diff --git a/Src/IronPython.Modules/fcntl.cs b/Src/IronPython.Modules/fcntl.cs index ba8c5f5e3..746e1b14f 100644 --- a/Src/IronPython.Modules/fcntl.cs +++ b/Src/IronPython.Modules/fcntl.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. @@ -44,16 +44,14 @@ a file object. public static int F_DUPFD => 0; - public static int F_DUPFD_CLOEXEC => RuntimeInformation.IsOSPlatform(OSPlatform.OSX) ? 67 : 1030; + [PythonHidden(PlatformID.MacOSX)] + [SupportedOSPlatform("linux")] + public static int F_DUPFD_CLOEXEC => 1030; [PythonHidden(PlatformID.MacOSX)] [SupportedOSPlatform("linux")] public static int F_EXLCK => 4; - [PythonHidden(PlatformID.Unix)] - [SupportedOSPlatform("macos")] - public static int F_FULLFSYNC => 51; - public static int F_GETFD => 1; public static int F_GETFL => 3; diff --git a/Src/Scripts/generate_os_codes.py b/Src/Scripts/generate_os_codes.py index 62e349d80..cb7d676e0 100644 --- a/Src/Scripts/generate_os_codes.py +++ b/Src/Scripts/generate_os_codes.py @@ -238,6 +238,9 @@ def generate_common_O_flags(cw): FD_commands_linux = {'F_ADD_SEALS': 1033, 'F_DUPFD': 0, 'F_DUPFD_CLOEXEC': 1030, 'F_EXLCK': 4, 'F_GETFD': 1, 'F_GETFL': 3, 'F_GETLEASE': 1025, 'F_GETLK': 5, 'F_GETLK64': 5, 'F_GETOWN': 9, 'F_GETPIPE_SZ': 1032, 'F_GETSIG': 11, 'F_GET_SEALS': 1034, 'F_NOTIFY': 1026, 'F_OFD_GETLK': 36, 'F_OFD_SETLK': 37, 'F_OFD_SETLKW': 38, 'F_RDLCK': 0, 'F_SEAL_GROW': 4, 'F_SEAL_SEAL': 1, 'F_SEAL_SHRINK': 2, 'F_SEAL_WRITE': 8, 'F_SETFD': 2, 'F_SETFL': 4, 'F_SETLEASE': 1024, 'F_SETLK': 6, 'F_SETLK64': 6, 'F_SETLKW': 7, 'F_SETLKW64': 7, 'F_SETOWN': 8, 'F_SETPIPE_SZ': 1031, 'F_SETSIG': 10, 'F_SHLCK': 8, 'F_UNLCK': 2, 'F_WRLCK': 1} # Python 3.7.0 [Clang 4.0.1 ] on darwin 24.2.0 FD_commands_darwin = {'F_DUPFD': 0, 'F_DUPFD_CLOEXEC': 67, 'F_FULLFSYNC': 51, 'F_GETFD': 1, 'F_GETFL': 3, 'F_GETLK': 7, 'F_GETOWN': 5, 'F_NOCACHE': 48, 'F_RDLCK': 1, 'F_SETFD': 2, 'F_SETFL': 4, 'F_SETLK': 8, 'F_SETLKW': 9, 'F_SETOWN': 6, 'F_UNLCK': 2, 'F_WRLCK': 3} +# Unsupported by Mono.Unix 7.1.0-final.1.21458.1 on darwin +FD_commands_darwin.pop('F_DUPFD_CLOEXEC') +FD_commands_darwin.pop('F_FULLFSYNC') def generate_FD_commands(cw): codeval = {}