| Skip Navigation Links | |
| Exit Print View | |
![]() | man pages section 2: System Calls Oracle Solaris 11 Information Library |
- execute a file
#include <sys/execx.h>int execvex(uintptr_tfile, char *constargv[], char *constenvp[], intflags);
All of the interfaces described inexec() are implemented using calls tothe fundamentalexecvex() system call described here. Seeexec(2) for details of processexecution and return values from the system call.
The interpretation of the file argument depends on the value of theflags argument. The value of theflags argument must be aninclusive-OR of zero or more of these values:
|
IfEXEC_DESCRIPTOR is set inflags, thefile argument must be anopen file descriptor for a regular file that is executable by thecalling process. The file may have been opened with any ofthese access modes (seeopen(2)):
|
IfEXEC_DESCRIPTOR is not set inflags, thefile argument must bea pointer to a pathname for a file that is executable bythe calling process.
IfEXEC_RETAINNAME is set inflags, the process's name, contained in thekernel user structureu_comm[] member, fetched in the /proc/pid/psinfopr_fname[] member, reportedbyps(1) and interrogated bypgrep(1), remains unchanged across theexec() ofthe new image.
IfEXEC_DESCRIPTOR orEXEC_ARGVNAME is set inflags andEXEC_RETAINNAME is notset, the process's name becomes the last component of the pathname-likeargv[0]argument.
If none of theEXEC_DESCRIPTOR,EXEC_RETAINNAME orEXEC_ARGVNAME flags are set inflags, the name of the process becomes the last component of thepathname passed in thefile argument.
A call toexecvex() with no flags:
execvex((uintptr_t)pathname,argv,envp, 0);
is equivalent to a call toexecve():
execve(pathname,argv,envp);
A call toexecvex() with only theEXEC_DESCRIPTOR flag:
execvex(fd,argv,envp, EXEC_DESCRIPTOR);
is equivalent to a call tofexecve():
fexecve(fd,argv,envp);
If theexecvex() function returns to the calling process image, an errorhas occurred; the return value is -1 anderrno is set toindicate the error.
In addition to the failures described inexec(2), theexecvex() function willfail if:
Theflags argument is invalid.
Seeattributes(5) for descriptions of the following attributes:
|
Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Legal Notices | ![]() ![]() |