mirror of
https://github.com/opnsense/src.git
synced 2026-06-11 09:41:03 -04:00
linux(4): Convert flags in timerfd_create
The timerfd is introduced in FreeBSD 14, and the Linux ABI timerfd is also moved to FreeBSD native timerfd, but it can't work well as Linux TFD_CLOEXEC and TFD_NONBLOCK haven't been converted to FreeBSD TFD_CLOEXEC and TFD_NONBLOCK. Reviewed by: dchagin, jfree Differential revision: https://reviews.freebsd.org/D41708 MFC after: 1 week
This commit is contained in:
parent
11e37048db
commit
aadc14bceb
2 changed files with 10 additions and 2 deletions
|
|
@ -611,13 +611,18 @@ int
|
|||
linux_timerfd_create(struct thread *td, struct linux_timerfd_create_args *args)
|
||||
{
|
||||
clockid_t clockid;
|
||||
int error;
|
||||
int error, flags;
|
||||
|
||||
error = linux_to_native_clockid(&clockid, args->clockid);
|
||||
if (error != 0)
|
||||
return (error);
|
||||
flags = 0;
|
||||
if ((args->flags & LINUX_TFD_CLOEXEC) != 0)
|
||||
flags |= O_CLOEXEC;
|
||||
if ((args->flags & LINUX_TFD_NONBLOCK) != 0)
|
||||
flags |= TFD_NONBLOCK;
|
||||
|
||||
return (kern_timerfd_create(td, clockid, args->flags));
|
||||
return (kern_timerfd_create(td, clockid, flags));
|
||||
}
|
||||
|
||||
int
|
||||
|
|
|
|||
|
|
@ -54,4 +54,7 @@
|
|||
|
||||
#define LINUX_EFD_SEMAPHORE (1 << 0)
|
||||
|
||||
#define LINUX_TFD_CLOEXEC LINUX_O_CLOEXEC
|
||||
#define LINUX_TFD_NONBLOCK LINUX_O_NONBLOCK
|
||||
|
||||
#endif /* !_LINUX_EVENT_H_ */
|
||||
|
|
|
|||
Loading…
Reference in a new issue