From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fa528,116d2dc2c007de2d X-Google-Attributes: gidfa528,public X-Google-ArrivalTime: 2001-08-23 06:21:51 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!paloalto-snf1.gtei.net!news.gtei.net!news.compaq.com!news.cpqcorp.net!harris Subject: Re: a question about system program From: Bob Harris Newsgroups: comp.unix.tru64 Posted-And-Mailed: yes Message-ID: <230820010921513249%harris@zk3.dec.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-transfer-encoding: 8bit User-Agent: YA-NewsWatcher/5.0.1 Date: Thu, 23 Aug 2001 09:21:51 -0400 NNTP-Posting-Host: 16.140.32.194 X-Complaints-To: abuse@Compaq.com X-Trace: news.cpqcorp.net 998572911 16.140.32.194 (Thu, 23 Aug 2001 06:21:51 PDT) NNTP-Posting-Date: Thu, 23 Aug 2001 06:21:51 PDT Organization: Compaq Computer Corporation Xref: archiver1.google.com comp.unix.tru64:4334 [[ This message was both posted and mailed: see the "To," "Cc," and "Newsgroups" headers for details. ]] In article , jing wrote: X When I use the function of 'setpgid(void)',it completed X sucessfully,but after this,I use 'setpgrp(void)',it return -1 .why X does this happened,and does it effect my program or system? X Thanks in advance! But setpgid(pid,gid) takes 2 arguments! Most likely the first time you called setpgid(void), register 16 and 17 (the 1st and 2nd call arguments) contained values that did not upset setpgid(), although who knows what it actually did. The second time you called setpgid(void), registers 16 and 17 most likely contained values that setpgid() did not like. While you really should fix the code to call the function correctly, if you really Really REALLY want to know what it did not like, then fetch the errno value. if ( setpgid(void) == -1 ) perror("setpgid doesn't like void"); Bob Harris