mirror of
https://github.com/opnsense/src.git
synced 2026-06-04 14:26:03 -04:00
Add kqueue1() syscall
It takes the flags argument. Immediate use is to provide the KQUEUE_CLOEXEC flag for kqueue(2). Reviewed by: emaste, jhb Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D39271
This commit is contained in:
parent
ac6b2b4344
commit
61194e9852
3 changed files with 21 additions and 0 deletions
|
|
@ -1057,6 +1057,19 @@ sys_kqueue(struct thread *td, struct kqueue_args *uap)
|
|||
return (kern_kqueue(td, 0, NULL));
|
||||
}
|
||||
|
||||
int
|
||||
sys_kqueue1(struct thread *td, struct kqueue1_args *uap)
|
||||
{
|
||||
int flags;
|
||||
|
||||
if ((uap->flags & ~(KQUEUE_CLOEXEC)) != 0)
|
||||
return (EINVAL);
|
||||
flags = 0;
|
||||
if ((uap->flags & KQUEUE_CLOEXEC) != 0)
|
||||
flags |= O_CLOEXEC;
|
||||
return (kern_kqueue(td, flags, NULL));
|
||||
}
|
||||
|
||||
static void
|
||||
kqueue_init(struct kqueue *kq)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -3306,5 +3306,10 @@
|
|||
u_int flags,
|
||||
);
|
||||
}
|
||||
583 AUE_KQUEUE STD|CAPENABLED {
|
||||
int kqueue1(
|
||||
u_int flags
|
||||
);
|
||||
}
|
||||
|
||||
; vim: syntax=off
|
||||
|
|
|
|||
|
|
@ -218,6 +218,9 @@ struct freebsd11_kevent32 {
|
|||
#define NOTE_NSECONDS 0x00000008 /* data is nanoseconds */
|
||||
#define NOTE_ABSTIME 0x00000010 /* timeout is absolute */
|
||||
|
||||
/* Flags for kqueue1(2) */
|
||||
#define KQUEUE_CLOEXEC 0x00000001 /* close on exec */
|
||||
|
||||
struct knote;
|
||||
SLIST_HEAD(klist, knote);
|
||||
struct kqueue;
|
||||
|
|
|
|||
Loading…
Reference in a new issue