In prepending or appending data to a file, there is always an issue of allocating space. Appending additional space to a file is much easier than prepending because of file descriptors pointing to the beginning of a file's stream. If you want to append to a file, the file descriptor need not be changed, just the size of the file and the allocated memory. If you want to prepend to a file, a new file descriptor must be immediately instantiated, either to write the prepended data to first or to store the location of the data being prepended while the original is updated.
Making a new file descriptor can be tricky, as you must also update any references pointing to it. This is why it is easy for an OS to implement appending data and slightly harder to implement prepending.
ioctl()
that would do just that; but after not finding it for a very long time, I gave up -- maybe my memory mislead me. Even though I wouldn't call it trivial (not like appending, any way :) I agree that providing prepending support should enable some tasks to run much faster than the usual read-and-write-every-byte approach. – Specialistic