# Fuchsia&#39;s libc

Fuchsia's libc started as a fork of musl libc. It has since diverged
significantly, but the approximate source code layout remains the same. The
source can be found in
[`zircon/third_party/ulib/musl`](https://cs.opensource.google/fuchsia/fuchsia/+/main:/zircon/third_party/ulib/musl).

TODO(https://fxbug.dev/42106460) Type more here.

## Standards

### C11

Fuchsia's libc supports most of the [C11](https://en.wikipedia.org/wiki/C11_(C_standard_revision)) standard. This
in particular includes the atomic and threading portions of the
standard library.

### POSIX

Fuchsia implements a subset of POSIX.

Things at least partially supported include the basics of POSIX I/O
(open/close/read/write/stat/...), and pthreads (threads and mutexes).

On Fuchsia, the portion of file paths beginning with a sequence of
`..` is resolved locally. See [this writeup](https://fuchsia.dev/docs/concepts/filesystems/dotdot) for more
information.

Similarly, symlinks are not supported on Fuchsia.

Conspicuously not supported are UNIX signals, fork, and exec.

## FDIO

Fuchsia's libc does not directly support I/O operations. Instead it
provides weak symbols that another library can override. This is
typically done by [fdio.so](https://cs.opensource.google/fuchsia/fuchsia/+/main:/sdk/lib/fdio).

## Linking

Statically linking libc is not supported. Everything dynamically links libc.so.

## Dynamic linking and loading

libc.so is also the dynamic linker.
[](https://issues.fuchsia.dev/issues/new?component=1439230&template=1881640&description=Issue+on:+https://fuchsia.dev/docs/development/languages/c-cpp/libc.md "Report a bug or suggest improvements on this page") [](https://cs.opensource.google/fuchsia/fuchsia/+/main:docs/development/languages/c-cpp/libc.md "View the source code of this page") [](https://ci.android.com/edit?repo=fuchsia/fuchsia/main&file=docs/development/languages/c-cpp/libc.md&cloneRepo=fuchsia/fuchsia:refs/heads/main&fullPath=fuchsia/docs/development/languages/c-cpp/libc.md "Edit the source code of this page")