Does it actually read character by character or does it read some bytes into the kernel buffer and return to the user- character by character?
Is it the same with fgets?
Let me say I use glibc and a gcc compiler.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Almost right. A typical modern implementation that does have a user/kernel separation stores the bytes in a user buffer, not in a kernel buffer. Thus many calls to
fgetcactually trigger few true system calls.