Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 09 Jul 1999 22:14:10 +0200
From:      "D. Rock" <rock@dead-end.net>
To:        current@freebsd.org
Subject:   dev_t and system accounting
Message-ID:  <37865812.DC1A235C@dead-end.net>

next in thread | raw e-mail | index | archive | help
Hi,

the new dev_t stuff in the kernel keeps system accounting showing up
the tty properly. After taking a look at the fix for the swap device,
I propose the following equivalent fix:

Index: kern/kern_acct.c
===================================================================
RCS file: /data/cvs/src/sys/kern/kern_acct.c,v
retrieving revision 1.20
diff -u -r1.20 kern_acct.c
--- kern_acct.c	1999/04/27 11:15:53	1.20
+++ kern_acct.c	1999/07/09 19:57:38
@@ -221,7 +221,7 @@
 
 	/* (7) The terminal from which the process was started */
 	if ((p->p_flag & P_CONTROLT) && p->p_pgrp->pg_session->s_ttyp)
-		acct.ac_tty = p->p_pgrp->pg_session->s_ttyp->t_dev;
+		acct.ac_tty = dev2udev(p->p_pgrp->pg_session->s_ttyp->t_dev);
 	else
- 		acct.ac_tty = NODEV;
+ 		acct.ac_tty = dev2udev(NODEV);

Index: sys/acct.h
===================================================================
RCS file: /data/cvs/src/sys/sys/acct.h,v
retrieving revision 1.9
diff -u -r1.9 acct.h
--- acct.h	1998/02/01 20:08:35	1.9
+++ acct.h	1999/07/09 19:57:15
@@ -60,7 +60,7 @@
 	gid_t	  ac_gid;		/* group id */
 	u_int16_t ac_mem;		/* average memory usage */
 	comp_t	  ac_io;		/* count of IO blocks */
-	dev_t	  ac_tty;		/* controlling tty */
+	udev_t	  ac_tty;		/* controlling tty */
 
 #define	AFORK	0x01			/* forked but not exec'ed */
 #define	ASU	0x02			/* used super-user permissions */


Daniel


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




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