* Copyright (c) 1982, 1986 Regents of the University of California.
* All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution.
* @(#)vfs_xxx.c 7.3 (Berkeley) %G%
* Oh, how backwards compatibility is ugly!!!
* The old fstat system call.
} *uap
= (struct a
*)u
.u_ap
;
u
.u_error
= getvnode(uap
->fd
, &fp
);
u
.u_error
= ostat1((struct inode
*)fp
->f_data
, uap
->sb
);
* Old stat system call. This version follows links.
register struct vnode
*vp
;
} *uap
= (struct a
*)u
.u_ap
;
register struct nameidata
*ndp
= &u
.u_nd
;
ndp
->ni_nameiop
= LOOKUP
| FOLLOW
;
ndp
->ni_segflg
= UIO_USERSPACE
;
ndp
->ni_dirp
= uap
->fname
;
if (u
.u_error
= namei(ndp
))
ostat1(ndp
->ni_vp
, uap
->sb
);
register struct vnode
*vp
;
error
= VOP_GETATTR(vp
, &vattr
, u
.u_cred
);
ds
.ost_dev
= vattr
.va_fsid
;
ds
.ost_ino
= (short)vattr
.va_fileid
;
ds
.ost_mode
= (u_short
)vattr
.va_mode
;
ds
.ost_nlink
= vattr
.va_nlink
;
ds
.ost_uid
= (short)vattr
.va_uid
;
ds
.ost_gid
= (short)vattr
.va_gid
;
ds
.ost_rdev
= (dev_t
)vattr
.va_rdev
;
ds
.ost_size
= (int)vattr
.va_size
;
ds
.ost_atime
= (int)vattr
.va_atime
.tv_sec
;
ds
.ost_mtime
= (int)vattr
.va_mtime
.tv_sec
;
ds
.ost_ctime
= (int)vattr
.va_atime
.tv_sec
;
return (copyout((caddr_t
)&ds
, (caddr_t
)ub
, sizeof(ds
)));
* Set IUPD and IACC times on file.
} *uap
= (struct a
*)u
.u_ap
;
u
.u_error
= copyin((caddr_t
)uap
->tptr
, (caddr_t
)tv
, sizeof (tv
));
vattr
.va_atime
.tv_sec
= tv
[0];
vattr
.va_atime
.tv_usec
= 0;
vattr
.va_mtime
.tv_sec
= tv
[1];
vattr
.va_mtime
.tv_usec
= 0;
u
.u_error
= namesetattr(uap
->fname
, FOLLOW
, &vattr
);