Xref: utzoo comp.sys.att:5446 comp.unix.wizards:14546 Path: utzoo!attcan!uunet!auspex!guy From: guy@auspex.UUCP (Guy Harris) Newsgroups: comp.sys.att,comp.unix.wizards Subject: Re: how to tell if a descriptor is a streams device ?? Keywords: streams, SVR3.2 Message-ID: <956@auspex.UUCP> Date: 5 Feb 89 21:28:30 GMT References: <290@hsi86.hsi.UUCP> Reply-To: guy@auspex.UUCP (Guy Harris) Organization: Auspex Systems, Santa Clara Lines: 18 >Is there a "best" way to tell if a given descriptor refers to >a streams device ?? I've found that none of the simple ioctl's >listed in streamio(7) return the "Not a streams device" (errno=60) >error, which is the error message I'd like to get. Well, you'll just have to get use to not getting it, because, in general, UNIX systems tend to return ENOTTY or EINVAL if you do an "ioctl" on a file descriptor that refers to an object that doesn't recognize the "ioctl" in question. Modifying *every* driver on the system to return ENOSTR for all streams "ioctl"s (which is what would have to have been done in order to get the result you want) would have been time-consuming; furthermore, there's no guarantee that *every* driver would have been caught. I'd suggest using I_LOOK or I_FIND, since they don't modify the stream, just look at it; if it returns an error, it's not a stream, otherwise, it is.