1 /*
2  # This file is part of the Astrometry.net suite.
3  # Licensed under a 3-clause BSD style license - see LICENSE
4  */
5 #include <stdlib.h>
6 #include <limits.h>
7 #include <string.h>
8 #include <unistd.h>
9 
10 #include "os-features.h"
11 
12 #if defined(_POSIX_SYNCHRONIZED_IO) && (_POSIX_SYNCHRONIZED_IO > 0)
13 #define NEED_FDATASYNC 0
14 #else
15 #define NEED_FDATASYNC 1
16 #endif
17 
18 //# Modified by Robert Lancaster for the StellarSolver Internal Library
19 //#if NEED_CANONICALIZE_FILE_NAME
20 //char* canonicalize_file_name(const char* fn) {
21 //    char* path = malloc(1024);
22 //    char* canon;
23 //    canon = realpath(fn, path);
24 //    if (!canon) {
25 //        free(path);
26 //        return NULL;
27 //    }
28 //    path = realloc(path, strlen(path) + 1);
29 //    return path;
30 //}
31 //#endif
32 //
33 //#if NEED_FDATASYNC
34 //int fdatasync(int fd) {
35 //    return fsync(fd);
36 //}
37 //#endif
38 
39 #if NEED_QSORT_R
40 #include "qsort_reentrant.c"
41 #endif
42