Skip to content

Commit e9a3acd

Browse files
committed
gh-153711: Test availability for dup3() and pipe2() on iOS
1 parent 3874ad1 commit e9a3acd

4 files changed

Lines changed: 7 additions & 4 deletions

File tree

Doc/library/os.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1448,7 +1448,7 @@ or `the MSDN <https://msdn.microsoft.com/en-us/library/z0kc8e3z.aspx>`_ on Windo
14481448
Return a pair of file descriptors ``(r, w)`` usable for reading and writing,
14491449
respectively.
14501450

1451-
.. availability:: Unix, macOS >= 27.0, not WASI, not iOS.
1451+
.. availability:: Unix, macOS >= 27.0, iOS >= 27.0, not WASI.
14521452

14531453
.. versionadded:: 3.3
14541454

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
On iOS, add :func:`os.pipe2`, and use the syscalls :manpage:`pipe2 (2)` and
2+
:manpage:`dup3 (2)` internally, when available at both build-time and
3+
run-time.

Modules/posixmodule.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -504,8 +504,8 @@ static const unsigned int _Py_STATX_KNOWN = (STATX_BASIC_STATS | STATX_BTIME
504504
# define HAVE_MKFIFOAT_RUNTIME __builtin_available(macOS 13.0, iOS 16.0, tvOS 16.0, watchOS 9.0, *)
505505
# define HAVE_MKNODAT_RUNTIME __builtin_available(macOS 13.0, iOS 16.0, tvOS 16.0, watchOS 9.0, *)
506506
# define HAVE_PTSNAME_R_RUNTIME __builtin_available(macOS 10.13.4, iOS 11.3, tvOS 11.3, watchOS 4.3, *)
507-
# define HAVE_DUP3_RUNTIME __builtin_available(macOS 27.0, *)
508-
# define HAVE_PIPE2_RUNTIME __builtin_available(macOS 27.0, *)
507+
# define HAVE_DUP3_RUNTIME __builtin_available(macOS 27.0, iOS 27.0, tvOS 27.0, watchOS 27.0, visionOS 27.0, *)
508+
# define HAVE_PIPE2_RUNTIME __builtin_available(macOS 27.0, iOS 27.0, tvOS 27.0, watchOS 27.0, visionOS 27.0, *)
509509

510510
# define HAVE_POSIX_SPAWN_SETSID_RUNTIME __builtin_available(macOS 10.15, *)
511511

configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5540,7 +5540,7 @@ fi
55405540
# header definition prevents usage - autoconf doesn't use the headers), or
55415541
# raise an error if used at runtime. Force these symbols off.
55425542
if test "$ac_sys_system" != "iOS" ; then
5543-
AC_CHECK_FUNCS([dup3 getentropy getgroups pipe2 system])
5543+
AC_CHECK_FUNCS([getentropy getgroups system])
55445544
fi
55455545

55465546
AC_CHECK_DECL([dirfd],

0 commit comments

Comments
 (0)