Lines Matching refs:p

25 #define LOCK_PATH(p, arg)                   \  argument
27 (p) = lock_user_string(arg); \
28 if ((p) == NULL) { \
33 #define UNLOCK_PATH(p, arg) unlock_user(p, arg, 0) argument
74 void *p; in do_bsd_read() local
76 p = lock_user(VERIFY_WRITE, arg2, arg3, 0); in do_bsd_read()
77 if (p == NULL) { in do_bsd_read()
80 ret = get_errno(safe_read(arg1, p, arg3)); in do_bsd_read()
81 unlock_user(p, arg2, ret); in do_bsd_read()
91 void *p; in do_bsd_pread() local
93 p = lock_user(VERIFY_WRITE, arg2, arg3, 0); in do_bsd_pread()
94 if (p == NULL) { in do_bsd_pread()
101 ret = get_errno(safe_pread(arg1, p, arg3, target_arg64(arg4, arg5))); in do_bsd_pread()
102 unlock_user(p, arg2, ret); in do_bsd_pread()
148 void *p; in do_bsd_write() local
155 p = lock_user(VERIFY_READ, arg2, nbytes, 1); in do_bsd_write()
156 if (p == NULL) { in do_bsd_write()
159 ret = get_errno(safe_write(arg1, p, arg3)); in do_bsd_write()
160 unlock_user(p, arg2, 0); in do_bsd_write()
170 void *p; in do_bsd_pwrite() local
172 p = lock_user(VERIFY_READ, arg2, arg3, 1); in do_bsd_pwrite()
173 if (p == NULL) { in do_bsd_pwrite()
180 ret = get_errno(safe_pwrite(arg1, p, arg3, target_arg64(arg4, arg5))); in do_bsd_pwrite()
181 unlock_user(p, arg2, 0); in do_bsd_pwrite()
227 void *p; in do_bsd_open() local
229 LOCK_PATH(p, arg1); in do_bsd_open()
230 ret = get_errno(safe_open(path(p), target_to_host_bitmask(arg2, in do_bsd_open()
232 UNLOCK_PATH(p, arg1); in do_bsd_open()
242 void *p; in do_bsd_openat() local
244 LOCK_PATH(p, arg2); in do_bsd_openat()
245 ret = get_errno(safe_openat(arg1, path(p), in do_bsd_openat()
247 UNLOCK_PATH(p, arg2); in do_bsd_openat()
281 void *p; in do_bsd_revoke() local
283 LOCK_PATH(p, arg1); in do_bsd_revoke()
284 ret = get_errno(revoke(p)); /* XXX path(p)? */ in do_bsd_revoke()
285 UNLOCK_PATH(p, arg1); in do_bsd_revoke()
294 void *p; in do_bsd_access() local
296 LOCK_PATH(p, arg1); in do_bsd_access()
297 ret = get_errno(access(path(p), arg2)); in do_bsd_access()
298 UNLOCK_PATH(p, arg1); in do_bsd_access()
307 void *p; in do_bsd_eaccess() local
309 LOCK_PATH(p, arg1); in do_bsd_eaccess()
310 ret = get_errno(eaccess(path(p), arg2)); in do_bsd_eaccess()
311 UNLOCK_PATH(p, arg1); in do_bsd_eaccess()
321 void *p; in do_bsd_faccessat() local
323 LOCK_PATH(p, arg2); in do_bsd_faccessat()
324 ret = get_errno(faccessat(arg1, p, arg3, arg4)); /* XXX path(p)? */ in do_bsd_faccessat()
325 UNLOCK_PATH(p, arg2); in do_bsd_faccessat()
334 void *p; in do_bsd_chdir() local
336 LOCK_PATH(p, arg1); in do_bsd_chdir()
337 ret = get_errno(chdir(p)); /* XXX path(p)? */ in do_bsd_chdir()
338 UNLOCK_PATH(p, arg1); in do_bsd_chdir()
407 void *p; in do_bsd_unlink() local
409 LOCK_PATH(p, arg1); in do_bsd_unlink()
410 ret = get_errno(unlink(p)); /* XXX path(p) */ in do_bsd_unlink()
411 UNLOCK_PATH(p, arg1); in do_bsd_unlink()
421 void *p; in do_bsd_unlinkat() local
423 LOCK_PATH(p, arg2); in do_bsd_unlinkat()
424 ret = get_errno(unlinkat(arg1, p, arg3)); /* XXX path(p) */ in do_bsd_unlinkat()
425 UNLOCK_PATH(p, arg2); in do_bsd_unlinkat()
434 void *p; in do_bsd_mkdir() local
436 LOCK_PATH(p, arg1); in do_bsd_mkdir()
437 ret = get_errno(mkdir(p, arg2)); /* XXX path(p) */ in do_bsd_mkdir()
438 UNLOCK_PATH(p, arg1); in do_bsd_mkdir()
448 void *p; in do_bsd_mkdirat() local
450 LOCK_PATH(p, arg2); in do_bsd_mkdirat()
451 ret = get_errno(mkdirat(arg1, p, arg3)); in do_bsd_mkdirat()
452 UNLOCK_PATH(p, arg2); in do_bsd_mkdirat()
461 void *p; in do_bsd_rmdir() local
463 LOCK_PATH(p, arg1); in do_bsd_rmdir()
464 ret = get_errno(rmdir(p)); /* XXX path(p)? */ in do_bsd_rmdir()
465 UNLOCK_PATH(p, arg1); in do_bsd_rmdir()
474 void *p; in do_bsd___getcwd() local
476 p = lock_user(VERIFY_WRITE, arg1, arg2, 0); in do_bsd___getcwd()
477 if (p == NULL) { in do_bsd___getcwd()
480 ret = safe_syscall(SYS___getcwd, p, arg2); in do_bsd___getcwd()
481 unlock_user(p, arg1, ret == 0 ? strlen(p) + 1 : 0); in do_bsd___getcwd()
503 void *p; in do_bsd_truncate() local
505 LOCK_PATH(p, arg1); in do_bsd_truncate()
510 ret = get_errno(truncate(p, target_arg64(arg2, arg3))); in do_bsd_truncate()
511 UNLOCK_PATH(p, arg1); in do_bsd_truncate()
531 void *p; in do_bsd_acct() local
536 LOCK_PATH(p, arg1); in do_bsd_acct()
537 ret = get_errno(acct(path(p))); in do_bsd_acct()
538 UNLOCK_PATH(p, arg1); in do_bsd_acct()
576 void *p; in do_bsd_unmount() local
578 LOCK_PATH(p, arg1); in do_bsd_unmount()
579 ret = get_errno(unmount(p, arg2)); /* XXX path(p)? */ in do_bsd_unmount()
580 UNLOCK_PATH(p, arg1); in do_bsd_unmount()
680 void *p; in do_bsd_chmod() local
682 LOCK_PATH(p, arg1); in do_bsd_chmod()
683 ret = get_errno(chmod(p, arg2)); /* XXX path(p)? */ in do_bsd_chmod()
684 UNLOCK_PATH(p, arg1); in do_bsd_chmod()
699 void *p; in do_bsd_lchmod() local
701 LOCK_PATH(p, arg1); in do_bsd_lchmod()
702 ret = get_errno(lchmod(p, arg2)); /* XXX path(p)? */ in do_bsd_lchmod()
703 UNLOCK_PATH(p, arg1); in do_bsd_lchmod()
713 void *p; in do_bsd_fchmodat() local
715 LOCK_PATH(p, arg2); in do_bsd_fchmodat()
716 ret = get_errno(fchmodat(arg1, p, arg3, arg4)); in do_bsd_fchmodat()
717 UNLOCK_PATH(p, arg2); in do_bsd_fchmodat()
726 void *p; in do_bsd_freebsd11_mknod() local
728 LOCK_PATH(p, arg1); in do_bsd_freebsd11_mknod()
729 ret = get_errno(syscall(SYS_freebsd11_mknod, p, arg2, arg3)); in do_bsd_freebsd11_mknod()
730 UNLOCK_PATH(p, arg1); in do_bsd_freebsd11_mknod()
740 void *p; in do_bsd_freebsd11_mknodat() local
742 LOCK_PATH(p, arg2); in do_bsd_freebsd11_mknodat()
743 ret = get_errno(syscall(SYS_freebsd11_mknodat, arg1, p, arg3, arg4)); in do_bsd_freebsd11_mknodat()
744 UNLOCK_PATH(p, arg2); in do_bsd_freebsd11_mknodat()
755 void *p; in do_bsd_mknodat() local
757 LOCK_PATH(p, arg2); in do_bsd_mknodat()
760 ret = get_errno(mknodat(arg1, p, arg3, target_arg64(arg5, arg6))); in do_bsd_mknodat()
762 ret = get_errno(mknodat(arg1, p, arg3, target_arg64(arg4, arg5))); in do_bsd_mknodat()
764 UNLOCK_PATH(p, arg2); in do_bsd_mknodat()
773 void *p; in do_bsd_chown() local
775 LOCK_PATH(p, arg1); in do_bsd_chown()
776 ret = get_errno(chown(p, arg2, arg3)); /* XXX path(p)? */ in do_bsd_chown()
777 UNLOCK_PATH(p, arg1); in do_bsd_chown()
794 void *p; in do_bsd_lchown() local
796 LOCK_PATH(p, arg1); in do_bsd_lchown()
797 ret = get_errno(lchown(p, arg2, arg3)); /* XXX path(p)? */ in do_bsd_lchown()
798 UNLOCK_PATH(p, arg1); in do_bsd_lchown()
808 void *p; in do_bsd_fchownat() local
810 LOCK_PATH(p, arg2); in do_bsd_fchownat()
811 ret = get_errno(fchownat(arg1, p, arg3, arg4, arg5)); /* XXX path(p)? */ in do_bsd_fchownat()
812 UNLOCK_PATH(p, arg2); in do_bsd_fchownat()
821 void *p; in do_bsd_chflags() local
823 LOCK_PATH(p, arg1); in do_bsd_chflags()
824 ret = get_errno(chflags(p, arg2)); /* XXX path(p)? */ in do_bsd_chflags()
825 UNLOCK_PATH(p, arg1); in do_bsd_chflags()
834 void *p; in do_bsd_lchflags() local
836 LOCK_PATH(p, arg1); in do_bsd_lchflags()
837 ret = get_errno(lchflags(p, arg2)); /* XXX path(p)? */ in do_bsd_lchflags()
838 UNLOCK_PATH(p, arg1); in do_bsd_lchflags()
853 void *p; in do_bsd_chroot() local
855 LOCK_PATH(p, arg1); in do_bsd_chroot()
856 ret = get_errno(chroot(p)); /* XXX path(p)? */ in do_bsd_chroot()
857 UNLOCK_PATH(p, arg1); in do_bsd_chroot()
872 void *p; in do_bsd_mkfifo() local
874 LOCK_PATH(p, arg1); in do_bsd_mkfifo()
875 ret = get_errno(mkfifo(p, arg2)); /* XXX path(p)? */ in do_bsd_mkfifo()
876 UNLOCK_PATH(p, arg1); in do_bsd_mkfifo()
886 void *p; in do_bsd_mkfifoat() local
888 LOCK_PATH(p, arg2); in do_bsd_mkfifoat()
889 ret = get_errno(mkfifoat(arg1, p, arg3)); in do_bsd_mkfifoat()
890 UNLOCK_PATH(p, arg2); in do_bsd_mkfifoat()
899 void *p; in do_bsd_pathconf() local
901 LOCK_PATH(p, arg1); in do_bsd_pathconf()
902 ret = get_errno(pathconf(p, arg2)); /* XXX path(p)? */ in do_bsd_pathconf()
903 UNLOCK_PATH(p, arg1); in do_bsd_pathconf()
912 void *p; in do_bsd_lpathconf() local
914 LOCK_PATH(p, arg1); in do_bsd_lpathconf()
915 ret = get_errno(lpathconf(p, arg2)); /* XXX path(p)? */ in do_bsd_lpathconf()
916 UNLOCK_PATH(p, arg1); in do_bsd_lpathconf()
931 void *p; in do_bsd_undelete() local
933 LOCK_PATH(p, arg1); in do_bsd_undelete()
934 ret = get_errno(undelete(p)); /* XXX path(p)? */ in do_bsd_undelete()
935 UNLOCK_PATH(p, arg1); in do_bsd_undelete()