You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I use waitid() instead of waitpid() or wait() since I want the WNOWAIT flag. According to man 2 waitid:
Upon successful return, waitid() fills in the following fields of the siginfo_t
structure pointed to by infop:
si_pid The process ID of the child.
However, looking at the declaration of sigino_t for Rust libc, it seems there is no si_pid field available. I know this is related to how sigino_t is defined #716.
Currently I'm linking out to C to get the correct field. It's ugly but it works.
I just ran into this myself. I need access to si_pid for use with libc::WNOHANG: when calling waitid with WNOHANG, you have to check if si_pid == 0 to tell if you have a process status or if waitid has returned immediately because there aren't any waitable processes.
Long-term, I'd love to have the fields defined, but short-term, I'd settle for a method that returns the appropriate field value.
Hello!
I'm trying call
waitid()
from libc like:I use
waitid()
instead ofwaitpid()
orwait()
since I want theWNOWAIT
flag. According toman 2 waitid
:However, looking at the declaration of
sigino_t
for Rust libc, it seems there is nosi_pid
field available. I know this is related to how sigino_t is defined #716.Currently I'm linking out to C to get the correct field. It's ugly but it works.
I would like to transmute/cast the struct in Rust, but I have no idea what the
si_pid
-containing version ofsiginfo_t
looks like.The text was updated successfully, but these errors were encountered: