]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man3/getusershell.3
man*/: ffix (un-bracket tables)
[thirdparty/man-pages.git] / man3 / getusershell.3
1 '\" t
2 .\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk)
3 .\"
4 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
5 .\"
6 .\" References consulted:
7 .\" Linux libc source code
8 .\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
9 .\" 386BSD man pages
10 .\" Modified Sat Jul 24 19:17:53 1993 by Rik Faith (faith@cs.unc.edu)
11 .TH getusershell 3 (date) "Linux man-pages (unreleased)"
12 .SH NAME
13 getusershell, setusershell, endusershell \- get permitted user shells
14 .SH LIBRARY
15 Standard C library
16 .RI ( libc ", " \-lc )
17 .SH SYNOPSIS
18 .nf
19 .B #include <unistd.h>
20 .PP
21 .B char *getusershell(void);
22 .B void setusershell(void);
23 .B void endusershell(void);
24 .fi
25 .PP
26 .RS -4
27 Feature Test Macro Requirements for glibc (see
28 .BR feature_test_macros (7)):
29 .RE
30 .PP
31 .BR getusershell (),
32 .BR setusershell (),
33 .BR endusershell ():
34 .nf
35 Since glibc 2.21:
36 .\" commit 266865c0e7b79d4196e2cc393693463f03c90bd8
37 _DEFAULT_SOURCE
38 In glibc 2.19 and 2.20:
39 _DEFAULT_SOURCE || (_XOPEN_SOURCE && _XOPEN_SOURCE < 500)
40 Up to and including glibc 2.19:
41 _BSD_SOURCE || (_XOPEN_SOURCE && _XOPEN_SOURCE < 500)
42 .fi
43 .SH DESCRIPTION
44 The
45 .BR getusershell ()
46 function returns the next line from the file
47 .IR /etc/shells ,
48 opening the file if necessary.
49 The line should contain
50 the pathname of a valid user shell.
51 If
52 .I /etc/shells
53 does not exist or
54 is unreadable,
55 .BR getusershell ()
56 behaves as if
57 .I /bin/sh
58 and
59 .I /bin/csh
60 were listed in the file.
61 .PP
62 The
63 .BR setusershell ()
64 function rewinds
65 .IR /etc/shells .
66 .PP
67 The
68 .BR endusershell ()
69 function closes
70 .IR /etc/shells .
71 .SH RETURN VALUE
72 The
73 .BR getusershell ()
74 function returns NULL on end-of-file.
75 .SH FILES
76 .I /etc/shells
77 .SH ATTRIBUTES
78 For an explanation of the terms used in this section, see
79 .BR attributes (7).
80 .TS
81 allbox;
82 lbx lb lb
83 l l l.
84 Interface Attribute Value
85 T{
86 .na
87 .nh
88 .BR getusershell (),
89 .BR setusershell (),
90 .BR endusershell ()
91 T} Thread safety MT-Unsafe
92 .TE
93 .sp 1
94 .SH STANDARDS
95 None.
96 .SH HISTORY
97 4.3BSD.
98 .SH SEE ALSO
99 .BR shells (5)