Commit Graph

31 Commits

Author SHA1 Message Date
Warner Losh
fbbd9655e5 Renumber copyright clause 4
Renumber cluase 4 to 3, per what everybody else did when BSD granted
them permission to remove clause 3. My insistance on keeping the same
numbering for legal reasons is too pedantic, so give up on that point.

Submitted by:	Jan Schaumann <jschauma@stevens.edu>
Pull Request:	https://github.com/freebsd/freebsd/pull/96
2017-02-28 23:42:47 +00:00
Jilles Tjoelker
43d53dba8f Add sbin and /usr/local directories to _PATH_DEFPATH.
Set _PATH_DEFPATH to
/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin. This is the
path in the default class in the default /etc/login.conf,
excluding ~/bin which would not be expanded properly in a string
constant.

For normal logins, _PATH_DEFPATH is overridden by /etc/login.conf,
~/.login_conf or shell startup files. _PATH_DEFPATH is still used as a
default by execlp(), execvp(), posix_spawnp() and sh if PATH is not set, and
by cron. Especially the latter is a common trap (most recently in PR
204813).

PR:		204813
Reviewed by:	secteam (delphij), alfred
2016-01-05 16:21:20 +00:00
Jilles Tjoelker
3c0237a634 exec(3): Fix COMPATIBILITY section: default path does not contain cwd.
MFC after:	1 week
2015-12-12 15:57:46 +00:00
Ed Schouten
c605eea952 Turn execvpe() into an internal libc routine.
Adding exevpe() has caused some ports to break. Even though execvpe() is
a useful routine, it does not conform to any standards.

This patch is a little bit different from the patch sent to the mailing
list. I forgot to remove execvpe from the Symbol.map (which does not
seem to miscompile libc, though).

Reviewed by:	davidxu
Approved by:	philip
2008-06-23 05:22:06 +00:00
David Xu
947aa542e9 Add POSIX routines called posix_spawn() and posix_spawnp(), which
can be used as replacements for exec/fork in a lot of cases. This
change also added execvpe() which allows environment variable
PATH to be used for searching executable file, it is used for
implementing posix_spawnp().

PR: standards/122051
2008-06-17 06:26:29 +00:00
Warner Losh
c879ae3536 Per Regents of the University of Calfornia letter, remove advertising
clause.

# If I've done so improperly on a file, please let me know.
2007-01-09 00:28:16 +00:00
Ruslan Ermilov
0227791b40 Expand *n't contractions. 2005-02-13 22:25:33 +00:00
Ruslan Ermilov
24a0682c64 Sort sections. 2005-01-20 09:17:07 +00:00
Ruslan Ermilov
743d5d518c mdoc(7): Properly mark C headers. 2003-09-10 19:24:35 +00:00
Ruslan Ermilov
b6f8b339d3 With the latest mdoc(7), we can now fix the synopsis like this.
Desired by:	bde
2003-07-03 18:14:39 +00:00
Gordon Tetlow
09f49aab84 Add a libc function execvP that takes the search path as an arguement.
Change execvp to be a wrapper around execvP. This is necessary for some
of the /rescue pieces. It may also be more generally applicable as well.

Submitted by:	Tim Kientzle <kientzle@acm.org>
Approved by:	Silence on arch@
2003-06-29 17:33:34 +00:00
Ruslan Ermilov
19c2ee9e5f Make the execle() synopsis look (again) like a normal C prototype.
Also fixed the rest of ell (list) functions prototypes to include
a (commented out) terminating null pointer.

Pointed out by:	bde
Obtained from:	POSIX.1-2001
Glanced at by:	imp
2003-06-18 15:24:21 +00:00
Poul-Henning Kamp
bbaba031a5 Fix the execle(3) synopsis to include the environment pointer.
Confused:	anordby
2003-06-17 08:57:37 +00:00
Ruslan Ermilov
2efeeba554 mdoc(7) police: "The .Fa argument.". 2002-12-19 09:40:28 +00:00
Ruslan Ermilov
95f4226b27 mdoc(7) police: "The .Fn function". 2002-12-18 10:13:54 +00:00
Ruslan Ermilov
32eef9aeb1 mdoc(7) police: Use the new .In macro for #include statements. 2001-10-01 16:09:29 +00:00
Dima Dorfman
dae32f31ab begin executed --> being executed
Obtained from:	NetBSD
2001-08-24 00:18:37 +00:00
Dima Dorfman
7ebcc426ef Remove whitespace at EOL. 2001-07-15 07:53:42 +00:00
Dima Dorfman
a910f192bb Remove duplicate words. 2001-06-24 01:34:38 +00:00
Ruslan Ermilov
b77b3c00be mdoc(7) police: Ft/Vt now accept punctuation-type arguments. 2001-01-12 15:46:56 +00:00
Ben Smithurst
cb17760de7 Remove fullstops from the end of .Xr lines in SEE ALSO section. 2000-11-15 14:40:14 +00:00
Jeroen Ruigrok van der Werven
cc5966e584 Correct incorrect information about the PATH used for exec*() calls.
PR:			21990
Partially submitted by:	Gerhard Sittig <Gerhard.Sittig@gmx.net>
2000-10-30 13:39:23 +00:00
Jeroen Ruigrok van der Werven
5714e85318 Whitespace only change: trim trailing whitespace. 2000-10-30 13:23:19 +00:00
Alexey Zelkin
25bb73e063 Introduce ".Lb" macro to libc manpages.
More libraries manpages updates following.
2000-04-21 09:42:15 +00:00
Peter Wemm
7f3dea244c $Id$ -> $FreeBSD$ 1999-08-28 00:22:10 +00:00
Bruce Evans
1df595f25d Fixed searching of $PATH in execvp(). Do what sh(1) should do according
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
1997-10-14 07:23:16 +00:00
Bruce Evans
853aa1faf3 Fixed synopsis. The envp arg for execle() can't be given in the prototype.
Fortunately, the man page doesn't refer to "envp" so just deleting it is OK.
1997-09-03 03:25:35 +00:00
Mike Pritchard
712dc76e87 Fixed various problems: typos, grammer, missing include files
wrong function type declarations, and wrong argument type
declarations.
1996-05-23 01:05:25 +00:00
Mike Pritchard
064f007493 Added missing section numbers to a bunch of .Xr macros, or
converted them into .Fn macros where appropriate.  Also fixed
up some minor formatting problems.
1996-03-27 20:49:07 +00:00
Mike Pritchard
78b0b234eb Correct a bunch of man page cross references and generally
try and silence "manck".

ncurses, rpc, and some of the gnu stuff are still a big mess, however.
1996-02-11 22:38:05 +00:00
Rodney W. Grimes
58f0484fa2 BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00