开发者

Statically linking new libc symbols to use with a lower libc version

开发者 https://www.devze.com 2023-01-10 03:55 出处:网络
I have an app that uses eventfd and timerfd kernel syscalls. For that use you need a modern kernel and a libc that supports them, at least 2.8.

I have an app that uses eventfd and timerfd kernel syscalls. For that use you need a modern kernel and a libc that supports them, at least 2.8.

My current situation is, I have a system with the proper kernel but a 2.7.11 libc version which obviously does not support the required functions for the new syscalls.

But, as those 2 interfaces(timerfd,eventfd) are probably just a syscall call from the libc I was wondering if I could statically link the required symbols with a modern libc and then run the app on the 2.7.11 libc with the proper kernel.

As I see the statically linked functions will just execute the syscalls without using the libc and that would make them safe, but I might be overlooking other problems.

Anybody knows if this sounds feasible and how could I statically开发者_StackOverflow中文版 link just those functions?


It's probably more feasible to create your own conditionally-compiled versions that use syscall() to call them directly.

0

精彩评论

暂无评论...
验证码 换一张
取 消