python / cpython

The Python programming language
https://www.python.org
Other
62.34k stars 29.94k forks source link

Missing F_* constants in fcntl module on macOS #113092

Open ronaldoussoren opened 9 months ago

ronaldoussoren commented 9 months ago

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:

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 commented 8 months ago

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

ronaldoussoren commented 7 months ago

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 commented 7 months ago

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.