News for hackers. Stuff that matters.
Re:Things Unix can do atomically (2010) by rwmj on Tuesday May 31, 2016 @05:58AM (#11805655)
I always thought it would be a good idea for system calls to support transactions. Probably in a limited way because implementing general transactions would require massive changes to the kernel. But it would be nice to be able to do [error checking omitted]:

    begin ();
    fp = fopen ("file", "w");
    fputs (content, fp);
    fclose (fp);
    commit ();
It could solve the whole thing with ending up with zero-length files because you didn't use the right incantation to update a file atomically on ext4 (https://thunk.org/tytso/blog/2009/03/12/delayed-allocation-a...).

In Unix v7 mkdir was not a system call. It was a setuid program implemented using mknod + link. That was racy so the mkdir(2) system call was added. But it could have been solved more generally (and more elegantly) by adding transactions.

Re:Things Unix can do atomically (2010) by tobias3 on Tuesday May 31, 2016 @06:39AM (#11805763)
Windows has it, but not many people seem to use it: https://msdn.microsoft.com/en-us/library/windows/desktop/aa3...
Re:Things Unix can do atomically (2010) by krylon on Tuesday May 31, 2016 @06:57AM (#11805813)
Beware, it appears to be deprecated:

"Microsoft strongly recommends developers utilize alternative means to achieve your application’s needs. Many scenarios that TxF was developed for can be achieved through simpler and more readily available techniques. Furthermore, TxF may not be available in future versions of Microsoft Windows."

Re:Things Unix can do atomically (2010) by SolarNet on Tuesday May 31, 2016 @06:39AM (#11805764)
Windows has this.