Go to main content

man pages section 3: Basic Library Functions

Exit Print View

Updated: Wednesday, July 27, 2022
 
 

isaexec(3C)

Name

isaexec - invoke isa-specific executable

Synopsis

#include <unistd.h>

int isaexec(const char *path, char *const argv[], char *const envp[]);

Description

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.

Return Values

If no file is located, isaexec() returns ENOENT. Other return values are the same as for execve().

Examples

Example 1 Example of isaexec() function.

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));
}

Attributes

See attributes(7) for descriptions of the following attributes:

ATTRIBUTE TYPE
ATTRIBUTE VALUE
MT-Level
Safe
Interface Stability
Committed

See Also

exec(2), getisax(2), getexecname(3C), attributes(7), isalist(7)