musl is a
C standard library
The C standard library, sometimes referred to as libc, is the standard library for the C (programming language), C programming language, as specified in the ISO C standard.International Organization for Standardization, ISO/International Electrote ...
intended for
operating system
An operating system (OS) is system software that manages computer hardware and software resources, and provides common daemon (computing), services for computer programs.
Time-sharing operating systems scheduler (computing), schedule tasks for ...
s based on the
Linux kernel
The Linux kernel is a Free and open-source software, free and open source Unix-like kernel (operating system), kernel that is used in many computer systems worldwide. The kernel was created by Linus Torvalds in 1991 and was soon adopted as the k ...
, released under the
MIT License
The MIT License is a permissive software license originating at the Massachusetts Institute of Technology (MIT) in the late 1980s. As a permissive license, it puts very few restrictions on reuse and therefore has high license compatibility.
Unl ...
. It was developed by Rich Felker to write a clean, efficient, and standards-conformant
libc
The C standard library, sometimes referred to as libc, is the standard library for the C programming language, as specified in the ISO C standard.ISO/ IEC (2018). '' ISO/IEC 9899:2018(E): Programming Languages - C §7'' Starting from the origina ...
implementation.
Overview
musl was designed from scratch to allow efficient
static linking and to have realtime-quality robustness by avoiding
race conditions, internal failures on resource exhaustion, and various other bad worst-case behaviors present in existing implementations.
The dynamic runtime is a single file with stable
ABI allowing race-free updates and the static linking support allows an application to be deployed as a single portable binary without significant size overhead.
It claims compatibility with the
POSIX
The Portable Operating System Interface (POSIX; ) is a family of standards specified by the IEEE Computer Society for maintaining compatibility between operating systems. POSIX defines application programming interfaces (APIs), along with comm ...
2008 specification and the
C11 standard. It also implements most of the widely used non-standard
Linux
Linux ( ) is a family of open source Unix-like operating systems based on the Linux kernel, an kernel (operating system), operating system kernel first released on September 17, 1991, by Linus Torvalds. Linux is typically package manager, pac ...
,
BSD
The Berkeley Software Distribution (BSD), also known as Berkeley Unix or BSD Unix, is a discontinued Unix operating system developed and distributed by the Computer Systems Research Group (CSRG) at the University of California, Berkeley, beginni ...
, and
glibc
The GNU C Library, commonly known as glibc, is the GNU Project implementation of the C standard library. It provides a wrapper around the system calls of the Linux kernel and other kernels for application use. Despite its name, it now also dir ...
functions. There is partial ABI compatibility with the part of glibc required by
Linux Standard Base
The Linux Standard Base (LSB) was a joint project by several Linux distributions under the organizational structure of the Linux Foundation to standardize the software system structure, including the Filesystem Hierarchy Standard. LSB was based ...
.
Version 1.2.0 has support for (no longer current)
Unicode
Unicode or ''The Unicode Standard'' or TUS is a character encoding standard maintained by the Unicode Consortium designed to support the use of text in all of the world's writing systems that can be digitized. Version 16.0 defines 154,998 Char ...
12.1.0 (while still having full
UTF-8
UTF-8 is a character encoding standard used for electronic communication. Defined by the Unicode Standard, the name is derived from ''Unicode Transformation Format 8-bit''. Almost every webpage is transmitted as UTF-8.
UTF-8 supports all 1,112,0 ...
support, more conformant/strict than
glibc
The GNU C Library, commonly known as glibc, is the GNU Project implementation of the C standard library. It provides a wrapper around the system calls of the Linux kernel and other kernels for application use. Despite its name, it now also dir ...
), and version 1.2.1 "features the new 'mallocng'
malloc
C dynamic memory allocation refers to performing manual memory management for dynamic memory allocation in the C programming language via a group of functions in the C standard library, namely , , , and .
The C++ programming language includ ...
implementation, replacing musl's original
dlmalloc-like allocator that suffered from fundamental design problems."
Use
Linux distribution
A Linux distribution, often abbreviated as distro, is an operating system that includes the Linux kernel for its kernel functionality. Although the name does not imply product distribution per se, a distro—if distributed on its own—is oft ...
s which use musl as their standard C library (some use
only musl) include but are not limited to:
*
Alpine Linux
*
Dragora 3
*
Gentoo Linux
Gentoo Linux (pronounced ) is a Linux distribution built using the Portage package management system. Unlike a binary software distribution, the source code is compiled locally according to the user's preferences and is often optimized for ...
(glibc by default, musl can be chosen at install time)
*
OpenWrt
OpenWrt (from ''open wireless router'') is an open-source project for embedded operating systems based on Linux kernel, Linux, primarily used on Embedded system, embedded devices to Router (computing), route network traffic. The main components ...
*
postmarketOS
postmarketOS (abbreviated as pmOS) is an operating system primarily for smartphones, based on the Alpine Linux distribution.
postmarketOS was launched on 26 May 2017 with the source code available on GitHub before migrating to GitLab in 2018. ...
* Sabotage
* Morpheus Linux
*
Chimera Linux
*
Void Linux
The
seL4 microkernel ships with musl.
For binaries that have been linked against glibc, gcompat and glibmus-hq
can be used to execute them on musl-based distros.
See also
*
Bionic libc
*
dietlibc
*
EGLIBC
*
klibc
*
Newlib
*
uClibc
__NOTOC__
In computing, uClibc (sometimes written μClibc) is a small C standard library intended for Linux kernel-based operating systems for embedded systems and mobile devices. uClibc was written to support μClinux, a version of Linux not ...
References
External links
*
Comparison of C/POSIX standard library implementations for LinuxMatrix of C/POSIX standard libraries by architectureProject:Musl on Gentoo wiki
{{CProLang
C standard library
Free computer libraries
Free software programmed in C
Interfaces of the Linux kernel
Linux APIs
Software using the MIT license