Linux 查看 glibc 版本

Linux About 1,143 words

方法一

ldd --version

输出

bash-4.4$ ldd --version
ldd (GNU libc) 2.28
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Written by Roland McGrath and Ulrich Drepper.

方法二

执行库文件

/lib64/libc.so.6

或者

/lib/libc.so.6

输出

bash-4.4$ /lib64/libc.so.6
GNU C Library (GNU libc) stable release version 2.28.
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
Compiled by GNU CC version 8.5.0 20210514 (Red Hat 8.5.0-10.0.2).
libc ABIs: UNIQUE IFUNC ABSOLUTE
For bug reporting instructions, please see:
<http://www.gnu.org/software/libc/bugs.html>.

方法三

查看软连接

ls -l /lib64/libc.so.*

或者

ls -l /lib/libc.so.*

输出

bash-4.4$ ls -l /lib64/libc.so.*
lrwxrwxrwx 1 root root 12 Jun 17  2022 /lib64/libc.so.6 -> libc-2.28.so

补充

glibc提供的malloc/free系列函数来进行内存的分配。

Linuxmalloc的早期版本是由Doug Lea实现的,它有一个严重问题是内存分配只有一个分配区(arena),每次分配内存都要对分配区加锁,分配完释放锁,导致多线程下并发申请释放内存锁的竞争激烈。

Views: 379 · Posted: 2023-08-07

————        END        ————

Give me a Star, Thanks:)

https://github.com/fendoudebb/LiteNote

扫描下方二维码关注公众号和小程序↓↓↓

扫描下方二维码关注公众号和小程序↓↓↓


Today On History
Browsing Refresh