diff --git a/Lib/os.py b/Lib/os.py --- a/Lib/os.py +++ b/Lib/os.py @@ -110,6 +110,7 @@ # Python uses fixed values for the SEEK_ constants; they are mapped # to native constants if necessary in posixmodule.c +# Other possible SEEK values are directly imported from posixmodule.c SEEK_SET = 0 SEEK_CUR = 1 SEEK_END = 2 diff --git a/Misc/NEWS b/Misc/NEWS --- a/Misc/NEWS +++ b/Misc/NEWS @@ -135,6 +135,8 @@ Extensions ---------- +- Issue #10142: Support for SEEK_HOLE/SEEK_DATA (for instance, under ZFS). + - Issue #10143: Update "os.pathconf" values. - Issue #6518: Support context manager protcol for ossaudiodev types. diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -8151,6 +8151,14 @@ if (ins(d, "O_EXLOCK", (long)O_EXLOCK)) return -1; #endif +/* Solaris */ +#ifdef SEEK_HOLE /* ZFS */ + if (ins(d, "SEEK_HOLE", (long)SEEK_HOLE)) return -1; +#endif +#ifdef SEEK_DATA /* ZFS */ + if (ins(d, "SEEK_DATA", (long)SEEK_DATA)) return -1; +#endif + /* MS Windows */ #ifdef O_NOINHERIT /* Don't inherit in child processes. */