Imported Upstream version 3.4
[platform/upstream/ccache.git] / src / system.h
1 // Copyright (C) 2010-2016 Joel Rosdahl
2 //
3 // This program is free software; you can redistribute it and/or modify it
4 // under the terms of the GNU General Public License as published by the Free
5 // Software Foundation; either version 3 of the License, or (at your option)
6 // any later version.
7 //
8 // This program is distributed in the hope that it will be useful, but WITHOUT
9 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 // FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11 // more details.
12 //
13 // You should have received a copy of the GNU General Public License along with
14 // this program; if not, write to the Free Software Foundation, Inc., 51
15 // Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
17 #ifndef CCACHE_SYSTEM_H
18 #define CCACHE_SYSTEM_H
19
20 #include "config.h"
21
22 #include <sys/file.h>
23 #ifdef HAVE_SYS_MMAN_H
24 #include <sys/mman.h>
25 #endif
26 #include <sys/stat.h>
27 #include <sys/types.h>
28 #ifdef HAVE_SYS_WAIT_H
29 #include <sys/wait.h>
30 #endif
31
32 #include <assert.h>
33 #include <ctype.h>
34 #include <dirent.h>
35 #include <errno.h>
36 #include <fcntl.h>
37 #include <inttypes.h>
38 #include <limits.h>
39 #include <signal.h>
40 #include <stdarg.h>
41 #include <stdbool.h>
42 #include <stddef.h>
43 #include <stdio.h>
44 #include <stdlib.h>
45 #include <string.h>
46 #include <strings.h>
47 #include <time.h>
48 #include <unistd.h>
49 #include <utime.h>
50
51 extern char **environ;
52
53 #ifndef ESTALE
54 #define ESTALE -1
55 #endif
56
57 #if !HAVE_VSNPRINTF
58   int rpl_vsnprintf(char *, size_t, const char *, va_list);
59   #define vsnprintf rpl_vsnprintf
60 #endif
61 #if !HAVE_SNPRINTF
62   int rpl_snprintf(char *, size_t, const char *, ...);
63   #define snprintf rpl_snprintf
64 #endif
65 #if !HAVE_VASPRINTF
66   int rpl_vasprintf(char **, const char *, va_list);
67   #define vasprintf rpl_vasprintf
68 #endif
69 #if !HAVE_ASPRINTF
70   int rpl_asprintf(char **, const char *, ...);
71   #define asprintf rpl_asprintf
72 #endif
73
74 #endif // CCACHE_SYSTEM_H