lx_syscall.c revision 319378d99bca1eacf64f0a464b0175bf66b422ab
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <sys/machbrand.h>
#include <sys/lx_syscalls.h>
#include <sys/lx_brand.h>
/*
* Some system calls return either a 32-bit or a 64-bit value, depending
* on the datamodel.
*/
#ifdef _LP64
#else
#define V_RVAL SE_32RVAL1
#endif
/*
* Define system calls that return a native 'long' quantity i.e. a 32-bit
* or 64-bit integer - depending on how the kernel is itself compiled
* e.g. read(2) returns 'ssize_t' in the kernel and in userland.
*/
/*
* Returns a 32 bit quantity regardless of datamodel
*/
extern longlong_t lx_nosys(void);
lx_sysent_t lx_sysent[] =
{
LX_NOSYS("lx_fork"),
LX_NOSYS("read"),
LX_NOSYS("write"),
LX_NOSYS("open"),
LX_NOSYS("close"),
LX_NOSYS("waitpid"),
LX_NOSYS("creat"),
LX_NOSYS("link"),
LX_NOSYS("exec"),
LX_NOSYS("chdir"),
LX_NOSYS("gtime"),
LX_NOSYS("mknod"),
LX_NOSYS("chmod"),
LX_NOSYS("lchown16"),
LX_NOSYS("break"),
LX_NOSYS("stat"),
LX_NOSYS("lseek"),
LX_NOSYS("mount"),
LX_NOSYS("umount"),
LX_NOSYS("setuid16"),
LX_NOSYS("getuid16"),
LX_NOSYS("stime"),
LX_NOSYS("ptrace"),
LX_NOSYS("alarm"),
LX_NOSYS("fstat"),
LX_NOSYS("pause"),
LX_NOSYS("stty"),
LX_NOSYS("gtty"),
LX_NOSYS("access"),
LX_NOSYS("nice"),
LX_NOSYS("ftime"),
LX_NOSYS("sync"),
LX_NOSYS("rename"),
LX_NOSYS("mkdir"),
LX_NOSYS("dup"),
LX_NOSYS("pipe"),
LX_NOSYS("times"),
LX_NOSYS("prof"),
LX_NOSYS("setgid16"),
LX_NOSYS("getgid16"),
LX_NOSYS("signal"),
LX_NOSYS("geteuid16"),
LX_NOSYS("sysacct"),
LX_NOSYS("umount2"),
LX_NOSYS("lock"),
LX_NOSYS("ioctl"),
LX_NOSYS("fcntl"),
LX_NOSYS("mpx"),
LX_NOSYS("setpgid"),
LX_NOSYS("ulimit"),
LX_NOSYS("olduname"),
LX_NOSYS("chroot"),
LX_NOSYS("ustat"),
LX_NOSYS("dup2"),
LX_NOSYS("pgrp"),
LX_NOSYS("setsid"),
LX_NOSYS("sigaction"),
LX_NOSYS("sgetmask"),
LX_NOSYS("ssetmask"),
LX_NOSYS("setregid16"),
LX_NOSYS("sigsuspend"),
LX_NOSYS("sigpending"),
LX_NOSYS("sethostname"),
LX_NOSYS("setrlimit"),
LX_NOSYS("old_getrlimit"),
LX_NOSYS("getrusage"),
LX_NOSYS("gettimeofday"),
LX_NOSYS("settimeofday"),
LX_NOSYS("setgroups16"),
LX_NOSYS("old_select"),
LX_NOSYS("symlink"),
LX_NOSYS("oldlstat"),
LX_NOSYS("readlink"),
LX_NOSYS("uselib"),
LX_NOSYS("swapon"),
LX_NOSYS("reboot"),
LX_NOSYS("old_readdir"),
LX_NOSYS("munmap"),
LX_NOSYS("truncate"),
LX_NOSYS("ftruncate"),
LX_NOSYS("fchmod"),
LX_NOSYS("fchown16"),
LX_NOSYS("getpriority"),
LX_NOSYS("setpriority"),
LX_NOSYS("profil"),
LX_NOSYS("statfs"),
LX_NOSYS("ioperm"),
LX_NOSYS("socketcall"),
LX_NOSYS("syslog"),
LX_NOSYS("setitimer"),
LX_NOSYS("getitimer"),
LX_NOSYS("newstat"),
LX_NOSYS("newsltat"),
LX_NOSYS("newsftat"),
LX_NOSYS("uname"),
LX_NOSYS("oldvhangup"),
LX_NOSYS("idle"),
LX_NOSYS("vm86old"),
LX_NOSYS("wait4"),
LX_NOSYS("swapoff"),
LX_NOSYS("ipc"),
LX_NOSYS("fsync"),
LX_NOSYS("sigreturn"),
LX_NOSYS("setdomainname"),
LX_NOSYS("newuname"),
LX_NOSYS("adjtimex"),
LX_NOSYS("mprotect"),
LX_NOSYS("sigprocmask"),
LX_NOSYS("create_module"),
LX_NOSYS("init_module"),
LX_NOSYS("delete_module"),
LX_NOSYS("quotactl"),
LX_NOSYS("getpgid"),
LX_NOSYS("fchdir"),
LX_NOSYS("bdflush"),
LX_NOSYS("sysfs"),
LX_NOSYS("personality"),
LX_NOSYS("afs_syscall"),
LX_NOSYS("setfsuid16"),
LX_NOSYS("setfsgid16"),
LX_NOSYS("getdents"),
LX_NOSYS("select"),
LX_NOSYS("flock"),
LX_NOSYS("msync"),
LX_NOSYS("readv"),
LX_NOSYS("writev"),
LX_NOSYS("getsid"),
LX_NOSYS("fdatasync"),
LX_NOSYS("sysctl"),
LX_NOSYS("munlock"),
LX_NOSYS("mlockall"),
LX_NOSYS("munlockall"),
LX_NOSYS("sched_setscheduler"),
LX_NOSYS("sched_getscheduler"),
LX_NOSYS("yield"),
LX_NOSYS("sched_get_priority_max"),
LX_NOSYS("nanosleep"),
LX_NOSYS("mremap"),
LX_NOSYS("getresuid16"),
LX_NOSYS("vm86"),
LX_NOSYS("query_module"),
LX_NOSYS("poll"),
LX_NOSYS("nfsserctl"),
LX_NOSYS("getresgid16"),
LX_NOSYS("prctl"),
LX_NOSYS("rt_sigreturn"),
LX_NOSYS("rt_sigaction"),
LX_NOSYS("rt_sigprocmask"),
LX_NOSYS("rt_sigpending"),
LX_NOSYS("rt_sigtimedwait"),
LX_NOSYS("rt_sigqueueinfo"),
LX_NOSYS("rt_sigsuspend"),
LX_NOSYS("pwrite64"),
LX_NOSYS("chown16"),
LX_NOSYS("getcwd"),
LX_NOSYS("capget"),
LX_NOSYS("capset"),
LX_NOSYS("sigaltstack"),
LX_NOSYS("sendfile"),
LX_NOSYS("getpmsg"),
LX_NOSYS("putpmsg"),
LX_NOSYS("getrlimit"),
LX_NOSYS("mmap2"),
LX_NOSYS("truncate64"),
LX_NOSYS("ftruncate64"),
LX_NOSYS("stat64"),
LX_NOSYS("lstat64"),
LX_NOSYS("fstat64"),
LX_NOSYS("lchown"),
LX_NOSYS("getuid"),
LX_NOSYS("geteuid"),
LX_NOSYS("getegid"),
LX_NOSYS("setreuid"),
LX_NOSYS("setregid"),
LX_NOSYS("getgroups"),
LX_NOSYS("fchown"),
LX_NOSYS("getresuid"),
LX_NOSYS("getresgid"),
LX_NOSYS("chown"),
LX_NOSYS("setuid"),
LX_NOSYS("setgid"),
LX_NOSYS("setfsuid"),
LX_NOSYS("setfsgid"),
LX_NOSYS("pivot_root"),
LX_NOSYS("mincore"),
LX_NOSYS("madvise"),
LX_NOSYS("fcntl64"),
LX_NOSYS("lx_nosys"),
LX_NOSYS("security"),
LX_NOSYS("readahead"),
LX_NOSYS("setxattr"),
LX_NOSYS("lsetxattr"),
LX_NOSYS("fsetxattr"),
LX_NOSYS("getxattr"),
LX_NOSYS("fgetxattr"),
LX_NOSYS("listxattr"),
LX_NOSYS("llistxattr"),
LX_NOSYS("flistxattr"),
LX_NOSYS("removexattr"),
LX_NOSYS("lremovexattr"),
LX_NOSYS("fremovexattr"),
LX_NOSYS("sendfile64"),
LX_NOSYS("sched_setaffinity"),
LX_NOSYS("sched_getaffinity"),
LX_NOSYS("io_setup"),
LX_NOSYS("io_destroy"),
LX_NOSYS("io_getevents"),
LX_NOSYS("io_submit"),
LX_NOSYS("io_cancel"),
LX_NOSYS("lx_nosys"),
LX_NOSYS("exit_group"),
LX_NOSYS("lookup_dcookie"),
LX_NOSYS("epoll_create"),
LX_NOSYS("epoll_ctl"),
LX_NOSYS("epoll_wait"),
LX_NOSYS("remap_file_pages"),
LX_NOSYS("timer_create"),
LX_NOSYS("timer_gettime"),
LX_NOSYS("timer_getoverrun"),
LX_NOSYS("timer_delete"),
LX_NOSYS("clock_settime"),
LX_NOSYS("clock_gettime"),
LX_NOSYS("clock_getres"),
LX_NOSYS("clock_nanosleep"),
LX_NOSYS("statfs64"),
LX_NOSYS("fstatfs64"),
/* The following are Linux 2.6 system calls */
LX_NOSYS("utimes"),
LX_NOSYS("fadvise64_64"),
LX_NOSYS("vserver"),
LX_NOSYS("mbind"),
LX_NOSYS("get_mempolicy"),
LX_NOSYS("set_mempolicy"),
LX_NOSYS("mq_open"),
LX_NOSYS("mq_unlink"),
LX_NOSYS("mq_timedsend"),
LX_NOSYS("mq_notify"),
LX_NOSYS("mq_getsetattr"),
LX_NOSYS("kexec_load"),
LX_NOSYS("waitid"),
LX_NOSYS("sys_setaltroot"),
LX_NOSYS("add_key"),
LX_NOSYS("request_key"),
LX_NOSYS("keyctl"),
LX_NOSYS("ioprio_set"),
LX_NOSYS("inotify_init"),
LX_NOSYS("inotify_add_watch"),
LX_NOSYS("inotify_rm_watch"),
LX_NOSYS("migrate_pages"),
LX_NOSYS("openat"),
LX_NOSYS("mkdirat"),
LX_NOSYS("mknodat"),
LX_NOSYS("fchownat"),
LX_NOSYS("futimesat"),
LX_NOSYS("unlinkat"),
LX_NOSYS("renameat"),
LX_NOSYS("linkat"),
LX_NOSYS("syslinkat"),
LX_NOSYS("readlinkat"),
LX_NOSYS("fchmodat"),
LX_NOSYS("faccessat"),
LX_NOSYS("pselect6"),
LX_NOSYS("ppoll"),
LX_NOSYS("set_robust_list"),
LX_NOSYS("get_robust_list"),
LX_NOSYS("splice"),
LX_NOSYS("sync_file_range"),
LX_NOSYS("tee"),
LX_NOSYS("vmsplice"),
LX_NOSYS("move_pages"),
NULL /* NULL-termination is required for lx_systrace */
};
{
case 0: {
break;
}
case 1: {
break;
}
case 2: {
break;
}
case 3: {
lx_print("--> %s(0x%lx, 0x%lx, 0x%lx)\n",
break;
}
case 4: {
lx_print("--> %s(0x%lx, 0x%lx, 0x%lx, 0x%lx)\n",
break;
}
case 5: {
lx_print("--> %s(0x%lx, 0x%lx, 0x%lx, 0x%lx, 0x%lx)\n",
break;
}
case 6: {
lx_print("--> %s(0x%lx, 0x%lx, 0x%lx, 0x%lx,"
" 0x%lx, 0x%lx)\n",
arg6);
break;
}
default:
}
return (rval);
}