Open System Services System Calls Reference Manual (G06.25+, H06.03+)

tdm_execvep(2) OSS System Calls Reference Manual
Specifying the Environment
The envp[]parameter is an array of character pointers to null-terminated strings. These strings
constitute the environment for the new process image. The environment array is terminated with
a null pointer.
The number of bytes available for the new processs combined argument and environment lists
has a system-imposed limit. This limit, which includes the pointers and the null terminators on
the strings, is available by calling the sysconf(_SC_ARG_MAX)
function.
Executing a Binary File
If the le specied as the new process image le is a binary executable le, the tdm_execvep()
function loads the le directly.
Executing a Text File
If the le specied as the new process image le is not a binary executable le, the
tdm_execvep() function examines the le to determine whether it is an executable text le. It
checks for a header line in this format:
#! interpreter_name [optional_string]
The #! notation identies the le as an executable text le. The new process image lename is
constructed from the process image lename in the interpreter_name string, treating it like the
le parameter. The Guardian input and output structures pointed to by the pe_parms and
pr_results parameters apply to the command interpreter as they would to any process le.
The arguments passed to the new process are modied as listed:
argv[0] is set to the name of the command interpreter.
If the optional_string portion is present, argv[1] is set to optional_string.
The next element of argv[]is set to the original value of le.
The remaining elements of argv[]are set to the original elements of argv[], starting with
argv[1]. The original argv[0] is discarded.
The S_ISUID and S_ISGID mode bits of an executable text le are honored. Those bits are
ignored for the interpreter_name command interpreter.
When the File Is Invalid
If the process image le is not a valid executable object, or if the text le does not contain the
header line, the tdm_execvep() function invokes the interpreter_name command interpreter as
the new process image and passes these arguments to it:
argv[0] is set to the string sh.
argv[1] is set to the original value of the le parameter.
The remaining elements of argv[]are set to the original elements of argv[], starting with
argv[1].
The original argv[0] is discarded.
818 Hewlett-Packard Company 527186-003