Date: Fri, 8 Jan 2010 23:57:30 +0000 (UTC) From: Ed Schouten <ed@FreeBSD.org> To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r201857 - in user/ed/utmpx: include lib/libc/gen Message-ID: <201001082357.o08NvUoA030995@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: ed Date: Fri Jan 8 23:57:30 2010 New Revision: 201857 URL: http://svn.freebsd.org/changeset/base/201857 Log: Last-minute ABI change. I was thinking: if we use the same layout for struct utmpx as we do for the futx, it is a lot easier to retain ABI compatibility. ut_type is just stored at the beginning of the structure, which means we can always first read the value of ut_type and cast it to an entirely different structure. Modified: user/ed/utmpx/include/utmpx.h user/ed/utmpx/lib/libc/gen/getutxent.3 Modified: user/ed/utmpx/include/utmpx.h ============================================================================== --- user/ed/utmpx/include/utmpx.h Fri Jan 8 23:50:39 2010 (r201856) +++ user/ed/utmpx/include/utmpx.h Fri Jan 8 23:57:30 2010 (r201857) @@ -39,17 +39,17 @@ typedef __pid_t pid_t; #endif struct utmpx { + short ut_type; /* Type of entry. */ + struct timeval ut_tv; /* Time entry was made. */ + char ut_id[8]; /* Record identifier. */ + pid_t ut_pid; /* Process ID. */ char ut_user[32]; /* User login name. */ - char ut_id[8]; /* Process identifier. */ char ut_line[32]; /* Device name. */ #if __BSD_VISIBLE char ut_host[128]; /* Remote hostname. */ #else char __ut_host[128]; #endif - pid_t ut_pid; /* Process ID. */ - short ut_type; /* Type of entry. */ - struct timeval ut_tv; /* Time entry was made. */ }; #define EMPTY 0 /* No valid user accounting information. */ Modified: user/ed/utmpx/lib/libc/gen/getutxent.3 ============================================================================== --- user/ed/utmpx/lib/libc/gen/getutxent.3 Fri Jan 8 23:50:39 2010 (r201856) +++ user/ed/utmpx/lib/libc/gen/getutxent.3 Fri Jan 8 23:57:30 2010 (r201857) @@ -93,13 +93,13 @@ found in the include file .In utmpx.h : .Bd -literal -offset indent struct utmpx { + short ut_type; /* Type of entry. */ + struct timeval ut_tv; /* Time entry was made. */ + char ut_id[]; /* Record identifier. */ + pid_t ut_pid; /* Process ID. */ char ut_user[]; /* User login name. */ - char ut_id[]; /* Process identifier. */ char ut_line[]; /* Device name. */ char ut_host[]; /* Remote hostname. */ - pid_t ut_pid; /* Process ID. */ - short ut_type; /* Type of entry. */ - struct timeval ut_tv; /* Time entry was made. */ }; .Ed .Pp @@ -136,15 +136,9 @@ are not processed by this implementation .Pp Other fields inside the structure are: .Bl -tag -width ut_user -.It Fa ut_user -The user login name corresponding with the login session. -This field is only applicable to entries of type -.Dv USER_PROCESS -and -.Dv INIT_PROCESS . -For -.Dv INIT_PROCESS -entries this entry typically contains the name of the login process. +.It Fa ut_tv +The time the event occured. +This field is used for all types of entries. .It Fa ut_id An identifier that is used to refer to the entry. This identifier can be used to remove or replace a login entry by @@ -156,6 +150,23 @@ This field is only applicable to entries .Dv LOGIN_PROCESS and .Dv DEAD_PROCESS . +.It Fa ut_pid +The process identifier of the session leader of the login session. +This field is only applicable to entries of type +.Dv USER_PROCESS , +.Dv INIT_PROCESS , +.Dv LOGIN_PROCESS +and +.Dv DEAD_PROCESS . +.It Fa ut_user +The user login name corresponding with the login session. +This field is only applicable to entries of type +.Dv USER_PROCESS +and +.Dv INIT_PROCESS . +For +.Dv INIT_PROCESS +entries this entry typically contains the name of the login process. .It Fa ut_line The name of the TTY character device, without the leading .Pa /dev/ @@ -171,17 +182,6 @@ If the user login session is not perform is left blank. This field is only applicable to entries of type .Dv USER_PROCESS . -.It Fa ut_pid -The process identifier of the session leader of the login session. -This field is only applicable to entries of type -.Dv USER_PROCESS , -.Dv INIT_PROCESS , -.Dv LOGIN_PROCESS -and -.Dv DEAD_PROCESS . -.It Fa ut_tv -The time the event occured. -This field is used for all types of entries. .El .Pp This implementation guarantees all inapplicable fields to be discarded.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201001082357.o08NvUoA030995>