mirror of
https://github.com/trapexit/mergerfs.git
synced 2025-02-23 06:44:27 +08:00
check if fdatasync is available and return ENOSYS if not
This commit is contained in:
parent
f954be60a4
commit
6d6fb45a3b
@ -16,6 +16,7 @@
|
||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
|
||||
namespace fs
|
||||
@ -33,6 +34,10 @@ namespace fs
|
||||
int
|
||||
fdatasync(const int fd)
|
||||
{
|
||||
#if _POSIX_SYNCHRONIZED_IO > 0
|
||||
return ::fdatasync(fd);
|
||||
#else
|
||||
return (errno=ENOSYS,-1);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user