Commit Graph

3 Commits

Author SHA1 Message Date
Adhemerval Zanella
db8cbc6a7a posix: Use posix_spawn for wordexp
This patch replaces the fork+exec by posix_spawn on wordexp, which
allows a better scability on Linux and simplifies the thread
cancellation handling.

The only change which can not be implemented with posix_spawn the
/dev/null check to certify it is indeed the expected device.  I am
not sure how effetive this check is since /dev/null tampering means
something very wrong with the system and this is the least of the
issues.  My view is the tests is really out of the place and the
hardening provided is minimum.

If the idea is still to provide such check, I think a possibilty
would be to open /dev/null, check it, add a dup2 file action, and
close the file descriptor.

Checked on powerpc64le-linux-gnu and x86_64-linux-gnu.

	* include/spawn.h (__posix_spawn_file_actions_addopen): New
	prototype.
	* posix/spawn_faction_addopen.c (posix_spawn_file_actions_addopen):
	Add internal alias.
	* posix/wordexp.c (create_environment, free_environment): New
	functions.
	(exec_comm_child, exec_comm): Use posix_spawn instead of fork+exec.
	* posix/wordexp-test.c: Use libsupport.
2019-10-09 17:48:41 -03:00
Adhemerval Zanella
2a973ab7f1 posix: Add internal symbols for posix_spawn interface
This patch adds internal hidden definition for mostly of the posix_spawn
function so it can be used internally on both popen and system
implementations.

Checked on x86_64-linux-gnu.

	* include/spawn.h (__posix_spawn, posix_spawn_file_actions_addclose,
	__posix_spawn_file_actions_adddup2, __posix_spawn_file_actions_destroy,
	__posix_spawn_file_actions_init, __posix_spawnattr_init,
	__posix_spawnattr_destroy, __posix_spawnattr_setflags,
	__posix_spawnattr_setsigdefault, __posix_spawnattr_setsigmask): New
	prototype.
	* posix/spawn.c (__posix_spawn): Add libc_hidden_def.
	* posix/spawn_faction_addclose.c
	(__posix_spawn_file_actions_addclose): Add hidden definition.
	* posix/spawn_faction_adddup2.c
	(__posix_spawn_file_actions_adddup2): Likewise.
	* posix/spawn_faction_destroy.c
	(__posix_spawn_file_actions_destroy): Likewise.
	* posix/spawn_faction_init.c (__posix_spawn_file_actions_init):
	Likewise.
	* posix/spawnattr_destroy.c (__posix_spawnattr_destroy): Likewise.
	* posix/spawnattr_init.c (__posix_spawnattr_init): Likewise.
	* posix/spawnattr_setdefault.c (__posix_spawnattr_setsigdefault):
	Likewise.
	* posix/spawnattr_setflags.c (__posix_spawnattr_setflags): Likewise.
	* posix/spawnattr_setsigmask.c (__posix_spawnattr_setsigmask):
	Likewise.
2018-10-24 15:22:27 -03:00
Ulrich Drepper
3e07621988 Update.
2000-10-01  Bruno Haible  <haible@clisp.cons.org>

	* charmaps/BIG5: Add a width table.
	* charmaps/GB18030: Likewise.
	* charmaps/ISO-8859-6: Likewise.
	* charmaps/ISO-8859-8: Likewise.
	* charmaps/TIS-620: Likewise.
2000-10-01 19:15:29 +00:00