mirror of
https://github.com/trapexit/mergerfs.git
synced 2025-02-23 06:29:57 +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.
|
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <errno.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
namespace fs
|
namespace fs
|
||||||
@ -33,6 +34,10 @@ namespace fs
|
|||||||
int
|
int
|
||||||
fdatasync(const int fd)
|
fdatasync(const int fd)
|
||||||
{
|
{
|
||||||
|
#if _POSIX_SYNCHRONIZED_IO > 0
|
||||||
return ::fdatasync(fd);
|
return ::fdatasync(fd);
|
||||||
|
#else
|
||||||
|
return (errno=ENOSYS,-1);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user