How stream buffer is implemented in C?

Viewed 107

I'm new to C, sorry if my question is dumb.

Where is the source code for IO stream? I want to see how the stream buffer is implemented, I can only see _IO_FILE struct in libc.h, but I don't see any internal buffer in this struct. Can anyone show me how can I locate the implmentation of stream buffer?

2 Answers

The musl C library is very clean and well-designed.

The implementation is in the stdio directory, and the stdio internal function prototypes and macros are found in: stdio_impl.h

Related