Skip to content

Missing F_* constants in fcntl module on macOS #113092

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
ronaldoussoren opened this issue Dec 14, 2023 · 3 comments
Open

Missing F_* constants in fcntl module on macOS #113092

ronaldoussoren opened this issue Dec 14, 2023 · 3 comments
Assignees
Labels
OS-mac type-feature A feature request or enhancement

Comments

@ronaldoussoren
Copy link
Contributor

ronaldoussoren commented Dec 14, 2023

Feature or enhancement

Proposal:

There's a fairly large number of F_* macros that are present in sys/fcntl.h on macOS, but are not exposed in fcntlmodule.c:

  • F_SETLKWTIMEOUT
  • F_FLUSH_DATA
  • F_CHKCLEAN
  • F_PREALLOCATE
  • F_SETSIZE (No-op)
  • F_RDADVISE
  • F_RDAHEAD
  • F_LOG2PHYS
  • F_PATHPKG_CHECK (found no public use other than XNU kernel, can't get test to work)
  • F_FREEZE_FS
  • F_THAW_FS
  • F_GLOBAL_NOCACHE
  • F_ADDSIGS
  • F_ADDFILESIGS
  • F_NODIRECT
  • F_GETPROTECTIONCLASS
  • F_SETPROTECTIONCLASS
  • F_LOG2PHYS_EXT
  • F_GETLKPID
  • F_SETBACKINGSTORE
  • F_GETPATH_MTMINFO
  • F_GETCODEDIR
  • F_SETNOSIGPIPE
  • F_GETNOSIGPIPE
  • F_TRANSCODEKEY
  • F_SINGLE_WRITER
  • F_GETPROTECTIONLEVEL
  • F_FINDSIGS
  • F_ADDFILESIGS_FOR_DYLD_SIM
  • F_BARRIERFSYNC
  • F_OFD_SETLKWTIMEOUT
  • F_ADDFILESIGS_RETURN
  • F_CHECK_LV
  • F_PUNCHHOLE
  • F_TRIM_ACTIVE_FILE
  • F_SPECULATIVE_READ
  • F_GETPATH_NOFIRMLINK
  • F_ADDFILESIGS_INFO
  • F_ADDFILESUPPL
  • F_GETSIGSINFO
  • F_TRANSFEREXTENTS
  • F_ATTRIBUTION_TAG
  • F_ALLOCATECONTIG
  • F_ALLOCATEALL
  • F_ALLOCATEPERSIST
  • F_PEOFPOSMODE
  • F_VOLPOSMODE
  • F_CREATE_TAG
  • F_DELETE_TAG
  • F_QUERY_TAG

Fixing this issue requires more than just adding definitions for the macros above, but also needs new tests to check that these settings are actually usable.

Has this already been discussed elsewhere?

This is a minor feature, which does not need previous discussion elsewhere

Links to previous discussion of this feature:

No response

@serhiy-storchaka
Copy link
Member

#114322 includes some names from this long list which happens to exist on other platforms.

@ronaldoussoren
Copy link
Contributor Author

I thing I noticed while working on this: at least one of the constants is defined as requiring a buffer of PATH_MAX bytes to read the value (IIRC F_GETPATH). The buffer we're using is only 1K long.

@serhiy-storchaka
Copy link
Member

Some of constants require an access to a specific C struct. I am currently working on adding Python interface to such structs for Linux and FreeBSD, and it may results in some convenient helper C API. But this requires some preparatory steps (#114388, #114392, and some more).

It can help to do similar on macOS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OS-mac type-feature A feature request or enhancement
Projects
None yet
Development

No branches or pull requests

2 participants