Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84 SMI; site sun.uucp Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!genrad!decvax!decwrl!sun!guy From: guy@sun.uucp (Guy Harris) Newsgroups: net.bugs.4bsd Subject: Re: getpid() return value Message-ID: <2112@sun.uucp> Date: Thu, 11-Apr-85 01:42:15 EST Article-I.D.: sun.2112 Posted: Thu Apr 11 01:42:15 1985 Date-Received: Sat, 13-Apr-85 03:56:25 EST References: <139@lownlab.UUCP> Organization: Sun Microsystems, Inc. Lines: 17 > In the manual page for getpid() it states that a long is returned. > In the readable lint file it says that an int is returned. > > What does getpid() return under 4.2BSD? The smartass answer is that "int"s and "long"s are one and the same under 4.2BSD (for instance, Internet addresses, which are 32-bit quantities, are declared as "int" all throughout 4.2) so it doesn't make a difference. Process IDs are declared as "long" some places in the kernel and as "int" in others. Since 4.2, like most other V7-family systems, limits process IDs to the range 0 <= PID < 30000, PIDs will fit in a 16-bit "int". I'm not sure why they declared them as longs where they did. In all other UNIX systems, "getpid" returns an "int". I'd say the manual page is wedged. Guy Harris sun!guy