1.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.

These definitions are intended to supplement those provided in the referenced underlying specifications.

This specification uses ISO/IEC 9899 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.

1.3.1. errno.h


#define EDEADLOCK	58

1.3.2. fcntl.h


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

1.3.3. inttypes.h


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

1.3.4. limits.h


#define ULONG_MAX	0xFFFFFFFFUL
#define LONG_MAX	2147483647L

#define CHAR_MIN	0
#define CHAR_MAX	255

#define PTHREAD_STACK_MIN	16384

1.3.5. setjmp.h


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

1.3.6. signal.h


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

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

struct sigaction
{
  union
  {
    sighandler_t _sa_handler;
    void (*_sa_sigaction) (int, siginfo_t *, void *);
  }
  __sigaction_handler;
  sigset_t sa_mask;
  unsigned long int sa_flags;
  void (*sa_restorer) (void);
}
 ;
#define MINSIGSTKSZ	2048
#define SIGSTKSZ	8192

struct sigcontext
{
  long int _unused[4];
  int signal;
  unsigned long int handler;
  unsigned long int oldmask;
  struct pt_regs *regs;
}
 ;

1.3.7. stddef.h


typedef unsigned int size_t;
typedef int ptrdiff_t;

1.3.8. stdio.h


#define __IO_FILE_SIZE	152

1.3.9. sys/ioctl.h


#define TIOCNOTTY	0x5422
#define FIONREAD	1074030207

1.3.10. sys/ipc.h


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

1.3.11. sys/mman.h


#define MCL_FUTURE	16384
#define MCL_CURRENT	8192

1.3.12. sys/msg.h


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

struct msqid_ds
{
  struct ipc_perm msg_perm;
  unsigned int __unused1;
  time_t msg_stime;
  unsigned int __unused2;
  time_t msg_rtime;
  unsigned int __unused3;
  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;
}
 ;

1.3.13. sys/sem.h


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

1.3.14. sys/shm.h


#define SHMLBA	(__getpagesize())

typedef unsigned long int shmatt_t;

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

1.3.15. sys/socket.h


typedef uint32_t __ss_aligntype;

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

1.3.16. sys/stat.h


#define _STAT_VER	3

struct stat64
{
  dev_t st_dev;
  ino64_t st_ino;
  mode_t st_mode;
  nlink_t st_nlink;
  uid_t st_uid;
  gid_t st_gid;
  dev_t st_rdev;
  unsigned short __pad2;
  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;
}
 ;
struct stat
{
  dev_t st_dev;
  unsigned short __pad1;
  ino_t st_ino;
  mode_t st_mode;
  nlink_t st_nlink;
  uid_t st_uid;
  gid_t st_gid;
  dev_t st_rdev;
  unsigned short __pad2;
  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;
}
 ;

1.3.17. 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;
  int __f_unused;
  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;
  int __f_unused;
  unsigned long int f_flag;
  unsigned long int f_namemax;
  int __f_spare[6];
}
 ;

1.3.18. sys/types.h


typedef long long int int64_t;

typedef int32_t ssize_t;

#define __FDSET_LONGS	32

1.3.19. 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

1.3.20. ucontext.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 mq;
  unsigned long int trap;
  unsigned long int dar;
  unsigned long int dsisr;
  unsigned long int result;
}
 ;
typedef struct _libc_vrstate
{
  unsigned int vrregs[128];
  unsigned int vrsave;
  unsigned int _pad[2];
  unsigned int vscr;
}
vrregset_t __attribute__ ((__aligned__ (16)));

#define NGREG	48

typedef unsigned long int gregset_t[48];

typedef struct _libc_fpstate
{
  double fpregs[32];
  double fpscr;
  int _pad[2];
}
fpregset_t;

typedef struct
{
  gregset_t gregs;
  fpregset_t fpregs;
  vrregset_t vrregs;
}
mcontext_t;

union uc_regs_ptr
{
  struct pt_regs *regs;
  mcontext_t *uc_regs;
}
 ;

typedef struct ucontext
{
  unsigned long int uc_flags;
  struct ucontext *uc_link;
  stack_t uc_stack;
  int uc_pad[7];
  union uc_regs_ptr uc_mcontext;
  sigset_t uc_sigmask;
  char uc_reg_space[sizeof (mcontext_t) + 12];
}
ucontext_t;

1.3.21. unistd.h


typedef int intptr_t;

1.3.22. utmp.h


struct lastlog
{
  time_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;
  long int ut_session;
  struct timeval ut_tv;
  int32_t ut_addr_v6[4];
  char __unused[20];
}
 ;

1.3.23. 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;
  long int ut_session;
  struct timeval ut_tv;
  int32_t ut_addr_v6[4];
  char __unused[20];
}
 ;