11.3. Data Definitions for libc

This section defines global identifiers and their values that are associated with interfaces contained in libc. These definitions are organized into groups that correspond to system headers. This convention is used as a convenience for the reader, and does not imply the existence of these headers, or their content. Where an interface is defined as requiring a particular system header file all of the data definitions for that system header file presented here shall be in effect.

This section gives data definitions to promote binary application portability, not to repeat source interface definitions available elsewhere. System providers and application developers should use this ABI to supplement - not to replace - source interface definition specifications.

This specification uses the ISO C (1999) C Language as the reference programming language, and data definitions are specified in ISO C format. The C language is used here as a convenient notation. Using a C language description of these data objects does not preclude their use by other programming languages.

11.3.1. ctype.h


enum {
    _ISupper = 1,
    _ISlower = 2,
    _ISalpha = 4,
    _ISdigit = 8,
    _ISxdigit = 16,
    _ISspace = 32,
    _ISprint = 64,
    _ISgraph = 128,
    _ISblank = 256,
    _IScntrl = 512,
    _ISpunct = 1024,
    _ISalnum = 2048
};

11.3.2. dirent.h


/*
 * This header is architecture neutral
 * Please refer to the generic specification for details
 */

11.3.3. errno.h


#define EDEADLOCK	58

11.3.4. fcntl.h


#define O_LARGEFILE	0200000

#define F_GETLK64	12
#define F_SETLK64	13
#define F_SETLKW64	14

11.3.5. fnmatch.h


/*
 * This header is architecture neutral
 * Please refer to the generic specification for details
 */

11.3.6. ftw.h


/*
 * This header is architecture neutral
 * Please refer to the generic specification for details
 */

11.3.7. getopt.h


/*
 * This header is architecture neutral
 * Please refer to the generic specification for details
 */

11.3.8. glob.h


/*
 * This header is architecture neutral
 * Please refer to the generic specification for details
 */

11.3.9. iconv.h


/*
 * This header is architecture neutral
 * Please refer to the generic specification for details
 */

11.3.10. langinfo.h


/*
 * This header is architecture neutral
 * Please refer to the generic specification for details
 */

11.3.11. limits.h


#define ULONG_MAX	0xFFFFFFFFFFFFFFFFUL
#define LONG_MAX	9223372036854775807L

#define CHAR_MIN	0
#define CHAR_MAX	255

#define PTHREAD_STACK_MIN	16384

11.3.12. locale.h


/*
 * This header is architecture neutral
 * Please refer to the generic specification for details
 */

11.3.13. net/if.h


/*
 * This header is architecture neutral
 * Please refer to the generic specification for details
 */

11.3.14. netdb.h


/*
 * This header is architecture neutral
 * Please refer to the generic specification for details
 */

11.3.15. netinet/in.h


/*
 * This header is architecture neutral
 * Please refer to the generic specification for details
 */

11.3.16. netinet/ip.h


/*
 * This header is architecture neutral
 * Please refer to the generic specification for details
 */

11.3.17. netinet/tcp.h


/*
 * This header is architecture neutral
 * Please refer to the generic specification for details
 */

11.3.18. netinet/udp.h


/*
 * This header is architecture neutral
 * Please refer to the generic specification for details
 */

11.3.19. nl_types.h


/*
 * This header is architecture neutral
 * Please refer to the generic specification for details
 */

11.3.20. pwd.h


/*
 * This header is architecture neutral
 * Please refer to the generic specification for details
 */

11.3.21. regex.h


/*
 * This header is architecture neutral
 * Please refer to the generic specification for details
 */

11.3.22. rpc/auth.h


/*
 * This header is architecture neutral
 * Please refer to the generic specification for details
 */

11.3.23. rpc/clnt.h


/*
 * This header is architecture neutral
 * Please refer to the generic specification for details
 */

11.3.24. rpc/rpc_msg.h


/*
 * This header is architecture neutral
 * Please refer to the generic specification for details
 */

11.3.25. rpc/svc.h


/*
 * This header is architecture neutral
 * Please refer to the generic specification for details
 */

11.3.26. rpc/types.h


/*
 * This header is architecture neutral
 * Please refer to the generic specification for details
 */

11.3.27. rpc/xdr.h


/*
 * This header is architecture neutral
 * Please refer to the generic specification for details
 */

11.3.28. sched.h


/*
 * This header is architecture neutral
 * Please refer to the generic specification for details
 */

11.3.29. search.h


/*
 * This header is architecture neutral
 * Please refer to the generic specification for details
 */

11.3.30. setjmp.h


typedef long int __jmp_buf[64] __attribute__ ((aligned(16)));

11.3.31. signal.h


