Lines Matching refs:error
76 int error; in copyin_path() local
81 error = copyin(uaddr, buf, len); in copyin_path()
82 if (error != 0) { in copyin_path()
84 return (error); in copyin_path()
147 int error; in cloudabi_sys_file_create() local
149 error = copyin_path(uap->path, uap->path_len, &path); in cloudabi_sys_file_create()
150 if (error != 0) in cloudabi_sys_file_create()
151 return (error); in cloudabi_sys_file_create()
160 error = kern_mkdirat(td, uap->fd, path, UIO_SYSSPACE, 0777); in cloudabi_sys_file_create()
163 error = EINVAL; in cloudabi_sys_file_create()
167 return (error); in cloudabi_sys_file_create()
175 int error; in cloudabi_sys_file_link() local
177 error = copyin_path(uap->path1, uap->path1_len, &path1); in cloudabi_sys_file_link()
178 if (error != 0) in cloudabi_sys_file_link()
179 return (error); in cloudabi_sys_file_link()
180 error = copyin_path(uap->path2, uap->path2_len, &path2); in cloudabi_sys_file_link()
181 if (error != 0) { in cloudabi_sys_file_link()
183 return (error); in cloudabi_sys_file_link()
186 error = kern_linkat(td, uap->fd1.fd, uap->fd2, path1, path2, in cloudabi_sys_file_link()
191 return (error); in cloudabi_sys_file_link()
205 int error, fd, fflags; in cloudabi_sys_file_open() local
208 error = copyin(uap->fds, &fds, sizeof(fds)); in cloudabi_sys_file_open()
209 if (error != 0) in cloudabi_sys_file_open()
210 return (error); in cloudabi_sys_file_open()
213 error = cloudabi_convert_rights( in cloudabi_sys_file_open()
215 if (error != 0) in cloudabi_sys_file_open()
216 return (error); in cloudabi_sys_file_open()
255 error = falloc_noinstall(td, &fp); in cloudabi_sys_file_open()
256 if (error != 0) in cloudabi_sys_file_open()
257 return (error); in cloudabi_sys_file_open()
261 error = copyin_path(uap->path, uap->path_len, &path); in cloudabi_sys_file_open()
262 if (error != 0) { in cloudabi_sys_file_open()
264 return (error); in cloudabi_sys_file_open()
268 error = vn_open(&nd, &fflags, 0777 & ~td->td_proc->p_fd->fd_cmask, fp); in cloudabi_sys_file_open()
270 if (error != 0) { in cloudabi_sys_file_open()
272 if (error == ENXIO && fp->f_ops != &badfileops) in cloudabi_sys_file_open()
279 if (error == EMLINK) in cloudabi_sys_file_open()
280 error = ELOOP; in cloudabi_sys_file_open()
282 return (error); in cloudabi_sys_file_open()
298 error = fo_truncate(fp, 0, td->td_ucred, td); in cloudabi_sys_file_open()
299 if (error != 0) { in cloudabi_sys_file_open()
301 return (error); in cloudabi_sys_file_open()
314 error = finstall(td, fp, &fd, fflags, &fcaps); in cloudabi_sys_file_open()
316 if (error != 0) in cloudabi_sys_file_open()
317 return (error); in cloudabi_sys_file_open()
332 int error; in write_dirent() local
365 error = uiomove(&cde, len, uio); in write_dirent()
366 if (error != 0) in write_dirent()
367 return (error); in write_dirent()
394 int error; in cloudabi_sys_file_readdir() local
397 error = getvnode(td, uap->fd, &cap_read_rights, &fp); in cloudabi_sys_file_readdir()
398 if (error != 0) { in cloudabi_sys_file_readdir()
399 if (error == EINVAL) in cloudabi_sys_file_readdir()
401 return (error); in cloudabi_sys_file_readdir()
438 error = ENOTDIR; in cloudabi_sys_file_readdir()
442 error = mac_vnode_check_readdir(td->td_ucred, vp); in cloudabi_sys_file_readdir()
443 if (error != 0) { in cloudabi_sys_file_readdir()
452 error = VOP_READDIR(vp, &readuio, fp->f_cred, &eof, in cloudabi_sys_file_readdir()
455 if (error != 0) in cloudabi_sys_file_readdir()
467 error = write_dirent(bde, *cookie, &uio); in cloudabi_sys_file_readdir()
468 if (error != 0) { in cloudabi_sys_file_readdir()
489 if (error != 0) in cloudabi_sys_file_readdir()
490 return (error); in cloudabi_sys_file_readdir()
502 int error; in cloudabi_sys_file_readlink() local
504 error = copyin_path(uap->path, uap->path_len, &path); in cloudabi_sys_file_readlink()
505 if (error != 0) in cloudabi_sys_file_readlink()
506 return (error); in cloudabi_sys_file_readlink()
508 error = kern_readlinkat(td, uap->fd, path, UIO_SYSSPACE, in cloudabi_sys_file_readlink()
511 return (error); in cloudabi_sys_file_readlink()
519 int error; in cloudabi_sys_file_rename() local
521 error = copyin_path(uap->path1, uap->path1_len, &old); in cloudabi_sys_file_rename()
522 if (error != 0) in cloudabi_sys_file_rename()
523 return (error); in cloudabi_sys_file_rename()
524 error = copyin_path(uap->path2, uap->path2_len, &new); in cloudabi_sys_file_rename()
525 if (error != 0) { in cloudabi_sys_file_rename()
527 return (error); in cloudabi_sys_file_rename()
530 error = kern_renameat(td, uap->fd1, old, uap->fd2, new, in cloudabi_sys_file_rename()
534 return (error); in cloudabi_sys_file_rename()
562 int error; in cloudabi_sys_file_stat_fget() local
567 error = fget(td, uap->fd, &cap_fstat_rights, &fp); in cloudabi_sys_file_stat_fget()
568 if (error != 0) in cloudabi_sys_file_stat_fget()
569 return (error); in cloudabi_sys_file_stat_fget()
570 error = fo_stat(fp, &sb, td->td_ucred, td); in cloudabi_sys_file_stat_fget()
571 if (error != 0) { in cloudabi_sys_file_stat_fget()
573 return (error); in cloudabi_sys_file_stat_fget()
615 int error; in cloudabi_sys_file_stat_fput() local
617 error = copyin(uap->buf, &fs, sizeof(fs)); in cloudabi_sys_file_stat_fput()
618 if (error != 0) in cloudabi_sys_file_stat_fput()
619 return (error); in cloudabi_sys_file_stat_fput()
651 int error; in cloudabi_sys_file_stat_get() local
655 error = copyin_path(uap->path, uap->path_len, &path); in cloudabi_sys_file_stat_get()
656 if (error != 0) in cloudabi_sys_file_stat_get()
657 return (error); in cloudabi_sys_file_stat_get()
659 error = kern_statat(td, in cloudabi_sys_file_stat_get()
663 if (error != 0) in cloudabi_sys_file_stat_get()
664 return (error); in cloudabi_sys_file_stat_get()
695 int error; in cloudabi_sys_file_stat_put() local
706 error = copyin(uap->buf, &fs, sizeof(fs)); in cloudabi_sys_file_stat_put()
707 if (error != 0) in cloudabi_sys_file_stat_put()
708 return (error); in cloudabi_sys_file_stat_put()
709 error = copyin_path(uap->path, uap->path_len, &path); in cloudabi_sys_file_stat_put()
710 if (error != 0) in cloudabi_sys_file_stat_put()
711 return (error); in cloudabi_sys_file_stat_put()
714 error = kern_utimensat(td, uap->fd.fd, path, UIO_SYSSPACE, ts, in cloudabi_sys_file_stat_put()
718 return (error); in cloudabi_sys_file_stat_put()
726 int error; in cloudabi_sys_file_symlink() local
728 error = copyin_path(uap->path1, uap->path1_len, &path1); in cloudabi_sys_file_symlink()
729 if (error != 0) in cloudabi_sys_file_symlink()
730 return (error); in cloudabi_sys_file_symlink()
731 error = copyin_path(uap->path2, uap->path2_len, &path2); in cloudabi_sys_file_symlink()
732 if (error != 0) { in cloudabi_sys_file_symlink()
734 return (error); in cloudabi_sys_file_symlink()
737 error = kern_symlinkat(td, path1, uap->fd, path2, UIO_SYSSPACE); in cloudabi_sys_file_symlink()
740 return (error); in cloudabi_sys_file_symlink()
748 int error; in cloudabi_sys_file_unlink() local
750 error = copyin_path(uap->path, uap->path_len, &path); in cloudabi_sys_file_unlink()
751 if (error != 0) in cloudabi_sys_file_unlink()
752 return (error); in cloudabi_sys_file_unlink()
755 error = kern_rmdirat(td, uap->fd, path, UIO_SYSSPACE); in cloudabi_sys_file_unlink()
757 error = kern_unlinkat(td, uap->fd, path, UIO_SYSSPACE, 0); in cloudabi_sys_file_unlink()
759 return (error); in cloudabi_sys_file_unlink()