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
6
votes
1 answer

Cannot compile and link AVR program in OS X

I am working on a Mac with Yosemite OS X and I'm trying to compile a program in C that I could then upload onto my Arduino. I am following a tutorial. I tried going through and reinstalling avr-gcc, but I got the same output. I tried searching for…
6
votes
1 answer

Linking Rust with C: undefined reference to '__aeabi' functions

I'm working on a project using Rust on an embedded device, where I'm trying to write functions in Rust that can be called from C. I compile the project without the standard library, more or less following this tutorial: Embedded Rust Right Now! My…
Jambaman
  • 741
  • 9
  • 22
6
votes
1 answer

Set a breakpoint into LibC with gdb

Why I cannot set a breakpoint (using gdb) in an exported function within LibC? As being Libc dynamically linked, it must contains the symbols of the functions it exports. Shouldn't I be able to set a breakpoint to any of these functions? I merely…
badnack
  • 737
  • 1
  • 11
  • 20
6
votes
2 answers

Is there a linker flag to force it to load all shared libraries at start time?

Is there a flag or any other directive that I can use to force the Linux Dynamic Linker ld.so to load all shared libraries at once at start of the program instead of lazy binding. Essentially I want to turn off lazy binding. Thanks
abhi
  • 3,476
  • 5
  • 41
  • 58
6
votes
2 answers

libc.h: No such file or directory when compiling nanomsg pipeline sample

Trying to get a simple nanomsg file running, starting with the first one here: https://github.com/dysinger/nanomsg-examples Installed nanomsg to /usr/local/lib/nanomsg-0.2-alpha. Ran sudo ./configure, sudo make check, sudo make install and sudo…
jcollum
  • 43,623
  • 55
  • 191
  • 321
6
votes
1 answer

Using python ctypes and libc to write void pointer to binary file

I am using python ctypes and libc to interface with a vendor-provided DLL file. The purpose of the DLL file is to acquire an image from a camera. The image acquisition appears to run without error; the issue I am having is accessing the data. The…
Joe
  • 355
  • 1
  • 5
  • 17
6
votes
3 answers

C: Why does strcpy return its argument?

Why does strcpy(3) (and strncpy(3)) return their first argument? I don't see how this does add any value. Instead, frequently I'd rather have the number of copied bytes returned. Addendum: What am I supposed to do when I need also the length of the…
Jo So
  • 25,005
  • 6
  • 42
  • 59
6
votes
3 answers

How is linux simultaneously 32bit and 64bit? Or is that something handled in glibc?

How is Linux simultaneously 32bit and 64bit? Or is that something handled in glibc? I run CentOS 5.3 and it is a "64 bit" version; although I build things for 64 bit and 32 bit. From what I think I know, Windows supposedly has a 32bit emulator. Does…
Crazy Chenz
  • 12,650
  • 12
  • 50
  • 62
5
votes
2 answers

Alignment and performance

Routines strcmp for comparing char * and memcmp for everything else, do they run faster on memory block (on x86_64) which is somehow aligned (how?)? Does libc use SSE for this routines?
Cartesius00
  • 23,584
  • 43
  • 124
  • 195
5
votes
2 answers

What is mnemonic for "W" in WIFEXITED, WEXITSTATUS, etc?

What is mnemonic for "W" i.e. what does "W" mean in the following macros: int WIFEXITED (int status) int WEXITSTATUS (int status) int WIFSIGNALED (int status) int WTERMSIG (int status) int WCOREDUMP (int status) int WIFSTOPPED (int status) int…
Roman Byshko
  • 8,591
  • 7
  • 35
  • 57
5
votes
1 answer

Should I compile on an old Ubuntu version for maximum `glibc` portability?

I am compiling my Rust code to be used as a CLI. I want it installable on the widest possible range of x86_64-unknown-linux-gnu based systems, particularly Ubuntu's. I am using a docker base image FROM rust:latest for builds, but this compile-host…
zino
  • 1,222
  • 2
  • 17
  • 47
5
votes
0 answers

errno without thread-local storage

I want to statically compile a program with tcc. tcc complains with error: Unknown relocation type: 23. This is apparently caused by my libc implementation (glibc 2.28-10) using thread-local storage to implement errno, which tcc does not support.…
Tom
  • 61
  • 1
  • 4
5
votes
2 answers

Python ctypes calling reboot() from libc on Linux

I'm trying to call the reboot function from libc in Python via ctypes and I just can not get it to work. I've been referencing the man 2 reboot page (http://linux.die.net/man/2/reboot). My kernel version is 2.6.35. Below is the console log from the…
tMC
  • 18,105
  • 14
  • 62
  • 98
5
votes
1 answer

How do you write to a pty master Rust

I have created a simple pty setup, however I am unsure on how to actually write to the master or slave sides once it is created. I am also unsure if my setup is correct, because upon inspection, the Stdin, Stdout, and Stderr of the child process for…
Ethalot
  • 57
  • 6
5
votes
0 answers

linstalling libc6:amd64 would break locales, and deconfiguration is not permitted

I couldn't install libc6_2.29-9_amd64 on my debian machine when i type this command: sudo dpkg -i libc6_2.29-9_amd64.deb I get this message back: dpkg: regarding libc6_2.29-9_amd64.deb containing libc6:amd64: libc6:amd64 breaks locales (<< 2.29)…
Lina Hammami
  • 373
  • 1
  • 4
  • 22