fsync, fdatasync, fcntl to common code