Skip to contentSkip to conversation

Track change in FreeBSD SYSCTL(9) types

PATCH Applied Ed Maste 3 participants 4 messages Apr 25, 2013 – Apr 26, 2013

lore
Share & tools
lore

Ed Maste

author
#0 lore raw

PATCH 1/1 Track change in FreeBSD SYSCTL(9) types

Originally from Garrett Cooper in FreeBSD PR ports/155558
http://www.freebsd.org/cgi/query-pr.cgi?pr=155558

---
 bsd-user/syscall.c | 4 ++++
 1 file changed, 4 insertions(+)
bsd-user/syscall.c +4 -0
index 18b43f1..69e3466 100644
@@ -211,7 +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
+    case CTLTYPE_U64:
+#endif
         *(uint64_t *)holdp = tswap64(*(uint64_t *)holdp);
         break;
     case CTLTYPE_STRING:
Signature · 1 line
1.7.11.5
#1 lore raw

On Thu, Apr 25, 2013 at 01:59:41PM -0400, Ed Maste wrote:

CCing [email protected].

Quoted 28 lines

Originally from Garrett Cooper in FreeBSD PR ports/155558
http://www.freebsd.org/cgi/query-pr.cgi?pr=155558

---
 bsd-user/syscall.c | 4 ++++
 1 file changed, 4 insertions(+)
bsd-user/syscall.c +4 -0
index 18b43f1..69e3466 100644
@@ -211,7 +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
+    case CTLTYPE_U64:
+#endif
         *(uint64_t *)holdp = tswap64(*(uint64_t *)holdp);
         break;
     case CTLTYPE_STRING:
Signature · 1 line
1.7.11.5
#3 lore raw
In reply to Ed Maste
Quoted 14 lines · Ed Maste

Originally from Garrett Cooper in FreeBSD PR ports/155558
http://www.freebsd.org/cgi/query-pr.cgi?pr=155558

---
 bsd-user/syscall.c | 4 ++++
 1 file changed, 4 insertions(+)
bsd-user/syscall.c +0 -0
index 18b43f1..69e3466 100644
@@ -211,7 +211,11 @@ static int sysctl_oldcvt(void *holdp, size_t holdlen, uint32_t kind)
         *(uint64_t *)holdp = tswap64(*(unsigned long *)holdp);

bsd-user/syscall.c static int sysctl_oldcvt(void *holdp, size_t holdlen, uint32_t kind) · line 221

Quoted 10 lines
bsd-user/syscall.c +4 -0
         break;
 #endif
+#if !defined(__FreeBSD_version) || __FreeBSD_version < 900031
     case CTLTYPE_QUAD:
+#else
+    case CTLTYPE_U64:
+#endif
         *(uint64_t *)holdp = tswap64(*(uint64_t *)holdp);
         break;
     case CTLTYPE_STRING:

Would something OS agnostic such as

#ifdef CTLTYPE_U64
case CTLTYPE_U64:
#else
case CTLTYPE_QUAD:
#endif

have done?

Cheers,

Patrick