man(1) Manual page archive

sys-exec(2) - Unix First Edition Manual Page
11/3/71SYS_EXEC (II)

NAME exec --execute a file
SYNOPSIS sys exec; name; args / exec = 11.


name: <...\0>... args: arg1; arg2; ...; 0arg1: <...\0> ...
DESCRIPTION exec overlays the calling process with the named file,then transfers to the beginning of the core image of the


file. The first argument to exec is a pointer to the nameof the file to be executed. The second is the address of a list of pointers to arguments to be passed to the file.Conventionally, the first argument is the name of the file. Each pointer addresses a string terminated by a nullbyte.


There can be no return from the file; the calling coreimage is lost. The program break is set from the executed file; see theformat of a.out. Once the called file starts execution, the arguments arepassed as follows. The stack pointer points to the number of arguments. Just above this number is a list of pointersto the argument strings.


sp--> nargs


arg1... argn arg1: ... argn: The arguments are placed as high as possible incore: justbelow 60000(8).


Files remain open across exec calls. However, the illegalinstruction, emt, quit, and interrupt trap specifications are reset to the standard values. (See ilgins, cemt,intr).


Each user has a real user ID and an effective (The real IDidentifies the person using the system; the effective ID determines his access privileges.) exec changes theeffective user ID to the owner of the executed file if the file has the "set--user--ID mode. The real user ID is notaffected.


11/3/71SYS_EXEC (II)

FILES
SEE_ALSO fork
DIAGNOSTICS If the file cannot be read or if it is not executable, areturn from exec constitutes the diagnostic. The error bit


(c--bit) is set.

BUGS
OWNER ken, dmr