Embed Notice
HTML Code
Corresponding Notice
- Embed this notice
Taylan (Now 18% More Deranged) (taylan@fedi.feministwiki.org)'s status on Wednesday, 23-Apr-2025 20:47:31 JST Taylan (Now 18% More Deranged)
@Suiseiseki @kaia @lain
Hmm, according to this man page, it's actually synchronous on Linux:
https://man7.org/linux/man-pages/man2/sync.2.html
Apparently, the problem I've described is based on the guarantees (not) made by the POSIX standard.
So I guess it's important to call it twice in cross platform scripts, but on GNU+Linux it shouldn't matter.
In fact, based on the following, it seems that even the hack of calling it multiple times may not help, because this doesn't describe the behaviour that I mentioned earlier, of subsequent calls having to wait for the first to finish:
https://pubs.opengroup.org/onlinepubs/9799919799/functions/sync.html