#include <sys/param.h>
#include <sys/systm.h>
#include <sys/signal.h>
#include <sys/mount.h>
#define syss(fn,no) {no, 0, KERNEL_FUNNEL, fn}
#define sysp(fn,no) {no, 1, KERNEL_FUNNEL, fn}
#define sysnets(fn,no) {no, 0, NETWORK_FUNNEL, fn}
#define sysnetp(fn,no) {no, 1, NETWORK_FUNNEL, fn}
int nosys();
int exit();
int fork();
int read();
int write();
int open();
int close();
int wait4();
int link();
int unlink();
int chdir();
int fchdir();
int mknod();
int chmod();
int chown();
int obreak();
int getfsstat();
#if COMPAT_GETFSSTAT
int ogetfsstat();
#endif
int getpid();
int mount();
int unmount();
int setuid();
int getuid();
int geteuid();
int ptrace();
int recvmsg();
int sendmsg();
int recvfrom();
int accept();
int getpeername();
int getsockname();
int access();
int chflags();
int fchflags();
int sync();
int kill();
int getppid();
int dup();
int pipe();
int getegid();
int profil();
int load_shared_file();
int reset_shared_file();
#if KTRACE
int ktrace();
#else
#endif
int sigaction();
int getgid();
int sigprocmask();
int getlogin();
int setlogin();
int acct();
int sigpending();
int sigaltstack();
int ioctl();
int reboot();
int revoke();
int symlink();
int readlink();
int execve();
int umask();
int chroot();
int msync();
int vfork();
int sbrk();
int sstk();
int ovadvise();
int munmap();
int mprotect();
int madvise();
int mincore();
int getgroups();
int setgroups();
int getpgrp();
int setpgid();
int setitimer();
int swapon();
int getitimer();
int getdtablesize();
int dup2();
int fcntl();
int select();
int fsync();
int setpriority();
int socket();
int connect();
int getpriority();
int sigreturn();
int bind();
int setsockopt();
int listen();
int sigsuspend();
#if TRACE
int vtrace();
#else
#endif
int gettimeofday();
int getrusage();
int getsockopt();
int readv();
int writev();
int settimeofday();
int fchown();
int fchmod();
int rename();
int flock();
int mkfifo();
int sendto();
int shutdown();
int socketpair();
int mkdir();
int rmdir();
int utimes();
int adjtime();
int setsid();
int quotactl();
int nfssvc();
int statfs();
int fstatfs();
int getfh();
int setgid();
int setegid();
int seteuid();
#if LFS
int lfs_bmapv();
int lfs_markv();
int lfs_segclean();
int lfs_segwait();
#else
#endif
int stat();
int fstat();
int lstat();
int pathconf();
int fpathconf();
int getrlimit();
int setrlimit();
int getdirentries();
int mmap();
int nosys();
int lseek();
int truncate();
int ftruncate();
int __sysctl();
int undelete();
int setprivexec();
int add_profil();
#ifdef NOTEVER
int table();
#endif
int kdebug_trace();
int mlock();
int munlock();
int minherit();
int mlockall();
int munlockall();
#if COMPAT_43
#define compat(name,n) syss(__CONCAT(o,name),n)
#define compatp(name,n) sysp(__CONCAT(o,name),n)
#define comaptnet(name,n) sysnets(__CONCAT(o,name),n)
#define comaptnetp(name,n) sysnetp(__CONCAT(o,name),n)
int ocreat();
int olseek();
int ostat();
int olstat();
#if KTRACE
#else
#endif
int ofstat();
int ogetkerninfo();
int osmmap();
int ogetpagesize();
int ommap();
int owait();
int ogethostname();
int osethostname();
int oaccept();
int osend();
int orecv();
int osigvec();
int osigblock();
int osigsetmask();
int osigstack();
int orecvmsg();
int osendmsg();
#if TRACE
#else
#endif
int orecvfrom();
int osetreuid();
int osetregid();
int otruncate();
int oftruncate();
int ogetpeername();
int ogethostid();
int osethostid();
int ogetrlimit();
int osetrlimit();
int okillpg();
int oquota();
int ogetsockname();
int ogetdomainname();
int osetdomainname();
int owait3();
#if NFS
#else
#endif
int ogetdirentries();
#if NFS
#else
#endif
#if LFS
#else
#endif
#if NETAT
int ATsocket();
int ATgetmsg();
int ATputmsg();
int ATPsndreq();
int ATPsndrsp();
int ATPgetreq();
int ATPgetrsp();
#endif
int mkcomplex();
int statv();
int lstatv();
int fstatv();
int getattrlist();
int setattrlist();
int getdirentriesattr();
int exchangedata();
int checkuseraccess();
int searchfs();
int delete();
int copyfile();
#else
#define compat(n, name) syss(nosys,0)
#define compatp(n, name) sysp(nosys,0)
#define comaptnet(n, name) sysnets(nosys,0)
#define comaptnetp(n, name) sysnetp(nosys,0)
#endif
int watchevent();
int waitevent();
int modwatch();
int fsctl();
int semsys();
int msgsys();
int shmsys();
int semctl();
int semget();
int semop();
int semconfig();
int msgctl();
int msgget();
int msgsnd();
int msgrcv();
int shmat();
int shmctl();
int shmdt();
int shmget();
int shm_open();
int shm_unlink();
int sem_open();
int sem_close();
int sem_unlink();
int sem_wait();
int sem_trywait();
int sem_post();
int sem_getvalue();
int sem_init();
int sem_destroy();
struct sysent sysent[] = {
syss(nosys,0),
syss(exit,1),
syss(fork,0),
sysp(read,3),
sysp(write,3),
syss(open,3),
syss(close,1),
syss(wait4, 4),
compat(creat,2),
syss(link,2),
syss(unlink,1),
syss(nosys, 0),
syss(chdir,1),
syss(fchdir,1),
syss(mknod,3),
syss(chmod,2),
syss(chown,3),
syss(obreak,1),
#if COMPAT_GETFSSTAT
syss(ogetfsstat, 3),
#else
syss(getfsstat, 3),
#endif
compat(lseek,3),
sysp(getpid,0),
syss(nosys, 0),
syss(nosys, 0),
syss(setuid,1),
sysp(getuid,0),
sysp(geteuid,0),
syss(ptrace,4),
sysnets(recvmsg,3),
sysnets(sendmsg,3),
sysnets(recvfrom,6),
sysnets(accept,3),
sysnets(getpeername,3),
sysnets(getsockname,3),
syss(access,2),
syss(chflags,2),
syss(fchflags,2),
syss(sync,0),
syss(kill,2),
compat(stat,2),
sysp(getppid,0),
compat(lstat,2),
syss(dup,2),
syss(pipe,0),
sysp(getegid,0),
syss(profil,4),
#if KTRACE
syss(ktrace,4),
#else
syss(nosys,0),
#endif
syss(sigaction,3),
sysp(getgid,0),
syss(sigprocmask,2),
syss(getlogin,2),
syss(setlogin,1),
syss(acct,1),
syss(sigpending,0),
syss(sigaltstack,2),
syss(ioctl,3),
syss(reboot,2),
syss(revoke,1),
syss(symlink,2),
syss(readlink,3),
syss(execve,3),
syss(umask,1),
syss(chroot,1),
compat(fstat,2),
syss(nosys,0),
compat(getpagesize,0),
syss(msync,3),
syss(vfork,0),
syss(nosys,0),
syss(nosys,0),
syss(sbrk,1),
syss(sstk,1),
compat(smmap,6),
syss(ovadvise,1),
syss(munmap,2),
syss(mprotect,3),
syss(madvise,3),
syss(nosys,0),
syss(nosys,0),
syss(mincore,3),
sysp(getgroups,2),
sysp(setgroups,2),
sysp(getpgrp,0),
sysp(setpgid,2),
syss(setitimer,3),
compat(wait,0),
syss(swapon,1),
syss(getitimer,2),
compat(gethostname,2),
compat(sethostname,2),
sysp(getdtablesize, 0),
syss(dup2,2),
syss(nosys,0),
syss(fcntl,3),
syss(select,5),
syss(nosys,0),
syss(fsync,1),
sysp(setpriority,3),
sysnets(socket,3),
sysnets(connect,3),
comaptnet(accept,3),
sysp(getpriority,2),
comaptnet(send,4),
comaptnet(recv,4),
syss(sigreturn,1),
sysnets(bind,3),
sysnets(setsockopt,5),
sysnets(listen,2),
syss(nosys,0),
compat(sigvec,3),
compat(sigblock,1),
compat(sigsetmask,1),
syss(sigsuspend,1),
compat(sigstack,2),
comaptnet(recvmsg,3),
comaptnet(sendmsg,3),
syss(nosys,0),
syss(gettimeofday,2),
sysp(getrusage,2),
sysnets(getsockopt,5),
syss(nosys,0),
sysp(readv,3),
sysp(writev,3),
syss(settimeofday,2),
syss(fchown,3),
syss(fchmod,2),
comaptnet(recvfrom,6),
compat(setreuid,2),
compat(setregid,2),
syss(rename,2),
compat(truncate,2),
compat(ftruncate,2),
syss(flock,2),
syss(mkfifo,2),
sysnets(sendto,6),
sysnets(shutdown,2),
sysnets(socketpair,5),
syss(mkdir,2),
syss(rmdir,1),
syss(utimes,2),
syss(nosys,0),
syss(adjtime,2),
comaptnet(getpeername,3),
compat(gethostid,0),
sysp(nosys,0),
compat(getrlimit,2),
compat(setrlimit,2),
compat(killpg,2),
syss(setsid,0),
syss(nosys,0),
syss(nosys,0),
comaptnet(getsockname,3),
syss(nosys,0),
sysp(setprivexec,1),
syss(nosys,0),
syss(nosys,0),
syss(nfssvc,2),
compat(getdirentries,4),
syss(statfs, 2),
syss(fstatfs, 2),
syss(unmount, 2),
syss(nosys,0),
syss(getfh,2),
compat(getdomainname,2),
compat(setdomainname,2),
syss(nosys,0),
#if QUOTA
syss(quotactl, 4),
#else QUOTA
syss(nosys, 0),
#endif
syss(nosys,0),
syss(mount, 4),
syss(nosys,0),
syss(nosys,0),
syss(nosys,0),
compat(wait3,3),
syss(nosys,0),
syss(nosys,0),
syss(nosys,0),
syss(nosys,0),
syss(add_profil,4),
syss(nosys,0),
syss(nosys,0),
syss(nosys,0),
syss(kdebug_trace,0),
syss(setgid,1),
syss(setegid,1),
syss(seteuid,1),
#if LFS
syss(lfs_bmapv,3),
syss(lfs_markv,3),
syss(lfs_segclean,2),
syss(lfs_segwait,2),
#else
syss(nosys,0),
syss(nosys,0),
syss(nosys,0),
syss(nosys,0),
#endif
syss(stat,2),
syss(fstat,2),
syss(lstat,2),
syss(pathconf,2),
syss(fpathconf,2),
#if COMPAT_GETFSSTAT
syss(getfsstat,0),
#else
syss(nosys,0),
#endif
syss(getrlimit,2),
syss(setrlimit,2),
syss(getdirentries,4),
#ifdef DOUBLE_ALIGN_PARAMS
syss(mmap,8),
#else
syss(mmap,7),
#endif
syss(nosys,0),
syss(lseek,5),
syss(truncate,4),
syss(ftruncate,4),
syss(__sysctl,6),
sysp(mlock, 2),
syss(munlock, 2),
#if NETAT
syss(undelete,1),
sysnets(ATsocket,1),
sysnets(ATgetmsg,4),
sysnets(ATputmsg,4),
sysnets(ATPsndreq,4),
sysnets(ATPsndrsp,4),
sysnets(ATPgetreq,3),
sysnets(ATPgetrsp,2),
syss(nosys,0),
syss(nosys,0),
syss(nosys,0),
#else
syss(undelete,1),
syss(nosys,0),
syss(nosys,0),
syss(nosys,0),
syss(nosys,0),
syss(nosys,0),
syss(nosys,0),
syss(nosys,0),
syss(nosys,0),
syss(nosys,0),
syss(nosys,0),
#endif
syss(nosys,3),
syss(nosys,2),
syss(nosys,2),
syss(nosys,2),
syss(getattrlist,5),
syss(setattrlist,5),
syss(getdirentriesattr,8),
syss(exchangedata,3),
syss(checkuseraccess,6),
syss(searchfs,6),
syss(delete,1),
syss(copyfile,4),
syss(nosys,0),
syss(nosys,0),
syss(nosys,0),
sysnets(watchevent,2),
sysnets(waitevent,2),
sysnets(modwatch,2),
syss(nosys,0),
syss(nosys,0),
syss(nosys,0),
syss(nosys,0),
syss(nosys,0),
syss(nosys,0),
syss(nosys,0),
syss(nosys,0),
syss(fsctl,0),
syss(nosys,0),
syss(nosys,0),
syss(nosys,0),
syss(nosys,0),
syss(nosys,0),
syss(nosys,0),
syss(nosys,0),
syss(minherit,3),
syss(semsys,5),
syss(msgsys,6),
syss(shmsys,4),
syss(semctl,4),
syss(semget,3),
syss(semop,3),
syss(semconfig,1),
syss(msgctl,3),
syss(msgget,2),
syss(msgsnd,4),
syss(msgrcv,5),
syss(shmat,3),
syss(shmctl,3),
syss(shmdt,1),
syss(shmget,3),
syss(shm_open,3),
syss(shm_unlink,1),
syss(sem_open,4),
syss(sem_close,1),
syss(sem_unlink,1),
syss(sem_wait,1),
syss(sem_trywait,1),
syss(sem_post,1),
syss(sem_getvalue,2),
syss(sem_init,3),
syss(sem_destroy,1),
syss(nosys,0),
syss(nosys,0),
syss(nosys,0),
syss(nosys,0),
syss(nosys,0),
syss(nosys,0),
syss(nosys,0),
syss(nosys,0),
syss(nosys,0),
syss(nosys,0),
syss(nosys,0),
syss(nosys,0),
syss(nosys,0),
syss(nosys,0),
syss(nosys,0),
syss(nosys,0),
syss(nosys,0),
syss(nosys,0),
syss(nosys,0),
syss(load_shared_file,7),
syss(reset_shared_file,3),
syss(nosys,0),
syss(nosys,0),
syss(nosys,0),
syss(nosys,0),
syss(nosys,0),
syss(nosys,0),
syss(nosys,0),
syss(nosys,0),
syss(nosys,0),
syss(nosys,0),
syss(nosys,0),
syss(nosys,0),
syss(nosys,0),
syss(nosys,0),
syss(nosys,0),
syss(nosys,0),
syss(nosys,0),
syss(nosys,0),
syss(nosys,0),
syss(nosys,0),
syss(nosys,0),
syss(nosys,0),
syss(nosys,0),
syss(nosys,0),
syss(nosys,0),
syss(nosys,0),
syss(mlockall,1),
syss(munlockall,1),
syss(nosys,0),
syss(nosys,0),
syss(nosys,0),
syss(nosys,0),
syss(nosys,0),
syss(nosys,0),
syss(nosys,0),
syss(nosys,0),
syss(nosys,0),
syss(nosys,0),
syss(nosys,0),
syss(nosys,0),
syss(nosys,0),
syss(nosys,0),
syss(nosys,0),
syss(nosys,0),
syss(nosys,0),
syss(nosys,0),
syss(nosys,0),
syss(nosys,0),
syss(nosys,0),
syss(nosys,0),
syss(nosys,0),
syss(nosys,0)
};
int nsysent = sizeof(sysent) / sizeof(sysent[0]);