struct pt_regs {
    unsigned long int gpr[32];
    unsigned long int nip;
    unsigned long int msr;
    unsigned long int orig_gpr3;
    unsigned long int ctr;
    unsigned long int link;
    unsigned long int xer;
    unsigned long int ccr;
    unsigned long int softe;
    unsigned long int trap;
    unsigned long int dar;
    unsigned long int dsisr;
    unsigned long int result;
};

#define SIGEV_PAD_SIZE	((SIGEV_MAX_SIZE/sizeof(int))-4)

#define SI_PAD_SIZE	((SI_MAX_SIZE/sizeof(int))-4)

struct sigaction {
    union {
	sighandler_t _sa_handler;
	void (*_sa_sigaction) (int, siginfo_t *, void *);
    } __sigaction_handler;
    sigset_t sa_mask;
    int sa_flags;
    void (*sa_restorer) (void);
};

#define MINSIGSTKSZ	2048
#define SIGSTKSZ	8192

struct sigcontext {
    unsigned long int _unused[4];
    int signal;
    unsigned long int handler;
    unsigned long int oldmask;
    struct pt_regs *regs;
    unsigned long int gp_regs[48];
    double fp_regs[33];
};

11.3.32. spawn.h


/*
 * This header is architecture neutral
 * Please refer to the generic specification for details
 */

11.3.33. stddef.h


typedef int wchar_t;
typedef unsigned long int size_t;
typedef long int ptrdiff_t;

11.3.34. stdint.h


#define INT64_C(c)	c ## L
#define INTMAX_C(c)	c ## L
#define __INT64_C(c)	c ## L
#define UINT64_C(c)	c ## UL
#define UINTMAX_C(c)	c ## UL
#define __UINT64_C(c)	c ## UL

#define INTPTR_MIN	(-9223372036854775807L-1)
#define INT_FAST16_MIN	(-9223372036854775807L-1)
#define INT_FAST32_MIN	(-9223372036854775807L-1)
#define PTRDIFF_MIN	(-9223372036854775807L-1)
#define SIZE_MAX	(18446744073709551615UL)
#define UINTPTR_MAX	(18446744073709551615UL)
#define UINT_FAST16_MAX	(18446744073709551615UL)
#define UINT_FAST32_MAX	(18446744073709551615UL)
#define INTPTR_MAX	(9223372036854775807L)
#define INT_FAST16_MAX	(9223372036854775807L)
#define INT_FAST32_MAX	(9223372036854775807L)
#define PTRDIFF_MAX	(9223372036854775807L)

typedef long int int64_t;
typedef long int intmax_t;
typedef unsigned long int uintmax_t;
typedef long int intptr_t;
typedef unsigned long int uintptr_t;
typedef unsigned long int uint64_t;
typedef long int int_least64_t;
typedef unsigned long int uint_least64_t;
typedef long int int_fast16_t;
typedef long int int_fast32_t;
typedef long int int_fast64_t;
typedef unsigned long int uint_fast16_t;
typedef unsigned long int uint_fast32_t;
typedef unsigned long int uint_fast64_t;

11.3.35. stdio.h


#define __IO_FILE_SIZE	216

11.3.36. stdlib.h


/*
 * This header is architecture neutral
 * Please refer to the generic specification for details
 */

11.3.37. sys/file.h


/*
 * This header is architecture neutral
 * Please refer to the generic specification for details
 */

11.3.38. sys/ioctl.h


#define TIOCGWINSZ	0x40087468
#define FIONREAD	1074030207
#define TIOCNOTTY	21538

11.3.39. sys/ipc.h


struct ipc_perm {
    key_t __key;
    uid_t uid;
    gid_t gid;
    uid_t cuid;
    gid_t cgid;
    mode_t mode;
    unsigned int __seq;
    unsigned int __pad1;
    unsigned long int __unused1;
    unsigned long int __unused2;
};

11.3.40. sys/mman.h


#define MCL_FUTURE	16384
#define MCL_CURRENT	8192

11.3.41. sys/msg.h


typedef unsigned long int msgqnum_t;
typedef unsigned long int msglen_t;

struct msqid_ds {
    struct ipc_perm msg_perm;
    time_t msg_stime;
    time_t msg_rtime;
    time_t msg_ctime;
    unsigned long int __msg_cbytes;
    msgqnum_t msg_qnum;
    msglen_t msg_qbytes;
    pid_t msg_lspid;
    pid_t msg_lrpid;
    unsigned long int __unused4;
    unsigned long int __unused5;
};

11.3.42. sys/param.h


/*
 * This header is architecture neutral
 * Please refer to the generic specification for details
 */

