aboutsummaryrefslogtreecommitdiff
path: root/src/njs_unix.h
blob: efcea7548ab2fb9e0ad78df4bae32946d0932a55 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/*
 * Copyright (C) Dmitry Volyntsev
 * Copyright (C) NGINX, Inc.
 */


#ifndef _NJS_UNIX_H_INCLUDED_
#define _NJS_UNIX_H_INCLUDED_

#define njs_pagesize()      getpagesize()

#if (NJS_LINUX)

#ifdef _FORTIFY_SOURCE
/*
 * _FORTIFY_SOURCE
 *     does not allow to use "(void) write()";
 */
#undef _FORTIFY_SOURCE
#endif

#endif /* NJS_LINUX */


#include <errno.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <float.h>
#include <limits.h>
#include <time.h>
#include <fcntl.h>

/*
 * alloca() is defined in stdlib.h in Linux, FreeBSD and MacOSX
 * and in alloca.h in Linux, Solaris and MacOSX.
 */
#if (NJS_SOLARIS)
#include <alloca.h>
#endif

#include <sys/time.h>
#include <sys/stat.h>
#include <sys/param.h>

#include <unistd.h>

extern char  **environ;

#if defined(PATH_MAX)
#define NJS_MAX_PATH             PATH_MAX
#else
#define NJS_MAX_PATH             4096
#endif

#endif /* _NJS_UNIX_H_INCLUDED_ */