Module Name:    src
Committed By:   jruoho
Date:           Thu Apr 22 06:48:29 UTC 2010

Modified Files:
        src/distrib/sets/lists/comp: mi
        src/distrib/sets/lists/man: mi
        src/share/man/man3: Makefile
        src/share/man/man5: Makefile
Added Files:
        src/share/man/man3: types.3
Removed Files:
        src/share/man/man5: types.5

Log Message:
Rewrite types(5) as per perry@'s suggestion from few years back ("XXX this
document is rather musty. It needs a general update."). Also move it to the
right section from section 5. Ok w...@.

To minimize maintenance costs, the content is mostly jargon around The
Standard. Only few NetBSD-specific types are mentioned as an example.


To generate a diff of this commit:
cvs rdiff -u -r1.1434 -r1.1435 src/distrib/sets/lists/comp/mi
cvs rdiff -u -r1.1203 -r1.1204 src/distrib/sets/lists/man/mi
cvs rdiff -u -r1.48 -r1.49 src/share/man/man3/Makefile
cvs rdiff -u -r0 -r1.1 src/share/man/man3/types.3
cvs rdiff -u -r1.62 -r1.63 src/share/man/man5/Makefile
cvs rdiff -u -r1.13 -r0 src/share/man/man5/types.5

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/distrib/sets/lists/comp/mi
diff -u src/distrib/sets/lists/comp/mi:1.1434 src/distrib/sets/lists/comp/mi:1.1435
--- src/distrib/sets/lists/comp/mi:1.1434	Wed Apr 21 18:04:38 2010
+++ src/distrib/sets/lists/comp/mi	Thu Apr 22 06:48:28 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: mi,v 1.1434 2010/04/21 18:04:38 jruoho Exp $
+#	$NetBSD: mi,v 1.1435 2010/04/22 06:48:28 jruoho Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -8219,6 +8219,7 @@
 ./usr/share/man/cat3/ttyslot.0			comp-c-catman		.cat
 ./usr/share/man/cat3/ttyunlock.0		comp-c-catman		.cat
 ./usr/share/man/cat3/twalk.0			comp-c-catman		.cat
+./usr/share/man/cat3/types.0			comp-c-catman		.cat
 ./usr/share/man/cat3/tzset.0			comp-c-catman		.cat
 ./usr/share/man/cat3/tzsetwall.0		comp-c-catman		.cat
 ./usr/share/man/cat3/ualarm.0			comp-c-catman		.cat
@@ -13946,6 +13947,7 @@
 ./usr/share/man/html3/ttyslot.html		comp-c-htmlman		html
 ./usr/share/man/html3/ttyunlock.html		comp-c-htmlman		html
 ./usr/share/man/html3/twalk.html		comp-c-htmlman		html
+./usr/share/man/html3/types.html		comp-c-htmlman		html
 ./usr/share/man/html3/tzset.html		comp-c-htmlman		html
 ./usr/share/man/html3/tzsetwall.html		comp-c-htmlman		html
 ./usr/share/man/html3/ualarm.html		comp-c-htmlman		html
@@ -19743,6 +19745,7 @@
 ./usr/share/man/man3/ttyslot.3			comp-c-man		.man
 ./usr/share/man/man3/ttyunlock.3		comp-c-man		.man
 ./usr/share/man/man3/twalk.3			comp-c-man		.man
+./usr/share/man/man3/types.3			comp-c-man		.man
 ./usr/share/man/man3/tzset.3			comp-c-man		.man
 ./usr/share/man/man3/tzsetwall.3		comp-c-man		.man
 ./usr/share/man/man3/ualarm.3			comp-c-man		.man

