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

armcc (keil uVision4): how to get time() to return time from the RTC?

I'm a developer who's fairly used to working with embedded systems on Linux with free tools. Now I find myself on a project which uses the Keil compiler on Windows (armcc, uVision4... I'm finding the naming of stuff in this area a bit confusing…
Magnus
  • 4,644
  • 1
  • 33
  • 49
0
votes
1 answer

libc.so mmap strace

I am studying for exam tomorrow and I ran across this question: After we run an executable with strace the following syscalls result regarding standard C lib: open("/lib/libc.so.6", "O_RDONLY") = 3 mmap(NULL, 36803630, PROT_READ | PROT_EXEC,…
Dan Lincan
  • 1,065
  • 2
  • 14
  • 32
0
votes
1 answer

SIGSEGV backtrace with libc is repeating entries

I was using libunwind prior to moving to the available execinfo backtrace. After implementing a new backtrace I was enjoying it until I removed the libunwind from the project and did a full rebuild. Now my backtrace function refuses to produce a…
Ulterior
  • 2,786
  • 3
  • 30
  • 58
0
votes
1 answer

linking to libc on android/linux (x86) libc.so vs libc.so.6

I'm trying to build for an android device and I don't have real SDK/NDK for it. Unlike usual Android devices that have libc.so this one has symbolic link libc.so.6 --> libc-2.7.so. If I build with regular android NDK-x86 my shared lib (as reported…
Pavel P
  • 15,789
  • 11
  • 79
  • 128
-1
votes
1 answer

Why does the GNU coding standard prefer getopt_long over argp?

I do not understand why the GNU Coding Standard has the following line in Section 4.2 - Writing Robust Programs Use getopt_long to decode arguments, unless the argument syntax makes this unreasonable. My understanding is that getopt is part of the…
-1
votes
1 answer

ret2libc: sh: line 1: command not found

So I've been trying to develop a ret2libc exploit for my program as shown below: #include #include void vuln() { char arr[0x10]; scanf("%s", arr); printf("Input: %s",arr); } int main() { vuln(); return 0; } I've…
bruh
  • 1
  • 3
-1
votes
1 answer

Meaning of the [k] symbol in perf report output

What is the meaning of the [k] symbol I can see in the following perf report output: + 63.93% 0.10% sample libc.so.6 [.] __GI___fstatat64 + 63.82% 63.82% sample [unknown] [k] 0xffffffffa90001a2 <----…
imrichardcole
  • 4,633
  • 3
  • 23
  • 45
-1
votes
1 answer

What are the differences between the various C standard library implementations

While I was researching how fopen and moreover the structure FILE are built I found out it wasn't all just GNU libc. I began to look closer at the various implementations such as Google's Bionic, Musl, Newlib and several others. Having only been…
tijko
  • 7,599
  • 11
  • 44
  • 64
-1
votes
2 answers

How is a char array maximum size in C determined?

Learning C and checking the reference from the GNU reference manual. I don't understand how is the maximum size that can be allocated to a char array defined in an exact way. In my test program when the allocated size for a string array is "small"…
varinme
  • 45
  • 1
  • 5
-1
votes
1 answer

In which library write writev and other functions that operate on socket like send also and where is the location of .so file

I like to run this command to look for function names similar to sendfile, send, write writev on my some system library or kernel. command nm -D /usr/lib/libopenal.so.1 //or T option But I don't know where to look for these functions exact name the…
user786
  • 3,902
  • 4
  • 40
  • 72
-1
votes
2 answers

C++ print time difference?

In C++ I wrote: time_t tmp1, tmp2; time(&tmp1); sleep(1); time(&tmp2); std::cout << tmp2-tmp1; But every-time I run it I see 1 printed, why the result is too perfect? shouldn't it contain some milliseconds too?
user16468058
-1
votes
1 answer

How to let ld use PIC version of libc.a

To link gcc statically into a shared library, based on the answer in this question, the remaining problem is how to let the linker use the PIC version of libc.a instead of the non-PIC version. The problem is the same as that answer: g++ -fPIC -Wall…
jw_
  • 1,663
  • 18
  • 32
-1
votes
1 answer

Why does ISO/IEC 9899 not standardize the definitions of the functions in the C standard library?

ISO:IEC 9899 standardizes the prototypes of the functions of the C standard library and describes their behavior. It specifies the identifier, the return type and the parameter(s) with its matching type(s) of a certain C standard function. But why…
-1
votes
1 answer

How can I reset the environment to the default for a user when running program as that user?

I'm trying to run a program in Rust using libc as another user. nix::unistd::setuid(uid).unwrap(); If I fork and exec a process which runs printenv, the environment does not change. How can I reset the environment to the default for a user?
Federico Ponzi
  • 2,682
  • 4
  • 34
  • 60
-1
votes
1 answer

Accidently renamed libc.so.6 and cannot chroot within rescue mode

We have accidently renamed shared library /lib64/libc.so.6 to be /lib64/libc.so_6. Right after previous command the system (CentOS 6.9) throws the following error : error while loading shared libraries: /lib64/libc.so.6: cannot open shared object…
LiNuX
  • 21
  • 7