2 /* $OpenBSD: compat_linux.h,v 1.8 2007/06/16 00:26:33 deraadt Exp $ */
5 * Copyright (c) 2005 Uwe Stuehler <uwe@bsdx.de>
7 * Permission to use, copy, modify, and distribute this software for any
8 * purpose with or without fee is hereby granted, provided that the above
9 * copyright notice and this permission notice appear in all copies.
11 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
12 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
13 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
14 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
15 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
16 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
17 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
20 /* This file must be included late, for redefinitions to take effect. */
24 #include <sys/param.h>
25 #include <sys/termios.h>
26 #include <sys/fd_set.h>
30 #include <compat/linux/common/linux_types.h>
31 #include <compat/linux/common/linux_fcntl.h>
32 #include <compat/linux/common/linux_util.h>
33 #include <compat/linux/common/linux_ioctl.h>
34 #include <compat/linux/common/linux_errno.h>
36 #define INT_LIMIT(x) (~((x)1 << (sizeof(x) * 8 - 1)))
37 #define OFFSET_MAX INT_LIMIT(long long)
38 #define OFFT_OFFSET_MAX INT_LIMIT(long)
45 #define LINUX_EOVERFLOW 75
49 #include <compat/linux/linux_syscall.h>
51 /* linux/asm/unistd.h */
52 #define __NR_SYSCALL_BASE 0x900000
53 #define __NR_exit (__NR_SYSCALL_BASE + LINUX_SYS_exit)
54 #define __NR_read (__NR_SYSCALL_BASE + LINUX_SYS_read)
55 #define __NR_write (__NR_SYSCALL_BASE + LINUX_SYS_write)
56 #define __NR_open (__NR_SYSCALL_BASE + LINUX_SYS_open)
57 #define __NR_close (__NR_SYSCALL_BASE + LINUX_SYS_close)
58 #define __NR_time (__NR_SYSCALL_BASE + LINUX_SYS_time)
59 #define __NR_lseek32 (__NR_SYSCALL_BASE + LINUX_SYS_lseek)
60 #define __NR_ioctl (__NR_SYSCALL_BASE + LINUX_SYS_ioctl)
61 #define __NR_select (__NR_SYSCALL_BASE + LINUX_SYS_select)
62 #define __NR_stat (__NR_SYSCALL_BASE + LINUX_SYS_stat)
63 #define __NR_syscall (__NR_SYSCALL_BASE + 113)
66 #define SYS_select __NR_select