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>
pull/995/head
Bas van Doren 2025-04-06 14:42:09 +02:00 zatwierdzone przez Damien George
rodzic d1a74360a2
commit 42caaf14de
2 zmienionych plików z 5 dodań i 2 usunięć

Wyświetl plik

@ -5,7 +5,10 @@ import os
from signal import *
libc = ffilib.libc()
librt = ffilib.open("librt")
try:
librt = ffilib.open("librt")
except OSError as e:
librt = libc
CLOCK_REALTIME = 0
CLOCK_MONOTONIC = 1

Wyświetl plik

@ -1,4 +1,4 @@
metadata(version="0.2.1")
metadata(version="0.2.2")
# Originally written by Paul Sokolovsky.