0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-05-18 10:53:48 +02:00

ircd::fs: Add autoconfs for sync(2) etc.

This commit is contained in:
Jason Volk 2022-09-04 21:14:17 -07:00
parent dcbeb3fd4a
commit 10201c11eb
2 changed files with 6 additions and 2 deletions

View file

@ -1382,6 +1382,8 @@ AC_CHECK_FUNCS([ \
pwritev2 \
strlcat \
strlcpy \
sync \
syncfs \
])
AC_SEARCH_LIBS(dlinfo, dl, AC_DEFINE(HAVE_DLINFO, 1, [Define if you have dlinfo]))

View file

@ -700,10 +700,12 @@ ircd::fs::sync(const fd &fd,
"fs::sync(fd:%d)", int(fd)
};
#ifdef __linux__
#if defined(HAVE_SYNCFS)
syscall(::syncfs, fd);
#else
#elif defined(HAVE_SYNC)
syscall(::sync);
#else
#error "Missing sync(2) on this platform."
#endif
}