Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 (Tek) 9/26/83; site dadla.UUCP Path: utzoo!watmath!clyde!akgua!sdcsvax!sdcrdcf!hplabs!tektronix!teklds!azure!dadla!rogers From: rogers@dadla.UUCP (Roger Southwick) Newsgroups: net.unix-wizards Subject: Re: Type of brk(2) return value Message-ID: <60@dadla.UUCP> Date: Mon, 21-May-84 00:21:50 EDT Article-I.D.: dadla.60 Posted: Mon May 21 00:21:50 1984 Date-Received: Mon, 21-May-84 04:51:29 EDT References: <488@sri-arpa.UUCP> Organization: Tektronix, Beaverton OR Lines: 29 I think you would find that brk() really returns an int and not a char * (I've looked at the code for 4.1 BSD, 2.8 BSD and Bell V7). This is because of the way the entries are defined in the sysent[] table (as pointers to functions which return int). Therefore all system calls return int. If you read the DIAGNOSTICS portion, it gives a 0 when the break was granted, and a -1 when not granted. This is consistant with all other system calls. I believe that this is an error in the documentation in the page for brk, sbrk, break. I think it should read: brk(addr) char *addr; sbrk(incr) char *incr; I think you'll find that this is the way it should be, although I really didn't dig into how brk() and sbrk() work all that much. I am real positive as to the return values though. -Roger Southwick ...!tektronix!dadla!rogers