Index: head/sys/amd64/linux/linux.h =================================================================== --- head/sys/amd64/linux/linux.h +++ head/sys/amd64/linux/linux.h @@ -35,6 +35,8 @@ #include #include +#define LINUX_LEGACY_SYSCALLS + /* * debugging support */ Index: head/sys/amd64/linux32/linux.h =================================================================== --- head/sys/amd64/linux32/linux.h +++ head/sys/amd64/linux32/linux.h @@ -38,6 +38,8 @@ #include #include +#define LINUX_LEGACY_SYSCALLS + /* * debugging support */ Index: head/sys/compat/linux/linux_event.c =================================================================== --- head/sys/compat/linux/linux_event.c +++ head/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: head/sys/compat/linux/linux_file.c =================================================================== --- head/sys/compat/linux/linux_file.c +++ head/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,8 +85,8 @@ LFREEPATH(path); return (error); } +#endif - static int linux_common_open(struct thread *td, int dirfd, char *path, int l_flags, int mode) { @@ -165,7 +166,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); @@ -191,6 +196,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) { @@ -207,6 +213,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) @@ -305,6 +312,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) { @@ -384,6 +392,7 @@ free(buf, M_TEMP); return (error); } +#endif int linux_getdents64(struct thread *td, struct linux_getdents64_args *args) @@ -517,6 +526,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) { @@ -539,6 +549,7 @@ return (error); } +#endif int linux_faccessat(struct thread *td, struct linux_faccessat_args *args) @@ -564,6 +575,7 @@ return (error); } +#ifdef LINUX_LEGACY_SYSCALLS int linux_unlink(struct thread *td, struct linux_unlink_args *args) { @@ -590,6 +602,7 @@ LFREEPATH(path); return (error); } +#endif int linux_unlinkat(struct thread *td, struct linux_unlinkat_args *args) @@ -639,6 +652,7 @@ return (error); } +#ifdef LINUX_LEGACY_SYSCALLS int linux_chmod(struct thread *td, struct linux_chmod_args *args) { @@ -656,6 +670,7 @@ LFREEPATH(path); return (error); } +#endif int linux_fchmodat(struct thread *td, struct linux_fchmodat_args *args) @@ -676,6 +691,7 @@ return (error); } +#ifdef LINUX_LEGACY_SYSCALLS int linux_mkdir(struct thread *td, struct linux_mkdir_args *args) { @@ -692,6 +708,7 @@ LFREEPATH(path); return (error); } +#endif int linux_mkdirat(struct thread *td, struct linux_mkdirat_args *args) @@ -711,6 +728,7 @@ return (error); } +#ifdef LINUX_LEGACY_SYSCALLS int linux_rmdir(struct thread *td, struct linux_rmdir_args *args) { @@ -751,6 +769,7 @@ LFREEPATH(to); return (error); } +#endif int linux_renameat(struct thread *td, struct linux_renameat_args *args) @@ -778,6 +797,7 @@ return (error); } +#ifdef LINUX_LEGACY_SYSCALLS int linux_symlink(struct thread *td, struct linux_symlink_args *args) { @@ -801,6 +821,7 @@ LFREEPATH(to); return (error); } +#endif int linux_symlinkat(struct thread *td, struct linux_symlinkat_args *args) @@ -828,6 +849,7 @@ return (error); } +#ifdef LINUX_LEGACY_SYSCALLS int linux_readlink(struct thread *td, struct linux_readlink_args *args) { @@ -846,6 +868,7 @@ LFREEPATH(name); return (error); } +#endif int linux_readlinkat(struct thread *td, struct linux_readlinkat_args *args) @@ -913,6 +936,7 @@ return (kern_ftruncate(td, args->fd, args->length)); } +#ifdef LINUX_LEGACY_SYSCALLS int linux_link(struct thread *td, struct linux_link_args *args) { @@ -937,6 +961,7 @@ LFREEPATH(to); return (error); } +#endif int linux_linkat(struct thread *td, struct linux_linkat_args *args) @@ -1138,6 +1163,7 @@ } #endif /* __i386__ || (__amd64__ && COMPAT_LINUX32) */ +#ifdef LINUX_LEGACY_SYSCALLS int linux_umount(struct thread *td, struct linux_umount_args *args) { @@ -1147,6 +1173,7 @@ bsd.flags = args->flags; /* XXX correct? */ return (sys_unmount(td, &bsd)); } +#endif /* * fcntl family of syscalls @@ -1458,6 +1485,7 @@ } #endif /* __i386__ || (__amd64__ && COMPAT_LINUX32) */ +#ifdef LINUX_LEGACY_SYSCALLS int linux_chown(struct thread *td, struct linux_chown_args *args) { @@ -1475,6 +1503,7 @@ LFREEPATH(path); return (error); } +#endif int linux_fchownat(struct thread *td, struct linux_fchownat_args *args) @@ -1501,6 +1530,7 @@ return (error); } +#ifdef LINUX_LEGACY_SYSCALLS int linux_lchown(struct thread *td, struct linux_lchown_args *args) { @@ -1518,6 +1548,7 @@ LFREEPATH(path); return (error); } +#endif static int convert_fadvice(int advice) @@ -1566,6 +1597,7 @@ } #endif /* __i386__ || (__amd64__ && COMPAT_LINUX32) */ +#ifdef LINUX_LEGACY_SYSCALLS int linux_pipe(struct thread *td, struct linux_pipe_args *args) { @@ -1589,6 +1621,7 @@ return (error); } +#endif int linux_pipe2(struct thread *td, struct linux_pipe2_args *args) Index: head/sys/compat/linux/linux_fork.c =================================================================== --- head/sys/compat/linux/linux_fork.c +++ head/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: head/sys/compat/linux/linux_misc.c =================================================================== --- head/sys/compat/linux/linux_misc.c +++ head/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: head/sys/compat/linux/linux_stats.c =================================================================== --- head/sys/compat/linux/linux_stats.c +++ head/sys/compat/linux/linux_stats.c @@ -81,6 +81,7 @@ translate_vnhook_major_minor)); } +#ifdef LINUX_LEGACY_SYSCALLS static int linux_kern_stat(struct thread *td, char *path, enum uio_seg pathseg, struct stat *sbp) @@ -97,6 +98,7 @@ return (linux_kern_statat(td, AT_SYMLINK_NOFOLLOW, AT_FDCWD, path, pathseg, sbp)); } +#endif static void translate_fd_major_minor(struct thread *td, int fd, struct stat *buf) @@ -173,6 +175,7 @@ return (copyout(&tbuf, ubuf, sizeof(tbuf))); } +#ifdef LINUX_LEGACY_SYSCALLS int linux_newstat(struct thread *td, struct linux_newstat_args *args) { @@ -214,6 +217,7 @@ return (error); return (newstat_copyout(&sb, args->buf)); } +#endif int linux_newfstat(struct thread *td, struct linux_newfstat_args *args) @@ -524,6 +528,7 @@ char f_fpack[6]; }; +#ifdef LINUX_LEGACY_SYSCALLS int linux_ustat(struct thread *td, struct linux_ustat_args *args) { @@ -534,6 +539,7 @@ return (EOPNOTSUPP); } +#endif #if defined(__i386__) || (defined(__amd64__) && defined(COMPAT_LINUX32)) Index: head/sys/compat/linux/linux_sysctl.c =================================================================== --- head/sys/compat/linux/linux_sysctl.c +++ head/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: head/sys/i386/linux/linux.h =================================================================== --- head/sys/i386/linux/linux.h +++ head/sys/i386/linux/linux.h @@ -35,6 +35,8 @@ #include #include +#define LINUX_LEGACY_SYSCALLS + /* * debugging support */