* SUCH DAMAGE.
*
* from: @(#)vfs_syscalls.c 7.74 (Berkeley) 6/21/91
- * $Id: vfs_syscalls.c,v 1.6 1993/11/25 01:33:43 wollman Exp $
+ * $Id: vfs_syscalls.c,v 1.9 1994/01/19 20:27:38 guido Exp $
*/
#include "param.h"
#include "uio.h"
#include "malloc.h"
+static int getvnode(struct filedesc *, int, struct file **);
+static int chdirec(struct nameidata *, struct proc *);
+
/*
* Virtual File System System Calls
*/
/*
* Common routine for chroot and chdir.
*/
-int
+static int
chdirec(ndp, p)
struct nameidata *ndp;
struct proc *p;
int error;
struct nameidata nd;
- if (error = copyin((caddr_t)uap->tptr, (caddr_t)tv, sizeof (tv)))
+ VATTR_NULL(&vattr);
+ if ((caddr_t)uap->tptr == NULL) {
+ microtime(&tv[0]);
+ tv[1] = tv[0];
+ vattr.va_vaflags |= VA_UTIMES_NULL;
+ } else if (error = copyin((caddr_t)uap->tptr, (caddr_t)tv, sizeof (tv)))
return (error);
ndp = &nd;
ndp->ni_nameiop = LOOKUP | FOLLOW | LOCKLEAF;
error = EROFS;
goto out;
}
- VATTR_NULL(&vattr);
vattr.va_atime = tv[0];
vattr.va_mtime = tv[1];
error = VOP_SETATTR(vp, &vattr, p->p_ucred, p);
/*
* Convert a user file descriptor to a kernel file entry.
*/
-int
+static int
getvnode(fdp, fdes, fpp)
struct filedesc *fdp;
- struct file **fpp;
int fdes;
+ struct file **fpp;
{
struct file *fp;