Summary: | qemu-bsd-user fails to parse sysctl tree for mips | ||
---|---|---|---|
Product: | Ports & Packages | Reporter: | Sean Bruno <sbruno> |
Component: | Individual Port(s) | Assignee: | Sean Bruno <sbruno> |
Status: | Closed FIXED | ||
Severity: | Affects Only Me | CC: | nox, sson |
Priority: | --- | ||
Version: | Latest | ||
Hardware: | Any | ||
OS: | Any |
Description
Sean Bruno
2015-06-28 15:46:19 UTC
Also fails with qemu-mips64. qemu-mips64-static -strace indicates that sysctl({0 4 16777216 16777216}, 4,...) is failing: 39063 __sysctl({ 0 2 1 }, 3, 0x0000007fffffd5f8, 0x0000007fffffd650, 0x0000000000000000, 0x0000000000000000) = 0 39063 __sysctl({ 0 1 16777216 16777216 }, 4, 0x0000007fffffccb0, 0x0000007fffffd518, 0x0000000000000000, 0x0000000000000000) = 0 39063 __sysctl({ 0 4 16777216 16777216 }, 4, 0x0000007fffffc478, 0x0000007fffffc878, 0x0000000000000000, 0x0000000000000000) = -1 errno=2 (No such file or directory) A comment from sys/kern/kern_sysctl.c documents these undocumented sysctl's: /* * "Staff-functions" * * These functions implement a presently undocumented interface * used by the sysctl program to walk the tree, and get the type * so it can print the value. * This interface is under work and consideration, and should probably * be killed with a big axe by the first person who can find the time. * (be aware though, that the proper interface isn't as obvious as it * may seem, there are various conflicting requirements. * * {0,0} printf the entire MIB-tree. * {0,1,...} return the name of the "..." OID. * {0,2,...} return the next OID. * {0,3} return the OID of the name in "new" * {0,4,...} return the kind & format info for the "..." OID. * {0,5,...} return the description the "..." OID. */ It is strange that {0,1,...} works but {0,4,...} is failing. (In reply to Stacey Son from comment #1) Some sysctls are structs, I don't think we handle all of these... ..for example sysctl_oldcvt() in bsd-user/freebsd/os-sys.c doesn't handle CTLTYPE_OPAQUE and CTLTYPE_STRUCT. (In reply to Juergen Lock from comment #3) Note that all the KERN_PROC code I recently added is CTLTYPE_STRUCT types. With structs there isn't really a generic way of handling them. https://github.com/seanbruno/qemu-bsd-user/commit/9b1c1bb82d63266e0b0e24d455e430ae366642c3 should fix this problem and give lots of output for 'sysctl -a'. Some of the output from 'sysctl -a' may not be correct, however, since it may need to be byte swapped itself. A commit references this bug: Author: nox Date: Thu Jul 2 15:41:53 UTC 2015 New revision: 391165 URL: https://svnweb.freebsd.org/changeset/ports/391165 Log: Catch up with github tree - changelog: https://github.com/seanbruno/qemu-bsd-user/commits/bsd-user PR: 201168 Changes: head/emulators/qemu-sbruno/Makefile head/emulators/qemu-sbruno/distinfo |