svn commit: r194838 - projects/libprocstat/sys/sys

Bruce Evans brde at optusnet.com.au
Wed Jun 24 19:20:46 UTC 2009


On Wed, 24 Jun 2009, John Baldwin wrote:

> On Wednesday 24 June 2009 11:00:45 am Ulf Lilleengen wrote:
>>
>> Log:
>>   - Use the spare fields instead of expanding the struct.
>>   - Use types with known size.
>
> Note that mode_t and dev_t have fixed sizes already and are fine to use, same
> with off_t for the file size.
>
>> From <sys/_types.h>:
>
> typedef	__uint16_t	__mode_t;	/* permissions */
> typedef	__int64_t	__off_t;	/* file offset */
> typedef	__uint32_t	__dev_t;	/* device number */

I don't agree with using fixed-width types, but it would be difficult
to map opaque types and their padding into the int spares.  Only fields
of type int can be mapped properly.  struct kinfo_proc also has long
and pointer spares so that more fields can be mapped properly.

Bruce


More information about the svn-src-projects mailing list