4 ms·
The first and foremost interface of the kernel is the syscall interface aka the uapi. libc and other C libraries like liburing or libcap are downstream of that.
by muvlon 11mo ago
The first and foremost interface of the kernel is the syscall interface aka the uapi. libc and other C libraries like liburing or libcap are downstream of that. Many syscalls still don't have wrappers in libc after years of use.
- smartmic 11mo agoThanks for clarification! I meant more, why isn't there a C API first, but Rust, Haskell, and Go before that — that's kind of surprising or new to me.
- WJW 11mo agoI don't understand what you mean. There's no "official" Rust, Haskell and Go APIs for this thing either. All libraries available seem to be just what some third party made available. There's also several C libraries, just none that have been officially endorsed by the Linux kernel team.
- wging 11mo agoI read the article as saying that there's no official C library but unofficial ones do exist. Quote below, emphasis mine. > A official c library doesn’t exist yet unfortunately, but there’s several out there you can try. Also, it looks like there is more than zero support for C programs calling Landlock APIs. Even without a 3rd-party library you're not just calling syscall() with a magic number: https://docs.kernel.org/userspace-api/landlock.html https://docs.kernel.org/userspace-api/landlock.html https://github.com/torvalds/linux/blob/6bda50f4/include/uapi/linux/landlock.h https://github.com/torvalds/linux/blob/6bda50f4/include/uapi... https://github.com/torvalds/linux/blob/6bda50f4/include/linux/syscalls.h#L980 https://github.com/torvalds/linux/blob/6bda50f4/include/linu...
- nine_k 11mo agoGo is famous for not needing libc and talking to the kernel. Rust and Haskell have communities that are very interested in safety and security, so they are earlier adopters. For C, unofficial support apparently sufficed for now.
- samus 11mo agoYet for many syscalls there is an official library - in most cases a wrapper in libc, but especially io_uring is known to provide a C library that most applications ought to use instead of the raw syscalls.
- ijustlovemath 11mo agoIs io_uring not itself a set of syscalls?
- projektfu 11mo agohttps://github.com/axboe/liburing https://github.com/axboe/liburing "This is the io_uring library, liburing. liburing provides helpers to setup and teardown io_uring instances, and also a simplified interface for applications that don't need (or want) to deal with the full kernel side implementation."
- samus 11mo agoYes, it is. But it's rather complicated and not all applications need its full power. https://lwn.net/Articles/810414/ https://lwn.net/Articles/810414/
- moffkalast 11mo agoWhat do you call syscalls in then? Assembly?