Module Name: src Committed By: wiz Date: Sat Feb 27 22:04:38 UTC 2010
Modified Files: src/distrib/sets/lists/comp: mi src/share/man/man3: Makefile Added Files: src/share/man/man3: offsetof.3 Log Message: Add offsetof(3) man page. From Thomas Pfaff via OpenBSD. To generate a diff of this commit: cvs rdiff -u -r1.1394 -r1.1395 src/distrib/sets/lists/comp/mi cvs rdiff -u -r1.35 -r1.36 src/share/man/man3/Makefile cvs rdiff -u -r0 -r1.1 src/share/man/man3/offsetof.3 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.1394 src/distrib/sets/lists/comp/mi:1.1395 --- src/distrib/sets/lists/comp/mi:1.1394 Sun Feb 21 03:18:46 2010 +++ src/distrib/sets/lists/comp/mi Sat Feb 27 22:04:37 2010 @@ -1,4 +1,4 @@ -# $NetBSD: mi,v 1.1394 2010/02/21 03:18:46 darran Exp $ +# $NetBSD: mi,v 1.1395 2010/02/27 22:04:37 wiz Exp $ # # Note: don't delete entries from here - mark them as "obsolete" instead. # @@ -7161,6 +7161,7 @@ ./usr/share/man/cat3/ntohl.0 comp-c-catman .cat ./usr/share/man/cat3/ntohs.0 comp-c-catman .cat ./usr/share/man/cat3/offtime.0 comp-c-catman .cat +./usr/share/man/cat3/offsetof.0 comp-c-catman .cat ./usr/share/man/cat3/opendir.0 comp-c-catman .cat ./usr/share/man/cat3/opendisk.0 comp-c-catman .cat ./usr/share/man/cat3/openlog.0 comp-c-catman .cat @@ -12874,6 +12875,7 @@ ./usr/share/man/html3/ntohl.html comp-c-htmlman html ./usr/share/man/html3/ntohs.html comp-c-htmlman html ./usr/share/man/html3/offtime.html comp-c-htmlman html +./usr/share/man/html3/offsetof.html comp-c-htmlman html ./usr/share/man/html3/opendir.html comp-c-htmlman html ./usr/share/man/html3/opendisk.html comp-c-htmlman html ./usr/share/man/html3/openlog.html comp-c-htmlman html @@ -18581,6 +18583,7 @@ ./usr/share/man/man3/ntohl.3 comp-c-man .man ./usr/share/man/man3/ntohs.3 comp-c-man .man ./usr/share/man/man3/offtime.3 comp-c-man .man +./usr/share/man/man3/offsetof.3 comp-c-man .man ./usr/share/man/man3/opendir.3 comp-c-man .man ./usr/share/man/man3/opendisk.3 comp-c-man .man ./usr/share/man/man3/openlog.3 comp-c-man .man Index: src/share/man/man3/Makefile diff -u src/share/man/man3/Makefile:1.35 src/share/man/man3/Makefile:1.36 --- src/share/man/man3/Makefile:1.35 Sun Jan 24 22:21:34 2010 +++ src/share/man/man3/Makefile Sat Feb 27 22:04:38 2010 @@ -1,8 +1,10 @@ -# $NetBSD: Makefile,v 1.35 2010/01/24 22:21:34 njoly Exp $ +# $NetBSD: Makefile,v 1.36 2010/02/27 22:04:38 wiz Exp $ # @(#)Makefile 8.2 (Berkeley) 12/13/93 -MAN= _DIAGASSERT.3 CMSG_DATA.3 assert.3 bits.3 bitstring.3 dlfcn.3 end.3 \ - gcq.3 intro.3 queue.3 stdarg.3 sysexits.3 timeradd.3 tree.3 varargs.3 +MAN= _DIAGASSERT.3 CMSG_DATA.3 \ + assert.3 bits.3 bitstring.3 dlfcn.3 end.3 \ + gcq.3 intro.3 offsetof.3 queue.3 stdarg.3 sysexits.3 \ + timeradd.3 tree.3 varargs.3 USETBL= # used by queue.3 Added files: Index: src/share/man/man3/offsetof.3 diff -u /dev/null src/share/man/man3/offsetof.3:1.1 --- /dev/null Sat Feb 27 22:04:38 2010 +++ src/share/man/man3/offsetof.3 Sat Feb 27 22:04:38 2010 @@ -0,0 +1,48 @@ +.\" $NetBSD: offsetof.3,v 1.1 2010/02/27 22:04:38 wiz Exp $ +.\" +.\" $OpenBSD: offsetof.3,v 1.2 2010/02/18 18:30:19 jmc Exp $ +.\" +.\" Copyright (c) 2010 Thomas Pfaff <tpf...@tp76.info> +.\" +.\" Permission to use, copy, modify, and distribute this software for any +.\" purpose with or without fee is hereby granted, provided that the above +.\" copyright notice and this permission notice appear in all copies. +.\" +.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +.\" +.\" +.Dd February 18, 2010 +.Dt OFFSETOF 3 +.Os +.Sh NAME +.Nm offsetof +.Nd offset of a structure member +.Sh SYNOPSIS +.In stddef.h +.Ft size_t +.Fn offsetof "type" "member" +.Sh DESCRIPTION +The +.Fn offsetof +macro expands to an integer constant expression of type +.Ft size_t +and yields the offset, +in bytes, of the field +.Ar member +from the start of the structure +.Ar type . +.Pp +A compiler error will result if +.Ar member +is not aligned to a byte boundary (i.e. it is a bit-field). +.Sh STANDARDS +The +.Fn offsetof +macro conforms to +.St -ansiC .