summaryrefslogtreecommitdiff
path: root/libc/kinclude
diff options
context:
space:
mode:
authorRobert de Bath <rdebath@poboxes.com>1996-03-24 21:25:23 +0100
committerLubomir Rintel <lkundrak@v3.sk>2013-10-23 23:29:54 +0200
commitdcc973ea3e31710429858c99d4f040334ac67c06 (patch)
tree8883b902eb18eba489957b7f03caa491fd7992a7 /libc/kinclude
parentfe22c37817ce338fbbc90b239320248c270957fa (diff)
downloaddev86-dcc973ea3e31710429858c99d4f040334ac67c06.tar.gz
Import Dev86-0.0.5.tar.gzv0.0.5
Diffstat (limited to 'libc/kinclude')
-rw-r--r--libc/kinclude/Config1
-rw-r--r--libc/kinclude/Makefile18
-rw-r--r--libc/kinclude/arch/errno.h127
-rw-r--r--libc/kinclude/arch/ioctl.h9
-rw-r--r--libc/kinclude/arch/types.h48
-rw-r--r--libc/kinclude/linuxmt/errno.h1
-rw-r--r--libc/kinclude/linuxmt/fcntl.h70
-rw-r--r--libc/kinclude/linuxmt/ioctl.h1
-rw-r--r--libc/kinclude/linuxmt/stat.h55
-rw-r--r--libc/kinclude/linuxmt/termios.h258
-rw-r--r--libc/kinclude/linuxmt/types.h32
11 files changed, 620 insertions, 0 deletions
diff --git a/libc/kinclude/Config b/libc/kinclude/Config
new file mode 100644
index 0000000..f3d064f
--- /dev/null
+++ b/libc/kinclude/Config
@@ -0,0 +1 @@
+kinc: The kernel include files
diff --git a/libc/kinclude/Makefile b/libc/kinclude/Makefile
new file mode 100644
index 0000000..79dd5c2
--- /dev/null
+++ b/libc/kinclude/Makefile
@@ -0,0 +1,18 @@
+# Copyright (C) 1995,1996 Robert de Bath <rdebath@cix.compulink.co.uk>
+# This file is part of the Linux-8086 C library and is distributed
+# under the GNU Library General Public License.
+
+TOP=..
+include $(TOP)/Make.defs
+
+OBJ=
+
+all: $(OBJ)
+
+libc.a:
+
+transfer:
+ -@rm -f ../include/linuxmt
+ ln -s ../kinclude/linuxmt ../include
+
+clean:
diff --git a/libc/kinclude/arch/errno.h b/libc/kinclude/arch/errno.h
new file mode 100644
index 0000000..ee3fcab
--- /dev/null
+++ b/libc/kinclude/arch/errno.h
@@ -0,0 +1,127 @@
+#ifndef _I86_ERRNO_H
+#define _I86_ERRNO_H
+
+#define EPERM 1 /* Operation not permitted */
+#define ENOENT 2 /* No such file or directory */
+#define ESRCH 3 /* No such process */
+#define EINTR 4 /* Interrupted system call */
+#define EIO 5 /* I/O error */
+#define ENXIO 6 /* No such device or address */
+#define E2BIG 7 /* Arg list too long */
+#define ENOEXEC 8 /* Exec format error */
+#define EBADF 9 /* Bad file number */
+#define ECHILD 10 /* No child processes */
+#define EAGAIN 11 /* Try again */
+#define ENOMEM 12 /* Out of memory */
+#define EACCES 13 /* Permission denied */
+#define EFAULT 14 /* Bad address */
+#define ENOTBLK 15 /* Block device required */
+#define EBUSY 16 /* Device or resource busy */
+#define EEXIST 17 /* File exists */
+#define EXDEV 18 /* Cross-device link */
+#define ENODEV 19 /* No such device */
+#define ENOTDIR 20 /* Not a directory */
+#define EISDIR 21 /* Is a directory */
+#define EINVAL 22 /* Invalid argument */
+#define ENFILE 23 /* File table overflow */
+#define EMFILE 24 /* Too many open files */
+#define ENOTTY 25 /* Not a typewriter */
+#define ETXTBSY 26 /* Text file busy */
+#define EFBIG 27 /* File too large */
+#define ENOSPC 28 /* No space left on device */
+#define ESPIPE 29 /* Illegal seek */
+#define EROFS 30 /* Read-only file system */
+#define EMLINK 31 /* Too many links */
+#define EPIPE 32 /* Broken pipe */
+#define EDOM 33 /* Math argument out of domain of func */
+#define ERANGE 34 /* Math result not representable */
+#define EDEADLK 35 /* Resource deadlock would occur */
+#define ENAMETOOLONG 36 /* File name too long */
+#define ENOLCK 37 /* No record locks available */
+#define ENOSYS 38 /* Function not implemented */
+#define ENOTEMPTY 39 /* Directory not empty */
+#define ELOOP 40 /* Too many symbolic links encountered */
+#define EWOULDBLOCK EAGAIN /* Operation would block */
+#define ENOMSG 42 /* No message of desired type */
+#define EIDRM 43 /* Identifier removed */
+#define ECHRNG 44 /* Channel number out of range */
+#define EL2NSYNC 45 /* Level 2 not synchronized */
+#define EL3HLT 46 /* Level 3 halted */
+#define EL3RST 47 /* Level 3 reset */
+#define ELNRNG 48 /* Link number out of range */
+#define EUNATCH 49 /* Protocol driver not attached */
+#define ENOCSI 50 /* No CSI structure available */
+#define EL2HLT 51 /* Level 2 halted */
+#define EBADE 52 /* Invalid exchange */
+#define EBADR 53 /* Invalid request descriptor */
+#define EXFULL 54 /* Exchange full */
+#define ENOANO 55 /* No anode */
+#define EBADRQC 56 /* Invalid request code */
+#define EBADSLT 57 /* Invalid slot */
+#define EDEADLOCK 58 /* File locking deadlock error */
+#define EBFONT 59 /* Bad font file format */
+#define ENOSTR 60 /* Device not a stream */
+#define ENODATA 61 /* No data available */
+#define ETIME 62 /* Timer expired */
+#define ENOSR 63 /* Out of streams resources */
+#define ENONET 64 /* Machine is not on the network */
+#define ENOPKG 65 /* Package not installed */
+#define EREMOTE 66 /* Object is remote */
+#define ENOLINK 67 /* Link has been severed */
+#define EADV 68 /* Advertise error */
+#define ESRMNT 69 /* Srmount error */
+#define ECOMM 70 /* Communication error on send */
+#define EPROTO 71 /* Protocol error */
+#define EMULTIHOP 72 /* Multihop attempted */
+#define EDOTDOT 73 /* RFS specific error */
+#define EBADMSG 74 /* Not a data message */
+#define EOVERFLOW 75 /* Value too large for defined data type */
+#define ENOTUNIQ 76 /* Name not unique on network */
+#define EBADFD 77 /* File descriptor in bad state */
+#define EREMCHG 78 /* Remote address changed */
+#define ELIBACC 79 /* Can not access a needed shared library */
+#define ELIBBAD 80 /* Accessing a corrupted shared library */
+#define ELIBSCN 81 /* .lib section in a.out corrupted */
+#define ELIBMAX 82 /* Attempting to link in too many shared libraries */
+#define ELIBEXEC 83 /* Cannot exec a shared library directly */
+#define EILSEQ 84 /* Illegal byte sequence */
+#define ERESTART 85 /* Interrupted system call should be restarted */
+#define ESTRPIPE 86 /* Streams pipe error */
+#define EUSERS 87 /* Too many users */
+#define ENOTSOCK 88 /* Socket operation on non-socket */
+#define EDESTADDRREQ 89 /* Destination address required */
+#define EMSGSIZE 90 /* Message too long */
+#define EPROTOTYPE 91 /* Protocol wrong type for socket */
+#define ENOPROTOOPT 92 /* Protocol not available */
+#define EPROTONOSUPPORT 93 /* Protocol not supported */
+#define ESOCKTNOSUPPORT 94 /* Socket type not supported */
+#define EOPNOTSUPP 95 /* Operation not supported on transport endpoint */
+#define EPFNOSUPPORT 96 /* Protocol family not supported */
+#define EAFNOSUPPORT 97 /* Address family not supported by protocol */
+#define EADDRINUSE 98 /* Address already in use */
+#define EADDRNOTAVAIL 99 /* Cannot assign requested address */
+#define ENETDOWN 100 /* Network is down */
+#define ENETUNREACH 101 /* Network is unreachable */
+#define ENETRESET 102 /* Network dropped connection because of reset */
+#define ECONNABORTED 103 /* Software caused connection abort */
+#define ECONNRESET 104 /* Connection reset by peer */
+#define ENOBUFS 105 /* No buffer space available */
+#define EISCONN 106 /* Transport endpoint is already connected */
+#define ENOTCONN 107 /* Transport endpoint is not connected */
+#define ESHUTDOWN 108 /* Cannot send after transport endpoint shutdown */
+#define ETOOMANYREFS 109 /* Too many references: cannot splice */
+#define ETIMEDOUT 110 /* Connection timed out */
+#define ECONNREFUSED 111 /* Connection refused */
+#define EHOSTDOWN 112 /* Host is down */
+#define EHOSTUNREACH 113 /* No route to host */
+#define EALREADY 114 /* Operation already in progress */
+#define EINPROGRESS 115 /* Operation now in progress */
+#define ESTALE 116 /* Stale NFS file handle */
+#define EUCLEAN 117 /* Structure needs cleaning */
+#define ENOTNAM 118 /* Not a XENIX named type file */
+#define ENAVAIL 119 /* No XENIX semaphores available */
+#define EISNAM 120 /* Is a named type file */
+#define EREMOTEIO 121 /* Remote I/O error */
+#define EDQUOT 122 /* Quota exceeded */
+
+#endif
diff --git a/libc/kinclude/arch/ioctl.h b/libc/kinclude/arch/ioctl.h
new file mode 100644
index 0000000..55b276b
--- /dev/null
+++ b/libc/kinclude/arch/ioctl.h
@@ -0,0 +1,9 @@
+/*
+ * Nothing here yet.
+ */
+
+#ifndef _ASMI86_IOCTL_H
+#define _ASMI86_IOCTL_H
+
+
+#endif /* _ASMI86_IOCTL_H */
diff --git a/libc/kinclude/arch/types.h b/libc/kinclude/arch/types.h
new file mode 100644
index 0000000..d6690d1
--- /dev/null
+++ b/libc/kinclude/arch/types.h
@@ -0,0 +1,48 @@
+/* arch/i86/include/asm/types.h - Basic Linux/MT data types. */
+
+#ifndef LINUXMT_8086_TYPES
+#define LINUXMT_8086_TYPES
+
+/* First we define all of the __u and __s types...*/
+
+typedef unsigned char __u8;
+typedef unsigned char * __pu8;
+typedef char __s8;
+typedef char * __ps8;
+
+typedef unsigned int __u16;
+typedef unsigned int * __pu16;
+typedef int __s16;
+typedef int * __ps16;
+
+typedef unsigned long __u32;
+typedef unsigned long * __pu32;
+typedef long __s32;
+typedef long * __ps32;
+
+/* __uint == 16bit here */
+
+typedef unsigned int __uint;
+typedef int __sint;
+typedef unsigned int * __puint;
+typedef int * __psint;
+
+/* Then we define registers, etc... */
+
+struct _registers {
+ __u16 ksp, sp, ss, ax, bx, cx, dx, di, si, ds, es, bp, ip, cs, flags;
+};
+
+typedef struct _registers __registers;
+typedef struct _registers * __pregisters;
+
+typedef __u32 __pptr;
+
+struct _mminit {
+ __u16 cs, endcs, ds, endds, ss, endss, lowss;
+};
+
+typedef struct _mminit __arch_mminit;
+typedef struct _mminit * __parch_mminit;
+
+#endif
diff --git a/libc/kinclude/linuxmt/errno.h b/libc/kinclude/linuxmt/errno.h
new file mode 100644
index 0000000..b4c07a3
--- /dev/null
+++ b/libc/kinclude/linuxmt/errno.h
@@ -0,0 +1 @@
+#include "../arch/errno.h"
diff --git a/libc/kinclude/linuxmt/fcntl.h b/libc/kinclude/linuxmt/fcntl.h
new file mode 100644
index 0000000..d9188a1
--- /dev/null
+++ b/libc/kinclude/linuxmt/fcntl.h
@@ -0,0 +1,70 @@
+#ifndef __LINUXMT_FCNTL_H
+#define __LINUXMT_FCNTL_H
+
+/*
+ * Definitions taken from the i386 Linux kernel.
+ */
+
+/* open/fcntl */
+
+#define O_ACCMODE 0003
+#define O_RDONLY 00
+#define O_WRONLY 01
+#define O_RDWR 02
+#define O_CREAT 0100 /* not fcntl */
+#define O_EXCL 0200 /* not fcntl */
+#define O_NOCTTY 0400 /* not fcntl */
+#define O_TRUNC 01000 /* not fcntl */
+#define O_APPEND 02000
+#define O_NONBLOCK 04000
+#define O_NDELAY O_NONBLOCK
+#if 0
+#define O_SYNC 010000 /* Not supported */
+#define FASYNC 020000 /* Not supported */
+#endif
+
+#define F_DUPFD 0 /* dup */
+#define F_GETFD 1 /* get f_flags */
+#define F_SETFD 2 /* set f_flags */
+#define F_GETFL 3 /* more flags (cloexec) */
+#define F_SETFL 4
+#define F_GETLK 5
+#define F_SETLK 6
+#define F_SETLKW 7
+
+#define F_SETOWN 8 /* for sockets. */
+#define F_GETOWN 9 /* for sockets. */
+
+/* for F_[GET|SET]FL */
+#define FD_CLOEXEC 1 /* actually anything with low bit set goes */
+
+/* for posix fcntl() and lockf() */
+#define F_RDLCK 0
+#define F_WRLCK 1
+#define F_UNLCK 2
+
+/* for old implementation of bsd flock () */
+#define F_EXLCK 4 /* or 3 */
+#define F_SHLCK 8 /* or 4 */
+
+/* operations for bsd flock(), also used by the kernel implementation */
+#define LOCK_SH 1 /* shared lock */
+#define LOCK_EX 2 /* exclusive lock */
+#define LOCK_NB 4 /* or'd with one of the above to prevent
+ blocking */
+#define LOCK_UN 8 /* remove lock */
+
+#ifdef __KERNEL__
+#define F_POSIX 1
+#define F_FLOCK 2
+#endif /* __KERNEL__ */
+
+struct flock {
+ short l_type;
+ short l_whence;
+ off_t l_start;
+ off_t l_len;
+ pid_t l_pid;
+};
+
+#endif
diff --git a/libc/kinclude/linuxmt/ioctl.h b/libc/kinclude/linuxmt/ioctl.h
new file mode 100644
index 0000000..20f5ac6
--- /dev/null
+++ b/libc/kinclude/linuxmt/ioctl.h
@@ -0,0 +1 @@
+#include "../arch/ioctl.h"
diff --git a/libc/kinclude/linuxmt/stat.h b/libc/kinclude/linuxmt/stat.h
new file mode 100644
index 0000000..0eb1c0e
--- /dev/null
+++ b/libc/kinclude/linuxmt/stat.h
@@ -0,0 +1,55 @@
+#ifndef _LINUX_STAT_H
+#define _LINUX_STAT_H
+
+#ifdef __KERNEL__
+
+#include "../arch/stat.h"
+
+#endif
+
+#define S_IFMT 00170000
+#ifdef __LINUXMT_NETWORK__
+#define S_IFSOCK 0140000
+#endif
+#define S_IFLNK 0120000
+#define S_IFREG 0100000
+#define S_IFBLK 0060000
+#define S_IFDIR 0040000
+#define S_IFCHR 0020000
+#define S_IFIFO 0010000
+#define S_ISUID 0004000
+#define S_ISGID 0002000
+#define S_ISVTX 0001000
+
+#define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK)
+#define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
+#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
+#define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR)
+#define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK)
+#define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO)
+#define S_ISSOCK(m) (((m) & S_IFMT) == S_IFSOCK)
+
+#define S_IRWXU 00700
+#define S_IRUSR 00400
+#define S_IWUSR 00200
+#define S_IXUSR 00100
+
+#define S_IRWXG 00070
+#define S_IRGRP 00040
+#define S_IWGRP 00020
+#define S_IXGRP 00010
+
+#define S_IRWXO 00007
+#define S_IROTH 00004
+#define S_IWOTH 00002
+#define S_IXOTH 00001
+
+#ifdef __KERNEL__
+#define S_IRWXUGO (S_IRWXU|S_IRWXG|S_IRWXO)
+#define S_IALLUGO (S_ISUID|S_ISGID|S_ISVTX|S_IRWXUGO)
+#define S_IRUGO (S_IRUSR|S_IRGRP|S_IROTH)
+#define S_IWUGO (S_IWUSR|S_IWGRP|S_IWOTH)
+#define S_IXUGO (S_IXUSR|S_IXGRP|S_IXOTH)
+#endif
+
+#endif
diff --git a/libc/kinclude/linuxmt/termios.h b/libc/kinclude/linuxmt/termios.h
new file mode 100644
index 0000000..52bde9a
--- /dev/null
+++ b/libc/kinclude/linuxmt/termios.h
@@ -0,0 +1,258 @@
+#ifndef _LINUXMT_TERMIOS_H
+#define _LINUXMT_TERMIOS_H
+#include <linuxmt/types.h>
+
+/* This is just a magic number to make these relatively unique ('T') */
+#define __TERMIOS_MAJ ('T'<<8)
+
+#define TCGETS (__TERMIOS_MAJ+0x01)
+#define TCSETS (__TERMIOS_MAJ+0x02)
+#define TCSETSW (__TERMIOS_MAJ+0x03)
+#define TCSETSF (__TERMIOS_MAJ+0x04)
+#define TCGETA (__TERMIOS_MAJ+0x05)
+#define TCSETA (__TERMIOS_MAJ+0x06)
+#define TCSETAW (__TERMIOS_MAJ+0x07)
+#define TCSETAF (__TERMIOS_MAJ+0x08)
+#define TCSBRK (__TERMIOS_MAJ+0x09)
+#define TCXONC (__TERMIOS_MAJ+0x0A)
+#define TCFLSH (__TERMIOS_MAJ+0x0B)
+#define TIOCEXCL (__TERMIOS_MAJ+0x0C)
+#define TIOCNXCL (__TERMIOS_MAJ+0x0D)
+#define TIOCSCTTY (__TERMIOS_MAJ+0x0E)
+#define TIOCGPGRP (__TERMIOS_MAJ+0x0F)
+#define TIOCSPGRP (__TERMIOS_MAJ+0x10)
+#define TIOCOUTQ (__TERMIOS_MAJ+0x11)
+#define TIOCSTI (__TERMIOS_MAJ+0x12)
+#define TIOCGWINSZ (__TERMIOS_MAJ+0x13)
+#define TIOCSWINSZ (__TERMIOS_MAJ+0x14)
+#define TIOCMGET (__TERMIOS_MAJ+0x15)
+#define TIOCMBIS (__TERMIOS_MAJ+0x16)
+#define TIOCMBIC (__TERMIOS_MAJ+0x17)
+#define TIOCMSET (__TERMIOS_MAJ+0x18)
+#define TIOCGSOFTCAR (__TERMIOS_MAJ+0x19)
+#define TIOCSSOFTCAR (__TERMIOS_MAJ+0x1A)
+#define FIONREAD (__TERMIOS_MAJ+0x1B)
+#define TIOCINQ FIONREAD
+#define TIOCLINUX (__TERMIOS_MAJ+0x1C)
+#define TIOCCONS (__TERMIOS_MAJ+0x1D)
+#define TIOCGSERIAL (__TERMIOS_MAJ+0x1E)
+#define TIOCSSERIAL (__TERMIOS_MAJ+0x1F)
+#define TIOCPKT (__TERMIOS_MAJ+0x20)
+#define FIONBIO (__TERMIOS_MAJ+0x21)
+#define TIOCNOTTY (__TERMIOS_MAJ+0x22)
+#define TIOCSETD (__TERMIOS_MAJ+0x23)
+#define TIOCGETD (__TERMIOS_MAJ+0x24)
+#define TCSBRKP (__TERMIOS_MAJ+0x25) /* Needed for POSIX tcsendbreak */
+#define TIOCTTYGSTRUCT (__TERMIOS_MAJ+0x26) /* For debugging only */
+#define FIONCLEX (__TERMIOS_MAJ+0x50) /* these numbers need to be adjusted. */
+#define FIOCLEX (__TERMIOS_MAJ+0x51)
+#define FIOASYNC (__TERMIOS_MAJ+0x52)
+#define TIOCSERCONFIG (__TERMIOS_MAJ+0x53)
+#define TIOCSERGWILD (__TERMIOS_MAJ+0x54)
+#define TIOCSERSWILD (__TERMIOS_MAJ+0x55)
+#define TIOCGLCKTRMIOS (__TERMIOS_MAJ+0x56)
+#define TIOCSLCKTRMIOS (__TERMIOS_MAJ+0x57)
+#define TIOCSERGSTRUCT (__TERMIOS_MAJ+0x58) /* For debugging only */
+#define TIOCSERGETLSR (__TERMIOS_MAJ+0x59) /* Get line status register */
+#define TIOCSERGETMULTI (__TERMIOS_MAJ+0x5A) /* Get multiport config */
+#define TIOCSERSETMULTI (__TERMIOS_MAJ+0x5B) /* Set multiport config */
+
+/* Used for packet mode */
+#define TIOCPKT_DATA 0
+#define TIOCPKT_FLUSHREAD 1
+#define TIOCPKT_FLUSHWRITE 2
+#define TIOCPKT_STOP 4
+#define TIOCPKT_START 8
+#define TIOCPKT_NOSTOP 16
+#define TIOCPKT_DOSTOP 32
+
+struct winsize {
+ unsigned short ws_row;
+ unsigned short ws_col;
+ unsigned short ws_xpixel;
+ unsigned short ws_ypixel;
+};
+
+#define NCC 8
+struct termio {
+ unsigned short c_iflag; /* input mode flags */
+ unsigned short c_oflag; /* output mode flags */
+ unsigned short c_cflag; /* control mode flags */
+ unsigned short c_lflag; /* local mode flags */
+ unsigned char c_line; /* line discipline */
+ unsigned char c_cc[NCC]; /* control characters */
+};
+
+#define NCCS 19
+struct termios {
+ tcflag_t c_iflag; /* input mode flags */
+ tcflag_t c_oflag; /* output mode flags */
+ tcflag_t c_cflag; /* control mode flags */
+ tcflag_t c_lflag; /* local mode flags */
+ cc_t c_line; /* line discipline */
+ cc_t c_cc[NCCS]; /* control characters */
+};
+
+/* c_cc characters */
+#define VINTR 0
+#define VQUIT 1
+#define VERASE 2
+#define VKILL 3
+#define VEOF 4
+#define VTIME 5
+#define VMIN 6
+#define VSWTC 7
+#define VSTART 8
+#define VSTOP 9
+#define VSUSP 10
+#define VEOL 11
+#define VREPRINT 12
+#define VDISCARD 13
+#define VWERASE 14
+#define VLNEXT 15
+#define VEOL2 16
+
+/* c_iflag bits */
+#define IGNBRK 0000001
+#define BRKINT 0000002
+#define IGNPAR 0000004
+#define PARMRK 0000010
+#define INPCK 0000020
+#define ISTRIP 0000040
+#define INLCR 0000100
+#define IGNCR 0000200
+#define ICRNL 0000400
+#define IUCLC 0001000
+#define IXON 0002000
+#define IXANY 0004000
+#define IXOFF 0010000
+#define IMAXBEL 0020000
+
+/* c_oflag bits */
+#define OPOST 0000001
+#define OLCUC 0000002
+#define ONLCR 0000004
+#define OCRNL 0000010
+#define ONOCR 0000020
+#define ONLRET 0000040
+#define OFILL 0000100
+#define OFDEL 0000200
+#define NLDLY 0000400
+#define NL0 0000000
+#define NL1 0000400
+#define CRDLY 0003000
+#define CR0 0000000
+#define CR1 0001000
+#define CR2 0002000
+#define CR3 0003000
+#define TABDLY 0014000
+#define TAB0 0000000
+#define TAB1 0004000
+#define TAB2 0010000
+#define TAB3 0014000
+#define XTABS 0014000
+#define BSDLY 0020000
+#define BS0 0000000
+#define BS1 0020000
+#define VTDLY 0040000
+#define VT0 0000000
+#define VT1 0040000
+#define FFDLY 0100000
+#define FF0 0000000
+#define FF1 0100000
+
+/* c_cflag bit meaning */
+#define CBAUD 0010017
+#define B0 0000000 /* hang up */
+#define B50 0000001
+#define B75 0000002
+#define B110 0000003
+#define B134 0000004
+#define B150 0000005
+#define B200 0000006
+#define B300 0000007
+#define B600 0000010
+#define B1200 0000011
+#define B1800 0000012
+#define B2400 0000013
+#define B4800 0000014
+#define B9600 0000015
+#define B19200 0000016
+#define B38400 0000017
+#define EXTA B19200
+#define EXTB B38400
+#define CSIZE 0000060
+#define CS5 0000000
+#define CS6 0000020
+#define CS7 0000040
+#define CS8 0000060
+#define CSTOPB 0000100
+#define CREAD 0000200
+#define PARENB 0000400
+#define PARODD 0001000
+#define HUPCL 0002000
+#define CLOCAL 0004000
+#define CBAUDEX 0010000
+#define B57600 0010001
+#define B115200 0010002
+#define B230400 0010003
+#define CIBAUD 002003600000 /* input baud rate (not used) */
+#define CRTSCTS 020000000000 /* flow control */
+
+/* c_lflag bits */
+#define ISIG 0000001
+#define ICANON 0000002
+#define XCASE 0000004
+#define ECHO 0000010
+#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
+
+/* modem lines */
+#define TIOCM_LE 0x001
+#define TIOCM_DTR 0x002
+#define TIOCM_RTS 0x004
+#define TIOCM_ST 0x008
+#define TIOCM_SR 0x010
+#define TIOCM_CTS 0x020
+#define TIOCM_CAR 0x040
+#define TIOCM_RNG 0x080
+#define TIOCM_DSR 0x100
+#define TIOCM_CD TIOCM_CAR
+#define TIOCM_RI TIOCM_RNG
+
+/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
+#define TIOCSER_TEMT 0x01 /* Transmitter physically empty */
+
+
+/* tcflow() and TCXONC use these */
+#define TCOOFF 0
+#define TCOON 1
+#define TCIOFF 2
+#define TCION 3
+
+/* tcflush() and TCFLSH use these */
+#define TCIFLUSH 0
+#define TCOFLUSH 1
+#define TCIOFLUSH 2
+
+/* tcsetattr uses these */
+#define TCSANOW 0
+#define TCSADRAIN 1
+#define TCSAFLUSH 2
+
+/* line disciplines */
+#define N_TTY 0
+#define N_SLIP 1
+#define N_MOUSE 2
+#define N_PPP 3
+
+#endif /* _LINUXMT_TERMIOS_H */
diff --git a/libc/kinclude/linuxmt/types.h b/libc/kinclude/linuxmt/types.h
new file mode 100644
index 0000000..437d985
--- /dev/null
+++ b/libc/kinclude/linuxmt/types.h
@@ -0,0 +1,32 @@
+#ifndef __LINUXMT_TYPES_H
+#define __LINUXMT_TYPES_H
+
+#include "../arch/types.h"
+
+/* Throw away _FUNCTION parameters - the syntax is ripped off of Minix's
+ _PROTOTYPE. Considering Borland did the same thing to MFC on a bigger
+ scale, I don't think PH will mind :) */
+
+/* Yes, this should be in arch/types.h too */
+
+#define _FUNCTION(function, params) function()
+#define _VFUNCTION(functiom, params) (*function) ()
+
+typedef __u32 off_t;
+typedef __u16 pid_t;
+typedef __u16 uid_t;
+typedef __u16 gid_t;
+typedef __u32 time_t;
+typedef __u16 umode_t;
+typedef __u16 nlink_t;
+typedef __u16 mode_t;
+typedef __u32 loff_t;
+typedef unsigned int speed_t;
+
+typedef __u16 dev_t;
+typedef __u16 ino_t;
+typedef __u32 tcflag_t;
+typedef __u8 cc_t;
+
+#endif
+