 <p><code>fwrite</code> writes to a <code>FILE*</code>, i.e. a (potentially) buffered <code>stdio</code> stream. It's specified by the ISO C standard. Additionally, on POSIX systems, <a href="http://stackoverflow.com/a/468105/166749"><code>fwrite</code> is thread-safe</a> to a certain degree.</p> <p><code>write</code> is a lower-level API based on file descriptors, described in the POSIX standard. It doesn't know about buffering. If you want to use it on a <code>FILE*</code>, then fetch its file descriptor with <code>fileno</code>, but be sure to manually lock and flush the stream before attempting a <code>write</code>.</p> <p>Use <code>fwrite</code> unless you know what you're doing.</p>