-/* $OpenBSD: uipc_socket.c,v 1.297 2023/01/23 18:34:24 mvs Exp $ */
+/* $OpenBSD: uipc_socket.c,v 1.298 2023/01/27 18:46:34 mvs Exp $ */
/* $NetBSD: uipc_socket.c,v 1.21 1996/02/04 02:17:52 christos Exp $ */
/*
if (prp->pr_type != type)
return (EPROTOTYPE);
so = soalloc(M_WAIT);
- klist_init(&so->so_rcv.sb_sel.si_note, &socket_klistops, so);
- klist_init(&so->so_snd.sb_sel.si_note, &socket_klistops, so);
+ klist_init(&so->so_rcv.sb_klist, &socket_klistops, so);
+ klist_init(&so->so_snd.sb_klist, &socket_klistops, so);
sigio_init(&so->so_sigio);
TAILQ_INIT(&so->so_q0);
TAILQ_INIT(&so->so_q);
}
sigio_free(&so->so_sigio);
- klist_free(&so->so_rcv.sb_sel.si_note);
- klist_free(&so->so_snd.sb_sel.si_note);
+ klist_free(&so->so_rcv.sb_klist);
+ klist_free(&so->so_snd.sb_klist);
#ifdef SOCKET_SPLICE
if (so->so_sp) {
if (issplicedback(so)) {
sohasoutofband(struct socket *so)
{
pgsigio(&so->so_sigio, SIGURG, 0);
- KNOTE(&so->so_rcv.sb_sel.si_note, 0);
+ KNOTE(&so->so_rcv.sb_klist, 0);
}
int
return (EINVAL);
}
- klist_insert_locked(&sb->sb_sel.si_note, kn);
+ klist_insert_locked(&sb->sb_klist, kn);
sounlock(so);
return (0);
{
struct socket *so = kn->kn_fp->f_data;
- klist_remove(&so->so_rcv.sb_sel.si_note, kn);
+ klist_remove(&so->so_rcv.sb_klist, kn);
}
int
{
struct socket *so = kn->kn_fp->f_data;
- klist_remove(&so->so_snd.sb_sel.si_note, kn);
+ klist_remove(&so->so_snd.sb_klist, kn);
}
int
-/* $OpenBSD: uipc_socket2.c,v 1.133 2023/01/22 12:05:44 mvs Exp $ */
+/* $OpenBSD: uipc_socket2.c,v 1.134 2023/01/27 18:46:34 mvs Exp $ */
/* $NetBSD: uipc_socket2.c,v 1.11 1996/02/04 02:17:55 christos Exp $ */
/*
so->so_rcv.sb_lowat = head->so_rcv.sb_lowat;
so->so_rcv.sb_timeo_nsecs = head->so_rcv.sb_timeo_nsecs;
- klist_init(&so->so_rcv.sb_sel.si_note, &socket_klistops, so);
- klist_init(&so->so_snd.sb_sel.si_note, &socket_klistops, so);
+ klist_init(&so->so_rcv.sb_klist, &socket_klistops, so);
+ klist_init(&so->so_snd.sb_klist, &socket_klistops, so);
sigio_init(&so->so_sigio);
sigio_copy(&so->so_sigio, &head->so_sigio);
if (persocket)
sounlock(so);
sigio_free(&so->so_sigio);
- klist_free(&so->so_rcv.sb_sel.si_note);
- klist_free(&so->so_snd.sb_sel.si_note);
+ klist_free(&so->so_rcv.sb_klist);
+ klist_free(&so->so_snd.sb_klist);
pool_put(&socket_pool, so);
return (NULL);
}
}
if (sb->sb_flags & SB_ASYNC)
pgsigio(&so->so_sigio, SIGIO, 0);
- KNOTE(&sb->sb_sel.si_note, 0);
+ KNOTE(&sb->sb_klist, 0);
}
/*
-/* $OpenBSD: uipc_syscalls.c,v 1.209 2023/01/22 12:05:44 mvs Exp $ */
+/* $OpenBSD: uipc_syscalls.c,v 1.210 2023/01/27 18:46:34 mvs Exp $ */
/* $NetBSD: uipc_syscalls.c,v 1.19 1996/02/09 19:00:48 christos Exp $ */
/*
: (flags & SOCK_NONBLOCK ? FNONBLOCK : 0);
/* connection has been removed from the listen queue */
- KNOTE(&head->so_rcv.sb_sel.si_note, 0);
+ KNOTE(&head->so_rcv.sb_klist, 0);
if (persocket)
sounlock(head);
-/* $OpenBSD: fifo_vnops.c,v 1.100 2023/01/22 12:05:44 mvs Exp $ */
+/* $OpenBSD: fifo_vnops.c,v 1.101 2023/01/27 18:46:34 mvs Exp $ */
/* $NetBSD: fifo_vnops.c,v 1.18 1996/03/16 23:52:42 christos Exp $ */
/*
ap->a_kn->kn_hook = so;
- klist_insert(&sb->sb_sel.si_note, ap->a_kn);
+ klist_insert(&sb->sb_klist, ap->a_kn);
return (0);
}
{
struct socket *so = (struct socket *)kn->kn_hook;
- klist_remove(&so->so_rcv.sb_sel.si_note, kn);
+ klist_remove(&so->so_rcv.sb_klist, kn);
}
int
{
struct socket *so = (struct socket *)kn->kn_hook;
- klist_remove(&so->so_snd.sb_sel.si_note, kn);
+ klist_remove(&so->so_snd.sb_klist, kn);
}
int
-/* $OpenBSD: socketvar.h,v 1.118 2023/01/23 18:35:13 mvs Exp $ */
+/* $OpenBSD: socketvar.h,v 1.119 2023/01/27 18:46:34 mvs Exp $ */
/* $NetBSD: socketvar.h,v 1.18 1996/02/09 18:25:38 christos Exp $ */
/*-
#ifndef _SYS_SOCKETVAR_H_
#define _SYS_SOCKETVAR_H_
-#include <sys/selinfo.h> /* for struct selinfo */
+#include <sys/event.h>
#include <sys/queue.h>
#include <sys/sigio.h> /* for struct sigio_ref */
#include <sys/task.h>
#define sb_endzero sb_flags
short sb_state; /* socket state on sockbuf */
uint64_t sb_timeo_nsecs;/* timeout for read/write */
- struct selinfo sb_sel; /* process selecting read/write */
+ struct klist sb_klist; /* process selecting read/write */
} so_rcv, so_snd;
#define SB_MAX (2*1024*1024) /* default for max chars in sockbuf */
#define SB_LOCK 0x01 /* lock on data queue */
{
soassertlocked(so);
return ((sb->sb_flags & (SB_WAIT|SB_ASYNC|SB_SPLICE)) != 0 ||
- !klist_empty(&sb->sb_sel.si_note));
+ !klist_empty(&sb->sb_klist));
}
/*