tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: eventfd(2) and timerfd(2) APIs



    Date:        Sat, 18 Sep 2021 15:54:06 -0700
    From:        Jason Thorpe <thorpej%me.com@localhost>
    Message-ID:  <63BF9E95-498A-4389-9A14-2F3C87A517F8%me.com@localhost>

  | I've changed the man pages to state "set for non-blocking I/O".

That should be much better.

  | Yes, they're file descriptors, so close(2) gets rid of them.
  | Does this really need to be stated explicitly?

I would, since open() doesn't make them, it's just a few extra words,
and an extra Xr in the SEE ALSO.

  |         st->st_birthtimespec = st->st_ctimespec = tfd->tfd_btime;

ctimespec should really be mtime, not btime (but you can do it after
the itimer_lock() region by just copying mtimespec).

Making it a pretend FIFO is reasonable.

  | Actually, fchmod(), fchown(), etc. only work on DTYPE_VNODE descriptors.

That probably should be fixed, POSIX certainly requires it to work on
shared memory segments (though it limits which bits are required to
exist there).

  | You'll get EBADF if you try it on anything else

and that's definitely wrong, on a pipe the system is allowed to return EINVAL,
and that's what ought to be returned whenever the fd is not something that
supports chmod (etc).   EBADF should only be used when the process doesn't
have the fd open.

But none of this part is related to your proposal, I'm not suggesting that
you need to go fix any of that.

kre



Home | Main Index | Thread Index | Old Index