Find a file
2020-03-26 13:11:41 +01:00
abis sysdeps/sigma: Use SysdepsAllocator and add kbus auxval 2020-02-21 21:31:21 +01:00
ci ci: add files needed to build with jenkins 2020-02-17 19:46:03 +01:00
libdl/src Remove unused makefiles 2019-02-20 18:59:22 +01:00
libm/src Remove unused makefiles 2019-02-20 18:59:22 +01:00
libpthread/src Remove unused makefiles 2019-02-20 18:59:22 +01:00
librt/src Remove unused makefiles 2019-02-20 18:59:22 +01:00
libutil/src Remove unused makefiles 2019-02-20 18:59:22 +01:00
options options/internal: implement AllocatorLock::lock slow path 2020-03-26 13:11:41 +01:00
subprojects build: Add wraps for cxxshim and frigg deps. 2018-11-17 16:11:20 +01:00
sysdeps options/internal: implement AllocatorLock::lock slow path 2020-03-26 13:11:41 +01:00
.gitignore qword: Move mount to own header 2019-12-29 09:33:35 +01:00
internal-config.h.in options/ansi: Work around systems without mmap() 2019-02-28 18:30:16 +01:00
LICENSE Update LICENSE 2020-01-22 19:13:46 +01:00
meson.build sysdeps/Sigma: Add linux option and transition to new IPC system 2020-03-08 00:06:15 +01:00
meson_options.txt meson: Disable static option by default 2020-02-18 07:09:31 +01:00
README.md README: Add Discord server 2020-02-23 18:28:36 +01:00

mlibc is a C standard library

Official Discord server: https://discord.gg/7WB6Ur3

Design of the library

Directory Purpose
options/ (More or less) OS-independent headers and code.
options/ is divided into subdirectories that can be enabled or disabled by ports.
sysdeps/ OS-specific headers and code.
sysdeps/ is divded into per-port subdirectories. Exactly one of those subdirectories is enabled in each build.
abis/ OS-specific interface headers ("ABI headers"). Those contain the constants and structs of the OS interface. For example, the numerical values of SEEK_SET or O_CREAT live here, as well as structs like struct stat. ABI headers are only allowed to contain constants, structs and unions but no function declarations or logic.
abis/ is divided into per-OS subdirectories but this division is for organizational purposes only. Ports can still mix headers from different abis/ subdirectories.

Porting mlibc to a new OS: Ports to new OSes are welcome. To port mlibc to another OS, the following changes need to be made:

  1. Add new sysdeps/ subdirectory sysdeps/some-new-os/ and a meson.build to compile it. Integreate sysdeps/some-new-os/meson.build into the toplevel meson.build.
  2. Create ABI headers in abis/some-new-os/. Add symlinks in sysdeps/some-new-os/include/abi-bits to your ABI headers. Look at existing ports to figure out the ABI headers required for the options enabled by sysdeps/some-new-os/meson.build.
  3. In sysdeps/some-new-os/, add code to implement (a subset of) the functions from options/internal/include/mlibc/sysdeps.hpp. Which subset you need depends on the options that sysdeps/some-new-os/meson.build enables.