* a question about system program
@ 2001-08-23 8:32 jing
2001-08-23 13:21 ` Bob Harris
0 siblings, 1 reply; 4+ messages in thread
From: jing @ 2001-08-23 8:32 UTC (permalink / raw)
When I use the function of 'setpgid(void)',it completed
sucessfully,but after this,I use 'setpgrp(void)',it return -1 .why
does this happened,and does it effect my program or system?
Thanks in advance!
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: a question about system program
2001-08-23 8:32 a question about system program jing
@ 2001-08-23 13:21 ` Bob Harris
2001-08-24 1:38 ` jing
0 siblings, 1 reply; 4+ messages in thread
From: Bob Harris @ 2001-08-23 13:21 UTC (permalink / raw)
[[ This message was both posted and mailed: see
the "To," "Cc," and "Newsgroups" headers for details. ]]
In article <a22a0b3c.0108230032.3685c937@posting.google.com>, jing
<jing116@263.net> 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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: a question about system program
2001-08-23 13:21 ` Bob Harris
@ 2001-08-24 1:38 ` jing
2001-08-24 13:26 ` Bob Harris
0 siblings, 1 reply; 4+ messages in thread
From: jing @ 2001-08-24 1:38 UTC (permalink / raw)
Thanks to Bob's quickly response!
Now my problem is I cann't set the function of setpgid or setpgrp's
parameter to be void,but from menual I see it can be void.My os is
Tru64UNIX 5.1,maybe this is the reason?
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: a question about system program
2001-08-24 1:38 ` jing
@ 2001-08-24 13:26 ` Bob Harris
0 siblings, 0 replies; 4+ messages in thread
From: Bob Harris @ 2001-08-24 13:26 UTC (permalink / raw)
[[ This message was both posted and mailed: see
the "To," "Cc," and "Newsgroups" headers for details. ]]
In article <a22a0b3c.0108231738.37f70c68@posting.google.com>, jing
<jing116@263.net> wrote:
X Thanks to Bob's quickly response!
X Now my problem is I cann't set the function of setpgid or setpgrp's
X parameter to be void,but from menual I see it can be void.My os is
X Tru64UNIX 5.1,maybe this is the reason?
I just looked at the man page for setpgid() and setpgrp() and it does
look confusing. It would appear that the number and type of arguments
is a function of which compiler options are specified.
You may want to read the "man 5 standards" man page and see which
compiler options are needed to use setpgrp(void) syntax. I do not
think setpgid(void) is ever valid, only setpgrp(void) if and only if
the right compiler switches are specified.
Of course the question is, why do you even care to use the
setpgrp(void) notation. It would seem that setpgid(0,0) should do the
same things as setpgrp(void).
But then again, I do not play in this space, so I am just going by what
I'm reading in the man pages. Since I have not first hand experience
using either of these functions, I'll defer to someone that knows more
about them.
Bob Harris
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2001-08-24 13:26 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-08-23 8:32 a question about system program jing
2001-08-23 13:21 ` Bob Harris
2001-08-24 1:38 ` jing
2001-08-24 13:26 ` Bob Harris
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox