nightly: remove unused BINARCHIVE
[unleashed.git] / share / man / man3c / isaexec.3c
blob0bc091f3909f8a2fdbf174ef5bf6b82734274430
1 '\" te
2 .\"  Copyright 1989 AT&T  Copyright (c) 1998, Sun Microsystems, Inc.  All Rights Reserved
3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 .TH ISAEXEC 3C "Mar 20, 1998"
7 .SH NAME
8 isaexec \- invoke isa-specific executable
9 .SH SYNOPSIS
10 .LP
11 .nf
12 #include <unistd.h>
14 \fBint\fR \fBisaexec\fR(\fBconst char *\fR\fIpath\fR, \fBchar *const\fR \fIargv[]\fR, \fBchar *const\fR \fIenvp[]\fR);
15 .fi
17 .SH DESCRIPTION
18 .sp
19 .LP
20 The \fBisaexec()\fR function takes the path specified as \fIpath\fR and breaks
21 it into directory and file name components. It enquires from the running system
22 the list of supported instruction set architectures; see \fBisalist\fR(5). The
23 function traverses the list for an executable file in named subdirectories of
24 the original directory.  When such a file is located, \fBexecve()\fR is invoked
25 with \fIargv\fR\fB[\|]\fR and \fIenvp\fR\fB[\|]\fR. See \fBexec\fR(2).
26 .SH RETURN VALUES
27 .sp
28 .LP
29 If no file is located, \fBisaexec()\fR returns \fBENOENT\fR. Other return
30 values are the same as for \fBexecve()\fR.
31 .SH EXAMPLES
32 .LP
33 \fBExample 1 \fRExample of \fBisaexec()\fR function.
34 .sp
35 .LP
36 On a system whose \fBisalist\fR is
38 .sp
39 .in +2
40 .nf
41 sparcv7 sparc
42 .fi
43 .in -2
45 .sp
46 .LP
47 the program
49 .sp
50 .in +2
51 .nf
52 int
53 main(int argc, char *argv[], char *envp[])
55         return (isaexec("/bin/thing", argv, envp));
57 .fi
58 .in -2
60 .sp
61 .LP
62 will look first for an executable file named \fB/bin/sparcv7/thing\fR, then for
63 an executable file named \fB/bin/sparc/thing\fR. It will invoke \fBexecve()\fR
64 on the first executable file it finds named \fBthing\fR.
66 .sp
67 .LP
68 On that same system, a program called \fB/u/bin/tofu\fR can cause either
69 \fB/u/bin/sparcv7/tofu\fR or \fB/u/bin/sparc/tofu\fR to be invoked using the
70 following code:
72 .sp
73 .in +2
74 .nf
75 int
76 main(int argc, char *argv[], char *envp[])
78               return (isaexec(getexecname(), argv, envp));
80 .fi
81 .in -2
83 .SH ATTRIBUTES
84 .sp
85 .LP
86 See \fBattributes\fR(5) for descriptions of the following attributes:
87 .sp
89 .sp
90 .TS
91 box;
92 c | c
93 l | l .
94 ATTRIBUTE TYPE  ATTRIBUTE VALUE
96 MT-Level        Safe
98 Interface Stability     Stable
99 .TE
101 .SH SEE ALSO
104 \fBexec\fR(2), \fBgetexecname\fR(3C), \fBattributes\fR(5), \fBisalist\fR(5)