9330 stack overflow when creating a deeply nested dataset
[unleashed.git] / usr / src / man / man3c / getexecname.3c
blobbfa3561b737b346df44d30a64e1e7fdc0b00cdf4
1 '\" te
2 .\"  Copyright (c) 1997, 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 GETEXECNAME 3C "Dec 17, 1997"
7 .SH NAME
8 getexecname \- return pathname of executable
9 .SH SYNOPSIS
10 .LP
11 .nf
12 #include <stdlib.h>
14 \fBconst char *\fR\fBgetexecname\fR(\fBvoid\fR);
15 .fi
17 .SH DESCRIPTION
18 .sp
19 .LP
20 The \fBgetexecname()\fR function returns the pathname (the first argument of
21 one of the \fBexec\fR family of functions; see \fBexec\fR(2)) of the executable
22 that started the process.
23 .sp
24 .LP
25 Normally this is an absolute pathname, as the majority of commands are executed
26 by the shells that append the command name to the user's \fBPATH\fR components.
27 If this is not an absolute path, the output of \fBgetcwd\fR(3C) can be
28 prepended to it to create an absolute path, unless the process or one of its
29 ancestors has changed its root directory or current working directory since the
30 last successful call to one of the \fBexec\fR family of functions.
31 .SH RETURN VALUES
32 .sp
33 .LP
34 If successful, \fBgetexecname()\fR returns a pointer to the executables
35 pathname; otherwise, it returns \fB0\fR.
36 .SH USAGE
37 .sp
38 .LP
39 The \fBgetexecname()\fR function obtains the executable pathname from the
40 \fBAT_SUN_EXECNAME\fR aux vector.  These vectors are made available to
41 dynamically linked processes only.
42 .sp
43 .LP
44 A successful call to one of the \fBexec\fR family of functions will always have
45 \fBAT_SUN_EXECNAME\fR in the aux vector. The associated pathname is guaranteed
46 to be less than or equal to \fIPATH_MAX\fR, not counting the trailing null byte
47 that is always present.
48 .SH ATTRIBUTES
49 .sp
50 .LP
51 See \fBattributes\fR(5) for descriptions of the following attributes:
52 .sp
54 .sp
55 .TS
56 box;
57 c | c
58 l | l .
59 ATTRIBUTE TYPE  ATTRIBUTE VALUE
61 MT-Level        Safe
62 .TE
64 .SH SEE ALSO
65 .sp
66 .LP
67 \fBexec\fR(2), \fBgetcwd\fR(3C), \fBattributes\fR(5)