Changeset View
Changeset View
Standalone View
Standalone View
sys/compat/cloudabi/cloudabi_fd.c
| Show All 23 Lines | |||||
| */ | */ | ||||
| #include <sys/cdefs.h> | #include <sys/cdefs.h> | ||||
| __FBSDID("$FreeBSD$"); | __FBSDID("$FreeBSD$"); | ||||
| #include <sys/param.h> | #include <sys/param.h> | ||||
| #include <sys/capsicum.h> | #include <sys/capsicum.h> | ||||
| #include <sys/filedesc.h> | #include <sys/filedesc.h> | ||||
| #include <sys/proc.h> | #include <sys/proc.h> | ||||
markj: This sorts before filedesc.h. | |||||
| #include <sys/mman.h> | #include <sys/mman.h> | ||||
| #include <sys/socketvar.h> | #include <sys/socketvar.h> | ||||
| #include <sys/syscallsubr.h> | #include <sys/syscallsubr.h> | ||||
| #include <sys/sysproto.h> | #include <sys/sysproto.h> | ||||
| #include <sys/systm.h> | #include <sys/systm.h> | ||||
| #include <sys/unistd.h> | #include <sys/unistd.h> | ||||
| #include <sys/vnode.h> | #include <sys/vnode.h> | ||||
| ▲ Show 20 Lines • Show All 49 Lines • ▼ Show 20 Lines | |||||
| { | { | ||||
| struct filecaps fcaps = {}; | struct filecaps fcaps = {}; | ||||
| switch (uap->type) { | switch (uap->type) { | ||||
| case CLOUDABI_FILETYPE_SHARED_MEMORY: | case CLOUDABI_FILETYPE_SHARED_MEMORY: | ||||
| cap_rights_init(&fcaps.fc_rights, CAP_FSTAT, CAP_FTRUNCATE, | cap_rights_init(&fcaps.fc_rights, CAP_FSTAT, CAP_FTRUNCATE, | ||||
| CAP_MMAP_RWX); | CAP_MMAP_RWX); | ||||
| return (kern_shm_open(td, SHM_ANON, O_RDWR | O_CLOEXEC, 0, | return (kern_shm_open(td, SHM_ANON, O_RDWR | O_CLOEXEC, 0, | ||||
| &fcaps)); | &fcaps, NULL)); | ||||
| default: | default: | ||||
| return (EINVAL); | return (EINVAL); | ||||
| } | } | ||||
| } | } | ||||
| int | int | ||||
| cloudabi_sys_fd_create2(struct thread *td, | cloudabi_sys_fd_create2(struct thread *td, | ||||
| struct cloudabi_sys_fd_create2_args *uap) | struct cloudabi_sys_fd_create2_args *uap) | ||||
| ▲ Show 20 Lines • Show All 368 Lines • Show Last 20 Lines | |||||
This sorts before filedesc.h.