Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!uunet!cbmvax!ag From: ag@cbmvax.UUCP (Keith Gabryelski) Newsgroups: comp.unix.wizards Subject: Passing 0 to accept(2) as second and third argument. Message-ID: <7936@cbmvax.UUCP> Date: 18 Sep 89 00:45:12 GMT Reply-To: ag@cbmvax.UUCP (Keith Gabryelski) Organization: Commodore Technology, West Chester, PA Lines: 31 I've seen two examples of the following code fragement: while (accept(s, 0, 0) < 0) { ... } found in talk and X Windows. Under our current socket implementation this above code fragment will return EFAULT which seems entirely reasonable to me since the second and third arguments to accept() are suppose to be pointers to user memory for return values. Since: struct sockaddr dummyaddr; int dummylen = sizeof struct sockaddr; accept(s, &dummyaddr, &dummylen); seems more reasonable to me than having the kernel check for these two sigularities (twoplearity?) I am wondering if this is actually considered a feature that should be supported and accepted or if this is just a hand me down that people have gotten use to. BTW, passing a null pointer as the second or third argument to accept() is not documented under any of the accept man pages I've read (Ultrix and SunOs). -- "It took no computation to dance to the rock 'n roll station" -- VU ag@cbmvax.commodore.com Keith M. Gabryelski ...!uunet!cbmvax!ag