Data Definitions for libc

This section contains standard data definitions that describe system data. 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.

ISO C serves as the LSB 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.

errno.h




#define EDEADLOCK	EDEADLK

inttypes.h






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

limits.h


#define LONG_MAX	0x7FFFFFFFL
#define ULONG_MAX	0xFFFFFFFFUL






#define CHAR_MAX	SCHAR_MAX
#define CHAR_MIN	SCHAR_MIN

setjmp.h






typedef int __jmp_buf[6];

signal.h
























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





struct _fpreg
{
  unsigned short significand[4];
  unsigned short exponent;
}
 ;
struct _fpxreg
{
  unsigned short significand[4];
  unsigned short exponent;
  unsigned short padding[3];
}
 ;
struct _xmmreg
{
  unsigned long element[4];
}
 ;


struct _fpstate
{
  unsigned long cw;
  unsigned long sw;
  unsigned long tag;
  unsigned long ipoff;
  unsigned long cssel;
  unsigned long dataoff;
  unsigned long datasel;
  struct _fpreg _st[8];
  unsigned short status;
  unsigned short magic;
  unsigned long _fxsr_env[6];
  unsigned long mxcsr;
  unsigned long reserved;
  struct _fpxreg _fxsr_st[8];
  struct _xmmreg _xmm[8];
  unsigned long padding[56];
}
 ;


struct sigcontext
{
  unsigned short gs;
  unsigned short __gsh;
  unsigned short fs;
  unsigned short __fsh;
  unsigned short es;
  unsigned short __esh;
  unsigned short ds;
  unsigned short __dsh;
  unsigned long edi;
  unsigned long esi;
  unsigned long ebp;
  unsigned long esp;
  unsigned long ebx;
  unsigned long edx;
  unsigned long ecx;
  unsigned long eax;
  unsigned long trapno;
  unsigned long err;
  unsigned long eip;
  unsigned short cs;
  unsigned short __csh;
  unsigned long eflags;
  unsigned long esp_at_signal;
  unsigned short ss;
  unsigned short __ssh;
  struct _fpstate *fpstate;
  unsigned long oldmask;
  unsigned long cr2;
}
 ;

stddef.h



typedef unsigned int size_t;
typedef int ptrdiff_t;

sys/ioctl.h


#define FIONREAD	0x541B
#define TIOCNOTTY	0x5422

sys/ipc.h



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

sys/mman.h


#define MCL_CURRENT	1
#define MCL_FUTURE	2

sys/msg.h






typedef unsigned long msgqnum_t;
typedef unsigned long msglen_t;


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

sys/sem.h



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

sys/shm.h


#define SHMLBA	(__getpagesize())





typedef unsigned long shmatt_t;


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

sys/stat.h


#define _STAT_VER	3


struct stat
{
  dev_t st_dev;
  unsigned short __pad1;
  unsigned long st_ino;
  mode_t st_mode;
  nlink_t st_nlink;
  pid_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;
  time_t st_atime;
  unsigned long __unused1;
  time_t st_mtime;
  unsigned long __unused2;
  time_t st_ctime;
  unsigned long __unused3;
  unsigned long __unused4;
  unsigned long __unused5;
}
 ;
struct stat64
{
  dev_t st_dev;
  unsigned int __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 int __pad2;
  off64_t st_size;
  blksize_t st_blksize;
  blkcnt64_t st_blocks;
  time_t st_atime;
  unsigned long __unused1;
  time_t st_mtime;
  unsigned long __unused2;
  time_t st_ctime;
  unsigned long __unused3;
  ino64_t st_ino;
}
 ;

sys/statvfs.h



struct statvfs
{
  unsigned long f_bsize;
  unsigned long 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 f_fsid;
  int __f_unused;
  unsigned long f_flag;
  unsigned long f_namemax;
  int __f_spare[6];
}
 ;
struct statvfs64
{
  unsigned long f_bsize;
  unsigned long 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 f_fsid;
  int __f_unused;
  unsigned long f_flag;
  unsigned long f_namemax;
  int __f_spare[6];
}
 ;

sys/types.h



typedef int ssize_t;

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

ucontext.h






typedef int greg_t;
#define NGREG	19





typedef greg_t gregset_t[19];





struct _libc_fpreg
{
  unsigned short significand[4];
  unsigned short exponent;
}
 ;





struct _libc_fpstate
{
  unsigned long cw;
  unsigned long sw;
  unsigned long tag;
  unsigned long ipoff;
  unsigned long cssel;
  unsigned long dataoff;
  unsigned long datasel;
  struct _libc_fpreg _st[8];
  unsigned long status;
}
 ;
typedef struct _libc_fpstate *fpregset_t;


typedef struct
{
  gregset_t gregs;
  fpregset_t fpregs;
  unsigned long oldmask;
  unsigned long cr2;
}
mcontext_t;


typedef struct ucontext
{
  unsigned long 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;

unistd.h



typedef int intptr_t;