11.3.43. sys/poll.h


/*
 * This header is architecture neutral
 * Please refer to the generic specification for details
 */

11.3.44. sys/resource.h


/*
 * This header is architecture neutral
 * Please refer to the generic specification for details
 */

11.3.45. sys/sem.h


struct semid_ds {
    struct ipc_perm sem_perm;
    time_t sem_otime;
    time_t sem_ctime;
    unsigned long int sem_nsems;
    unsigned long int __unused3;
    unsigned long int __unused4;
};

11.3.46. sys/shm.h


#define SHMLBA	(__getpagesize())

typedef unsigned long int shmatt_t;

struct shmid_ds {
    struct ipc_perm shm_perm;
    time_t shm_atime;
    time_t shm_dtime;
    time_t shm_ctime;
    size_t shm_segsz;
    pid_t shm_cpid;
    pid_t shm_lpid;
    shmatt_t shm_nattch;
    unsigned long int __unused5;
    unsigned long int __unused6;
};

11.3.47. sys/socket.h


typedef uint64_t __ss_aligntype;

#define SO_RCVLOWAT	16
#define SO_SNDLOWAT	17
#define SO_RCVTIMEO	18
#define SO_SNDTIMEO	19

11.3.48. sys/stat.h


#define _STAT_VER	1

struct stat {
    dev_t st_dev;
    ino_t st_ino;
    nlink_t st_nlink;
    mode_t st_mode;
    uid_t st_uid;
    gid_t st_gid;
    int __pad2;
    dev_t st_rdev;
    off_t st_size;
    blksize_t st_blksize;
    blkcnt_t st_blocks;
    struct timespec st_atim;
    struct timespec st_mtim;
    struct timespec st_ctim;
    unsigned long int __unused4;
    unsigned long int __unused5;
    unsigned long int __unused6;
};
struct stat64 {
    dev_t st_dev;
    ino64_t st_ino;
    nlink_t st_nlink;
    mode_t st_mode;
    uid_t st_uid;
    gid_t st_gid;
    int __pad2;
    dev_t st_rdev;
    off64_t st_size;
    blksize_t st_blksize;
    blkcnt64_t st_blocks;
    struct timespec st_atim;
    struct timespec st_mtim;
    struct timespec st_ctim;
    unsigned long int __unused4;
    unsigned long int __unused5;
    unsigned long int __unused6;
};

11.3.49. sys/statfs.h


struct statfs {
    long int f_type;
    long int f_bsize;
    fsblkcnt_t f_blocks;
    fsblkcnt_t f_bfree;
    fsblkcnt_t f_bavail;
    fsfilcnt_t f_files;
    fsfilcnt_t f_ffree;
    fsid_t f_fsid;
    long int f_namelen;
    long int f_frsize;
    long int f_spare[5];
};
struct statfs64 {
    long int f_type;
    long int f_bsize;
    fsblkcnt64_t f_blocks;
    fsblkcnt64_t f_bfree;
    fsblkcnt64_t f_bavail;
    fsfilcnt64_t f_files;
    fsfilcnt64_t f_ffree;
    fsid_t f_fsid;
    long int f_namelen;
    long int f_frsize;
    long int f_spare[5];
};

11.3.50. sys/statvfs.h


struct statvfs {
    unsigned long int f_bsize;
    unsigned long int f_frsize;
    fsblkcnt_t f_blocks;
    fsblkcnt_t f_bfree;
    fsblkcnt_t f_bavail;
    fsfilcnt_t f_files;
    fsfilcnt_t f_ffree;
    fsfilcnt_t f_favail;
    unsigned long int f_fsid;
    unsigned long int f_flag;
    unsigned long int f_namemax;
    int __f_spare[6];
};
struct statvfs64 {
    unsigned long int f_bsize;
    unsigned long int f_frsize;
    fsblkcnt64_t f_blocks;
    fsblkcnt64_t f_bfree;
    fsblkcnt64_t f_bavail;
    fsfilcnt64_t f_files;
    fsfilcnt64_t f_ffree;
    fsfilcnt64_t f_favail;
    unsigned long int f_fsid;
    unsigned long int f_flag;
    unsigned long int f_namemax;
    int __f_spare[6];
};

11.3.51. sys/time.h


/*
 * This header is architecture neutral
 * Please refer to the generic specification for details
 */

11.3.52. sys/timeb.h


/*
 * This header is architecture neutral
 * Please refer to the generic specification for details
 */

11.3.53. sys/times.h


/*
 * This header is architecture neutral
 * Please refer to the generic specification for details
 */

11.3.54. sys/types.h


typedef int64_t ssize_t;

#define __FDSET_LONGS	16

