diff options
Diffstat (limited to 'contrib/qemu/util/oslib-posix.c')
| -rw-r--r-- | contrib/qemu/util/oslib-posix.c | 8 | 
1 files changed, 6 insertions, 2 deletions
diff --git a/contrib/qemu/util/oslib-posix.c b/contrib/qemu/util/oslib-posix.c index 77cb9b72d1d..bac4c1a158e 100644 --- a/contrib/qemu/util/oslib-posix.c +++ b/contrib/qemu/util/oslib-posix.c @@ -86,7 +86,7 @@ void *qemu_oom_check(void *ptr)  void *qemu_memalign(size_t alignment, size_t size)  {      void *ptr; -#if defined(_POSIX_C_SOURCE) && !defined(__sun__) +#if defined(_POSIX_C_SOURCE) && !defined(__sun__) || defined(__APPLE__)      int ret;      ret = posix_memalign(&ptr, alignment, size);      if (ret != 0) { @@ -175,11 +175,13 @@ int qemu_pipe(int pipefd[2])      int ret;  #ifdef CONFIG_PIPE2 +#ifdef pipe2      ret = pipe2(pipefd, O_CLOEXEC);      if (ret != -1 || errno != ENOSYS) {          return ret;      }  #endif +#endif      ret = pipe(pipefd);      if (ret == 0) {          qemu_set_cloexec(pipefd[0]); @@ -194,7 +196,8 @@ int qemu_utimens(const char *path, const struct timespec *times)      struct timeval tv[2], tv_now;      struct stat st;      int i; -#if defined(CONFIG_UTIMENSAT) && !defined(__FreeBSD__) +#if defined(CONFIG_UTIMENSAT) +#ifdef utimensat      int ret;      ret = utimensat(AT_FDCWD, path, times, AT_SYMLINK_NOFOLLOW); @@ -202,6 +205,7 @@ int qemu_utimens(const char *path, const struct timespec *times)          return ret;      }  #endif +#endif      /* Fallback: use utimes() instead of utimensat() */      /* happy if special cases */  | 
