Index: sys/amd64/linux/linux.h =================================================================== --- sys/amd64/linux/linux.h +++ sys/amd64/linux/linux.h @@ -35,6 +35,8 @@ #include #include +#define LINUX_LEGACY_SYSCALLS + /* * debugging support */ Index: sys/amd64/linux32/linux.h =================================================================== --- sys/amd64/linux32/linux.h +++ sys/amd64/linux32/linux.h @@ -38,6 +38,8 @@ #include #include +#define LINUX_LEGACY_SYSCALLS + /* * debugging support */ Index: sys/compat/linux/linux_event.c =================================================================== --- sys/compat/linux/linux_event.c +++ sys/compat/linux/linux_event.c @@ -263,6 +263,7 @@ return (0); } +#ifdef LINUX_LEGACY_SYSCALLS int linux_epoll_create(struct thread *td, struct linux_epoll_create_args *args) { @@ -276,6 +277,7 @@ return (epoll_create_common(td, 0)); } +#endif int linux_epoll_create1(struct thread *td, struct linux_epoll_create1_args *args) @@ -616,6 +618,7 @@ return (error); } +#ifdef LINUX_LEGACY_SYSCALLS int linux_epoll_wait(struct thread *td, struct linux_epoll_wait_args *args) { @@ -623,6 +626,7 @@ return (linux_epoll_wait_common(td, args->epfd, args->events, args->maxevents, args->timeout, NULL)); } +#endif int linux_epoll_pwait(struct thread *td, struct linux_epoll_pwait_args *args) @@ -707,12 +711,14 @@ return (error); } +#ifdef LINUX_LEGACY_SYSCALLS int linux_eventfd(struct thread *td, struct linux_eventfd_args *args) { return (eventfd_create(td, args->initval, 0)); } +#endif int linux_eventfd2(struct thread *td, struct linux_eventfd2_args *args) Index: sys/compat/linux/linux_file.c =================================================================== --- sys/compat/linux/linux_file.c +++ sys/compat/linux/linux_file.c @@ -68,6 +68,7 @@ static int linux_getdents_error(struct thread *, int, int); +#ifdef LINUX_LEGACY_SYSCALLS int linux_creat(struct thread *td, struct linux_creat_args *args) { @@ -84,7 +85,7 @@ LFREEPATH(path); return (error); } - +#endif static int linux_common_open(struct thread *td, int dirfd, char *path, int l_flags, int mode) @@ -166,7 +167,11 @@ done: #ifdef DEBUG +#ifdef LINUX_LEGACY_SYSCALLS if (ldebug(open)) +#else + if (ldebug(openat)) +#endif printf(LMSG("open returns error %d"), error); #endif LFREEPATH(path); @@ -192,6 +197,7 @@ return (linux_common_open(td, dfd, path, args->flags, args->mode)); } +#ifdef LINUX_LEGACY_SYSCALLS int linux_open(struct thread *td, struct linux_open_args *args) { @@ -208,6 +214,7 @@ #endif return (linux_common_open(td, AT_FDCWD, path, args->flags, args->mode)); } +#endif int linux_lseek(struct thread *td, struct linux_lseek_args *args) @@ -307,6 +314,7 @@ roundup(offsetof(struct l_dirent64, d_name) + (namlen) + 1, \ sizeof(uint64_t)) +#ifdef LINUX_LEGACY_SYSCALLS int linux_getdents(struct thread *td, struct linux_getdents_args *args) { @@ -386,6 +394,7 @@ free(buf, M_TEMP); return (error); } +#endif int linux_getdents64(struct thread *td, struct linux_getdents64_args *args) @@ -519,6 +528,7 @@ * These exist mainly for hooks for doing /compat/linux translation. */ +#ifdef LINUX_LEGACY_SYSCALLS int linux_access(struct thread *td, struct linux_access_args *args) { @@ -541,6 +551,7 @@ return (error); } +#endif int linux_faccessat(struct thread *td, struct linux_faccessat_args *args) @@ -566,6 +577,7 @@ return (error); } +#ifdef LINUX_LEGACY_SYSCALLS int linux_unlink(struct thread *td, struct linux_unlink_args *args) { @@ -592,6 +604,7 @@ LFREEPATH(path); return (error); } +#endif int linux_unlinkat(struct thread *td, struct linux_unlinkat_args *args) @@ -641,6 +654,7 @@ return (error); } +#ifdef LINUX_LEGACY_SYSCALLS int linux_chmod(struct thread *td, struct linux_chmod_args *args) { @@ -658,6 +672,7 @@ LFREEPATH(path); return (error); } +#endif int linux_fchmodat(struct thread *td, struct linux_fchmodat_args *args) @@ -678,6 +693,7 @@ return (error); } +#ifdef LINUX_LEGACY_SYSCALLS int linux_mkdir(struct thread *td, struct linux_mkdir_args *args) { @@ -694,6 +710,7 @@ LFREEPATH(path); return (error); } +#endif int linux_mkdirat(struct thread *td, struct linux_mkdirat_args *args) @@ -713,6 +730,7 @@ return (error); } +#ifdef LINUX_LEGACY_SYSCALLS int linux_rmdir(struct thread *td, struct linux_rmdir_args *args) { @@ -753,6 +771,7 @@ LFREEPATH(to); return (error); } +#endif int linux_renameat(struct thread *td, struct linux_renameat_args *args) @@ -780,6 +799,7 @@ return (error); } +#ifdef LINUX_LEGACY_SYSCALLS int linux_symlink(struct thread *td, struct linux_symlink_args *args) { @@ -803,6 +823,7 @@ LFREEPATH(to); return (error); } +#endif int linux_symlinkat(struct thread *td, struct linux_symlinkat_args *args) @@ -830,6 +851,7 @@ return (error); } +#ifdef LINUX_LEGACY_SYSCALLS int linux_readlink(struct thread *td, struct linux_readlink_args *args) { @@ -848,6 +870,7 @@ LFREEPATH(name); return (error); } +#endif int linux_readlinkat(struct thread *td, struct linux_readlinkat_args *args) @@ -915,6 +938,7 @@ return (kern_ftruncate(td, args->fd, args->length)); } +#ifdef LINUX_LEGACY_SYSCALLS int linux_link(struct thread *td, struct linux_link_args *args) { @@ -939,6 +963,7 @@ LFREEPATH(to); return (error); } +#endif int linux_linkat(struct thread *td, struct linux_linkat_args *args) @@ -1142,6 +1167,7 @@ } #endif /* __i386__ || (__amd64__ && COMPAT_LINUX32) */ +#ifdef LINUX_LEGACY_SYSCALLS int linux_umount(struct thread *td, struct linux_umount_args *args) { @@ -1151,6 +1177,7 @@ bsd.flags = args->flags; /* XXX correct? */ return (sys_unmount(td, &bsd)); } +#endif /* * fcntl family of syscalls @@ -1463,6 +1490,7 @@ } #endif /* __i386__ || (__amd64__ && COMPAT_LINUX32) */ +#ifdef LINUX_LEGACY_SYSCALLS int linux_chown(struct thread *td, struct linux_chown_args *args) { @@ -1480,6 +1508,7 @@ LFREEPATH(path); return (error); } +#endif int linux_fchownat(struct thread *td, struct linux_fchownat_args *args) @@ -1506,6 +1535,7 @@ return (error); } +#ifdef LINUX_LEGACY_SYSCALLS int linux_lchown(struct thread *td, struct linux_lchown_args *args) { @@ -1523,6 +1553,7 @@ LFREEPATH(path); return (error); } +#endif static int convert_fadvice(int advice) @@ -1571,6 +1602,7 @@ } #endif /* __i386__ || (__amd64__ && COMPAT_LINUX32) */ +#ifdef LINUX_LEGACY_SYSCALLS int linux_pipe(struct thread *td, struct linux_pipe_args *args) { @@ -1594,6 +1626,7 @@ return (error); } +#endif int linux_pipe2(struct thread *td, struct linux_pipe2_args *args) Index: sys/compat/linux/linux_fork.c =================================================================== --- sys/compat/linux/linux_fork.c +++ sys/compat/linux/linux_fork.c @@ -64,6 +64,7 @@ #include #include +#ifdef LINUX_LEGACY_SYSCALLS int linux_fork(struct thread *td, struct linux_fork_args *args) { @@ -135,6 +136,7 @@ return (0); } +#endif static int linux_clone_proc(struct thread *td, struct linux_clone_args *args) Index: sys/compat/linux/linux_misc.c =================================================================== --- sys/compat/linux/linux_misc.c +++ sys/compat/linux/linux_misc.c @@ -191,6 +191,7 @@ return (copyout(&sysinfo, args->info, sizeof(sysinfo))); } +#ifdef LINUX_LEGACY_SYSCALLS int linux_alarm(struct thread *td, struct linux_alarm_args *args) { @@ -225,6 +226,7 @@ td->td_retval[0] = old_it.it_value.tv_sec; return (0); } +#endif int linux_brk(struct thread *td, struct linux_brk_args *args) @@ -494,6 +496,7 @@ #endif /* __i386__ */ +#ifdef LINUX_LEGACY_SYSCALLS int linux_select(struct thread *td, struct linux_select_args *args) { @@ -585,6 +588,7 @@ #endif return (error); } +#endif int linux_mremap(struct thread *td, struct linux_mremap_args *args) @@ -646,6 +650,7 @@ args->fl & ~LINUX_MS_SYNC)); } +#ifdef LINUX_LEGACY_SYSCALLS int linux_time(struct thread *td, struct linux_time_args *args) { @@ -665,6 +670,7 @@ td->td_retval[0] = tm; return (0); } +#endif struct l_times_argv { l_clock_t tms_utime; @@ -761,6 +767,7 @@ l_time_t l_modtime; }; +#ifdef LINUX_LEGACY_SYSCALLS int linux_utime(struct thread *td, struct linux_utime_args *args) { @@ -794,7 +801,9 @@ LFREEPATH(fname); return (error); } +#endif +#ifdef LINUX_LEGACY_SYSCALLS int linux_utimes(struct thread *td, struct linux_utimes_args *args) { @@ -827,6 +836,7 @@ LFREEPATH(fname); return (error); } +#endif static int linux_utimensat_nsec_valid(l_long nsec) @@ -921,6 +931,7 @@ return (error); } +#ifdef LINUX_LEGACY_SYSCALLS int linux_futimesat(struct thread *td, struct linux_futimesat_args *args) { @@ -953,6 +964,7 @@ LFREEPATH(fname); return (error); } +#endif int linux_common_wait(struct thread *td, int pid, int *status, @@ -1094,6 +1106,7 @@ return (error); } +#ifdef LINUX_LEGACY_SYSCALLS int linux_mknod(struct thread *td, struct linux_mknod_args *args) { @@ -1142,6 +1155,7 @@ LFREEPATH(path); return (error); } +#endif int linux_mknodat(struct thread *td, struct linux_mknodat_args *args) Index: sys/compat/linux/linux_stats.c =================================================================== --- sys/compat/linux/linux_stats.c +++ sys/compat/linux/linux_stats.c @@ -155,6 +155,7 @@ return (copyout(&tbuf, ubuf, sizeof(tbuf))); } +#ifdef LINUX_LEGACY_SYSCALLS int linux_newstat(struct thread *td, struct linux_newstat_args *args) { @@ -196,6 +197,7 @@ return (error); return (newstat_copyout(&sb, args->buf)); } +#endif int linux_newfstat(struct thread *td, struct linux_newfstat_args *args) @@ -509,6 +511,7 @@ char f_fpack[6]; }; +#ifdef LINUX_LEGACY_SYSCALLS int linux_ustat(struct thread *td, struct linux_ustat_args *args) { @@ -519,6 +522,7 @@ return (EOPNOTSUPP); } +#endif #if defined(__i386__) || (defined(__amd64__) && defined(COMPAT_LINUX32)) Index: sys/compat/linux/linux_sysctl.c =================================================================== --- sys/compat/linux/linux_sysctl.c +++ sys/compat/linux/linux_sysctl.c @@ -115,6 +115,7 @@ return (0); } +#ifdef LINUX_LEGACY_SYSCALLS int linux_sysctl(struct thread *td, struct linux_sysctl_args *args) { @@ -191,3 +192,4 @@ LIN_SDT_PROBE1(sysctl, linux_sysctl, return, ENOTDIR); return (ENOTDIR); } +#endif Index: sys/i386/linux/linux.h =================================================================== --- sys/i386/linux/linux.h +++ sys/i386/linux/linux.h @@ -36,6 +36,8 @@ #include #include +#define LINUX_LEGACY_SYSCALLS + /* * debugging support */