[Bug 236714] Clang problem with rctl(8)
bugzilla-noreply at freebsd.org
bugzilla-noreply at freebsd.org
Wed Apr 3 20:31:24 UTC 2019
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=236714
--- Comment #12 from Mateusz Guzik <mjg at FreeBSD.org> ---
It is not being ignored. There is non-zero garbage in an area not written to by
sysctl, which makes the zero comparison fail.
diff --git a/usr.bin/rctl/rctl.c b/usr.bin/rctl/rctl.c
index 74073c13207e..8fb9e862aee8 100644
--- a/usr.bin/rctl/rctl.c
+++ b/usr.bin/rctl/rctl.c
@@ -378,12 +378,15 @@ print_rules(char *rules, int hflag, int nflag)
static void
enosys(void)
{
- int error, racct_enable;
+ int error, racct_enable = ~(0);
size_t racct_enable_len;
+
+ printf("%x\n", racct_enable);
racct_enable_len = sizeof(racct_enable);
error = sysctlbyname("kern.racct.enable",
&racct_enable, &racct_enable_len, NULL, 0);
+ printf("%x\n", racct_enable);
if (error != 0) {
if (errno == ENOENT)
Results in:
ffffffff
ffffff00
a.out: failed to show rules for '::': Function not implemented
--
You are receiving this mail because:
You are the assignee for the bug.
More information about the freebsd-toolchain
mailing list