Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit d0bd333

Browse files
committed
unix-ffi/machine/machine/timer.py: 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 <basvdoren@gmail.com>
1 parent 96e17b6 commit d0bd333

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

‎unix-ffi/machine/machine/timer.py‎

Lines changed: 4 additions & 1 deletion
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)

AltStyle によって変換されたページ (->オリジナル) /