Skip to content

Commit a7f7cc8

Browse files
committed
Remove commands unsupported by Mono.Unix
1 parent e55c278 commit a7f7cc8

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

Src/IronPython.Modules/fcntl.cs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Licensed to the .NET Foundation under one or more agreements.
1+
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the Apache 2.0 License.
33
// See the LICENSE file in the project root for more information.
44

@@ -44,16 +44,14 @@ a file object.
4444

4545
public static int F_DUPFD => 0;
4646

47-
public static int F_DUPFD_CLOEXEC => RuntimeInformation.IsOSPlatform(OSPlatform.OSX) ? 67 : 1030;
47+
[PythonHidden(PlatformID.MacOSX)]
48+
[SupportedOSPlatform("linux")]
49+
public static int F_DUPFD_CLOEXEC => 1030;
4850

4951
[PythonHidden(PlatformID.MacOSX)]
5052
[SupportedOSPlatform("linux")]
5153
public static int F_EXLCK => 4;
5254

53-
[PythonHidden(PlatformID.Unix)]
54-
[SupportedOSPlatform("macos")]
55-
public static int F_FULLFSYNC => 51;
56-
5755
public static int F_GETFD => 1;
5856

5957
public static int F_GETFL => 3;

Src/Scripts/generate_os_codes.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,9 @@ def generate_common_O_flags(cw):
238238
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}
239239
# Python 3.7.0 [Clang 4.0.1 ] on darwin 24.2.0
240240
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}
241+
# Unsupported by Mono.Unix 7.1.0-final.1.21458.1 on darwin
242+
FD_commands_darwin.pop('F_DUPFD_CLOEXEC')
243+
FD_commands_darwin.pop('F_FULLFSYNC')
241244

242245
def generate_FD_commands(cw):
243246
codeval = {}

0 commit comments

Comments
 (0)