Revert "Import posix_spawn from Gnulib."
This reverts commit 3ba34141da
.
It breaks the MinGW build and should be first tested on a
branch.
This commit is contained in:
parent
e387371497
commit
ecf84a22ee
27 changed files with 1 additions and 3612 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -65,9 +65,7 @@ lib/ieee754.h
|
|||
lib/inttypes.h
|
||||
lib/libgnu.a
|
||||
lib/limits.h
|
||||
lib/sched.h
|
||||
lib/signal.h
|
||||
lib/spawn.h
|
||||
lib/std*.h
|
||||
!lib/std*.in.h
|
||||
!lib/stdio-impl.h
|
||||
|
|
|
@ -39,14 +39,7 @@ GNULIB_MODULES='
|
|||
getloadavg getopt-gnu getrandom gettime gettimeofday gitlog-to-changelog
|
||||
ieee754-h ignore-value intprops largefile libgmp lstat
|
||||
manywarnings memmem-simple mempcpy memrchr minmax mkostemp mktime nstrftime
|
||||
pathmax pipe2
|
||||
posix_spawn posix_spawn_file_actions_addchdir
|
||||
posix_spawn_file_actions_adddup2 posix_spawn_file_actions_destroy
|
||||
posix_spawn_file_actions_init
|
||||
posix_spawnattr_destroy posix_spawnattr_init
|
||||
posix_spawnattr_setflags posix_spawnattr_setpgroup
|
||||
posix_spawnattr_setsigdefault posix_spawnattr_setsigmask
|
||||
pselect pthread_sigmask
|
||||
pathmax pipe2 pselect pthread_sigmask
|
||||
qcopy-acl readlink readlinkat regex
|
||||
sig2str sigdescr_np socklen stat-time std-gnu11 stdalign stddef stdio
|
||||
stpcpy strnlen strtoimax symlink sys_stat sys_time
|
||||
|
|
302
lib/gnulib.mk.in
302
lib/gnulib.mk.in
|
@ -130,17 +130,6 @@
|
|||
# nstrftime \
|
||||
# pathmax \
|
||||
# pipe2 \
|
||||
# posix_spawn \
|
||||
# posix_spawn_file_actions_addchdir \
|
||||
# posix_spawn_file_actions_adddup2 \
|
||||
# posix_spawn_file_actions_destroy \
|
||||
# posix_spawn_file_actions_init \
|
||||
# posix_spawnattr_destroy \
|
||||
# posix_spawnattr_init \
|
||||
# posix_spawnattr_setflags \
|
||||
# posix_spawnattr_setpgroup \
|
||||
# posix_spawnattr_setsigdefault \
|
||||
# posix_spawnattr_setsigmask \
|
||||
# pselect \
|
||||
# pthread_sigmask \
|
||||
# qcopy-acl \
|
||||
|
@ -404,29 +393,6 @@ GNULIB_PIPE2 = @GNULIB_PIPE2@
|
|||
GNULIB_POPEN = @GNULIB_POPEN@
|
||||
GNULIB_POSIX_MEMALIGN = @GNULIB_POSIX_MEMALIGN@
|
||||
GNULIB_POSIX_OPENPT = @GNULIB_POSIX_OPENPT@
|
||||
GNULIB_POSIX_SPAWN = @GNULIB_POSIX_SPAWN@
|
||||
GNULIB_POSIX_SPAWNATTR_DESTROY = @GNULIB_POSIX_SPAWNATTR_DESTROY@
|
||||
GNULIB_POSIX_SPAWNATTR_GETFLAGS = @GNULIB_POSIX_SPAWNATTR_GETFLAGS@
|
||||
GNULIB_POSIX_SPAWNATTR_GETPGROUP = @GNULIB_POSIX_SPAWNATTR_GETPGROUP@
|
||||
GNULIB_POSIX_SPAWNATTR_GETSCHEDPARAM = @GNULIB_POSIX_SPAWNATTR_GETSCHEDPARAM@
|
||||
GNULIB_POSIX_SPAWNATTR_GETSCHEDPOLICY = @GNULIB_POSIX_SPAWNATTR_GETSCHEDPOLICY@
|
||||
GNULIB_POSIX_SPAWNATTR_GETSIGDEFAULT = @GNULIB_POSIX_SPAWNATTR_GETSIGDEFAULT@
|
||||
GNULIB_POSIX_SPAWNATTR_GETSIGMASK = @GNULIB_POSIX_SPAWNATTR_GETSIGMASK@
|
||||
GNULIB_POSIX_SPAWNATTR_INIT = @GNULIB_POSIX_SPAWNATTR_INIT@
|
||||
GNULIB_POSIX_SPAWNATTR_SETFLAGS = @GNULIB_POSIX_SPAWNATTR_SETFLAGS@
|
||||
GNULIB_POSIX_SPAWNATTR_SETPGROUP = @GNULIB_POSIX_SPAWNATTR_SETPGROUP@
|
||||
GNULIB_POSIX_SPAWNATTR_SETSCHEDPARAM = @GNULIB_POSIX_SPAWNATTR_SETSCHEDPARAM@
|
||||
GNULIB_POSIX_SPAWNATTR_SETSCHEDPOLICY = @GNULIB_POSIX_SPAWNATTR_SETSCHEDPOLICY@
|
||||
GNULIB_POSIX_SPAWNATTR_SETSIGDEFAULT = @GNULIB_POSIX_SPAWNATTR_SETSIGDEFAULT@
|
||||
GNULIB_POSIX_SPAWNATTR_SETSIGMASK = @GNULIB_POSIX_SPAWNATTR_SETSIGMASK@
|
||||
GNULIB_POSIX_SPAWNP = @GNULIB_POSIX_SPAWNP@
|
||||
GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR = @GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR@
|
||||
GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE = @GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE@
|
||||
GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2 = @GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2@
|
||||
GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR = @GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR@
|
||||
GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN = @GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN@
|
||||
GNULIB_POSIX_SPAWN_FILE_ACTIONS_DESTROY = @GNULIB_POSIX_SPAWN_FILE_ACTIONS_DESTROY@
|
||||
GNULIB_POSIX_SPAWN_FILE_ACTIONS_INIT = @GNULIB_POSIX_SPAWN_FILE_ACTIONS_INIT@
|
||||
GNULIB_PREAD = @GNULIB_PREAD@
|
||||
GNULIB_PRINTF = @GNULIB_PRINTF@
|
||||
GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@
|
||||
|
@ -459,7 +425,6 @@ GNULIB_RMDIR = @GNULIB_RMDIR@
|
|||
GNULIB_RPMATCH = @GNULIB_RPMATCH@
|
||||
GNULIB_SCANDIR = @GNULIB_SCANDIR@
|
||||
GNULIB_SCANF = @GNULIB_SCANF@
|
||||
GNULIB_SCHED_YIELD = @GNULIB_SCHED_YIELD@
|
||||
GNULIB_SECURE_GETENV = @GNULIB_SECURE_GETENV@
|
||||
GNULIB_SELECT = @GNULIB_SELECT@
|
||||
GNULIB_SETENV = @GNULIB_SETENV@
|
||||
|
@ -669,11 +634,6 @@ HAVE_POPEN = @HAVE_POPEN@
|
|||
HAVE_POSIX_MEMALIGN = @HAVE_POSIX_MEMALIGN@
|
||||
HAVE_POSIX_OPENPT = @HAVE_POSIX_OPENPT@
|
||||
HAVE_POSIX_SIGNALBLOCKING = @HAVE_POSIX_SIGNALBLOCKING@
|
||||
HAVE_POSIX_SPAWN = @HAVE_POSIX_SPAWN@
|
||||
HAVE_POSIX_SPAWNATTR_T = @HAVE_POSIX_SPAWNATTR_T@
|
||||
HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR = @HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR@
|
||||
HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR = @HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR@
|
||||
HAVE_POSIX_SPAWN_FILE_ACTIONS_T = @HAVE_POSIX_SPAWN_FILE_ACTIONS_T@
|
||||
HAVE_PREAD = @HAVE_PREAD@
|
||||
HAVE_PSELECT = @HAVE_PSELECT@
|
||||
HAVE_PTHREAD_SIGMASK = @HAVE_PTHREAD_SIGMASK@
|
||||
|
@ -695,8 +655,6 @@ HAVE_RENAMEAT = @HAVE_RENAMEAT@
|
|||
HAVE_REWINDDIR = @HAVE_REWINDDIR@
|
||||
HAVE_RPMATCH = @HAVE_RPMATCH@
|
||||
HAVE_SCANDIR = @HAVE_SCANDIR@
|
||||
HAVE_SCHED_H = @HAVE_SCHED_H@
|
||||
HAVE_SCHED_YIELD = @HAVE_SCHED_YIELD@
|
||||
HAVE_SECURE_GETENV = @HAVE_SECURE_GETENV@
|
||||
HAVE_SETENV = @HAVE_SETENV@
|
||||
HAVE_SETHOSTNAME = @HAVE_SETHOSTNAME@
|
||||
|
@ -711,7 +669,6 @@ HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@
|
|||
HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@
|
||||
HAVE_SIGSET_T = @HAVE_SIGSET_T@
|
||||
HAVE_SLEEP = @HAVE_SLEEP@
|
||||
HAVE_SPAWN_H = @HAVE_SPAWN_H@
|
||||
HAVE_STDINT_H = @HAVE_STDINT_H@
|
||||
HAVE_STPCPY = @HAVE_STPCPY@
|
||||
HAVE_STPNCPY = @HAVE_STPNCPY@
|
||||
|
@ -726,7 +683,6 @@ HAVE_STRTOLD = @HAVE_STRTOLD@
|
|||
HAVE_STRTOLL = @HAVE_STRTOLL@
|
||||
HAVE_STRTOULL = @HAVE_STRTOULL@
|
||||
HAVE_STRUCT_RANDOM_DATA = @HAVE_STRUCT_RANDOM_DATA@
|
||||
HAVE_STRUCT_SCHED_PARAM = @HAVE_STRUCT_SCHED_PARAM@
|
||||
HAVE_STRUCT_SIGACTION_SA_SIGACTION = @HAVE_STRUCT_SIGACTION_SA_SIGACTION@
|
||||
HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@
|
||||
HAVE_STRVERSCMP = @HAVE_STRVERSCMP@
|
||||
|
@ -826,7 +782,6 @@ LIB_EACCESS = @LIB_EACCESS@
|
|||
LIB_EXECINFO = @LIB_EXECINFO@
|
||||
LIB_GETRANDOM = @LIB_GETRANDOM@
|
||||
LIB_MATH = @LIB_MATH@
|
||||
LIB_POSIX_SPAWN = @LIB_POSIX_SPAWN@
|
||||
LIB_PTHREAD = @LIB_PTHREAD@
|
||||
LIB_PTHREAD_SIGMASK = @LIB_PTHREAD_SIGMASK@
|
||||
LIB_TIMER_TIME = @LIB_TIMER_TIME@
|
||||
|
@ -850,9 +805,7 @@ NEXT_AS_FIRST_DIRECTIVE_FCNTL_H = @NEXT_AS_FIRST_DIRECTIVE_FCNTL_H@
|
|||
NEXT_AS_FIRST_DIRECTIVE_GETOPT_H = @NEXT_AS_FIRST_DIRECTIVE_GETOPT_H@
|
||||
NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H = @NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H@
|
||||
NEXT_AS_FIRST_DIRECTIVE_LIMITS_H = @NEXT_AS_FIRST_DIRECTIVE_LIMITS_H@
|
||||
NEXT_AS_FIRST_DIRECTIVE_SCHED_H = @NEXT_AS_FIRST_DIRECTIVE_SCHED_H@
|
||||
NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H = @NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H@
|
||||
NEXT_AS_FIRST_DIRECTIVE_SPAWN_H = @NEXT_AS_FIRST_DIRECTIVE_SPAWN_H@
|
||||
NEXT_AS_FIRST_DIRECTIVE_STDDEF_H = @NEXT_AS_FIRST_DIRECTIVE_STDDEF_H@
|
||||
NEXT_AS_FIRST_DIRECTIVE_STDINT_H = @NEXT_AS_FIRST_DIRECTIVE_STDINT_H@
|
||||
NEXT_AS_FIRST_DIRECTIVE_STDIO_H = @NEXT_AS_FIRST_DIRECTIVE_STDIO_H@
|
||||
|
@ -871,9 +824,7 @@ NEXT_FCNTL_H = @NEXT_FCNTL_H@
|
|||
NEXT_GETOPT_H = @NEXT_GETOPT_H@
|
||||
NEXT_INTTYPES_H = @NEXT_INTTYPES_H@
|
||||
NEXT_LIMITS_H = @NEXT_LIMITS_H@
|
||||
NEXT_SCHED_H = @NEXT_SCHED_H@
|
||||
NEXT_SIGNAL_H = @NEXT_SIGNAL_H@
|
||||
NEXT_SPAWN_H = @NEXT_SPAWN_H@
|
||||
NEXT_STDDEF_H = @NEXT_STDDEF_H@
|
||||
NEXT_STDINT_H = @NEXT_STDINT_H@
|
||||
NEXT_STDIO_H = @NEXT_STDIO_H@
|
||||
|
@ -995,12 +946,6 @@ REPLACE_OPENDIR = @REPLACE_OPENDIR@
|
|||
REPLACE_PERROR = @REPLACE_PERROR@
|
||||
REPLACE_POPEN = @REPLACE_POPEN@
|
||||
REPLACE_POSIX_MEMALIGN = @REPLACE_POSIX_MEMALIGN@
|
||||
REPLACE_POSIX_SPAWN = @REPLACE_POSIX_SPAWN@
|
||||
REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR = @REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR@
|
||||
REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE = @REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE@
|
||||
REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2 = @REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2@
|
||||
REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR = @REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR@
|
||||
REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN = @REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN@
|
||||
REPLACE_PREAD = @REPLACE_PREAD@
|
||||
REPLACE_PRINTF = @REPLACE_PRINTF@
|
||||
REPLACE_PSELECT = @REPLACE_PSELECT@
|
||||
|
@ -1022,7 +967,6 @@ REPLACE_REMOVE = @REPLACE_REMOVE@
|
|||
REPLACE_RENAME = @REPLACE_RENAME@
|
||||
REPLACE_RENAMEAT = @REPLACE_RENAMEAT@
|
||||
REPLACE_RMDIR = @REPLACE_RMDIR@
|
||||
REPLACE_SCHED_YIELD = @REPLACE_SCHED_YIELD@
|
||||
REPLACE_SELECT = @REPLACE_SELECT@
|
||||
REPLACE_SETENV = @REPLACE_SETENV@
|
||||
REPLACE_SETSTATE = @REPLACE_SETSTATE@
|
||||
|
@ -1164,13 +1108,11 @@ gamegroup = @gamegroup@
|
|||
gameuser = @gameuser@
|
||||
gl_GNULIB_ENABLED_03e0aaad4cb89ca757653bd367a6ccb7 = @gl_GNULIB_ENABLED_03e0aaad4cb89ca757653bd367a6ccb7@
|
||||
gl_GNULIB_ENABLED_260941c0e5dc67ec9e87d1fb321c300b = @gl_GNULIB_ENABLED_260941c0e5dc67ec9e87d1fb321c300b@
|
||||
gl_GNULIB_ENABLED_332607f759618fb73dfc3076748afea7 = @gl_GNULIB_ENABLED_332607f759618fb73dfc3076748afea7@
|
||||
gl_GNULIB_ENABLED_5264294aa0a5557541b53c8c741f7f31 = @gl_GNULIB_ENABLED_5264294aa0a5557541b53c8c741f7f31@
|
||||
gl_GNULIB_ENABLED_6099e9737f757db36c47fa9d9f02e88c = @gl_GNULIB_ENABLED_6099e9737f757db36c47fa9d9f02e88c@
|
||||
gl_GNULIB_ENABLED_682e609604ccaac6be382e4ee3a4eaec = @gl_GNULIB_ENABLED_682e609604ccaac6be382e4ee3a4eaec@
|
||||
gl_GNULIB_ENABLED_a9786850e999ae65a836a6041e8e5ed1 = @gl_GNULIB_ENABLED_a9786850e999ae65a836a6041e8e5ed1@
|
||||
gl_GNULIB_ENABLED_be453cec5eecf5731a274f2de7f2db36 = @gl_GNULIB_ENABLED_be453cec5eecf5731a274f2de7f2db36@
|
||||
gl_GNULIB_ENABLED_cdeb0f2aaf9d280baa6526bfa1b07f70 = @gl_GNULIB_ENABLED_cdeb0f2aaf9d280baa6526bfa1b07f70@
|
||||
gl_GNULIB_ENABLED_cloexec = @gl_GNULIB_ENABLED_cloexec@
|
||||
gl_GNULIB_ENABLED_dirfd = @gl_GNULIB_ENABLED_dirfd@
|
||||
gl_GNULIB_ENABLED_ef07dc4b3077c11ea9cef586db4e5955 = @gl_GNULIB_ENABLED_ef07dc4b3077c11ea9cef586db4e5955@
|
||||
|
@ -1182,7 +1124,6 @@ gl_GNULIB_ENABLED_lchmod = @gl_GNULIB_ENABLED_lchmod@
|
|||
gl_GNULIB_ENABLED_open = @gl_GNULIB_ENABLED_open@
|
||||
gl_GNULIB_ENABLED_rawmemchr = @gl_GNULIB_ENABLED_rawmemchr@
|
||||
gl_GNULIB_ENABLED_scratch_buffer = @gl_GNULIB_ENABLED_scratch_buffer@
|
||||
gl_GNULIB_ENABLED_strchrnul = @gl_GNULIB_ENABLED_strchrnul@
|
||||
gl_GNULIB_ENABLED_strtoll = @gl_GNULIB_ENABLED_strtoll@
|
||||
gl_GNULIB_ENABLED_utimens = @gl_GNULIB_ENABLED_utimens@
|
||||
gl_LIBOBJS = @gl_LIBOBJS@
|
||||
|
@ -2329,140 +2270,6 @@ libgnu_a_SOURCES += pipe2.c
|
|||
endif
|
||||
## end gnulib module pipe2
|
||||
|
||||
## begin gnulib module posix_spawn
|
||||
ifeq (,$(OMIT_GNULIB_MODULE_posix_spawn))
|
||||
|
||||
|
||||
EXTRA_DIST += spawn.c
|
||||
|
||||
EXTRA_libgnu_a_SOURCES += spawn.c
|
||||
|
||||
endif
|
||||
## end gnulib module posix_spawn
|
||||
|
||||
## begin gnulib module posix_spawn-internal
|
||||
ifeq (,$(OMIT_GNULIB_MODULE_posix_spawn-internal))
|
||||
|
||||
ifneq (,$(gl_GNULIB_ENABLED_332607f759618fb73dfc3076748afea7))
|
||||
|
||||
endif
|
||||
EXTRA_DIST += spawn_int.h spawni.c
|
||||
|
||||
EXTRA_libgnu_a_SOURCES += spawni.c
|
||||
|
||||
endif
|
||||
## end gnulib module posix_spawn-internal
|
||||
|
||||
## begin gnulib module posix_spawn_file_actions_addchdir
|
||||
ifeq (,$(OMIT_GNULIB_MODULE_posix_spawn_file_actions_addchdir))
|
||||
|
||||
|
||||
EXTRA_DIST += spawn_faction_addchdir.c spawn_int.h
|
||||
|
||||
EXTRA_libgnu_a_SOURCES += spawn_faction_addchdir.c
|
||||
|
||||
endif
|
||||
## end gnulib module posix_spawn_file_actions_addchdir
|
||||
|
||||
## begin gnulib module posix_spawn_file_actions_adddup2
|
||||
ifeq (,$(OMIT_GNULIB_MODULE_posix_spawn_file_actions_adddup2))
|
||||
|
||||
|
||||
EXTRA_DIST += spawn_faction_adddup2.c spawn_int.h
|
||||
|
||||
EXTRA_libgnu_a_SOURCES += spawn_faction_adddup2.c
|
||||
|
||||
endif
|
||||
## end gnulib module posix_spawn_file_actions_adddup2
|
||||
|
||||
## begin gnulib module posix_spawn_file_actions_destroy
|
||||
ifeq (,$(OMIT_GNULIB_MODULE_posix_spawn_file_actions_destroy))
|
||||
|
||||
|
||||
EXTRA_DIST += spawn_faction_destroy.c
|
||||
|
||||
EXTRA_libgnu_a_SOURCES += spawn_faction_destroy.c
|
||||
|
||||
endif
|
||||
## end gnulib module posix_spawn_file_actions_destroy
|
||||
|
||||
## begin gnulib module posix_spawn_file_actions_init
|
||||
ifeq (,$(OMIT_GNULIB_MODULE_posix_spawn_file_actions_init))
|
||||
|
||||
|
||||
EXTRA_DIST += spawn_faction_init.c spawn_int.h
|
||||
|
||||
EXTRA_libgnu_a_SOURCES += spawn_faction_init.c
|
||||
|
||||
endif
|
||||
## end gnulib module posix_spawn_file_actions_init
|
||||
|
||||
## begin gnulib module posix_spawnattr_destroy
|
||||
ifeq (,$(OMIT_GNULIB_MODULE_posix_spawnattr_destroy))
|
||||
|
||||
|
||||
EXTRA_DIST += spawnattr_destroy.c
|
||||
|
||||
EXTRA_libgnu_a_SOURCES += spawnattr_destroy.c
|
||||
|
||||
endif
|
||||
## end gnulib module posix_spawnattr_destroy
|
||||
|
||||
## begin gnulib module posix_spawnattr_init
|
||||
ifeq (,$(OMIT_GNULIB_MODULE_posix_spawnattr_init))
|
||||
|
||||
|
||||
EXTRA_DIST += spawnattr_init.c
|
||||
|
||||
EXTRA_libgnu_a_SOURCES += spawnattr_init.c
|
||||
|
||||
endif
|
||||
## end gnulib module posix_spawnattr_init
|
||||
|
||||
## begin gnulib module posix_spawnattr_setflags
|
||||
ifeq (,$(OMIT_GNULIB_MODULE_posix_spawnattr_setflags))
|
||||
|
||||
|
||||
EXTRA_DIST += spawnattr_setflags.c
|
||||
|
||||
EXTRA_libgnu_a_SOURCES += spawnattr_setflags.c
|
||||
|
||||
endif
|
||||
## end gnulib module posix_spawnattr_setflags
|
||||
|
||||
## begin gnulib module posix_spawnattr_setpgroup
|
||||
ifeq (,$(OMIT_GNULIB_MODULE_posix_spawnattr_setpgroup))
|
||||
|
||||
|
||||
EXTRA_DIST += spawnattr_setpgroup.c
|
||||
|
||||
EXTRA_libgnu_a_SOURCES += spawnattr_setpgroup.c
|
||||
|
||||
endif
|
||||
## end gnulib module posix_spawnattr_setpgroup
|
||||
|
||||
## begin gnulib module posix_spawnattr_setsigdefault
|
||||
ifeq (,$(OMIT_GNULIB_MODULE_posix_spawnattr_setsigdefault))
|
||||
|
||||
|
||||
EXTRA_DIST += spawnattr_setdefault.c
|
||||
|
||||
EXTRA_libgnu_a_SOURCES += spawnattr_setdefault.c
|
||||
|
||||
endif
|
||||
## end gnulib module posix_spawnattr_setsigdefault
|
||||
|
||||
## begin gnulib module posix_spawnattr_setsigmask
|
||||
ifeq (,$(OMIT_GNULIB_MODULE_posix_spawnattr_setsigmask))
|
||||
|
||||
|
||||
EXTRA_DIST += spawnattr_setsigmask.c
|
||||
|
||||
EXTRA_libgnu_a_SOURCES += spawnattr_setsigmask.c
|
||||
|
||||
endif
|
||||
## end gnulib module posix_spawnattr_setsigmask
|
||||
|
||||
## begin gnulib module pselect
|
||||
ifeq (,$(OMIT_GNULIB_MODULE_pselect))
|
||||
|
||||
|
@ -2550,39 +2357,6 @@ EXTRA_DIST += root-uid.h
|
|||
endif
|
||||
## end gnulib module root-uid
|
||||
|
||||
## begin gnulib module sched
|
||||
ifeq (,$(OMIT_GNULIB_MODULE_sched))
|
||||
|
||||
BUILT_SOURCES += sched.h
|
||||
|
||||
# We need the following in order to create a replacement for <sched.h> when
|
||||
# the system doesn't have one.
|
||||
sched.h: sched.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H)
|
||||
$(AM_V_GEN)rm -f $@-t $@ && \
|
||||
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
|
||||
sed -e 's|@''GUARD_PREFIX''@|GL|g' \
|
||||
-e 's|@''HAVE_SCHED_H''@|$(HAVE_SCHED_H)|g' \
|
||||
-e 's|@''HAVE_SYS_CDEFS_H''@|$(HAVE_SYS_CDEFS_H)|g' \
|
||||
-e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
|
||||
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
|
||||
-e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
|
||||
-e 's|@''NEXT_SCHED_H''@|$(NEXT_SCHED_H)|g' \
|
||||
-e 's|@''HAVE_STRUCT_SCHED_PARAM''@|$(HAVE_STRUCT_SCHED_PARAM)|g' \
|
||||
-e 's/@''GNULIB_SCHED_YIELD''@/$(GNULIB_SCHED_YIELD)/g' \
|
||||
-e 's|@''HAVE_SCHED_YIELD''@|$(HAVE_SCHED_YIELD)|g' \
|
||||
-e 's|@''REPLACE_SCHED_YIELD''@|$(REPLACE_SCHED_YIELD)|g' \
|
||||
-e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
|
||||
-e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
|
||||
< $(srcdir)/sched.in.h; \
|
||||
} > $@-t && \
|
||||
mv $@-t $@
|
||||
MOSTLYCLEANFILES += sched.h sched.h-t
|
||||
|
||||
EXTRA_DIST += sched.in.h
|
||||
|
||||
endif
|
||||
## end gnulib module sched
|
||||
|
||||
## begin gnulib module scratch_buffer
|
||||
ifeq (,$(OMIT_GNULIB_MODULE_scratch_buffer))
|
||||
|
||||
|
@ -2717,69 +2491,6 @@ EXTRA_DIST += warn-on-use.h
|
|||
endif
|
||||
## end gnulib module snippet/warn-on-use
|
||||
|
||||
## begin gnulib module spawn
|
||||
ifeq (,$(OMIT_GNULIB_MODULE_spawn))
|
||||
|
||||
BUILT_SOURCES += spawn.h
|
||||
|
||||
# We need the following in order to create a replacement for <spawn.h> when
|
||||
# the system doesn't have one.
|
||||
spawn.h: spawn.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
|
||||
$(AM_V_GEN)rm -f $@-t $@ && \
|
||||
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
|
||||
sed -e 's|@''GUARD_PREFIX''@|GL|g' \
|
||||
-e 's|@''HAVE_SPAWN_H''@|$(HAVE_SPAWN_H)|g' \
|
||||
-e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
|
||||
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
|
||||
-e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
|
||||
-e 's|@''NEXT_SPAWN_H''@|$(NEXT_SPAWN_H)|g' \
|
||||
-e 's/@''GNULIB_POSIX_SPAWN''@/$(GNULIB_POSIX_SPAWN)/g' \
|
||||
-e 's/@''GNULIB_POSIX_SPAWNP''@/$(GNULIB_POSIX_SPAWNP)/g' \
|
||||
-e 's/@''GNULIB_POSIX_SPAWN_FILE_ACTIONS_INIT''@/$(GNULIB_POSIX_SPAWN_FILE_ACTIONS_INIT)/g' \
|
||||
-e 's/@''GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR''@/$(GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR)/g' \
|
||||
-e 's/@''GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE''@/$(GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE)/g' \
|
||||
-e 's/@''GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2''@/$(GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2)/g' \
|
||||
-e 's/@''GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR''@/$(GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR)/g' \
|
||||
-e 's/@''GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN''@/$(GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN)/g' \
|
||||
-e 's/@''GNULIB_POSIX_SPAWN_FILE_ACTIONS_DESTROY''@/$(GNULIB_POSIX_SPAWN_FILE_ACTIONS_DESTROY)/g' \
|
||||
-e 's/@''GNULIB_POSIX_SPAWNATTR_INIT''@/$(GNULIB_POSIX_SPAWNATTR_INIT)/g' \
|
||||
-e 's/@''GNULIB_POSIX_SPAWNATTR_GETFLAGS''@/$(GNULIB_POSIX_SPAWNATTR_GETFLAGS)/g' \
|
||||
-e 's/@''GNULIB_POSIX_SPAWNATTR_SETFLAGS''@/$(GNULIB_POSIX_SPAWNATTR_SETFLAGS)/g' \
|
||||
-e 's/@''GNULIB_POSIX_SPAWNATTR_GETPGROUP''@/$(GNULIB_POSIX_SPAWNATTR_GETPGROUP)/g' \
|
||||
-e 's/@''GNULIB_POSIX_SPAWNATTR_SETPGROUP''@/$(GNULIB_POSIX_SPAWNATTR_SETPGROUP)/g' \
|
||||
-e 's/@''GNULIB_POSIX_SPAWNATTR_GETSCHEDPARAM''@/$(GNULIB_POSIX_SPAWNATTR_GETSCHEDPARAM)/g' \
|
||||
-e 's/@''GNULIB_POSIX_SPAWNATTR_SETSCHEDPARAM''@/$(GNULIB_POSIX_SPAWNATTR_SETSCHEDPARAM)/g' \
|
||||
-e 's/@''GNULIB_POSIX_SPAWNATTR_GETSCHEDPOLICY''@/$(GNULIB_POSIX_SPAWNATTR_GETSCHEDPOLICY)/g' \
|
||||
-e 's/@''GNULIB_POSIX_SPAWNATTR_SETSCHEDPOLICY''@/$(GNULIB_POSIX_SPAWNATTR_SETSCHEDPOLICY)/g' \
|
||||
-e 's/@''GNULIB_POSIX_SPAWNATTR_GETSIGDEFAULT''@/$(GNULIB_POSIX_SPAWNATTR_GETSIGDEFAULT)/g' \
|
||||
-e 's/@''GNULIB_POSIX_SPAWNATTR_SETSIGDEFAULT''@/$(GNULIB_POSIX_SPAWNATTR_SETSIGDEFAULT)/g' \
|
||||
-e 's/@''GNULIB_POSIX_SPAWNATTR_GETSIGMASK''@/$(GNULIB_POSIX_SPAWNATTR_GETSIGMASK)/g' \
|
||||
-e 's/@''GNULIB_POSIX_SPAWNATTR_SETSIGMASK''@/$(GNULIB_POSIX_SPAWNATTR_SETSIGMASK)/g' \
|
||||
-e 's/@''GNULIB_POSIX_SPAWNATTR_DESTROY''@/$(GNULIB_POSIX_SPAWNATTR_DESTROY)/g' \
|
||||
-e 's|@''HAVE_POSIX_SPAWN''@|$(HAVE_POSIX_SPAWN)|g' \
|
||||
-e 's|@''HAVE_POSIX_SPAWNATTR_T''@|$(HAVE_POSIX_SPAWNATTR_T)|g' \
|
||||
-e 's|@''HAVE_POSIX_SPAWN_FILE_ACTIONS_T''@|$(HAVE_POSIX_SPAWN_FILE_ACTIONS_T)|g' \
|
||||
-e 's|@''HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR''@|$(HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR)|g' \
|
||||
-e 's|@''HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR''@|$(HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR)|g' \
|
||||
-e 's|@''REPLACE_POSIX_SPAWN''@|$(REPLACE_POSIX_SPAWN)|g' \
|
||||
-e 's|@''REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR''@|$(REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR)|g' \
|
||||
-e 's|@''REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE''@|$(REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE)|g' \
|
||||
-e 's|@''REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2''@|$(REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2)|g' \
|
||||
-e 's|@''REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR''@|$(REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR)|g' \
|
||||
-e 's|@''REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN''@|$(REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN)|g' \
|
||||
-e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
|
||||
-e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
|
||||
-e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
|
||||
< $(srcdir)/spawn.in.h; \
|
||||
} > $@-t && \
|
||||
mv $@-t $@
|
||||
MOSTLYCLEANFILES += spawn.h spawn.h-t
|
||||
|
||||
EXTRA_DIST += spawn.in.h
|
||||
|
||||
endif
|
||||
## end gnulib module spawn
|
||||
|
||||
## begin gnulib module stat-time
|
||||
ifeq (,$(OMIT_GNULIB_MODULE_stat-time))
|
||||
|
||||
|
@ -3174,19 +2885,6 @@ EXTRA_libgnu_a_SOURCES += stpcpy.c
|
|||
endif
|
||||
## end gnulib module stpcpy
|
||||
|
||||
## begin gnulib module strchrnul
|
||||
ifeq (,$(OMIT_GNULIB_MODULE_strchrnul))
|
||||
|
||||
ifneq (,$(gl_GNULIB_ENABLED_strchrnul))
|
||||
|
||||
endif
|
||||
EXTRA_DIST += strchrnul.c strchrnul.valgrind
|
||||
|
||||
EXTRA_libgnu_a_SOURCES += strchrnul.c
|
||||
|
||||
endif
|
||||
## end gnulib module strchrnul
|
||||
|
||||
## begin gnulib module string
|
||||
ifeq (,$(OMIT_GNULIB_MODULE_string))
|
||||
|
||||
|
|
|
@ -1,99 +0,0 @@
|
|||
/* A GNU-like <sched.h>.
|
||||
Copyright (C) 2008-2020 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _@GUARD_PREFIX@_SCHED_H
|
||||
|
||||
#if __GNUC__ >= 3
|
||||
@PRAGMA_SYSTEM_HEADER@
|
||||
#endif
|
||||
@PRAGMA_COLUMNS@
|
||||
|
||||
/* The include_next requires a split double-inclusion guard. */
|
||||
#if @HAVE_SCHED_H@
|
||||
# if @HAVE_SYS_CDEFS_H@
|
||||
# include <sys/cdefs.h>
|
||||
# endif
|
||||
# @INCLUDE_NEXT@ @NEXT_SCHED_H@
|
||||
#endif
|
||||
|
||||
#ifndef _@GUARD_PREFIX@_SCHED_H
|
||||
#define _@GUARD_PREFIX@_SCHED_H
|
||||
|
||||
/* Get pid_t.
|
||||
This is needed on glibc 2.11 (see
|
||||
glibc bug <https://sourceware.org/bugzilla/show_bug.cgi?id=13198>)
|
||||
and Mac OS X 10.5. */
|
||||
#include <sys/types.h>
|
||||
|
||||
#ifdef __KLIBC__
|
||||
/* On OS/2 kLIBC, struct sched_param is in spawn.h. */
|
||||
# include <spawn.h>
|
||||
#endif
|
||||
|
||||
#ifdef __VMS
|
||||
/* On OpenVMS, struct sched_param is in <pthread.h>. */
|
||||
# include <pthread.h>
|
||||
#endif
|
||||
|
||||
/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
|
||||
|
||||
/* The definition of _GL_WARN_ON_USE is copied here. */
|
||||
|
||||
#if !@HAVE_STRUCT_SCHED_PARAM@
|
||||
|
||||
# if !GNULIB_defined_struct_sched_param
|
||||
struct sched_param
|
||||
{
|
||||
int sched_priority;
|
||||
};
|
||||
# define GNULIB_defined_struct_sched_param 1
|
||||
# endif
|
||||
|
||||
#endif
|
||||
|
||||
#if !(defined SCHED_FIFO && defined SCHED_RR && defined SCHED_OTHER)
|
||||
# define SCHED_FIFO 1
|
||||
# define SCHED_RR 2
|
||||
# define SCHED_OTHER 0
|
||||
#endif
|
||||
|
||||
#if @GNULIB_SCHED_YIELD@
|
||||
# if @REPLACE_SCHED_YIELD@
|
||||
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
|
||||
# undef sched_yield
|
||||
# define sched_yield rpl_sched_yield
|
||||
# endif
|
||||
_GL_FUNCDECL_RPL (sched_yield, int, (void));
|
||||
_GL_CXXALIAS_RPL (sched_yield, int, (void));
|
||||
# else
|
||||
# if !@HAVE_SCHED_YIELD@
|
||||
_GL_FUNCDECL_SYS (sched_yield, int, (void));
|
||||
# endif
|
||||
_GL_CXXALIAS_SYS (sched_yield, int, (void));
|
||||
# endif
|
||||
# if __GLIBC__ >= 2
|
||||
_GL_CXXALIASWARN (sched_yield);
|
||||
# endif
|
||||
#elif defined GNULIB_POSIXCHECK
|
||||
# undef sched_yield
|
||||
# if HAVE_RAW_DECL_SCHED_YIELD
|
||||
_GL_WARN_ON_USE (sched_yield, "sched_yield is not portable - "
|
||||
"use gnulib module sched_yield for portability");
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#endif /* _@GUARD_PREFIX@_SCHED_H */
|
||||
#endif /* _@GUARD_PREFIX@_SCHED_H */
|
34
lib/spawn.c
34
lib/spawn.c
|
@ -1,34 +0,0 @@
|
|||
/* Copyright (C) 2000, 2009-2020 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
/* Specification. */
|
||||
#include <spawn.h>
|
||||
|
||||
#include "spawn_int.h"
|
||||
|
||||
/* Spawn a new process executing PATH with the attributes describes in *ATTRP.
|
||||
Before running the process perform the actions described in FILE-ACTIONS. */
|
||||
int
|
||||
posix_spawn (pid_t *pid, const char *path,
|
||||
const posix_spawn_file_actions_t *file_actions,
|
||||
const posix_spawnattr_t *attrp, char *const argv[],
|
||||
char *const envp[])
|
||||
{
|
||||
return __spawni (pid, path, file_actions, attrp,
|
||||
(const char * const *) argv, (const char * const *) envp, 0);
|
||||
}
|
974
lib/spawn.in.h
974
lib/spawn.in.h
|
@ -1,974 +0,0 @@
|
|||
/* Definitions for POSIX spawn interface.
|
||||
Copyright (C) 2000, 2003-2004, 2008-2020 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _@GUARD_PREFIX@_SPAWN_H
|
||||
|
||||
#if __GNUC__ >= 3
|
||||
@PRAGMA_SYSTEM_HEADER@
|
||||
#endif
|
||||
@PRAGMA_COLUMNS@
|
||||
|
||||
/* The include_next requires a split double-inclusion guard. */
|
||||
#if @HAVE_SPAWN_H@
|
||||
# @INCLUDE_NEXT@ @NEXT_SPAWN_H@
|
||||
#endif
|
||||
|
||||
#ifndef _@GUARD_PREFIX@_SPAWN_H
|
||||
#define _@GUARD_PREFIX@_SPAWN_H
|
||||
|
||||
/* Get definitions of 'struct sched_param' and 'sigset_t'.
|
||||
But avoid namespace pollution on glibc systems. */
|
||||
#if !(defined __GLIBC__ && !defined __UCLIBC__)
|
||||
# include <sched.h>
|
||||
# include <signal.h>
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
#ifndef __THROW
|
||||
# define __THROW
|
||||
#endif
|
||||
|
||||
/* For plain 'restrict', use glibc's __restrict if defined.
|
||||
Otherwise, GCC 2.95 and later have "__restrict"; C99 compilers have
|
||||
"restrict", and "configure" may have defined "restrict".
|
||||
Other compilers use __restrict, __restrict__, and _Restrict, and
|
||||
'configure' might #define 'restrict' to those words, so pick a
|
||||
different name. */
|
||||
#ifndef _Restrict_
|
||||
# if defined __restrict \
|
||||
|| 2 < __GNUC__ + (95 <= __GNUC_MINOR__) \
|
||||
|| __clang_major__ >= 3
|
||||
# define _Restrict_ __restrict
|
||||
# elif 199901L <= __STDC_VERSION__ || defined restrict
|
||||
# define _Restrict_ restrict
|
||||
# else
|
||||
# define _Restrict_
|
||||
# endif
|
||||
#endif
|
||||
/* For the ISO C99 syntax
|
||||
array_name[restrict]
|
||||
use glibc's __restrict_arr if available.
|
||||
Otherwise, GCC 3.1 and clang support this syntax (but not in C++ mode).
|
||||
Other ISO C99 compilers support it as well. */
|
||||
#ifndef _Restrict_arr_
|
||||
# ifdef __restrict_arr
|
||||
# define _Restrict_arr_ __restrict_arr
|
||||
# elif ((199901L <= __STDC_VERSION__ \
|
||||
|| 3 < __GNUC__ + (1 <= __GNUC_MINOR__) \
|
||||
|| __clang_major__ >= 3) \
|
||||
&& !defined __cplusplus)
|
||||
# define _Restrict_arr_ _Restrict_
|
||||
# else
|
||||
# define _Restrict_arr_
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
|
||||
|
||||
/* The definition of _GL_ARG_NONNULL is copied here. */
|
||||
|
||||
/* The definition of _GL_WARN_ON_USE is copied here. */
|
||||
|
||||
|
||||
/* Data structure to contain attributes for thread creation. */
|
||||
#if @REPLACE_POSIX_SPAWN@ || (@HAVE_POSIX_SPAWNATTR_T@ && !@HAVE_POSIX_SPAWN@)
|
||||
# define posix_spawnattr_t rpl_posix_spawnattr_t
|
||||
#endif
|
||||
#if @REPLACE_POSIX_SPAWN@ || !@HAVE_POSIX_SPAWNATTR_T@ || !@HAVE_POSIX_SPAWN@
|
||||
# if !GNULIB_defined_posix_spawnattr_t
|
||||
typedef struct
|
||||
{
|
||||
short int _flags;
|
||||
pid_t _pgrp;
|
||||
sigset_t _sd;
|
||||
sigset_t _ss;
|
||||
struct sched_param _sp;
|
||||
int _policy;
|
||||
int __pad[16];
|
||||
} posix_spawnattr_t;
|
||||
# define GNULIB_defined_posix_spawnattr_t 1
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
/* Data structure to contain information about the actions to be
|
||||
performed in the new process with respect to file descriptors. */
|
||||
#if @REPLACE_POSIX_SPAWN@ || (@HAVE_POSIX_SPAWN_FILE_ACTIONS_T@ && !@HAVE_POSIX_SPAWN@)
|
||||
# define posix_spawn_file_actions_t rpl_posix_spawn_file_actions_t
|
||||
#endif
|
||||
#if @REPLACE_POSIX_SPAWN@ || !@HAVE_POSIX_SPAWN_FILE_ACTIONS_T@ || !@HAVE_POSIX_SPAWN@
|
||||
# if !GNULIB_defined_posix_spawn_file_actions_t
|
||||
typedef struct
|
||||
{
|
||||
int _allocated;
|
||||
int _used;
|
||||
struct __spawn_action *_actions;
|
||||
int __pad[16];
|
||||
} posix_spawn_file_actions_t;
|
||||
# define GNULIB_defined_posix_spawn_file_actions_t 1
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
/* Flags to be set in the 'posix_spawnattr_t'. */
|
||||
#if @HAVE_POSIX_SPAWN@
|
||||
/* Use the values from the system, but provide the missing ones. */
|
||||
# ifndef POSIX_SPAWN_SETSCHEDPARAM
|
||||
# define POSIX_SPAWN_SETSCHEDPARAM 0
|
||||
# endif
|
||||
# ifndef POSIX_SPAWN_SETSCHEDULER
|
||||
# define POSIX_SPAWN_SETSCHEDULER 0
|
||||
# endif
|
||||
#else
|
||||
# if @REPLACE_POSIX_SPAWN@
|
||||
/* Use the values from the system, for better compatibility. */
|
||||
/* But this implementation does not support AIX extensions. */
|
||||
# undef POSIX_SPAWN_FORK_HANDLERS
|
||||
# else
|
||||
# define POSIX_SPAWN_RESETIDS 0x01
|
||||
# define POSIX_SPAWN_SETPGROUP 0x02
|
||||
# define POSIX_SPAWN_SETSIGDEF 0x04
|
||||
# define POSIX_SPAWN_SETSIGMASK 0x08
|
||||
# define POSIX_SPAWN_SETSCHEDPARAM 0x10
|
||||
# define POSIX_SPAWN_SETSCHEDULER 0x20
|
||||
# endif
|
||||
#endif
|
||||
/* A GNU extension. Use the next free bit position. */
|
||||
#ifndef POSIX_SPAWN_USEVFORK
|
||||
# define POSIX_SPAWN_USEVFORK \
|
||||
((POSIX_SPAWN_RESETIDS | (POSIX_SPAWN_RESETIDS - 1) \
|
||||
| POSIX_SPAWN_SETPGROUP | (POSIX_SPAWN_SETPGROUP - 1) \
|
||||
| POSIX_SPAWN_SETSIGDEF | (POSIX_SPAWN_SETSIGDEF - 1) \
|
||||
| POSIX_SPAWN_SETSIGMASK | (POSIX_SPAWN_SETSIGMASK - 1) \
|
||||
| POSIX_SPAWN_SETSCHEDPARAM \
|
||||
| (POSIX_SPAWN_SETSCHEDPARAM > 0 ? POSIX_SPAWN_SETSCHEDPARAM - 1 : 0) \
|
||||
| POSIX_SPAWN_SETSCHEDULER \
|
||||
| (POSIX_SPAWN_SETSCHEDULER > 0 ? POSIX_SPAWN_SETSCHEDULER - 1 : 0)) \
|
||||
+ 1)
|
||||
#endif
|
||||
#if !GNULIB_defined_verify_POSIX_SPAWN_USEVFORK_no_overlap
|
||||
typedef int verify_POSIX_SPAWN_USEVFORK_no_overlap
|
||||
[(((POSIX_SPAWN_RESETIDS | POSIX_SPAWN_SETPGROUP
|
||||
| POSIX_SPAWN_SETSIGDEF | POSIX_SPAWN_SETSIGMASK
|
||||
| POSIX_SPAWN_SETSCHEDPARAM | POSIX_SPAWN_SETSCHEDULER)
|
||||
& POSIX_SPAWN_USEVFORK)
|
||||
== 0)
|
||||
? 1 : -1];
|
||||
# define GNULIB_defined_verify_POSIX_SPAWN_USEVFORK_no_overlap 1
|
||||
#endif
|
||||
|
||||
|
||||
#if @GNULIB_POSIX_SPAWN@
|
||||
/* Spawn a new process executing PATH with the attributes describes in *ATTRP.
|
||||
Before running the process perform the actions described in FILE-ACTIONS.
|
||||
|
||||
This function is a possible cancellation points and therefore not
|
||||
marked with __THROW. */
|
||||
# if @REPLACE_POSIX_SPAWN@
|
||||
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
|
||||
# define posix_spawn rpl_posix_spawn
|
||||
# endif
|
||||
_GL_FUNCDECL_RPL (posix_spawn, int,
|
||||
(pid_t *_Restrict_ __pid,
|
||||
const char *_Restrict_ __path,
|
||||
const posix_spawn_file_actions_t *_Restrict_ __file_actions,
|
||||
const posix_spawnattr_t *_Restrict_ __attrp,
|
||||
char *const argv[_Restrict_arr_],
|
||||
char *const envp[_Restrict_arr_])
|
||||
_GL_ARG_NONNULL ((2, 5, 6)));
|
||||
_GL_CXXALIAS_RPL (posix_spawn, int,
|
||||
(pid_t *_Restrict_ __pid,
|
||||
const char *_Restrict_ __path,
|
||||
const posix_spawn_file_actions_t *_Restrict_ __file_actions,
|
||||
const posix_spawnattr_t *_Restrict_ __attrp,
|
||||
char *const argv[_Restrict_arr_],
|
||||
char *const envp[_Restrict_arr_]));
|
||||
# else
|
||||
# if !@HAVE_POSIX_SPAWN@
|
||||
_GL_FUNCDECL_SYS (posix_spawn, int,
|
||||
(pid_t *_Restrict_ __pid,
|
||||
const char *_Restrict_ __path,
|
||||
const posix_spawn_file_actions_t *_Restrict_ __file_actions,
|
||||
const posix_spawnattr_t *_Restrict_ __attrp,
|
||||
char *const argv[_Restrict_arr_],
|
||||
char *const envp[_Restrict_arr_])
|
||||
_GL_ARG_NONNULL ((2, 5, 6)));
|
||||
# endif
|
||||
_GL_CXXALIAS_SYS (posix_spawn, int,
|
||||
(pid_t *_Restrict_ __pid,
|
||||
const char *_Restrict_ __path,
|
||||
const posix_spawn_file_actions_t *_Restrict_ __file_actions,
|
||||
const posix_spawnattr_t *_Restrict_ __attrp,
|
||||
char *const argv[_Restrict_arr_],
|
||||
char *const envp[_Restrict_arr_]));
|
||||
# endif
|
||||
_GL_CXXALIASWARN (posix_spawn);
|
||||
#elif defined GNULIB_POSIXCHECK
|
||||
# undef posix_spawn
|
||||
# if HAVE_RAW_DECL_POSIX_SPAWN
|
||||
_GL_WARN_ON_USE (posix_spawn, "posix_spawn is unportable - "
|
||||
"use gnulib module posix_spawn for portability");
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if @GNULIB_POSIX_SPAWNP@
|
||||
/* Similar to 'posix_spawn' but search for FILE in the PATH.
|
||||
|
||||
This function is a possible cancellation points and therefore not
|
||||
marked with __THROW. */
|
||||
# if @REPLACE_POSIX_SPAWN@
|
||||
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
|
||||
# define posix_spawnp rpl_posix_spawnp
|
||||
# endif
|
||||
_GL_FUNCDECL_RPL (posix_spawnp, int,
|
||||
(pid_t *__pid, const char *__file,
|
||||
const posix_spawn_file_actions_t *__file_actions,
|
||||
const posix_spawnattr_t *__attrp,
|
||||
char *const argv[], char *const envp[])
|
||||
_GL_ARG_NONNULL ((2, 5, 6)));
|
||||
_GL_CXXALIAS_RPL (posix_spawnp, int,
|
||||
(pid_t *__pid, const char *__file,
|
||||
const posix_spawn_file_actions_t *__file_actions,
|
||||
const posix_spawnattr_t *__attrp,
|
||||
char *const argv[], char *const envp[]));
|
||||
# else
|
||||
# if !@HAVE_POSIX_SPAWN@
|
||||
_GL_FUNCDECL_SYS (posix_spawnp, int,
|
||||
(pid_t *__pid, const char *__file,
|
||||
const posix_spawn_file_actions_t *__file_actions,
|
||||
const posix_spawnattr_t *__attrp,
|
||||
char *const argv[], char *const envp[])
|
||||
_GL_ARG_NONNULL ((2, 5, 6)));
|
||||
# endif
|
||||
_GL_CXXALIAS_SYS (posix_spawnp, int,
|
||||
(pid_t *__pid, const char *__file,
|
||||
const posix_spawn_file_actions_t *__file_actions,
|
||||
const posix_spawnattr_t *__attrp,
|
||||
char *const argv[], char *const envp[]));
|
||||
# endif
|
||||
_GL_CXXALIASWARN (posix_spawnp);
|
||||
#elif defined GNULIB_POSIXCHECK
|
||||
# undef posix_spawnp
|
||||
# if HAVE_RAW_DECL_POSIX_SPAWNP
|
||||
_GL_WARN_ON_USE (posix_spawnp, "posix_spawnp is unportable - "
|
||||
"use gnulib module posix_spawnp for portability");
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
#if @GNULIB_POSIX_SPAWNATTR_INIT@
|
||||
/* Initialize data structure with attributes for 'spawn' to default values. */
|
||||
# if @REPLACE_POSIX_SPAWN@
|
||||
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
|
||||
# define posix_spawnattr_init rpl_posix_spawnattr_init
|
||||
# endif
|
||||
_GL_FUNCDECL_RPL (posix_spawnattr_init, int, (posix_spawnattr_t *__attr)
|
||||
__THROW _GL_ARG_NONNULL ((1)));
|
||||
_GL_CXXALIAS_RPL (posix_spawnattr_init, int, (posix_spawnattr_t *__attr));
|
||||
# else
|
||||
# if !@HAVE_POSIX_SPAWN@
|
||||
_GL_FUNCDECL_SYS (posix_spawnattr_init, int, (posix_spawnattr_t *__attr)
|
||||
__THROW _GL_ARG_NONNULL ((1)));
|
||||
# endif
|
||||
_GL_CXXALIAS_SYS (posix_spawnattr_init, int, (posix_spawnattr_t *__attr));
|
||||
# endif
|
||||
_GL_CXXALIASWARN (posix_spawnattr_init);
|
||||
#elif defined GNULIB_POSIXCHECK
|
||||
# undef posix_spawnattr_init
|
||||
# if HAVE_RAW_DECL_POSIX_SPAWNATTR_INIT
|
||||
_GL_WARN_ON_USE (posix_spawnattr_init, "posix_spawnattr_init is unportable - "
|
||||
"use gnulib module posix_spawnattr_init for portability");
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if @GNULIB_POSIX_SPAWNATTR_DESTROY@
|
||||
/* Free resources associated with ATTR. */
|
||||
# if @REPLACE_POSIX_SPAWN@
|
||||
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
|
||||
# define posix_spawnattr_destroy rpl_posix_spawnattr_destroy
|
||||
# endif
|
||||
_GL_FUNCDECL_RPL (posix_spawnattr_destroy, int, (posix_spawnattr_t *__attr)
|
||||
__THROW _GL_ARG_NONNULL ((1)));
|
||||
_GL_CXXALIAS_RPL (posix_spawnattr_destroy, int, (posix_spawnattr_t *__attr));
|
||||
# else
|
||||
# if !@HAVE_POSIX_SPAWN@
|
||||
_GL_FUNCDECL_SYS (posix_spawnattr_destroy, int, (posix_spawnattr_t *__attr)
|
||||
__THROW _GL_ARG_NONNULL ((1)));
|
||||
# endif
|
||||
_GL_CXXALIAS_SYS (posix_spawnattr_destroy, int, (posix_spawnattr_t *__attr));
|
||||
# endif
|
||||
_GL_CXXALIASWARN (posix_spawnattr_destroy);
|
||||
#elif defined GNULIB_POSIXCHECK
|
||||
# undef posix_spawnattr_destroy
|
||||
# if HAVE_RAW_DECL_POSIX_SPAWNATTR_DESTROY
|
||||
_GL_WARN_ON_USE (posix_spawnattr_destroy,
|
||||
"posix_spawnattr_destroy is unportable - "
|
||||
"use gnulib module posix_spawnattr_destroy for portability");
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if @GNULIB_POSIX_SPAWNATTR_GETSIGDEFAULT@
|
||||
/* Store signal mask for signals with default handling from ATTR in
|
||||
SIGDEFAULT. */
|
||||
# if @REPLACE_POSIX_SPAWN@
|
||||
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
|
||||
# define posix_spawnattr_getsigdefault rpl_posix_spawnattr_getsigdefault
|
||||
# endif
|
||||
_GL_FUNCDECL_RPL (posix_spawnattr_getsigdefault, int,
|
||||
(const posix_spawnattr_t *_Restrict_ __attr,
|
||||
sigset_t *_Restrict_ __sigdefault)
|
||||
__THROW _GL_ARG_NONNULL ((1, 2)));
|
||||
_GL_CXXALIAS_RPL (posix_spawnattr_getsigdefault, int,
|
||||
(const posix_spawnattr_t *_Restrict_ __attr,
|
||||
sigset_t *_Restrict_ __sigdefault));
|
||||
# else
|
||||
# if !@HAVE_POSIX_SPAWN@
|
||||
_GL_FUNCDECL_SYS (posix_spawnattr_getsigdefault, int,
|
||||
(const posix_spawnattr_t *_Restrict_ __attr,
|
||||
sigset_t *_Restrict_ __sigdefault)
|
||||
__THROW _GL_ARG_NONNULL ((1, 2)));
|
||||
# endif
|
||||
_GL_CXXALIAS_SYS (posix_spawnattr_getsigdefault, int,
|
||||
(const posix_spawnattr_t *_Restrict_ __attr,
|
||||
sigset_t *_Restrict_ __sigdefault));
|
||||
# endif
|
||||
_GL_CXXALIASWARN (posix_spawnattr_getsigdefault);
|
||||
#elif defined GNULIB_POSIXCHECK
|
||||
# undef posix_spawnattr_getsigdefault
|
||||
# if HAVE_RAW_DECL_POSIX_SPAWNATTR_GETSIGDEFAULT
|
||||
_GL_WARN_ON_USE (posix_spawnattr_getsigdefault,
|
||||
"posix_spawnattr_getsigdefault is unportable - "
|
||||
"use gnulib module posix_spawnattr_getsigdefault for portability");
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if @GNULIB_POSIX_SPAWNATTR_SETSIGDEFAULT@
|
||||
/* Set signal mask for signals with default handling in ATTR to SIGDEFAULT. */
|
||||
# if @REPLACE_POSIX_SPAWN@
|
||||
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
|
||||
# define posix_spawnattr_setsigdefault rpl_posix_spawnattr_setsigdefault
|
||||
# endif
|
||||
_GL_FUNCDECL_RPL (posix_spawnattr_setsigdefault, int,
|
||||
(posix_spawnattr_t *_Restrict_ __attr,
|
||||
const sigset_t *_Restrict_ __sigdefault)
|
||||
__THROW _GL_ARG_NONNULL ((1, 2)));
|
||||
_GL_CXXALIAS_RPL (posix_spawnattr_setsigdefault, int,
|
||||
(posix_spawnattr_t *_Restrict_ __attr,
|
||||
const sigset_t *_Restrict_ __sigdefault));
|
||||
# else
|
||||
# if !@HAVE_POSIX_SPAWN@
|
||||
_GL_FUNCDECL_SYS (posix_spawnattr_setsigdefault, int,
|
||||
(posix_spawnattr_t *_Restrict_ __attr,
|
||||
const sigset_t *_Restrict_ __sigdefault)
|
||||
__THROW _GL_ARG_NONNULL ((1, 2)));
|
||||
# endif
|
||||
_GL_CXXALIAS_SYS (posix_spawnattr_setsigdefault, int,
|
||||
(posix_spawnattr_t *_Restrict_ __attr,
|
||||
const sigset_t *_Restrict_ __sigdefault));
|
||||
# endif
|
||||
_GL_CXXALIASWARN (posix_spawnattr_setsigdefault);
|
||||
#elif defined GNULIB_POSIXCHECK
|
||||
# undef posix_spawnattr_setsigdefault
|
||||
# if HAVE_RAW_DECL_POSIX_SPAWNATTR_SETSIGDEFAULT
|
||||
_GL_WARN_ON_USE (posix_spawnattr_setsigdefault,
|
||||
"posix_spawnattr_setsigdefault is unportable - "
|
||||
"use gnulib module posix_spawnattr_setsigdefault for portability");
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if @GNULIB_POSIX_SPAWNATTR_GETSIGMASK@
|
||||
/* Store signal mask for the new process from ATTR in SIGMASK. */
|
||||
# if @REPLACE_POSIX_SPAWN@
|
||||
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
|
||||
# define posix_spawnattr_getsigmask rpl_posix_spawnattr_getsigmask
|
||||
# endif
|
||||
_GL_FUNCDECL_RPL (posix_spawnattr_getsigmask, int,
|
||||
(const posix_spawnattr_t *_Restrict_ __attr,
|
||||
sigset_t *_Restrict_ __sigmask)
|
||||
__THROW _GL_ARG_NONNULL ((1, 2)));
|
||||
_GL_CXXALIAS_RPL (posix_spawnattr_getsigmask, int,
|
||||
(const posix_spawnattr_t *_Restrict_ __attr,
|
||||
sigset_t *_Restrict_ __sigmask));
|
||||
# else
|
||||
# if !@HAVE_POSIX_SPAWN@
|
||||
_GL_FUNCDECL_SYS (posix_spawnattr_getsigmask, int,
|
||||
(const posix_spawnattr_t *_Restrict_ __attr,
|
||||
sigset_t *_Restrict_ __sigmask)
|
||||
__THROW _GL_ARG_NONNULL ((1, 2)));
|
||||
# endif
|
||||
_GL_CXXALIAS_SYS (posix_spawnattr_getsigmask, int,
|
||||
(const posix_spawnattr_t *_Restrict_ __attr,
|
||||
sigset_t *_Restrict_ __sigmask));
|
||||
# endif
|
||||
_GL_CXXALIASWARN (posix_spawnattr_getsigmask);
|
||||
#elif defined GNULIB_POSIXCHECK
|
||||
# undef posix_spawnattr_getsigmask
|
||||
# if HAVE_RAW_DECL_POSIX_SPAWNATTR_GETSIGMASK
|
||||
_GL_WARN_ON_USE (posix_spawnattr_getsigmask,
|
||||
"posix_spawnattr_getsigmask is unportable - "
|
||||
"use gnulib module posix_spawnattr_getsigmask for portability");
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if @GNULIB_POSIX_SPAWNATTR_SETSIGMASK@
|
||||
/* Set signal mask for the new process in ATTR to SIGMASK. */
|
||||
# if @REPLACE_POSIX_SPAWN@
|
||||
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
|
||||
# define posix_spawnattr_setsigmask rpl_posix_spawnattr_setsigmask
|
||||
# endif
|
||||
_GL_FUNCDECL_RPL (posix_spawnattr_setsigmask, int,
|
||||
(posix_spawnattr_t *_Restrict_ __attr,
|
||||
const sigset_t *_Restrict_ __sigmask)
|
||||
__THROW _GL_ARG_NONNULL ((1, 2)));
|
||||
_GL_CXXALIAS_RPL (posix_spawnattr_setsigmask, int,
|
||||
(posix_spawnattr_t *_Restrict_ __attr,
|
||||
const sigset_t *_Restrict_ __sigmask));
|
||||
# else
|
||||
# if !@HAVE_POSIX_SPAWN@
|
||||
_GL_FUNCDECL_SYS (posix_spawnattr_setsigmask, int,
|
||||
(posix_spawnattr_t *_Restrict_ __attr,
|
||||
const sigset_t *_Restrict_ __sigmask)
|
||||
__THROW _GL_ARG_NONNULL ((1, 2)));
|
||||
# endif
|
||||
_GL_CXXALIAS_SYS (posix_spawnattr_setsigmask, int,
|
||||
(posix_spawnattr_t *_Restrict_ __attr,
|
||||
const sigset_t *_Restrict_ __sigmask));
|
||||
# endif
|
||||
_GL_CXXALIASWARN (posix_spawnattr_setsigmask);
|
||||
#elif defined GNULIB_POSIXCHECK
|
||||
# undef posix_spawnattr_setsigmask
|
||||
# if HAVE_RAW_DECL_POSIX_SPAWNATTR_SETSIGMASK
|
||||
_GL_WARN_ON_USE (posix_spawnattr_setsigmask,
|
||||
"posix_spawnattr_setsigmask is unportable - "
|
||||
"use gnulib module posix_spawnattr_setsigmask for portability");
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if @GNULIB_POSIX_SPAWNATTR_GETFLAGS@
|
||||
/* Get flag word from the attribute structure. */
|
||||
# if @REPLACE_POSIX_SPAWN@
|
||||
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
|
||||
# define posix_spawnattr_getflags rpl_posix_spawnattr_getflags
|
||||
# endif
|
||||
_GL_FUNCDECL_RPL (posix_spawnattr_getflags, int,
|
||||
(const posix_spawnattr_t *_Restrict_ __attr,
|
||||
short int *_Restrict_ __flags)
|
||||
__THROW _GL_ARG_NONNULL ((1, 2)));
|
||||
_GL_CXXALIAS_RPL (posix_spawnattr_getflags, int,
|
||||
(const posix_spawnattr_t *_Restrict_ __attr,
|
||||
short int *_Restrict_ __flags));
|
||||
# else
|
||||
# if !@HAVE_POSIX_SPAWN@
|
||||
_GL_FUNCDECL_SYS (posix_spawnattr_getflags, int,
|
||||
(const posix_spawnattr_t *_Restrict_ __attr,
|
||||
short int *_Restrict_ __flags)
|
||||
__THROW _GL_ARG_NONNULL ((1, 2)));
|
||||
# endif
|
||||
_GL_CXXALIAS_SYS (posix_spawnattr_getflags, int,
|
||||
(const posix_spawnattr_t *_Restrict_ __attr,
|
||||
short int *_Restrict_ __flags));
|
||||
# endif
|
||||
_GL_CXXALIASWARN (posix_spawnattr_getflags);
|
||||
#elif defined GNULIB_POSIXCHECK
|
||||
# undef posix_spawnattr_getflags
|
||||
# if HAVE_RAW_DECL_POSIX_SPAWNATTR_GETFLAGS
|
||||
_GL_WARN_ON_USE (posix_spawnattr_getflags,
|
||||
"posix_spawnattr_getflags is unportable - "
|
||||
"use gnulib module posix_spawnattr_getflags for portability");
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if @GNULIB_POSIX_SPAWNATTR_SETFLAGS@
|
||||
/* Store flags in the attribute structure. */
|
||||
# if @REPLACE_POSIX_SPAWN@
|
||||
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
|
||||
# define posix_spawnattr_setflags rpl_posix_spawnattr_setflags
|
||||
# endif
|
||||
_GL_FUNCDECL_RPL (posix_spawnattr_setflags, int,
|
||||
(posix_spawnattr_t *__attr, short int __flags)
|
||||
__THROW _GL_ARG_NONNULL ((1)));
|
||||
_GL_CXXALIAS_RPL (posix_spawnattr_setflags, int,
|
||||
(posix_spawnattr_t *__attr, short int __flags));
|
||||
# else
|
||||
# if !@HAVE_POSIX_SPAWN@
|
||||
_GL_FUNCDECL_SYS (posix_spawnattr_setflags, int,
|
||||
(posix_spawnattr_t *__attr, short int __flags)
|
||||
__THROW _GL_ARG_NONNULL ((1)));
|
||||
# endif
|
||||
_GL_CXXALIAS_SYS (posix_spawnattr_setflags, int,
|
||||
(posix_spawnattr_t *__attr, short int __flags));
|
||||
# endif
|
||||
_GL_CXXALIASWARN (posix_spawnattr_setflags);
|
||||
#elif defined GNULIB_POSIXCHECK
|
||||
# undef posix_spawnattr_setflags
|
||||
# if HAVE_RAW_DECL_POSIX_SPAWNATTR_SETFLAGS
|
||||
_GL_WARN_ON_USE (posix_spawnattr_setflags,
|
||||
"posix_spawnattr_setflags is unportable - "
|
||||
"use gnulib module posix_spawnattr_setflags for portability");
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if @GNULIB_POSIX_SPAWNATTR_GETPGROUP@
|
||||
/* Get process group ID from the attribute structure. */
|
||||
# if @REPLACE_POSIX_SPAWN@
|
||||
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
|
||||
# define posix_spawnattr_getpgroup rpl_posix_spawnattr_getpgroup
|
||||
# endif
|
||||
_GL_FUNCDECL_RPL (posix_spawnattr_getpgroup, int,
|
||||
(const posix_spawnattr_t *_Restrict_ __attr,
|
||||
pid_t *_Restrict_ __pgroup)
|
||||
__THROW _GL_ARG_NONNULL ((1, 2)));
|
||||
_GL_CXXALIAS_RPL (posix_spawnattr_getpgroup, int,
|
||||
(const posix_spawnattr_t *_Restrict_ __attr,
|
||||
pid_t *_Restrict_ __pgroup));
|
||||
# else
|
||||
# if !@HAVE_POSIX_SPAWN@
|
||||
_GL_FUNCDECL_SYS (posix_spawnattr_getpgroup, int,
|
||||
(const posix_spawnattr_t *_Restrict_ __attr,
|
||||
pid_t *_Restrict_ __pgroup)
|
||||
__THROW _GL_ARG_NONNULL ((1, 2)));
|
||||
# endif
|
||||
_GL_CXXALIAS_SYS (posix_spawnattr_getpgroup, int,
|
||||
(const posix_spawnattr_t *_Restrict_ __attr,
|
||||
pid_t *_Restrict_ __pgroup));
|
||||
# endif
|
||||
_GL_CXXALIASWARN (posix_spawnattr_getpgroup);
|
||||
#elif defined GNULIB_POSIXCHECK
|
||||
# undef posix_spawnattr_getpgroup
|
||||
# if HAVE_RAW_DECL_POSIX_SPAWNATTR_GETPGROUP
|
||||
_GL_WARN_ON_USE (posix_spawnattr_getpgroup,
|
||||
"posix_spawnattr_getpgroup is unportable - "
|
||||
"use gnulib module posix_spawnattr_getpgroup for portability");
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if @GNULIB_POSIX_SPAWNATTR_SETPGROUP@
|
||||
/* Store process group ID in the attribute structure. */
|
||||
# if @REPLACE_POSIX_SPAWN@
|
||||
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
|
||||
# define posix_spawnattr_setpgroup rpl_posix_spawnattr_setpgroup
|
||||
# endif
|
||||
_GL_FUNCDECL_RPL (posix_spawnattr_setpgroup, int,
|
||||
(posix_spawnattr_t *__attr, pid_t __pgroup)
|
||||
__THROW _GL_ARG_NONNULL ((1)));
|
||||
_GL_CXXALIAS_RPL (posix_spawnattr_setpgroup, int,
|
||||
(posix_spawnattr_t *__attr, pid_t __pgroup));
|
||||
# else
|
||||
# if !@HAVE_POSIX_SPAWN@
|
||||
_GL_FUNCDECL_SYS (posix_spawnattr_setpgroup, int,
|
||||
(posix_spawnattr_t *__attr, pid_t __pgroup)
|
||||
__THROW _GL_ARG_NONNULL ((1)));
|
||||
# endif
|
||||
_GL_CXXALIAS_SYS (posix_spawnattr_setpgroup, int,
|
||||
(posix_spawnattr_t *__attr, pid_t __pgroup));
|
||||
# endif
|
||||
_GL_CXXALIASWARN (posix_spawnattr_setpgroup);
|
||||
#elif defined GNULIB_POSIXCHECK
|
||||
# undef posix_spawnattr_setpgroup
|
||||
# if HAVE_RAW_DECL_POSIX_SPAWNATTR_SETPGROUP
|
||||
_GL_WARN_ON_USE (posix_spawnattr_setpgroup,
|
||||
"posix_spawnattr_setpgroup is unportable - "
|
||||
"use gnulib module posix_spawnattr_setpgroup for portability");
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if @GNULIB_POSIX_SPAWNATTR_GETSCHEDPOLICY@
|
||||
/* Get scheduling policy from the attribute structure. */
|
||||
# if @REPLACE_POSIX_SPAWN@
|
||||
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
|
||||
# define posix_spawnattr_getschedpolicy rpl_posix_spawnattr_getschedpolicy
|
||||
# endif
|
||||
_GL_FUNCDECL_RPL (posix_spawnattr_getschedpolicy, int,
|
||||
(const posix_spawnattr_t *_Restrict_ __attr,
|
||||
int *_Restrict_ __schedpolicy)
|
||||
__THROW _GL_ARG_NONNULL ((1, 2)));
|
||||
_GL_CXXALIAS_RPL (posix_spawnattr_getschedpolicy, int,
|
||||
(const posix_spawnattr_t *_Restrict_ __attr,
|
||||
int *_Restrict_ __schedpolicy));
|
||||
# else
|
||||
# if !@HAVE_POSIX_SPAWN@ || POSIX_SPAWN_SETSCHEDULER == 0
|
||||
_GL_FUNCDECL_SYS (posix_spawnattr_getschedpolicy, int,
|
||||
(const posix_spawnattr_t *_Restrict_ __attr,
|
||||
int *_Restrict_ __schedpolicy)
|
||||
__THROW _GL_ARG_NONNULL ((1, 2)));
|
||||
# endif
|
||||
_GL_CXXALIAS_SYS (posix_spawnattr_getschedpolicy, int,
|
||||
(const posix_spawnattr_t *_Restrict_ __attr,
|
||||
int *_Restrict_ __schedpolicy));
|
||||
# endif
|
||||
# if __GLIBC__ >= 2
|
||||
_GL_CXXALIASWARN (posix_spawnattr_getschedpolicy);
|
||||
# endif
|
||||
#elif defined GNULIB_POSIXCHECK
|
||||
# undef posix_spawnattr_getschedpolicy
|
||||
# if HAVE_RAW_DECL_POSIX_SPAWNATTR_GETSCHEDPOLICY
|
||||
_GL_WARN_ON_USE (posix_spawnattr_getschedpolicy,
|
||||
"posix_spawnattr_getschedpolicy is unportable - "
|
||||
"use gnulib module posix_spawnattr_getschedpolicy for portability");
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if @GNULIB_POSIX_SPAWNATTR_SETSCHEDPOLICY@
|
||||
/* Store scheduling policy in the attribute structure. */
|
||||
# if @REPLACE_POSIX_SPAWN@
|
||||
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
|
||||
# define posix_spawnattr_setschedpolicy rpl_posix_spawnattr_setschedpolicy
|
||||
# endif
|
||||
_GL_FUNCDECL_RPL (posix_spawnattr_setschedpolicy, int,
|
||||
(posix_spawnattr_t *__attr, int __schedpolicy)
|
||||
__THROW _GL_ARG_NONNULL ((1)));
|
||||
_GL_CXXALIAS_RPL (posix_spawnattr_setschedpolicy, int,
|
||||
(posix_spawnattr_t *__attr, int __schedpolicy));
|
||||
# else
|
||||
# if !@HAVE_POSIX_SPAWN@ || POSIX_SPAWN_SETSCHEDULER == 0
|
||||
_GL_FUNCDECL_SYS (posix_spawnattr_setschedpolicy, int,
|
||||
(posix_spawnattr_t *__attr, int __schedpolicy)
|
||||
__THROW _GL_ARG_NONNULL ((1)));
|
||||
# endif
|
||||
_GL_CXXALIAS_SYS (posix_spawnattr_setschedpolicy, int,
|
||||
(posix_spawnattr_t *__attr, int __schedpolicy));
|
||||
# endif
|
||||
# if __GLIBC__ >= 2
|
||||
_GL_CXXALIASWARN (posix_spawnattr_setschedpolicy);
|
||||
# endif
|
||||
#elif defined GNULIB_POSIXCHECK
|
||||
# undef posix_spawnattr_setschedpolicy
|
||||
# if HAVE_RAW_DECL_POSIX_SPAWNATTR_SETSCHEDPOLICY
|
||||
_GL_WARN_ON_USE (posix_spawnattr_setschedpolicy,
|
||||
"posix_spawnattr_setschedpolicy is unportable - "
|
||||
"use gnulib module posix_spawnattr_setschedpolicy for portability");
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if @GNULIB_POSIX_SPAWNATTR_GETSCHEDPARAM@
|
||||
/* Get scheduling parameters from the attribute structure. */
|
||||
# if @REPLACE_POSIX_SPAWN@
|
||||
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
|
||||
# define posix_spawnattr_getschedparam rpl_posix_spawnattr_getschedparam
|
||||
# endif
|
||||
_GL_FUNCDECL_RPL (posix_spawnattr_getschedparam, int,
|
||||
(const posix_spawnattr_t *_Restrict_ __attr,
|
||||
struct sched_param *_Restrict_ __schedparam)
|
||||
__THROW _GL_ARG_NONNULL ((1, 2)));
|
||||
_GL_CXXALIAS_RPL (posix_spawnattr_getschedparam, int,
|
||||
(const posix_spawnattr_t *_Restrict_ __attr,
|
||||
struct sched_param *_Restrict_ __schedparam));
|
||||
# else
|
||||
# if !@HAVE_POSIX_SPAWN@ || POSIX_SPAWN_SETSCHEDPARAM == 0
|
||||
_GL_FUNCDECL_SYS (posix_spawnattr_getschedparam, int,
|
||||
(const posix_spawnattr_t *_Restrict_ __attr,
|
||||
struct sched_param *_Restrict_ __schedparam)
|
||||
__THROW _GL_ARG_NONNULL ((1, 2)));
|
||||
# endif
|
||||
_GL_CXXALIAS_SYS (posix_spawnattr_getschedparam, int,
|
||||
(const posix_spawnattr_t *_Restrict_ __attr,
|
||||
struct sched_param *_Restrict_ __schedparam));
|
||||
# endif
|
||||
# if __GLIBC__ >= 2
|
||||
_GL_CXXALIASWARN (posix_spawnattr_getschedparam);
|
||||
# endif
|
||||
#elif defined GNULIB_POSIXCHECK
|
||||
# undef posix_spawnattr_getschedparam
|
||||
# if HAVE_RAW_DECL_POSIX_SPAWNATTR_GETSCHEDPARAM
|
||||
_GL_WARN_ON_USE (posix_spawnattr_getschedparam,
|
||||
"posix_spawnattr_getschedparam is unportable - "
|
||||
"use gnulib module posix_spawnattr_getschedparam for portability");
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if @GNULIB_POSIX_SPAWNATTR_SETSCHEDPARAM@
|
||||
/* Store scheduling parameters in the attribute structure. */
|
||||
# if @REPLACE_POSIX_SPAWN@
|
||||
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
|
||||
# define posix_spawnattr_setschedparam rpl_posix_spawnattr_setschedparam
|
||||
# endif
|
||||
_GL_FUNCDECL_RPL (posix_spawnattr_setschedparam, int,
|
||||
(posix_spawnattr_t *_Restrict_ __attr,
|
||||
const struct sched_param *_Restrict_ __schedparam)
|
||||
__THROW _GL_ARG_NONNULL ((1, 2)));
|
||||
_GL_CXXALIAS_RPL (posix_spawnattr_setschedparam, int,
|
||||
(posix_spawnattr_t *_Restrict_ __attr,
|
||||
const struct sched_param *_Restrict_ __schedparam));
|
||||
# else
|
||||
# if !@HAVE_POSIX_SPAWN@ || POSIX_SPAWN_SETSCHEDPARAM == 0
|
||||
_GL_FUNCDECL_SYS (posix_spawnattr_setschedparam, int,
|
||||
(posix_spawnattr_t *_Restrict_ __attr,
|
||||
const struct sched_param *_Restrict_ __schedparam)
|
||||
__THROW _GL_ARG_NONNULL ((1, 2)));
|
||||
# endif
|
||||
_GL_CXXALIAS_SYS (posix_spawnattr_setschedparam, int,
|
||||
(posix_spawnattr_t *_Restrict_ __attr,
|
||||
const struct sched_param *_Restrict_ __schedparam));
|
||||
# endif
|
||||
# if __GLIBC__ >= 2
|
||||
_GL_CXXALIASWARN (posix_spawnattr_setschedparam);
|
||||
# endif
|
||||
#elif defined GNULIB_POSIXCHECK
|
||||
# undef posix_spawnattr_setschedparam
|
||||
# if HAVE_RAW_DECL_POSIX_SPAWNATTR_SETSCHEDPARAM
|
||||
_GL_WARN_ON_USE (posix_spawnattr_setschedparam,
|
||||
"posix_spawnattr_setschedparam is unportable - "
|
||||
"use gnulib module posix_spawnattr_setschedparam for portability");
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
#if @GNULIB_POSIX_SPAWN_FILE_ACTIONS_INIT@
|
||||
/* Initialize data structure for file attribute for 'spawn' call. */
|
||||
# if @REPLACE_POSIX_SPAWN@
|
||||
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
|
||||
# define posix_spawn_file_actions_init rpl_posix_spawn_file_actions_init
|
||||
# endif
|
||||
_GL_FUNCDECL_RPL (posix_spawn_file_actions_init, int,
|
||||
(posix_spawn_file_actions_t *__file_actions)
|
||||
__THROW _GL_ARG_NONNULL ((1)));
|
||||
_GL_CXXALIAS_RPL (posix_spawn_file_actions_init, int,
|
||||
(posix_spawn_file_actions_t *__file_actions));
|
||||
# else
|
||||
# if !@HAVE_POSIX_SPAWN@
|
||||
_GL_FUNCDECL_SYS (posix_spawn_file_actions_init, int,
|
||||
(posix_spawn_file_actions_t *__file_actions)
|
||||
__THROW _GL_ARG_NONNULL ((1)));
|
||||
# endif
|
||||
_GL_CXXALIAS_SYS (posix_spawn_file_actions_init, int,
|
||||
(posix_spawn_file_actions_t *__file_actions));
|
||||
# endif
|
||||
_GL_CXXALIASWARN (posix_spawn_file_actions_init);
|
||||
#elif defined GNULIB_POSIXCHECK
|
||||
# undef posix_spawn_file_actions_init
|
||||
# if HAVE_RAW_DECL_POSIX_SPAWN_FILE_ACTIONS_INIT
|
||||
_GL_WARN_ON_USE (posix_spawn_file_actions_init,
|
||||
"posix_spawn_file_actions_init is unportable - "
|
||||
"use gnulib module posix_spawn_file_actions_init for portability");
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if @GNULIB_POSIX_SPAWN_FILE_ACTIONS_DESTROY@
|
||||
/* Free resources associated with FILE-ACTIONS. */
|
||||
# if @REPLACE_POSIX_SPAWN@
|
||||
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
|
||||
# define posix_spawn_file_actions_destroy rpl_posix_spawn_file_actions_destroy
|
||||
# endif
|
||||
_GL_FUNCDECL_RPL (posix_spawn_file_actions_destroy, int,
|
||||
(posix_spawn_file_actions_t *__file_actions)
|
||||
__THROW _GL_ARG_NONNULL ((1)));
|
||||
_GL_CXXALIAS_RPL (posix_spawn_file_actions_destroy, int,
|
||||
(posix_spawn_file_actions_t *__file_actions));
|
||||
# else
|
||||
# if !@HAVE_POSIX_SPAWN@
|
||||
_GL_FUNCDECL_SYS (posix_spawn_file_actions_destroy, int,
|
||||
(posix_spawn_file_actions_t *__file_actions)
|
||||
__THROW _GL_ARG_NONNULL ((1)));
|
||||
# endif
|
||||
_GL_CXXALIAS_SYS (posix_spawn_file_actions_destroy, int,
|
||||
(posix_spawn_file_actions_t *__file_actions));
|
||||
# endif
|
||||
_GL_CXXALIASWARN (posix_spawn_file_actions_destroy);
|
||||
#elif defined GNULIB_POSIXCHECK
|
||||
# undef posix_spawn_file_actions_destroy
|
||||
# if HAVE_RAW_DECL_POSIX_SPAWN_FILE_ACTIONS_DESTROY
|
||||
_GL_WARN_ON_USE (posix_spawn_file_actions_destroy,
|
||||
"posix_spawn_file_actions_destroy is unportable - "
|
||||
"use gnulib module posix_spawn_file_actions_destroy for portability");
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if @GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN@
|
||||
/* Add an action to FILE-ACTIONS which tells the implementation to call
|
||||
'open' for the given file during the 'spawn' call. */
|
||||
# if @REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN@
|
||||
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
|
||||
# define posix_spawn_file_actions_addopen rpl_posix_spawn_file_actions_addopen
|
||||
# endif
|
||||
_GL_FUNCDECL_RPL (posix_spawn_file_actions_addopen, int,
|
||||
(posix_spawn_file_actions_t *_Restrict_ __file_actions,
|
||||
int __fd,
|
||||
const char *_Restrict_ __path, int __oflag, mode_t __mode)
|
||||
__THROW _GL_ARG_NONNULL ((1, 3)));
|
||||
_GL_CXXALIAS_RPL (posix_spawn_file_actions_addopen, int,
|
||||
(posix_spawn_file_actions_t *_Restrict_ __file_actions,
|
||||
int __fd,
|
||||
const char *_Restrict_ __path, int __oflag, mode_t __mode));
|
||||
# else
|
||||
# if !@HAVE_POSIX_SPAWN@
|
||||
_GL_FUNCDECL_SYS (posix_spawn_file_actions_addopen, int,
|
||||
(posix_spawn_file_actions_t *_Restrict_ __file_actions,
|
||||
int __fd,
|
||||
const char *_Restrict_ __path, int __oflag, mode_t __mode)
|
||||
__THROW _GL_ARG_NONNULL ((1, 3)));
|
||||
# endif
|
||||
_GL_CXXALIAS_SYS (posix_spawn_file_actions_addopen, int,
|
||||
(posix_spawn_file_actions_t *_Restrict_ __file_actions,
|
||||
int __fd,
|
||||
const char *_Restrict_ __path, int __oflag, mode_t __mode));
|
||||
# endif
|
||||
# if __GLIBC__ >= 2
|
||||
_GL_CXXALIASWARN (posix_spawn_file_actions_addopen);
|
||||
# endif
|
||||
#elif defined GNULIB_POSIXCHECK
|
||||
# undef posix_spawn_file_actions_addopen
|
||||
# if HAVE_RAW_DECL_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN
|
||||
_GL_WARN_ON_USE (posix_spawn_file_actions_addopen,
|
||||
"posix_spawn_file_actions_addopen is unportable - "
|
||||
"use gnulib module posix_spawn_file_actions_addopen for portability");
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if @GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE@
|
||||
/* Add an action to FILE-ACTIONS which tells the implementation to call
|
||||
'close' for the given file descriptor during the 'spawn' call. */
|
||||
# if @REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE@
|
||||
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
|
||||
# define posix_spawn_file_actions_addclose rpl_posix_spawn_file_actions_addclose
|
||||
# endif
|
||||
_GL_FUNCDECL_RPL (posix_spawn_file_actions_addclose, int,
|
||||
(posix_spawn_file_actions_t *__file_actions, int __fd)
|
||||
__THROW _GL_ARG_NONNULL ((1)));
|
||||
_GL_CXXALIAS_RPL (posix_spawn_file_actions_addclose, int,
|
||||
(posix_spawn_file_actions_t *__file_actions, int __fd));
|
||||
# else
|
||||
# if !@HAVE_POSIX_SPAWN@
|
||||
_GL_FUNCDECL_SYS (posix_spawn_file_actions_addclose, int,
|
||||
(posix_spawn_file_actions_t *__file_actions, int __fd)
|
||||
__THROW _GL_ARG_NONNULL ((1)));
|
||||
# endif
|
||||
_GL_CXXALIAS_SYS (posix_spawn_file_actions_addclose, int,
|
||||
(posix_spawn_file_actions_t *__file_actions, int __fd));
|
||||
# endif
|
||||
# if __GLIBC__ >= 2
|
||||
_GL_CXXALIASWARN (posix_spawn_file_actions_addclose);
|
||||
# endif
|
||||
#elif defined GNULIB_POSIXCHECK
|
||||
# undef posix_spawn_file_actions_addclose
|
||||
# if HAVE_RAW_DECL_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE
|
||||
_GL_WARN_ON_USE (posix_spawn_file_actions_addclose,
|
||||
"posix_spawn_file_actions_addclose is unportable - "
|
||||
"use gnulib module posix_spawn_file_actions_addclose for portability");
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if @GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2@
|
||||
/* Add an action to FILE-ACTIONS which tells the implementation to call
|
||||
'dup2' for the given file descriptors during the 'spawn' call. */
|
||||
# if @REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2@
|
||||
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
|
||||
# define posix_spawn_file_actions_adddup2 rpl_posix_spawn_file_actions_adddup2
|
||||
# endif
|
||||
_GL_FUNCDECL_RPL (posix_spawn_file_actions_adddup2, int,
|
||||
(posix_spawn_file_actions_t *__file_actions,
|
||||
int __fd, int __newfd)
|
||||
__THROW _GL_ARG_NONNULL ((1)));
|
||||
_GL_CXXALIAS_RPL (posix_spawn_file_actions_adddup2, int,
|
||||
(posix_spawn_file_actions_t *__file_actions,
|
||||
int __fd, int __newfd));
|
||||
# else
|
||||
# if !@HAVE_POSIX_SPAWN@
|
||||
_GL_FUNCDECL_SYS (posix_spawn_file_actions_adddup2, int,
|
||||
(posix_spawn_file_actions_t *__file_actions,
|
||||
int __fd, int __newfd)
|
||||
__THROW _GL_ARG_NONNULL ((1)));
|
||||
# endif
|
||||
_GL_CXXALIAS_SYS (posix_spawn_file_actions_adddup2, int,
|
||||
(posix_spawn_file_actions_t *__file_actions,
|
||||
int __fd, int __newfd));
|
||||
# endif
|
||||
# if __GLIBC__ >= 2
|
||||
_GL_CXXALIASWARN (posix_spawn_file_actions_adddup2);
|
||||
# endif
|
||||
#elif defined GNULIB_POSIXCHECK
|
||||
# undef posix_spawn_file_actions_adddup2
|
||||
# if HAVE_RAW_DECL_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2
|
||||
_GL_WARN_ON_USE (posix_spawn_file_actions_adddup2,
|
||||
"posix_spawn_file_actions_adddup2 is unportable - "
|
||||
"use gnulib module posix_spawn_file_actions_adddup2 for portability");
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if @GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR@
|
||||
/* Add an action to FILE-ACTIONS which tells the implementation to call
|
||||
'chdir' to the given directory during the 'spawn' call. */
|
||||
# if @REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR@
|
||||
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
|
||||
# define posix_spawn_file_actions_addchdir rpl_posix_spawn_file_actions_addchdir
|
||||
# endif
|
||||
_GL_FUNCDECL_RPL (posix_spawn_file_actions_addchdir, int,
|
||||
(posix_spawn_file_actions_t *_Restrict_ __file_actions,
|
||||
const char *_Restrict_ __path)
|
||||
__THROW _GL_ARG_NONNULL ((1, 2)));
|
||||
_GL_CXXALIAS_RPL (posix_spawn_file_actions_addchdir, int,
|
||||
(posix_spawn_file_actions_t *_Restrict_ __file_actions,
|
||||
const char *_Restrict_ __path));
|
||||
# else
|
||||
# if !@HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR@
|
||||
_GL_FUNCDECL_SYS (posix_spawn_file_actions_addchdir, int,
|
||||
(posix_spawn_file_actions_t *_Restrict_ __file_actions,
|
||||
const char *_Restrict_ __path)
|
||||
__THROW _GL_ARG_NONNULL ((1, 2)));
|
||||
# endif
|
||||
_GL_CXXALIAS_SYS (posix_spawn_file_actions_addchdir, int,
|
||||
(posix_spawn_file_actions_t *_Restrict_ __file_actions,
|
||||
const char *_Restrict_ __path));
|
||||
# endif
|
||||
_GL_CXXALIASWARN (posix_spawn_file_actions_addchdir);
|
||||
#elif defined GNULIB_POSIXCHECK
|
||||
# undef posix_spawn_file_actions_addchdir
|
||||
# if HAVE_RAW_DECL_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR
|
||||
_GL_WARN_ON_USE (posix_spawn_file_actions_addchdir,
|
||||
"posix_spawn_file_actions_addchdir is unportable - "
|
||||
"use gnulib module posix_spawn_file_actions_addchdir for portability");
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if @GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR@
|
||||
/* Add an action to FILE-ACTIONS which tells the implementation to call
|
||||
'fchdir' to the given directory during the 'spawn' call. */
|
||||
# if @REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR@
|
||||
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
|
||||
# define posix_spawn_file_actions_addfchdir rpl_posix_spawn_file_actions_addfchdir
|
||||
# endif
|
||||
_GL_FUNCDECL_RPL (posix_spawn_file_actions_addfchdir, int,
|
||||
(posix_spawn_file_actions_t *_Restrict_ __file_actions,
|
||||
int __fd)
|
||||
__THROW _GL_ARG_NONNULL ((1)));
|
||||
_GL_CXXALIAS_RPL (posix_spawn_file_actions_addfchdir, int,
|
||||
(posix_spawn_file_actions_t *_Restrict_ __file_actions,
|
||||
int __fd));
|
||||
# else
|
||||
# if !@HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR@
|
||||
_GL_FUNCDECL_SYS (posix_spawn_file_actions_addfchdir, int,
|
||||
(posix_spawn_file_actions_t *_Restrict_ __file_actions,
|
||||
int __fd)
|
||||
__THROW _GL_ARG_NONNULL ((1)));
|
||||
# endif
|
||||
_GL_CXXALIAS_SYS (posix_spawn_file_actions_addfchdir, int,
|
||||
(posix_spawn_file_actions_t *_Restrict_ __file_actions,
|
||||
int __fd));
|
||||
# endif
|
||||
_GL_CXXALIASWARN (posix_spawn_file_actions_addfchdir);
|
||||
#elif defined GNULIB_POSIXCHECK
|
||||
# undef posix_spawn_file_actions_addfchdir
|
||||
# if HAVE_RAW_DECL_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR
|
||||
_GL_WARN_ON_USE (posix_spawn_file_actions_addfchdir,
|
||||
"posix_spawn_file_actions_addfchdir is unportable - "
|
||||
"use gnulib module posix_spawn_file_actions_addfchdir for portability");
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* _@GUARD_PREFIX@_SPAWN_H */
|
||||
#endif /* _@GUARD_PREFIX@_SPAWN_H */
|
|
@ -1,70 +0,0 @@
|
|||
/* Copyright (C) 2018-2020 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
/* Specification. */
|
||||
#include <spawn.h>
|
||||
|
||||
#include <errno.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#if REPLACE_POSIX_SPAWN
|
||||
# include "spawn_int.h"
|
||||
#endif
|
||||
|
||||
/* Add an action to FILE-ACTIONS which tells the implementation to call
|
||||
'chdir' to the given directory during the 'spawn' call. */
|
||||
int
|
||||
posix_spawn_file_actions_addchdir (posix_spawn_file_actions_t *file_actions,
|
||||
const char *path)
|
||||
#undef posix_spawn_file_actions_addchdir
|
||||
{
|
||||
#if !REPLACE_POSIX_SPAWN
|
||||
return posix_spawn_file_actions_addchdir_np (file_actions, path);
|
||||
#else
|
||||
{
|
||||
/* Copy PATH, because the caller may free it before calling posix_spawn()
|
||||
or posix_spawnp(). */
|
||||
char *path_copy = strdup (path);
|
||||
if (path_copy == NULL)
|
||||
return ENOMEM;
|
||||
|
||||
/* Allocate more memory if needed. */
|
||||
if (file_actions->_used == file_actions->_allocated
|
||||
&& __posix_spawn_file_actions_realloc (file_actions) != 0)
|
||||
{
|
||||
/* This can only mean we ran out of memory. */
|
||||
free (path_copy);
|
||||
return ENOMEM;
|
||||
}
|
||||
|
||||
{
|
||||
struct __spawn_action *rec;
|
||||
|
||||
/* Add the new value. */
|
||||
rec = &file_actions->_actions[file_actions->_used];
|
||||
rec->tag = spawn_do_chdir;
|
||||
rec->action.chdir_action.path = path_copy;
|
||||
|
||||
/* Account for the new entry. */
|
||||
++file_actions->_used;
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
|
@ -1,70 +0,0 @@
|
|||
/* Copyright (C) 2000, 2009-2020 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
/* Specification. */
|
||||
#include <spawn.h>
|
||||
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#if !_LIBC
|
||||
# define __sysconf(open_max) getdtablesize ()
|
||||
#endif
|
||||
|
||||
#if REPLACE_POSIX_SPAWN
|
||||
# include "spawn_int.h"
|
||||
#endif
|
||||
|
||||
/* Add an action to FILE-ACTIONS which tells the implementation to call
|
||||
'dup2' for the given file descriptors during the 'spawn' call. */
|
||||
int
|
||||
posix_spawn_file_actions_adddup2 (posix_spawn_file_actions_t *file_actions,
|
||||
int fd, int newfd)
|
||||
#undef posix_spawn_file_actions_adddup2
|
||||
{
|
||||
int maxfd = __sysconf (_SC_OPEN_MAX);
|
||||
|
||||
/* Test for the validity of the file descriptor. */
|
||||
if (fd < 0 || newfd < 0 || fd >= maxfd || newfd >= maxfd)
|
||||
return EBADF;
|
||||
|
||||
#if !REPLACE_POSIX_SPAWN
|
||||
return posix_spawn_file_actions_adddup2 (file_actions, fd, newfd);
|
||||
#else
|
||||
/* Allocate more memory if needed. */
|
||||
if (file_actions->_used == file_actions->_allocated
|
||||
&& __posix_spawn_file_actions_realloc (file_actions) != 0)
|
||||
/* This can only mean we ran out of memory. */
|
||||
return ENOMEM;
|
||||
|
||||
{
|
||||
struct __spawn_action *rec;
|
||||
|
||||
/* Add the new value. */
|
||||
rec = &file_actions->_actions[file_actions->_used];
|
||||
rec->tag = spawn_do_dup2;
|
||||
rec->action.dup2_action.fd = fd;
|
||||
rec->action.dup2_action.newfd = newfd;
|
||||
|
||||
/* Account for the new entry. */
|
||||
++file_actions->_used;
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
}
|
|
@ -1,61 +0,0 @@
|
|||
/* Copyright (C) 2000, 2009-2020 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
/* Specification. */
|
||||
#include <spawn.h>
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#if REPLACE_POSIX_SPAWN
|
||||
# include "spawn_int.h"
|
||||
#endif
|
||||
|
||||
/* Initialize data structure for file attribute for 'spawn' call. */
|
||||
int
|
||||
posix_spawn_file_actions_destroy (posix_spawn_file_actions_t *file_actions)
|
||||
#undef posix_spawn_file_actions_destroy
|
||||
{
|
||||
#if !REPLACE_POSIX_SPAWN
|
||||
return posix_spawn_file_actions_destroy (file_actions);
|
||||
#else
|
||||
int i;
|
||||
|
||||
/* Free the paths in the open actions. */
|
||||
for (i = 0; i < file_actions->_used; ++i)
|
||||
{
|
||||
struct __spawn_action *sa = &file_actions->_actions[i];
|
||||
switch (sa->tag)
|
||||
{
|
||||
case spawn_do_open:
|
||||
free (sa->action.open_action.path);
|
||||
break;
|
||||
case spawn_do_chdir:
|
||||
free (sa->action.chdir_action.path);
|
||||
break;
|
||||
default:
|
||||
/* No cleanup required. */
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* Free the array of actions. */
|
||||
free (file_actions->_actions);
|
||||
|
||||
return 0;
|
||||
#endif
|
||||
}
|
|
@ -1,56 +0,0 @@
|
|||
/* Copyright (C) 2000, 2009-2020 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
/* Specification. */
|
||||
#include <spawn.h>
|
||||
|
||||
#include <errno.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "spawn_int.h"
|
||||
|
||||
|
||||
/* Function used to increase the size of the allocated array. This
|
||||
function is called from the 'add'-functions. */
|
||||
int
|
||||
__posix_spawn_file_actions_realloc (posix_spawn_file_actions_t *file_actions)
|
||||
{
|
||||
int newalloc = file_actions->_allocated + 8;
|
||||
void *newmem = realloc (file_actions->_actions,
|
||||
newalloc * sizeof (struct __spawn_action));
|
||||
|
||||
if (newmem == NULL)
|
||||
/* Not enough memory. */
|
||||
return ENOMEM;
|
||||
|
||||
file_actions->_actions = (struct __spawn_action *) newmem;
|
||||
file_actions->_allocated = newalloc;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/* Initialize data structure for file attribute for 'spawn' call. */
|
||||
int
|
||||
posix_spawn_file_actions_init (posix_spawn_file_actions_t *file_actions)
|
||||
{
|
||||
/* Simply clear all the elements. */
|
||||
memset (file_actions, '\0', sizeof (*file_actions));
|
||||
return 0;
|
||||
}
|
|
@ -1,72 +0,0 @@
|
|||
/* Copyright (C) 2000, 2008-2020 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
/* Data structure to contain the action information. */
|
||||
struct __spawn_action
|
||||
{
|
||||
enum
|
||||
{
|
||||
spawn_do_close,
|
||||
spawn_do_dup2,
|
||||
spawn_do_open,
|
||||
spawn_do_chdir,
|
||||
spawn_do_fchdir
|
||||
} tag;
|
||||
|
||||
union
|
||||
{
|
||||
struct
|
||||
{
|
||||
int fd;
|
||||
} close_action;
|
||||
struct
|
||||
{
|
||||
int fd;
|
||||
int newfd;
|
||||
} dup2_action;
|
||||
struct
|
||||
{
|
||||
int fd;
|
||||
char *path;
|
||||
int oflag;
|
||||
mode_t mode;
|
||||
} open_action;
|
||||
struct
|
||||
{
|
||||
char *path;
|
||||
} chdir_action;
|
||||
struct
|
||||
{
|
||||
int fd;
|
||||
} fchdir_action;
|
||||
} action;
|
||||
};
|
||||
|
||||
#if !_LIBC
|
||||
# define __posix_spawn_file_actions_realloc gl_posix_spawn_file_actions_realloc
|
||||
#endif
|
||||
extern int __posix_spawn_file_actions_realloc (posix_spawn_file_actions_t *
|
||||
file_actions);
|
||||
|
||||
#if !_LIBC
|
||||
# define __spawni gl_posix_spawn_internal
|
||||
#endif
|
||||
extern int __spawni (pid_t *pid, const char *path,
|
||||
const posix_spawn_file_actions_t *file_actions,
|
||||
const posix_spawnattr_t *attrp, const char *const argv[],
|
||||
const char *const envp[], int use_path);
|
|
@ -1,28 +0,0 @@
|
|||
/* Copyright (C) 2000, 2009-2020 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
/* Specification. */
|
||||
#include <spawn.h>
|
||||
|
||||
/* Initialize data structure for file attribute for 'spawn' call. */
|
||||
int
|
||||
posix_spawnattr_destroy (posix_spawnattr_t *attr)
|
||||
{
|
||||
/* Nothing to do in the moment. */
|
||||
return 0;
|
||||
}
|
|
@ -1,33 +0,0 @@
|
|||
/* Copyright (C) 2000, 2009-2020 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
/* Specification. */
|
||||
#include <spawn.h>
|
||||
|
||||
#include <string.h>
|
||||
|
||||
/* Initialize data structure for file attribute for 'spawn' call. */
|
||||
int
|
||||
posix_spawnattr_init (posix_spawnattr_t *attr)
|
||||
{
|
||||
/* All elements have to be initialized to the default values which
|
||||
is generally zero. */
|
||||
memset (attr, '\0', sizeof (*attr));
|
||||
|
||||
return 0;
|
||||
}
|
|
@ -1,33 +0,0 @@
|
|||
/* Copyright (C) 2000, 2009-2020 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
/* Specification. */
|
||||
#include <spawn.h>
|
||||
|
||||
#include <string.h>
|
||||
|
||||
/* Set signal mask for signals with default handling in ATTR to SIGDEFAULT. */
|
||||
int
|
||||
posix_spawnattr_setsigdefault (posix_spawnattr_t *attr,
|
||||
const sigset_t *sigdefault)
|
||||
{
|
||||
/* Copy the sigset_t data to the user buffer. */
|
||||
memcpy (&attr->_sd, sigdefault, sizeof (sigset_t));
|
||||
|
||||
return 0;
|
||||
}
|
|
@ -1,45 +0,0 @@
|
|||
/* Copyright (C) 2000, 2004, 2009-2020 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
/* Specification. */
|
||||
#include <spawn.h>
|
||||
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
|
||||
#define ALL_FLAGS (POSIX_SPAWN_RESETIDS \
|
||||
| POSIX_SPAWN_SETPGROUP \
|
||||
| POSIX_SPAWN_SETSIGDEF \
|
||||
| POSIX_SPAWN_SETSIGMASK \
|
||||
| POSIX_SPAWN_SETSCHEDPARAM \
|
||||
| POSIX_SPAWN_SETSCHEDULER \
|
||||
| POSIX_SPAWN_USEVFORK)
|
||||
|
||||
/* Store flags in the attribute structure. */
|
||||
int
|
||||
posix_spawnattr_setflags (posix_spawnattr_t *attr, short int flags)
|
||||
{
|
||||
/* Check no invalid bits are set. */
|
||||
if (flags & ~ALL_FLAGS)
|
||||
return EINVAL;
|
||||
|
||||
/* Store the flag word. */
|
||||
attr->_flags = flags;
|
||||
|
||||
return 0;
|
||||
}
|
|
@ -1,32 +0,0 @@
|
|||
/* Copyright (C) 2000, 2009-2020 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
/* Specification. */
|
||||
#include <spawn.h>
|
||||
|
||||
#include <string.h>
|
||||
|
||||
/* Store process group ID in the attribute structure. */
|
||||
int
|
||||
posix_spawnattr_setpgroup (posix_spawnattr_t *attr, pid_t pgroup)
|
||||
{
|
||||
/* Store the process group ID. */
|
||||
attr->_pgrp = pgroup;
|
||||
|
||||
return 0;
|
||||
}
|
|
@ -1,33 +0,0 @@
|
|||
/* Copyright (C) 2000, 2009-2020 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
/* Specification. */
|
||||
#include <spawn.h>
|
||||
|
||||
#include <string.h>
|
||||
|
||||
/* Set signal mask for the new process in ATTR to SIGMASK. */
|
||||
int
|
||||
posix_spawnattr_setsigmask (posix_spawnattr_t *attr,
|
||||
const sigset_t *sigmask)
|
||||
{
|
||||
/* Copy the sigset_t data to the user buffer. */
|
||||
memcpy (&attr->_ss, sigmask, sizeof (sigset_t));
|
||||
|
||||
return 0;
|
||||
}
|
349
lib/spawni.c
349
lib/spawni.c
|
@ -1,349 +0,0 @@
|
|||
/* Guts of POSIX spawn interface. Generic POSIX.1 version.
|
||||
Copyright (C) 2000-2006, 2008-2020 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
/* Specification. */
|
||||
#include <spawn.h>
|
||||
#include "spawn_int.h"
|
||||
|
||||
#include <alloca.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include <fcntl.h>
|
||||
#ifndef O_LARGEFILE
|
||||
# define O_LARGEFILE 0
|
||||
#endif
|
||||
|
||||
#if _LIBC || HAVE_PATHS_H
|
||||
# include <paths.h>
|
||||
#else
|
||||
# define _PATH_BSHELL BOURNE_SHELL
|
||||
#endif
|
||||
|
||||
#include <signal.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#if _LIBC
|
||||
# include <not-cancel.h>
|
||||
#else
|
||||
# define close_not_cancel close
|
||||
# define open_not_cancel open
|
||||
#endif
|
||||
|
||||
#if _LIBC
|
||||
# include <local-setxid.h>
|
||||
#else
|
||||
# if !HAVE_SETEUID
|
||||
# define seteuid(id) setresuid (-1, id, -1)
|
||||
# endif
|
||||
# if !HAVE_SETEGID
|
||||
# define setegid(id) setresgid (-1, id, -1)
|
||||
# endif
|
||||
# define local_seteuid(id) seteuid (id)
|
||||
# define local_setegid(id) setegid (id)
|
||||
#endif
|
||||
|
||||
#if _LIBC
|
||||
# define alloca __alloca
|
||||
# define execve __execve
|
||||
# define dup2 __dup2
|
||||
# define fork __fork
|
||||
# define getgid __getgid
|
||||
# define getuid __getuid
|
||||
# define sched_setparam __sched_setparam
|
||||
# define sched_setscheduler __sched_setscheduler
|
||||
# define setpgid __setpgid
|
||||
# define sigaction __sigaction
|
||||
# define sigismember __sigismember
|
||||
# define sigprocmask __sigprocmask
|
||||
# define strchrnul __strchrnul
|
||||
# define vfork __vfork
|
||||
#endif
|
||||
|
||||
|
||||
/* The Unix standard contains a long explanation of the way to signal
|
||||
an error after the fork() was successful. Since no new wait status
|
||||
was wanted there is no way to signal an error using one of the
|
||||
available methods. The committee chose to signal an error by a
|
||||
normal program exit with the exit code 127. */
|
||||
#define SPAWN_ERROR 127
|
||||
|
||||
|
||||
#if defined _WIN32 && ! defined __CYGWIN__
|
||||
|
||||
/* Native Windows API. */
|
||||
int
|
||||
__spawni (pid_t *pid, const char *file,
|
||||
const posix_spawn_file_actions_t *file_actions,
|
||||
const posix_spawnattr_t *attrp, const char *const argv[],
|
||||
const char *const envp[], int use_path)
|
||||
{
|
||||
/* Not yet implemented. */
|
||||
return ENOSYS;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
|
||||
/* Spawn a new process executing PATH with the attributes describes in *ATTRP.
|
||||
Before running the process perform the actions described in FILE-ACTIONS. */
|
||||
int
|
||||
__spawni (pid_t *pid, const char *file,
|
||||
const posix_spawn_file_actions_t *file_actions,
|
||||
const posix_spawnattr_t *attrp, const char *const argv[],
|
||||
const char *const envp[], int use_path)
|
||||
{
|
||||
pid_t new_pid;
|
||||
char *path, *p, *name;
|
||||
size_t len;
|
||||
size_t pathlen;
|
||||
|
||||
/* Do this once. */
|
||||
short int flags = attrp == NULL ? 0 : attrp->_flags;
|
||||
|
||||
/* Avoid gcc warning
|
||||
"variable 'flags' might be clobbered by 'longjmp' or 'vfork'" */
|
||||
(void) &flags;
|
||||
|
||||
/* Generate the new process. */
|
||||
#if HAVE_VFORK
|
||||
if ((flags & POSIX_SPAWN_USEVFORK) != 0
|
||||
/* If no major work is done, allow using vfork. Note that we
|
||||
might perform the path searching. But this would be done by
|
||||
a call to execvp(), too, and such a call must be OK according
|
||||
to POSIX. */
|
||||
|| ((flags & (POSIX_SPAWN_SETSIGMASK | POSIX_SPAWN_SETSIGDEF
|
||||
| POSIX_SPAWN_SETSCHEDPARAM | POSIX_SPAWN_SETSCHEDULER
|
||||
| POSIX_SPAWN_SETPGROUP | POSIX_SPAWN_RESETIDS)) == 0
|
||||
&& file_actions == NULL))
|
||||
new_pid = vfork ();
|
||||
else
|
||||
#endif
|
||||
new_pid = fork ();
|
||||
|
||||
if (new_pid != 0)
|
||||
{
|
||||
if (new_pid < 0)
|
||||
return errno;
|
||||
|
||||
/* The call was successful. Store the PID if necessary. */
|
||||
if (pid != NULL)
|
||||
*pid = new_pid;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Set signal mask. */
|
||||
if ((flags & POSIX_SPAWN_SETSIGMASK) != 0
|
||||
&& sigprocmask (SIG_SETMASK, &attrp->_ss, NULL) != 0)
|
||||
_exit (SPAWN_ERROR);
|
||||
|
||||
/* Set signal default action. */
|
||||
if ((flags & POSIX_SPAWN_SETSIGDEF) != 0)
|
||||
{
|
||||
/* We have to iterate over all signals. This could possibly be
|
||||
done better but it requires system specific solutions since
|
||||
the sigset_t data type can be very different on different
|
||||
architectures. */
|
||||
int sig;
|
||||
struct sigaction sa;
|
||||
|
||||
memset (&sa, '\0', sizeof (sa));
|
||||
sa.sa_handler = SIG_DFL;
|
||||
|
||||
for (sig = 1; sig <= NSIG; ++sig)
|
||||
if (sigismember (&attrp->_sd, sig) != 0
|
||||
&& sigaction (sig, &sa, NULL) != 0)
|
||||
_exit (SPAWN_ERROR);
|
||||
|
||||
}
|
||||
|
||||
#if (_LIBC ? defined _POSIX_PRIORITY_SCHEDULING : HAVE_SCHED_SETPARAM && HAVE_SCHED_SETSCHEDULER)
|
||||
/* Set the scheduling algorithm and parameters. */
|
||||
if ((flags & (POSIX_SPAWN_SETSCHEDPARAM | POSIX_SPAWN_SETSCHEDULER))
|
||||
== POSIX_SPAWN_SETSCHEDPARAM)
|
||||
{
|
||||
if (sched_setparam (0, &attrp->_sp) == -1)
|
||||
_exit (SPAWN_ERROR);
|
||||
}
|
||||
else if ((flags & POSIX_SPAWN_SETSCHEDULER) != 0)
|
||||
{
|
||||
if (sched_setscheduler (0, attrp->_policy,
|
||||
(flags & POSIX_SPAWN_SETSCHEDPARAM) != 0
|
||||
? &attrp->_sp : NULL) == -1)
|
||||
_exit (SPAWN_ERROR);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Set the process group ID. */
|
||||
if ((flags & POSIX_SPAWN_SETPGROUP) != 0
|
||||
&& setpgid (0, attrp->_pgrp) != 0)
|
||||
_exit (SPAWN_ERROR);
|
||||
|
||||
/* Set the effective user and group IDs. */
|
||||
if ((flags & POSIX_SPAWN_RESETIDS) != 0
|
||||
&& (local_seteuid (getuid ()) != 0
|
||||
|| local_setegid (getgid ()) != 0))
|
||||
_exit (SPAWN_ERROR);
|
||||
|
||||
/* Execute the file actions. */
|
||||
if (file_actions != NULL)
|
||||
{
|
||||
int cnt;
|
||||
|
||||
for (cnt = 0; cnt < file_actions->_used; ++cnt)
|
||||
{
|
||||
struct __spawn_action *action = &file_actions->_actions[cnt];
|
||||
|
||||
switch (action->tag)
|
||||
{
|
||||
case spawn_do_close:
|
||||
if (close_not_cancel (action->action.close_action.fd) != 0)
|
||||
/* Signal the error. */
|
||||
_exit (SPAWN_ERROR);
|
||||
break;
|
||||
|
||||
case spawn_do_open:
|
||||
{
|
||||
int new_fd = open_not_cancel (action->action.open_action.path,
|
||||
action->action.open_action.oflag
|
||||
| O_LARGEFILE,
|
||||
action->action.open_action.mode);
|
||||
|
||||
if (new_fd == -1)
|
||||
/* The 'open' call failed. */
|
||||
_exit (SPAWN_ERROR);
|
||||
|
||||
/* Make sure the desired file descriptor is used. */
|
||||
if (new_fd != action->action.open_action.fd)
|
||||
{
|
||||
if (dup2 (new_fd, action->action.open_action.fd)
|
||||
!= action->action.open_action.fd)
|
||||
/* The 'dup2' call failed. */
|
||||
_exit (SPAWN_ERROR);
|
||||
|
||||
if (close_not_cancel (new_fd) != 0)
|
||||
/* The 'close' call failed. */
|
||||
_exit (SPAWN_ERROR);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case spawn_do_dup2:
|
||||
if (dup2 (action->action.dup2_action.fd,
|
||||
action->action.dup2_action.newfd)
|
||||
!= action->action.dup2_action.newfd)
|
||||
/* The 'dup2' call failed. */
|
||||
_exit (SPAWN_ERROR);
|
||||
break;
|
||||
|
||||
case spawn_do_chdir:
|
||||
if (chdir (action->action.chdir_action.path) < 0)
|
||||
/* The 'chdir' call failed. */
|
||||
_exit (SPAWN_ERROR);
|
||||
break;
|
||||
|
||||
case spawn_do_fchdir:
|
||||
if (fchdir (action->action.fchdir_action.fd) < 0)
|
||||
/* The 'fchdir' call failed. */
|
||||
_exit (SPAWN_ERROR);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (! use_path || strchr (file, '/') != NULL)
|
||||
{
|
||||
/* The FILE parameter is actually a path. */
|
||||
execve (file, (char * const *) argv, (char * const *) envp);
|
||||
|
||||
/* Oh, oh. 'execve' returns. This is bad. */
|
||||
_exit (SPAWN_ERROR);
|
||||
}
|
||||
|
||||
/* We have to search for FILE on the path. */
|
||||
path = getenv ("PATH");
|
||||
if (path == NULL)
|
||||
{
|
||||
#if HAVE_CONFSTR
|
||||
/* There is no 'PATH' in the environment.
|
||||
The default search path is the current directory
|
||||
followed by the path 'confstr' returns for '_CS_PATH'. */
|
||||
len = confstr (_CS_PATH, (char *) NULL, 0);
|
||||
path = (char *) alloca (1 + len);
|
||||
path[0] = ':';
|
||||
(void) confstr (_CS_PATH, path + 1, len);
|
||||
#else
|
||||
/* Pretend that the PATH contains only the current directory. */
|
||||
path = "";
|
||||
#endif
|
||||
}
|
||||
|
||||
len = strlen (file) + 1;
|
||||
pathlen = strlen (path);
|
||||
name = alloca (pathlen + len + 1);
|
||||
/* Copy the file name at the top. */
|
||||
name = (char *) memcpy (name + pathlen + 1, file, len);
|
||||
/* And add the slash. */
|
||||
*--name = '/';
|
||||
|
||||
p = path;
|
||||
do
|
||||
{
|
||||
char *startp;
|
||||
|
||||
path = p;
|
||||
p = strchrnul (path, ':');
|
||||
|
||||
if (p == path)
|
||||
/* Two adjacent colons, or a colon at the beginning or the end
|
||||
of 'PATH' means to search the current directory. */
|
||||
startp = name + 1;
|
||||
else
|
||||
startp = (char *) memcpy (name - (p - path), path, p - path);
|
||||
|
||||
/* Try to execute this name. If it works, execv will not return. */
|
||||
execve (startp, (char * const *) argv, (char * const *) envp);
|
||||
|
||||
switch (errno)
|
||||
{
|
||||
case EACCES:
|
||||
case ENOENT:
|
||||
case ESTALE:
|
||||
case ENOTDIR:
|
||||
/* Those errors indicate the file is missing or not executable
|
||||
by us, in which case we want to just try the next path
|
||||
directory. */
|
||||
break;
|
||||
|
||||
default:
|
||||
/* Some other error means we found an executable file, but
|
||||
something went wrong executing it; return the error to our
|
||||
caller. */
|
||||
_exit (SPAWN_ERROR);
|
||||
}
|
||||
}
|
||||
while (*p++ != '\0');
|
||||
|
||||
/* Return with an error. */
|
||||
_exit (SPAWN_ERROR);
|
||||
}
|
||||
|
||||
#endif
|
142
lib/strchrnul.c
142
lib/strchrnul.c
|
@ -1,142 +0,0 @@
|
|||
/* Searching in a string.
|
||||
Copyright (C) 2003, 2007-2020 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
/* Specification. */
|
||||
#include <string.h>
|
||||
|
||||
/* Find the first occurrence of C in S or the final NUL byte. */
|
||||
char *
|
||||
strchrnul (const char *s, int c_in)
|
||||
{
|
||||
/* On 32-bit hardware, choosing longword to be a 32-bit unsigned
|
||||
long instead of a 64-bit uintmax_t tends to give better
|
||||
performance. On 64-bit hardware, unsigned long is generally 64
|
||||
bits already. Change this typedef to experiment with
|
||||
performance. */
|
||||
typedef unsigned long int longword;
|
||||
|
||||
const unsigned char *char_ptr;
|
||||
const longword *longword_ptr;
|
||||
longword repeated_one;
|
||||
longword repeated_c;
|
||||
unsigned char c;
|
||||
|
||||
c = (unsigned char) c_in;
|
||||
if (!c)
|
||||
return rawmemchr (s, 0);
|
||||
|
||||
/* Handle the first few bytes by reading one byte at a time.
|
||||
Do this until CHAR_PTR is aligned on a longword boundary. */
|
||||
for (char_ptr = (const unsigned char *) s;
|
||||
(size_t) char_ptr % sizeof (longword) != 0;
|
||||
++char_ptr)
|
||||
if (!*char_ptr || *char_ptr == c)
|
||||
return (char *) char_ptr;
|
||||
|
||||
longword_ptr = (const longword *) char_ptr;
|
||||
|
||||
/* All these elucidatory comments refer to 4-byte longwords,
|
||||
but the theory applies equally well to any size longwords. */
|
||||
|
||||
/* Compute auxiliary longword values:
|
||||
repeated_one is a value which has a 1 in every byte.
|
||||
repeated_c has c in every byte. */
|
||||
repeated_one = 0x01010101;
|
||||
repeated_c = c | (c << 8);
|
||||
repeated_c |= repeated_c << 16;
|
||||
if (0xffffffffU < (longword) -1)
|
||||
{
|
||||
repeated_one |= repeated_one << 31 << 1;
|
||||
repeated_c |= repeated_c << 31 << 1;
|
||||
if (8 < sizeof (longword))
|
||||
{
|
||||
size_t i;
|
||||
|
||||
for (i = 64; i < sizeof (longword) * 8; i *= 2)
|
||||
{
|
||||
repeated_one |= repeated_one << i;
|
||||
repeated_c |= repeated_c << i;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Instead of the traditional loop which tests each byte, we will
|
||||
test a longword at a time. The tricky part is testing if *any of
|
||||
the four* bytes in the longword in question are equal to NUL or
|
||||
c. We first use an xor with repeated_c. This reduces the task
|
||||
to testing whether *any of the four* bytes in longword1 or
|
||||
longword2 is zero.
|
||||
|
||||
Let's consider longword1. We compute tmp =
|
||||
((longword1 - repeated_one) & ~longword1) & (repeated_one << 7).
|
||||
That is, we perform the following operations:
|
||||
1. Subtract repeated_one.
|
||||
2. & ~longword1.
|
||||
3. & a mask consisting of 0x80 in every byte.
|
||||
Consider what happens in each byte:
|
||||
- If a byte of longword1 is zero, step 1 and 2 transform it into 0xff,
|
||||
and step 3 transforms it into 0x80. A carry can also be propagated
|
||||
to more significant bytes.
|
||||
- If a byte of longword1 is nonzero, let its lowest 1 bit be at
|
||||
position k (0 <= k <= 7); so the lowest k bits are 0. After step 1,
|
||||
the byte ends in a single bit of value 0 and k bits of value 1.
|
||||
After step 2, the result is just k bits of value 1: 2^k - 1. After
|
||||
step 3, the result is 0. And no carry is produced.
|
||||
So, if longword1 has only non-zero bytes, tmp is zero.
|
||||
Whereas if longword1 has a zero byte, call j the position of the least
|
||||
significant zero byte. Then the result has a zero at positions 0, ...,
|
||||
j-1 and a 0x80 at position j. We cannot predict the result at the more
|
||||
significant bytes (positions j+1..3), but it does not matter since we
|
||||
already have a non-zero bit at position 8*j+7.
|
||||
|
||||
The test whether any byte in longword1 or longword2 is zero is equivalent
|
||||
to testing whether tmp1 is nonzero or tmp2 is nonzero. We can combine
|
||||
this into a single test, whether (tmp1 | tmp2) is nonzero.
|
||||
|
||||
This test can read more than one byte beyond the end of a string,
|
||||
depending on where the terminating NUL is encountered. However,
|
||||
this is considered safe since the initialization phase ensured
|
||||
that the read will be aligned, therefore, the read will not cross
|
||||
page boundaries and will not cause a fault. */
|
||||
|
||||
while (1)
|
||||
{
|
||||
longword longword1 = *longword_ptr ^ repeated_c;
|
||||
longword longword2 = *longword_ptr;
|
||||
|
||||
if (((((longword1 - repeated_one) & ~longword1)
|
||||
| ((longword2 - repeated_one) & ~longword2))
|
||||
& (repeated_one << 7)) != 0)
|
||||
break;
|
||||
longword_ptr++;
|
||||
}
|
||||
|
||||
char_ptr = (const unsigned char *) longword_ptr;
|
||||
|
||||
/* At this point, we know that one of the sizeof (longword) bytes
|
||||
starting at char_ptr is == 0 or == c. On little-endian machines,
|
||||
we could determine the first such byte without any further memory
|
||||
accesses, just by looking at the tmp result from the last loop
|
||||
iteration. But this does not work on big-endian machines.
|
||||
Choose code that works in both cases. */
|
||||
|
||||
char_ptr = (unsigned char *) longword_ptr;
|
||||
while (*char_ptr && (*char_ptr != c))
|
||||
char_ptr++;
|
||||
return (char *) char_ptr;
|
||||
}
|
|
@ -1,28 +0,0 @@
|
|||
# Suppress a valgrind message about use of uninitialized memory in strchrnul().
|
||||
|
||||
# Copyright (C) 2008-2020 Free Software Foundation, Inc.
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
# This use is OK because it provides only a speedup.
|
||||
{
|
||||
strchrnul-value4
|
||||
Memcheck:Value4
|
||||
fun:strchrnul
|
||||
}
|
||||
{
|
||||
strchrnul-value8
|
||||
Memcheck:Value8
|
||||
fun:strchrnul
|
||||
}
|
|
@ -139,18 +139,6 @@ AC_DEFUN([gl_EARLY],
|
|||
# Code from module openat-h:
|
||||
# Code from module pathmax:
|
||||
# Code from module pipe2:
|
||||
# Code from module posix_spawn:
|
||||
# Code from module posix_spawn-internal:
|
||||
# Code from module posix_spawn_file_actions_addchdir:
|
||||
# Code from module posix_spawn_file_actions_adddup2:
|
||||
# Code from module posix_spawn_file_actions_destroy:
|
||||
# Code from module posix_spawn_file_actions_init:
|
||||
# Code from module posix_spawnattr_destroy:
|
||||
# Code from module posix_spawnattr_init:
|
||||
# Code from module posix_spawnattr_setflags:
|
||||
# Code from module posix_spawnattr_setpgroup:
|
||||
# Code from module posix_spawnattr_setsigdefault:
|
||||
# Code from module posix_spawnattr_setsigmask:
|
||||
# Code from module pselect:
|
||||
# Code from module pthread_sigmask:
|
||||
# Code from module qcopy-acl:
|
||||
|
@ -159,9 +147,7 @@ AC_DEFUN([gl_EARLY],
|
|||
# Code from module readlinkat:
|
||||
# Code from module regex:
|
||||
# Code from module root-uid:
|
||||
# Code from module sched:
|
||||
# Code from module scratch_buffer:
|
||||
# Code from module sh-filename:
|
||||
# Code from module sig2str:
|
||||
# Code from module sigdescr_np:
|
||||
# Code from module signal-h:
|
||||
|
@ -170,7 +156,6 @@ AC_DEFUN([gl_EARLY],
|
|||
# Code from module snippet/c++defs:
|
||||
# Code from module snippet/warn-on-use:
|
||||
# Code from module socklen:
|
||||
# Code from module spawn:
|
||||
# Code from module ssize_t:
|
||||
# Code from module stat-time:
|
||||
# Code from module std-gnu11:
|
||||
|
@ -180,7 +165,6 @@ AC_DEFUN([gl_EARLY],
|
|||
# Code from module stdio:
|
||||
# Code from module stdlib:
|
||||
# Code from module stpcpy:
|
||||
# Code from module strchrnul:
|
||||
# Code from module string:
|
||||
# Code from module strnlen:
|
||||
# Code from module strtoimax:
|
||||
|
@ -419,61 +403,6 @@ AC_DEFUN([gl_INIT],
|
|||
gl_PATHMAX
|
||||
gl_FUNC_PIPE2
|
||||
gl_UNISTD_MODULE_INDICATOR([pipe2])
|
||||
gl_POSIX_SPAWN
|
||||
if test $HAVE_POSIX_SPAWN = 0 || test $REPLACE_POSIX_SPAWN = 1; then
|
||||
AC_LIBOBJ([spawn])
|
||||
fi
|
||||
gl_SPAWN_MODULE_INDICATOR([posix_spawn])
|
||||
gl_FUNC_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR
|
||||
if test $HAVE_POSIX_SPAWN = 0 || test $REPLACE_POSIX_SPAWN = 1 || test $HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR = 0 || test $REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR = 1; then
|
||||
AC_LIBOBJ([spawn_faction_addchdir])
|
||||
fi
|
||||
gl_SPAWN_MODULE_INDICATOR([posix_spawn_file_actions_addchdir])
|
||||
gl_FUNC_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2
|
||||
if test $HAVE_POSIX_SPAWN = 0 || test $REPLACE_POSIX_SPAWN = 1 || test $REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2 = 1; then
|
||||
AC_LIBOBJ([spawn_faction_adddup2])
|
||||
fi
|
||||
gl_SPAWN_MODULE_INDICATOR([posix_spawn_file_actions_adddup2])
|
||||
gl_POSIX_SPAWN
|
||||
if test $HAVE_POSIX_SPAWN = 0 || test $REPLACE_POSIX_SPAWN = 1; then
|
||||
AC_LIBOBJ([spawn_faction_destroy])
|
||||
fi
|
||||
gl_SPAWN_MODULE_INDICATOR([posix_spawn_file_actions_destroy])
|
||||
gl_POSIX_SPAWN
|
||||
if test $HAVE_POSIX_SPAWN = 0 || test $REPLACE_POSIX_SPAWN = 1; then
|
||||
AC_LIBOBJ([spawn_faction_init])
|
||||
fi
|
||||
gl_SPAWN_MODULE_INDICATOR([posix_spawn_file_actions_init])
|
||||
gl_POSIX_SPAWN
|
||||
if test $HAVE_POSIX_SPAWN = 0 || test $REPLACE_POSIX_SPAWN = 1; then
|
||||
AC_LIBOBJ([spawnattr_destroy])
|
||||
fi
|
||||
gl_SPAWN_MODULE_INDICATOR([posix_spawnattr_destroy])
|
||||
gl_POSIX_SPAWN
|
||||
if test $HAVE_POSIX_SPAWN = 0 || test $REPLACE_POSIX_SPAWN = 1; then
|
||||
AC_LIBOBJ([spawnattr_init])
|
||||
fi
|
||||
gl_SPAWN_MODULE_INDICATOR([posix_spawnattr_init])
|
||||
gl_POSIX_SPAWN
|
||||
if test $HAVE_POSIX_SPAWN = 0 || test $REPLACE_POSIX_SPAWN = 1; then
|
||||
AC_LIBOBJ([spawnattr_setflags])
|
||||
fi
|
||||
gl_SPAWN_MODULE_INDICATOR([posix_spawnattr_setflags])
|
||||
gl_POSIX_SPAWN
|
||||
if test $HAVE_POSIX_SPAWN = 0 || test $REPLACE_POSIX_SPAWN = 1; then
|
||||
AC_LIBOBJ([spawnattr_setpgroup])
|
||||
fi
|
||||
gl_SPAWN_MODULE_INDICATOR([posix_spawnattr_setpgroup])
|
||||
gl_POSIX_SPAWN
|
||||
if test $HAVE_POSIX_SPAWN = 0 || test $REPLACE_POSIX_SPAWN = 1; then
|
||||
AC_LIBOBJ([spawnattr_setdefault])
|
||||
fi
|
||||
gl_SPAWN_MODULE_INDICATOR([posix_spawnattr_setsigdefault])
|
||||
gl_POSIX_SPAWN
|
||||
if test $HAVE_POSIX_SPAWN = 0 || test $REPLACE_POSIX_SPAWN = 1; then
|
||||
AC_LIBOBJ([spawnattr_setsigmask])
|
||||
fi
|
||||
gl_SPAWN_MODULE_INDICATOR([posix_spawnattr_setsigmask])
|
||||
gl_FUNC_PSELECT
|
||||
if test $HAVE_PSELECT = 0 || test $REPLACE_PSELECT = 1; then
|
||||
AC_LIBOBJ([pselect])
|
||||
|
@ -501,7 +430,6 @@ AC_DEFUN([gl_INIT],
|
|||
AC_LIBOBJ([regex])
|
||||
gl_PREREQ_REGEX
|
||||
fi
|
||||
gl_SCHED_H
|
||||
gl_FUNC_SIG2STR
|
||||
if test $ac_cv_func_sig2str = no; then
|
||||
AC_LIBOBJ([sig2str])
|
||||
|
@ -514,7 +442,6 @@ AC_DEFUN([gl_INIT],
|
|||
gl_STRING_MODULE_INDICATOR([sigdescr_np])
|
||||
gl_SIGNAL_H
|
||||
gl_TYPE_SOCKLEN_T
|
||||
gl_SPAWN_H
|
||||
gt_TYPE_SSIZE_T
|
||||
gl_STAT_TIME
|
||||
gl_STAT_BIRTHTIME
|
||||
|
@ -601,12 +528,9 @@ AC_DEFUN([gl_INIT],
|
|||
gl_gnulib_enabled_5264294aa0a5557541b53c8c741f7f31=false
|
||||
gl_gnulib_enabled_open=false
|
||||
gl_gnulib_enabled_03e0aaad4cb89ca757653bd367a6ccb7=false
|
||||
gl_gnulib_enabled_332607f759618fb73dfc3076748afea7=false
|
||||
gl_gnulib_enabled_rawmemchr=false
|
||||
gl_gnulib_enabled_6099e9737f757db36c47fa9d9f02e88c=false
|
||||
gl_gnulib_enabled_scratch_buffer=false
|
||||
gl_gnulib_enabled_cdeb0f2aaf9d280baa6526bfa1b07f70=false
|
||||
gl_gnulib_enabled_strchrnul=false
|
||||
gl_gnulib_enabled_strtoll=false
|
||||
gl_gnulib_enabled_utimens=false
|
||||
gl_gnulib_enabled_682e609604ccaac6be382e4ee3a4eaec=false
|
||||
|
@ -761,20 +685,6 @@ AC_DEFUN([gl_INIT],
|
|||
gl_gnulib_enabled_03e0aaad4cb89ca757653bd367a6ccb7=true
|
||||
fi
|
||||
}
|
||||
func_gl_gnulib_m4code_332607f759618fb73dfc3076748afea7 ()
|
||||
{
|
||||
if ! $gl_gnulib_enabled_332607f759618fb73dfc3076748afea7; then
|
||||
gl_POSIX_SPAWN
|
||||
if test $HAVE_POSIX_SPAWN = 0 || test $REPLACE_POSIX_SPAWN = 1; then
|
||||
AC_LIBOBJ([spawni])
|
||||
gl_PREREQ_POSIX_SPAWN_INTERNAL
|
||||
fi
|
||||
gl_gnulib_enabled_332607f759618fb73dfc3076748afea7=true
|
||||
func_gl_gnulib_m4code_open
|
||||
func_gl_gnulib_m4code_cdeb0f2aaf9d280baa6526bfa1b07f70
|
||||
func_gl_gnulib_m4code_strchrnul
|
||||
fi
|
||||
}
|
||||
func_gl_gnulib_m4code_rawmemchr ()
|
||||
{
|
||||
if ! $gl_gnulib_enabled_rawmemchr; then
|
||||
|
@ -799,28 +709,6 @@ AC_DEFUN([gl_INIT],
|
|||
gl_gnulib_enabled_scratch_buffer=true
|
||||
fi
|
||||
}
|
||||
func_gl_gnulib_m4code_cdeb0f2aaf9d280baa6526bfa1b07f70 ()
|
||||
{
|
||||
if ! $gl_gnulib_enabled_cdeb0f2aaf9d280baa6526bfa1b07f70; then
|
||||
gl_SH_FILENAME
|
||||
gl_gnulib_enabled_cdeb0f2aaf9d280baa6526bfa1b07f70=true
|
||||
fi
|
||||
}
|
||||
func_gl_gnulib_m4code_strchrnul ()
|
||||
{
|
||||
if ! $gl_gnulib_enabled_strchrnul; then
|
||||
gl_FUNC_STRCHRNUL
|
||||
if test $HAVE_STRCHRNUL = 0 || test $REPLACE_STRCHRNUL = 1; then
|
||||
AC_LIBOBJ([strchrnul])
|
||||
gl_PREREQ_STRCHRNUL
|
||||
fi
|
||||
gl_STRING_MODULE_INDICATOR([strchrnul])
|
||||
gl_gnulib_enabled_strchrnul=true
|
||||
if test $HAVE_STRCHRNUL = 0 || test $REPLACE_STRCHRNUL = 1; then
|
||||
func_gl_gnulib_m4code_rawmemchr
|
||||
fi
|
||||
fi
|
||||
}
|
||||
func_gl_gnulib_m4code_strtoll ()
|
||||
{
|
||||
if ! $gl_gnulib_enabled_strtoll; then
|
||||
|
@ -903,12 +791,6 @@ AC_DEFUN([gl_INIT],
|
|||
if case $host_os in mingw*) false;; *) test $HAVE_GETRANDOM = 0 || test $REPLACE_GETRANDOM = 1;; esac; then
|
||||
func_gl_gnulib_m4code_open
|
||||
fi
|
||||
if test $HAVE_POSIX_SPAWN = 0 || test $REPLACE_POSIX_SPAWN = 1; then
|
||||
func_gl_gnulib_m4code_332607f759618fb73dfc3076748afea7
|
||||
fi
|
||||
if test $HAVE_POSIX_SPAWN = 0 || test $REPLACE_POSIX_SPAWN = 1 || test $REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2 = 1; then
|
||||
func_gl_gnulib_m4code_getdtablesize
|
||||
fi
|
||||
if test $HAVE_READLINKAT = 0 || test $REPLACE_READLINKAT = 1; then
|
||||
func_gl_gnulib_m4code_260941c0e5dc67ec9e87d1fb321c300b
|
||||
fi
|
||||
|
@ -948,12 +830,9 @@ AC_DEFUN([gl_INIT],
|
|||
AM_CONDITIONAL([gl_GNULIB_ENABLED_5264294aa0a5557541b53c8c741f7f31], [$gl_gnulib_enabled_5264294aa0a5557541b53c8c741f7f31])
|
||||
AM_CONDITIONAL([gl_GNULIB_ENABLED_open], [$gl_gnulib_enabled_open])
|
||||
AM_CONDITIONAL([gl_GNULIB_ENABLED_03e0aaad4cb89ca757653bd367a6ccb7], [$gl_gnulib_enabled_03e0aaad4cb89ca757653bd367a6ccb7])
|
||||
AM_CONDITIONAL([gl_GNULIB_ENABLED_332607f759618fb73dfc3076748afea7], [$gl_gnulib_enabled_332607f759618fb73dfc3076748afea7])
|
||||
AM_CONDITIONAL([gl_GNULIB_ENABLED_rawmemchr], [$gl_gnulib_enabled_rawmemchr])
|
||||
AM_CONDITIONAL([gl_GNULIB_ENABLED_6099e9737f757db36c47fa9d9f02e88c], [$gl_gnulib_enabled_6099e9737f757db36c47fa9d9f02e88c])
|
||||
AM_CONDITIONAL([gl_GNULIB_ENABLED_scratch_buffer], [$gl_gnulib_enabled_scratch_buffer])
|
||||
AM_CONDITIONAL([gl_GNULIB_ENABLED_cdeb0f2aaf9d280baa6526bfa1b07f70], [$gl_gnulib_enabled_cdeb0f2aaf9d280baa6526bfa1b07f70])
|
||||
AM_CONDITIONAL([gl_GNULIB_ENABLED_strchrnul], [$gl_gnulib_enabled_strchrnul])
|
||||
AM_CONDITIONAL([gl_GNULIB_ENABLED_strtoll], [$gl_gnulib_enabled_strtoll])
|
||||
AM_CONDITIONAL([gl_GNULIB_ENABLED_utimens], [$gl_gnulib_enabled_utimens])
|
||||
AM_CONDITIONAL([gl_GNULIB_ENABLED_682e609604ccaac6be382e4ee3a4eaec], [$gl_gnulib_enabled_682e609604ccaac6be382e4ee3a4eaec])
|
||||
|
@ -1234,7 +1113,6 @@ AC_DEFUN([gl_FILE_LIST], [
|
|||
lib/regex_internal.h
|
||||
lib/regexec.c
|
||||
lib/root-uid.h
|
||||
lib/sched.in.h
|
||||
lib/scratch_buffer.h
|
||||
lib/set-permissions.c
|
||||
lib/sha1.c
|
||||
|
@ -1247,20 +1125,6 @@ AC_DEFUN([gl_FILE_LIST], [
|
|||
lib/sig2str.h
|
||||
lib/sigdescr_np.c
|
||||
lib/signal.in.h
|
||||
lib/spawn.c
|
||||
lib/spawn.in.h
|
||||
lib/spawn_faction_addchdir.c
|
||||
lib/spawn_faction_adddup2.c
|
||||
lib/spawn_faction_destroy.c
|
||||
lib/spawn_faction_init.c
|
||||
lib/spawn_int.h
|
||||
lib/spawnattr_destroy.c
|
||||
lib/spawnattr_init.c
|
||||
lib/spawnattr_setdefault.c
|
||||
lib/spawnattr_setflags.c
|
||||
lib/spawnattr_setpgroup.c
|
||||
lib/spawnattr_setsigmask.c
|
||||
lib/spawni.c
|
||||
lib/stat-time.c
|
||||
lib/stat-time.h
|
||||
lib/stdalign.in.h
|
||||
|
@ -1271,8 +1135,6 @@ AC_DEFUN([gl_FILE_LIST], [
|
|||
lib/stdlib.in.h
|
||||
lib/stpcpy.c
|
||||
lib/str-two-way.h
|
||||
lib/strchrnul.c
|
||||
lib/strchrnul.valgrind
|
||||
lib/strftime.h
|
||||
lib/string.in.h
|
||||
lib/strnlen.c
|
||||
|
@ -1386,16 +1248,12 @@ AC_DEFUN([gl_FILE_LIST], [
|
|||
m4/pathmax.m4
|
||||
m4/pid_t.m4
|
||||
m4/pipe2.m4
|
||||
m4/posix_spawn.m4
|
||||
m4/posix_spawn_faction_addchdir.m4
|
||||
m4/pselect.m4
|
||||
m4/pthread_sigmask.m4
|
||||
m4/rawmemchr.m4
|
||||
m4/readlink.m4
|
||||
m4/readlinkat.m4
|
||||
m4/regex.m4
|
||||
m4/sched_h.m4
|
||||
m4/sh-filename.m4
|
||||
m4/sha1.m4
|
||||
m4/sha256.m4
|
||||
m4/sha512.m4
|
||||
|
@ -1403,7 +1261,6 @@ AC_DEFUN([gl_FILE_LIST], [
|
|||
m4/sigdescr_np.m4
|
||||
m4/signal_h.m4
|
||||
m4/socklen.m4
|
||||
m4/spawn_h.m4
|
||||
m4/ssize_t.m4
|
||||
m4/stat-time.m4
|
||||
m4/std-gnu11.m4
|
||||
|
@ -1413,7 +1270,6 @@ AC_DEFUN([gl_FILE_LIST], [
|
|||
m4/stdio_h.m4
|
||||
m4/stdlib_h.m4
|
||||
m4/stpcpy.m4
|
||||
m4/strchrnul.m4
|
||||
m4/string_h.m4
|
||||
m4/strnlen.m4
|
||||
m4/strtoimax.m4
|
||||
|
|
|
@ -1,678 +0,0 @@
|
|||
# posix_spawn.m4 serial 19
|
||||
dnl Copyright (C) 2008-2020 Free Software Foundation, Inc.
|
||||
dnl This file is free software; the Free Software Foundation
|
||||
dnl gives unlimited permission to copy and/or distribute it,
|
||||
dnl with or without modifications, as long as this notice is preserved.
|
||||
|
||||
dnl Tests whether the entire posix_spawn facility is available.
|
||||
AC_DEFUN([gl_POSIX_SPAWN],
|
||||
[
|
||||
AC_REQUIRE([gl_POSIX_SPAWN_BODY])
|
||||
])
|
||||
|
||||
AC_DEFUN([gl_POSIX_SPAWN_BODY],
|
||||
[
|
||||
AC_REQUIRE([gl_SPAWN_H_DEFAULTS])
|
||||
AC_REQUIRE([gl_HAVE_POSIX_SPAWN])
|
||||
dnl Assume that when the main function exists, all the others,
|
||||
dnl except posix_spawnattr_{get,set}sched*, are available as well.
|
||||
dnl AC_CHECK_FUNCS_ONCE([posix_spawnp])
|
||||
dnl AC_CHECK_FUNCS_ONCE([posix_spawn_file_actions_init])
|
||||
dnl AC_CHECK_FUNCS_ONCE([posix_spawn_file_actions_addclose])
|
||||
dnl AC_CHECK_FUNCS_ONCE([posix_spawn_file_actions_adddup2])
|
||||
dnl AC_CHECK_FUNCS_ONCE([posix_spawn_file_actions_addopen])
|
||||
dnl AC_CHECK_FUNCS_ONCE([posix_spawn_file_actions_destroy])
|
||||
dnl AC_CHECK_FUNCS_ONCE([posix_spawnattr_init])
|
||||
dnl AC_CHECK_FUNCS_ONCE([posix_spawnattr_getflags])
|
||||
dnl AC_CHECK_FUNCS_ONCE([posix_spawnattr_setflags])
|
||||
dnl AC_CHECK_FUNCS_ONCE([posix_spawnattr_getpgroup])
|
||||
dnl AC_CHECK_FUNCS_ONCE([posix_spawnattr_setpgroup])
|
||||
dnl AC_CHECK_FUNCS_ONCE([posix_spawnattr_getsigdefault])
|
||||
dnl AC_CHECK_FUNCS_ONCE([posix_spawnattr_setsigdefault])
|
||||
dnl AC_CHECK_FUNCS_ONCE([posix_spawnattr_getsigmask])
|
||||
dnl AC_CHECK_FUNCS_ONCE([posix_spawnattr_setsigmask])
|
||||
dnl AC_CHECK_FUNCS_ONCE([posix_spawnattr_destroy])
|
||||
if test $ac_cv_func_posix_spawn = yes; then
|
||||
m4_ifdef([gl_FUNC_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR],
|
||||
[dnl Module 'posix_spawn_file_actions_addchdir' is present.
|
||||
AC_CHECK_FUNCS_ONCE([posix_spawn_file_actions_addchdir_np])
|
||||
if test $ac_cv_func_posix_spawn_file_actions_addchdir_np = no; then
|
||||
dnl In order to implement the posix_spawn_file_actions_addchdir
|
||||
dnl function, we need to replace the entire posix_spawn facility.
|
||||
REPLACE_POSIX_SPAWN=1
|
||||
fi
|
||||
])
|
||||
m4_ifdef([gl_FUNC_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR],
|
||||
[dnl Module 'posix_spawn_file_actions_addfchdir' is present.
|
||||
AC_CHECK_FUNCS_ONCE([posix_spawn_file_actions_addfchdir_np])
|
||||
if test $ac_cv_func_posix_spawn_file_actions_addfchdir_np = no; then
|
||||
dnl In order to implement the posix_spawn_file_actions_addfchdir
|
||||
dnl function, we need to replace the entire posix_spawn facility.
|
||||
REPLACE_POSIX_SPAWN=1
|
||||
fi
|
||||
])
|
||||
if test $REPLACE_POSIX_SPAWN = 0; then
|
||||
gl_POSIX_SPAWN_WORKS
|
||||
case "$gl_cv_func_posix_spawn_works" in
|
||||
*yes) ;;
|
||||
*) REPLACE_POSIX_SPAWN=1 ;;
|
||||
esac
|
||||
fi
|
||||
if test $REPLACE_POSIX_SPAWN = 0; then
|
||||
gl_POSIX_SPAWN_SECURE
|
||||
case "$gl_cv_func_posix_spawn_secure_exec" in
|
||||
*yes) ;;
|
||||
*) REPLACE_POSIX_SPAWN=1 ;;
|
||||
esac
|
||||
case "$gl_cv_func_posix_spawnp_secure_exec" in
|
||||
*yes) ;;
|
||||
*) REPLACE_POSIX_SPAWN=1 ;;
|
||||
esac
|
||||
fi
|
||||
if test $REPLACE_POSIX_SPAWN = 0; then
|
||||
dnl Assume that these functions are available if POSIX_SPAWN_SETSCHEDULER
|
||||
dnl evaluates to nonzero.
|
||||
dnl AC_CHECK_FUNCS_ONCE([posix_spawnattr_getschedpolicy])
|
||||
dnl AC_CHECK_FUNCS_ONCE([posix_spawnattr_setschedpolicy])
|
||||
AC_CACHE_CHECK([whether posix_spawnattr_setschedpolicy is supported],
|
||||
[gl_cv_func_spawnattr_setschedpolicy],
|
||||
[AC_EGREP_CPP([POSIX scheduling supported], [
|
||||
#include <spawn.h>
|
||||
#if POSIX_SPAWN_SETSCHEDULER
|
||||
POSIX scheduling supported
|
||||
#endif
|
||||
],
|
||||
[gl_cv_func_spawnattr_setschedpolicy=yes],
|
||||
[gl_cv_func_spawnattr_setschedpolicy=no])
|
||||
])
|
||||
dnl Assume that these functions are available if POSIX_SPAWN_SETSCHEDPARAM
|
||||
dnl evaluates to nonzero.
|
||||
dnl AC_CHECK_FUNCS_ONCE([posix_spawnattr_getschedparam])
|
||||
dnl AC_CHECK_FUNCS_ONCE([posix_spawnattr_setschedparam])
|
||||
AC_CACHE_CHECK([whether posix_spawnattr_setschedparam is supported],
|
||||
[gl_cv_func_spawnattr_setschedparam],
|
||||
[AC_EGREP_CPP([POSIX scheduling supported], [
|
||||
#include <spawn.h>
|
||||
#if POSIX_SPAWN_SETSCHEDPARAM
|
||||
POSIX scheduling supported
|
||||
#endif
|
||||
],
|
||||
[gl_cv_func_spawnattr_setschedparam=yes],
|
||||
[gl_cv_func_spawnattr_setschedparam=no])
|
||||
])
|
||||
fi
|
||||
fi
|
||||
if test $ac_cv_func_posix_spawn != yes || test $REPLACE_POSIX_SPAWN = 1; then
|
||||
AC_DEFINE([REPLACE_POSIX_SPAWN], [1],
|
||||
[Define if gnulib uses its own posix_spawn and posix_spawnp functions.])
|
||||
fi
|
||||
])
|
||||
|
||||
dnl Test whether posix_spawn actually works.
|
||||
dnl posix_spawn on AIX 5.3..6.1 has two bugs:
|
||||
dnl 1) When it fails to execute the program, the child process exits with
|
||||
dnl exit() rather than _exit(), which causes the stdio buffers to be
|
||||
dnl flushed. Reported by Rainer Tammer.
|
||||
dnl 2) The posix_spawn_file_actions_addopen function does not support file
|
||||
dnl names that contain a '*'.
|
||||
dnl posix_spawn on AIX 5.3..6.1 has also a third bug: It does not work
|
||||
dnl when POSIX threads are used. But we don't test against this bug here.
|
||||
AC_DEFUN([gl_POSIX_SPAWN_WORKS],
|
||||
[
|
||||
AC_REQUIRE([AC_PROG_CC])
|
||||
AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
|
||||
AC_CACHE_CHECK([whether posix_spawn works], [gl_cv_func_posix_spawn_works],
|
||||
[if test $cross_compiling = no; then
|
||||
AC_LINK_IFELSE([AC_LANG_SOURCE([[
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <signal.h>
|
||||
#include <spawn.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/wait.h>
|
||||
]GL_MDA_DEFINES[
|
||||
|
||||
extern char **environ;
|
||||
|
||||
#ifndef STDIN_FILENO
|
||||
# define STDIN_FILENO 0
|
||||
#endif
|
||||
#ifndef STDOUT_FILENO
|
||||
# define STDOUT_FILENO 1
|
||||
#endif
|
||||
#ifndef STDERR_FILENO
|
||||
# define STDERR_FILENO 2
|
||||
#endif
|
||||
|
||||
#ifndef WTERMSIG
|
||||
# define WTERMSIG(x) ((x) & 0x7f)
|
||||
#endif
|
||||
#ifndef WIFEXITED
|
||||
# define WIFEXITED(x) (WTERMSIG (x) == 0)
|
||||
#endif
|
||||
#ifndef WEXITSTATUS
|
||||
# define WEXITSTATUS(x) (((x) >> 8) & 0xff)
|
||||
#endif
|
||||
|
||||
#define CHILD_PROGRAM_FILENAME "/non/exist/ent"
|
||||
|
||||
static int
|
||||
fd_safer (int fd)
|
||||
{
|
||||
if (0 <= fd && fd <= 2)
|
||||
{
|
||||
int f = fd_safer (dup (fd));
|
||||
int e = errno;
|
||||
close (fd);
|
||||
errno = e;
|
||||
fd = f;
|
||||
}
|
||||
|
||||
return fd;
|
||||
}
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
char *argv[2] = { CHILD_PROGRAM_FILENAME, NULL };
|
||||
int ofd[2];
|
||||
sigset_t blocked_signals;
|
||||
sigset_t fatal_signal_set;
|
||||
posix_spawn_file_actions_t actions;
|
||||
bool actions_allocated;
|
||||
posix_spawnattr_t attrs;
|
||||
bool attrs_allocated;
|
||||
int err;
|
||||
pid_t child;
|
||||
int status;
|
||||
int exitstatus;
|
||||
|
||||
setvbuf (stdout, NULL, _IOFBF, 0);
|
||||
puts ("This should be seen only once.");
|
||||
if (pipe (ofd) < 0 || (ofd[1] = fd_safer (ofd[1])) < 0)
|
||||
{
|
||||
perror ("cannot create pipe");
|
||||
exit (1);
|
||||
}
|
||||
sigprocmask (SIG_SETMASK, NULL, &blocked_signals);
|
||||
sigemptyset (&fatal_signal_set);
|
||||
sigaddset (&fatal_signal_set, SIGINT);
|
||||
sigaddset (&fatal_signal_set, SIGTERM);
|
||||
sigaddset (&fatal_signal_set, SIGHUP);
|
||||
sigaddset (&fatal_signal_set, SIGPIPE);
|
||||
sigprocmask (SIG_BLOCK, &fatal_signal_set, NULL);
|
||||
actions_allocated = false;
|
||||
attrs_allocated = false;
|
||||
if ((err = posix_spawn_file_actions_init (&actions)) != 0
|
||||
|| (actions_allocated = true,
|
||||
(err = posix_spawn_file_actions_adddup2 (&actions, ofd[0], STDIN_FILENO)) != 0
|
||||
|| (err = posix_spawn_file_actions_addclose (&actions, ofd[0])) != 0
|
||||
|| (err = posix_spawn_file_actions_addclose (&actions, ofd[1])) != 0
|
||||
|| (err = posix_spawnattr_init (&attrs)) != 0
|
||||
|| (attrs_allocated = true,
|
||||
(err = posix_spawnattr_setsigmask (&attrs, &blocked_signals)) != 0
|
||||
|| (err = posix_spawnattr_setflags (&attrs, POSIX_SPAWN_SETSIGMASK)) != 0)
|
||||
|| (err = posix_spawnp (&child, CHILD_PROGRAM_FILENAME, &actions, &attrs, argv, environ)) != 0))
|
||||
{
|
||||
if (actions_allocated)
|
||||
posix_spawn_file_actions_destroy (&actions);
|
||||
if (attrs_allocated)
|
||||
posix_spawnattr_destroy (&attrs);
|
||||
sigprocmask (SIG_UNBLOCK, &fatal_signal_set, NULL);
|
||||
if (err == ENOENT)
|
||||
return 0;
|
||||
else
|
||||
{
|
||||
errno = err;
|
||||
perror ("subprocess failed");
|
||||
exit (1);
|
||||
}
|
||||
}
|
||||
posix_spawn_file_actions_destroy (&actions);
|
||||
posix_spawnattr_destroy (&attrs);
|
||||
sigprocmask (SIG_UNBLOCK, &fatal_signal_set, NULL);
|
||||
close (ofd[0]);
|
||||
close (ofd[1]);
|
||||
status = 0;
|
||||
while (waitpid (child, &status, 0) != child)
|
||||
;
|
||||
if (!WIFEXITED (status))
|
||||
{
|
||||
fprintf (stderr, "subprocess terminated with unexpected wait status %d\n", status);
|
||||
exit (1);
|
||||
}
|
||||
exitstatus = WEXITSTATUS (status);
|
||||
if (exitstatus != 127)
|
||||
{
|
||||
fprintf (stderr, "subprocess terminated with unexpected exit status %d\n", exitstatus);
|
||||
exit (1);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
]])],
|
||||
[if test -s conftest$ac_exeext \
|
||||
&& ./conftest$ac_exeext > conftest.out \
|
||||
&& echo 'This should be seen only once.' > conftest.ok \
|
||||
&& cmp conftest.out conftest.ok >/dev/null 2>&1; then
|
||||
gl_cv_func_posix_spawn_works=yes
|
||||
else
|
||||
gl_cv_func_posix_spawn_works=no
|
||||
fi],
|
||||
[gl_cv_func_posix_spawn_works=no])
|
||||
if test $gl_cv_func_posix_spawn_works = yes; then
|
||||
AC_RUN_IFELSE([AC_LANG_SOURCE([[
|
||||
/* Test whether posix_spawn_file_actions_addopen supports filename arguments
|
||||
that contain special characters such as '*'. */
|
||||
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <signal.h>
|
||||
#include <spawn.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/wait.h>
|
||||
]GL_MDA_DEFINES[
|
||||
|
||||
extern char **environ;
|
||||
|
||||
#ifndef STDIN_FILENO
|
||||
# define STDIN_FILENO 0
|
||||
#endif
|
||||
#ifndef STDOUT_FILENO
|
||||
# define STDOUT_FILENO 1
|
||||
#endif
|
||||
#ifndef STDERR_FILENO
|
||||
# define STDERR_FILENO 2
|
||||
#endif
|
||||
|
||||
#ifndef WTERMSIG
|
||||
# define WTERMSIG(x) ((x) & 0x7f)
|
||||
#endif
|
||||
#ifndef WIFEXITED
|
||||
# define WIFEXITED(x) (WTERMSIG (x) == 0)
|
||||
#endif
|
||||
#ifndef WEXITSTATUS
|
||||
# define WEXITSTATUS(x) (((x) >> 8) & 0xff)
|
||||
#endif
|
||||
|
||||
#define CHILD_PROGRAM_FILENAME "conftest"
|
||||
#define DATA_FILENAME "conftest%=*#?"
|
||||
|
||||
static int
|
||||
parent_main (void)
|
||||
{
|
||||
FILE *fp;
|
||||
char *argv[3] = { CHILD_PROGRAM_FILENAME, "-child", NULL };
|
||||
posix_spawn_file_actions_t actions;
|
||||
bool actions_allocated;
|
||||
int err;
|
||||
pid_t child;
|
||||
int status;
|
||||
int exitstatus;
|
||||
|
||||
/* Create a data file with specific contents. */
|
||||
fp = fopen (DATA_FILENAME, "wb");
|
||||
if (fp == NULL)
|
||||
{
|
||||
perror ("cannot create data file");
|
||||
return 1;
|
||||
}
|
||||
fwrite ("Halle Potta", 1, 11, fp);
|
||||
if (fflush (fp) || fclose (fp))
|
||||
{
|
||||
perror ("cannot prepare data file");
|
||||
return 2;
|
||||
}
|
||||
|
||||
/* Avoid reading from our stdin, as it could block. */
|
||||
freopen ("/dev/null", "rb", stdin);
|
||||
|
||||
/* Test whether posix_spawn_file_actions_addopen with this file name
|
||||
actually works, but spawning a child that reads from this file. */
|
||||
actions_allocated = false;
|
||||
if ((err = posix_spawn_file_actions_init (&actions)) != 0
|
||||
|| (actions_allocated = true,
|
||||
(err = posix_spawn_file_actions_addopen (&actions, STDIN_FILENO, DATA_FILENAME, O_RDONLY, 0600)) != 0
|
||||
|| (err = posix_spawn (&child, CHILD_PROGRAM_FILENAME, &actions, NULL, argv, environ)) != 0))
|
||||
{
|
||||
if (actions_allocated)
|
||||
posix_spawn_file_actions_destroy (&actions);
|
||||
errno = err;
|
||||
perror ("subprocess failed");
|
||||
return 3;
|
||||
}
|
||||
posix_spawn_file_actions_destroy (&actions);
|
||||
status = 0;
|
||||
while (waitpid (child, &status, 0) != child)
|
||||
;
|
||||
if (!WIFEXITED (status))
|
||||
{
|
||||
fprintf (stderr, "subprocess terminated with unexpected wait status %d\n", status);
|
||||
return 4;
|
||||
}
|
||||
exitstatus = WEXITSTATUS (status);
|
||||
if (exitstatus != 0)
|
||||
{
|
||||
fprintf (stderr, "subprocess terminated with unexpected exit status %d\n", exitstatus);
|
||||
return 5;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
child_main (void)
|
||||
{
|
||||
char buf[1024];
|
||||
|
||||
/* See if reading from STDIN_FILENO yields the expected contents. */
|
||||
if (fread (buf, 1, sizeof (buf), stdin) == 11
|
||||
&& memcmp (buf, "Halle Potta", 11) == 0)
|
||||
return 0;
|
||||
else
|
||||
return 8;
|
||||
}
|
||||
|
||||
static void
|
||||
cleanup_then_die (int sig)
|
||||
{
|
||||
/* Clean up data file. */
|
||||
unlink (DATA_FILENAME);
|
||||
|
||||
/* Re-raise the signal and die from it. */
|
||||
signal (sig, SIG_DFL);
|
||||
raise (sig);
|
||||
}
|
||||
|
||||
int
|
||||
main (int argc, char *argv[])
|
||||
{
|
||||
int exitstatus;
|
||||
|
||||
if (!(argc > 1 && strcmp (argv[1], "-child") == 0))
|
||||
{
|
||||
/* This is the parent process. */
|
||||
signal (SIGINT, cleanup_then_die);
|
||||
signal (SIGTERM, cleanup_then_die);
|
||||
#ifdef SIGHUP
|
||||
signal (SIGHUP, cleanup_then_die);
|
||||
#endif
|
||||
|
||||
exitstatus = parent_main ();
|
||||
}
|
||||
else
|
||||
{
|
||||
/* This is the child process. */
|
||||
|
||||
exitstatus = child_main ();
|
||||
}
|
||||
unlink (DATA_FILENAME);
|
||||
return exitstatus;
|
||||
}
|
||||
]])],
|
||||
[],
|
||||
[gl_cv_func_posix_spawn_works=no])
|
||||
fi
|
||||
else
|
||||
case "$host_os" in
|
||||
aix*) gl_cv_func_posix_spawn_works="guessing no";;
|
||||
*) gl_cv_func_posix_spawn_works="guessing yes";;
|
||||
esac
|
||||
fi
|
||||
])
|
||||
])
|
||||
|
||||
dnl Test whether posix_spawn and posix_spawnp are secure.
|
||||
AC_DEFUN([gl_POSIX_SPAWN_SECURE],
|
||||
[
|
||||
AC_REQUIRE([AC_PROG_CC])
|
||||
AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
|
||||
dnl On many platforms, posix_spawn or posix_spawnp allow executing a
|
||||
dnl script without a '#!' marker as a shell script. This is unsecure.
|
||||
AC_CACHE_CHECK([whether posix_spawn rejects scripts without shebang],
|
||||
[gl_cv_func_posix_spawn_secure_exec],
|
||||
[echo ':' > conftest.scr
|
||||
chmod a+x conftest.scr
|
||||
AC_RUN_IFELSE([AC_LANG_SOURCE([[
|
||||
#include <errno.h>
|
||||
#include <spawn.h>
|
||||
#include <stddef.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/wait.h>
|
||||
int
|
||||
main ()
|
||||
{
|
||||
const char *prog_path = "./conftest.scr";
|
||||
const char *prog_argv[2] = { prog_path, NULL };
|
||||
const char *environment[2] = { "PATH=.", NULL };
|
||||
pid_t child;
|
||||
int status;
|
||||
int err = posix_spawn (&child, prog_path, NULL, NULL,
|
||||
(char **) prog_argv, (char **) environment);
|
||||
if (err == ENOEXEC)
|
||||
return 0;
|
||||
if (err != 0)
|
||||
return 1;
|
||||
status = 0;
|
||||
while (waitpid (child, &status, 0) != child)
|
||||
;
|
||||
if (!WIFEXITED (status))
|
||||
return 2;
|
||||
if (WEXITSTATUS (status) != 127)
|
||||
return 3;
|
||||
return 0;
|
||||
}
|
||||
]])],
|
||||
[gl_cv_func_posix_spawn_secure_exec=yes],
|
||||
[gl_cv_func_posix_spawn_secure_exec=no],
|
||||
[case "$host_os" in
|
||||
# Guess no on GNU/Hurd.
|
||||
gnu*)
|
||||
gl_cv_func_posix_spawn_secure_exec="guessing no" ;;
|
||||
# Guess yes on all other platforms.
|
||||
*)
|
||||
gl_cv_func_posix_spawn_secure_exec="guessing yes" ;;
|
||||
esac
|
||||
])
|
||||
rm -f conftest.scr
|
||||
])
|
||||
AC_CACHE_CHECK([whether posix_spawnp rejects scripts without shebang],
|
||||
[gl_cv_func_posix_spawnp_secure_exec],
|
||||
[echo ':' > conftest.scr
|
||||
chmod a+x conftest.scr
|
||||
AC_RUN_IFELSE([AC_LANG_SOURCE([[
|
||||
#include <errno.h>
|
||||
#include <spawn.h>
|
||||
#include <stddef.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/wait.h>
|
||||
int
|
||||
main ()
|
||||
{
|
||||
const char *prog_path = "./conftest.scr";
|
||||
const char *prog_argv[2] = { prog_path, NULL };
|
||||
const char *environment[2] = { "PATH=.", NULL };
|
||||
pid_t child;
|
||||
int status;
|
||||
int err = posix_spawnp (&child, prog_path, NULL, NULL,
|
||||
(char **) prog_argv, (char **) environment);
|
||||
if (err == ENOEXEC)
|
||||
return 0;
|
||||
if (err != 0)
|
||||
return 1;
|
||||
status = 0;
|
||||
while (waitpid (child, &status, 0) != child)
|
||||
;
|
||||
if (!WIFEXITED (status))
|
||||
return 2;
|
||||
if (WEXITSTATUS (status) != 127)
|
||||
return 3;
|
||||
return 0;
|
||||
}
|
||||
]])],
|
||||
[gl_cv_func_posix_spawnp_secure_exec=yes],
|
||||
[gl_cv_func_posix_spawnp_secure_exec=no],
|
||||
[case "$host_os" in
|
||||
# Guess yes on glibc systems (glibc >= 2.15 actually) except GNU/Hurd,
|
||||
# musl libc, NetBSD.
|
||||
*-gnu* | *-musl* | netbsd*)
|
||||
gl_cv_func_posix_spawnp_secure_exec="guessing yes" ;;
|
||||
# Guess no on GNU/Hurd, macOS, FreeBSD, OpenBSD, AIX, Solaris, Cygwin.
|
||||
gnu* | darwin* | freebsd* | dragonfly* | openbsd* | aix* | solaris* | cygwin*)
|
||||
gl_cv_func_posix_spawnp_secure_exec="guessing no" ;;
|
||||
# If we don't know, obey --enable-cross-guesses.
|
||||
*)
|
||||
gl_cv_func_posix_spawnp_secure_exec="$gl_cross_guess_normal" ;;
|
||||
esac
|
||||
])
|
||||
rm -f conftest.scr
|
||||
])
|
||||
])
|
||||
|
||||
# Prerequisites of lib/spawni.c.
|
||||
AC_DEFUN([gl_PREREQ_POSIX_SPAWN_INTERNAL],
|
||||
[
|
||||
AC_CHECK_HEADERS([paths.h])
|
||||
AC_CHECK_FUNCS([confstr sched_setparam sched_setscheduler setegid seteuid vfork])
|
||||
])
|
||||
|
||||
AC_DEFUN([gl_FUNC_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE],
|
||||
[
|
||||
AC_REQUIRE([gl_SPAWN_H_DEFAULTS])
|
||||
AC_REQUIRE([AC_PROG_CC])
|
||||
AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
|
||||
gl_POSIX_SPAWN
|
||||
if test $REPLACE_POSIX_SPAWN = 1; then
|
||||
REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE=1
|
||||
else
|
||||
dnl On musl libc and Solaris 11.0, posix_spawn_file_actions_addclose
|
||||
dnl succeeds even if the fd argument is out of range.
|
||||
AC_CACHE_CHECK([whether posix_spawn_file_actions_addclose works],
|
||||
[gl_cv_func_posix_spawn_file_actions_addclose_works],
|
||||
[AC_RUN_IFELSE(
|
||||
[AC_LANG_SOURCE([[
|
||||
#include <spawn.h>
|
||||
int main ()
|
||||
{
|
||||
posix_spawn_file_actions_t actions;
|
||||
if (posix_spawn_file_actions_init (&actions) != 0)
|
||||
return 1;
|
||||
if (posix_spawn_file_actions_addclose (&actions, 10000000) == 0)
|
||||
return 2;
|
||||
return 0;
|
||||
}]])],
|
||||
[gl_cv_func_posix_spawn_file_actions_addclose_works=yes],
|
||||
[gl_cv_func_posix_spawn_file_actions_addclose_works=no],
|
||||
[# Guess no on musl libc and Solaris, yes otherwise.
|
||||
case "$host_os" in
|
||||
*-musl*) gl_cv_func_posix_spawn_file_actions_addclose_works="guessing no" ;;
|
||||
solaris*) gl_cv_func_posix_spawn_file_actions_addclose_works="guessing no" ;;
|
||||
# Guess no on native Windows.
|
||||
mingw*) gl_cv_func_posix_spawn_file_actions_addclose_works="guessing no" ;;
|
||||
*) gl_cv_func_posix_spawn_file_actions_addclose_works="guessing yes" ;;
|
||||
esac
|
||||
])
|
||||
])
|
||||
case "$gl_cv_func_posix_spawn_file_actions_addclose_works" in
|
||||
*yes) ;;
|
||||
*) REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE=1 ;;
|
||||
esac
|
||||
fi
|
||||
])
|
||||
|
||||
AC_DEFUN([gl_FUNC_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2],
|
||||
[
|
||||
AC_REQUIRE([gl_SPAWN_H_DEFAULTS])
|
||||
AC_REQUIRE([AC_PROG_CC])
|
||||
AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
|
||||
gl_POSIX_SPAWN
|
||||
if test $REPLACE_POSIX_SPAWN = 1; then
|
||||
REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2=1
|
||||
else
|
||||
dnl On musl libc and Solaris 11.0, posix_spawn_file_actions_adddup2
|
||||
dnl succeeds even if the fd argument is out of range.
|
||||
AC_CACHE_CHECK([whether posix_spawn_file_actions_adddup2 works],
|
||||
[gl_cv_func_posix_spawn_file_actions_adddup2_works],
|
||||
[AC_RUN_IFELSE(
|
||||
[AC_LANG_SOURCE([[
|
||||
#include <spawn.h>
|
||||
int main ()
|
||||
{
|
||||
posix_spawn_file_actions_t actions;
|
||||
if (posix_spawn_file_actions_init (&actions) != 0)
|
||||
return 1;
|
||||
if (posix_spawn_file_actions_adddup2 (&actions, 10000000, 2) == 0)
|
||||
return 2;
|
||||
return 0;
|
||||
}]])],
|
||||
[gl_cv_func_posix_spawn_file_actions_adddup2_works=yes],
|
||||
[gl_cv_func_posix_spawn_file_actions_adddup2_works=no],
|
||||
[# Guess no on musl libc and Solaris, yes otherwise.
|
||||
case "$host_os" in
|
||||
*-musl*) gl_cv_func_posix_spawn_file_actions_adddup2_works="guessing no";;
|
||||
solaris*) gl_cv_func_posix_spawn_file_actions_adddup2_works="guessing no";;
|
||||
# Guess no on native Windows.
|
||||
mingw*) gl_cv_func_posix_spawn_file_actions_adddup2_works="guessing no" ;;
|
||||
*) gl_cv_func_posix_spawn_file_actions_adddup2_works="guessing yes";;
|
||||
esac
|
||||
])
|
||||
])
|
||||
case "$gl_cv_func_posix_spawn_file_actions_adddup2_works" in
|
||||
*yes) ;;
|
||||
*) REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2=1 ;;
|
||||
esac
|
||||
fi
|
||||
])
|
||||
|
||||
AC_DEFUN([gl_FUNC_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN],
|
||||
[
|
||||
AC_REQUIRE([gl_SPAWN_H_DEFAULTS])
|
||||
AC_REQUIRE([AC_PROG_CC])
|
||||
AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
|
||||
gl_POSIX_SPAWN
|
||||
if test $REPLACE_POSIX_SPAWN = 1; then
|
||||
REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN=1
|
||||
else
|
||||
dnl On musl libc and Solaris 11.0, posix_spawn_file_actions_addopen
|
||||
dnl succeeds even if the fd argument is out of range.
|
||||
AC_CACHE_CHECK([whether posix_spawn_file_actions_addopen works],
|
||||
[gl_cv_func_posix_spawn_file_actions_addopen_works],
|
||||
[AC_RUN_IFELSE(
|
||||
[AC_LANG_SOURCE([[
|
||||
#include <spawn.h>
|
||||
#include <fcntl.h>
|
||||
int main ()
|
||||
{
|
||||
posix_spawn_file_actions_t actions;
|
||||
if (posix_spawn_file_actions_init (&actions) != 0)
|
||||
return 1;
|
||||
if (posix_spawn_file_actions_addopen (&actions, 10000000, "foo", 0, O_RDONLY)
|
||||
== 0)
|
||||
return 2;
|
||||
return 0;
|
||||
}]])],
|
||||
[gl_cv_func_posix_spawn_file_actions_addopen_works=yes],
|
||||
[gl_cv_func_posix_spawn_file_actions_addopen_works=no],
|
||||
[# Guess no on musl libc and Solaris, yes otherwise.
|
||||
case "$host_os" in
|
||||
*-musl*) gl_cv_func_posix_spawn_file_actions_addopen_works="guessing no";;
|
||||
solaris*) gl_cv_func_posix_spawn_file_actions_addopen_works="guessing no";;
|
||||
# Guess no on native Windows.
|
||||
mingw*) gl_cv_func_posix_spawn_file_actions_addopen_works="guessing no" ;;
|
||||
*) gl_cv_func_posix_spawn_file_actions_addopen_works="guessing yes";;
|
||||
esac
|
||||
])
|
||||
])
|
||||
case "$gl_cv_func_posix_spawn_file_actions_addopen_works" in
|
||||
*yes) ;;
|
||||
*) REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN=1 ;;
|
||||
esac
|
||||
fi
|
||||
])
|
|
@ -1,20 +0,0 @@
|
|||
# posix_spawn_faction_addchdir.m4 serial 1
|
||||
dnl Copyright (C) 2018-2020 Free Software Foundation, Inc.
|
||||
dnl This file is free software; the Free Software Foundation
|
||||
dnl gives unlimited permission to copy and/or distribute it,
|
||||
dnl with or without modifications, as long as this notice is preserved.
|
||||
|
||||
AC_DEFUN([gl_FUNC_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR],
|
||||
[
|
||||
AC_REQUIRE([gl_SPAWN_H_DEFAULTS])
|
||||
AC_REQUIRE([AC_PROG_CC])
|
||||
gl_POSIX_SPAWN
|
||||
AC_CHECK_FUNCS_ONCE([posix_spawn_file_actions_addchdir posix_spawn_file_actions_addchdir_np])
|
||||
if test $ac_cv_func_posix_spawn_file_actions_addchdir = yes; then
|
||||
dnl This function is not yet standardized. Therefore override the
|
||||
dnl system's implementation always.
|
||||
REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR=1
|
||||
else
|
||||
HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR=0
|
||||
fi
|
||||
])
|
|
@ -1,91 +0,0 @@
|
|||
# sched_h.m4 serial 12
|
||||
dnl Copyright (C) 2008-2020 Free Software Foundation, Inc.
|
||||
dnl This file is free software; the Free Software Foundation
|
||||
dnl gives unlimited permission to copy and/or distribute it,
|
||||
dnl with or without modifications, as long as this notice is preserved.
|
||||
|
||||
dnl Written by Bruno Haible.
|
||||
|
||||
AC_DEFUN([gl_SCHED_H],
|
||||
[
|
||||
dnl Use AC_REQUIRE here, so that the default behavior below is expanded
|
||||
dnl once only, before all statements that occur in other macros.
|
||||
AC_REQUIRE([gl_SCHED_H_DEFAULTS])
|
||||
|
||||
AC_REQUIRE([AC_CANONICAL_HOST])
|
||||
|
||||
AC_CHECK_HEADERS_ONCE([sys/cdefs.h])
|
||||
AC_CHECK_HEADERS([sched.h], [], [],
|
||||
[[#if HAVE_SYS_CDEFS_H
|
||||
#include <sys/cdefs.h>
|
||||
#endif
|
||||
]])
|
||||
gl_NEXT_HEADERS([sched.h])
|
||||
|
||||
if test "$ac_cv_header_sched_h" = yes; then
|
||||
HAVE_SCHED_H=1
|
||||
else
|
||||
HAVE_SCHED_H=0
|
||||
fi
|
||||
AC_SUBST([HAVE_SCHED_H])
|
||||
|
||||
if test "$HAVE_SCHED_H" = 1; then
|
||||
AC_CHECK_TYPE([struct sched_param],
|
||||
[HAVE_STRUCT_SCHED_PARAM=1], [HAVE_STRUCT_SCHED_PARAM=0],
|
||||
[[#if HAVE_SYS_CDEFS_H
|
||||
#include <sys/cdefs.h>
|
||||
#endif
|
||||
#include <sched.h>
|
||||
]])
|
||||
else
|
||||
HAVE_STRUCT_SCHED_PARAM=0
|
||||
case "$host_os" in
|
||||
os2*)
|
||||
dnl On OS/2 kLIBC, struct sched_param is in spawn.h.
|
||||
AC_CHECK_TYPE([struct sched_param],
|
||||
[HAVE_STRUCT_SCHED_PARAM=1], [],
|
||||
[#include <spawn.h>])
|
||||
;;
|
||||
vms)
|
||||
dnl On OpenVMS 7.2 or newer, struct sched_param is in pthread.h.
|
||||
AC_CHECK_TYPE([struct sched_param],
|
||||
[HAVE_STRUCT_SCHED_PARAM=1], [],
|
||||
[#include <pthread.h>])
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
AC_SUBST([HAVE_STRUCT_SCHED_PARAM])
|
||||
|
||||
if test "$ac_cv_header_sys_cdefs_h" = yes; then
|
||||
HAVE_SYS_CDEFS_H=1
|
||||
else
|
||||
HAVE_SYS_CDEFS_H=0
|
||||
fi
|
||||
AC_SUBST([HAVE_SYS_CDEFS_H])
|
||||
|
||||
dnl Ensure the type pid_t gets defined.
|
||||
AC_REQUIRE([AC_TYPE_PID_T])
|
||||
|
||||
dnl Check for declarations of anything we want to poison if the
|
||||
dnl corresponding gnulib module is not in use, if it is not common
|
||||
dnl enough to be declared everywhere.
|
||||
gl_WARN_ON_USE_PREPARE([[#include <sched.h>
|
||||
]], [sched_yield])
|
||||
])
|
||||
|
||||
AC_DEFUN([gl_SCHED_MODULE_INDICATOR],
|
||||
[
|
||||
dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
|
||||
AC_REQUIRE([gl_SCHED_H_DEFAULTS])
|
||||
gl_MODULE_INDICATOR_SET_VARIABLE([$1])
|
||||
dnl Define it also as a C macro, for the benefit of the unit tests.
|
||||
gl_MODULE_INDICATOR_FOR_TESTS([$1])
|
||||
])
|
||||
|
||||
AC_DEFUN([gl_SCHED_H_DEFAULTS],
|
||||
[
|
||||
GNULIB_SCHED_YIELD=0; AC_SUBST([GNULIB_SCHED_YIELD])
|
||||
dnl Assume proper GNU behavior unless another module says otherwise.
|
||||
HAVE_SCHED_YIELD=1; AC_SUBST([HAVE_SCHED_YIELD])
|
||||
REPLACE_SCHED_YIELD=0; AC_SUBST([REPLACE_SCHED_YIELD])
|
||||
])
|
|
@ -1,22 +0,0 @@
|
|||
# sh-filename.m4 serial 2
|
||||
dnl Copyright (C) 2018-2020 Free Software Foundation, Inc.
|
||||
dnl This file is free software; the Free Software Foundation
|
||||
dnl gives unlimited permission to copy and/or distribute it,
|
||||
dnl with or without modifications, as long as this notice is preserved.
|
||||
|
||||
dnl From Bruno Haible.
|
||||
|
||||
AC_DEFUN([gl_SH_FILENAME],
|
||||
[
|
||||
AH_VERBATIM([SH_FILENAME],
|
||||
[/* File name of the Bourne shell. */
|
||||
#if defined __CYGWIN__ || defined __ANDROID__
|
||||
/* Omit the directory part because
|
||||
- For 32-bit Cygwin programs in a 64-bit Cygwin environment, the Cygwin
|
||||
mounts are not visible.
|
||||
- On Android, /bin/sh does not exist. It's /system/bin/sh instead. */
|
||||
# define BOURNE_SHELL "sh"
|
||||
#else
|
||||
# define BOURNE_SHELL "/bin/sh"
|
||||
#endif])
|
||||
])
|
136
m4/spawn_h.m4
136
m4/spawn_h.m4
|
@ -1,136 +0,0 @@
|
|||
# spawn_h.m4 serial 18
|
||||
dnl Copyright (C) 2008-2020 Free Software Foundation, Inc.
|
||||
dnl This file is free software; the Free Software Foundation
|
||||
dnl gives unlimited permission to copy and/or distribute it,
|
||||
dnl with or without modifications, as long as this notice is preserved.
|
||||
|
||||
dnl Written by Bruno Haible.
|
||||
|
||||
AC_DEFUN([gl_SPAWN_H],
|
||||
[
|
||||
dnl Use AC_REQUIRE here, so that the default behavior below is expanded
|
||||
dnl once only, before all statements that occur in other macros.
|
||||
AC_REQUIRE([gl_SPAWN_H_DEFAULTS])
|
||||
|
||||
dnl <spawn.h> is always overridden, because of GNULIB_POSIXCHECK.
|
||||
gl_CHECK_NEXT_HEADERS([spawn.h])
|
||||
|
||||
if test $ac_cv_header_spawn_h = yes; then
|
||||
HAVE_SPAWN_H=1
|
||||
AC_CHECK_TYPES([posix_spawnattr_t], [], [HAVE_POSIX_SPAWNATTR_T=0], [[
|
||||
#include <spawn.h>
|
||||
]])
|
||||
AC_CHECK_TYPES([posix_spawn_file_actions_t], [],
|
||||
[HAVE_POSIX_SPAWN_FILE_ACTIONS_T=0], [[
|
||||
#include <spawn.h>
|
||||
]])
|
||||
else
|
||||
HAVE_SPAWN_H=0
|
||||
HAVE_POSIX_SPAWNATTR_T=0
|
||||
HAVE_POSIX_SPAWN_FILE_ACTIONS_T=0
|
||||
fi
|
||||
AC_SUBST([HAVE_SPAWN_H])
|
||||
|
||||
dnl Ensure the type pid_t gets defined.
|
||||
AC_REQUIRE([AC_TYPE_PID_T])
|
||||
|
||||
dnl Ensure the type mode_t gets defined.
|
||||
AC_REQUIRE([AC_TYPE_MODE_T])
|
||||
|
||||
AC_REQUIRE([gl_HAVE_POSIX_SPAWN])
|
||||
|
||||
AC_REQUIRE([AC_C_RESTRICT])
|
||||
|
||||
dnl Check for declarations of anything we want to poison if the
|
||||
dnl corresponding gnulib module is not in use.
|
||||
gl_WARN_ON_USE_PREPARE([[#include <spawn.h>
|
||||
]], [posix_spawn posix_spawnp posix_spawnattr_init posix_spawnattr_destroy
|
||||
posix_spawnattr_getsigdefault posix_spawnattr_setsigdefault
|
||||
posix_spawnattr_getsigmask posix_spawnattr_setsigmask
|
||||
posix_spawnattr_getflags posix_spawnattr_setflags
|
||||
posix_spawnattr_getpgroup posix_spawnattr_setpgroup
|
||||
posix_spawnattr_getschedpolicy posix_spawnattr_setschedpolicy
|
||||
posix_spawnattr_getschedparam posix_spawnattr_setschedparam
|
||||
posix_spawn_file_actions_init posix_spawn_file_actions_destroy
|
||||
posix_spawn_file_actions_addopen posix_spawn_file_actions_addclose
|
||||
posix_spawn_file_actions_adddup2 posix_spawn_file_actions_addchdir
|
||||
posix_spawn_file_actions_addfchdir])
|
||||
])
|
||||
|
||||
dnl Checks whether the system has the functions posix_spawn.
|
||||
dnl Sets ac_cv_func_posix_spawn and HAVE_POSIX_SPAWN.
|
||||
AC_DEFUN([gl_HAVE_POSIX_SPAWN],
|
||||
[
|
||||
dnl Use AC_REQUIRE here, so that the default behavior below is expanded
|
||||
dnl once only, before all statements that occur in other macros.
|
||||
AC_REQUIRE([gl_SPAWN_H_DEFAULTS])
|
||||
|
||||
LIB_POSIX_SPAWN=
|
||||
AC_SUBST([LIB_POSIX_SPAWN])
|
||||
gl_saved_libs=$LIBS
|
||||
AC_SEARCH_LIBS([posix_spawn], [rt],
|
||||
[test "$ac_cv_search_posix_spawn" = "none required" ||
|
||||
LIB_POSIX_SPAWN=$ac_cv_search_posix_spawn])
|
||||
AC_CHECK_FUNCS([posix_spawn])
|
||||
LIBS=$gl_saved_libs
|
||||
|
||||
if test $ac_cv_func_posix_spawn != yes; then
|
||||
HAVE_POSIX_SPAWN=0
|
||||
fi
|
||||
])
|
||||
|
||||
AC_DEFUN([gl_SPAWN_MODULE_INDICATOR],
|
||||
[
|
||||
dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
|
||||
AC_REQUIRE([gl_SPAWN_H_DEFAULTS])
|
||||
gl_MODULE_INDICATOR_SET_VARIABLE([$1])
|
||||
dnl Define it also as a C macro, for the benefit of the unit tests.
|
||||
gl_MODULE_INDICATOR_FOR_TESTS([$1])
|
||||
])
|
||||
|
||||
AC_DEFUN([gl_SPAWN_H_DEFAULTS],
|
||||
[
|
||||
GNULIB_POSIX_SPAWN=0; AC_SUBST([GNULIB_POSIX_SPAWN])
|
||||
GNULIB_POSIX_SPAWNP=0; AC_SUBST([GNULIB_POSIX_SPAWNP])
|
||||
GNULIB_POSIX_SPAWN_FILE_ACTIONS_INIT=0; AC_SUBST([GNULIB_POSIX_SPAWN_FILE_ACTIONS_INIT])
|
||||
GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR=0; AC_SUBST([GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR])
|
||||
GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE=0; AC_SUBST([GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE])
|
||||
GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2=0; AC_SUBST([GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2])
|
||||
GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR=0; AC_SUBST([GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR])
|
||||
GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN=0; AC_SUBST([GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN])
|
||||
GNULIB_POSIX_SPAWN_FILE_ACTIONS_DESTROY=0; AC_SUBST([GNULIB_POSIX_SPAWN_FILE_ACTIONS_DESTROY])
|
||||
GNULIB_POSIX_SPAWNATTR_INIT=0; AC_SUBST([GNULIB_POSIX_SPAWNATTR_INIT])
|
||||
GNULIB_POSIX_SPAWNATTR_GETFLAGS=0; AC_SUBST([GNULIB_POSIX_SPAWNATTR_GETFLAGS])
|
||||
GNULIB_POSIX_SPAWNATTR_SETFLAGS=0; AC_SUBST([GNULIB_POSIX_SPAWNATTR_SETFLAGS])
|
||||
GNULIB_POSIX_SPAWNATTR_GETPGROUP=0; AC_SUBST([GNULIB_POSIX_SPAWNATTR_GETPGROUP])
|
||||
GNULIB_POSIX_SPAWNATTR_SETPGROUP=0; AC_SUBST([GNULIB_POSIX_SPAWNATTR_SETPGROUP])
|
||||
GNULIB_POSIX_SPAWNATTR_GETSCHEDPARAM=0; AC_SUBST([GNULIB_POSIX_SPAWNATTR_GETSCHEDPARAM])
|
||||
GNULIB_POSIX_SPAWNATTR_SETSCHEDPARAM=0; AC_SUBST([GNULIB_POSIX_SPAWNATTR_SETSCHEDPARAM])
|
||||
GNULIB_POSIX_SPAWNATTR_GETSCHEDPOLICY=0; AC_SUBST([GNULIB_POSIX_SPAWNATTR_GETSCHEDPOLICY])
|
||||
GNULIB_POSIX_SPAWNATTR_SETSCHEDPOLICY=0; AC_SUBST([GNULIB_POSIX_SPAWNATTR_SETSCHEDPOLICY])
|
||||
GNULIB_POSIX_SPAWNATTR_GETSIGDEFAULT=0; AC_SUBST([GNULIB_POSIX_SPAWNATTR_GETSIGDEFAULT])
|
||||
GNULIB_POSIX_SPAWNATTR_SETSIGDEFAULT=0; AC_SUBST([GNULIB_POSIX_SPAWNATTR_SETSIGDEFAULT])
|
||||
GNULIB_POSIX_SPAWNATTR_GETSIGMASK=0; AC_SUBST([GNULIB_POSIX_SPAWNATTR_GETSIGMASK])
|
||||
GNULIB_POSIX_SPAWNATTR_SETSIGMASK=0; AC_SUBST([GNULIB_POSIX_SPAWNATTR_SETSIGMASK])
|
||||
GNULIB_POSIX_SPAWNATTR_DESTROY=0; AC_SUBST([GNULIB_POSIX_SPAWNATTR_DESTROY])
|
||||
dnl Assume proper GNU behavior unless another module says otherwise.
|
||||
HAVE_POSIX_SPAWN=1; AC_SUBST([HAVE_POSIX_SPAWN])
|
||||
HAVE_POSIX_SPAWNATTR_T=1; AC_SUBST([HAVE_POSIX_SPAWNATTR_T])
|
||||
HAVE_POSIX_SPAWN_FILE_ACTIONS_T=1;
|
||||
AC_SUBST([HAVE_POSIX_SPAWN_FILE_ACTIONS_T])
|
||||
HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR=1;
|
||||
AC_SUBST([HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR])
|
||||
HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR=1;
|
||||
AC_SUBST([HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR])
|
||||
REPLACE_POSIX_SPAWN=0; AC_SUBST([REPLACE_POSIX_SPAWN])
|
||||
REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR=0;
|
||||
AC_SUBST([REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR])
|
||||
REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE=0;
|
||||
AC_SUBST([REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE])
|
||||
REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2=0;
|
||||
AC_SUBST([REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2])
|
||||
REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR=0;
|
||||
AC_SUBST([REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR])
|
||||
REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN=0;
|
||||
AC_SUBST([REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN])
|
||||
])
|
|
@ -1,50 +0,0 @@
|
|||
# strchrnul.m4 serial 9
|
||||
dnl Copyright (C) 2003, 2007, 2009-2020 Free Software Foundation, Inc.
|
||||
dnl This file is free software; the Free Software Foundation
|
||||
dnl gives unlimited permission to copy and/or distribute it,
|
||||
dnl with or without modifications, as long as this notice is preserved.
|
||||
|
||||
AC_DEFUN([gl_FUNC_STRCHRNUL],
|
||||
[
|
||||
dnl Persuade glibc <string.h> to declare strchrnul().
|
||||
AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
|
||||
|
||||
AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS])
|
||||
AC_CHECK_FUNCS([strchrnul])
|
||||
if test $ac_cv_func_strchrnul = no; then
|
||||
HAVE_STRCHRNUL=0
|
||||
else
|
||||
AC_CACHE_CHECK([whether strchrnul works],
|
||||
[gl_cv_func_strchrnul_works],
|
||||
[AC_RUN_IFELSE([AC_LANG_PROGRAM([[
|
||||
#include <string.h> /* for strchrnul */
|
||||
]], [[const char *buf = "a";
|
||||
return strchrnul (buf, 'b') != buf + 1;
|
||||
]])],
|
||||
[gl_cv_func_strchrnul_works=yes],
|
||||
[gl_cv_func_strchrnul_works=no],
|
||||
[dnl Cygwin 1.7.9 introduced strchrnul, but it was broken until 1.7.10
|
||||
AC_EGREP_CPP([Lucky user],
|
||||
[
|
||||
#if defined __CYGWIN__
|
||||
#include <cygwin/version.h>
|
||||
#if CYGWIN_VERSION_DLL_COMBINED > CYGWIN_VERSION_DLL_MAKE_COMBINED (1007, 9)
|
||||
Lucky user
|
||||
#endif
|
||||
#else
|
||||
Lucky user
|
||||
#endif
|
||||
],
|
||||
[gl_cv_func_strchrnul_works="guessing yes"],
|
||||
[gl_cv_func_strchrnul_works="guessing no"])
|
||||
])
|
||||
])
|
||||
case "$gl_cv_func_strchrnul_works" in
|
||||
*yes) ;;
|
||||
*) REPLACE_STRCHRNUL=1 ;;
|
||||
esac
|
||||
fi
|
||||
])
|
||||
|
||||
# Prerequisites of lib/strchrnul.c.
|
||||
AC_DEFUN([gl_PREREQ_STRCHRNUL], [:])
|
Loading…
Add table
Reference in a new issue