Changeset View
Changeset View
Standalone View
Standalone View
sys/compat/cloudabi/cloudabi_file.c
Show First 20 Lines • Show All 259 Lines • ▼ Show 20 Lines | cloudabi_sys_file_open(struct thread *td, | ||||
/* Open path. */ | /* Open path. */ | ||||
error = copyin_path(uap->path, uap->path_len, &path); | error = copyin_path(uap->path, uap->path_len, &path); | ||||
if (error != 0) { | if (error != 0) { | ||||
fdrop(fp, td); | fdrop(fp, td); | ||||
return (error); | return (error); | ||||
} | } | ||||
NDINIT_ATRIGHTS(&nd, LOOKUP, FOLLOW, UIO_SYSSPACE, path, uap->dirfd.fd, | NDINIT_ATRIGHTS(&nd, LOOKUP, FOLLOW, UIO_SYSSPACE, path, uap->dirfd.fd, | ||||
&rights, td); | &rights, td); | ||||
error = vn_open(&nd, &fflags, 0777 & ~td->td_proc->p_fd->fd_cmask, fp); | error = vn_open(&nd, &fflags, 0777 & ~td->td_proc->p_pd->pd_cmask, fp); | ||||
cloudabi_freestr(path); | cloudabi_freestr(path); | ||||
if (error != 0) { | if (error != 0) { | ||||
/* Custom operations provided. */ | /* Custom operations provided. */ | ||||
if (error == ENXIO && fp->f_ops != &badfileops) | if (error == ENXIO && fp->f_ops != &badfileops) | ||||
goto success; | goto success; | ||||
/* | /* | ||||
* POSIX compliance: return ELOOP in case openat() is | * POSIX compliance: return ELOOP in case openat() is | ||||
▲ Show 20 Lines • Show All 487 Lines • Show Last 20 Lines |