1isaexec(3C) Standard C Library Functions isaexec(3C)
2
3
4
6 isaexec - invoke isa-specific executable
7
9 #include <unistd.h>
10
11 int isaexec(const char *path, char *const argv[], char *const envp[]);
12
13
15 The isaexec() function takes the path specified as path and breaks it
16 into directory and file name components. It enquires from the running
17 system the list of supported instruction set architectures; see isal‐
18 ist(5). The function traverses the list for an executable file in named
19 subdirectories of the original directory. When such a file is located,
20 execve() is invoked with argv[] and envp[]. See exec(2).
21
23 If no file is located, isaexec() returns ENOENT. Other return values
24 are the same as for execve().
25
27 Example 1 Example of isaexec() function.
28
29
30 On a system whose isalist is
31
32
33 sparcv7 sparc
34
35
36
37 the program
38
39
40 int
41 main(int argc, char *argv[], char *envp[])
42 {
43 return (isaexec("/bin/thing", argv, envp));
44 }
45
46
47
48 will look first for an executable file named /bin/sparcv7/thing, then
49 for an executable file named /bin/sparc/thing. It will invoke execve()
50 on the first executable file it finds named thing.
51
52
53
54 On that same system, a program called /u/bin/tofu can cause either
55 /u/bin/sparcv7/tofu or /u/bin/sparc/tofu to be invoked using the fol‐
56 lowing code:
57
58
59 int
60 main(int argc, char *argv[], char *envp[])
61 {
62 return (isaexec(getexecname(), argv, envp));
63 }
64
65
67 See attributes(5) for descriptions of the following attributes:
68
69
70
71
72 ┌─────────────────────────────┬─────────────────────────────┐
73 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
74 ├─────────────────────────────┼─────────────────────────────┤
75 │MT-Level │Safe │
76 ├─────────────────────────────┼─────────────────────────────┤
77 │Interface Stability │Stable │
78 └─────────────────────────────┴─────────────────────────────┘
79
81 exec(2), getexecname(3C), attributes(5), isalist(5)
82
83
84
85SunOS 5.11 20 Mar 1998 isaexec(3C)