Index: src/distrib/sets/lists/man/mi
diff -u src/distrib/sets/lists/man/mi:1.1203 src/distrib/sets/lists/man/mi:1.1204
--- src/distrib/sets/lists/man/mi:1.1203	Sat Apr 10 20:52:14 2010
+++ src/distrib/sets/lists/man/mi	Thu Apr 22 06:48:28 2010
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1203 2010/04/10 20:52:14 pooka Exp $
+# $NetBSD: mi,v 1.1204 2010/04/22 06:48:28 jruoho Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -1896,7 +1896,7 @@
 ./usr/share/man/cat5/transport.0		man-postfix-catman	postfix,.cat
 ./usr/share/man/cat5/ttyaction.0		man-sys-catman		.cat
 ./usr/share/man/cat5/ttys.0			man-sys-catman		.cat
-./usr/share/man/cat5/types.0			man-c-catman		.cat
+./usr/share/man/cat5/types.0			man-obsolete		obsolete
 ./usr/share/man/cat5/tzfile.0			man-sys-catman		.cat
 ./usr/share/man/cat5/ucontext.0			man-obsolete		obsolete
 ./usr/share/man/cat5/usermgmt.conf.0		man-sys-catman		.cat
@@ -4456,7 +4456,7 @@
 ./usr/share/man/html5/transport.html		man-postfix-htmlman	postfix,html
 ./usr/share/man/html5/ttyaction.html		man-sys-htmlman		html
 ./usr/share/man/html5/ttys.html			man-sys-htmlman		html
-./usr/share/man/html5/types.html		man-c-htmlman		html
+./usr/share/man/html5/types.html		man-obsolete		obsolete
 ./usr/share/man/html5/tzfile.html		man-sys-htmlman		html
 ./usr/share/man/html5/usermgmt.conf.html	man-sys-htmlman		html
 ./usr/share/man/html5/utmp.html			man-sys-htmlman		html
@@ -6986,7 +6986,7 @@
 ./usr/share/man/man5/transport.5		man-postfix-man		postfix,.man
 ./usr/share/man/man5/ttyaction.5		man-sys-man		.man
 ./usr/share/man/man5/ttys.5			man-sys-man		.man
-./usr/share/man/man5/types.5			man-c-man		.man
+./usr/share/man/man5/types.5			man-obsolete		obsolete
 ./usr/share/man/man5/tzfile.5			man-sys-man		.man
 ./usr/share/man/man5/ucontext.5			man-obsolete		obsolete
 ./usr/share/man/man5/usermgmt.conf.5		man-sys-man		.man

Index: src/share/man/man3/Makefile
diff -u src/share/man/man3/Makefile:1.48 src/share/man/man3/Makefile:1.49
--- src/share/man/man3/Makefile:1.48	Wed Apr 21 18:04:38 2010
+++ src/share/man/man3/Makefile	Thu Apr 22 06:48:29 2010
@@ -1,11 +1,11 @@
-#	$NetBSD: Makefile,v 1.48 2010/04/21 18:04:38 jruoho Exp $
+#	$NetBSD: Makefile,v 1.49 2010/04/22 06:48:29 jruoho Exp $
 #	@(#)Makefile	8.2 (Berkeley) 12/13/93
 
 MAN=	_DIAGASSERT.3 __CONCAT.3 __UNCONST.3 CMSG_DATA.3 \
 	__arraycount.3 assert.3 bits.3 bitstring.3 dlfcn.3 end.3 \
 	fast_divide32.3 gcq.3 intro.3 inttypes.3 iso646.3 offsetof.3 queue.3 \
 	rb.3 stdarg.3 stdbool.3 stddef.3 stdint.3 stdlib.3 sysexits.3 \
-	tgmath.3 timeradd.3 tree.3 varargs.3
+	tgmath.3 timeradd.3 tree.3 types.3 varargs.3
 
 USETBL=	# used by queue.3
 

Index: src/share/man/man5/Makefile
diff -u src/share/man/man5/Makefile:1.62 src/share/man/man5/Makefile:1.63
--- src/share/man/man5/Makefile:1.62	Sat Jul 25 16:20:11 2009
+++ src/share/man/man5/Makefile	Thu Apr 22 06:48:28 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.62 2009/07/25 16:20:11 mbalmer Exp $
+#	$NetBSD: Makefile,v 1.63 2010/04/22 06:48:28 jruoho Exp $
 #	@(#)Makefile	8.1 (Berkeley) 6/5/93
 
 # missing: dump.5 plot.5
