1getusershell(3)            Library Functions Manual            getusershell(3)
2
3
4

NAME

6       getusershell, setusershell, endusershell - get permitted user shells
7

LIBRARY

9       Standard C library (libc, -lc)
10

SYNOPSIS

12       #include <unistd.h>
13
14       char *getusershell(void);
15       void setusershell(void);
16       void endusershell(void);
17
18   Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
19
20       getusershell(), setusershell(), endusershell():
21           Since glibc 2.21:
22               _DEFAULT_SOURCE
23           In glibc 2.19 and 2.20:
24               _DEFAULT_SOURCE || (_XOPEN_SOURCE && _XOPEN_SOURCE < 500)
25           Up to and including glibc 2.19:
26               _BSD_SOURCE || (_XOPEN_SOURCE && _XOPEN_SOURCE < 500)
27

DESCRIPTION

29       The  getusershell()  function  returns  the  next  line  from  the file
30       /etc/shells, opening the file if necessary.  The  line  should  contain
31       the  pathname  of a valid user shell.  If /etc/shells does not exist or
32       is unreadable, getusershell() behaves as if /bin/sh and  /bin/csh  were
33       listed in the file.
34
35       The setusershell() function rewinds /etc/shells.
36
37       The endusershell() function closes /etc/shells.
38

RETURN VALUE

40       The getusershell() function returns NULL on end-of-file.
41

FILES

43       /etc/shells
44

ATTRIBUTES

46       For  an  explanation  of  the  terms  used  in  this  section,  see at‐
47       tributes(7).
48
49       ┌──────────────────────────────────────────┬───────────────┬───────────┐
50Interface                                 Attribute     Value     
51       ├──────────────────────────────────────────┼───────────────┼───────────┤
52getusershell(), setusershell(),           │ Thread safety │ MT-Unsafe │
53endusershell()                            │               │           │
54       └──────────────────────────────────────────┴───────────────┴───────────┘
55

STANDARDS

57       None.
58

HISTORY

60       4.3BSD.
61

SEE ALSO

63       shells(5)
64
65
66
67Linux man-pages 6.05              2023-07-20                   getusershell(3)
Impressum