Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!uakari.primate.wisc.edu!indri!ames!haven!adm!xadmx!rbj@dsys.ncsl.nist.gov From: rbj@dsys.ncsl.nist.gov (Root Boy Jim) Newsgroups: comp.unix.wizards Subject: is it a socket or is it not? Message-ID: <20463@adm.BRL.MIL> Date: 31 Jul 89 22:58:40 GMT Sender: news@adm.BRL.MIL Lines: 13 ? What's a good method of determining whether a file descriptor ? is a socket or not? The fstat(2) call does not work well on sockets ? (and it even says so in the man page :-) Do a getsockopt on it. If you get back ENOTSOCK, it ain't. ? Curtis C. Generous ? DTIC Special Projects Office (DTIC-SPO) ? ARPA: generous@daitc.mil ? UUCP: {uunet,vrdxhq,lll-tis}!daitc!generous Root Boy Jim Have GNU, Will Travel.