From 4503cb7236ea626a42d4c158fe822c2466b8050f Mon Sep 17 00:00:00 2001 From: bz Date: Mon, 14 Mar 2016 14:55:15 +0000 Subject: [PATCH] Only check for SYS_freebsd6_lseek if the syscall code is defined. Whether this is the right or best solution is unclear but it fixes the build for now. --- sys/arm/arm/vm_machdep.c | 11 ++++++++--- sys/powerpc/powerpc/exec_machdep.c | 7 +++++-- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/sys/arm/arm/vm_machdep.c b/sys/arm/arm/vm_machdep.c index 6a70cbf403e0..70d6c705897b 100644 --- a/sys/arm/arm/vm_machdep.c +++ b/sys/arm/arm/vm_machdep.c @@ -40,6 +40,8 @@ * Utah $Hdr: vm_machdep.c 1.16.1.1 89/06/23$ */ +#include "opt_compat.h" + #include __FBSDID("$FreeBSD$"); @@ -180,7 +182,7 @@ cpu_set_syscall_retval(struct thread *td, int error) /* * __syscall returns an off_t while most other syscalls return an * int. As an off_t is 64-bits and an int is 32-bits we need to - * place the returned data into r1. As the lseek and frerebsd6_lseek + * place the returned data into r1. As the lseek and freebsd6_lseek * syscalls also return an off_t they do not need this fixup. */ call = frame->tf_r7; @@ -189,8 +191,11 @@ cpu_set_syscall_retval(struct thread *td, int error) register_t code = ap[_QUAD_LOWWORD]; if (td->td_proc->p_sysent->sv_mask) code &= td->td_proc->p_sysent->sv_mask; - fixup = (code != SYS_freebsd6_lseek && code != SYS_lseek) - ? 1 : 0; + fixup = ( +#if defined(COMPAT_FREEBSD6) && defined(SYS_freebsd6_lseek) + code != SYS_freebsd6_lseek && +#endif + code != SYS_lseek) ? 1 : 0; } #endif diff --git a/sys/powerpc/powerpc/exec_machdep.c b/sys/powerpc/powerpc/exec_machdep.c index 4e56429ea0bb..1acc1803d406 100644 --- a/sys/powerpc/powerpc/exec_machdep.c +++ b/sys/powerpc/powerpc/exec_machdep.c @@ -879,8 +879,11 @@ cpu_set_syscall_retval(struct thread *td, int error) int code = tf->fixreg[FIRSTARG + 1]; if (p->p_sysent->sv_mask) code &= p->p_sysent->sv_mask; - fixup = (code != SYS_freebsd6_lseek && code != SYS_lseek) ? - 1 : 0; + fixup = ( +#if defined(COMPAT_FREEBSD6) && defined(SYS_freebsd6_lseek) + code != SYS_freebsd6_lseek && +#endif + code != SYS_lseek) ? 1 : 0; } else fixup = 0;