See followup comment below. You're confusing logical atomicity for physical consistency and durability: yes, these operations may have certain atomicity guarantees from perspective of the application, but they are entirely asynchronous from the perspective of the storage medium unless you explicitly fsync(), and for example on Linux, even then the default behaviour of ext4 is to allow metadata updates to complete prior to data updates (no "write barrier").
In other words:
1. fd = open("super-safe-file.tmp", O_CREAT|O_RDWR);
2. write(fd, "super-safe-data", 15);
3. close(fd);
4. rename("super-safe-file.tmp", "super-safe-file");
5. (kernel flushes file and directory metadata to disk)
6. CRASH
7. Machine reboots, "super-safe-data" exists, but no longer contains any data, since file data itself was never flushed.
8. Tears are shed, programmers are fired, backups are restored