function int posix_spawnattr_setschedparam (posix_spawnattr_t*, const struct sched_param*)
function int posix_spawnattr_setschedpolicy (posix_spawnattr_t*, int)
function int posix_spawnattr_setsigmask (posix_spawnattr_t*, const sigset_t*)
+#if defined XOPEN2K24 || defined POSIX2024
+function int posix_spawn_file_actions_addchdir (posix_spawn_file_actions_t*, const char *)
+function int posix_spawn_file_actions_addfchdir (posix_spawn_file_actions_t*, int)
+#endif
function int posix_spawn_file_actions_addclose (posix_spawn_file_actions_t*, int)
function int posix_spawn_file_actions_adddup2 (posix_spawn_file_actions_t*, int, int)
function int posix_spawn_file_actions_addopen (posix_spawn_file_actions_t*, int, const char *, int, mode_t)
tst-rxspencer-no-utf8 \
tst-sched_getaffinity \
tst-spawn-chdir \
+ tst-spawn-chdir-posix \
tst-spawn4 \
tst-spawn5 \
tst-spawn6 \
int __fd, int __newfd)
__THROW __nonnull ((1));
+#ifdef __USE_XOPEN2K24XSI
+
+/* Add an action changing the directory to PATH during spawn. This
+ affects the subsequent file actions.
+ Alias of posix_spawn_file_actions_addchdir_np. */
+extern int __REDIRECT_NTH (posix_spawn_file_actions_addchdir,
+ (posix_spawn_file_actions_t * __restrict __actions,
+ const char *__restrict __path),
+ posix_spawn_file_actions_addchdir_np);
+
+/* Add an action changing the directory to FD during spawn. This
+ affects the subsequent file actions. FD is not duplicated and must
+ be open when the file action is executed.
+ Alias of posix_spawn_file_actions_addfchdir_np. */
+extern int __REDIRECT_NTH (posix_spawn_file_actions_addfchdir,
+ (posix_spawn_file_actions_t *, int __fd),
+ posix_spawn_file_actions_addfchdir_np);
+
+#endif /* __USE_XOPEN2K24XSI */
+
#ifdef __USE_MISC
/* Add an action changing the directory to PATH during spawn. This
affects the subsequent file actions. */
--- /dev/null
+#define USE_POSIX_ALIASES
+#include "tst-spawn-chdir.c"
{
TEST_COMPARE (posix_spawn_file_actions_addopen
(actions, tmpfd, path, O_DIRECTORY | O_RDONLY, 0), 0);
- TEST_COMPARE (posix_spawn_file_actions_addfchdir_np
- (actions, tmpfd), 0);
+
+#ifdef USE_POSIX_ALIASES
+ int ret = posix_spawn_file_actions_addfchdir (actions, tmpfd);
+#else
+ int ret = posix_spawn_file_actions_addfchdir_np (actions, tmpfd);
+#endif
+ TEST_COMPARE (ret, 0);
+
TEST_COMPARE (posix_spawn_file_actions_addclose (actions, tmpfd), 0);
}
else
- TEST_COMPARE (posix_spawn_file_actions_addchdir_np (actions, path), 0);
+ {
+#ifdef USE_POSIX_ALIASES
+ int ret = posix_spawn_file_actions_addchdir (actions, path);
+#else
+ int ret = posix_spawn_file_actions_addchdir_np (actions, path);
+#endif
+ TEST_COMPARE (ret, 0);
+ }
}
static int