execve man page on Ultrix

Man page or keyword search:  
man Server   3690 pages
apropos Keyword Search (all sections)
Output format
Ultrix logo
[printable version]

execve(2)							     execve(2)

       execve - execute a file

       execve(name, argv, envp)
       char *name, *argv[], *envp[];

       The system call transforms the calling process into a new process.  The
       new process is constructed from an ordinary file called the new process
       file.  This file is either an executable object file, or a file of data
       for an interpreter.  An executable object file consists of an identify‐
       ing  header, followed by pages of data representing the initial program
       (text) and initialized data pages.  Additional pages can	 be  specified
       by  the	header to be initialized with zero data.  For further informa‐
       tion, see

       An interpreter file begins with a line of the form ``#!	interpreter''.
       When  an interpreter file is executed the system executes the specified
       interpreter, giving it the name of the originally executed file	as  an
       argument, shifting over the rest of the original arguments.

       There can be no return from a successful because the calling core image
       is lost.	 This is the mechanism whereby different process images become

       The  argument argv is an array of character pointers to null-terminated
       character strings.  These strings constitute the argument  list	to  be
       made  available	to the new process.  By convention, at least one argu‐
       ment must be present in this array, and the first element of this array
       should be the name of the executed program, the last component of name.

       The argument envp is also an array of character pointers to null-termi‐
       nated strings.  These strings pass information to the new process,  but
       they  are  not directly arguments to the command.  For further informa‐
       tion, see

       Descriptors open in the calling process remain open in the new process,
       except  for those for which the close-on-exec flag is set.  For further
       information, see Descriptors which remain open are unaffected by

       Ignored signals remain ignored across an but signals  that  are	caught
       are  reset  to  their  default values.  The signal stack is reset to be
       undefined.  For further information, see

       Each process has real user and group IDs and effective user  and	 group
       IDs.  The real ID identifies the person using the system; the effective
       ID determines his access	 privileges.   The  system  call  changes  the
       effective  user	and  group ID to the owner of the executed file if the
       file has the set-user-ID or set-group-ID modes.	The real  user	ID  is
       not affected.

       The new process also inherits the following attributes from the calling

	    Process ID		See getpid(2)
	    Parent process ID	See getpid(2)
	    Process group ID	See getpgrp(2)
	    Access groups	See getgroups(2)
	    Working directory	See chdir(2)
	    root directory	See chroot(2)
	    Control terminal	See tty(4)
	    Resource usages	See getrusage(2)
	    Interval timers	See getitimer(2)
	    Resource limits	See getrlimit(2)
	    File mode mask	See umask(2)
	    Signal mask		See sigvec(2)

       When the executed program begins, it is called as follows:

	    main(argc, argv, envp)
	    int argc;
	    char **argv, **envp;

       The argc argument is the number of elements in argv (the ``arg count'')
       and  argv  is  the  array  of character pointers to the arguments them‐

       The envp argument is a pointer to an array of strings  that  constitute
       the environment of the process.	A pointer to this array is also stored
       in the global environ variable.	Each string consists  of  a  name,  an
       equal  sign  ( = ), and a null-terminated value.	 The array of pointers
       is terminated by a null pointer.	 The shell passes an environment entry
       for each global shell variable defined when the program is called.  See
       for some conventionally used names.

       If returns to the calling process, an error has	occurred;  the	return
       value is -1 and the global variable errno contains an error code.

   POSIX, System Five
       When  your program is compiled using the POSIX or System V environment,
       the effective user ID and effective group ID of the new	process	 image
       are saved (as the saved-set-uid and saved-set-gid) for later use by the
       and functions.

       If a program's effective user ID is not the superuser, but it  is  exe‐
       cuted when the real user ID is root, then the program has the powers of
       the superuser.

       The system call fails and returns to the calling process under the fol‐
       lowing conditions:

       [ENOENT]	      The new process file does not exist.

       [ENOTDIR]      A component of the path prefix is not a directory.

       [EACCES]	      Search  permission is denied for a component of the path

       [EACCES]	      The new process file is not an ordinary file.

       [EACCES]	      The new process file mode denies execute permission.

       [ENOEXEC]      The new process file has the appropriate access  permis‐
		      sion, but it has an invalid magic number in its header.

       [ETXTBSY]      The  new	process file is a pure procedure (shared text)
		      file that is currently open for writing  or  reading  by
		      some process.

       [ENOMEM]	      The  new	process	 requires  more virtual memory than is
		      allowed by the imposed maximum.	For  further  informa‐
		      tion, see

       [E2BIG]	      The  number  of bytes in the new process's argument list
		      is larger than the  system-imposed  limit	 of  {ARG_MAX}

       [EFAULT]	      The  new process file is not as long as indicated by the
		      size values in its header.

       [EFAULT]	      The path, argv, or envp points to an illegal address.

       [EIO]	      An I/O error occurred while reading from the  file  sys‐

       [ENAMETOOLONG] A component of a pathname exceeded 255 characters, or an
		      entire path name exceeded 1023 characters.

       [ELOOP]	      Too many symbolic links were encountered in  translating
		      the pathname.

       [EROFS]	      If binaries cannot be executed from the file system.

       [EROFS]	      If and programs cannot be executed from the file system.

       [ESTALE]	      The  file	 handle given in the argument is invalid.  The
		      file referred to by that file handle no longer exists or
		      has been revoked.

       [ETIMEDOUT]    A	 connect  request  or  remote  file  operation	failed
		      because the connected party  did	not  properly  respond
		      after a period of time that is dependent on the communi‐
		      cations protocol.

See Also
       exit(2), fork(2), execl(3), environ(7)


List of man pages available for Ultrix

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
Vote for polarhome
Free Shell Accounts :: the biggest list on the net