2 Get the port name of stdin. */
10 #if HAVE_SYS_TYPES_TCP_H
11 #include <sys/types.tcp.h>
13 #include <sys/socket.h>
17 extern char *ttyname ();
20 /* Get the port name of standard input. I assume that Unix systems
21 generally support ttyname. If they don't, this function can just
22 return NULL. It uses getsockname to see whether standard input is
26 zsysdep_port_name (ftcp_port)
38 clen = sizeof (struct sockaddr);
39 if (getsockname (0, &s, &clen) == 0)
47 if (strncmp (z, "/dev/", sizeof "/dev/" - 1) == 0)
48 return z + sizeof "/dev/" - 1;