Skip to content

Commit

Permalink
bsd-user: OS-agnostic 64-bit SYSCTL types
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
emaste authored and Michael Tokarev committed May 12, 2013
1 parent 38ebb39 commit e6a3ee5
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions bsd-user/syscall.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit e6a3ee5

Please sign in to comment.