]> git.saurik.com Git - apple/libc.git/blame - gen/getusershell.3
Libc-1439.100.3.tar.gz
[apple/libc.git] / gen / getusershell.3
CommitLineData
5b2abdfb
A
1.\" $NetBSD: getusershell.3,v 1.6 1999/03/22 19:44:42 garbled Exp $
2.\" $FreeBSD: src/lib/libc/gen/getusershell.3,v 1.10 2001/10/01 16:08:51 ru Exp $
3.\"
4.\" Copyright (c) 1985, 1991, 1993
e9ce8d39
A
5.\" The Regents of the University of California. All rights reserved.
6.\"
7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions
9.\" are met:
10.\" 1. Redistributions of source code must retain the above copyright
11.\" notice, this list of conditions and the following disclaimer.
12.\" 2. Redistributions in binary form must reproduce the above copyright
13.\" notice, this list of conditions and the following disclaimer in the
14.\" documentation and/or other materials provided with the distribution.
15.\" 3. All advertising materials mentioning features or use of this software
16.\" must display the following acknowledgement:
17.\" This product includes software developed by the University of
18.\" California, Berkeley and its contributors.
19.\" 4. Neither the name of the University nor the names of its contributors
20.\" may be used to endorse or promote products derived from this software
21.\" without specific prior written permission.
22.\"
23.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
24.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
27.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33.\" SUCH DAMAGE.
34.\"
5b2abdfb 35.\" @(#)getusershell.3 8.1 (Berkeley) 6/4/93
e9ce8d39 36.\"
5b2abdfb
A
37.Dd January 16, 1999
38.Dt GETUSERSHELL 3
e9ce8d39
A
39.Os
40.Sh NAME
5b2abdfb
A
41.Nm getusershell ,
42.Nm setusershell ,
43.Nm endusershell
44.Nd get valid user shells
e9ce8d39
A
45.Sh LIBRARY
46.Lb libc
47.Sh SYNOPSIS
5b2abdfb
A
48.In unistd.h
49.Ft char *
50.Fn getusershell void
51.Ft void
52.Fn setusershell void
53.Ft void
54.Fn endusershell void
e9ce8d39
A
55.Sh DESCRIPTION
56The
5b2abdfb
A
57.Fn getusershell
58function
59returns a pointer to a valid user shell as defined by the
60system manager in the shells database as described in
61.Xr shells 5 .
62If the shells database is not available,
63.Fn getusershell
64behaves as if
65.Pa /bin/sh
e9ce8d39 66and
5b2abdfb
A
67.Pa /bin/csh
68were listed.
69.Pp
e9ce8d39 70The
5b2abdfb
A
71.Fn getusershell
72function
73reads the next
74line (opening the file if necessary);
75.Fn setusershell
76rewinds the file;
77.Fn endusershell
78closes it.
79.Sh FILES
80.Bl -tag -width /etc/shells -compact
81.It Pa /etc/shells
82.El
83.Sh DIAGNOSTICS
84The routine
85.Fn getusershell
86returns a null pointer (0) on
87.Dv EOF .
e9ce8d39 88.Sh SEE ALSO
5b2abdfb 89.Xr shells 5
e9ce8d39
A
90.Sh HISTORY
91The
5b2abdfb
A
92.Fn getusershell
93function appeared in
94.Bx 4.3 .
95.Sh BUGS
96The
97.Fn getusershell
98function leaves its result in an internal static object and returns
99a pointer to that object.
100Subsequent calls to
101.Fn getusershell
102will modify the same object.