epoll_pwait2 is new and may not be present in libc and/or kernel.
Since we effectively add it to libc (as will be probed by the program
using dlsym or a weak function pointer) we need to handle the case
when it's not present in the actual libc.
Details
Details
- Reviewers
melver - Commits
- rG099997540f45: tsan: fix epoll_pwait2 interceptor
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Unit Tests
Unit Tests
Event Timeline
compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp | ||
---|---|---|
1954 | sanitizer_posix.cpp already includes things like errno.h - can we include errno.h and use ENOSYS? Also is this return value correct? On success, epoll_wait() returns the number of file descriptors ready for the requested I/O, or zero if no file descriptor became ready during the requested timeout milliseconds. On failure, epoll_wait() returns -1 and errno is set to indicate the error. |
Comment Actions
Also is this return value correct?
Good point!
Somehow the internal test I was using to check this passed...
sanitizer_posix.cpp already includes things like errno.h - can we include errno.h and use ENOSYS?
We avoided including any system headers to avoid conflicts in definitions and redefinitions. I would do it differently (with asm aliases), but that's how we do it now.
I see there is already sanitizer_common/sanitizer_errno_codes.h, so I extended it.
PTAL
sanitizer_posix.cpp already includes things like errno.h - can we include errno.h and use ENOSYS?
Also is this return value correct?
https://man7.org/linux/man-pages/man2/epoll_wait.2.html