[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[patches] PATCH: Implement the OPTION_EGLIBC_SPAWN option group



I've committed the following.

ChangeLog.eglibc:
2007-08-17  Jim Blandy  <jimb@xxxxxxxxxxxxxxxx>

	Implement the OPTION_EGLIBC_SPAWN option group.

	* option-groups.def (OPTION_EGLIBC_SPAWN): New entry.
	* option-groups.defaults (OPTION_EGLIBC_SPAWN): Initialize.
	* posix/Makefile (routines): Move spawn routines into group.
	(tests): Move tst-spawn into group.
	* iconv/Makefile (CPPFLAGS-charmap-dir.c): Pass NO_UNCOMPRESS if
	spawn is not available.
	* locale/Makefile (CFLAGS-charmap-dir.c): Same.
	* nptl/Makefile (tst-exec1): Put in group.

Index: option-groups.def
===================================================================
--- option-groups.def	(revision 3173)
+++ option-groups.def	(working copy)
@@ -420,6 +420,42 @@
         rresvport       ruserpass
         rresvport_af
         
+config OPTION_EGLIBC_SPAWN
+   bool "Support for POSIX posix_spawn functions"
+   help
+      This option group includes the POSIX functions for executing
+      programs in child processes without using 'fork' or 'vfork'.
+
+      This option group includes the following functions:
+
+        posix_spawn
+        posix_spawnattr_destroy
+        posix_spawnattr_getflags
+        posix_spawnattr_getpgroup
+        posix_spawnattr_getschedparam
+        posix_spawnattr_getschedpolicy
+        posix_spawnattr_getsigdefault
+        posix_spawnattr_getsigmask
+        posix_spawnattr_init
+        posix_spawnattr_setflags
+        posix_spawnattr_setpgroup
+        posix_spawnattr_setschedparam
+        posix_spawnattr_setschedpolicy
+        posix_spawnattr_setsigdefault
+        posix_spawnattr_setsigmask
+        posix_spawn_file_actions_addclose
+        posix_spawn_file_actions_adddup2
+        posix_spawn_file_actions_addopen
+        posix_spawn_file_actions_destroy
+        posix_spawn_file_actions_init
+        posix_spawnp
+
+      This option group also provides the ability for the iconv,
+      localedef, and locale programs to operate transparently on
+      compressed charset definitions.  When this option group is
+      disabled, those programs will only operate on uncompressed
+      charmap files.
+
 config OPTION_EGLIBC_SUNRPC
    bool "Support for the Sun 'RPC' protocol."
    depends OPTION_EGLIBC_INET
Index: iconv/Makefile
===================================================================
--- iconv/Makefile	(revision 3173)
+++ iconv/Makefile	(working copy)
@@ -79,6 +79,9 @@
 CPPFLAGS-strtab = -DNOT_IN_libc
 CPPFLAGS-charmap = -DNOT_IN_libc
 CPPFLAGS-charmap-dir = -DNOT_IN_libc
+ifneq (y,$(OPTION_EGLIBC_SPAWN))
+CPPFLAGS-charmap-dir.c += -DNO_UNCOMPRESS
+endif
 
 include ../Rules
 
Index: locale/Makefile
===================================================================
--- locale/Makefile	(revision 3173)
+++ locale/Makefile	(working copy)
@@ -124,6 +124,9 @@
 CFLAGS-charmap.c = -Wno-write-strings -Wno-char-subscripts
 CFLAGS-locfile.c = -Wno-write-strings -Wno-char-subscripts
 CFLAGS-charmap-dir.c = -Wno-write-strings
+ifneq (y,$(OPTION_EGLIBC_SPAWN))
+CFLAGS-charmap-dir.c += -DNO_UNCOMPRESS
+endif
 CFLAGS-ld-messages.c = $(OPTION_POSIX_REGEXP-CFLAGS-y)
 
 # This makes sure -DNOT_IN_libc is passed for all these modules.
Index: option-groups.defaults
===================================================================
--- option-groups.defaults	(revision 3173)
+++ option-groups.defaults	(working copy)
@@ -19,5 +19,6 @@
 OPTION_EGLIBC_NIS = y
 OPTION_EGLIBC_NSSWITCH = y
 OPTION_EGLIBC_RCMD = y
+OPTION_EGLIBC_SPAWN = y
 OPTION_EGLIBC_SUNRPC = y
 OPTION_POSIX_REGEXP = y
Index: nptl/Makefile
===================================================================
--- nptl/Makefile	(revision 3173)
+++ nptl/Makefile	(working copy)
@@ -247,7 +247,7 @@
 	tst-flock1 tst-flock2 \
 	tst-signal1 tst-signal2 tst-signal3 tst-signal4 tst-signal5 \
 	tst-signal6 tst-signal7 \
-	tst-exec1 tst-exec2 tst-exec3 tst-exec4 \
+	tst-exec2 tst-exec3 tst-exec4 \
 	tst-exit1 tst-exit2 tst-exit3 \
 	tst-stdio1 tst-stdio2 \
 	tst-stack1 tst-stack2 tst-stack3 \
@@ -267,6 +267,9 @@
 	tst-initializers1 $(patsubst %,tst-initializers1-%,c89 gnu89 c99 gnu99)
 xtests = tst-setuid1 tst-setuid1-static tst-mutexpp1 tst-mutexpp6 tst-mutexpp10
 
+# This test uses the posix_spawn functions.
+tests-$(OPTION_EGLIBC_SPAWN) += tst-exec1
+
 # Files which must not be linked with libpthread.
 tests-nolibpthread = tst-unload
 
Index: posix/Makefile
===================================================================
--- posix/Makefile	(revision 3173)
+++ posix/Makefile	(working copy)
@@ -59,6 +59,12 @@
 	sched_primin sched_rr_gi sched_getaffinity sched_setaffinity	      \
 	wordexp								      \
 	pread pwrite pread64 pwrite64					      \
+	posix_madvise							      \
+	get_child_max sched_cpucount
+
+routines-$(OPTION_EGLIBC_INET) += getaddrinfo gai_strerror 
+routines-$(OPTION_POSIX_REGEXP) += regex
+routines-$(OPTION_EGLIBC_SPAWN) +=					      \
 	spawn_faction_init spawn_faction_destroy spawn_faction_addclose	      \
 	spawn_faction_addopen spawn_faction_adddup2			      \
 	spawnattr_init spawnattr_destroy				      \
@@ -66,13 +72,8 @@
 	spawnattr_getflags spawnattr_setflags				      \
 	spawnattr_getpgroup spawnattr_setpgroup spawn spawnp spawni	      \
 	spawnattr_getsigmask spawnattr_getschedpolicy spawnattr_getschedparam \
-	spawnattr_setsigmask spawnattr_setschedpolicy spawnattr_setschedparam \
-	posix_madvise							      \
-	get_child_max sched_cpucount
+	spawnattr_setsigmask spawnattr_setschedpolicy spawnattr_setschedparam
 
-routines-$(OPTION_EGLIBC_INET) += getaddrinfo gai_strerror 
-routines-$(OPTION_POSIX_REGEXP) += regex
-
 include ../Makeconfig
 
 aux		:= init-posix environ
@@ -105,7 +106,8 @@
 xtests-$(OPTION_EGLIBC_INET) += bug-ga2
 ifeq (yes,$(build-shared))
 test-srcs	:= globtest
-tests           += wordexp-test tst-exec tst-spawn
+tests           += wordexp-test tst-exec
+tests-$(OPTION_EGLIBC_SPAWN) += tst-spawn
 endif
 others		:= getconf
 install-bin	:= getconf