11.3.55. sys/un.h


/*
 * This header is architecture neutral
 * Please refer to the generic specification for details
 */

11.3.56. sys/utsname.h


/*
 * This header is architecture neutral
 * Please refer to the generic specification for details
 */

11.3.57. sys/wait.h


/*
 * This header is architecture neutral
 * Please refer to the generic specification for details
 */

11.3.58. syslog.h


/*
 * This header is architecture neutral
 * Please refer to the generic specification for details
 */

11.3.59. termios.h


#define TAB1	1024
#define CR3	12288
#define CRDLY	12288
#define FF1	16384
#define FFDLY	16384
#define XCASE	16384
#define ONLCR	2
#define TAB2	2048
#define TAB3	3072
#define TABDLY	3072
#define BS1	32768
#define BSDLY	32768
#define OLCUC	4
#define CR1	4096
#define IUCLC	4096
#define VT1	65536
#define VTDLY	65536
#define NLDLY	768
#define CR2	8192

#define VWERASE	10
#define VREPRINT	11
#define VSUSP	12
#define VSTART	13
#define VSTOP	14
#define VDISCARD	16
#define VMIN	5
#define VEOL	6
#define VEOL2	8
#define VSWTC	9

#define IXOFF	1024
#define IXON	512

#define CSTOPB	1024
#define HUPCL	16384
#define CREAD	2048
#define CS6	256
#define CLOCAL	32768
#define PARENB	4096
#define CS7	512
#define VTIME	7
#define CS8	768
#define CSIZE	768
#define PARODD	8192

#define NOFLSH	0x80000000
#define ECHOKE	1
#define IEXTEN	1024
#define ISIG	128
#define ECHONL	16
#define ECHOE	2
#define ICANON	256
#define ECHOPRT	32
#define ECHOK	4
#define TOSTOP	4194304
#define PENDIN	536870912
#define ECHOCTL	64
#define FLUSHO	8388608

11.3.60. ucontext.h


typedef struct _libc_vscr {
    int __pad[3];
    int vscr_word;
} vscr_t;
typedef struct _libc_vrstate {
    unsigned int vrregs[128];
    vscr_t vscr;
    unsigned int vrsave;
    unsigned int __pad[3];
} vrregset_t __attribute__ ((__aligned__(16)));

#define NGREG	48

typedef unsigned long int gregset_t[48];

typedef double fpregset_t[33];

typedef struct {
    unsigned long int __unused[4];
    int signal;
    int pad0;
    unsigned long int handler;
    unsigned long int oldmask;
    struct pt_regs *regs;
    gregset_t gp_regs;
    fpregset_t fp_regs;
    vrregset_t *v_regs;
    long int vmx_reserve[69];
} mcontext_t;

typedef struct ucontext {
    unsigned long int uc_flags;
    struct ucontext *uc_link;
    stack_t uc_stack;
    sigset_t uc_sigmask;
    mcontext_t uc_mcontext;
} ucontext_t;

11.3.61. ulimit.h


/*
 * This header is architecture neutral
 * Please refer to the generic specification for details
 */

11.3.62. unistd.h


/*
 * This header is architecture neutral
 * Please refer to the generic specification for details
 */

11.3.63. utime.h


/*
 * This header is architecture neutral
 * Please refer to the generic specification for details
 */

11.3.64. utmp.h


struct lastlog {
    int32_t ll_time;
    char ll_line[UT_LINESIZE];
    char ll_host[UT_HOSTSIZE];
};

struct utmp {
    short ut_type;
    pid_t ut_pid;
    char ut_line[UT_LINESIZE];
    char ut_id[4];
    char ut_user[UT_NAMESIZE];
    char ut_host[UT_HOSTSIZE];
    struct exit_status ut_exit;
    int32_t ut_session;
    struct {
	int32_t tv_sec;
	int32_t tv_usec;
    } ut_tv;
    int32_t ut_addr_v6[4];
    char __unused[20];
};

11.3.65. utmpx.h


struct utmpx {
    short ut_type;
    pid_t ut_pid;
    char ut_line[UT_LINESIZE];
    char ut_id[4];
    char ut_user[UT_NAMESIZE];
    char ut_host[UT_HOSTSIZE];
    struct exit_status ut_exit;
    int32_t ut_session;
    struct {
	int32_t tv_sec;
	int32_t tv_usec;
    } ut_tv;
    int32_t ut_addr_v6[4];
    char __unused[20];
};

11.3.66. wctype.h


/*
 * This header is architecture neutral
 * Please refer to the generic specification for details
 */

11.3.67. wordexp.h


/*
 * This header is architecture neutral
 * Please refer to the generic specification for details
 */