Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site ptsfa.UUCP Path: utzoo!watmath!clyde!burl!ulysses!gamma!epsilon!zeta!sabre!bellcore!decvax!linus!philabs!cmcl2!seismo!umcp-cs!gymble!lll-crg!dual!ptsfa!rob From: rob@ptsfa.UUCP (Rob Bernardo) Newsgroups: net.unix-wizards Subject: Re: How can I log a user out? Message-ID: <703@ptsfa.UUCP> Date: Mon, 24-Jun-85 15:37:14 EDT Article-I.D.: ptsfa.703 Posted: Mon Jun 24 15:37:14 1985 Date-Received: Sat, 29-Jun-85 03:06:05 EDT References: <327@muddcs.UUCP> <440@bu-cs.UUCP> Reply-To: rob@ptsfa.UUCP (Rob Bernardo) Organization: Pacific Bell, San Francisco Lines: 28 Keywords: logout hangup In article <440@bu-cs.UUCP> root@bu-cs.UUCP (Barry Shein) writes: >>From: david@muddcs.UUCP (David Goebel) >>Subject: How can I log a user out? >>Date: Wed, 19-Jun-85 19:17:08 EDT >> >>Does anyone out there know of a quick way to log a user out from a C >>program without rummaging through memory for the pid of the login shell? > >I'm not sure exactly what you are after but this is a program I >often use that just toggles DTR on the terminal line. ... > if(ioctl(fd,TIOCCDTR,0) < 0) ... This must be a BSD-ism as TIOCCDTR is NOT a possible argument to ioctl(2) in SIII or SV. However, the good news is that you can drop DTR (and thereby cause the line to be hanged up) by setting the baud rate to "zero", either with the shell command stty 0 < /dev/ttyXX or by using ioctl(2) on the desired port. -- Rob Bernardo, San Ramon, California ihnp4!ptsfa!rob {nsc,ucbvax,decwrl,amd,fortune,zehntel}!dual!ptsfa!rob