Changeset View
Changeset View
Standalone View
Standalone View
sys/kern/sys_generic.c
Show First 20 Lines • Show All 48 Lines • ▼ Show 20 Lines | |||||
#include <sys/filedesc.h> | #include <sys/filedesc.h> | ||||
#include <sys/filio.h> | #include <sys/filio.h> | ||||
#include <sys/fcntl.h> | #include <sys/fcntl.h> | ||||
#include <sys/file.h> | #include <sys/file.h> | ||||
#include <sys/lock.h> | #include <sys/lock.h> | ||||
#include <sys/proc.h> | #include <sys/proc.h> | ||||
#include <sys/signalvar.h> | #include <sys/signalvar.h> | ||||
#include <sys/socketvar.h> | #include <sys/socketvar.h> | ||||
#include <sys/timerfd.h> | |||||
#include <sys/uio.h> | #include <sys/uio.h> | ||||
#include <sys/eventfd.h> | #include <sys/eventfd.h> | ||||
#include <sys/kernel.h> | #include <sys/kernel.h> | ||||
kib: The existing order is not alphabetical, but do not add more disordering | |||||
#include <sys/ktr.h> | #include <sys/ktr.h> | ||||
#include <sys/limits.h> | #include <sys/limits.h> | ||||
#include <sys/malloc.h> | #include <sys/malloc.h> | ||||
#include <sys/poll.h> | #include <sys/poll.h> | ||||
#include <sys/resourcevar.h> | #include <sys/resourcevar.h> | ||||
#include <sys/selinfo.h> | #include <sys/selinfo.h> | ||||
#include <sys/sleepqueue.h> | #include <sys/sleepqueue.h> | ||||
#include <sys/specialfd.h> | #include <sys/specialfd.h> | ||||
▲ Show 20 Lines • Show All 876 Lines • ▼ Show 20 Lines | user_eventfd(struct thread *td, const void *arg) | ||||
error = copyin(arg, &efd, sizeof(efd)); | error = copyin(arg, &efd, sizeof(efd)); | ||||
if (error != 0) | if (error != 0) | ||||
return (error); | return (error); | ||||
return (eventfd_create_file(td, efd.initval, efd.flags)); | return (eventfd_create_file(td, efd.initval, efd.flags)); | ||||
} | } | ||||
int | int | ||||
user_timerfd(struct thread *td, const void *arg) | |||||
{ | |||||
struct specialfd_timerfd tfd; | |||||
int error; | |||||
error = copyin(arg, &tfd, sizeof(tfd)); | |||||
if (error != 0) | |||||
return (error); | |||||
return (timerfd_create_file(td, tfd.clockid, tfd.flags)); | |||||
} | |||||
int | |||||
sys___specialfd(struct thread *td, struct __specialfd_args *args) | sys___specialfd(struct thread *td, struct __specialfd_args *args) | ||||
{ | { | ||||
size_t arg_size; | size_t arg_size; | ||||
int (*specialfd_func)(struct thread *, const void *); | int (*specialfd_func)(struct thread *, const void *); | ||||
switch (args->type) { | switch (args->type) { | ||||
case SPECIALFD_EVENTFD: | case SPECIALFD_EVENTFD: | ||||
arg_size = sizeof(struct specialfd_eventfd); | arg_size = sizeof(struct specialfd_eventfd); | ||||
specialfd_func = user_eventfd; | specialfd_func = user_eventfd; | ||||
break; | |||||
case SPECIALFD_TIMERFD: | |||||
arg_size = sizeof(struct specialfd_timerfd); | |||||
specialfd_func = user_timerfd; | |||||
break; | break; | ||||
default: | default: | ||||
return (EINVAL); | return (EINVAL); | ||||
} | } | ||||
if (args->len != arg_size) | if (args->len != arg_size) | ||||
return (EINVAL); | return (EINVAL); | ||||
▲ Show 20 Lines • Show All 1,082 Lines • Show Last 20 Lines |
The existing order is not alphabetical, but do not add more disordering