-/* $OpenBSD: init_sysent.c,v 1.174 2015/10/02 17:51:04 kettenis Exp $ */
+/* $OpenBSD: init_sysent.c,v 1.175 2015/10/09 01:11:12 deraadt Exp $ */
/*
* System call switch table.
*
* DO NOT EDIT-- this file is automatically generated.
- * created from; OpenBSD: syscalls.master,v 1.161 2015/10/02 17:49:40 kettenis Exp
+ * created from; OpenBSD: syscalls.master,v 1.162 2015/10/09 01:10:27 deraadt Exp
*/
#include <sys/param.h>
sys_listen }, /* 106 = listen */
{ 4, s(struct sys_chflagsat_args), 0,
sys_chflagsat }, /* 107 = chflagsat */
- { 2, s(struct sys_tame_args), 0,
- sys_tame }, /* 108 = tame */
+ { 2, s(struct sys_pledge_args), 0,
+ sys_pledge }, /* 108 = pledge */
{ 4, s(struct sys_ppoll_args), 0,
sys_ppoll }, /* 109 = ppoll */
{ 6, s(struct sys_pselect_args), 0,
-/* $OpenBSD: kern_event.c,v 1.61 2014/12/19 05:59:21 tedu Exp $ */
+/* $OpenBSD: kern_event.c,v 1.62 2015/10/09 01:11:12 deraadt Exp $ */
/*-
* Copyright (c) 1999,2000,2001 Jonathan Lemon <jlemon@FreeBSD.org>
return (kn->kn_fflags != 0);
}
+static void
+filt_timer_timeout_add(struct knote *kn)
+{
+ struct timeval tv;
+ int tticks;
+
+ tv.tv_sec = kn->kn_sdata / 1000;
+ tv.tv_usec = (kn->kn_sdata % 1000) * 1000;
+ tticks = tvtohz(&tv);
+ timeout_add(kn->kn_hook, tticks ? tticks : 1);
+}
+
void
filt_timerexpire(void *knx)
{
struct knote *kn = knx;
- struct timeval tv;
- int tticks;
kn->kn_data++;
KNOTE_ACTIVATE(kn);
- if ((kn->kn_flags & EV_ONESHOT) == 0) {
- tv.tv_sec = kn->kn_sdata / 1000;
- tv.tv_usec = (kn->kn_sdata % 1000) * 1000;
- tticks = tvtohz(&tv);
- timeout_add((struct timeout *)kn->kn_hook, tticks);
- }
+ if ((kn->kn_flags & EV_ONESHOT) == 0)
+ filt_timer_timeout_add(kn);
}
filt_timerattach(struct knote *kn)
{
struct timeout *to;
- struct timeval tv;
- int tticks;
if (kq_ntimeouts > kq_timeoutmax)
return (ENOMEM);
kq_ntimeouts++;
- tv.tv_sec = kn->kn_sdata / 1000;
- tv.tv_usec = (kn->kn_sdata % 1000) * 1000;
- tticks = tvtohz(&tv);
-
kn->kn_flags |= EV_CLEAR; /* automatically set */
to = malloc(sizeof(*to), M_KEVENT, M_WAITOK);
timeout_set(to, filt_timerexpire, kn);
- timeout_add(to, tticks);
kn->kn_hook = to;
+ filt_timer_timeout_add(kn);
return (0);
}
-/* $OpenBSD: syscalls.c,v 1.173 2015/10/02 17:51:04 kettenis Exp $ */
+/* $OpenBSD: syscalls.c,v 1.174 2015/10/09 01:11:12 deraadt Exp $ */
/*
* System call names.
*
* DO NOT EDIT-- this file is automatically generated.
- * created from; OpenBSD: syscalls.master,v 1.161 2015/10/02 17:49:40 kettenis Exp
+ * created from; OpenBSD: syscalls.master,v 1.162 2015/10/09 01:10:27 deraadt Exp
*/
char *syscallnames[] = {
"setsockopt", /* 105 = setsockopt */
"listen", /* 106 = listen */
"chflagsat", /* 107 = chflagsat */
- "tame", /* 108 = tame */
+ "pledge", /* 108 = pledge */
"ppoll", /* 109 = ppoll */
"pselect", /* 110 = pselect */
"sigsuspend", /* 111 = sigsuspend */
-/* $OpenBSD: syscall.h,v 1.172 2015/10/02 17:51:04 kettenis Exp $ */
+/* $OpenBSD: syscall.h,v 1.173 2015/10/09 01:11:12 deraadt Exp $ */
/*
* System call numbers.
*
* DO NOT EDIT-- this file is automatically generated.
- * created from; OpenBSD: syscalls.master,v 1.161 2015/10/02 17:49:40 kettenis Exp
+ * created from; OpenBSD: syscalls.master,v 1.162 2015/10/09 01:10:27 deraadt Exp
*/
/* syscall: "syscall" ret: "int" args: "int" "..." */
/* syscall: "chflagsat" ret: "int" args: "int" "const char *" "u_int" "int" */
#define SYS_chflagsat 107
-/* syscall: "tame" ret: "int" args: "const char *" "const char **" */
-#define SYS_tame 108
+/* syscall: "pledge" ret: "int" args: "const char *" "const char **" */
+#define SYS_pledge 108
/* syscall: "ppoll" ret: "int" args: "struct pollfd *" "u_int" "const struct timespec *" "const sigset_t *" */
#define SYS_ppoll 109
-/* $OpenBSD: syscallargs.h,v 1.175 2015/10/02 17:51:04 kettenis Exp $ */
+/* $OpenBSD: syscallargs.h,v 1.176 2015/10/09 01:11:12 deraadt Exp $ */
/*
* System call argument lists.
*
* DO NOT EDIT-- this file is automatically generated.
- * created from; OpenBSD: syscalls.master,v 1.161 2015/10/02 17:49:40 kettenis Exp
+ * created from; OpenBSD: syscalls.master,v 1.162 2015/10/09 01:10:27 deraadt Exp
*/
#ifdef syscallarg
syscallarg(int) atflags;
};
-struct sys_tame_args {
+struct sys_pledge_args {
syscallarg(const char *) request;
syscallarg(const char **) paths;
};
int sys_setsockopt(struct proc *, void *, register_t *);
int sys_listen(struct proc *, void *, register_t *);
int sys_chflagsat(struct proc *, void *, register_t *);
-int sys_tame(struct proc *, void *, register_t *);
+int sys_pledge(struct proc *, void *, register_t *);
int sys_ppoll(struct proc *, void *, register_t *);
int sys_pselect(struct proc *, void *, register_t *);
int sys_sigsuspend(struct proc *, void *, register_t *);