Skip to content

Commit 26afdf6

Browse files
committed
unix-ffi/machine/timer: Use libc if librt is not present.
Newer implementations of libc integrate the functions from librt, for example glibc since 2.17 and uClibc-ng. So if the librt.so cannot be loaded, it can be assumed that libc contains the expected functions.
1 parent 96e17b6 commit 26afdf6

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Diff for: unix-ffi/machine/machine/timer.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@
55
from signal import *
66

77
libc = ffilib.libc()
8-
librt = ffilib.open("librt")
8+
try:
9+
librt = ffilib.open("librt")
10+
except OSError as e:
11+
librt = libc
912

1013
CLOCK_REALTIME = 0
1114
CLOCK_MONOTONIC = 1

0 commit comments

Comments
 (0)