Skip to content

Commit 42caaf1

Browse files
basvddpgeorge
authored andcommitted
unix-ffi/machine: 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. Signed-off-by: Bas van Doren <[email protected]>
1 parent d1a7436 commit 42caaf1

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

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

unix-ffi/machine/manifest.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
metadata(version="0.2.1")
1+
metadata(version="0.2.2")
22

33
# Originally written by Paul Sokolovsky.
44

0 commit comments

Comments
 (0)