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 <basvdoren@gmail.com>
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

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

unix-ffi/machine/manifest.py

Lines changed: 1 addition & 1 deletion
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy