isaexec - invoke isa-specific executable
#include <unistd.h> int isaexec(const char *path, char *const argv[], char *const envp[]);
The isaexec() function breaks the specified path into directory and file name components. The list of instruction set architectures that are supported by the underlying system is discovered; see isalist(7). isaexec traverses this list, searching for an instance of the original file name within a subdirectory identified by the list item, of the original directory.
If an executable file is located, execve() is invoked with argv[ ] and envp[ ]. See exec(2).
The enumerated list of instruction set architectures used by this function may be suboptimal or obsolete. For recommended ways of identifying and using instruction set variants, see getisax(2), and the chapter Chapter 8, Capability Processing in Oracle Solaris 11.4 Linkers and Libraries Guide.
If no file is located, isaexec() returns ENOENT. Other return values are the same as for execve().
On a system whose available instruction set architectures are:
sparcv7 sparc
the following program first looks for an executable file named /bin/sparcv7/thing, then for an executable file named /bin/sparc/thing. execve() is invoked for the first executable file named thing that is found.
int main(int argc, char *argv[], char *envp[]) { return (isaexec("/bin/thing", argv, envp)); }
On the same system, a program called /u/bin/tofu can cause either /u/bin/sparcv7/tofu or /u/bin/sparc/tofu to be invoked using the following.
int main(int argc, char *argv[], char *envp[]) { return (isaexec(getexecname(), argv, envp)); }
See attributes(7) for descriptions of the following attributes:
|
exec(2), getisax(2), getexecname(3C), attributes(7), isalist(7)