llow'/>
summaryrefslogtreecommitdiff
path: root/lib/libc/stdlib/system.c
AgeCommit message (Collapse)Author
2022-03-14system(3): Simplify initialization of argp.riastradh
2022-03-14system(3): Switch from vfork/execve to posix_spawn.riastradh
Changes by me: - Minor style nits. - Set errno on posix_spawn failure. - Handle edge cases of SIGINT/SIGQUIT set to SIG_IGN by caller. Author: Nikita Ronja Gillmann <nikita@NetBSD.org> Committer: Taylor R Campbell <riastradh@NetBSD.org>
2021-10-29Add "--" 'options end' parameter to the sh -c call that runs thekre
command, so that the command cannot appear to be more options (which always then fails, as there would be no arg for "-c" to treat as the command string in that case). For the full (LONG) explanation, see: http://mail-index.netbsd.org/current-users/2021/10/29/msg041629.html
2015-01-20Fix non _REENTRANT build.christos
2012-06-25Update old-style definitions to ANSI, remove a couple of registerabs
definitions along the way. Fixed gcc 4.1 build (thank you vax)
2010-11-14Improve and simplify implementation of *env(3) functions:tron
- Use RB tree to keep track of memory allocated via setenv(3) as suggested by Enami Tsugutomo in private e-mail. This simplifies the code a lot as we no longer need to keep the size of "environ" in sync with an array of allocated environment variables. It also makes it possible to free environment variables in unsetenv(3) if something has changed the order of the "environ" array. - Fix a bug in getenv(3) and getenv_r(3) which would return bogus results e.g. for " getenv("A=B") " if an environment variable "A" with value "B=C" exists. - Clean up the internal functions: - Don't expose the read/write lock for the environment to other parts of "libc". Provide locking functions instead. - Use "bool" to report success or failure. - Use "ssize_t" or "size_t" instead of "int" for indexes. - Provide internal functions with simpler interfaces e.g. don't combine return values and reference arguments. - Don't copy "environ" into an allocated block unless we really need to grow it. Code reviewed by Joerg Sonnenberger and Christos Zoulas, tested by Joerg Sonnenberger and me. These changes also fix problems in zsh 4.3.* and pam_ssh according to Joerg.
2008-08-27system(NULL) should return if the command interpreter is there or not.christos
Andy Shevchenko
2006-10-07Correctly recover signal state if failed trying to set it.elad
Patch from David A. Holland in #NetBSD-code, thanks!
2005-11-29WARNS=4christos
2003-08-07Move UCB-licensed code from 4-clause to 3-clause licence.agc
Patches provided by Joel Baker in PR 22280, verified by myself.
2003-03-04Don't acquire __environ_lock around exec*() calls; nothing requiresnathanw
that these calls be thread-safe with respect to the environment, and it causes serious problems for threaded applications which call vfork() and exec*() (including indirectly, via popen() or system()). Acquire and release __environ_lock in the parent in popen() and system() to play safe and provide the child with a stable environment. __environ_lock should also have an atfork() handler; still under development.
2001-10-31Inspired by Stevens' APUE and the implementation example in XSH:kleink
* Don't return if wait()ing for the child is interrupted. * Fix a race condition for the parent's SIG{INT,QUIT} disposition. * While we're here, convert from using signal(3) to sigaction(2).