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	35

1.3.2. fcntl.h


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

1.3.3. inttypes.h


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

1.3.4. limits.h


#define ULONG_MAX	0xFFFFFFFFFFFFFFFFUL
#define LONG_MAX	9223372036854775807L

#define CHAR_MIN	0
#define CHAR_MAX	255

#define PTHREAD_STACK_MIN	196608

1.3.5. setjmp.h


typedef long int __jmp_buf[18];

1.3.6. signal.h


#define __NUM_ACRS	16
#define __NUM_FPRS	16
#define __NUM_GPRS	16

typedef struct
{
  unsigned long int mask;
  unsigned long int addr;
} __attribute__ ((aligned (8))) _psw_t;
typedef struct
{
  _psw_t psw;
  unsigned long int gprs[16];
  unsigned int acrs[16];
}
_s390_regs_common;

#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;
  unsigned long int sa_flags;
  void (*sa_restorer) (void);
  sigset_t sa_mask;
}
 ;
#define MINSIGSTKSZ	2048
#define SIGSTKSZ	8192

typedef struct
{
  unsigned int fpc;
  double fprs[__NUM_FPRS];
}
_s390_fp_regs;
typedef struct
{
  _s390_regs_common regs;
  _s390_fp_regs fpregs;
}
_sigregs;

struct sigcontext
{
  unsigned long int oldmask;
  _sigregs *sregs;
}
 ;

1.3.7. stddef.h


typedef unsigned long int size_t;
typedef long int ptrdiff_t;

1.3.8. stdio.h


#define __IO_FILE_SIZE	216

1.3.9. sys/ioctl.h


#define FIONREAD	21531
#define TIOCNOTTY	21538

1.3.10. 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 short __seq;
  unsigned short __pad2;
  unsigned long int __unused1;
  unsigned long int __unused2;
}
 ;

1.3.11. sys/mman.h


#define MCL_CURRENT	1
#define MCL_FUTURE	2

1.3.12. 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;
}
 ;

1.3.13. 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;
}
 ;

1.3.14. sys/shm.h


#define SHMLBA	4096

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

1.3.15. sys/socket.h


typedef uint64_t __ss_aligntype;

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

1.3.16. 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;
  struct timespec st_atim;
  struct timespec st_mtim;
  struct timespec st_ctim;
  blksize_t st_blksize;
  blkcnt_t st_blocks;
  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;
  struct timespec st_atim;
  struct timespec st_mtim;
  struct timespec st_ctim;
  blksize_t st_blksize;
  blkcnt64_t st_blocks;
  long int __unused[3];
}
 ;

1.3.17. sys/statvfs.h


struct statvfs
{
  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 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];
}
 ;

1.3.18. sys/types.h


typedef long int int64_t;

typedef int64_t ssize_t;

#define __FDSET_LONGS	16

1.3.19. termios.h


#define CR2	1024
#define CR3	1536
#define CRDLY	1536
#define VT1	16384
#define VTDLY	16384
#define OLCUC	2
#define TAB1	2048
#define NLDLY	256
#define FF1	32768
#define FFDLY	32768
#define ONLCR	4
#define XCASE	4
#define TAB2	4096
#define CR1	512
#define IUCLC	512
#define TAB3	6144
#define TABDLY	6144
#define BS1	8192
#define BSDLY	8192

#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	1024
#define IXOFF	4096

#define HUPCL	1024
#define CREAD	128
#define CS6	16
#define CLOCAL	2048
#define PARENB	256
#define CS7	32
#define CS8	48
#define CSIZE	48
#define VTIME	5
#define PARODD	512
#define CSTOPB	64

#define ISIG	1
#define ECHOPRT	1024
#define NOFLSH	128
#define ECHOE	16
#define PENDIN	16384
#define ICANON	2
#define ECHOKE	2048
#define TOSTOP	256
#define ECHOK	32
#define IEXTEN	32768
#define FLUSHO	4096
#define ECHOCTL	512
#define ECHONL	64

1.3.20. ucontext.h


#define NGREG	27

typedef union
{
  double d;
  float f;
}
fpreg_t;

typedef struct
{
  unsigned int fpc;
  fpreg_t fprs[16];
}
fpregset_t;

typedef struct
{
  _psw_t psw;
  unsigned long int gregs[16];
  unsigned int aregs[16];
  fpregset_t fpregs;
}
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;
}
ucontext_t;

1.3.21. 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.22. 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];
}
 ;