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


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

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	EDEADLK

11.3.4. fcntl.h


#define F_GETLK64	5
#define F_SETLK64	6
#define F_SETLKW64	7

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. inttypes.h


typedef long int intmax_t;
typedef unsigned long int uintptr_t;
typedef unsigned long int uintmax_t;
typedef unsigned long int uint64_t;

11.3.11. langinfo.h


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

11.3.12. limits.h


#define LONG_MAX	0x7FFFFFFFFFFFFFFFL
#define ULONG_MAX	0xFFFFFFFFFFFFFFFFUL

#define CHAR_MAX	127
#define CHAR_MIN	SCHAR_MIN

#define PTHREAD_STACK_MIN	16384

11.3.13. locale.h


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

11.3.14. net/if.h


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

11.3.15. netdb.h


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

11.3.16. netinet/in.h


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

11.3.17. netinet/ip.h


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

11.3.18. netinet/tcp.h


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

11.3.19. netinet/udp.h


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

11.3.20. nl_types.h


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

11.3.21. pwd.h


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

11.3.22. regex.h


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

11.3.23. rpc/auth.h


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

11.3.24. rpc/clnt.h


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

11.3.25. rpc/rpc_msg.h


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

11.3.26. rpc/svc.h


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

11.3.27. rpc/types.h


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

11.3.28. rpc/xdr.h


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

11.3.29. sched.h


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

11.3.30. search.h


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

11.3.31. setjmp.h


typedef long int __jmp_buf[8];

11.3.32. signal.h


#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 _fpxreg {
    unsigned short significand[4];
    unsigned short exponent;
    unsigned short padding[3];
};
struct _xmmreg {
    uint32_t element[4];
};

struct _fpstate {
    uint16_t cwd;
    uint16_t swd;
    uint16_t ftw;
    uint16_t fop;
    uint64_t rip;
    uint64_t rdp;
    uint32_t mxcsr;
    uint32_t mxcr_mask;
    struct _fpxreg _st[8];
    struct _xmmreg _xmm[16];
    uint32_t padding[24];
};

struct sigcontext {
    unsigned long int r8;
    unsigned long int r9;
    unsigned long int r10;
    unsigned long int r11;
    unsigned long int r12;
    unsigned long int r13;
    unsigned long int r14;
    unsigned long int r15;
    unsigned long int rdi;
    unsigned long int rsi;
    unsigned long int rbp;
    unsigned long int rbx;
    unsigned long int rdx;
    unsigned long int rax;
    unsigned long int rcx;
    unsigned long int rsp;
    unsigned long int rip;
    unsigned long int eflags;
    unsigned short cs;
    unsigned short gs;
    unsigned short fs;
    unsigned short __pad0;
    unsigned long int err;
    unsigned long int trapno;
    unsigned long int oldmask;
    unsigned long int cr2;
    struct _fpstate *fpstate;
    unsigned long int __reserved1[8];
};

11.3.33. stddef.h


typedef long int ptrdiff_t;
typedef unsigned long int size_t;

11.3.34. stdio.h


#define __IO_FILE_SIZE	216

11.3.35. stdlib.h


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

11.3.36. sys/file.h


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

11.3.37. sys/ioctl.h


#define TIOCGWINSZ	0x5413
#define FIONREAD	0x541B
#define TIOCNOTTY	21538

11.3.38. sys/ipc.h


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

11.3.39. sys/mman.h


#define MCL_CURRENT	1
#define MCL_FUTURE	2

11.3.40. 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.41. sys/param.h


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

11.3.42. sys/poll.h


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

11.3.43. sys/resource.h


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

11.3.44. sys/sem.h


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

11.3.45. sys/shm.h


#define SHMLBA	(__getpagesize())

typedef unsigned long int shmatt_t;

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

11.3.46. sys/socket.h


typedef uint64_t __ss_aligntype;

#define SO_RCVLOWAT	18
#define SO_SNDLOWAT	19
#define SO_RCVTIMEO	20
#define SO_SNDTIMEO	21

11.3.47. 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 pad0;
    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 __unused[3];
};
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 pad0;
    dev_t st_rdev;
    off_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 __unused[3];
};

11.3.48. sys/statfs.h


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

11.3.49. sys/statvfs.h


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];
};
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];
};

11.3.50. sys/time.h


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

11.3.51. sys/timeb.h


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

11.3.52. sys/times.h


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

11.3.53. sys/types.h


typedef long int int64_t;

typedef int64_t ssize_t;

#define __FDSET_LONGS	16

11.3.54. sys/un.h


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

11.3.55. sys/utsname.h


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

11.3.56. sys/wait.h


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

11.3.57. syslog.h


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

11.3.58. termios.h


#define OLCUC	0000002
#define ONLCR	0000004
#define XCASE	0000004
#define NLDLY	0000400
#define CR1	0001000
#define IUCLC	0001000
#define CR2	0002000
#define CR3	0003000
#define CRDLY	0003000
#define TAB1	0004000
#define TAB2	0010000
#define TAB3	0014000
#define TABDLY	0014000
#define BS1	0020000
#define BSDLY	0020000
#define VT1	0040000
#define VTDLY	0040000
#define FF1	0100000
#define FFDLY	0100000

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

#define IXON	0002000
#define IXOFF	0010000

#define CS6	0000020
#define CS7	0000040
#define CS8	0000060
#define CSIZE	0000060
#define CSTOPB	0000100
#define CREAD	0000200
#define PARENB	0000400
#define PARODD	0001000
#define HUPCL	0002000
#define CLOCAL	0004000
#define VTIME	5

#define ISIG	0000001
#define ICANON	0000002
#define ECHOE	0000020
#define ECHOK	0000040
#define ECHONL	0000100
#define NOFLSH	0000200
#define TOSTOP	0000400
#define ECHOCTL	0001000
#define ECHOPRT	0002000
#define ECHOKE	0004000
#define FLUSHO	0010000
#define PENDIN	0040000
#define IEXTEN	0100000

11.3.59. ucontext.h


struct _libc_fpxreg {
    unsigned short significand[4];
    unsigned short exponent;
    unsigned short padding[3];
};

typedef long int greg_t;

#define NGREG	23

typedef greg_t gregset_t[23];

struct _libc_xmmreg {
    uint32_t element[4];
};
struct _libc_fpstate {
    uint16_t cwd;
    uint16_t swd;
    uint16_t ftw;
    uint16_t fop;
    uint64_t rip;
    uint64_t rdp;
    uint32_t mxcsr;
    uint32_t mxcr_mask;
    struct _libc_fpxreg _st[8];
    struct _libc_xmmreg _xmm[16];
    uint32_t padding[24];
};
typedef struct _libc_fpstate *fpregset_t;

typedef struct {
    gregset_t gregs;
    fpregset_t fpregs;
    unsigned long int __reserved1[8];
} mcontext_t;

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

11.3.60. ulimit.h


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

11.3.61. unistd.h


typedef long int intptr_t;

11.3.62. utime.h


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

11.3.63. 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;
    int ut_session;
    struct {
	int32_t tv_sec;
	int32_t tv_usec;
    } ut_tv;
    int32_t ut_addr_v6[4];
    char __unused[20];
};

11.3.64. 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.65. wctype.h


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

11.3.66. wordexp.h


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