summaryrefslogtreecommitdiff
path: root/sys/compat/linux/include
diff options
context:
space:
mode:
authorfvdl <fvdl@NetBSD.org>1995-02-28 23:24:35 +0000
committerfvdl <fvdl@NetBSD.org>1995-02-28 23:24:35 +0000
commit3bf459f350dcbcf47afccba837f4466b132a98c8 (patch)
tree282143a8f0ed1d8860e89324a32312964e0bd6e8 /sys/compat/linux/include
parent8bb0b6790c84a1e16ffa558fd110fb0d90cd0470 (diff)
Added Linux compat code.
Diffstat (limited to 'sys/compat/linux/include')
-rw-r--r--sys/compat/linux/include/linux_dirent.h49
-rw-r--r--sys/compat/linux/include/linux_errno.h158
-rw-r--r--sys/compat/linux/include/linux_exec.h70
-rw-r--r--sys/compat/linux/include/linux_fcntl.h90
-rw-r--r--sys/compat/linux/include/linux_ioctl.h277
-rw-r--r--sys/compat/linux/include/linux_ipc.h64
-rw-r--r--sys/compat/linux/include/linux_ipccall.h63
-rw-r--r--sys/compat/linux/include/linux_mmap.h53
-rw-r--r--sys/compat/linux/include/linux_msg.h85
-rw-r--r--sys/compat/linux/include/linux_shm.h63
-rw-r--r--sys/compat/linux/include/linux_signal.h88
-rw-r--r--sys/compat/linux/include/linux_socket.h96
-rw-r--r--sys/compat/linux/include/linux_socketcall.h162
-rw-r--r--sys/compat/linux/include/linux_sockio.h39
-rw-r--r--sys/compat/linux/include/linux_types.h132
-rw-r--r--sys/compat/linux/include/linux_util.h75
16 files changed, 1564 insertions, 0 deletions
diff --git a/sys/compat/linux/include/linux_dirent.h b/sys/compat/linux/include/linux_dirent.h
new file mode 100644
index 00000000000..48d47c5a332
--- /dev/null
+++ b/sys/compat/linux/include/linux_dirent.h
@@ -0,0 +1,49 @@
+/* $NetBSD: linux_dirent.h,v 1.1 1995/02/28 23:25:31 fvdl Exp $ */
+
+/*
+ * Copyright (c) 1995 Frank van der Linden
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed for the NetBSD Project
+ * by Frank van der Linden
+ * 4. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef _LINUX_DIRENT_H
+#define _LINUX_DIRENT_H
+
+#define LINUX_NAME_MAX 255
+
+struct linux_dirent {
+ long l_dino;
+ linux_off_t l_doff;
+ unsigned short l_dreclen;
+ char l_dname[LINUX_NAME_MAX + 1];
+};
+
+#define LINUX_NAMEOFF(dp) ((char *)&(dp)->l_dname - (char *)dp)
+#define LINUX_RECLEN(de,namlen) ALIGN((LINUX_NAMEOFF(de) + (namlen) + 1))
+
+#endif /* _LINUX_DIRENT_H */
diff --git a/sys/compat/linux/include/linux_errno.h b/sys/compat/linux/include/linux_errno.h
new file mode 100644
index 00000000000..94530fd2eed
--- /dev/null
+++ b/sys/compat/linux/include/linux_errno.h
@@ -0,0 +1,158 @@
+/* $NetBSD: linux_errno.h,v 1.1 1995/02/28 23:25:34 fvdl Exp $ */
+/*
+ * Copyright (c) 1995 Frank van der Linden
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed for the NetBSD Project
+ * by Frank van der Linden
+ * 4. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef _LINUX_ERRNO_H
+#define _LINUX_ERRNO_H
+
+#define LINUX_EPERM 1
+#define LINUX_ENOENT 2
+#define LINUX_ESRCH 3
+#define LINUX_EINTR 4
+#define LINUX_EIO 5
+#define LINUX_ENXIO 6
+#define LINUX_E2BIG 7
+#define LINUX_ENOEXEC 8
+#define LINUX_EBADF 9
+#define LINUX_ECHILD 10
+#define LINUX_EAGAIN 11
+#define LINUX_ENOMEM 12
+#define LINUX_EACCES 13
+#define LINUX_EFAULT 14
+#define LINUX_ENOTBLK 15
+#define LINUX_EBUSY 16
+#define LINUX_EEXIST 17
+#define LINUX_EXDEV 18
+#define LINUX_ENODEV 19
+#define LINUX_ENOTDIR 20
+#define LINUX_EISDIR 21
+#define LINUX_EINVAL 22
+#define LINUX_ENFILE 23
+#define LINUX_EMFILE 24
+#define LINUX_ENOTTY 25
+#define LINUX_ETXTBSY 26
+#define LINUX_EFBIG 27
+#define LINUX_ENOSPC 28
+#define LINUX_ESPIPE 29
+#define LINUX_EROFS 30
+#define LINUX_EMLINK 31
+#define LINUX_EPIPE 32
+#define LINUX_EDOM 33
+#define LINUX_ERANGE 34
+#define LINUX_EDEADLK 35
+#define LINUX_ENAMETOOLONG 36
+#define LINUX_ENOLCK 37
+#define LINUX_ENOSYS 38
+#define LINUX_ENOTEMPTY 39
+#define LINUX_ELOOP 40
+#define LINUX_ENOMSG 42
+#define LINUX_EIDRM 43
+#define LINUX_ECHRNG 44
+#define LINUX_EL2NSYNC 45
+#define LINUX_EL3HLT 46
+#define LINUX_EL3RST 47
+#define LINUX_ELNRNG 48
+#define LINUX_EUNATCH 49
+#define LINUX_ENOCSI 50
+#define LINUX_EL2HLT 51
+#define LINUX_EBADE 52
+#define LINUX_EBADR 53
+#define LINUX_EXFULL 54
+#define LINUX_ENOANO 55
+#define LINUX_EBADRQC 56
+#define LINUX_EBADSLT 57
+#define LINUX_EDEADLOCK 58
+#define LINUX_EBFONT 59
+#define LINUX_ENOSTR 60
+#define LINUX_ENODATA 61
+#define LINUX_ETIME 62
+#define LINUX_ENOSR 63
+#define LINUX_ENONET 64
+#define LINUX_ENOPKG 65
+#define LINUX_EREMOTE 66
+#define LINUX_ENOLINK 67
+#define LINUX_EADV 68
+#define LINUX_ESRMNT 69
+#define LINUX_ECOMM 70
+#define LINUX_EPROTO 71
+#define LINUX_EMULTIHOP 72
+#define LINUX_EDOTDOT 73
+#define LINUX_EBADMSG 74
+#define LINUX_EOVERFLOW 75
+#define LINUX_ENOTUNIQ 76
+#define LINUX_EBADFD 77
+#define LINUX_EREMCHG 78
+#define LINUX_ELIBACC 79
+#define LINUX_ELIBBAD 80
+#define LINUX_ELIBSCN 81
+#define LINUX_ELIBMAX 82
+#define LINUX_ELIBEXEC 83
+#define LINUX_EILSEQ 84
+#define LINUX_ERESTART 85
+#define LINUX_ESTRPIPE 86
+#define LINUX_EUSERS 87
+#define LINUX_ENOTSOCK 88
+#define LINUX_EDESTADDRREQ 89
+#define LINUX_EMSGSIZE 90
+#define LINUX_EPROTOTYPE 91
+#define LINUX_ENOPROTOOPT 92
+#define LINUX_EPROTONOSUPPORT 93
+#define LINUX_ESOCKTNOSUPPORT 94
+#define LINUX_EOPNOTSUPP 95
+#define LINUX_EPFNOSUPPORT 96
+#define LINUX_EAFNOSUPPORT 97
+#define LINUX_EADDRINUSE 98
+#define LINUX_EADDRNOTAVAIL 99
+#define LINUX_ENETDOWN 100
+#define LINUX_ENETUNREACH 101
+#define LINUX_ENETRESET 102
+#define LINUX_ECONNABORTED 103
+#define LINUX_ECONNRESET 104
+#define LINUX_ENOBUFS 105
+#define LINUX_EISCONN 106
+#define LINUX_ENOTCONN 107
+#define LINUX_ESHUTDOWN 108
+#define LINUX_ETOOMANYREFS 109
+#define LINUX_ETIMEDOUT 110
+#define LINUX_ECONNREFUSED 111
+#define LINUX_EHOSTDOWN 112
+#define LINUX_EHOSTUNREACH 113
+#define LINUX_EALREADY 114
+#define LINUX_EINPROGRESS 115
+#define LINUX_ESTALE 116
+#define LINUX_EUCLEAN 117
+#define LINUX_ENOTNAM 118
+#define LINUX_ENAVAIL 119
+#define LINUX_EISNAM 120
+#define LINUX_EREMOTEIO 121
+#define LINUX_EDQUOT 122
+
+#endif /* !_LINUX_ERRNO_H */
diff --git a/sys/compat/linux/include/linux_exec.h b/sys/compat/linux/include/linux_exec.h
new file mode 100644
index 00000000000..18349a2b5e3
--- /dev/null
+++ b/sys/compat/linux/include/linux_exec.h
@@ -0,0 +1,70 @@
+/* $NetBSD: linux_exec.h,v 1.1 1995/02/28 23:25:37 fvdl Exp $ */
+
+/*
+ * Copyright (c) 1995 Frank van der Linden
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed for the NetBSD Project
+ * by Frank van der Linden
+ * 4. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+#ifndef _LINUX_EXEC_H
+#define _LINUX_EXEC_H
+
+#define LINUX_M_I386 100
+/* Sparc? Alpha? */
+
+/* XXX linux_machdep.h ? */
+#ifdef i386
+#define LINUX_MID_MACHINE LINUX_M_I386
+#endif
+
+#define LINUX_AOUT_HDR_SIZE (sizeof (struct exec))
+
+#define LINUX_N_MAGIC(ep) ((ep)->a_midmag & 0xffff)
+#define LINUX_N_MACHTYPE(ep) (((ep)->a_midmag >> 16) & 0xff)
+
+#define LINUX_N_TXTOFF(x,m) \
+ ((m) == ZMAGIC ? 1024 : ((m) == QMAGIC ? 0 : sizeof (struct exec)))
+
+#define LINUX_N_DATOFF(x,m) (LINUX_N_TXTOFF(x,m) + (x).a_text)
+
+#define LINUX_N_TXTADDR(x,m) ((m) == QMAGIC ? PAGE_SIZE : 0)
+
+#define LINUX__N_SEGMENT_ROUND(x) (((x) + NBPG - 1) & ~(NBPG - 1))
+
+#define LINUX__N_TXTENDADDR(x,m) (LINUX_N_TXTADDR(x,m)+(x).a_text)
+
+#define LINUX_N_DATADDR(x,m) \
+ ((m)==OMAGIC? (LINUX__N_TXTENDADDR(x,m)) \
+ : (LINUX__N_SEGMENT_ROUND (LINUX__N_TXTENDADDR(x,m))))
+
+#define LINUX_N_BSSADDR(x,m) (LINUX_N_DATADDR(x,m) + (x).a_data)
+
+int exec_linux_aout_makecmds __P((struct proc *, struct exec_package *));
+
+#endif /* !_LINUX_EXEC_H */
diff --git a/sys/compat/linux/include/linux_fcntl.h b/sys/compat/linux/include/linux_fcntl.h
new file mode 100644
index 00000000000..4c34e7d3f45
--- /dev/null
+++ b/sys/compat/linux/include/linux_fcntl.h
@@ -0,0 +1,90 @@
+/* $NetBSD: linux_fcntl.h,v 1.1 1995/02/28 23:25:40 fvdl Exp $ */
+
+/*
+ * Copyright (c) 1995 Frank van der Linden
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed for the NetBSD Project
+ * by Frank van der Linden
+ * 4. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * Various flag values used in Linux for open(2) and fcntl(2).
+ */
+
+#ifndef _LINUX_FCNTL_H
+#define _LINUX_FCNTL_H
+
+/* read/write mode for open(2) (as usual) */
+#define LINUX_O_RDONLY 0x0000
+#define LINUX_O_WRONLY 0x0001
+#define LINUX_O_RDWR 0x0002
+#define LINUX_O_ACCMODE 0x0003
+
+/* flags used in open(2) */
+#define LINUX_O_CREAT 0x0040
+#define LINUX_O_EXCL 0x0080
+#define LINUX_O_NOCTTY 0x0100
+#define LINUX_O_TRUNC 0x0200
+#define LINUX_O_APPEND 0x0400
+#define LINUX_O_NDELAY 0x0800
+#define LINUX_O_SYNC 0x1000
+
+#define LINUX_FASYNC 0x2000
+
+/* fcntl(2) operations */
+#define LINUX_F_DUPFD 0
+#define LINUX_F_GETFD 1
+#define LINUX_F_SETFD 2
+#define LINUX_F_GETFL 3
+#define LINUX_F_SETFL 4
+#define LINUX_F_GETLK 5
+#define LINUX_F_SETLK 6
+#define LINUX_F_SETLKW 7
+#define LINUX_F_SETOWN 8
+#define LINUX_F_GETOWN 9
+
+#define LINUX_F_RDLCK 0
+#define LINUX_F_WRLCK 1
+#define LINUX_F_UNLCK 2
+
+#define LINUX_LOCK_EX 4
+#define LINUX_LOCK_SH 8
+
+/*
+ * The arguments in the flock structure have a different order from the
+ * BSD structure.
+ */
+
+struct linux_flock {
+ short l_type;
+ short l_whence;
+ linux_off_t l_start;
+ linux_off_t l_len;
+ linux_pid_t l_pid;
+};
+
+#endif /* _LINUX_FCNTL_H */
diff --git a/sys/compat/linux/include/linux_ioctl.h b/sys/compat/linux/include/linux_ioctl.h
new file mode 100644
index 00000000000..e779b3623f2
--- /dev/null
+++ b/sys/compat/linux/include/linux_ioctl.h
@@ -0,0 +1,277 @@
+/* $NetBSD: linux_ioctl.h,v 1.1 1995/02/28 23:25:43 fvdl Exp $ */
+
+/*
+ * Copyright (c) 1995 Frank van der Linden
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed for the NetBSD Project
+ * by Frank van der Linden
+ * 4. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef _LINUX_IOCTL_H
+#define _LINUX_IOCTL_H
+
+#define _LINUX_IO(c,n) (((c)<< 8) | (n))
+
+#define LINUX_TCGETS _LINUX_IO('T',1)
+#define LINUX_TCSETS _LINUX_IO('T',2)
+#define LINUX_TCSETSW _LINUX_IO('T',3)
+#define LINUX_TCSETSF _LINUX_IO('T',4)
+#define LINUX_TCGETA _LINUX_IO('T',5)
+#define LINUX_TCSETA _LINUX_IO('T',6)
+#define LINUX_TCSETAW _LINUX_IO('T',7)
+#define LINUX_TCSETAF _LINUX_IO('T',8)
+#define LINUX_TCSBRK _LINUX_IO('T',9)
+#define LINUX_TCXONC _LINUX_IO('T',10)
+#define LINUX_TCFLSH _LINUX_IO('T',11)
+#define LINUX_TIOCEXCL _LINUX_IO('T',12)
+#define LINUX_TIOCNXCL _LINUX_IO('T',13)
+#define LINUX_TIOCSCTTY _LINUX_IO('T',14)
+#define LINUX_TIOCGPGRP _LINUX_IO('T',15)
+#define LINUX_TIOCSPGRP _LINUX_IO('T',16)
+#define LINUX_TIOCOUTQ _LINUX_IO('T',17)
+#define LINUX_TIOCSTI _LINUX_IO('T',18)
+#define LINUX_TIOCGWINSZ _LINUX_IO('T',19)
+#define LINUX_TIOCSWINSZ _LINUX_IO('T',20)
+#define LINUX_TIOCMGET _LINUX_IO('T',21)
+#define LINUX_TIOCMBIS _LINUX_IO('T',22)
+#define LINUX_TIOCMBIC _LINUX_IO('T',23)
+#define LINUX_TIOCMSET _LINUX_IO('T',24)
+#define LINUX_TIOCGSOFTCAR _LINUX_IO('T',25)
+#define LINUX_TIOCSSOFTCAR _LINUX_IO('T',26)
+#define LINUX_FIONREAD _LINUX_IO('T',27)
+#define LINUX_TIOCINQ LINUX_FIONREAD
+#define LINUX_TIOCLINUX _LINUX_IO('T',28)
+#define LINUX_TIOCCONS _LINUX_IO('T',29)
+#define LINUX_TIOCGSERIAL _LINUX_IO('T',30)
+#define LINUX_TIOCSSERIAL _LINUX_IO('T',31)
+#define LINUX_TIOCPKT _LINUX_IO('T',32)
+#define LINUX_FIONBIO _LINUX_IO('T',33)
+#define LINUX_TIOCNOTTY _LINUX_IO('T',34)
+#define LINUX_TIOCSETD _LINUX_IO('T',35)
+#define LINUX_TIOCGETD _LINUX_IO('T',36)
+#define LINUX_TCSBRKP _LINUX_IO('T',37)
+#define LINUX_TIOCTTYGSTRUCT _LINUX_IO('T',38)
+
+#define LINUX_FIONCLEX _LINUX_IO('T',80)
+#define LINUX_FIOCLEX _LINUX_IO('T',81)
+#define LINUX_FIOASYNC _LINUX_IO('T',82)
+#define LINUX_TIOCSERCONFIG _LINUX_IO('T',83)
+#define LINUX_TIOCSERGWILD _LINUX_IO('T',84)
+#define LINUX_TIOCSERSWILD _LINUX_IO('T',85)
+#define LINUX_TIOCGLCKTRMIOS _LINUX_IO('T',86)
+#define LINUX_TIOCSLCKTRMIOS _LINUX_IO('T',87)
+#define LINUX_TIOCSERGSTRUCT _LINUX_IO('T',88)
+#define LINUX_TIOCSERGETLSR _LINUX_IO('T',89)
+
+
+#define LINUX_NCC 8
+struct linux_termio {
+ unsigned short c_iflag;
+ unsigned short c_oflag;
+ unsigned short c_cflag;
+ unsigned short c_lflag;
+ unsigned char c_line;
+ unsigned char c_cc[LINUX_NCC];
+};
+
+typedef unsigned char linux_cc_t;
+typedef unsigned long linux_tcflag_t;
+
+#define LINUX_NCCS 19
+struct linux_termios {
+ linux_tcflag_t c_iflag;
+ linux_tcflag_t c_oflag;
+ linux_tcflag_t c_cflag;
+ linux_tcflag_t c_lflag;
+ linux_cc_t c_line;
+ linux_cc_t c_cc[LINUX_NCCS];
+};
+
+/* Just in old style linux_termio struct */
+#define LINUX_VINTR 0
+#define LINUX_VQUIT 1
+#define LINUX_VERASE 2
+#define LINUX_VKILL 3
+#define LINUX_VEOF 4
+#define LINUX_VTIME 5
+#define LINUX_VMIN 6
+#define LINUX_VSWTC 7
+
+/* In the termios struct too */
+#define LINUX_VSTART 8
+#define LINUX_VSTOP 9
+#define LINUX_VSUSP 10
+#define LINUX_VEOL 11
+#define LINUX_VREPRINT 12
+#define LINUX_VDISCARD 13
+#define LINUX_VWERASE 14
+#define LINUX_VLNEXT 15
+#define LINUX_VEOL2 16
+
+/* Linux c_iflag masks */
+#define LINUX_IGNBRK 0x0000001
+#define LINUX_BRKINT 0x0000002
+#define LINUX_IGNPAR 0x0000004
+#define LINUX_PARMRK 0x0000008
+#define LINUX_INPCK 0x0000010
+#define LINUX_ISTRIP 0x0000020
+#define LINUX_INLCR 0x0000040
+#define LINUX_IGNCR 0x0000080
+#define LINUX_ICRNL 0x0000100
+#define LINUX_IUCLC 0x0000200
+#define LINUX_IXON 0x0000400
+#define LINUX_IXANY 0x0000800
+#define LINUX_IXOFF 0x0001000
+#define LINUX_IMAXBEL 0x0002000
+
+/* Linux c_oflag masks */
+#define LINUX_OPOST 0x0000001
+#define LINUX_OLCUC 0x0000002
+#define LINUX_ONLCR 0x0000004
+#define LINUX_OCRNL 0x0000008
+#define LINUX_ONOCR 0x0000010
+#define LINUX_ONLRET 0x0000020
+#define LINUX_OFILL 0x0000040
+#define LINUX_OFDEL 0x0000080
+#define LINUX_NLDLY 0x0000100
+
+#define LINUX_NL0 0x0000000
+#define LINUX_NL1 0x0000100
+#define LINUX_CRDLY 0x0000600
+#define LINUX_CR0 0x0000000
+#define LINUX_CR1 0x0000200
+#define LINUX_CR2 0x0000400
+#define LINUX_CR3 0x0000600
+#define LINUX_TABDLY 0x0001800
+#define LINUX_TAB0 0x0000000
+#define LINUX_TAB1 0x0000800
+#define LINUX_TAB2 0x0001000
+#define LINUX_TAB3 0x0001800
+#define LINUX_XTABS 0x0001800
+#define LINUX_BSDLY 0x0002000
+#define LINUX_BS0 0x0000000
+#define LINUX_BS1 0x0002000
+#define LINUX_VTDLY 0x0004000
+#define LINUX_VT0 0x0000000
+#define LINUX_VT1 0x0004000
+#define LINUX_FFDLY 0x0008000
+#define LINUX_FF0 0x0000000
+#define LINUX_FF1 0x0008000
+
+/* Linux c_cflag bit masks */
+
+#define LINUX_NSPEEDS 16
+#define LINUX_NXSPEEDS 2
+
+#define LINUX_CBAUD 0x0000100f
+
+#define LINUX_B0 0x00000000
+#define LINUX_B50 0x00000001
+#define LINUX_B75 0x00000002
+#define LINUX_B110 0x00000003
+#define LINUX_B134 0x00000004
+#define LINUX_B150 0x00000005
+#define LINUX_B200 0x00000006
+#define LINUX_B300 0x00000007
+#define LINUX_B600 0x00000008
+#define LINUX_B1200 0x00000009
+#define LINUX_B1800 0x0000000a
+#define LINUX_B2400 0x0000000b
+#define LINUX_B4800 0x0000000c
+#define LINUX_B9600 0x0000000d
+#define LINUX_B19200 0x0000000e
+#define LINUX_B38400 0x0000000f
+#define LINUX_EXTA LINUX_B19200
+#define LINUX_EXTB LINUX_B38400
+#define LINUX_CBAUDEX 0x00001000
+#define LINUX_B57600 0x00001001
+#define LINUX_B115200 0x00001002
+
+#define LINUX_CSIZE 0x00000030
+#define LINUX_CS5 0x00000000
+#define LINUX_CS6 0x00000010
+#define LINUX_CS7 0x00000020
+#define LINUX_CS8 0x00000030
+#define LINUX_CSTOPB 0x00000040
+#define LINUX_CREAD 0x00000080
+#define LINUX_PARENB 0x00000100
+#define LINUX_PARODD 0x00000200
+#define LINUX_HUPCL 0x00000400
+#define LINUX_CLOCAL 0x00000800
+
+#define LINUX_CRTSCTS 0x80000000
+
+/* Linux c_lflag masks */
+#define LINUX_ISIG 0x00000001
+#define LINUX_ICANON 0x00000002
+#define LINUX_XCASE 0x00000004
+#define LINUX_ECHO 0x00000008
+#define LINUX_ECHOE 0x00000010
+#define LINUX_ECHOK 0x00000020
+#define LINUX_ECHONL 0x00000040
+#define LINUX_NOFLSH 0x00000080
+#define LINUX_TOSTOP 0x00000100
+#define LINUX_ECHOCTL 0x00000200
+#define LINUX_ECHOPRT 0x00000400
+#define LINUX_ECHOKE 0x00000800
+#define LINUX_FLUSHO 0x00001000
+#define LINUX_PENDIN 0x00002000
+#define LINUX_IEXTEN 0x00008000
+
+/* Linux modem line defines.. not sure if they'll be used */
+#define LINUX_TIOCM_LE 0x0001
+#define LINUX_TIOCM_DTR 0x0002
+#define LINUX_TIOCM_RTS 0x0004
+#define LINUX_TIOCM_ST 0x0008
+#define LINUX_TIOCM_SR 0x0010
+#define LINUX_TIOCM_CTS 0x0020
+#define LINUX_TIOCM_CAR 0x0040
+#define LINUX_TIOCM_RNG 0x0080
+#define LINUX_TIOCM_DSR 0x0100
+#define LINUX_TIOCM_CD LINUX_TIOCM_CAR
+#define LINUX_TIOCM_RI LINUX_TIOCM_RNG
+
+#define LINUX_TCIFLUSH 0
+#define LINUX_TCOFLUSH 1
+#define LINUX_TCIOFLUSH 2
+
+#define LINUX_TCOOFF 0
+#define LINUX_TCOON 1
+#define LINUX_TCIOFF 2
+#define LINUX_TCION 3
+
+#define LINUX_TCSANOW 0
+#define LINUX_TCSADRAIN 1
+#define LINUX_TCSAFLUSH 2
+
+/* Linux line disciplines */
+#define LINUX_N_TTY 0
+#define LINUX_N_SLIP 1
+#define LINUX_N_MOUSE 2
+#define LINUX_N_PPP 3
+
+#endif /* !_LINUX_IOCTL_H */
diff --git a/sys/compat/linux/include/linux_ipc.h b/sys/compat/linux/include/linux_ipc.h
new file mode 100644
index 00000000000..1f9245f6ed8
--- /dev/null
+++ b/sys/compat/linux/include/linux_ipc.h
@@ -0,0 +1,64 @@
+/* $NetBSD: linux_ipc.h,v 1.1 1995/02/28 23:25:47 fvdl Exp $ */
+
+/*
+ * Copyright (c) 1995 Frank van der Linden
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed for the NetBSD Project
+ * by Frank van der Linden
+ * 4. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef _LINUX_IPC_H
+#define _LINUX_IPC_H
+
+/*
+ * Structs and values to handle the SYSV ipc/shm/msg calls implemented
+ * in Linux. Most values match the NetBSD values (as they are both derived
+ * from SysV values). Values that are the same may not be defined here.
+ */
+
+typedef int linux_key_t;
+
+/*
+ * The only thing different about the Linux ipc_perm structure is the
+ * order of the fields.
+ */
+struct linux_ipc_perm {
+ linux_key_t l_key;
+ ushort l_uid;
+ ushort l_gid;
+ ushort l_cuid;
+ ushort l_cgid;
+ ushort l_mode;
+ ushort l_seq;
+};
+
+#define LINUX_IPC_RMID 0
+#define LINUX_IPC_SET 1
+#define LINUX_IPC_STAT 2
+#define LINUX_IPC_INFO 3
+
+#endif /* _LINUX_IPC_H */
diff --git a/sys/compat/linux/include/linux_ipccall.h b/sys/compat/linux/include/linux_ipccall.h
new file mode 100644
index 00000000000..42f166b5402
--- /dev/null
+++ b/sys/compat/linux/include/linux_ipccall.h
@@ -0,0 +1,63 @@
+/* $NetBSD: linux_ipccall.h,v 1.1 1995/02/28 23:25:50 fvdl Exp $ */
+
+/*
+ * Copyright (c) 1995 Frank van der Linden
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed for the NetBSD Project
+ * by Frank van der Linden
+ * 4. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef _LINUX_IPC_CALL_H
+#define _LINUX_IPC_CALL_H
+
+/*
+ * Defines for the numbers passes as the first argument to the
+ * linux_ipc() call, and based on which the actual system calls
+ * are made.
+ */
+#define LINUX_SYS_semop 1
+#define LINUX_SYS_semget 2
+#define LINUX_SYS_semctl 3
+#define LINUX_SYS_msgsnd 11
+#define LINUX_SYS_msgrcv 12
+#define LINUX_SYS_msgget 13
+#define LINUX_SYS_msgctl 14
+#define LINUX_SYS_shmat 21
+#define LINUX_SYS_shmdt 22
+#define LINUX_SYS_shmget 23
+#define LINUX_SYS_shmctl 24
+
+/*
+ * This kludge is used for the 6th argument to the msgrcv system
+ * call, to get around the maximum of 5 arguments to a syscall in Linux.
+ */
+struct linux_ipc_kludge {
+ struct linux_msgbuf *msg;
+ int type;
+};
+
+#endif /* _LINUX_IPC_CALL_H */
diff --git a/sys/compat/linux/include/linux_mmap.h b/sys/compat/linux/include/linux_mmap.h
new file mode 100644
index 00000000000..3b13dcc0c46
--- /dev/null
+++ b/sys/compat/linux/include/linux_mmap.h
@@ -0,0 +1,53 @@
+/* $NetBSD: linux_mmap.h,v 1.1 1995/02/28 23:25:52 fvdl Exp $ */
+/*
+ * Copyright (c) 1995 Frank van der Linden
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed for the NetBSD Project
+ * by Frank van der Linden
+ * 4. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef _LINUX_MMAP_H
+#define _LINUX_MMAP_H
+
+#define LINUX_PROT_NONE 0x00
+#define LINUX_PROT_READ 0x01
+#define LINUX_PROT_WRITE 0x02
+#define LINUX_PROT_EXEC 0x04
+
+#define LINUX_MAP_SHARED 0x0001
+#define LINUX_MAP_PRIVATE 0x0002
+
+#define LINUX_MAP_FIXED 0x0010
+#define LINUX_MAP_ANON 0x0020
+
+/* the following flags are silently ignored */
+
+#define LINUX_MAP_GROWSDOWN 0x0400
+#define LINUX_MAP_DENYWRITE 0x0800
+#define LINUX_MAP_EXECUTABLE 0x1000
+
+#endif /* !_LINUX_MMAP_H */
diff --git a/sys/compat/linux/include/linux_msg.h b/sys/compat/linux/include/linux_msg.h
new file mode 100644
index 00000000000..9abd614f8b5
--- /dev/null
+++ b/sys/compat/linux/include/linux_msg.h
@@ -0,0 +1,85 @@
+/* $NetBSD: linux_msg.h,v 1.1 1995/02/28 23:25:54 fvdl Exp $ */
+
+/*
+ * Copyright (c) 1995 Frank van der Linden
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed for the NetBSD Project
+ * by Frank van der Linden
+ * 4. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef _LINUX_MSG_H
+#define _LINUX_MSG_H
+
+/*
+ * msq_id_ds structure. Mostly the same fields, except for some internal
+ * ones.
+ */
+struct linux_msqid_ds {
+ struct linux_ipc_perm l_msg_perm;
+ struct linux_msg *l_msg_first;
+ struct linux_msg *l_msg_last;
+ linux_time_t l_msg_stime;
+ linux_time_t l_msg_rtime;
+ linux_time_t l_msg_ctime;
+ void *l_wwait; /* Linux internal */
+ void *l_rwait; /* Linux internal */
+ ushort l_msg_cbytes;
+ ushort l_msg_qnum;
+ ushort l_msg_qbytes;
+ ushort l_msg_lspid;
+ ushort l_msg_lrpid;
+};
+
+#define LINUX_MSG_NOERROR 0x1000
+#define LINUX_MSG_EXCEPT 0x2000
+
+/*
+ * The notorious anonymous message structure.
+ */
+struct linux_mymsg {
+ long l_mtype;
+ char l_mtext[1];
+};
+
+/*
+ * For msgctl calls.
+ */
+struct linux_msginfo {
+ int l_msgpool;
+ int l_msgmap;
+ int l_msgmax;
+ int l_msgmnb;
+ int l_msgmni;
+ int l_msgssz;
+ int l_msgtql;
+ ushort l_msgseg;
+};
+
+#define LINUX_MSG_STAT 11
+#define LINUX_MSG_INFO 12
+
+#endif /* _LINUX_MSG_H */
diff --git a/sys/compat/linux/include/linux_shm.h b/sys/compat/linux/include/linux_shm.h
new file mode 100644
index 00000000000..098595062d1
--- /dev/null
+++ b/sys/compat/linux/include/linux_shm.h
@@ -0,0 +1,63 @@
+/* $NetBSD: linux_shm.h,v 1.1 1995/02/28 23:25:57 fvdl Exp $ */
+
+/*
+ * Copyright (c) 1995 Frank van der Linden
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed for the NetBSD Project
+ * by Frank van der Linden
+ * 4. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef _LINUX_SHM_H
+#define _LINUX_SHM_H
+
+/*
+ * shm segment control structure
+ */
+struct linux_shmid_ds {
+ struct linux_ipc_perm l_shm_perm;
+ int l_shm_segsz;
+ linux_time_t l_shm_atime;
+ linux_time_t l_shm_dtime;
+ linux_time_t l_shm_ctime;
+ ushort l_shm_cpid;
+ ushort l_shm_lpid;
+ short l_shm_nattch;
+ ushort l_private1;
+ void *l_private2;
+ void *l_private3;
+};
+
+#define LINUX_SHM_RDONLY 0x1000
+#define LINUX_SHM_RND 0x2000
+#define LINUX_SHM_REMAP 0x4000
+
+#define LINUX_SHM_LOCK 11
+#define LINUX_SHM_UNLOCK 12
+#define LINUX_SHM_STAT 13
+#define LINUX_SHM_INFO 14
+
+#endif /* _LINUX_SHM_H */
diff --git a/sys/compat/linux/include/linux_signal.h b/sys/compat/linux/include/linux_signal.h
new file mode 100644
index 00000000000..46c5ad4cbc6
--- /dev/null
+++ b/sys/compat/linux/include/linux_signal.h
@@ -0,0 +1,88 @@
+/* $NetBSD: linux_signal.h,v 1.1 1995/02/28 23:26:01 fvdl Exp $ */
+
+/*
+ * Copyright (c) 1995 Frank van der Linden
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed for the NetBSD Project
+ * by Frank van der Linden
+ * 4. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef _LINUX_SIGNAL_H
+#define _LINUX_SIGNAL_H
+
+#define LINUX_NSIG 32
+
+/* sigaction flags */
+
+#define LINUX_SA_NOCLDSTOP 0x00000001
+#define LINUX_SA_ONSTACK 0x08000000
+#define LINUX_SA_RESTART 0x10000000
+#define LINUX_SA_INTERRUPT 0x20000000
+#define LINUX_SA_NOMASK 0x40000000
+#define LINUX_SA_ONESHOT 0x80000000
+
+/* sigprocmask actions */
+
+#define LINUX_SIG_BLOCK 0
+#define LINUX_SIG_UNBLOCK 1
+#define LINUX_SIG_SETMASK 2
+
+/* signal numbers */
+
+#define LINUX_SIGHUP 1
+#define LINUX_SIGINT 2
+#define LINUX_SIGQUIT 3
+#define LINUX_SIGILL 4
+#define LINUX_SIGTRAP 5
+#define LINUX_SIGABRT 6
+#define LINUX_SIGIOT 6
+#define LINUX_SIGBUS 7
+#define LINUX_SIGFPE 8
+#define LINUX_SIGKILL 9
+#define LINUX_SIGUSR1 10
+#define LINUX_SIGSEGV 11
+#define LINUX_SIGUSR2 12
+#define LINUX_SIGPIPE 13
+#define LINUX_SIGALRM 14
+#define LINUX_SIGTERM 15
+#define LINUX_SIGSTKFLT 16
+#define LINUX_SIGCHLD 17
+#define LINUX_SIGCONT 18
+#define LINUX_SIGSTOP 19
+#define LINUX_SIGTSTP 20
+#define LINUX_SIGTTIN 21
+#define LINUX_SIGTTOU 22
+#define LINUX_SIGURG 23
+#define LINUX_SIGXCPU 24
+#define LINUX_SIGXFSZ 25
+#define LINUX_SIGVTALRM 26
+#define LINUX_SIGPROF 27
+#define LINUX_SIGWINCH 28
+#define LINUX_SIGIO 29
+#define LINUX_SIGPWR 30
+
+#endif /* !_LINUX_SIGNAL_H */
diff --git a/sys/compat/linux/include/linux_socket.h b/sys/compat/linux/include/linux_socket.h
new file mode 100644
index 00000000000..aa47360712d
--- /dev/null
+++ b/sys/compat/linux/include/linux_socket.h
@@ -0,0 +1,96 @@
+/* $NetBSD: linux_socket.h,v 1.1 1995/02/28 23:26:03 fvdl Exp $ */
+
+/*
+ * Copyright (c) 1995 Frank van der Linden
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed for the NetBSD Project
+ * by Frank van der Linden
+ * 4. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef _LINUX_SOCKET_H
+#define _LINUX_SOCKET_H
+
+/*
+ * Various Linux socket defines. Everything that is not re-defined here
+ * is the same as in NetBSD.
+ *
+ * COMPAT_43 is assumed, and the osockaddr struct is used (it is what
+ * Linux uses)
+ */
+
+/*
+ * Address families. There are fewer of them, and they're numbered
+ * a bit different
+ */
+
+#define LINUX_AF_UNSPEC 0
+#define LINUX_AF_UNIX 1
+#define LINUX_AF_INET 2
+#define LINUX_AF_AX25 3
+#define LINUX_AF_IPX 4
+#define LINUX_AF_APPLETALK 5
+
+/*
+ * Option levels for [gs]etsockopt(2). Only SOL_SOCKET is different,
+ * the rest matches IPPROTO_XXX
+ */
+
+#define LINUX_SOL_SOCKET 1
+#define LINUX_SOL_IP 0
+#define LINUX_SOL_IPX 256
+#define LINUX_SOL_AX25 257
+#define LINUX_SOL_TCP 6
+#define LINUX_SOL_UDP 17
+
+/*
+ * Options for [gs]etsockopt(2), socket level. For Linux, they
+ * are not masks, but just increasing numbers.
+ */
+
+#define LINUX_SO_DEBUG 1
+#define LINUX_SO_REUSEADDR 2
+#define LINUX_SO_TYPE 3
+#define LINUX_SO_ERROR 4
+#define LINUX_SO_DONTROUTE 5
+#define LINUX_SO_BROADCAST 6
+#define LINUX_SO_SNDBUF 7
+#define LINUX_SO_RCVBUF 8
+#define LINUX_SO_KEEPALIVE 9
+#define LINUX_SO_OOBINLINE 10
+#define LINUX_SO_NO_CHECK 11
+#define LINUX_SO_PRIORITY 12
+#define LINUX_SO_LINGER 13
+
+/*
+ * Options vor [gs]etsockopt(2), IP level. Only 2 of them are
+ * currently implemented in Linux
+ */
+
+#define LINUX_IP_TOS 1
+#define LINUX_IP_TTL 2
+
+#endif /* _LINUX_SOCKET_H */
diff --git a/sys/compat/linux/include/linux_socketcall.h b/sys/compat/linux/include/linux_socketcall.h
new file mode 100644
index 00000000000..60b1156f2bc
--- /dev/null
+++ b/sys/compat/linux/include/linux_socketcall.h
@@ -0,0 +1,162 @@
+/* $NetBSD: linux_socketcall.h,v 1.1 1995/02/28 23:26:05 fvdl Exp $ */
+
+/*
+ * Copyright (c) 1995 Frank van der Linden
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed for the NetBSD Project
+ * by Frank van der Linden
+ * 4. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef _LINUX_SOCKETCALL_H
+#define _LINUX_SOCKETCALL_H
+
+/*
+ * Values passed to the Linux socketcall() syscall, determining the actual
+ * action to take.
+ */
+#define LINUX_SYS_socket 1
+#define LINUX_SYS_bind 2
+#define LINUX_SYS_connect 3
+#define LINUX_SYS_listen 4
+#define LINUX_SYS_accept 5
+#define LINUX_SYS_getsockname 6
+#define LINUX_SYS_getpeername 7
+#define LINUX_SYS_socketpair 8
+#define LINUX_SYS_send 9
+#define LINUX_SYS_recv 10
+#define LINUX_SYS_sendto 11
+#define LINUX_SYS_recvfrom 12
+#define LINUX_SYS_shutdown 13
+#define LINUX_SYS_setsockopt 14
+#define LINUX_SYS_getsockopt 15
+
+/*
+ * Structures for the arguments of the different system calls. This looks
+ * a little better than copyin() of all values one by one.
+ */
+struct linux_socket_args {
+ int domain;
+ int type;
+ int protocol;
+};
+
+struct linux_bind_args {
+ int s;
+ struct sockaddr *name;
+ int namelen;
+};
+
+struct linux_connect_args {
+ int s;
+ struct sockaddr *name;
+ int namelen;
+};
+
+struct linux_listen_args {
+ int s;
+ int backlog;
+};
+
+struct linux_accept_args {
+ int s;
+ struct sockaddr *addr;
+ int *namelen;
+};
+
+struct linux_getsockname_args {
+ int s;
+ struct sockaddr *addr;
+ int *namelen;
+};
+
+struct linux_getpeername_args {
+ int s;
+ struct sockaddr *addr;
+ int *namelen;
+};
+
+struct linux_socketpair_args {
+ int domain;
+ int type;
+ int protocol;
+ int *rsv;
+};
+
+struct linux_send_args {
+ int s;
+ void *msg;
+ int len;
+ int flags;
+};
+
+struct linux_recv_args {
+ int s;
+ void *msg;
+ int len;
+ int flags;
+};
+
+struct linux_sendto_args {
+ int s;
+ void *msg;
+ int len;
+ int flags;
+ struct sockaddr *to;
+ int tolen;
+};
+
+struct linux_recvfrom_args {
+ int s;
+ void *buf;
+ int len;
+ int flags;
+ struct sockaddr *from;
+ int *fromlen;
+};
+
+struct linux_shutdown_args {
+ int s;
+ int how;
+};
+
+struct linux_getsockopt_args {
+ int s;
+ int level;
+ int optname;
+ void *optval;
+ int *optlen;
+};
+
+struct linux_setsockopt_args {
+ int s;
+ int level;
+ int optname;
+ void *optval;
+ int optlen;
+};
+
+#endif /* _LINUX_SOCKETCALL_H */
diff --git a/sys/compat/linux/include/linux_sockio.h b/sys/compat/linux/include/linux_sockio.h
new file mode 100644
index 00000000000..8ef399cd416
--- /dev/null
+++ b/sys/compat/linux/include/linux_sockio.h
@@ -0,0 +1,39 @@
+/* $NetBSD: linux_sockio.h,v 1.1 1995/02/28 23:26:08 fvdl Exp $ */
+
+/*
+ * Copyright (c) 1995 Frank van der Linden
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed for the NetBSD Project
+ * by Frank van der Linden
+ * 4. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef _LINUX_SOCKIO_H
+#define _LINUX_SOCKIO_H
+/*
+ * Empty for the moment, will contain Linux socket ioctl() definitions.
+ */
+#endif /* _LINUX_SOCKIO_H */
diff --git a/sys/compat/linux/include/linux_types.h b/sys/compat/linux/include/linux_types.h
new file mode 100644
index 00000000000..7c1a5f99c4e
--- /dev/null
+++ b/sys/compat/linux/include/linux_types.h
@@ -0,0 +1,132 @@
+/* $NetBSD: linux_types.h,v 1.1 1995/02/28 23:26:14 fvdl Exp $ */
+
+/*
+ * Copyright (c) 1995 Frank van der Linden
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed for the NetBSD Project
+ * by Frank van der Linden
+ * 4. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef _LINUX_TYPES_H
+#define _LINUX_TYPES_H
+
+
+typedef unsigned short linux_uid_t;
+typedef unsigned short linux_gid_t;
+typedef unsigned short linux_dev_t;
+typedef unsigned long linux_ino_t;
+typedef unsigned short linux_mode_t;
+typedef unsigned short linux_nlink_t;
+typedef long linux_time_t;
+typedef long linux_clock_t;
+typedef long linux_off_t;
+typedef int linux_pid_t;
+typedef unsigned long linux_sigset_t;
+typedef void (*linux_handler_t)(int);
+
+struct linux_statfs {
+ int dummy; /* Not filled in yet */
+};
+
+/*
+ * Structure for uname(2)
+ */
+struct linux_utsname {
+ char l_sysname[65];
+ char l_nodename[65];
+ char l_release[65];
+ char l_version[65];
+ char l_machine[65];
+ char l_domainname[65];
+};
+
+struct linux_sigaction {
+ void (*sa_handler)(int);
+ linux_sigset_t sa_mask;
+ unsigned long sa_flags;
+ void (*sa_restorer)(void);
+};
+
+/*
+ * Passed to the mmap() system call
+ */
+struct linux_mmap {
+ caddr_t lm_addr;
+ int lm_len;
+ int lm_prot;
+ int lm_flags;
+ int lm_fd;
+ int lm_pos;
+};
+
+/*
+ * Passed to the select() system call
+ */
+struct linux_select {
+ int nfds;
+ fd_set *readfds;
+ fd_set *writefds;
+ fd_set *exceptfds;
+ struct timeval *timeout;
+};
+
+struct linux_stat {
+ linux_dev_t lst_dev;
+ unsigned short pad1;
+ linux_ino_t lst_ino;
+ linux_mode_t lst_mode;
+ linux_nlink_t lst_nlink;
+ linux_uid_t lst_uid;
+ linux_gid_t lst_gid;
+ linux_dev_t lst_rdev;
+ unsigned short pad2;
+ linux_off_t lst_size;
+ unsigned long lst_blksize;
+ unsigned long lst_blocks;
+ linux_time_t lst_atime;
+ unsigned long unused1;
+ linux_time_t lst_mtime;
+ unsigned long unused2;
+ linux_time_t lst_ctime;
+ unsigned long unused3;
+ unsigned long unused4;
+ unsigned long unused5;
+};
+
+struct linux_tms {
+ linux_clock_t ltms_utime;
+ linux_clock_t ltms_stime;
+ linux_clock_t ltms_cutime;
+ linux_clock_t ltms_cstime;
+};
+
+struct linux_utimbuf {
+ linux_time_t l_actime;
+ linux_time_t l_modtime;
+};
+
+#endif /* !_LINUX_TYPES_H */
diff --git a/sys/compat/linux/include/linux_util.h b/sys/compat/linux/include/linux_util.h
new file mode 100644
index 00000000000..a720ddf476d
--- /dev/null
+++ b/sys/compat/linux/include/linux_util.h
@@ -0,0 +1,75 @@
+/* $NetBSD: linux_util.h,v 1.1 1995/02/28 23:26:17 fvdl Exp $ */
+
+/*
+ * Copyright (c) 1994 Christos Zoulas
+ * Copyright (c) 1995 Frank van der Linden
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * from: svr4_util.h,v 1.5 1994/11/18 02:54:31 christos Exp
+ */
+
+/*
+ * This file is pretty much the same as Christos' svr4_util.h
+ * (for now).
+ */
+
+#ifndef _LINUX_UTIL_H_
+#define _LINUX_UTIL_H_
+
+#include <machine/vmparam.h>
+#include <sys/exec.h>
+#include <sys/cdefs.h>
+
+#define cvtto_linux_mask(flags,bmask,lmask) (((flags) & bmask) ? lmask : 0)
+#define cvtto_bsd_mask(flags,lmask,bmask) (((flags) & lmask) ? bmask : 0)
+
+static __inline caddr_t
+stackgap_init()
+{
+ extern char sigcode[], esigcode[];
+#define szsigcode ((caddr_t)(esigcode - sigcode))
+ return STACKGAPBASE;
+}
+
+
+static __inline void *
+stackgap_alloc(sgp, sz)
+ caddr_t *sgp;
+ size_t sz;
+{
+ void *p = (void *) *sgp;
+ *sgp += ALIGN(sz);
+ return p;
+}
+
+extern const char linux_emul_path[];
+
+int linux_emul_find __P((struct proc *, caddr_t *, const char *, char *,
+ char **));
+
+#define CHECK_ALT(p, sgp, path) \
+ linux_emul_find(p, sgp, linux_emul_path, path, &(path))
+
+#endif /* !_LINUX_UTIL_H_ */