Assuming that I understand the stream correctly, I would like to read a few bytes from the open stream FILE, lets talk using fread:
- syscall
readwill copy data from the kernel to the user space buffer - the user space buffer (either allocated by glibc or provided
setvbuf...) will be copied to the buffer providedfread
Why is the second step necessary? why can I get a pointer to the user space buffer, which I will decide if I want to store (copy) or not?
Thank,
nixer source
share