No description
Find a file
Alexander van der Grinten 2931688a94
Merge pull request #228 from Dennisbonke/signal-changes
sysdeps/managarm: Handle EINVAL in sigaction
2021-02-03 22:31:25 +01:00
.github/workflows Revert "ci: continue-on-error for now" 2021-01-02 14:20:22 +01:00
abis Merge pull request #214 from Dennisbonke/util-linux 2021-01-28 19:40:29 +01:00
ci ci: re-enable stack protection 2020-09-13 15:36:44 +02:00
libcrypt/src libcrypt: Add a dummy libcrypt to satisfy shadow 2021-01-12 21:18:33 +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
libresolv/src meta: Build an empty libresolv to satisfy some programs 2021-01-14 20:48:51 +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 Merge pull request #227 from Dennisbonke/strtol 2021-02-03 20:53:03 +01:00
scripts scripts: add abi-link.sh script 2020-08-29 12:31:13 +02:00
subprojects build: Add wraps for cxxshim and frigg deps. 2018-11-17 16:11:20 +01:00
sysdeps sysdeps/managarm: Handle EINVAL in sigaction 2021-02-03 19:23:00 +01:00
tests Merge pull request #227 from Dennisbonke/strtol 2021-02-03 20:53:03 +01:00
.gitignore qword: Move mount to own header 2019-12-29 09:33:35 +01:00
internal-config.h.in options/rtdl: integrate ld.so into static build 2020-03-31 11:47:09 +02:00
LICENSE Update LICENSE 2020-01-22 19:13:46 +01:00
meson.build meta: Split out the libintl functions so they can be enabled with a function 2021-01-31 15:46:21 +01:00
meson_options.txt meta: Split out the libintl functions so they can be enabled with a function 2021-01-31 15:46:21 +01:00
README.md README: Add CI icon 2020-08-26 20:41:19 +02:00

mlibc is a C standard library

Continuous Integration

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.