From: deraadt Date: Fri, 9 Oct 2015 01:11:12 +0000 (+0000) Subject: sync X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=7b01118df1ac0ee6226ed7984ed906427e0b942f;p=openbsd sync --- diff --git a/sys/kern/init_sysent.c b/sys/kern/init_sysent.c index b02a1d671e3..a0c662cc65e 100644 --- a/sys/kern/init_sysent.c +++ b/sys/kern/init_sysent.c @@ -1,10 +1,10 @@ -/* $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 @@ -248,8 +248,8 @@ struct sysent sysent[] = { 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, diff --git a/sys/kern/kern_event.c b/sys/kern/kern_event.c index a6db9983069..6446d6230d9 100644 --- a/sys/kern/kern_event.c +++ b/sys/kern/kern_event.c @@ -1,4 +1,4 @@ -/* $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 @@ -323,22 +323,28 @@ filt_proc(struct knote *kn, long hint) 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); } @@ -349,22 +355,16 @@ int 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); } diff --git a/sys/kern/syscalls.c b/sys/kern/syscalls.c index 8574caef298..0d63c5dd6c8 100644 --- a/sys/kern/syscalls.c +++ b/sys/kern/syscalls.c @@ -1,10 +1,10 @@ -/* $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[] = { @@ -128,7 +128,7 @@ 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 */ diff --git a/sys/sys/syscall.h b/sys/sys/syscall.h index 8a4de8ec0aa..1d3ad6e281e 100644 --- a/sys/sys/syscall.h +++ b/sys/sys/syscall.h @@ -1,10 +1,10 @@ -/* $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" "..." */ @@ -331,8 +331,8 @@ /* 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 diff --git a/sys/sys/syscallargs.h b/sys/sys/syscallargs.h index c7d648a811c..8585fe05876 100644 --- a/sys/sys/syscallargs.h +++ b/sys/sys/syscallargs.h @@ -1,10 +1,10 @@ -/* $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 @@ -544,7 +544,7 @@ struct sys_chflagsat_args { syscallarg(int) atflags; }; -struct sys_tame_args { +struct sys_pledge_args { syscallarg(const char *) request; syscallarg(const char **) paths; }; @@ -1201,7 +1201,7 @@ int sys_bind(struct proc *, void *, register_t *); 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 *);