Linux APIs: Difference between revisions

Line 2: Line 2:


== File descriptors ==
== File descriptors ==
* Since 2.1.69 and glibc 2.1, <tt>pread(2)</tt> and <tt>pwrite(2)</tt> have allowed <tt>read(2)</tt>- and <tt>write(2)</tt>-like behavior on a file descriptor from a specified offset, without updating the offset. This allows for the atomic equivalent of an <tt>lseek(2)</tt> and an I/O, particularly useful when multiple threads are working with the same file descriptor (since file descriptor offset is shared across the process).
* Since 2.6.16, the <tt>openat(2)</tt> system call can <tt>open(2)</tt> a file relative to an open directory provided as the first argument. As the man page says:
* Since 2.6.16, the <tt>openat(2)</tt> system call can <tt>open(2)</tt> a file relative to an open directory provided as the first argument. As the man page says:
<pre>      openat() and other similar system calls suffixed "at" are supported for
<pre>      openat() and other similar system calls suffixed "at" are supported for