1GETUSERSHELL(3) Linux Programmer's Manual GETUSERSHELL(3)
2
3
4
6 getusershell, setusershell, endusershell - get permitted user shells
7
9 #include <unistd.h>
10
11 char *getusershell(void);
12 void setusershell(void);
13 void endusershell(void);
14
15 Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
16
17 getusershell(), setusershell(), endusershell():
18 Since glibc 2.21:
19 _DEFAULT_SOURCE
20 In glibc 2.19 and 2.20:
21 _DEFAULT_SOURCE || (_XOPEN_SOURCE && _XOPEN_SOURCE < 500)
22 Up to and including glibc 2.19:
23 _BSD_SOURCE || (_XOPEN_SOURCE && _XOPEN_SOURCE < 500)
24
26 The getusershell() function returns the next line from the file
27 /etc/shells, opening the file if necessary. The line should contain
28 the pathname of a valid user shell. If /etc/shells does not exist or
29 is unreadable, getusershell() behaves as if /bin/sh and /bin/csh were
30 listed in the file.
31
32 The setusershell() function rewinds /etc/shells.
33
34 The endusershell() function closes /etc/shells.
35
37 The getusershell() function returns NULL on end-of-file.
38
40 /etc/shells
41
43 For an explanation of the terms used in this section, see at‐
44 tributes(7).
45
46 ┌──────────────────────────────────────────┬───────────────┬───────────┐
47 │Interface │ Attribute │ Value │
48 ├──────────────────────────────────────────┼───────────────┼───────────┤
49 │getusershell(), setusershell(), │ Thread safety │ MT-Unsafe │
50 │endusershell() │ │ │
51 └──────────────────────────────────────────┴───────────────┴───────────┘
52
54 4.3BSD.
55
57 shells(5)
58
60 This page is part of release 5.12 of the Linux man-pages project. A
61 description of the project, information about reporting bugs, and the
62 latest version of this page, can be found at
63 https://www.kernel.org/doc/man-pages/.
64
65
66
67GNU 2021-03-22 GETUSERSHELL(3)