Linux Source Compatibility
FreeBSD and Linux are already largely compatible at the source code level due to both being Unix systems and following the same standards. There are however certain system calls specific to Linux; there are also differences in header files, constants and so on. Implementing them in FreeBSD would make porting software easier. This page aims to provide an overview and help track progress.
Not all of those items are fixable. Some differences cannot be eliminated due to naming clashes, disagreements on how the system is supposed to work, or because it would make autoconf pick up a less functional compatibility API instead of the native one. In such cases we should document it and advise what to use instead.
The umbrella ticket is https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=281479.
item |
status |
prospective users and other notes |
Implemented since 13.2 |
|
|
Implemented since 10.0 |
|
|
clone(2) |
Native missing, but implemented for Linux binaries |
NetBSD supports it |
Implemented since 13.0 |
|
|
Implemented since 13.0 |
|
|
epoll(2) |
Native missing, but implemented for Linux binaries |
Use the devel/libepoll-shim userspace wrapper. Let's try not to repeat https://mail-index.netbsd.org/tech-userlevel/2023/07/31/msg014063.html. |
Implemented since 13.0 |
|
|
futex(2) et al |
Native missing, but implemented for Linux binaries |
NetBSD got their own implementation |
getauxval(3) |
Not implemented |
Linux' version of elf_aux_info(3); our API is different as the constants might differ? |
Implemented since 12.0 |
|
|
getxattr(2) et al |
Native missing, but implemented for Linux binaries |
Also supported natively by NetBSD |
inotify(2) |
Not implemented |
Use the devel/libinotify userspace wrapper. NetBSD's Linux compat supports it; might port from there |
Implemented since 14.1 |
|
|
Implemented, but man page missing? |
|
|
mremap(2) |
Native missing, but implemented for Linux binaries |
NetBSD supports it |
pidfd_getfd(2) et al |
Not implemented |
Should map nicely to FreeBSD's existing process descriptors |
Implemented, but man page missing? |
|
|
Implemented since 11.0 |
|
|
setns(2) |
Not implemented |
This really includes all of cgroups and namespaces; should be possible to implement it on top of jails |
signalfd(2) |
Not implemented |
|
splice(2) |
Not implemented |
|
Implemented since 14.0 |
|
Please feel free to add new ones as needed; this includes non-syscall items, like missing headers and unsupported constants. Preferably also mention the name of the software that could use them.