Deleted Added
full compact
vfs_extattr.c (12111) vfs_extattr.c (12221)
1/*
2 * Copyright (c) 1989, 1993
3 * The Regents of the University of California. All rights reserved.
4 * (c) UNIX System Laboratories, Inc.
5 * All or some portions of this file are derived from material licensed
6 * to the University of California by American Telephone and Telegraph
7 * Co. or Unix System Laboratories, Inc. and are reproduced herein with
8 * the permission of UNIX System Laboratories, Inc.

--- 22 unchanged lines hidden (view full) ---

31 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
32 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
34 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36 * SUCH DAMAGE.
37 *
38 * @(#)vfs_syscalls.c 8.13 (Berkeley) 4/15/94
1/*
2 * Copyright (c) 1989, 1993
3 * The Regents of the University of California. All rights reserved.
4 * (c) UNIX System Laboratories, Inc.
5 * All or some portions of this file are derived from material licensed
6 * to the University of California by American Telephone and Telegraph
7 * Co. or Unix System Laboratories, Inc. and are reproduced herein with
8 * the permission of UNIX System Laboratories, Inc.

--- 22 unchanged lines hidden (view full) ---

31 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
32 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
34 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36 * SUCH DAMAGE.
37 *
38 * @(#)vfs_syscalls.c 8.13 (Berkeley) 4/15/94
39 * $Id: vfs_syscalls.c,v 1.36 1995/11/04 10:35:26 bde Exp $
39 * $Id: vfs_syscalls.c,v 1.37 1995/11/05 21:01:01 dyson Exp $
40 */
41
42#include <sys/param.h>
43#include <sys/systm.h>
40 */
41
42#include <sys/param.h>
43#include <sys/systm.h>
44#include <sys/sysproto.h>
44#include <sys/namei.h>
45#include <sys/filedesc.h>
46#include <sys/kernel.h>
47#include <sys/file.h>
48#include <sys/stat.h>
49#include <sys/vnode.h>
50#include <sys/mount.h>
51#include <sys/proc.h>

--- 12 unchanged lines hidden (view full) ---

64
65/*
66 * Virtual File System System Calls
67 */
68
69/*
70 * Mount a file system.
71 */
45#include <sys/namei.h>
46#include <sys/filedesc.h>
47#include <sys/kernel.h>
48#include <sys/file.h>
49#include <sys/stat.h>
50#include <sys/vnode.h>
51#include <sys/mount.h>
52#include <sys/proc.h>

--- 12 unchanged lines hidden (view full) ---

