Questions tagged [libc]

The C standard library consists of a set of sections of the ISO C standard which describe a collection of headers and library routines used to implement common operations, such as input/output and string handling, in the C programming language.

The C standard library consists of a set of sections of the ISO C standard which describe a collection of headers and library routines used to implement common operations, such as input/output and string handling, in the C programming language.

There are many implementations of libc with different resource requirements, security goals, etc. With a typical tool chain the libc, compiler and OS work together to achieve some ISO, Posix or custom features/standards. Some libc implementation are only a subset of the ISO standard, but still full featured enough to be used in many applications.

Specific libc tags:

  • - the full Gnu Libc found on most GCC installs.
  • - a smaller micro-controller libc for resource constrained devices
  • - Android libc
  • - unhosted libc
  • - more modern lighter foot print libc

Websites

See also:

Do not confuse with , which is for the C++ programming language.

1076 questions
10
votes
1 answer

What's the difference between libc6:i386 and libc6-i386

I'm using Ubuntu 14.04.2 LTS \n \l. Here are the libcs I installed. $ dpkg --list | grep libc6 ii libc6:amd64 2.19-0ubuntu6.7 amd64 Embedded GNU C Library: Shared…
zjk
  • 2,043
  • 3
  • 28
  • 45
10
votes
1 answer

Why does some functions in stdio have the stream as last argument?

Some of the functions in stdio seem to have the stream as the last argument, for example: char *fgets(char *restrict, int, FILE *restrict); int fputs(const char *restrict, FILE *restrict); size_t fread(void *restrict, size_t, size_t, FILE…
skyking
  • 13,817
  • 1
  • 35
  • 57
10
votes
2 answers

How to use strerror_l with current locale?

I'm fixing some Linux code which used strerror (not thread-safe) for multi-threading. I found that strerror_r and strerror_l are both thread-safe. Due to different definitions for strerror_r (depending on _GNU_SOURCE it is differently defined) I'd…
Anteru
  • 19,042
  • 12
  • 77
  • 121
10
votes
3 answers

What is the difference between /lib/i386-linux-gnu/libc.so.6, /lib/x86_64-linux-gnu/libc.so.6 and /usr/lib/x86_64-linux-gnu/libc.so?

I installed Matlab in my Linux Mint 14 Nadia (a uname -a shows: Linux Ideapad-Z570 3.5.0-17-generic #28-Ubuntu SMP Tue Oct 9 19:31:23 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux) and when calling it from the command line I would get a: "/lib64/libc.so…
Alejandro
  • 1,064
  • 1
  • 8
  • 22
10
votes
1 answer

Comprehensive open-source test suite for the C Standard Library

I'm looking for a testsuite for the C Standard Library (mainly for the algorithms not contacting the "outer world", so strcpy(), memcmp(), itoa() & likes). I tried downloading the GCC sources, but they're very large and I have trouble finding…
akavel
  • 4,789
  • 1
  • 35
  • 66
10
votes
6 answers

equivalent of memcmp() in Java?

If I have two byte[] arrays, is there a built-in function to compare them ala C's memcmp() ?
Jason S
  • 184,598
  • 164
  • 608
  • 970
10
votes
2 answers

Android Static Linking vs Dynamic Linking against glibc

I have been cross-compiling some Linux tools (and some of my own C code) to Android and one of the challenges that I face is that Android's libc has some missing/stripped components and I end up patching my code to make it work with Android's libc…
angadsg
  • 184
  • 1
  • 3
  • 7
9
votes
1 answer

Android weird lib.c crash

I'm writing an Android app. I totally have no idea why it happenes often. Could someone tell me what reason might cause it happened? Thanks! 09-29 13:58:00.540: INFO/DEBUG(4658): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** 09-29…
shiami
  • 7,174
  • 16
  • 53
  • 68
9
votes
1 answer

art::ConditionVariable::WaitHoldingLocks(art::Thread*)

Our mobile app is published in the Google play store. The Crashes and ANR report is generated in Firebase Crashlytics. There is an ANR shown as…
9
votes
6 answers

GLIBC_2.33 not found - while building Flutter for Linux

I was trying to run a flutter app on Ubuntu 22.04 LTS. Everything was working fine. But, today this problem came up while running the app. The Flutter SDK fails to build the app throwing the below…
9
votes
0 answers

How do I update libc and libstdc++ on OS X 10.5?

I am using a Mac Mini as a build agent and I need to upgrade the standard libraries. I can't find either libc or libstdc++ on MacPorts.
Matt Chambers
  • 2,229
  • 1
  • 25
  • 43
9
votes
4 answers

Why to use 'errno' at all?

I'm a CS student at the Technion, I have just learned of errno variable and c-style function calls. This makes me wonder, if c-style syscalls use registers to return a value, why should anyone use errno at all?
David
  • 101
  • 1
  • 3
9
votes
1 answer

How Libc shared library loaded in memory and shared amongst processes?

I want to understand how Libc shared library loaded in memory and shared amongst processes? Is there one libc instance loaded in memory and shared amongst all processes or is it each libc instance in memory for each process. I am unclear about how…
Aditya Mertia
  • 495
  • 7
  • 19
9
votes
2 answers

libc or glibc in ubuntu?

I'm a little bit confused with these libraries. I'm working on Ubuntu now, I use g++ 5 and I see that my applications link in libc.so. Is it a Ubuntu's implementation of C standard library? Is it different from glibc? $ ldd…
Alexey
  • 710
  • 3
  • 7
  • 19
9
votes
2 answers

u-boot /lib/ld-linux-armhf.so.3: No such file or directory

My machine Ubuntu 16.04.3 LTS x86_64. I do compile u-boot-2017.11 and I got the error. u-boot-2017.11$ export ARCH=arm u-boot-2017.11$ export…
Abhisit Sangjan
  • 91
  • 1
  • 1
  • 6