# /* Set update and access times on file. */ utime() { register struct inode *ip; int tv[4]; if ((ip = owner()) == NULL) return; if (copyin(u.u_arg[1], &tv[0], sizeof(tv))) { u.u_error = EFAULT; return; } ip->i_flag =| (IACC|IUPD); iupdat7(ip, &tv[0], &tv[2]); ip->i_flag =& ~(IACC|IUPD); iput(ip); } /* V7 form, with the additional 'access time' argument. */ iupdat7(p, ta, tm) int *p; int *ta; int *tm; { register *ip1, *ip2, *rp; int *bp, i; rp = p; if((rp->i_flag&(IUPD|IACC)) != 0) { if(getfs(rp->i_dev)->s_ronly) return; i = rp->i_number+31; bp = bread(rp->i_dev, ldiv(i,16)); ip1 = bp->b_addr + 32*lrem(i, 16); ip2 = &rp->i_mode; while(ip2 < &rp->i_addr[8]) *ip1++ = *ip2++; if(rp->i_flag&IACC) { *ip1++ = *ta++; *ip1++ = *ta; } else ip1 =+ 2; if(rp->i_flag&IUPD) { *ip1++ = *tm++; *ip1++ = *tm; } bwrite(bp); } }