-
-
Notifications
You must be signed in to change notification settings - Fork 548
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for io_uring #272
Comments
Thoughts about this:
|
Apologies in advance for necro'ing this issue, but one thing to consider is that ifuncs are specific to glibc. Using them means lwan would no longer compile with musl, cosmopolitan, or any other alternative libc. I would suggest instead to use #if defined(SUPPORT_URING)
inline
#endif
static void my_func_impl_io_uring() {
// ...
}
#if defined(SUPPORT_EPOLL)
inline
#endif
static void my_func_impl_epoll() {
// ...
}
#if defined(SUPPORT_URING)
void my_func() { my_func_impl_io_uring(); }
#elif defined(SUPPORT_EPOLL)
void my_func() { my_func_impl_epoll(); }
#else
void(*my_func)();
__attribute__((constructor)) static void resolve_my_func() {
long major;
long minor;
// major, minor = uname(...)
if(major > 5 || (major == 5 && minor >= 1))
my_func = my_func_impl_io_uring;
else
my_func = my_func_impl_epoll;
}
#endif |
Yes, that's also a possibility. It'll take a long while before either handmade resolvers or ifuncs are used though -- I haven't been working that hard on Lwan for a while now. (Unless you're interested in implementing this -- in which case, feel free to ask questions if you end up getting stuck.) |
The text was updated successfully, but these errors were encountered: