Changeset View
Changeset View
Standalone View
Standalone View
head/sys/compat/cloudabi/cloudabi_fd.c
Show All 22 Lines | |||||
* SUCH DAMAGE. | * SUCH DAMAGE. | ||||
*/ | */ | ||||
#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/fcntl.h> | |||||
#include <sys/filedesc.h> | #include <sys/filedesc.h> | ||||
#include <sys/proc.h> | #include <sys/proc.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> | ||||
▲ Show 20 Lines • Show All 51 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, F_SEAL_SEAL)); | ||||
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 |