.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) .\" May be distributed under the GNU General Public License .\" References consulted: .\" Linux libc source code .\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) .\" 386BSD man pages .\" Modified Sat Jul 24 19:17:53 1993 by Rik Faith (faith@cs.unc.edu) .TH GETUSERSHELL 3 "July 4, 1993" "BSD" "Linux Programmer's Manual" .SH NAME getusershell, setusershell, endusershell \- get legal user shells .SH SYNOPSIS .nf .B #include .sp .B char *getusershell(void); .sp .B void setusershell(void); .sp .B void endusershell(void); .fi .SH DESCRIPTION The \fBgetusershell()\fP function returns the next line from the file \fI/etc/shells\fP, opening the file if necessary. The line should contain the pathname of a valid user shell. If \fI/etc/shells\fP does not exist or is unreadable, \fBgetusershell()\fP behaves as if \fI/bin/sh\fP and \fI/bin/csh\fP were listed in the file. .PP The \fBsetusershell()\fP function rewinds \fI/etc/shells\fP. .PP The \fBendusershell()\fP function closes \fI/etc/shells\fP. .SH "RETURN VALUE" The \fBgetusershell()\fP function returns a NULL pointer on end-of-file. .SH FILES .nf /etc/shells .fi .SH "CONFORMING TO" BSD 4.3 .SH SEE ALSO .BR shells (5)