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