Okay, this is for a homework; although I'm not requesting any help on the programming side. It's already done :)
After providing the same program which reads a random generated input file and echoes the same string it readed to an output. The only difference is that on one side I'm providing the read and write methods from linux syscals, and on the other side I'm using fread/fwrite.
Timing my application with an input of 10Mb in size and echoing it to /dev/null, and making sure the file in not cached, I've found that libc's frwite is faster by a LARGE scale when using very small buffers (1 byte in case).
Here is my output from time, using fwrite:
real 0m0.948s
user 0m0.780s
sys 0m0.012s
And with write syscall:
real 0m8.607s
user 0m0.972s
sys 0m7.624s
The only possibility that I've thought is that internally libc is already buffering my input... Unfortunately I couldn't find that much information around the web, so maybe the gurus here could help me out...
Thanks