Find a file
Alexander van der Grinten 120afb1f68 options/ansi: Increase FILE buffer size to 4096
It might make sense to increase the buffer size even
further but proper benchmarks need to be done to verify
that this is the case.
2021-06-11 22:45:51 +02:00
.github/workflows workflows: Install g++10 in order to use c++20 2021-05-01 22:21:28 +02:00
abis abis/mlibc: Changed uid_t, gid_t and id_t to unsigned 2021-05-10 19:36:41 +01:00
ci workflows: Install g++10 in order to use c++20 2021-05-01 22:21:28 +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 options/ansi: Increase FILE buffer size to 4096 2021-06-11 22:45:51 +02: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: Stub fdatasync() 2021-06-06 23:21:54 +02:00
tests Merge pull request #266 from Geertiebear/open_memstream 2021-06-08 22:02:32 +02: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 build: Bump c++ standard to c++20 2021-04-30 00:43:31 +02: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 docs: Add local development instructions 2021-05-17 22:41:37 +01: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.

Local Development

The mlibc test suite can be run under a Linux host. To do this, first run from the project root:

meson -Dbuild_tests=true build

This will create a build directory. Then, cd build and run the tests (showing output) with:

meson test -v