summaryrefslogtreecommitdiff
path: root/lib/libc/gen/exec.c
Commit message (Collapse)AuthorAgeFilesLines
* stat() the correct file in execvp() so that the fine tuned errno handlingBruce Evans1997-11-201-2/+2
| | | | | | | actually works. Notes: svn path=/head/; revision=31309
* Fixed searching of $PATH in execvp(). Do what sh(1) should do accordingBruce Evans1997-10-141-9/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | to POSIX.2. In particular: - don't retry for ETXTBSY. This matches what sh(1) does. The retry code was broken anyway. It only slept for several seconds for the first few retries. Then it retried without sleeping. - don't abort the search for errors related to the path prefix, in particular for ENAMETOOLONG, ENOTDIR, ELOOP. This fixes PR1487. sh(1) gets this wrong in the opposite direction by never aborting the search. - don't confuse EACCES for errors related to the path prefix with EACCES for errors related to the file. sh(1) gets this wrong. - don't return a stale errno when the search terminates normally without finding anything. The errno for the last unsuccessful execve() was usually returned. This gave too much precedence to pathologies in the last component of $PATH. This bug is irrelevant for sh(1). The implementation still uses the optimization/race-inhibitor of trying to execve() things first. POSIX.2 seems to require looking at file permissions using stat(). We now use stat() after execve() if execve() fails with an ambiguous error. Trying execve() first may actually be a pessimization, since failing execve()s are fundamentally a little slower than stat(), and are significantly slower when a file is found but has unsuitable permissions or points to an unsuitable interpreter. PR: 1487 Notes: svn path=/head/; revision=30399
* Fixed execvp() of an empty pathname to fail POSIXly. Previously itBruce Evans1996-11-181-0/+6
| | | | | | | | | | attempted to exec the components of $PATH and it usually set errno to the wrong value. Found by: NIST PCTS Notes: svn path=/head/; revision=19852
* Fixed uninitialized variables for the '/'-in-pathname case in execvp().Bruce Evans1996-11-181-1/+2
| | | | | | | | | | | Garbage in `eacces' caused the wrong errno to be set for non-EACCES errors. Garbage in `etxtbsy' caused a semi-random retry strategy for ETXTBSY errors. Found by: NIST-PCTS. gcc -Wall reported the problem, but -Wall is not enabled for libc. Notes: svn path=/head/; revision=19850
* General -Wall warning cleanup, part I.Jordan K. Hubbard1996-07-121-4/+4
| | | | | | | Submitted-By: Kent Vander Velden <graphix@iastate.edu> Notes: svn path=/head/; revision=17141
* Fix execl[e]. Multiple execle's failed because of bogus caching of theBruce Evans1994-12-121-16/+14
| | | | | | | | | | | pointer returned by realloc(). All callers free the pointer if the execve fails. Nuke the caching. This essentially restores buildargv() to the 1.1.5 version. Also fix a memory leak if realloc() fails. Also nuke similar but non-broken caching in execvp(). malloc() should be efficient enough. Notes: svn path=/head/; revision=5070
* BSD 4.4 Lite Lib SourcesRodney W. Grimes1994-05-271-0/+271
Notes: svn path=/cvs2svn/branches/unlabeled-1.1.1/; revision=1573