1*48352Scael.\" Copyright (c) 1985, 1991 The Regents of the University of California. 236275Sbostic.\" All rights reserved. 325431Smckusick.\" 443571Strent.\" %sccs.include.redist.man% 525431Smckusick.\" 6*48352Scael.\" @(#)getusershell.3 6.5 (Berkeley) 04/19/91 736275Sbostic.\" 8*48352Scael.Dd 9*48352Scael.Dt GETUSERSHELL 3 10*48352Scael.Os BSD 4.3 11*48352Scael.Sh NAME 12*48352Scael.Nm getusershell , 13*48352Scael.Nm setusershell , 14*48352Scael.Nm endusershell 15*48352Scael.Nd get legal user shells 16*48352Scael.Sh SYNOPSIS 17*48352Scael.Ft char * 18*48352Scael.Fn getusershell void 19*48352Scael.Ft void 20*48352Scael.Fn setusershell void 21*48352Scael.Ft void 22*48352Scael.Fn endusershell void 23*48352Scael.Sh DESCRIPTION 24*48352ScaelThe 25*48352Scael.Fn getusershell 26*48352Scaelfunction 2725431Smckusickreturns a pointer to a legal user shell as defined by the 2825431Smckusicksystem manager in the file 29*48352Scael.Pa /etc/shells . 3025431SmckusickIf 31*48352Scael.Pa /etc/shells 3230235Sbosticis unreadable or does not exist, 33*48352Scael.Fn getusershell 3430235Sbosticbehaves as if 35*48352Scael.Pa /bin/sh 3625431Smckusickand 37*48352Scael.Pa /bin/csh 3830235Sbosticwere listed in the file. 39*48352Scael.Pp 40*48352ScaelThe 41*48352Scael.Fn getusershell 42*48352Scaelfunction 4325431Smckusickreads the next 4425431Smckusickline (opening the file if necessary); 45*48352Scael.Fn setusershell 4625431Smckusickrewinds the file; 47*48352Scael.Fn endusershell 4825431Smckusickcloses it. 49*48352Scael.Sh FILES 50*48352Scael.Bl -tag -width /etc/shells -compact 51*48352Scael.It Pa /etc/shells 52*48352Scael.El 53*48352Scael.Sh DIAGNOSTICS 5425431SmckusickThe routine 55*48352Scael.Fn getusershell 56*48352Scaelreturns a null pointer (0) on 57*48352Scael.Dv EOF . 58*48352Scael.Sh SEE ALSO 59*48352Scael.Xr shells 5 60*48352Scael.Sh HISTORY 61*48352ScaelThe 62*48352Scael.Fn getusershell 63*48352Scaelfunction appeared in 64*48352Scael.Bx 4.3 . 65*48352Scael.Sh BUGS 66*48352ScaelThe 67*48352Scael.Fn getusershell 68*48352Scaelfunction leaves its result in an internal static object and returns 69*48352Scaela pointer to that object. Subsequent calls to 70*48352Scael.Fn getusershell 71*48352Scaelwill modify the same object. 72