caddr_t

Dan Bernstein brnstnd at kramden.acf.nyu.edu
Tue Mar 12 19:10:29 AEST 1991


In article <692 at tndsyd.oz.au> berny at tndsyd.oz.au (Berny Goodheart) writes:
> caddr_t		Byte aligned Virtual memory address.
> daddr_t		Block number of a block device.
> dev_t		Major-Minor device number.
> label_t		Data block for 'setjmp'
> off_t		Byte offset in file.
> paddr_t		Physical memory address
> These and other data types are defined in "types.h" and should only
> be used in kernel code such as device drivers.

Uh, no. On most UNIX systems, st_dev in a struct st has type dev_t, and
you'd better use that if you want portable code. off_t is also used
outside the kernel (for, e.g., lseek()), though I've seen systems where
it doesn't exist. caddr_t is used in many outside libraries.

POSIX defines dev_t, gid_t, ino_t, mode_t, nlink_t, off_t, pid_t, and
uid_t. I wouldn't recommend that you use most of these in portable code.

---Dan



More information about the Comp.unix.programmer mailing list