]> git.ipfire.org Git - thirdparty/man-pages.git/commitdiff
Consolidate duplicated information about ut_tv and ut_session
authorMichael Kerrisk <mtk.manpages@gmail.com>
Sun, 29 Jun 2008 05:24:03 +0000 (05:24 +0000)
committerMichael Kerrisk <mtk.manpages@gmail.com>
Sun, 29 Jun 2008 05:24:03 +0000 (05:24 +0000)
on biarch platforms.

man5/utmp.5

index bbc56f2f8496c1e7120407428591de5ba7bd0dac..bdc9da9c08ff2d10d640124d2df3f53454f40da6 100644 (file)
@@ -210,34 +210,6 @@ or
 .BR agetty (8)).
 None of these programs creates the file, so if it is
 removed, record-keeping is turned off.
-.PP
-Note that on \fIbiarch\fP platforms, that is, systems which can run both
-32-bit and 64-bit applications (x86-64, ppc64, s390x, etc.),
-\fIut_tv\fP is the same size in 32-bit mode as in 64-bit mode.
-The same goes for \fIut_session\fP and \fIut_time\fP if they are present.
-This allows data files and shared memory to be shared between
-32-bit and 64-bit applications.
-Since \fIut_tv\fP may not be the same as \fIstruct timeval\fP,
-then instead of the call:
-.in +4n
-.nf
-.sp
-gettimeofday((struct timeval *) &ut.ut_tv, NULL);
-.fi
-.in
-
-the following method of setting this field is recommended:
-.in +4n
-.nf
-.sp
-struct utmp ut;
-struct timeval tv;
-
-gettimeofday(&tv, NULL);
-ut.ut_tv.tv_sec = tv.tv_sec;
-ut.ut_tv.tv_usec = tv.tv_usec;
-.fi
-.in
 .SH FILES
 /var/run/utmp
 .br
@@ -284,9 +256,12 @@ binaries using the old libc5 struct will corrupt
 The file format is machine-dependent, so it is recommended that it be
 processed only on the machine architecture where it was created.
 .PP
-Note that on platforms which can run both 32-bit and 64-bit applications
-(x86-64, ppc64, s390x, etc.), the sizes of the fields of a \fIutmp\fP struct
-must be the same in 32-bit mode as in 64-bit mode.
+Note that on \fIbiarch\fP platforms, that is, systems which can run both
+32-bit and 64-bit applications (x86-64, ppc64, s390x, etc.),
+\fIut_tv\fP is the same size in 32-bit mode as in 64-bit mode.
+The same goes for \fIut_session\fP and \fIut_time\fP if they are present.
+This allows data files and shared memory to be shared between
+32-bit and 64-bit applications.
 This is achieved by changing the type of
 .I ut_session
 to
@@ -299,10 +274,27 @@ fields
 .I tv_sec
 and
 .IR tv_usec .
-(Thus, in order to fill it, first get the
-time into a real \fIstruct timeval\fP,
-then copy the two fields to
-.IR ut_tv .)
+Since \fIut_tv\fP may not be the same as \fIstruct timeval\fP,
+then instead of the call:
+.in +4n
+.nf
+.sp
+gettimeofday((struct timeval *) &ut.ut_tv, NULL);
+.fi
+.in
+
+the following method of setting this field is recommended:
+.in +4n
+.nf
+.sp
+struct utmp ut;
+struct timeval tv;
+
+gettimeofday(&tv, NULL);
+ut.ut_tv.tv_sec = tv.tv_sec;
+ut.ut_tv.tv_usec = tv.tv_usec;
+.fi
+.in
 .SH BUGS
 This man page is based on the libc5 one, things may work differently now.
 .SH "SEE ALSO"