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

signal's "siginfo_t* info" causes segmentation fault

I am making a program containing a "Server.c" which waits a client to send it a SIGUSR1 msg 10 times, then dies, and a "client.c" which sends a SIGUSR1 msg to the server. The problem is that if I try to access the siginfo_t* info, I get a…
Dmytro
  • 5,068
  • 4
  • 39
  • 50
0
votes
4 answers

How can I write a mini program that is compatible with all unix-like systems?

I want to write a socket program in Linux. So it'll use glibc system calls like socket(), bind(), listen(), write() etc. I wonder, can i compile it without any changing in FreeBSD, Solaris or Mac OS? If yes, is it called "posix standards"?
0
votes
1 answer

Why is my Rails on CentOS install looking for libc.dylib?

I'm moving a Rails app (written by somebody else) from running on an OSX server to a CentOS server and during my setup process I am trying to create the database using the command... /usr/bin/bundle exec /usr/bin/rake db:create RAILS_ENV=production…
Fraser Graham
  • 4,650
  • 4
  • 22
  • 42
0
votes
1 answer

Correlation between

I am asking here because I have no idea where to find any information about this problem. If you could recommend me a book or an article about it, I would be pleased. Where can I find any information about correlation between Linux kernel and…
nkdm
  • 1,220
  • 1
  • 11
  • 26
0
votes
2 answers

What are some open-sourced encryption libraries that depend on strictly libc and would be easy to implement into a small microcontroller?

I am looking for some open-sourced encryption libraries to be ported over to a different platform. The platform only has the libc library availible and it would require me to reimplement the algorithms in assembly language. Preferably ones that…
Jeremy
  • 824
  • 1
  • 9
  • 21
0
votes
1 answer

linux write system call and libc

in linux, 'write' is a small system call wapper function. in GDB. if I search for symbol 'write' (info addr write) GDB tells me an address which is in range of libc. but, when I check the export function list of libc there is no 'write' symbol. what…
daehee
  • 5,047
  • 7
  • 44
  • 70
0
votes
1 answer

Overriding a libc function using an injected dylib on OS X

I am trying to override some libc functions (eg: puts()) with my own implementation. I have defined my own implementation in a dylib file as follows. int puts ( const char * str ); When I link my binary with the dylib file in Xcode and build, my…
Karthik
  • 770
  • 1
  • 6
  • 12
0
votes
3 answers

Old version of libc linking with my binary

I have inherited a piece of software which is having some issues. I believe the issues are related to the version of libc that is being statically linked. I am building this on a Windows XP machine, targeting an x86 QNX Neutrino 6.3.2…
kmort
  • 2,848
  • 2
  • 32
  • 54
0
votes
0 answers

(Another) Return to Libc Attack: Won't Segfault or Return to Libc With Malicious Input. Works in GDB though

I'd like to learn how return to libc attacks work, so I have written a vulnerable program so that I can change the return address of a function to that of system(). However, the program doesn't appear to call system() and exits…
0
votes
2 answers

Cannot Find -llibc

I am a C noob, so this may be a stupid question. I am trying to compile a .so file (shared library, if I have my terminology correct) of C objects (.o files), for the express purpose of importing them into Python via ctypes. I first compiled the…
learner
  • 1,895
  • 2
  • 19
  • 21
0
votes
3 answers

Core in libc.so.1

I am using Solaris 10 and my C program is getting crashed and creates a core file. On debugging, it seems like the core is created in libc.so.1. Please let me know if anyone have any clue. Below is the dbx report. dbx prock.new core For information…
Sachin
  • 20,805
  • 32
  • 86
  • 99
0
votes
1 answer

How important is the version of GCC when building libc (and other libraries)?

I am trying to create a development environment on my host machine that is identical (or as close to as possible) to the one on my embedded device using a chroot. Both host and target machines are x86 so I am not attempting to cross compile. I want…
mathematician1975
  • 21,161
  • 6
  • 59
  • 101
0
votes
1 answer

Structure memory alignment - Compile time vs Dynamically allocated memory

I was just going through glibc manual for description about posix_memalign function when I encountered this statement: The address of a block returned by malloc or realloc in the GNU system is always a multiple of eight (or sixteen on 64-bit…
nurabha
  • 1,152
  • 3
  • 18
  • 42
0
votes
1 answer

bsearch on array sorted in descending order

I have an array which is sorted in descending order, with no duplicates. Can I perform binary search on it using bsearch function in libc ? To do this, do I need to alter the compare function that I am passing to it ? Thanks
nurabha
  • 1,152
  • 3
  • 18
  • 42
0
votes
1 answer

How retrieve multiple args for one option using getopt

How to retrieve multi args for one option using getopt in libc ? ./a.out -t 42 -n toto titi tata -a address #include
klefevre
  • 8,595
  • 7
  • 42
  • 71