当前位置:网站首页>musl Reference Manual
musl Reference Manual
2022-07-31 10:52:00 【阳光8088】
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)/ld−musl−(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.ld−musl−(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.
边栏推荐
猜你喜欢
随机推荐
Redis - Basics
Make your own dataset in FCN and train it
Qt compile error: C2228: '.key' must have class/struct/union on the left
浅谈Attention与Self-Attention,一起感受注意力之美
新人学习小熊派华为iot介绍
7 天能找到 Go 工作吗?学学 Go 数组和指针试试
如何优雅的停止一个线程?
出色的移动端用户验证
【云原生监控系列第一篇】一文详解Prometheus普罗米修斯监控系统(山前前后各有风景,有风无风都很自由)
【LeetCode】1161.最大层内元素和
redis-企业级使用
2022/7/30
Web系统常见安全漏洞介绍及解决方案-sql注入
SQL如何从字符串截取指定字符(LEFT、MID、RIGHT三大函数)
【LeetCode】118.杨辉三角
"JUC Concurrent Programming - Advanced" 06 - Immutability of Shared Models (Design of Immutable Classes | Use of Immutable Classes | Flyweight Pattern)
Find a Go job in 7 days, Conditional statements to learn in Gopher, loop statements, Part 3
Many mock tools, this time I chose the right one
[ 图 论 ]二分图判定及其匹配(基础+提高)
我们能做出来数据库吗?