Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!henry From: henry@utzoo.UUCP (Henry Spencer) Newsgroups: net.lang.c Subject: Re: how has C bitten you? Message-ID: <5932@utzoo.UUCP> Date: Fri, 6-Sep-85 12:32:41 EDT Article-I.D.: utzoo.5932 Posted: Fri Sep 6 12:32:41 1985 Date-Received: Fri, 6-Sep-85 12:32:41 EDT References: <228@investor.UUCP> <132@mcgill-vision.UUCP> <2702@sun.uucp>, <797@kuling.UUCP> Organization: U of Toronto Zoology Lines: 17 > Is it also possible to give a NULL-pointer to a procedure as a parameter, > if for example the procedure would return several values, and we are not > interested in all of them? > > wait(0) works at least here (4.2BSD), but something like this does not: > ... > (void)read(fd, 0, n); Passing NULL only works if the function is prepared for the possibility and explicitly checks for it. wait() does; read() does not. See the documentation. By the way, that should be "wait( (int *)0 )", to make sure the type is right; the Unix documentation is often sloppy about this particular detail, since it originated on machines where the sloppiness didn't cause any problems. -- Henry Spencer @ U of Toronto Zoology {allegra,ihnp4,linus,decvax}!utzoo!henry