Compiling that on OS X with nim cpp yields this error:
stdlib_ioselectors.cpp:558:10: error: no matching function for call to 'sysctl'
LOC3 = sysctl((&namearr0[(((NI) 0))- 0]), ((unsigned int) 2), ((void*) ((&maxfd0))), (&size0), NIM_NIL, ((NI) 0));
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include/sys/sysctl.h:759:5: note: candidate function not viable: no known conversion from 'NI *' (aka 'long long *') to 'size_t *' (aka 'unsigned long *') for 4th argument
int sysctl(int *, u_int, void *, size_t *, void *, size_t);
It seems the problem is that sysctl is wrapped with incorrect signature and C backend gets away with that because of C's loose type checking.