[Petter Reinholdtsen]
> This make me believe libeatmydata should change to behave according to the
> POSIX specification.

And just to make it more clear why I believe this.  My understanding of 
is that it should make the computer behave as normal while ignoring
any calls to force file buffers to sync to disk.  Returning 0 instead of -1 for 
bad file descriptors is not behaving like normal.  Linux and any other POSIX
compliant operating system return -1 in this case.

It can be easily demonstrated like this:

% cat > x.c <<EOF
#include <stdio.h>
#include <unistd.h>
int main(int argc, char *argv[]) {
   printf("fsync(1024) = %d\n", fsync(1024));
   return 0;
% gcc x.c 
% ./a.out 
fsync(1024) = -1
% eatmydata ./a.out 
fsync(1024) = 0

Please make eatmydata hide that it is running by behaving like POSIX specifies.

Happy hacking
Petter Reinholdtsen

Reply via email to