Move functions back to libc/gen sources; they are only versioned from libc and not libsys. Access libsys interposing slots using __libsys_interposing_slot() instead of direct __libsys_interposing array dereference, which cannot work from libc. Reported by: glebius
Details
Details
- Reviewers
brooks - Commits
- rG7d233b2220cd: libsys: fix sleep(3)/usleep(3) cancel behavior
Diff Detail
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Skipped - Unit
Tests Skipped
Event Timeline
lib/libc/gen/sleep.c | ||
---|---|---|
58 | Why not just call nanosleep(2) which can access this directly? |
lib/libc/gen/sleep.c | ||
---|---|---|
58 | I think this code just evolved that way. Calling nanosleep() from libc did not work, so it needed explicit interposing. Then for the same reason it needed the interposing call in libsys. Feel free to change, assuming it works. |
lib/libc/gen/sleep.c | ||
---|---|---|
58 | I was wrong, it is more complicated. Originally, the call was to _nanosleep() and not sleep, due to libc namespacing. Right now _nanosleep() in libsys is same as __sys_nanosleep(), i.e. not interposed. So the indirection through the slot is required there. Or we should change _nanosleep() to be alias for nanosleep() in libsys. |