PERFORCE change 150003 for review

Ed Schouten ed at FreeBSD.org
Thu Sep 18 12:19:51 UTC 2008


http://perforce.freebsd.org/chv.cgi?CH=150003

Change 150003 by ed at ed_dull on 2008/09/18 12:19:24

	Just return the [amc]times from the TTY charactr device.

Affected files ...

.. //depot/projects/mpsafetty/sys/kern/tty_pts.c#20 edit

Differences ...

==== //depot/projects/mpsafetty/sys/kern/tty_pts.c#20 (text+ko) ====

@@ -430,6 +430,7 @@
 #ifdef PTS_EXTERNAL
 	struct pts_softc *psc = tty_softc(tp);
 #endif /* PTS_EXTERNAL */
+	struct cdev *dev = tp->t_dev;
 
 	/*
 	 * According to POSIX, we must implement an fstat(). This also
@@ -437,8 +438,7 @@
 	 * because Linux calls fstat() on the pseudo-terminal master to
 	 * obtain st_rdev.
 	 *
-	 * XXX: POSIX also mentions we must fill in st_dev, st_atime,
-	 * st_ctime and st_mtime, but how?
+	 * XXX: POSIX also mentions we must fill in st_dev, but how?
 	 */
 
 	bzero(sb, sizeof *sb);
@@ -448,9 +448,13 @@
 	else
 #endif /* PTS_EXTERNAL */
 		sb->st_ino = sb->st_rdev = tty_udev(tp);
-	sb->st_mode = S_IFCHR;
-	sb->st_uid = tp->t_dev->si_cred->cr_ruid;
-	sb->st_gid = GID_TTY;
+
+	sb->st_atimespec = dev->si_atime;
+	sb->st_ctimespec = dev->si_ctime;
+	sb->st_mtimespec = dev->si_mtime;
+	sb->st_uid = dev->si_uid;
+	sb->st_gid = dev->si_gid;
+	sb->st_mode = dev->si_mode;
 	
 	return (0);
 }


More information about the p4-projects mailing list