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

Julia ccall outb - Problems with libc

I run the following ccall's: status = ccall((:ioperm, "libc"), Int32, (Uint, Uint, Int32), 0x378, 5, 1) ccall((:outb, "libc"), Void, (Uint8, Uint16), 0x00, 0x378) After the second ccall I receive the following Error message: ERROR: ccall: could not…
The Brofessor
  • 1,008
  • 6
  • 15
0
votes
2 answers

Visual Studio 2015 libc is not backwards compatible

The definition of mbstate_t has changed from: typedef int mbstate_t; to typedef struct _Mbstatet { // state of a multibyte translation unsigned long _Wchar; unsigned short _Byte, _State; } _Mbstatet; typedef _Mbstatet mbstate_t; This is…
0
votes
1 answer

What string operations do the 0x0d and 0xff (from a terminator canary) protect against

It is stated here: A terminator canary contains NULL(0x00), CR (0x0d), LF (0x0a) and EOF (0xff) -- four characters that should terminate most string operations, rendering the overflow attempt harmless. I know the null (0x00) can help prevent…
Seanoseanohay
  • 341
  • 4
  • 19
0
votes
1 answer

memccpy return lower memory address than the src starting address

I've got a school project where I have to recode the memccpy() function. I use 2 programs to check if my code works properly. The first is a small program with only a main. The second program is developped by another student (can be found here, if…
Olivier
  • 95
  • 2
  • 11
0
votes
1 answer

Tell which version of symbols are available for linking against (in libc)?

Ok, so I want to link against a lower version of libc / glibc, for compatibility. I noticed this answer about how to do this, on a case-by-case basis: How can I link to a specific glibc version? https://stackoverflow.com/a/2858996/920545 However,…
Paul Molodowitch
  • 1,366
  • 3
  • 12
  • 29
0
votes
1 answer

How to uninitialize the entropy of /dev/urandom in C?

Is there a way to make that the entropy of /dev/urandom is and stay uninitialized? My goal is to simulate an initialized or simply uninitialize /dev/urandom. How can I do a such thing? edit: I see my question has been downvoted. I am sure the person…
Greek2015
  • 21
  • 3
0
votes
1 answer

nasm: jump when input is NULL

I am recoding puts using nasm (64bit), and when puts receives NULL as argument it prints (null). I'm trying to recreate that behaviour, except I can't get the code to jump to the part where it prints (null). Instead it just prints nothing here's my…
Fabio
  • 3,015
  • 2
  • 29
  • 49
0
votes
1 answer

Common function of a dynamic library shared by several executables

I have an issue I don't know how to solve. I have ever written a program (Python script) which returns a list of dynamic libraries with all the executables using them. (My script uses the ldd utility). Now, I'd like to do a program which would…
JohnCage
  • 37
  • 5
0
votes
1 answer

version `GLIBC_2.11' not found while using gcc

I have problem using gcc/g++ after I changed the machine I use, I installed gcc-4.9.2 in my previous machine, when I moved to the new machine, I copied gcc folder to the new machine. When I try to use I get this error :…
Othman Benchekroun
  • 1,998
  • 2
  • 17
  • 36
0
votes
2 answers

Posix equivalent of LocalAlloc(LMEM_ZEROINIT, size)

I have code which works on windows, that calls LocalAlloc as follows: LocalAlloc(LMEM_ZEROINIT, size) I need the equivalent malloc or calloc call to get this to work on Unix systems, through Mono. Simple answer?
Tristan
  • 6,776
  • 5
  • 40
  • 63
0
votes
2 answers

killall(1) equivalent system call or C library call

I have to stop the earlier instances of processes before starting a new instance. For this i need to system call or a C library call. Presently i use "system("killall name"). This works but I want to replace this with any equivalent…
Ashoka K
  • 453
  • 3
  • 6
  • 17
0
votes
1 answer

Kqueue udata field changing

On mac I am using kqueue, it states that udata is unchanged. However the array returned in event_data of kevent call is being modified somewhat. What could cause this? I am passing in the pointer to string casted to void*, and when i read after…
Noitidart
  • 35,443
  • 37
  • 154
  • 323
0
votes
0 answers

alternative to mutex to protect section

Often I use pthread's mutex only to protect a section, for instance an asynchronous timed draw function which pick the objects to draw from a list where objects can be deleted. Is there any alternative? (libc's atomic types?) edit A more simple…
Alex
  • 3,264
  • 1
  • 25
  • 40
0
votes
0 answers

CPU spin in popen()

Here's my code piece: FILE *f; char cmd[4096] = {0}; snprintf(cmd, sizeof(cmd), "echo -n \"%s\" | openssl md5 -hex 2>/dev/null | sed 's/^.* //g'", input); if (NULL == (f = popen(cmd, "r"))) { perror(popen); } I got cpu spin in popen() and…
kai
  • 1,141
  • 3
  • 15
  • 25
0
votes
1 answer

Where is FreeBSD libc's _write defined?

Where is the code for the this _write() used in stdio? A wiki page says that every syscall must be registered in a master file and in the a libc's Symbol.map, it also says that for every entry in the Symbol.map three symbols are generated: symbol,…
Augusto Hack
  • 2,032
  • 18
  • 35