I\'m reading source code of the linux tool badblocks. They use the read() function there. Is there a difference to the standard C fread() function?
read() --> Directly using this system call to kernel and that performs the IO operation.
fread() --> Is a function provided in standard library.
Calling fread() is mainly used for binary file data where struct data are stored.
The main difference between these two is the number of system calls in your application.
The fread() kind of standard IO library functions are optimized for system calls, rather your application making system calls.