Commit 84778508 authored by blueswir1's avatar blueswir1

Preliminary BSD user emulator support

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5544 c046a42c-6fe2-441c-8c8c-71466251a162
parent 46f42f29
......@@ -469,6 +469,111 @@ $(QEMU_PROG): $(OBJS)
endif #CONFIG_DARWIN_USER
#########################################################
# BSD user emulator target
ifdef CONFIG_BSD_USER
VPATH+=:$(SRC_PATH)/bsd-user
CPPFLAGS+=-I$(SRC_PATH)/bsd-user -I$(SRC_PATH)/bsd-user/$(TARGET_ARCH)
ifdef CONFIG_STATIC
LDFLAGS+=-static
endif
ifeq ($(ARCH),i386)
ifdef TARGET_GPROF
USE_I386_LD=y
endif
ifdef CONFIG_STATIC
USE_I386_LD=y
endif
ifdef USE_I386_LD
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
else
# WARNING: this LDFLAGS is _very_ tricky : qemu is an ELF shared object
# that the kernel ELF loader considers as an executable. I think this
# is the simplest way to make it self virtualizable!
LDFLAGS+=-Wl,-shared
endif
endif
ifeq ($(ARCH),x86_64)
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
endif
ifeq ($(ARCH),ppc)
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
endif
ifeq ($(ARCH),ppc64)
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
endif
ifeq ($(ARCH),s390)
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
endif
ifeq ($(ARCH),sparc)
# -static is used to avoid g1/g3 usage by the dynamic linker
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld -static
endif
ifeq ($(ARCH),sparc64)
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
endif
ifeq ($(ARCH),alpha)
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
endif
ifeq ($(ARCH),ia64)
LDFLAGS+=-Wl,-G0 -Wl,-T,$(SRC_PATH)/$(ARCH).ld
endif
ifeq ($(ARCH),arm)
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
endif
ifeq ($(ARCH),m68k)
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
endif
ifeq ($(ARCH),mips)
ifeq ($(WORDS_BIGENDIAN),yes)
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
else
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH)el.ld
endif
endif
ifeq ($(ARCH),mips64)
ifeq ($(WORDS_BIGENDIAN),yes)
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
else
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH)el.ld
endif
endif
OBJS= main.o bsdload.o elfload.o mmap.o path.o signal.o strace.o syscall.o
OBJS+= uaccess.o
OBJS+= libqemu.a
ifdef CONFIG_GDBSTUB
OBJS+=gdbstub.o
endif
# Note: this is a workaround. The real fix is to avoid compiling
# cpu_signal_handler() in cpu-exec.c.
signal.o: signal.c
$(CC) $(HELPER_CFLAGS) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
$(QEMU_PROG): $(OBJS) ../libqemu_user.a
$(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
endif #CONFIG_BSD_USER
#########################################################
# System emulator target
ifndef CONFIG_USER_ONLY
......
/* Code for loading BSD executables. Mostly linux kernel code. */
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <errno.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include "qemu.h"
#define NGROUPS 32
/* ??? This should really be somewhere else. */
abi_long memcpy_to_target(abi_ulong dest, const void *src,
unsigned long len)
{
void *host_ptr;
host_ptr = lock_user(VERIFY_WRITE, dest, len, 0);
if (!host_ptr)
return -TARGET_EFAULT;
memcpy(host_ptr, src, len);
unlock_user(host_ptr, dest, 1);
return 0;
}
static int in_group_p(gid_t g)
{
/* return TRUE if we're in the specified group, FALSE otherwise */
int ngroup;
int i;
gid_t grouplist[NGROUPS];
ngroup = getgroups(NGROUPS, grouplist);
for(i = 0; i < ngroup; i++) {
if(grouplist[i] == g) {
return 1;
}
}
return 0;
}
static int count(char ** vec)
{
int i;
for(i = 0; *vec; i++) {
vec++;
}
return(i);
}
static int prepare_binprm(struct linux_binprm *bprm)
{
struct stat st;
int mode;
int retval, id_change;
if(fstat(bprm->fd, &st) < 0) {
return(-errno);
}
mode = st.st_mode;
if(!S_ISREG(mode)) { /* Must be regular file */
return(-EACCES);
}
if(!(mode & 0111)) { /* Must have at least one execute bit set */
return(-EACCES);
}
bprm->e_uid = geteuid();
bprm->e_gid = getegid();
id_change = 0;
/* Set-uid? */
if(mode & S_ISUID) {
bprm->e_uid = st.st_uid;
if(bprm->e_uid != geteuid()) {
id_change = 1;
}
}
/* Set-gid? */
/*
* If setgid is set but no group execute bit then this
* is a candidate for mandatory locking, not a setgid
* executable.
*/
if ((mode & (S_ISGID | S_IXGRP)) == (S_ISGID | S_IXGRP)) {
bprm->e_gid = st.st_gid;
if (!in_group_p(bprm->e_gid)) {
id_change = 1;
}
}
memset(bprm->buf, 0, sizeof(bprm->buf));
retval = lseek(bprm->fd, 0L, SEEK_SET);
if(retval >= 0) {
retval = read(bprm->fd, bprm->buf, 128);
}
if(retval < 0) {
perror("prepare_binprm");
exit(-1);
/* return(-errno); */
}
else {
return(retval);
}
}
/* Construct the envp and argv tables on the target stack. */
abi_ulong loader_build_argptr(int envc, int argc, abi_ulong sp,
abi_ulong stringp, int push_ptr)
{
int n = sizeof(abi_ulong);
abi_ulong envp;
abi_ulong argv;
sp -= (envc + 1) * n;
envp = sp;
sp -= (argc + 1) * n;
argv = sp;
if (push_ptr) {
/* FIXME - handle put_user() failures */
sp -= n;
put_user_ual(envp, sp);
sp -= n;
put_user_ual(argv, sp);
}
sp -= n;
/* FIXME - handle put_user() failures */
put_user_ual(argc, sp);
while (argc-- > 0) {
/* FIXME - handle put_user() failures */
put_user_ual(stringp, argv);
argv += n;
stringp += target_strlen(stringp) + 1;
}
/* FIXME - handle put_user() failures */
put_user_ual(0, argv);
while (envc-- > 0) {
/* FIXME - handle put_user() failures */
put_user_ual(stringp, envp);
envp += n;
stringp += target_strlen(stringp) + 1;
}
/* FIXME - handle put_user() failures */
put_user_ual(0, envp);
return sp;
}
int loader_exec(const char * filename, char ** argv, char ** envp,
struct target_pt_regs * regs, struct image_info *infop)
{
struct linux_binprm bprm;
int retval;
int i;
bprm.p = TARGET_PAGE_SIZE*MAX_ARG_PAGES-sizeof(unsigned int);
for (i=0 ; i<MAX_ARG_PAGES ; i++) /* clear page-table */
bprm.page[i] = 0;
retval = open(filename, O_RDONLY);
if (retval < 0)
return retval;
bprm.fd = retval;
bprm.filename = (char *)filename;
bprm.argc = count(argv);
bprm.argv = argv;
bprm.envc = count(envp);
bprm.envp = envp;
retval = prepare_binprm(&bprm);
infop->host_argv = argv;
if(retval>=0) {
if (bprm.buf[0] == 0x7f
&& bprm.buf[1] == 'E'
&& bprm.buf[2] == 'L'
&& bprm.buf[3] == 'F') {
retval = load_elf_binary(&bprm,regs,infop);
} else {
fprintf(stderr, "Unknown binary format\n");
return -1;
}
}
if(retval>=0) {
/* success. Initialize important registers */
do_init_thread(regs, infop);
return retval;
}
/* Something went wrong, return the inode and free the argument pages*/
for (i=0 ; i<MAX_ARG_PAGES ; i++) {
free(bprm.page[i]);
}
return(retval);
}
This diff is collapsed.
/* $OpenBSD: errno.h,v 1.20 2007/09/03 14:37:52 millert Exp $ */
/* $NetBSD: errno.h,v 1.10 1996/01/20 01:33:53 jtc Exp $ */
/*
* Copyright (c) 1982, 1986, 1989, 1993
* The Regents of the University of California. All rights reserved.
* (c) UNIX System Laboratories, Inc.
* All or some portions of this file are derived from material licensed
* to the University of California by American Telephone and Telegraph
* Co. or Unix System Laboratories, Inc. and are reproduced herein with
* the permission of UNIX System Laboratories, Inc.
*
* 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. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 REGENTS OR CONTRIBUTORS 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.
*
* @(#)errno.h 8.5 (Berkeley) 1/21/94
*/
#define TARGET_EPERM 1 /* Operation not permitted */
#define TARGET_ENOENT 2 /* No such file or directory */
#define TARGET_ESRCH 3 /* No such process */
#define TARGET_EINTR 4 /* Interrupted system call */
#define TARGET_EIO 5 /* Input/output error */
#define TARGET_ENXIO 6 /* Device not configured */
#define TARGET_E2BIG 7 /* Argument list too long */
#define TARGET_ENOEXEC 8 /* Exec format error */
#define TARGET_EBADF 9 /* Bad file descriptor */
#define TARGET_ECHILD 10 /* No child processes */
#define TARGET_EDEADLK 11 /* Resource deadlock avoided */
/* 11 was EAGAIN */
#define TARGET_ENOMEM 12 /* Cannot allocate memory */
#define TARGET_EACCES 13 /* Permission denied */
#define TARGET_EFAULT 14 /* Bad address */
#define TARGET_ENOTBLK 15 /* Block device required */
#define TARGET_EBUSY 16 /* Device busy */
#define TARGET_EEXIST 17 /* File exists */
#define TARGET_EXDEV 18 /* Cross-device link */
#define TARGET_ENODEV 19 /* Operation not supported by device */
#define TARGET_ENOTDIR 20 /* Not a directory */
#define TARGET_EISDIR 21 /* Is a directory */
#define TARGET_EINVAL 22 /* Invalid argument */
#define TARGET_ENFILE 23 /* Too many open files in system */
#define TARGET_EMFILE 24 /* Too many open files */
#define TARGET_ENOTTY 25 /* Inappropriate ioctl for device */
#define TARGET_ETXTBSY 26 /* Text file busy */
#define TARGET_EFBIG 27 /* File too large */
#define TARGET_ENOSPC 28 /* No space left on device */
#define TARGET_ESPIPE 29 /* Illegal seek */
#define TARGET_EROFS 30 /* Read-only file system */
#define TARGET_EMLINK 31 /* Too many links */
#define TARGET_EPIPE 32 /* Broken pipe */
/* math software */
#define TARGET_EDOM 33 /* Numerical argument out of domain */
#define TARGET_ERANGE 34 /* Result too large */
/* non-blocking and interrupt i/o */
#define TARGET_EAGAIN 35 /* Resource temporarily unavailable */
#define TARGET_EWOULDBLOCK EAGAIN /* Operation would block */
#define TARGET_EINPROGRESS 36 /* Operation now in progress */
#define TARGET_EALREADY 37 /* Operation already in progress */
/* ipc/network software -- argument errors */
#define TARGET_ENOTSOCK 38 /* Socket operation on non-socket */
#define TARGET_EDESTADDRREQ 39 /* Destination address required */
#define TARGET_EMSGSIZE 40 /* Message too long */
#define TARGET_EPROTOTYPE 41 /* Protocol wrong type for socket */
#define TARGET_ENOPROTOOPT 42 /* Protocol not available */
#define TARGET_EPROTONOSUPPORT 43 /* Protocol not supported */
#define TARGET_ESOCKTNOSUPPORT 44 /* Socket type not supported */
#define TARGET_EOPNOTSUPP 45 /* Operation not supported */
#define TARGET_EPFNOSUPPORT 46 /* Protocol family not supported */
#define TARGET_EAFNOSUPPORT 47 /* Address family not supported by protocol family */
#define TARGET_EADDRINUSE 48 /* Address already in use */
#define TARGET_EADDRNOTAVAIL 49 /* Can't assign requested address */
/* ipc/network software -- operational errors */
#define TARGET_ENETDOWN 50 /* Network is down */
#define TARGET_ENETUNREACH 51 /* Network is unreachable */
#define TARGET_ENETRESET 52 /* Network dropped connection on reset */
#define TARGET_ECONNABORTED 53 /* Software caused connection abort */
#define TARGET_ECONNRESET 54 /* Connection reset by peer */
#define TARGET_ENOBUFS 55 /* No buffer space available */
#define TARGET_EISCONN 56 /* Socket is already connected */
#define TARGET_ENOTCONN 57 /* Socket is not connected */
#define TARGET_ESHUTDOWN 58 /* Can't send after socket shutdown */
#define TARGET_ETOOMANYREFS 59 /* Too many references: can't splice */
#define TARGET_ETIMEDOUT 60 /* Operation timed out */
#define TARGET_ECONNREFUSED 61 /* Connection refused */
#define TARGET_ELOOP 62 /* Too many levels of symbolic links */
#define TARGET_ENAMETOOLONG 63 /* File name too long */
/* should be rearranged */
#define TARGET_EHOSTDOWN 64 /* Host is down */
#define TARGET_EHOSTUNREACH 65 /* No route to host */
#define TARGET_ENOTEMPTY 66 /* Directory not empty */
/* quotas & mush */
#define TARGET_EPROCLIM 67 /* Too many processes */
#define TARGET_EUSERS 68 /* Too many users */
#define TARGET_EDQUOT 69 /* Disk quota exceeded */
/* Network File System */
#define TARGET_ESTALE 70 /* Stale NFS file handle */
#define TARGET_EREMOTE 71 /* Too many levels of remote in path */
#define TARGET_EBADRPC 72 /* RPC struct is bad */
#define TARGET_ERPCMISMATCH 73 /* RPC version wrong */
#define TARGET_EPROGUNAVAIL 74 /* RPC prog. not avail */
#define TARGET_EPROGMISMATCH 75 /* Program version wrong */
#define TARGET_EPROCUNAVAIL 76 /* Bad procedure for program */
#define TARGET_ENOLCK 77 /* No locks available */
#define TARGET_ENOSYS 78 /* Function not implemented */
#define TARGET_EFTYPE 79 /* Inappropriate file type or format */
#define TARGET_EAUTH 80 /* Authentication error */
#define TARGET_ENEEDAUTH 81 /* Need authenticator */
#define TARGET_EIPSEC 82 /* IPsec processing failure */
#define TARGET_ENOATTR 83 /* Attribute not found */
#define TARGET_EILSEQ 84 /* Illegal byte sequence */
#define TARGET_ENOMEDIUM 85 /* No medium found */
#define TARGET_EMEDIUMTYPE 86 /* Wrong Medium Type */
#define TARGET_EOVERFLOW 87 /* Conversion overflow */
#define TARGET_ECANCELED 88 /* Operation canceled */
#define TARGET_EIDRM 89 /* Identifier removed */
#define TARGET_ENOMSG 90 /* No message of desired type */
#define TARGET_ELAST 90 /* Must be equal largest errno */
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
{ TARGET_NETBSD_NR___getcwd, "__getcwd", NULL, NULL, NULL },
{ TARGET_NETBSD_NR___syscall, "__syscall", NULL, NULL, NULL },
{ TARGET_NETBSD_NR___sysctl, "__sysctl", NULL, NULL, NULL },
{ TARGET_NETBSD_NR_accept, "accept", "%s(%d,%#x,%#x)", NULL, NULL },
{ TARGET_NETBSD_NR_access, "access", "%s(\"%s\",%#o)", NULL, NULL },
{ TARGET_NETBSD_NR_acct, "acct", NULL, NULL, NULL },
{ TARGET_NETBSD_NR_adjtime, "adjtime", NULL, NULL, NULL },
{ TARGET_NETBSD_NR_bind, "bind", NULL, NULL, NULL },
{ TARGET_NETBSD_NR_break, "break", NULL, NULL, NULL },
{ TARGET_NETBSD_NR_chdir, "chdir", "%s(\"%s\")", NULL, NULL },
{ TARGET_NETBSD_NR_chflags, "chflags", NULL, NULL, NULL },
{ TARGET_NETBSD_NR_chmod, "chmod", "%s(\"%s\",%#o)", NULL, NULL },
{ TARGET_NETBSD_NR_chown, "chown", NULL, NULL, NULL },
{ TARGET_NETBSD_NR_chroot, "chroot", NULL, NULL, NULL },
{ TARGET_NETBSD_NR_clock_getres, "clock_getres", NULL, NULL, NULL },
{ TARGET_NETBSD_NR_clock_gettime, "clock_gettime", NULL, NULL, NULL },
{ TARGET_NETBSD_NR_clock_settime, "clock_settime", NULL, NULL, NULL },
{ TARGET_NETBSD_NR_close, "close", "%s(%d)", NULL, NULL },
{ TARGET_NETBSD_NR_connect, "connect", "%s(%d,%#x,%d)", NULL, NULL },
{ TARGET_NETBSD_NR_dup, "dup", NULL, NULL, NULL },
{ TARGET_NETBSD_NR_dup2, "dup2", NULL, NULL, NULL },
{ TARGET_NETBSD_NR_execve, "execve", NULL, print_execve, NULL },
{ TARGET_NETBSD_NR_exit, "exit", "%s(%d)\n", NULL, NULL },
{ TARGET_NETBSD_NR_fchdir, "fchdir", NULL, NULL, NULL },
{ TARGET_NETBSD_NR_fchflags, "fchflags", NULL, NULL, NULL },
{ TARGET_NETBSD_NR_fchmod, "fchmod", "%s(%d,%#o)", NULL, NULL },
{ TARGET_NETBSD_NR_fchown, "fchown", "%s(\"%s\",%d,%d)", NULL, NULL },
{ TARGET_NETBSD_NR_fcntl, "fcntl", NULL, NULL, NULL },
{ TARGET_NETBSD_NR_flock, "flock", NULL, NULL, NULL },
{ TARGET_NETBSD_NR_fork, "fork", "%s()", NULL, NULL },
{ TARGET_NETBSD_NR_fpathconf, "fpathconf", NULL, NULL, NULL },
{ TARGET_NETBSD_NR_fsync, "fsync", NULL, NULL, NULL },
{ TARGET_NETBSD_NR_ftruncate, "ftruncate", NULL, NULL, NULL },
{ TARGET_NETBSD_NR_futimes, "futimes", NULL, NULL, NULL },
{ TARGET_NETBSD_NR_getegid, "getegid", "%s()", NULL, NULL },
{ TARGET_NETBSD_NR_geteuid, "geteuid", "%s()", NULL, NULL },
{ TARGET_NETBSD_NR_getgid, "getgid", "%s()", NULL, NULL },
{ TARGET_NETBSD_NR_getgroups, "getgroups", NULL, NULL, NULL },
{ TARGET_NETBSD_NR_getitimer, "getitimer", NULL, NULL, NULL },
{ TARGET_NETBSD_NR_getpeername, "getpeername", NULL, NULL, NULL },
{ TARGET_NETBSD_NR_getpgid, "getpgid", NULL, NULL, NULL },
{ TARGET_NETBSD_NR_getpgrp, "getpgrp", "%s()", NULL, NULL },
{ TARGET_NETBSD_NR_getpid, "getpid", "%s()", NULL, NULL },
{ TARGET_NETBSD_NR_getppid, "getppid", "%s()", NULL, NULL },
{ TARGET_NETBSD_NR_getpriority, "getpriority", "%s(%#x,%#x)", NULL, NULL },
{ TARGET_NETBSD_NR_getrlimit, "getrlimit", NULL, NULL, NULL },
{ TARGET_NETBSD_NR_getrusage, "getrusage", NULL, NULL, NULL },
{ TARGET_NETBSD_NR_getsid, "getsid", NULL, NULL, NULL },
{ TARGET_NETBSD_NR_getsockname, "getsockname", NULL, NULL, NULL },
{ TARGET_NETBSD_NR_getsockopt, "getsockopt", NULL, NULL, NULL },
{ TARGET_NETBSD_NR_gettimeofday, "gettimeofday", NULL, NULL, NULL },
{ TARGET_NETBSD_NR_getuid, "getuid", "%s()", NULL, NULL },
{ TARGET_NETBSD_NR_ioctl, "ioctl", NULL, NULL, NULL },
{ TARGET_NETBSD_NR_issetugid, "issetugid", "%s()", NULL, NULL },
{ TARGET_NETBSD_NR_kevent, "kevent", NULL, NULL, NULL },
{ TARGET_NETBSD_NR_kill, "kill", NULL, NULL, NULL },
{ TARGET_NETBSD_NR_kqueue, "kqueue", NULL, NULL, NULL },
{ TARGET_NETBSD_NR_ktrace, "ktrace", NULL, NULL, NULL },
{ TARGET_NETBSD_NR_lchown, "lchown", NULL, NULL, NULL },
{ TARGET_NETBSD_NR_lfs_bmapv, "lfs_bmapv", NULL, NULL, NULL },
{ TARGET_NETBSD_NR_lfs_markv, "lfs_markv", NULL, NULL, NULL },
{ TARGET_NETBSD_NR_lfs_segclean, "lfs_segclean", NULL, NULL, NULL },
{ TARGET_NETBSD_NR_lfs_segwait, "lfs_segwait", NULL, NULL, NULL },
{ TARGET_NETBSD_NR_link, "link", "%s(\"%s\",\"%s\")", NULL, NULL },
{ TARGET_NETBSD_NR_listen, "listen", NULL, NULL, NULL },
{ TARGET_NETBSD_NR_lseek, "lseek", NULL, NULL, NULL },
{ TARGET_NETBSD_NR_madvise, "madvise", NULL, NULL, NULL },
{ TARGET_NETBSD_NR_mincore, "mincore", NULL, NULL, NULL },
{ TARGET_NETBSD_NR_minherit, "minherit", NULL, NULL, NULL },
{ TARGET_NETBSD_NR_mkdir, "mkdir", "%s(\"%s\",%#o)", NULL, NULL },
{ TARGET_NETBSD_NR_mkfifo, "mkfifo", NULL, NULL, NULL },
{ TARGET_NETBSD_NR_mknod, "mknod", "%s(\"%s\",%#o,%#x)", NULL, NULL },
{ TARGET_NETBSD_NR_mlock, "mlock", NULL, NULL, NULL },
{ TARGET_NETBSD_NR_mlockall, "mlockall", NULL, NULL, NULL },
{ TARGET_NETBSD_NR_mmap, "mmap", NULL, NULL, print_syscall_ret_addr },
{ TARGET_NETBSD_NR_mprotect, "mprotect", "%s(%#x,%#x,%d)", NULL, NULL },
{ TARGET_NETBSD_NR_msgget, "msgget", NULL, NULL, NULL },
{ TARGET_NETBSD_NR_msgrcv, "msgrcv", NULL, NULL, NULL },
{ TARGET_NETBSD_NR_msgsnd, "msgsnd", NULL, NULL, NULL },
{ TARGET_NETBSD_NR_munlock, "munlock", NULL, NULL, NULL },
{ TARGET_NETBSD_NR_munlockall, "munlockall", NULL, NULL, NULL },
{ TARGET_NETBSD_NR_munmap, "munmap", "%s(%p,%d)", NULL, NULL },
{ TARGET_NETBSD_NR_nanosleep, "nanosleep", NULL, NULL, NULL },
{ TARGET_NETBSD_NR_nfssvc, "nfssvc", NULL, NULL, NULL },
{ TARGET_NETBSD_NR_open, "open", "%s(\"%s\",%#x,%#o)", NULL, NULL },
{ TARGET_NETBSD_NR_pathconf, "pathconf", NULL, NULL, NULL },
{ TARGET_NETBSD_NR_pipe, "pipe", NULL, NULL, NULL },
{ TARGET_NETBSD_NR_poll, "poll", NULL, NULL, NULL },
{ TARGET_NETBSD_NR_pread, "pread", NULL, NULL, NULL },
{ TARGET_NETBSD_NR_preadv, "preadv", NULL, NULL, NULL },
{ TARGET_NETBSD_NR_profil, "profil", NULL, NULL, NULL },
{ TARGET_NETBSD_NR_ptrace, "ptrace", NULL, NULL, NULL },
{ TARGET_NETBSD_NR_pwrite, "pwrite", NULL, NULL, NULL },
{ TARGET_NETBSD_NR_pwritev, "pwritev", NULL, NULL, NULL },
{ TARGET_NETBSD_NR_quotactl, "quotactl", NULL, NULL, NULL },
{ TARGET_NETBSD_NR_read, "read", "%s(%d,%#x,%d)", NULL, NULL },
{ TARGET_NETBSD_NR_readlink, "readlink", "%s(\"%s\",%p,%d)", NULL, NULL },
{ TARGET_NETBSD_NR_readv, "readv", NULL, NULL, NULL },
{ TARGET_NETBSD_NR_reboot, "reboot", NULL, NULL, NULL },
{ TARGET_NETBSD_NR_recvfrom, "recvfrom", NULL, NULL, NULL },
{ TARGET_NETBSD_NR_recvmsg, "recvmsg", NULL, NULL, NULL },
{ TARGET_NETBSD_NR_rename, "rename", "%s(\"%s\",\"%s\")", NULL, NULL },
{ TARGET_NETBSD_NR_revoke, "revoke", NULL, NULL, NULL },
{ TARGET_NETBSD_NR_rmdir, "rmdir", NULL, NULL, NULL },
{ TARGET_NETBSD_NR_sbrk, "sbrk", NULL, NULL, NULL },
{ TARGET_NETBSD_NR_sched_yield, "sched_yield", NULL, NULL, NULL },
{ TARGET_NETBSD_NR_select, "select", NULL, NULL, NULL },
{ TARGET_NETBSD_NR_semget, "semget", NULL, NULL, NULL },
{ TARGET_NETBSD_NR_semop, "semop", NULL, NULL, NULL },
{ TARGET_NETBSD_NR_sendmsg, "sendmsg", NULL, NULL, NULL },
{ TARGET_NETBSD_NR_sendto, "sendto", NULL, NULL, NULL },
{ TARGET_NETBSD_NR_setegid, "setegid", NULL, NULL, NULL },
{ TARGET_NETBSD_NR_seteuid, "seteuid", NULL, NULL, NULL },
{ TARGET_NETBSD_NR_setgid, "setgid", NULL, NULL, NULL },
{ TARGET_NETBSD_NR_setgroups, "setgroups", NULL, NULL, NULL },
{ TARGET_NETBSD_NR_setitimer, "setitimer", NULL, NULL, NULL },
{ TARGET_NETBSD_NR_setpgid, "setpgid", NULL, NULL, NULL },
{ TARGET_NETBSD_NR_setpriority, "setpriority", NULL, NULL, NULL },
{ TARGET_NETBSD_NR_setregid, "setregid", NULL, NULL, NULL },
{ TARGET_NETBSD_NR_setreuid, "setreuid", NULL, NULL, NULL },
{ TARGET_NETBSD_NR_setrlimit, "setrlimit", NULL, NULL, NULL },
{ TARGET_NETBSD_NR_setsid, "setsid", NULL, NULL, NULL },
{ TARGET_NETBSD_NR_setsockopt, "setsockopt", NULL, NULL, NULL },
{ TARGET_NETBSD_NR_settimeofday, "settimeofday", NULL, NULL, NULL },
{ TARGET_NETBSD_NR_setuid, "setuid", NULL, NULL, NULL },
{ TARGET_NETBSD_NR_shmat, "shmat", NULL, NULL, NULL },
{ TARGET_NETBSD_NR_shmdt, "shmdt", NULL, NULL, NULL },
{ TARGET_NETBSD_NR_shmget, "shmget", NULL, NULL, NULL },
{ TARGET_NETBSD_NR_shutdown, "shutdown", NULL, NULL, NULL },
{ TARGET_NETBSD_NR_socketpair, "socketpair", NULL, NULL, NULL },
{ TARGET_NETBSD_NR_sstk, "sstk", NULL, NULL, NULL },
{ TARGET_NETBSD_NR_swapctl, "swapctl", NULL, NULL, NULL },
{ TARGET_NETBSD_NR_symlink, "symlink", "%s(\"%s\",\"%s\")", NULL, NULL },
{ TARGET_NETBSD_NR_sync, "sync", NULL, NULL, NULL },
{ TARGET_NETBSD_NR_sysarch, "sysarch", NULL, NULL, NULL },
{ TARGET_NETBSD_NR_syscall, "syscall", NULL, NULL, NULL },
{ TARGET_NETBSD_NR_truncate, "truncate", NULL, NULL, NULL },
{ TARGET_NETBSD_NR_umask, "umask", "%s(%#o)", NULL, NULL },
{ TARGET_NETBSD_NR_unlink, "unlink", "%s(\"%s\")", NULL, NULL },
{ TARGET_NETBSD_NR_unmount, "unmount", NULL, NULL, NULL },
{ TARGET_NETBSD_NR_utimes, "utimes", NULL, NULL, NULL },
{ TARGET_NETBSD_NR_vfork, "vfork", NULL, NULL, NULL },
{ TARGET_NETBSD_NR_wait4, "wait4", NULL, NULL, NULL },
{ TARGET_NETBSD_NR_write, "write", "%s(%d,%#x,%d)", NULL, NULL },
{ TARGET_NETBSD_NR_writev, "writev", "%s(%d,%p,%#x)", NULL, NULL },
This diff is collapsed.
This diff is collapsed.
/* $OpenBSD: syscall.h,v 1.101 2008/03/16 19:43:41 otto Exp $ */
/*
* System call numbers.
*
* created from; OpenBSD: syscalls.master,v 1.90 2008/03/16 19:42:57 otto Exp
*/
#define TARGET_OPENBSD_NR_syscall 0
#define TARGET_OPENBSD_NR_exit 1
#define TARGET_OPENBSD_NR_fork 2
#define TARGET_OPENBSD_NR_read 3
#define TARGET_OPENBSD_NR_write 4
#define TARGET_OPENBSD_NR_open 5
#define TARGET_OPENBSD_NR_close 6
#define TARGET_OPENBSD_NR_wait4 7
#define TARGET_OPENBSD_NR_link 9
#define TARGET_OPENBSD_NR_unlink 10
#define TARGET_OPENBSD_NR_chdir 12
#define TARGET_OPENBSD_NR_fchdir 13
#define TARGET_OPENBSD_NR_mknod 14
#define TARGET_OPENBSD_NR_chmod 15
#define TARGET_OPENBSD_NR_chown 16
#define TARGET_OPENBSD_NR_break 17
#define TARGET_OPENBSD_NR_getpid 20
#define TARGET_OPENBSD_NR_mount 21
#define TARGET_OPENBSD_NR_unmount 22
#define TARGET_OPENBSD_NR_setuid 23
#define TARGET_OPENBSD_NR_getuid 24
#define TARGET_OPENBSD_NR_geteuid 25
#define TARGET_OPENBSD_NR_ptrace 26
#define TARGET_OPENBSD_NR_recvmsg 27
#define TARGET_OPENBSD_NR_sendmsg 28
#define TARGET_OPENBSD_NR_recvfrom 29
#define TARGET_OPENBSD_NR_accept 30
#define TARGET_OPENBSD_NR_getpeername 31
#define TARGET_OPENBSD_NR_getsockname 32
#define TARGET_OPENBSD_NR_access 33
#define TARGET_OPENBSD_NR_chflags 34
#define TARGET_OPENBSD_NR_fchflags 35
#define TARGET_OPENBSD_NR_sync 36
#define TARGET_OPENBSD_NR_kill 37
#define TARGET_OPENBSD_NR_getppid 39
#define TARGET_OPENBSD_NR_dup 41
#define TARGET_OPENBSD_NR_opipe 42
#define TARGET_OPENBSD_NR_getegid 43
#define TARGET_OPENBSD_NR_profil 44
#define TARGET_OPENBSD_NR_ktrace 45
#define TARGET_OPENBSD_NR_sigaction 46
#define TARGET_OPENBSD_NR_getgid 47
#define TARGET_OPENBSD_NR_sigprocmask 48
#define TARGET_OPENBSD_NR_getlogin 49
#define TARGET_OPENBSD_NR_setlogin 50
#define TARGET_OPENBSD_NR_acct 51
#define TARGET_OPENBSD_NR_sigpending 52
#define TARGET_OPENBSD_NR_osigaltstack 53
#define TARGET_OPENBSD_NR_ioctl 54
#define TARGET_OPENBSD_NR_reboot 55
#define TARGET_OPENBSD_NR_revoke 56
#define TARGET_OPENBSD_NR_symlink 57
#define TARGET_OPENBSD_NR_readlink 58
#define TARGET_OPENBSD_NR_execve 59
#define TARGET_OPENBSD_NR_umask 60
#define TARGET_OPENBSD_NR_chroot 61
#define TARGET_OPENBSD_NR_vfork 66
#define TARGET_OPENBSD_NR_sbrk 69
#define TARGET_OPENBSD_NR_sstk 70
#define TARGET_OPENBSD_NR_munmap 73
#define TARGET_OPENBSD_NR_mprotect 74
#define TARGET_OPENBSD_NR_madvise 75
#define TARGET_OPENBSD_NR_mincore 78
#define TARGET_OPENBSD_NR_getgroups 79
#define TARGET_OPENBSD_NR_setgroups 80
#define TARGET_OPENBSD_NR_getpgrp 81
#define TARGET_OPENBSD_NR_setpgid 82
#define TARGET_OPENBSD_NR_setitimer 83
#define TARGET_OPENBSD_NR_getitimer 86
#define TARGET_OPENBSD_NR_dup2 90
#define TARGET_OPENBSD_NR_fcntl 92
#define TARGET_OPENBSD_NR_select 93
#define TARGET_OPENBSD_NR_fsync 95
#define TARGET_OPENBSD_NR_setpriority 96
#define TARGET_OPENBSD_NR_socket 97
#define TARGET_OPENBSD_NR_connect 98
#define TARGET_OPENBSD_NR_getpriority 100
#define TARGET_OPENBSD_NR_sigreturn 103
#define TARGET_OPENBSD_NR_bind 104
#define TARGET_OPENBSD_NR_setsockopt 105
#define TARGET_OPENBSD_NR_listen 106
#define TARGET_OPENBSD_NR_sigsuspend 111
#define TARGET_OPENBSD_NR_gettimeofday 116
#define TARGET_OPENBSD_NR_getrusage 117
#define TARGET_OPENBSD_NR_getsockopt 118
#define TARGET_OPENBSD_NR_readv 120
#define TARGET_OPENBSD_NR_writev 121
#define TARGET_OPENBSD_NR_settimeofday 122
#define TARGET_OPENBSD_NR_fchown 123
#define TARGET_OPENBSD_NR_fchmod 124
#define TARGET_OPENBSD_NR_setreuid 126
#define TARGET_OPENBSD_NR_setregid 127
#define TARGET_OPENBSD_NR_rename 128
#define TARGET_OPENBSD_NR_flock 131
#define TARGET_OPENBSD_NR_mkfifo 132
#define TARGET_OPENBSD_NR_sendto 133
#define TARGET_OPENBSD_NR_shutdown 134
#define TARGET_OPENBSD_NR_socketpair 135
#define TARGET_OPENBSD_NR_mkdir 136
#define TARGET_OPENBSD_NR_rmdir 137
#define TARGET_OPENBSD_NR_utimes 138
#define TARGET_OPENBSD_NR_adjtime 140
#define TARGET_OPENBSD_NR_setsid 147
#define TARGET_OPENBSD_NR_quotactl 148
#define TARGET_OPENBSD_NR_nfssvc 155
#define TARGET_OPENBSD_NR_getfh 161
#define TARGET_OPENBSD_NR_sysarch 165
#define TARGET_OPENBSD_NR_pread 173
#define TARGET_OPENBSD_NR_pwrite 174
#define TARGET_OPENBSD_NR_setgid 181
#define TARGET_OPENBSD_NR_setegid 182
#define TARGET_OPENBSD_NR_seteuid 183
#define TARGET_OPENBSD_NR_lfs_bmapv 184
#define TARGET_OPENBSD_NR_lfs_markv 185
#define TARGET_OPENBSD_NR_lfs_segclean 186
#define TARGET_OPENBSD_NR_lfs_segwait 187
#define TARGET_OPENBSD_NR_pathconf 191
#define TARGET_OPENBSD_NR_fpathconf 192