diff options
author | Ed Maste <emaste@freebsd.org> | 2013-04-30 09:29:32 -0400 |
---|---|---|
committer | Michael Tokarev <mjt@tls.msk.ru> | 2013-05-12 13:25:55 +0400 |
commit | e6a3ee5f7981e7df40aa581ebc245fd0a7d3bed0 (patch) | |
tree | 4827a0c870f6ac4dfa72a192e952319dd0ec917c | |
parent | 38ebb396c955ceb2ef7e246248ceb7f8bfe1b774 (diff) |
bsd-user: OS-agnostic 64-bit SYSCTL types
Use existence of type as #ifdef condition rather than FreeBSD-specific
version check, as suggested by Patrick Welche.
Also handle the signed (CTLTYPE_S64) case identically to the unsigned
(CTLTYPE_U64) case, per later patches in the FreeBSD ports tree
(emulators/qemu-devel/files/patch-z-arm-bsd-user-001).
Signed-off-by: Ed Maste <emaste@freebsd.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
-rw-r--r-- | bsd-user/syscall.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/bsd-user/syscall.c b/bsd-user/syscall.c index 69e3466a08..a4d1583fed 100644 --- a/bsd-user/syscall.c +++ b/bsd-user/syscall.c @@ -211,10 +211,11 @@ static int sysctl_oldcvt(void *holdp, size_t holdlen, uint32_t kind) *(uint64_t *)holdp = tswap64(*(unsigned long *)holdp); break; #endif -#if !defined(__FreeBSD_version) || __FreeBSD_version < 900031 - case CTLTYPE_QUAD: -#else +#ifdef CTLTYPE_U64 + case CTLTYPE_S64: case CTLTYPE_U64: +#else + case CTLTYPE_QUAD: #endif *(uint64_t *)holdp = tswap64(*(uint64_t *)holdp); break; |