@@ -15,7 +15,7 @@
 	printcap.5 protocols.5 ranlib.5 rc.conf.5 remote.5 \
 	resolv.conf.5 route.conf.5 rpc.5 \
 	security.conf.5 services.5 shells.5 \
-	stab.5 statvfs.5 sysctl.conf.5 ttyaction.5 types.5 \
+	stab.5 statvfs.5 sysctl.conf.5 ttyaction.5 \
 	utmp.5 utmpx.5 veriexec.5 weekly.conf.5 wscons.conf.5
 
 MLINKS=	dir.5 dirent.5 fs.5 inode.5 hosts.equiv.5 rhosts.5

Added files:

Index: src/share/man/man3/types.3
diff -u /dev/null src/share/man/man3/types.3:1.1
--- /dev/null	Thu Apr 22 06:48:29 2010
+++ src/share/man/man3/types.3	Thu Apr 22 06:48:29 2010
@@ -0,0 +1,222 @@
+.\"	$NetBSD: types.3,v 1.1 2010/04/22 06:48:29 jruoho Exp $
+.\"
+.\" Copyright (c) 2010 The NetBSD Foundation, Inc.
+.\" All rights reserved.
+.\"
+.\" This code is derived from software contributed to The NetBSD Foundation
+.\" by Jukka Ruohonen.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"    notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"    notice, this list of conditions and the following disclaimer in the
+.\"    documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+.\" POSSIBILITY OF SUCH DAMAGE.
+.\"
+.\" Copyright (c) 1980, 1991, 1993
+.\"	The Regents of the University of California.  All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"    notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"    notice, this list of conditions and the following disclaimer in the
+.\"    documentation and/or other materials provided with the distribution.
+.\" 3. Neither the name of the University nor the names of its contributors
+.\"    may be used to endorse or promote products derived from this software
+.\"    without specific prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"     @(#)types.5	8.1 (Berkeley) 6/5/93
+.\"
+.Dd March 22, 2010
+.Dt TYPES 3
+.Os
+.Sh NAME
+.Nm types
+.Nd standard system data types
+.Sh SYNOPSIS
+.In sys/types.h
+.Sh DESCRIPTION
+The
+.In sys/types.h
+header contains the common data types used in the system.
+Although these are meant to be used within the kernel,
+most of the system data types are accessible also to user code.
+A companion header
+.In sys/param.h ,
+typically used in the kernel,
+includes
+.In sys/types.h
+and provides additional types as well as other facilities.
+.Ss Standard Types
+The following standards-compliant data types are defined:
+.Pp
+.Bl -column -offset indent \
+"suseconds_t " "file system block counts " "clock_settime(3) "
+.It Sy Type Ta Sy Typical use Ta Sy Example
+.It Va blkcnt_t Ta file block counts Ta Xr stat 2
+.It Va blksize_t Ta block sizes Ta Xr stat 2
+.It Va clock_t Ta system clock ticks Ta Xr clock 3
+.It Va clockid_t Ta clock IDs Ta Xr clock_settime 2
+.It Va dev_t Ta device IDs Ta Xr devname 3
+.It Va fsblkcnt_t Ta file system block counts Ta -
+.It Va fsfilcnt_t Ta file system file counts Ta -
+.It Va gid_t Ta group IDs Ta Xr getgid 2
+.It Va id_t Ta general identifier Ta Xr pset 3
+.It Va ino_t Ta file serial numbers Ta Xr fs 5
+.It Va key_t Ta interprocess communication Ta Xr ftok 3
+.It Va mode_t Ta file attributes Ta Xr stat 2
+.It Va nlink_t Ta link counts Ta Xr stat 2
+.It Va off_t Ta file sizes Ta Xr fseek 3
+.It Va pid_t Ta process and group IDs Ta Xr getpid 2
+.It Va size_t Ta size of objects Ta Xr stddef 3
+.It Va ssize_t Ta a count of bytes Ta Xr write 2
+.It Va suseconds_t Ta microseconds Ta Xr gettimeofday 2
+.It Va time_t Ta time in seconds Ta Xr time 3
+.It Va timer_t Ta timer IDs Ta Xr timer_create 2
+.\"
+.\" XXX: Following are undefined in NetBSD at the time of writing:
+.\"
+.\".It Va trace_attr_t Ta trace stream attributes Ta -
+.\".It Va trace_event_id_t Ta trace event type Ta -
+.\".It Va trace_event_set_t Ta trace event type set Ta -
+.\".It Va trace_id_t Ta trace stream ID Ta -
+.It Va uid_t Ta user IDs Ta Xr setuid 2
+.It Va useconds_t Ta time in microseconds Ta Xr usleep 3
+.El
+.Pp
+In addition, when included in user applications,
+.In sys/types.h
+includes
+.In pthread.h ,
+and thus it defines also the types used in the
+.Tn POSIX
+Threads Library,
+.Xr pthread 3 .
+.Pp
+Each described type may vary across machines and operating systems.
+Only the following properties are guaranteed by the
+.St -p1003.1-2001
+standard:
+.Bl -enum -offset indent
+.It
+The type
+.Em ssize_t
+is capable of storing integer values at least in the range [ -1,
+.Dv SSIZE_MAX
+].
+.It
+The type
+.Em useconds_t
+is an unsigned integer capable of storing
+values at least in the range [ 0, 1000000 ].
+.It
+The type
+.Em suseconds_t
+is a signed integer capable of storing
+values at least in the range [ -1, 1000000 ].
+.It
+The
+.Em time_t
+and
+.Em clock_t
+types are either integers or real-floating types.
+.It
+The following types are integers:
+.Em gid_t ,
+.Em id_t ,
+.Em mode_t ,
+.Em nlink_t ,
+and
+.Em uid_t .
+.It
+The following types are signed integers:
+.Em blkcnt_t ,
+.Em blksize_t ,
+.Em off_t ,
+.Em pid_t ,
+and
+.Em ssize_t .
+.It
+The following types are unsigned integers:
+.Em fsblkcnt_t ,
+.Em fsfilcnt_t ,
+.Em ino_t ,
+and
+.Em size_t .
+.El
+.Sh NetBSD-specific Types
+In addition to the standard types, the
+.In sys/types.h
+defines some data types specific to
+.Nx .
+These are mostly used in the kernel.
+A portable implementation should not rely
+on these types to be available in other systems.
+Examples include:
+.Bl -column -offset indent \
+"suseconds_t " "file system block counts " "clock_settime(3) "
+.It Sy Type Ta Sy Typical use Ta Sy Example
+.It Va cpuid_t Ta CPU ID Ta Xr cpuset 3
+.It Va daddr_t Ta disk address Ta Xr buffercache 9
+.It Va devmajor_t Ta major device number Ta Xr getdevmajor 3
+.It Va lwp_t Ta typedef of Va struct lwp Ta Xr kthread 9
+.It Va u_quad_t Ta synonym for Va uint64_t Ta Xr strtouq 3
+.El
+.Pp
+It can be noted that the standard
+.Dq C99 types
+described in
+.Xr stdint 3
+are preferred to the older fixed size integer types prefixed with an
+.Dq u_
+(in another words,
+.Va uint32_t
+should be used instead of
+.Va u_int32_t ) .
+.Sh SEE ALSO
+.Xr stdbool 3 ,
+.Xr stddef 3 ,
+.Xr stdint 3 ,
+.Xr stdlib 3
+.Sh STANDARDS
+The
+.In sys/types.h
+header conforms to
+.St -p1003.1-2001
+with respect to the described standard types.
+.Sh HISTORY
+The
+.In sys/types.h
+header first appeared in
+.At v7 .
+In the current form the header appeared in
+.Nx 0.9 .

Reply via email to