public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* -1 pid on sys.wait4?
@ 2012-11-09 19:53 Nicholas Murphy
  2012-11-09 19:59 ` Josh Stone
  0 siblings, 1 reply; 3+ messages in thread
From: Nicholas Murphy @ 2012-11-09 19:53 UTC (permalink / raw)
  To: systemtap

Maybe a dumb question, but: why would $pid show up as -1 fairly consistently in a "probe kernel.function("sys_wait4").call" probe?

Thanks,
Nick

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: -1 pid on sys.wait4?
  2012-11-09 19:53 -1 pid on sys.wait4? Nicholas Murphy
@ 2012-11-09 19:59 ` Josh Stone
  2012-11-09 20:07   ` Nicholas Murphy
  0 siblings, 1 reply; 3+ messages in thread
From: Josh Stone @ 2012-11-09 19:59 UTC (permalink / raw)
  To: systemtap

On 11/09/2012 11:53 AM, Nicholas Murphy wrote:
> Maybe a dumb question, but: why would $pid show up as -1 fairly
> consistently in a "probe kernel.function("sys_wait4").call" probe?

Check out "man 2 wait", which says:

  The value of pid can be:

  < -1   meaning  wait for any child process whose process group ID is
         equal to the absolute value of pid.

  -1     meaning wait for any child process.

  0      meaning wait for any child process whose process group ID is
         equal to that of the calling process.

  > 0    meaning wait for the child whose process ID is equal to the
         value of pid.


So it just means that the sys_wait4 caller was not specific about which
child process they're waiting for.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: -1 pid on sys.wait4?
  2012-11-09 19:59 ` Josh Stone
@ 2012-11-09 20:07   ` Nicholas Murphy
  0 siblings, 0 replies; 3+ messages in thread
From: Nicholas Murphy @ 2012-11-09 20:07 UTC (permalink / raw)
  To: Josh Stone; +Cc: systemtap

So, yes, dumb question. :)  (sorry...confused myself between $pid and pid())

Thanks,
Nick

On Nov 9, 2012, at 2:59 PM, Josh Stone <jistone@redhat.com> wrote:

> On 11/09/2012 11:53 AM, Nicholas Murphy wrote:
>> Maybe a dumb question, but: why would $pid show up as -1 fairly
>> consistently in a "probe kernel.function("sys_wait4").call" probe?
> 
> Check out "man 2 wait", which says:
> 
>  The value of pid can be:
> 
>  < -1   meaning  wait for any child process whose process group ID is
>         equal to the absolute value of pid.
> 
>  -1     meaning wait for any child process.
> 
>  0      meaning wait for any child process whose process group ID is
>         equal to that of the calling process.
> 
>> 0    meaning wait for the child whose process ID is equal to the
>         value of pid.
> 
> 
> So it just means that the sys_wait4 caller was not specific about which
> child process they're waiting for.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-11-09 20:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-09 19:53 -1 pid on sys.wait4? Nicholas Murphy
2012-11-09 19:59 ` Josh Stone
2012-11-09 20:07   ` Nicholas Murphy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).