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