MCPcopy Create free account
hub / github.com/async-profiler/async-profiler / poll_hook

Function poll_hook

src/symbols_linux.cpp:38–47  ·  view source on GitHub ↗

Workaround for JDK-8312065 on JDK 8: replace poll() implementation with ppoll() which is restartable

Source from the content-addressed store, hash-verified

36// Workaround for JDK-8312065 on JDK 8:
37// replace poll() implementation with ppoll() which is restartable
38static int poll_hook(struct pollfd* fds, nfds_t nfds, int timeout) {
39 if (timeout >= 0) {
40 struct timespec ts;
41 ts.tv_sec = timeout / 1000;
42 ts.tv_nsec = (timeout % 1000) * 1000000;
43 return ppoll(fds, nfds, &ts, NULL);
44 } else {
45 return ppoll(fds, nfds, NULL, NULL);
46 }
47}
48
49static void applyPatch(CodeCache* cc) {
50 static bool patch_libnet = VM::hotspot_version() == 8;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected