Re: pidfd and O_NONBLOCK

2020-08-11 Thread Josh Triplett
you > > provide WNOHANG. > > > > I don't think anything depends on that behavior. Would it be possible to > > make O_NONBLOCK on a pidfd cause waitid on a running process to return > > EWOULDBLOCK? > > > > This would make it easier to use pidfd in some non-bl

Re: pidfd and O_NONBLOCK

2020-08-11 Thread Christian Brauner
behavior. Would it be possible to > make O_NONBLOCK on a pidfd cause waitid on a running process to return > EWOULDBLOCK? > > This would make it easier to use pidfd in some non-blocking event loops. Hey Josh, Just to see I did a _horrible_ draft (cf. [1]) and it seems doable to me and if you c

pidfd and O_NONBLOCK

2020-08-11 Thread Josh Triplett
As far as I can tell, O_NONBLOCK has no effect on a pidfd. When calling waitid on a pidfd for a running process, it always blocks unless you provide WNOHANG. I don't think anything depends on that behavior. Would it be possible to make O_NONBLOCK on a pidfd cause waitid on a running process