[comp.unix.questions] setlogin

sdb%hotmomma@uunet.uu.net (Scott Ballantyne) (06/18/91)

I have been looking at the login.c source from
bsd-sources/usr.bin/login on uunet, and it uses what is apparently a
new system call: setlogin (username). Can someone tell me what this is
supposed to do, or aim me at the man page?

Also, is it possible to use this login.c to replace the login program
on SunOS 4.1.1?

Thanks,
sdb

-- 
{sdb%hotmomma@uunet.uu.net | hotmomma!sdb@uunet.uu.net | uunet!hotmomma!sdb}
"A hacker is a machine for turning caffeine into programs"

torek@elf.ee.lbl.gov (Chris Torek) (06/19/91)

In article <1991Jun17.224939.1459@hotmomma.UUCP> sdb%hotmomma@uunet.uu.net
(Scott Ballantyne) writes:
>... setlogin (username). Can someone tell me what this is
>supposed to do, or aim me at the man page?

setlogin is a privileged system call that sets the string to be
returned by getlogin(), another new system call.  This solves the
problem of describing the login of someone who does not have a `tty
slot' and thus cannot have an /etc/utmp entry.
-- 
In-Real-Life: Chris Torek, Lawrence Berkeley Lab CSE/EE (+1 415 486 5427)
Berkeley, CA		Domain:	torek@ee.lbl.gov