The unofficial musl manual Feature test macros, standards: Musl supports the following standards, with the given feature test macros or parameters: X/Open 2008 (SUS4) _XOPEN_SOURCE >= 700 POSIX 2008 _POSIX_C_SOURCE >= 200809L, _POSIX_SOURCE ISO C99 (requires -std=c99 or equivalent; detected using __STRICT_ANSI__, which gcc sets automatically) The following standards are partly supported: ISO C11 (WIP, threads and atomics aren't supported yet, and Annex K is unlikely to be supported in the foreseeable future; use -std=c11 or equivalent) ANSI C89/ISO C90 A few details are incompatible with C99, and the namespace respected is the C99 one. However, there shouldn't be breakage. Older POSIX and SUS _POSIX_C_SOURCE < 200809L, _XOPEN_SOURCE < 700 Exposes legacy extensions as well as the modern standard, rather than only the legacy standard. The following feature test macros are also supported to the extent practical: _GNU_SOURCE Partial glibc compatability. Nonstandard functions with the same names as standard ones (basename and several others) ARE NOT SUPPORTED: musl uses the ISO/POSIX/SUS definition unconditionally. _LARGEFILE64_SOURCE nop: musl only provides 64bit file io, so this just adds *64 aliases to the namespace _BSD_SOURCE While glibc is still stuck at BSD 4.4, musl provides much of the functionality available via _NETBSD_SOURCE on NetBSD. This includes strlcpy, strlcat, and fgetln. By default (-std=gnu* or no arguments for GCC), musl currently sets _XOPEN_SOURCE to 700 and defines _BSD_SOURCE. With musl 0.9.4 or older, musl defaulted to ANSI C99. Detecting musl: This is frequently asked about. It is not possible to detect musl for sure. Key differences: __linux and __ELF will both be defined, unlike with dietlibc. unistd.h defines _XOPEN_VERSION to 700 and _POSIX_VERSION to 200809L. (This is what you should be checking for, unless you need nonstandard functions) features.h defaults to defining _BSD_SOURCE and _XOPEN_SOURCE, rather than _BSD_SOURCE and _SVID_SOURCE; __USE_* macros are not present, nor are the __GLIBC* macros. Using GNU basename syntax ( basename("/usr"); ) will make for segfaults.