Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GNU HURD and util.c:1190: warning: sched_setaffinity is not implemented and will always fail #82

Closed
noloader opened this issue Mar 20, 2020 · 2 comments

Comments

@noloader
Copy link
Contributor

noloader commented Mar 20, 2020

Hi Everyone, @wcawijngaards,

Here's the last issue report for HURD. HURD needs a patch for _GNU_SOURCE and <sched.h>. Then it needs a custom AC_COMPILE_IFELSE test. That's attached in the PR.

Now, when linking nsd, we get this message:

gcc -g -O2 -flto -L/usr/local/lib -o nsd-checkconf answer.o axfr.o buffer.o conf
iglexer.o configparser.o dname.o dns.o edns.o iterated_hash.o lookup3.o namedb.o
 nsec3.o options.o packet.o query.o rbtree.o radtree.o rdata.o region-allocator.
o rrl.o tsig.o tsig-openssl.o udb.o udbradtree.o udbzone.o util.o bitset.o popen
3.o nsd-checkconf.o cpuset.o strlcat.o strlcpy.o b64_pton.o b64_ntop.o setprocti
tle.o -lcrypto -ldl -levent
/usr/bin/ld: /tmp/nsd.HEkDrr.ltrans3.ltrans.o: in function `set_cpu_affinity':
/home/nsd/util.c:1190: warning: sched_setaffinity is not implemented and will always fail

According to Success in building x86info under GNU/Hurd on the HURD mailing list, this is expected because mach kernels are single core:

Yes, that's not implemented yet on GNU/Hurd, since the mach is
mono-processor for now. For the same reason it's actually not a problem
at all, x86info only needs setaffinity on multi-processor boxes.

The idea is, you have lots of little servers running around and communicating and passing messages rather than a big, monolithic kernel.

Moving forward, cutest succeeds:

jwalton@hurd-x86:~/nsd$ ./cutest 
srandom(1584675682)
....................................................
OK (52 tests)
SKIP (0 tests)

At this point, I know Linux, DragonFly, FreeBSD, NetBSD, OpenBSD and HURD pass the self tests.

util.c compiles on Solaris, but not much more. Lex and Yacc are too anemic, and there are no replacements available in /usr/gnu/bin. In practice Solaris is not supported.

wcawijngaards added a commit that referenced this issue Mar 20, 2020
Fix GNU HURD sched_setaffinity compile (GH #82)
@wcawijngaards
Copy link
Member

So the test is fixed, now does that test you added fail for sched_setaffinity on herd? Because I thought it did. But that means it'll try cpuset_setaffinity from BSD. And also that the comment "Linux and Hurd" is not true. Instead an ifdef for hurd in util.c could have a routine that always fails (just like it is trying to give us already but then without the warning when you build it).

@wcawijngaards
Copy link
Member

I committed what could be a fix in d3825f5 . This creates the extra case for gnu hurd and prints an error that setaffinity is not available. It does not actually link in the sched_setaffinity call so the linker error should be solved. This should make everything compile clean, and also detection of sched_setaffinity works on hurd, even though it is unused.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants