mirror of
https://github.com/trapexit/mergerfs.git
synced 2026-11-20 23:16:27 -05:00
check if fdatasync is available and return ENOSYS if not
This commit is contained in:
parent
f954be60a4
commit
6d6fb45a3b
1 changed files with 5 additions and 0 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue