musl Reference Manual

musl is an implementation of the C standard library built on top of the Linux system call API, including interfaces defined in the base language standard, POSIX, and widely agreed-upon extensions. musl is lightweight, fast, simple, free, and strives to be correct in the sense of standards-conformance and safety.

doc

https://musl.libc.org/

RISC-V (riscv64[-sp|-sf])

The default ABI is hard-float; soft-float and single-precision-only FPU variants are also available but experimental.
Only 64-bit is supported.

x86_64 / AMD64 (x86_64, x32)

Both the standard LP64 ABI and the “x32” ILP32 ABI are supported, but the latter is experimental.

ARM (arm[eb][hf])

All ARM targets use the EABI, which requires armv4t or later. The default target is little-endian and uses the standard EABI where floating point arguments are passed in general-purpose registers. Hard-float ABI and big-endian variants are also supported.

AArch64 (aarch64[_be])

The default AArch64 target is little-endian. A big-endian variant is also supported. This target is experimental.

Filesystem Layout Dependencies

/dev/null - device node, required by POSIX
/dev/tty - device node, required by POSIX
/tmp - required by POSIX to exist as a directory, and used by various temporary file creation functions.
/bin/sh - an executable file providing a POSIX-conforming shell
/proc - must be a mount point for Linux procfs or a symlink to such. Several functions such as realpath, fexecve, and a number of the “at” functions added in POSIX 2008 need access to /proc to function correctly.
( s y s l i b d i r ) / l d − m u s l − (syslibdir)/ld-musl- (syslibdir)/ldmusl(ARCH).so.1 - must resolve to the musl dynamic linker/libc.so binary in order for dynamic-linked programs to run. For static-linked programs it is unnecessary

Additional Files Used

/dev/log
/dev/shm
/dev/ptmx and /dev/pts
/etc/passwd and /etc/group
/var/run/nscd/socket -
/etc/shadow
/etc/tcb/user/shadow
/etc/resolv.conf
/etc/hosts
/etc/services
/etc/shells
/usr/share/zoneinfo
/etc/localtime
…/etc/ld-musl-$(ARCH).path, default path of “/lib:/usr/local/lib:/usr/lib” will be used. Not used by static-linked programs.

Environment Variables

PATH - Used by execvp, execlp, and posix_spawnp as specified in POSIX. If unset, a default search path of “/usr/local/bin:/bin:/usr/bin” is used.
PWD - Used by the nonstandard get_current_dir_name function; if it matches the actual current directory, it is returned instead of using getcwd to obtain the canonical pathname.
LOGNAME - The getlogin function simply returns the value of the LOGNAME variable.
LD_PRELOAD - Colon-separated list of shared libraries that will be preloaded by the dynamic linker before processing the application’s dependency list. Components can be absolute or relative pathnames or filenames in the default library search path. This variable is completely ignored in programs invoked setuid, setgid, or with other elevated capabilities.
LD_LIBRARY_PATH - Colon-separated list of pathnames that will be searched for shared libraries requested without an explicit pathname. This path is searched prior to the default path (which is specified in ( s y s l i b d i r ) / . . / e t c . l d − m u s l − (syslibdir)/../etc.ld-musl- (syslibdir)/../etc.ldmusl(ARCH).path with built-in default fallback if this file is missing). This variable is completely ignored in programs invoked setuid, setgid, or with other elevated capabilities.
LC_ALL, LC_CTYPE, LC_NUMERIC, LC_TIME, LC_COLLATE, LC_MONETARY, LC_MESSAGES, and LANG - Used by setlocale and newlocale to determine a locale name to use when a zero-length string is passed. The precedence rules follow POSIX: LC_ALL overrides category-specific variables, and LANG provides a default for any category not set.
MUSL_LOCPATH - Colon-separated list of paths that will be searched for locale definitions. The requested locale name string will used as a filename and searched in each path component. If unset, locale files are not loaded and only the “C” locale is available. This variable is completely ignored in programs invoked setuid, setgid, or with other elevated capabilities.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值