Skip to content

macdice/unlinktest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

This program appears to show that Apple macOS 10.14 has a non-atomic unlink(2)
syscall; concurrent threads can see the file in a weird state during
unlinking.

On FreeBSD and Linux, the program prints out nothing: the 'reader' thread
either sees the file as not existing, or existing and containing exactly 11
bytes (= the unlink was atomic).

On macOS, it prints out a few messages indicating that it saw an intermediate
state where the file existed but was empty.  Is that a bug?

As discussed at:

https://www.postgresql.org/message-id/flat/CAEepm%3D31MzQvAyCT%3DLHk4ZiiNMEn%3Dmnh179DNapavj0ZVcnt7w%40mail.gmail.com

Update November 2020: This seems to be fixed in Big Sur.  Thanks Apple!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published