xref: /titanic_50/usr/src/man/man3c/getwd.3c (revision aaec9ca27fa0bbff6dbb446cd02e5cdd463e85ef)
1*aaec9ca2SGarrett D'Amore.\" Copyright 2015 Garrett D'Amore <garrett@damore.org>
2c10c16deSRichard Lowe.\" Copyright (c) 1992, X/Open Company Limited All Rights Reserved  Portions Copyright (c) 2002, Sun Microsystems, Inc.  All Rights Reserved
3c10c16deSRichard Lowe.\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation. Original documentation from The Open Group can be obtained online at
4c10c16deSRichard Lowe.\" http://www.opengroup.org/bookstore/.
5c10c16deSRichard Lowe.\" The Institute of Electrical and Electronics Engineers and The Open Group, have given us permission to reprint portions of their documentation. In the following statement, the phrase "this text" refers to portions of the system documentation. Portions of this text are reprinted and reproduced in electronic form in the Sun OS Reference Manual, from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between these versions and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html.
6c10c16deSRichard Lowe.\"  This notice shall appear on any product containing this material.
7c10c16deSRichard Lowe.\" 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.
8c10c16deSRichard Lowe.\" 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.
9c10c16deSRichard Lowe.\" 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]
10*aaec9ca2SGarrett D'Amore.Dd Mar 30, 2015
11*aaec9ca2SGarrett D'Amore.Dt GETWD 3C
12*aaec9ca2SGarrett D'Amore.Os
13*aaec9ca2SGarrett D'Amore.Sh NAME
14*aaec9ca2SGarrett D'Amore.Nm getwd
15*aaec9ca2SGarrett D'Amore.Nd get current working directory pathname
16*aaec9ca2SGarrett D'Amore.Sh SYNOPSIS
17*aaec9ca2SGarrett D'Amore.In unistd.h
18*aaec9ca2SGarrett D'Amore.Ft "char *"
19*aaec9ca2SGarrett D'Amore.Fn getwd "char *path_name"
20*aaec9ca2SGarrett D'Amore.Sh DESCRIPTION
21*aaec9ca2SGarrett D'AmoreThe
22*aaec9ca2SGarrett D'Amore.Fn getwd
23*aaec9ca2SGarrett D'Amorefunction determines an absolute pathname of the current
24c10c16deSRichard Loweworking directory of the calling process, and copies that pathname into the
25*aaec9ca2SGarrett D'Amorearray pointed to by the
26*aaec9ca2SGarrett D'Amore.Fa path_name
27*aaec9ca2SGarrett D'Amoreargument.
28*aaec9ca2SGarrett D'Amore.Lp
29c10c16deSRichard LoweIf the length of the pathname of the current working directory is greater than
30*aaec9ca2SGarrett D'Amore.Pq Dv PATH_MAX + 1
31*aaec9ca2SGarrett D'Amoreincluding the null byte,
32*aaec9ca2SGarrett D'Amore.Fn getwd
33*aaec9ca2SGarrett D'Amorefails and returns a null pointer.
34*aaec9ca2SGarrett D'Amore.Sh RETURN VALUES
35c10c16deSRichard LoweUpon successful completion, a pointer to the string containing the absolute
36c10c16deSRichard Lowepathname of the current working directory is returned.  Otherwise,
37*aaec9ca2SGarrett D'Amore.Fn getwd
38*aaec9ca2SGarrett D'Amorereturns a null pointer and the contents of the array pointed to by
39*aaec9ca2SGarrett D'Amore.Fa path_name
40*aaec9ca2SGarrett D'Amoreare undefined.
41*aaec9ca2SGarrett D'Amore.Sh ERRORS
42c10c16deSRichard LoweNo errors are defined.
43*aaec9ca2SGarrett D'Amore.Sh USAGE
44*aaec9ca2SGarrett D'AmoreThe
45*aaec9ca2SGarrett D'Amore.Fn getwd
46*aaec9ca2SGarrett D'Amorefunction is supplied for backwards compatibility.  The
47*aaec9ca2SGarrett D'Amore.Xr getcwd 3C
48*aaec9ca2SGarrett D'Amoreshould be used instead.
49*aaec9ca2SGarrett D'Amore.Sh INTERFACE STABILITY
50*aaec9ca2SGarrett D'Amore.Sy Obsolete Standard .
51*aaec9ca2SGarrett D'Amore.Sh SEE ALSO
52*aaec9ca2SGarrett D'Amore.Xr getcwd 3C ,
53*aaec9ca2SGarrett D'Amore.Xr standards 5
54*aaec9ca2SGarrett D'Amore.Sh STANDARDS
55*aaec9ca2SGarrett D'AmoreThe
56*aaec9ca2SGarrett D'Amore.Fn getwd
57*aaec9ca2SGarrett D'Amorefunction is available in the following compilation environments. See
58*aaec9ca2SGarrett D'Amore.Xr standards 5 .
59*aaec9ca2SGarrett D'Amore.Lp
60*aaec9ca2SGarrett D'Amore.Bl -bullet -compact
61*aaec9ca2SGarrett D'Amore.It
62*aaec9ca2SGarrett D'Amore.St -xpg4.2
63*aaec9ca2SGarrett D'Amore.It
64*aaec9ca2SGarrett D'Amore.St -susv2
65*aaec9ca2SGarrett D'Amore.It
66*aaec9ca2SGarrett D'Amore.St -susv3
67*aaec9ca2SGarrett D'Amore.El
68*aaec9ca2SGarrett D'Amore.Lp
69*aaec9ca2SGarrett D'AmoreIt was marked obsolete in
70*aaec9ca2SGarrett D'Amore.St -susv3
71*aaec9ca2SGarrett D'Amoreand removed from
72*aaec9ca2SGarrett D'Amore.St -p1003.1-2008 .
73