1
0
mirror of https://github.com/openbsd/src.git synced 2025-01-04 15:25:38 -08:00

Add syscall stub for kqueue1(2)

This rides previous libc minor bump.

Feedback and OK guenther@
This commit is contained in:
visa 2023-08-20 15:17:53 +00:00
parent 0ba2df44c1
commit 29a332bce6
6 changed files with 45 additions and 10 deletions

View File

@ -121,6 +121,7 @@ _thread_sys_issetugid
_thread_sys_kevent
_thread_sys_kill
_thread_sys_kqueue
_thread_sys_kqueue1
_thread_sys_ktrace
_thread_sys_lchown
_thread_sys_link
@ -322,6 +323,7 @@ issetugid
kevent
kill
kqueue
kqueue1
ktrace
lchown
link

View File

@ -1,4 +1,4 @@
/* $OpenBSD: event.h,v 1.1 2023/05/18 16:11:09 guenther Exp $ */
/* $OpenBSD: event.h,v 1.2 2023/08/20 15:17:53 visa Exp $ */
/*
* Copyright (c) 2023 Philip Guenther <guenther@openbsd.org>
*
@ -22,5 +22,6 @@
PROTO_NORMAL(kevent);
PROTO_NORMAL(kqueue);
PROTO_NORMAL(kqueue1);
#endif /* !_LIBC_SYS_EVENT_H_ */

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile.inc,v 1.173 2023/02/27 14:59:33 deraadt Exp $
# $OpenBSD: Makefile.inc,v 1.174 2023/08/20 15:17:53 visa Exp $
# $NetBSD: Makefile.inc,v 1.35 1995/10/16 23:49:07 jtc Exp $
# @(#)Makefile.inc 8.1 (Berkeley) 6/17/93
@ -73,7 +73,7 @@ ASM= __semctl.o __thrsigdivert.o \
getpriority.o getresgid.o getresuid.o \
getrlimit.o getrusage.o getsid.o getsockname.o \
getsockopt.o ioctl.o \
kevent.o kill.o kqueue.o ktrace.o lchown.o \
kevent.o kill.o kqueue.o kqueue1.o ktrace.o lchown.o \
link.o linkat.o listen.o lseek.o lstat.o \
madvise.o mimmutable.o minherit.o mkdir.o mkdirat.o mkfifo.o mkfifoat.o \
mknod.o mknodat.o mlock.o mlockall.o mmap.o mount.o mprotect.o \

View File

@ -1,4 +1,4 @@
.\" $OpenBSD: kqueue.2,v 1.49 2023/08/13 10:23:26 jmc Exp $
.\" $OpenBSD: kqueue.2,v 1.50 2023/08/20 15:17:53 visa Exp $
.\"
.\" Copyright (c) 2000 Jonathan Lemon
.\" All rights reserved.
@ -26,11 +26,12 @@
.\"
.\" $FreeBSD: src/lib/libc/sys/kqueue.2,v 1.18 2001/02/14 08:48:35 guido Exp $
.\"
.Dd $Mdocdate: August 13 2023 $
.Dd $Mdocdate: August 20 2023 $
.Dt KQUEUE 2
.Os
.Sh NAME
.Nm kqueue ,
.Nm kqueue1 ,
.Nm kevent ,
.Nm EV_SET
.Nd kernel event notification mechanism
@ -43,6 +44,12 @@
.Ft int
.Fn kevent "int kq" "const struct kevent *changelist" "int nchanges" "struct kevent *eventlist" "int nevents" "const struct timespec *timeout"
.Fn EV_SET "&kev" ident filter flags fflags data udata
.In sys/types.h
.In sys/event.h
.In sys/time.h
.In fcntl.h
.Ft int
.Fn kqueue1 "int flags"
.Sh DESCRIPTION
.Fn kqueue
provides a generic method of notifying the user when an event
@ -78,6 +85,17 @@ The queue is not inherited by a child created with
.Xr fork 2 .
Similarly, kqueues cannot be passed across UNIX-domain sockets.
.Pp
The
.Fn kqueue1
function is identical to
.Fn kqueue
except that the close-on-exec flag on the new file descriptor
is determined by the
.Dv O_CLOEXEC flag
in the
.Fa flags
argument.
.Pp
.Fn kevent
is used to register events with the queue, and return any pending
events to the user.
@ -545,7 +563,9 @@ contains the events which triggered the filter.
.El
.Sh RETURN VALUES
.Fn kqueue
creates a new kernel event queue and returns a file descriptor.
and
.Fn kqueue1
create a new kernel event queue and returns a file descriptor.
If there was an error creating the kernel event queue, a value of -1 is
returned and
.Va errno
@ -577,7 +597,9 @@ returns 0.
.Sh ERRORS
The
.Fn kqueue
function fails if:
and
.Fn kqueue1
functions fail if:
.Bl -tag -width Er
.It Bq Er ENOMEM
The kernel failed to allocate enough memory for the kernel queue.
@ -587,6 +609,15 @@ The per-process descriptor table is full.
The system file table is full.
.El
.Pp
In addition,
.Fn kqueue1
fails if:
.Bl -tag -width Er
.It Bq Er EINVAL
.Fa flags
is invalid.
.El
.Pp
The
.Fn kevent
function fails if:

View File

@ -1,4 +1,4 @@
.\" $OpenBSD: pledge.2,v 1.66 2023/06/02 17:44:29 cheloha Exp $
.\" $OpenBSD: pledge.2,v 1.67 2023/08/20 15:17:53 visa Exp $
.\"
.\" Copyright (c) 2015 Nicholas Marriott <nicm@openbsd.org>
.\"
@ -14,7 +14,7 @@
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
.Dd $Mdocdate: June 2 2023 $
.Dd $Mdocdate: August 20 2023 $
.Dt PLEDGE 2
.Os
.Sh NAME
@ -198,6 +198,7 @@ As a result, all the expected functionalities of libc stdio work.
.Xr issetugid 2 ,
.Xr kevent 2 ,
.Xr kqueue 2 ,
.Xr kqueue1 2 ,
.Xr lseek 2 ,
.Xr madvise 2 ,
.Xr minherit 2 ,

View File

@ -1,2 +1,2 @@
major=27
minor=0
minor=1