65
66/*
67 * Virtual File System System Calls
68 */
69
70/*
71 * Mount a file system.
72 */
73#ifndef _SYS_SYSPROTO_H_
72struct mount_args {
73 int type;
74 char *path;
75 int flags;
76 caddr_t data;
77};
74struct mount_args {
75 int type;
76 char *path;
77 int flags;
78 caddr_t data;
79};
80#endif
78/* ARGSUSED */
79int
80mount(p, uap, retval)
81 struct proc *p;
82 register struct mount_args *uap;
83 int *retval;
84{
85 register struct vnode *vp;

--- 120 unchanged lines hidden (view full) ---

206}
207
208/*
209 * Unmount a file system.
210 *
211 * Note: unmount takes a path to the vnode mounted on as argument,
212 * not special file (as before).
213 */
81/* ARGSUSED */
82int
83mount(p, uap, retval)
84 struct proc *p;
85 register struct mount_args *uap;
86 int *retval;
87{
88 register struct vnode *vp;

--- 120 unchanged lines hidden (view full) ---

209}
210
211/*
212 * Unmount a file system.
213 *
214 * Note: unmount takes a path to the vnode mounted on as argument,
215 * not special file (as before).
216 */
217#ifndef _SYS_SYSPROTO_H_
214struct unmount_args {
215 char *path;
216 int flags;
217};
218struct unmount_args {
219 char *path;
220 int flags;
221};
222#endif
218/* ARGSUSED */
219int
220unmount(p, uap, retval)
221 struct proc *p;
222 register struct unmount_args *uap;
223 int *retval;
224{
225 register struct vnode *vp;

--- 83 unchanged lines hidden (view full) ---

309/*
310 * Sync each mounted filesystem.
311 */
312#ifdef DIAGNOSTIC
313int syncprt = 0;
314struct ctldebug debug0 = { "syncprt", &syncprt };
315#endif
316
223/* ARGSUSED */
224int
225unmount(p, uap, retval)
226 struct proc *p;
227 register struct unmount_args *uap;
228 int *retval;
229{
230 register struct vnode *vp;

--- 83 unchanged lines hidden (view full) ---

314/*
315 * Sync each mounted filesystem.
316 */
317#ifdef DIAGNOSTIC
318int syncprt = 0;
319struct ctldebug debug0 = { "syncprt", &syncprt };
320#endif
321
322#ifndef _SYS_SYSPROTO_H_
317struct sync_args {
318 int dummy;
319};
323struct sync_args {
324 int dummy;
325};
326#endif
320
321/* ARGSUSED */
322int
323sync(p, uap, retval)
324 struct proc *p;
325 struct sync_args *uap;
326 int *retval;
327{

--- 17 unchanged lines hidden (view full) ---

345 }
346 }
347 return (0);
348}
349
350/*
351 * Change filesystem quotas.
352 */
327
328/* ARGSUSED */
329int
330sync(p, uap, retval)
331 struct proc *p;
332 struct sync_args *uap;
333 int *retval;
334{

--- 17 unchanged lines hidden (view full) ---

352 }
353 }
354 return (0);
355}
356
357/*
358 * Change filesystem quotas.
359 */
360#ifndef _SYS_SYSPROTO_H_
353struct quotactl_args {
354 char *path;
355 int cmd;
356 int uid;
357 caddr_t arg;
358};
361struct quotactl_args {
362 char *path;
363 int cmd;
364 int uid;
365 caddr_t arg;
366};
367#endif
359/* ARGSUSED */
360int
361quotactl(p, uap, retval)
362 struct proc *p;
363 register struct quotactl_args *uap;
364 int *retval;
365{
366 register struct mount *mp;

--- 7 unchanged lines hidden (view full) ---

374 mp = nd.ni_vp->v_mount;
375 vrele(nd.ni_vp);
376 return (VFS_QUOTACTL(mp, uap->cmd, uap->uid, uap->arg, p));
377}
378
379/*
380 * Get filesystem statistics.
381 */
368/* ARGSUSED */
369int
370quotactl(p, uap, retval)
371 struct proc *p;
372 register struct quotactl_args *uap;
373 int *retval;
374{
375 register struct mount *mp;

--- 7 unchanged lines hidden (view full) ---

383 mp = nd.ni_vp->v_mount;
384 vrele(nd.ni_vp);
385 return (VFS_QUOTACTL(mp, uap->cmd, uap->uid, uap->arg, p));
386}
387
388/*
389 * Get filesystem statistics.
390 */
391#ifndef _SYS_SYSPROTO_H_
382struct statfs_args {
383 char *path;
384 struct statfs *buf;
385};
392struct statfs_args {
393 char *path;
394 struct statfs *buf;
395};
396#endif
386/* ARGSUSED */
387int
388statfs(p, uap, retval)
389 struct proc *p;
390 register struct statfs_args *uap;
391 int *retval;
392{
393 register struct mount *mp;

--- 13 unchanged lines hidden (view full) ---

407 return (error);
408 sp->f_flags = mp->mnt_flag & MNT_VISFLAGMASK;
409 return (copyout((caddr_t)sp, (caddr_t)uap->buf, sizeof(*sp)));
410}
411
412/*
413 * Get filesystem statistics.
414 */
397/* ARGSUSED */
398int
399statfs(p, uap, retval)
400 struct proc *p;
401 register struct statfs_args *uap;
402 int *retval;
403{
404 register struct mount *mp;

--- 13 unchanged lines hidden (view full) ---

418 return (error);
419 sp->f_flags = mp->mnt_flag & MNT_VISFLAGMASK;
420 return (copyout((caddr_t)sp, (caddr_t)uap->buf, sizeof(*sp)));
421}
422
423/*
424 * Get filesystem statistics.
425 */
426#ifndef _SYS_SYSPROTO_H_
415struct fstatfs_args {
416 int fd;
417 struct statfs *buf;
418};
427struct fstatfs_args {
428 int fd;
429 struct statfs *buf;
430};
431#endif
419/* ARGSUSED */
420int
421fstatfs(p, uap, retval)
422 struct proc *p;
423 register struct fstatfs_args *uap;
424 int *retval;
425{
426 struct file *fp;

--- 11 unchanged lines hidden (view full) ---

438 return (error);
439 sp->f_flags = mp->mnt_flag & MNT_VISFLAGMASK;
440 return (copyout((caddr_t)sp, (caddr_t)uap->buf, sizeof(*sp)));
441}
442
443/*
444 * Get statistics on all filesystems.
445 */
432/* ARGSUSED */
433int
434fstatfs(p, uap, retval)
435 struct proc *p;
436 register struct fstatfs_args *uap;
437 int *retval;
438{
439 struct file *fp;

--- 11 unchanged lines hidden (view full) ---

451 return (error);
452 sp->f_flags = mp->mnt_flag & MNT_VISFLAGMASK;
453 return (copyout((caddr_t)sp, (caddr_t)uap->buf, sizeof(*sp)));
454}
455
456/*
457 * Get statistics on all filesystems.
458 */
459#ifndef _SYS_SYSPROTO_H_
446struct getfsstat_args {
447 struct statfs *buf;
448 long bufsize;
449 int flags;
450};
460struct getfsstat_args {
461 struct statfs *buf;
462 long bufsize;
463 int flags;
464};
465#endif
451int
452getfsstat(p, uap, retval)
453 struct proc *p;
454 register struct getfsstat_args *uap;
455 int *retval;
456{
457 register struct mount *mp, *nmp;
458 register struct statfs *sp;

--- 29 unchanged lines hidden (view full) ---

488 else
489 *retval = count;
490 return (0);
491}
492
493/*
494 * Change current working directory to a given file descriptor.
495 */
466int
467getfsstat(p, uap, retval)
468 struct proc *p;
469 register struct getfsstat_args *uap;
470 int *retval;
471{
472 register struct mount *mp, *nmp;
473 register struct statfs *sp;

--- 29 unchanged lines hidden (view full) ---

503 else
504 *retval = count;
505 return (0);
506}
507
508/*
509 * Change current working directory to a given file descriptor.
510 */
511#ifndef _SYS_SYSPROTO_H_
496struct fchdir_args {
497 int fd;
498};
512struct fchdir_args {
513 int fd;
514};
515#endif
499/* ARGSUSED */
500int
501fchdir(p, uap, retval)
502 struct proc *p;
503 struct fchdir_args *uap;
504 int *retval;
505{
506 register struct filedesc *fdp = p->p_fd;

--- 17 unchanged lines hidden (view full) ---

524 vrele(fdp->fd_cdir);
525 fdp->fd_cdir = vp;
526 return (0);
527}
528
529/*
530 * Change current working directory (``.'').
531 */
516/* ARGSUSED */
517int
518fchdir(p, uap, retval)
519 struct proc *p;
520 struct fchdir_args *uap;
521 int *retval;
522{
523 register struct filedesc *fdp = p->p_fd;

--- 17 unchanged lines hidden (view full) ---

541 vrele(fdp->fd_cdir);
542 fdp->fd_cdir = vp;
543 return (0);
544}
545
546/*
547 * Change current working directory (``.'').
548 */
549#ifndef _SYS_SYSPROTO_H_
532struct chdir_args {
533 char *path;
534};
550struct chdir_args {
551 char *path;
552};
553#endif
535/* ARGSUSED */
536int
537chdir(p, uap, retval)
538 struct proc *p;
539 struct chdir_args *uap;
540 int *retval;
541{
542 register struct filedesc *fdp = p->p_fd;

--- 7 unchanged lines hidden (view full) ---

550 vrele(fdp->fd_cdir);
551 fdp->fd_cdir = nd.ni_vp;
552 return (0);
553}
554
555/*
556 * Change notion of root (``/'') directory.
557 */
554/* ARGSUSED */
555int
556chdir(p, uap, retval)
557 struct proc *p;
558 struct chdir_args *uap;
559 int *retval;
560{
561 register struct filedesc *fdp = p->p_fd;

--- 7 unchanged lines hidden (view full) ---

569 vrele(fdp->fd_cdir);
570 fdp->fd_cdir = nd.ni_vp;
571 return (0);
572}
573
574/*
575 * Change notion of root (``/'') directory.
576 */
577#ifndef _SYS_SYSPROTO_H_
558struct chroot_args {
559 char *path;
560};
578struct chroot_args {
579 char *path;
580};
581#endif
561/* ARGSUSED */
562int
563chroot(p, uap, retval)
564 struct proc *p;
565 struct chroot_args *uap;
566 int *retval;
567{
568 register struct filedesc *fdp = p->p_fd;

--- 37 unchanged lines hidden (view full) ---

606 vrele(vp);
607 return (error);
608}
609
610/*
611 * Check permissions, allocate an open file structure,
612 * and call the device open routine if any.
613 */
582/* ARGSUSED */
583int
584chroot(p, uap, retval)
585 struct proc *p;
586 struct chroot_args *uap;
587 int *retval;
588{
589 register struct filedesc *fdp = p->p_fd;

--- 37 unchanged lines hidden (view full) ---

627 vrele(vp);
628 return (error);
629}
630
631/*
632 * Check permissions, allocate an open file structure,
633 * and call the device open routine if any.
634 */
635#ifndef _SYS_SYSPROTO_H_
614struct open_args {
615 char *path;
616 int flags;
617 int mode;
618};
636struct open_args {
637 char *path;
638 int flags;
639 int mode;
640};
641#endif
619int
620open(p, uap, retval)
621 struct proc *p;
622 register struct open_args *uap;
623 int *retval;
624{
625 register struct filedesc *fdp = p->p_fd;
626 register struct file *fp;

--- 59 unchanged lines hidden (view full) ---

686 *retval = indx;
687 return (0);
688}
689
690#ifdef COMPAT_43
691/*
692 * Create a file.
693 */
642int
643open(p, uap, retval)
644 struct proc *p;
645 register struct open_args *uap;
646 int *retval;
647{
648 register struct filedesc *fdp = p->p_fd;
649 register struct file *fp;

--- 59 unchanged lines hidden (view full) ---

709 *retval = indx;
710 return (0);
711}
712
713#ifdef COMPAT_43
714/*
715 * Create a file.
716 */
717#ifndef _SYS_SYSPROTO_H_
694struct ocreat_args {
695 char *path;
696 int mode;
697};
718struct ocreat_args {
719 char *path;
720 int mode;
721};
722#endif
698int
699ocreat(p, uap, retval)
700 struct proc *p;
701 register struct ocreat_args *uap;
702 int *retval;
703{
704 struct open_args openuap;
705
706 openuap.path = uap->path;
707 openuap.mode = uap->mode;
708 openuap.flags = O_WRONLY | O_CREAT | O_TRUNC;
709 return (open(p, &openuap, retval));
710}
711#endif /* COMPAT_43 */
712
713/*
714 * Create a special file.
715 */
723int
724ocreat(p, uap, retval)
725 struct proc *p;
726 register struct ocreat_args *uap;
727 int *retval;
728{
729 struct open_args openuap;
730
731 openuap.path = uap->path;
732 openuap.mode = uap->mode;
733 openuap.flags = O_WRONLY | O_CREAT | O_TRUNC;
734 return (open(p, &openuap, retval));
735}
736#endif /* COMPAT_43 */
737
738/*
739 * Create a special file.
740 */
741#ifndef _SYS_SYSPROTO_H_
716struct mknod_args {
717 char *path;
718 int mode;
719 int dev;
720};
742struct mknod_args {
743 char *path;
744 int mode;
745 int dev;
746};
747#endif
721/* ARGSUSED */
722int
723mknod(p, uap, retval)
724 struct proc *p;
725 register struct mknod_args *uap;
726 int *retval;
727{
728 register struct vnode *vp;

--- 44 unchanged lines hidden (view full) ---

773 vrele(vp);
774 }
775 return (error);
776}
777
778/*
779 * Create named pipe.
780 */
748/* ARGSUSED */
749int
750mknod(p, uap, retval)
751 struct proc *p;
752 register struct mknod_args *uap;
753 int *retval;
754{
755 register struct vnode *vp;

--- 44 unchanged lines hidden (view full) ---

800 vrele(vp);
801 }
802 return (error);
803}
804
805/*
806 * Create named pipe.
807 */
808#ifndef _SYS_SYSPROTO_H_
781struct mkfifo_args {
782 char *path;
783 int mode;
784};
809struct mkfifo_args {
810 char *path;
811 int mode;
812};
813#endif
785/* ARGSUSED */
786int
787mkfifo(p, uap, retval)
788 struct proc *p;
789 register struct mkfifo_args *uap;
790 int *retval;
791{
792 struct vattr vattr;

--- 18 unchanged lines hidden (view full) ---

811 vattr.va_mode = (uap->mode & ALLPERMS) &~ p->p_fd->fd_cmask;
812 LEASE_CHECK(nd.ni_dvp, p, p->p_ucred, LEASE_WRITE);
813 return (VOP_MKNOD(nd.ni_dvp, &nd.ni_vp, &nd.ni_cnd, &vattr));
814}
815
816/*
817 * Make a hard file link.
818 */
814/* ARGSUSED */
815int
816mkfifo(p, uap, retval)
817 struct proc *p;
818 register struct mkfifo_args *uap;
819 int *retval;
820{
821 struct vattr vattr;

--- 18 unchanged lines hidden (view full) ---

840 vattr.va_mode = (uap->mode & ALLPERMS) &~ p->p_fd->fd_cmask;
841 LEASE_CHECK(nd.ni_dvp, p, p->p_ucred, LEASE_WRITE);
842 return (VOP_MKNOD(nd.ni_dvp, &nd.ni_vp, &nd.ni_cnd, &vattr));
843}
844
845/*
846 * Make a hard file link.
847 */
848#ifndef _SYS_SYSPROTO_H_
819struct link_args {
820 char *path;
821 char *link;
822};
849struct link_args {
850 char *path;
851 char *link;
852};
853#endif
823/* ARGSUSED */
824int
825link(p, uap, retval)
826 struct proc *p;
827 register struct link_args *uap;
828 int *retval;
829{
830 register struct vnode *vp;

--- 32 unchanged lines hidden (view full) ---

863 }
864 vrele(vp);
865 return (error);
866}
867
868/*
869 * Make a symbolic link.
870 */
854/* ARGSUSED */
855int
856link(p, uap, retval)
857 struct proc *p;
858 register struct link_args *uap;
859 int *retval;
860{
861 register struct vnode *vp;

--- 32 unchanged lines hidden (view full) ---

894 }
895 vrele(vp);
896 return (error);
897}
898
899/*
900 * Make a symbolic link.
901 */
902#ifndef _SYS_SYSPROTO_H_
871struct symlink_args {
872 char *path;
873 char *link;
874};
903struct symlink_args {
904 char *path;
905 char *link;
906};
907#endif
875/* ARGSUSED */
876int
877symlink(p, uap, retval)
878 struct proc *p;
879 register struct symlink_args *uap;
880 int *retval;
881{
882 struct vattr vattr;

--- 26 unchanged lines hidden (view full) ---

909out:
910 FREE(path, M_NAMEI);
911 return (error);
912}
913
914/*
915 * Delete a name from the filesystem.
916 */
908/* ARGSUSED */
909int
910symlink(p, uap, retval)
911 struct proc *p;
912 register struct symlink_args *uap;
913 int *retval;
914{
915 struct vattr vattr;

--- 26 unchanged lines hidden (view full) ---

942out:
943 FREE(path, M_NAMEI);
944 return (error);
945}
946
947/*
948 * Delete a name from the filesystem.
949 */
950#ifndef _SYS_SYSPROTO_H_
917struct unlink_args {
918 char *path;
919};
951struct unlink_args {
952 char *path;
953};
954#endif
920/* ARGSUSED */
921int
922unlink(p, uap, retval)
923 struct proc *p;
924 struct unlink_args *uap;
925 int *retval;
926{
927 register struct vnode *vp;

--- 31 unchanged lines hidden (view full) ---

959 vput(vp);
960 }
961 return (error);
962}
963
964/*
965 * Reposition read/write file offset.
966 */
955/* ARGSUSED */
956int
957unlink(p, uap, retval)
958 struct proc *p;
959 struct unlink_args *uap;
960 int *retval;
961{
962 register struct vnode *vp;

--- 31 unchanged lines hidden (view full) ---

994 vput(vp);
995 }
996 return (error);
997}
998
999/*
1000 * Reposition read/write file offset.
1001 */
1002#ifndef _SYS_SYSPROTO_H_
967struct lseek_args {
968 int fd;
969 int pad;
970 off_t offset;
971 int whence;
972};
1003struct lseek_args {
1004 int fd;
1005 int pad;
1006 off_t offset;
1007 int whence;
1008};
1009#endif
973int
974lseek(p, uap, retval)
975 struct proc *p;
976 register struct lseek_args *uap;
977 int *retval;
978{
979 struct ucred *cred = p->p_ucred;
980 register struct filedesc *fdp = p->p_fd;

--- 25 unchanged lines hidden (view full) ---

1006 *(off_t *)retval = fp->f_offset;
1007 return (0);
1008}
1009
1010#if defined(COMPAT_43) || defined(COMPAT_SUNOS)
1011/*
1012 * Reposition read/write file offset.
1013 */
1010int
1011lseek(p, uap, retval)
1012 struct proc *p;
1013 register struct lseek_args *uap;
1014 int *retval;
1015{
1016 struct ucred *cred = p->p_ucred;
1017 register struct filedesc *fdp = p->p_fd;

--- 25 unchanged lines hidden (view full) ---

1043 *(off_t *)retval = fp->f_offset;
1044 return (0);
1045}
1046
1047#if defined(COMPAT_43) || defined(COMPAT_SUNOS)
1048/*
1049 * Reposition read/write file offset.
1050 */
1051#ifndef _SYS_SYSPROTO_H_
1014struct olseek_args {
1015 int fd;
1016 long offset;
1017 int whence;
1018};
1052struct olseek_args {
1053 int fd;
1054 long offset;
1055 int whence;
1056};
1057#endif
1019int
1020olseek(p, uap, retval)
1021 struct proc *p;
1022 register struct olseek_args *uap;
1023 int *retval;
1024{
1025 struct lseek_args nuap;
1026 off_t qret;

--- 6 unchanged lines hidden (view full) ---

1033 *(long *)retval = qret;
1034 return (error);
1035}
1036#endif /* COMPAT_43 */
1037
1038/*
1039 * Check access permissions.
1040 */
1058int
1059olseek(p, uap, retval)
1060 struct proc *p;
1061 register struct olseek_args *uap;
1062 int *retval;
1063{
1064 struct lseek_args nuap;
1065 off_t qret;

--- 6 unchanged lines hidden (view full) ---

1072 *(long *)retval = qret;
1073 return (error);
1074}
1075#endif /* COMPAT_43 */
1076
1077/*
1078 * Check access permissions.
1079 */
1080#ifndef _SYS_SYSPROTO_H_
1041struct access_args {
1042 char *path;
1043 int flags;
1044};
1081struct access_args {
1082 char *path;
1083 int flags;
1084};
1085#endif
1045int
1046access(p, uap, retval)
1047 struct proc *p;
1048 register struct access_args *uap;
1049 int *retval;
1050{
1051 register struct ucred *cred = p->p_ucred;
1052 register struct vnode *vp;

--- 28 unchanged lines hidden (view full) ---

1081 cred->cr_groups[0] = t_gid;
1082 return (error);
1083}
1084
1085#if defined(COMPAT_43) || defined(COMPAT_SUNOS)
1086/*
1087 * Get file status; this version follows links.
1088 */
1086int
1087access(p, uap, retval)
1088 struct proc *p;
1089 register struct access_args *uap;
1090 int *retval;
1091{
1092 register struct ucred *cred = p->p_ucred;
1093 register struct vnode *vp;

--- 28 unchanged lines hidden (view full) ---

1122 cred->cr_groups[0] = t_gid;
1123 return (error);
1124}
1125
1126#if defined(COMPAT_43) || defined(COMPAT_SUNOS)
1127/*
1128 * Get file status; this version follows links.
1129 */
1130#ifndef _SYS_SYSPROTO_H_
1089struct ostat_args {
1090 char *path;
1091 struct ostat *ub;
1092};
1131struct ostat_args {
1132 char *path;
1133 struct ostat *ub;
1134};
1135#endif
1093/* ARGSUSED */
1094int
1095ostat(p, uap, retval)
1096 struct proc *p;
1097 register struct ostat_args *uap;
1098 int *retval;
1099{
1100 struct stat sb;

--- 12 unchanged lines hidden (view full) ---

1113 cvtstat(&sb, &osb);
1114 error = copyout((caddr_t)&osb, (caddr_t)uap->ub, sizeof (osb));
1115 return (error);
1116}
1117
1118/*
1119 * Get file status; this version does not follow links.
1120 */
1136/* ARGSUSED */
1137int
1138ostat(p, uap, retval)
1139 struct proc *p;
1140 register struct ostat_args *uap;
1141 int *retval;
1142{
1143 struct stat sb;

--- 12 unchanged lines hidden (view full) ---

1156 cvtstat(&sb, &osb);
1157 error = copyout((caddr_t)&osb, (caddr_t)uap->ub, sizeof (osb));
1158 return (error);
1159}
1160
1161/*
1162 * Get file status; this version does not follow links.
1163 */
1164#ifndef _SYS_SYSPROTO_H_
1121struct olstat_args {
1122 char *path;
1123 struct ostat *ub;
1124};
1165struct olstat_args {
1166 char *path;
1167 struct ostat *ub;
1168};
1169#endif
1125/* ARGSUSED */
1126int
1127olstat(p, uap, retval)
1128 struct proc *p;
1129 register struct olstat_args *uap;
1130 int *retval;
1131{
1132 struct vnode *vp, *dvp;

--- 72 unchanged lines hidden (view full) ---

1205 ost->st_flags = st->st_flags;
1206 ost->st_gen = st->st_gen;
1207}
1208#endif /* COMPAT_43 || COMPAT_SUNOS */
1209
1210/*
1211 * Get file status; this version follows links.
1212 */
1170/* ARGSUSED */
1171int
1172olstat(p, uap, retval)
1173 struct proc *p;
1174 register struct olstat_args *uap;
1175 int *retval;
1176{
1177 struct vnode *vp, *dvp;

--- 72 unchanged lines hidden (view full) ---

1250 ost->st_flags = st->st_flags;
1251 ost->st_gen = st->st_gen;
1252}
1253#endif /* COMPAT_43 || COMPAT_SUNOS */
1254
1255/*
1256 * Get file status; this version follows links.
1257 */
1258#ifndef _SYS_SYSPROTO_H_
1213struct stat_args {
1214 char *path;
1215 struct stat *ub;
1216};
1259struct stat_args {
1260 char *path;
1261 struct stat *ub;
1262};
1263#endif
1217/* ARGSUSED */
1218int
1219stat(p, uap, retval)
1220 struct proc *p;
1221 register struct stat_args *uap;
1222 int *retval;
1223{
1224 struct stat sb;

--- 10 unchanged lines hidden (view full) ---

1235 return (error);
1236 error = copyout((caddr_t)&sb, (caddr_t)uap->ub, sizeof (sb));
1237 return (error);
1238}
1239
1240/*
1241 * Get file status; this version does not follow links.
1242 */
1264/* ARGSUSED */
1265int
1266stat(p, uap, retval)
1267 struct proc *p;
1268 register struct stat_args *uap;
1269 int *retval;
1270{
1271 struct stat sb;

--- 10 unchanged lines hidden (view full) ---

1282 return (error);
1283 error = copyout((caddr_t)&sb, (caddr_t)uap->ub, sizeof (sb));
1284 return (error);
1285}
1286
1287/*
1288 * Get file status; this version does not follow links.
1289 */
1290#ifndef _SYS_SYSPROTO_H_
1243struct lstat_args {
1244 char *path;
1245 struct stat *ub;
1246};
1291struct lstat_args {
1292 char *path;
1293 struct stat *ub;
1294};
1295#endif
1247/* ARGSUSED */
1248int
1249lstat(p, uap, retval)
1250 struct proc *p;
1251 register struct lstat_args *uap;
1252 int *retval;
1253{
1254 int error;

--- 40 unchanged lines hidden (view full) ---

1295 }
1296 error = copyout((caddr_t)&sb, (caddr_t)uap->ub, sizeof (sb));
1297 return (error);
1298}
1299
1300/*
1301 * Get configurable pathname variables.
1302 */
1296/* ARGSUSED */
1297int
1298lstat(p, uap, retval)
1299 struct proc *p;
1300 register struct lstat_args *uap;
1301 int *retval;
1302{
1303 int error;

--- 40 unchanged lines hidden (view full) ---

1344 }
1345 error = copyout((caddr_t)&sb, (caddr_t)uap->ub, sizeof (sb));
1346 return (error);
1347}
1348
1349/*
1350 * Get configurable pathname variables.
1351 */
1352#ifndef _SYS_SYSPROTO_H_
1303struct pathconf_args {
1304 char *path;
1305 int name;
1306};
1353struct pathconf_args {
1354 char *path;
1355 int name;
1356};
1357#endif
1307/* ARGSUSED */
1308int
1309pathconf(p, uap, retval)
1310 struct proc *p;
1311 register struct pathconf_args *uap;
1312 int *retval;
1313{
1314 int error;

--- 6 unchanged lines hidden (view full) ---

1321 error = VOP_PATHCONF(nd.ni_vp, uap->name, retval);
1322 vput(nd.ni_vp);
1323 return (error);
1324}
1325
1326/*
1327 * Return target name of a symbolic link.
1328 */
1358/* ARGSUSED */
1359int
1360pathconf(p, uap, retval)
1361 struct proc *p;
1362 register struct pathconf_args *uap;
1363 int *retval;
1364{
1365 int error;

--- 6 unchanged lines hidden (view full) ---

1372 error = VOP_PATHCONF(nd.ni_vp, uap->name, retval);
1373 vput(nd.ni_vp);
1374 return (error);
1375}
1376
1377/*
1378 * Return target name of a symbolic link.
1379 */
1380#ifndef _SYS_SYSPROTO_H_
1329struct readlink_args {
1330 char *path;
1331 char *buf;
1332 int count;
1333};
1381struct readlink_args {
1382 char *path;
1383 char *buf;
1384 int count;
1385};
1386#endif
1334/* ARGSUSED */
1335int
1336readlink(p, uap, retval)
1337 struct proc *p;
1338 register struct readlink_args *uap;
1339 int *retval;
1340{
1341 register struct vnode *vp;

--- 24 unchanged lines hidden (view full) ---

1366 vput(vp);
1367 *retval = uap->count - auio.uio_resid;
1368 return (error);
1369}
1370
1371/*
1372 * Change flags of a file given a path name.
1373 */
1387/* ARGSUSED */
1388int
1389readlink(p, uap, retval)
1390 struct proc *p;
1391 register struct readlink_args *uap;
1392 int *retval;
1393{
1394 register struct vnode *vp;

--- 24 unchanged lines hidden (view full) ---

1419 vput(vp);
1420 *retval = uap->count - auio.uio_resid;
1421 return (error);
1422}
1423
1424/*
1425 * Change flags of a file given a path name.
1426 */
1427#ifndef _SYS_SYSPROTO_H_
1374struct chflags_args {
1375 char *path;
1376 int flags;
1377};
1428struct chflags_args {
1429 char *path;
1430 int flags;
1431};
1432#endif
1378/* ARGSUSED */
1379int
1380chflags(p, uap, retval)
1381 struct proc *p;
1382 register struct chflags_args *uap;
1383 int *retval;
1384{
1385 register struct vnode *vp;

--- 13 unchanged lines hidden (view full) ---

1399 error = VOP_SETATTR(vp, &vattr, p->p_ucred, p);
1400 vput(vp);
1401 return (error);
1402}
1403
1404/*
1405 * Change flags of a file given a file descriptor.
1406 */
1433/* ARGSUSED */
1434int
1435chflags(p, uap, retval)
1436 struct proc *p;
1437 register struct chflags_args *uap;
1438 int *retval;
1439{
1440 register struct vnode *vp;

--- 13 unchanged lines hidden (view full) ---

1454 error = VOP_SETATTR(vp, &vattr, p->p_ucred, p);
1455 vput(vp);
1456 return (error);
1457}
1458
1459/*
1460 * Change flags of a file given a file descriptor.
1461 */
1462#ifndef _SYS_SYSPROTO_H_
1407struct fchflags_args {
1408 int fd;
1409 int flags;
1410};
1463struct fchflags_args {
1464 int fd;
1465 int flags;
1466};
1467#endif
1411/* ARGSUSED */
1412int
1413fchflags(p, uap, retval)
1414 struct proc *p;
1415 register struct fchflags_args *uap;
1416 int *retval;
1417{
1418 struct vattr vattr;

--- 12 unchanged lines hidden (view full) ---

1431 error = VOP_SETATTR(vp, &vattr, p->p_ucred, p);
1432 VOP_UNLOCK(vp);
1433 return (error);
1434}
1435
1436/*
1437 * Change mode of a file given path name.
1438 */
1468/* ARGSUSED */
1469int
1470fchflags(p, uap, retval)
1471 struct proc *p;
1472 register struct fchflags_args *uap;
1473 int *retval;
1474{
1475 struct vattr vattr;

--- 12 unchanged lines hidden (view full) ---

1488 error = VOP_SETATTR(vp, &vattr, p->p_ucred, p);
1489 VOP_UNLOCK(vp);
1490 return (error);
1491}
1492
1493/*
1494 * Change mode of a file given path name.
1495 */
1496#ifndef _SYS_SYSPROTO_H_
1439struct chmod_args {
1440 char *path;
1441 int mode;
1442};
1497struct chmod_args {
1498 char *path;
1499 int mode;
1500};
1501#endif
1443/* ARGSUSED */
1444int
1445chmod(p, uap, retval)
1446 struct proc *p;
1447 register struct chmod_args *uap;
1448 int *retval;
1449{
1450 register struct vnode *vp;

--- 13 unchanged lines hidden (view full) ---

1464 error = VOP_SETATTR(vp, &vattr, p->p_ucred, p);
1465 vput(vp);
1466 return (error);
1467}
1468
1469/*
1470 * Change mode of a file given a file descriptor.
1471 */
1502/* ARGSUSED */
1503int
1504chmod(p, uap, retval)
1505 struct proc *p;
1506 register struct chmod_args *uap;
1507 int *retval;
1508{
1509 register struct vnode *vp;

--- 13 unchanged lines hidden (view full) ---

1523 error = VOP_SETATTR(vp, &vattr, p->p_ucred, p);
1524 vput(vp);
1525 return (error);
1526}
1527
1528/*
1529 * Change mode of a file given a file descriptor.
1530 */
1531#ifndef _SYS_SYSPROTO_H_
1472struct fchmod_args {
1473 int fd;
1474 int mode;
1475};
1532struct fchmod_args {
1533 int fd;
1534 int mode;
1535};
1536#endif
1476/* ARGSUSED */
1477int
1478fchmod(p, uap, retval)
1479 struct proc *p;
1480 register struct fchmod_args *uap;
1481 int *retval;
1482{
1483 struct vattr vattr;

--- 12 unchanged lines hidden (view full) ---

1496 error = VOP_SETATTR(vp, &vattr, p->p_ucred, p);
1497 VOP_UNLOCK(vp);
1498 return (error);
1499}
1500
1501/*
1502 * Set ownership given a path name.
1503 */
1537/* ARGSUSED */
1538int
1539fchmod(p, uap, retval)
1540 struct proc *p;
1541 register struct fchmod_args *uap;
1542 int *retval;
1543{
1544 struct vattr vattr;

--- 12 unchanged lines hidden (view full) ---

1557 error = VOP_SETATTR(vp, &vattr, p->p_ucred, p);
1558 VOP_UNLOCK(vp);
1559 return (error);
1560}
1561
1562/*
1563 * Set ownership given a path name.
1564 */
1565#ifndef _SYS_SYSPROTO_H_
1504struct chown_args {
1505 char *path;
1506 int uid;
1507 int gid;
1508};
1566struct chown_args {
1567 char *path;
1568 int uid;
1569 int gid;
1570};
1571#endif
1509/* ARGSUSED */
1510int
1511chown(p, uap, retval)
1512 struct proc *p;
1513 register struct chown_args *uap;
1514 int *retval;
1515{
1516 register struct vnode *vp;

--- 14 unchanged lines hidden (view full) ---

1531 error = VOP_SETATTR(vp, &vattr, p->p_ucred, p);
1532 vput(vp);
1533 return (error);
1534}
1535
1536/*
1537 * Set ownership given a file descriptor.
1538 */
1572/* ARGSUSED */
1573int
1574chown(p, uap, retval)
1575 struct proc *p;
1576 register struct chown_args *uap;
1577 int *retval;
1578{
1579 register struct vnode *vp;

--- 14 unchanged lines hidden (view full) ---

1594 error = VOP_SETATTR(vp, &vattr, p->p_ucred, p);
1595 vput(vp);
1596 return (error);
1597}
1598
1599/*
1600 * Set ownership given a file descriptor.
1601 */
1602#ifndef _SYS_SYSPROTO_H_
1539struct fchown_args {
1540 int fd;
1541 int uid;
1542 int gid;
1543};
1603struct fchown_args {
1604 int fd;
1605 int uid;
1606 int gid;
1607};
1608#endif
1544/* ARGSUSED */
1545int
1546fchown(p, uap, retval)
1547 struct proc *p;
1548 register struct fchown_args *uap;
1549 int *retval;
1550{
1551 struct vattr vattr;

--- 13 unchanged lines hidden (view full) ---

1565 error = VOP_SETATTR(vp, &vattr, p->p_ucred, p);
1566 VOP_UNLOCK(vp);
1567 return (error);
1568}
1569
1570/*
1571 * Set the access and modification times of a file.
1572 */
1609/* ARGSUSED */
1610int
1611fchown(p, uap, retval)
1612 struct proc *p;
1613 register struct fchown_args *uap;
1614 int *retval;
1615{
1616 struct vattr vattr;

--- 13 unchanged lines hidden (view full) ---

1630 error = VOP_SETATTR(vp, &vattr, p->p_ucred, p);
1631 VOP_UNLOCK(vp);
1632 return (error);
1633}
1634
1635/*
1636 * Set the access and modification times of a file.
1637 */
1638#ifndef _SYS_SYSPROTO_H_
1573struct utimes_args {
1574 char *path;
1575 struct timeval *tptr;
1576};
1639struct utimes_args {
1640 char *path;
1641 struct timeval *tptr;
1642};
1643#endif
1577/* ARGSUSED */
1578int
1579utimes(p, uap, retval)
1580 struct proc *p;
1581 register struct utimes_args *uap;
1582 int *retval;
1583{
1584 register struct vnode *vp;

--- 26 unchanged lines hidden (view full) ---

1611 error = VOP_SETATTR(vp, &vattr, p->p_ucred, p);
1612 vput(vp);
1613 return (error);
1614}
1615
1616/*
1617 * Truncate a file given its path name.
1618 */
1644/* ARGSUSED */
1645int
1646utimes(p, uap, retval)
1647 struct proc *p;
1648 register struct utimes_args *uap;
1649 int *retval;
1650{
1651 register struct vnode *vp;

--- 26 unchanged lines hidden (view full) ---

1678 error = VOP_SETATTR(vp, &vattr, p->p_ucred, p);
1679 vput(vp);
1680 return (error);
1681}
1682
1683/*
1684 * Truncate a file given its path name.
1685 */
1686#ifndef _SYS_SYSPROTO_H_
1619struct truncate_args {
1620 char *path;
1621 int pad;
1622 off_t length;
1623};
1687struct truncate_args {
1688 char *path;
1689 int pad;
1690 off_t length;
1691};
1692#endif
1624/* ARGSUSED */
1625int
1626truncate(p, uap, retval)
1627 struct proc *p;
1628 register struct truncate_args *uap;
1629 int *retval;
1630{
1631 register struct vnode *vp;

--- 20 unchanged lines hidden (view full) ---

1652 }
1653 vput(vp);
1654 return (error);
1655}
1656
1657/*
1658 * Truncate a file given a file descriptor.
1659 */
1693/* ARGSUSED */
1694int
1695truncate(p, uap, retval)
1696 struct proc *p;
1697 register struct truncate_args *uap;
1698 int *retval;
1699{
1700 register struct vnode *vp;

--- 20 unchanged lines hidden (view full) ---

1721 }
1722 vput(vp);
1723 return (error);
1724}
1725
1726/*
1727 * Truncate a file given a file descriptor.
1728 */
1729#ifndef _SYS_SYSPROTO_H_
1660struct ftruncate_args {
1661 int fd;
1662 int pad;
1663 off_t length;
1664};
1730struct ftruncate_args {
1731 int fd;
1732 int pad;
1733 off_t length;
1734};
1735#endif
1665/* ARGSUSED */
1666int
1667ftruncate(p, uap, retval)
1668 struct proc *p;
1669 register struct ftruncate_args *uap;
1670 int *retval;
1671{
1672 struct vattr vattr;

--- 21 unchanged lines hidden (view full) ---

1694 VOP_UNLOCK(vp);
1695 return (error);
1696}
1697
1698#if defined(COMPAT_43) || defined(COMPAT_SUNOS)
1699/*
1700 * Truncate a file given its path name.
1701 */
1736/* ARGSUSED */
1737int
1738ftruncate(p, uap, retval)
1739 struct proc *p;
1740 register struct ftruncate_args *uap;
1741 int *retval;
1742{
1743 struct vattr vattr;

--- 21 unchanged lines hidden (view full) ---

1765 VOP_UNLOCK(vp);
1766 return (error);
1767}
1768
1769#if defined(COMPAT_43) || defined(COMPAT_SUNOS)
1770/*
1771 * Truncate a file given its path name.
1772 */
1773#ifndef _SYS_SYSPROTO_H_
1702struct otruncate_args {
1703 char *path;
1704 long length;
1705};
1774struct otruncate_args {
1775 char *path;
1776 long length;
1777};
1778#endif
1706/* ARGSUSED */
1707int
1708otruncate(p, uap, retval)
1709 struct proc *p;
1710 register struct otruncate_args *uap;
1711 int *retval;
1712{
1713 struct truncate_args nuap;
1714
1715 nuap.path = uap->path;
1716 nuap.length = uap->length;
1717 return (truncate(p, &nuap, retval));
1718}
1719
1720/*
1721 * Truncate a file given a file descriptor.
1722 */
1779/* ARGSUSED */
1780int
1781otruncate(p, uap, retval)
1782 struct proc *p;
1783 register struct otruncate_args *uap;
1784 int *retval;
1785{
1786 struct truncate_args nuap;
1787
1788 nuap.path = uap->path;
1789 nuap.length = uap->length;
1790 return (truncate(p, &nuap, retval));
1791}
1792
1793/*
1794 * Truncate a file given a file descriptor.
1795 */
1796#ifndef _SYS_SYSPROTO_H_
1723struct oftruncate_args {
1724 int fd;
1725 long length;
1726};
1797struct oftruncate_args {
1798 int fd;
1799 long length;
1800};
1801#endif
1727/* ARGSUSED */
1728int
1729oftruncate(p, uap, retval)
1730 struct proc *p;
1731 register struct oftruncate_args *uap;
1732 int *retval;
1733{
1734 struct ftruncate_args nuap;
1735
1736 nuap.fd = uap->fd;
1737 nuap.length = uap->length;
1738 return (ftruncate(p, &nuap, retval));
1739}
1740#endif /* COMPAT_43 || COMPAT_SUNOS */
1741
1742/*
1743 * Sync an open file.
1744 */
1802/* ARGSUSED */
1803int
1804oftruncate(p, uap, retval)
1805 struct proc *p;
1806 register struct oftruncate_args *uap;
1807 int *retval;
1808{
1809 struct ftruncate_args nuap;
1810
1811 nuap.fd = uap->fd;
1812 nuap.length = uap->length;
1813 return (ftruncate(p, &nuap, retval));
1814}
1815#endif /* COMPAT_43 || COMPAT_SUNOS */
1816
1817/*
1818 * Sync an open file.
1819 */
1820#ifndef _SYS_SYSPROTO_H_
1745struct fsync_args {
1746 int fd;
1747};
1821struct fsync_args {
1822 int fd;
1823};
1824#endif
1748/* ARGSUSED */
1749int
1750fsync(p, uap, retval)
1751 struct proc *p;
1752 struct fsync_args *uap;
1753 int *retval;
1754{
1755 register struct vnode *vp;

--- 13 unchanged lines hidden (view full) ---

1769 VOP_UNLOCK(vp);
1770 return (error);
1771}
1772
1773/*
1774 * Rename files. Source and destination must either both be directories,
1775 * or both not be directories. If target is a directory, it must be empty.
1776 */
1825/* ARGSUSED */
1826int
1827fsync(p, uap, retval)
1828 struct proc *p;
1829 struct fsync_args *uap;
1830 int *retval;
1831{
1832 register struct vnode *vp;

--- 13 unchanged lines hidden (view full) ---

1846 VOP_UNLOCK(vp);
1847 return (error);
1848}
1849
1850/*
1851 * Rename files. Source and destination must either both be directories,
1852 * or both not be directories. If target is a directory, it must be empty.
1853 */
1854#ifndef _SYS_SYSPROTO_H_
1777struct rename_args {
1778 char *from;
1779 char *to;
1780};
1855struct rename_args {
1856 char *from;
1857 char *to;
1858};
1859#endif
1781/* ARGSUSED */
1782int
1783rename(p, uap, retval)
1784 struct proc *p;
1785 register struct rename_args *uap;
1786 int *retval;
1787{
1788 register struct vnode *tvp, *fvp, *tdvp;

--- 73 unchanged lines hidden (view full) ---

1862 if (error == -1)
1863 return (0);
1864 return (error);
1865}
1866
1867/*
1868 * Make a directory file.
1869 */
1860/* ARGSUSED */
1861int
1862rename(p, uap, retval)
1863 struct proc *p;
1864 register struct rename_args *uap;
1865 int *retval;
1866{
1867 register struct vnode *tvp, *fvp, *tdvp;

--- 73 unchanged lines hidden (view full) ---

1941 if (error == -1)
1942 return (0);
1943 return (error);
1944}
1945
1946/*
1947 * Make a directory file.
1948 */
1949#ifndef _SYS_SYSPROTO_H_
1870struct mkdir_args {
1871 char *path;
1872 int mode;
1873};
1950struct mkdir_args {
1951 char *path;
1952 int mode;
1953};
1954#endif
1874/* ARGSUSED */
1875int
1876mkdir(p, uap, retval)
1877 struct proc *p;
1878 register struct mkdir_args *uap;
1879 int *retval;
1880{
1881 register struct vnode *vp;

--- 24 unchanged lines hidden (view full) ---

1906 if (!error)
1907 vput(nd.ni_vp);
1908 return (error);
1909}
1910
1911/*
1912 * Remove a directory file.
1913 */
1955/* ARGSUSED */
1956int
1957mkdir(p, uap, retval)
1958 struct proc *p;
1959 register struct mkdir_args *uap;
1960 int *retval;
1961{
1962 register struct vnode *vp;

--- 24 unchanged lines hidden (view full) ---

1987 if (!error)
1988 vput(nd.ni_vp);
1989 return (error);
1990}
1991
1992/*
1993 * Remove a directory file.
1994 */
1995#ifndef _SYS_SYSPROTO_H_
1914struct rmdir_args {
1915 char *path;
1916};
1996struct rmdir_args {
1997 char *path;
1998};
1999#endif
1917/* ARGSUSED */
1918int
1919rmdir(p, uap, retval)
1920 struct proc *p;
1921 struct rmdir_args *uap;
1922 int *retval;
1923{
1924 register struct vnode *vp;

--- 36 unchanged lines hidden (view full) ---

1961 }
1962 return (error);
1963}
1964
1965#ifdef COMPAT_43
1966/*
1967 * Read a block of directory entries in a file system independent format.
1968 */
2000/* ARGSUSED */
2001int
2002rmdir(p, uap, retval)
2003 struct proc *p;
2004 struct rmdir_args *uap;
2005 int *retval;
2006{
2007 register struct vnode *vp;

--- 36 unchanged lines hidden (view full) ---

2044 }
2045 return (error);
2046}
2047
2048#ifdef COMPAT_43
2049/*
2050 * Read a block of directory entries in a file system independent format.
2051 */
2052#ifndef _SYS_SYSPROTO_H_
1969struct ogetdirentries_args {
1970 int fd;
1971 char *buf;
1972 u_int count;
1973 long *basep;
1974};
2053struct ogetdirentries_args {
2054 int fd;
2055 char *buf;
2056 u_int count;
2057 long *basep;
2058};
2059#endif
1975int
1976ogetdirentries(p, uap, retval)
1977 struct proc *p;
1978 register struct ogetdirentries_args *uap;
1979 int *retval;
1980{
1981 register struct vnode *vp;
1982 struct file *fp;

--- 78 unchanged lines hidden (view full) ---

2061 *retval = uap->count - auio.uio_resid;
2062 return (error);
2063}
2064#endif
2065
2066/*
2067 * Read a block of directory entries in a file system independent format.
2068 */
2060int
2061ogetdirentries(p, uap, retval)
2062 struct proc *p;
2063 register struct ogetdirentries_args *uap;
2064 int *retval;
2065{
2066 register struct vnode *vp;
2067 struct file *fp;

--- 78 unchanged lines hidden (view full) ---

2146 *retval = uap->count - auio.uio_resid;
2147 return (error);
2148}
2149#endif
2150
2151/*
2152 * Read a block of directory entries in a file system independent format.
2153 */
2154#ifndef _SYS_SYSPROTO_H_
2069struct getdirentries_args {
2070 int fd;
2071 char *buf;
2072 u_int count;
2073 long *basep;
2074};
2155struct getdirentries_args {
2156 int fd;
2157 char *buf;
2158 u_int count;
2159 long *basep;
2160};
2161#endif
2075int
2076getdirentries(p, uap, retval)
2077 struct proc *p;
2078 register struct getdirentries_args *uap;
2079 int *retval;
2080{
2081 register struct vnode *vp;
2082 struct file *fp;

--- 69 unchanged lines hidden (view full) ---

2152 error = copyout((caddr_t)&loff, (caddr_t)uap->basep, sizeof(long));
2153 *retval = uap->count - auio.uio_resid;
2154 return (error);
2155}
2156
2157/*
2158 * Set the mode mask for creation of filesystem nodes.
2159 */
2162int
2163getdirentries(p, uap, retval)
2164 struct proc *p;
2165 register struct getdirentries_args *uap;
2166 int *retval;
2167{
2168 register struct vnode *vp;
2169 struct file *fp;

--- 69 unchanged lines hidden (view full) ---

2239 error = copyout((caddr_t)&loff, (caddr_t)uap->basep, sizeof(long));
2240 *retval = uap->count - auio.uio_resid;
2241 return (error);
2242}
2243
2244/*
2245 * Set the mode mask for creation of filesystem nodes.
2246 */
2247#ifndef _SYS_SYSPROTO_H_
2160struct umask_args {
2161 int newmask;
2162};
2248struct umask_args {
2249 int newmask;
2250};
2251#endif
2163mode_t /* XXX */
2164umask(p, uap, retval)
2165 struct proc *p;
2166 struct umask_args *uap;
2167 int *retval;
2168{
2169 register struct filedesc *fdp;
2170
2171 fdp = p->p_fd;
2172 *retval = fdp->fd_cmask;
2173 fdp->fd_cmask = uap->newmask & ALLPERMS;
2174 return (0);
2175}
2176
2177/*
2178 * Void all references to file by ripping underlying filesystem
2179 * away from vnode.
2180 */
2252mode_t /* XXX */
2253umask(p, uap, retval)
2254 struct proc *p;
2255 struct umask_args *uap;
2256 int *retval;
2257{
2258 register struct filedesc *fdp;
2259
2260 fdp = p->p_fd;
2261 *retval = fdp->fd_cmask;
2262 fdp->fd_cmask = uap->newmask & ALLPERMS;
2263 return (0);
2264}
2265
2266/*
2267 * Void all references to file by ripping underlying filesystem
2268 * away from vnode.
2269 */
2270#ifndef _SYS_SYSPROTO_H_
2181struct revoke_args {
2182 char *path;
2183};
2271struct revoke_args {
2272 char *path;
2273};
2274#endif
2184/* ARGSUSED */
2185int
2186revoke(p, uap, retval)
2187 struct proc *p;
2188 register struct revoke_args *uap;
2189 int *retval;
2190{
2191 register struct vnode *vp;

--- 45 unchanged lines hidden ---
2275/* ARGSUSED */
2276int
2277revoke(p, uap, retval)
2278 struct proc *p;
2279 register struct revoke_args *uap;
2280 int *retval;
2281{
2282 register struct vnode *vp;

--- 45 unchanged lines hidden ---