summaryrefslogtreecommitdiff
path: root/src/libstddjb/fd_sync.c
blob: c4d359b05573fbe812de95da701d2e595bc26b3e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/* ISC license. */

#include <skalibs/nonposix.h>  /* lol MacOS */

#include <unistd.h>
#include <errno.h>

#include <skalibs/djbunix.h>

int fd_sync (int fd)
{
  int r ;
  do r = fsync(fd) ;
  while (r == -1 && errno == EINTR) ;
  return r ;
}