The GNU C library is used as the C library in the GNU system and most systems with the Linux kernel. It defines the "system calls" and other basic facilities such as open, malloc, printf, exit, etc.
Questions tagged [glibc]
2271 questions
34
votes
2 answers
Why is glibc's sscanf vastly slower than fscanf on Linux?
I am using GCC 4.8 and glibc 2.19 on an x86_64 Linux.
While playing with different input methods for a different question, I compared fscanf and sscanf. Specifically, I would either use fscanf on the standard input directly:
char s[128]; int…

Kerrek SB
- 464,522
- 92
- 875
- 1,084
34
votes
10 answers
How to recover after deleting the symbolic link libc.so.6?
In our server the symbolic link to libc.so.6 has been deleted. Now none of the binaries in the system work. To fix this, I tried:
/bin/ln -s /lib/libc-2.11.3.so /lib/libc.so.6
which, as expected, gives me:
/bin/ln: error while loading shared…

perreal
- 94,503
- 21
- 155
- 181
34
votes
3 answers
How compatible are different versions of glibc?
Specifically:
Is it assured somehow that all versions of glibc 2.x are binary compatible?
If not, how can I run a binary (game) on my system which has been compiled for a different version? Can I install glibc in a different folder?
My specific…

Aaron Digulla
- 321,842
- 108
- 597
- 820
32
votes
4 answers
How to upgrade glibc from version 2.12 to 2.14 on CentOS?
I do not know how to upgrade glibc from version 2.12 to 2.14 on CentOS 6.3.
I need your help.

Tae Am CHOI
- 321
- 1
- 3
- 4
30
votes
5 answers
How to tell if glibc is used
I am trying to implement backtrace functionality for a large framework, which is used for different platforms and OS'es. In some of them, it is linked against glibc, while in the other, something different (eg. uclibc) is used. backtrace() function…

x13n
- 4,103
- 2
- 21
- 28
30
votes
2 answers
Compiling with -static-libgcc -static-libstdc++ still results in dynamic dependency on libc.so
I'm trying to make an executable that's as portable as possible. After removing a few dependencies, I came across the following when running the binary on another system:
/lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.15' not found (required by…

Claudiu
- 224,032
- 165
- 485
- 680
30
votes
2 answers
Can one use libSegFault.so to get backtraces for SIGABRT?
The magic incantation
LD_PRELOAD=/lib/libSegFault.so someapp
runs someapp with libSegFault.so providing backtrace information on a SIGSEGV as described in many different places.
Other than using signal(7)-like approaches to cause SIGABRT to invoke…

Rhys Ulerich
- 1,242
- 1
- 12
- 28
29
votes
9 answers
printf slows down my program
I have a small C program to calculate hashes (for hash tables). The code looks quite clean I hope, but there's something unrelated to it that's bugging me.
I can easily generate about one million hashes in about 0.2-0.3 seconds (benchmarked with…

Flavius
- 13,566
- 13
- 80
- 126
28
votes
10 answers
Where is the implementation of strlen() in GCC?
Can anyone point me to the definition of strlen() in GCC? I've been grepping release 4.4.2 for about a half hour now (while Googling like crazy) and I can't seem to find where strlen() is actually implemented.

Chris Tonkinson
- 13,823
- 14
- 58
- 90
28
votes
5 answers
Writing to a closed, local TCP socket not failing
I seem to be having a problem with my sockets. Below, you will see some code which forks a server and a client. The server opens a TCP socket, and the client connects to it and then closes it. Sleeps are used to coordinate the timing. After the…

regularfry
- 3,248
- 2
- 21
- 27
27
votes
4 answers
How to compile my own glibc C standard library from source and use it?
I am trying to compile my own glibc. I have a directory glibc, which contain the glibc source code I downloaded from the internet. From that directory I typed mkdir ../build-glibc. Now from the build-glibc directory I typed ../glibc/configure, which…

pythonic
- 20,589
- 43
- 136
- 219
26
votes
4 answers
Where are syscalls located in glibc source
So I was looking through the linux glibc source and I don't see where it actually does anything. The following is from io/chdir.c but it is indicative of many of the source files. What's going on here? Obviously I am missing something. What's…

ValenceElectron
- 2,678
- 6
- 26
- 27
26
votes
4 answers
Why are log2 and log1p so much faster than log and log10, in numpy?
Whilst playing around with this question I noticed something I couldn't explain regarding the relative performance of np.log2, np.log and np.log10:
In [1]: %%timeit x = np.random.rand(100000)
....: np.log2(x)
....:
1000 loops, best of 3: 1.31…

ali_m
- 71,714
- 23
- 223
- 298
26
votes
3 answers
How to build a C program using a custom version of glibc and static linking?
I have built glibc 2.14 and installed it in directory ~/GLIBC/glibc_install. Now I want to build and run programs using this C library instead of my system's default C library.
To be sure that I was using my custom glibc, I added a call to puts…

Amittai Aviram
- 2,270
- 3
- 25
- 32
25
votes
2 answers
How to install GLIBC 2.29 or higher in Ubuntu 18.04
So I am trying to install truDesk on my local system. I am getting this error while running the command npm install -g yarn:
node: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.28' not found
(required by node)
My Ubuntu version is Ubuntu…
user15692170