Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 18 Sep 2008 12:19:50 GMT
From:      Ed Schouten <ed@FreeBSD.org>
To:        Perforce Change Reviews <perforce@FreeBSD.org>
Subject:   PERFORCE change 150003 for review
Message-ID:  <200809181219.m8ICJoLE043623@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=150003

Change 150003 by ed@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);
 }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200809181219.m8ICJoLE043623>