Finding your remote host's name

Wietse Venema wswietse at lso.win.tue.nl
Fri Jun 8 22:06:49 AEST 1990


In article <1211 at tuewsd.win.tue.nl> I write:

>    if (getpeername(0, &sa, &length) >= 0) {

to obtain the name of the host one is logged in from. Obviously, this
does not work when stdin is connected to a pty.

Oops. Good thing this ain't comp.unix.wizards.



More information about the Comp.unix.questions mailing list