Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!att!cbnewsl!ams From: ams@cbnewsl.ATT.COM (andrew.m.shaw) Newsgroups: comp.lang.c Subject: Re: ttyname() - question Message-ID: <1702@cbnewsl.ATT.COM> Date: 31 Aug 89 14:16:41 GMT References: <2613@incas.UUCP> Organization: AT&T Bell Laboratories Lines: 9 From article <2613@incas.UUCP>, by tbecker@incas.UUCP (Thomas Becker): > The manpage of ttyname(3) says that the function takes a field descritor as > an argument. So I tried to call ttyname(NULL) within test(), and it worked! You were lucky that in your implementation the representation of NULL is the same as the representation of (int)0, giving you stdin. A field [sic] descriptor is properly an int, not a pointer. Andrew Shaw