-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathos.h
62 lines (50 loc) · 1.08 KB
/
os.h
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
59
60
61
62
/*
* This file is part of John the Ripper password cracker,
* Copyright (c) 1996-2013 by Solar Designer
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted.
*
* There's ABSOLUTELY NO WARRANTY, express or implied.
*/
/*
* OS-specific parameters.
*/
#ifndef _JOHN_OS_H
#define _JOHN_OS_H
#ifdef NEED_OS_TIMER
#if defined(__CYGWIN__) || defined(__BEOS__)
#define OS_TIMER 0
#else
#ifndef _XOPEN_SOURCE
#define _XOPEN_SOURCE 500 /* for ITIMER_REAL */
#endif
#include <sys/time.h>
#ifdef ITIMER_REAL
#define OS_TIMER 1
#else
#define OS_TIMER 0
#warning ITIMER_REAL is not available - will emulate timers
#endif
#endif
#endif
#ifdef NEED_OS_FLOCK
#if defined(__APPLE__) && !defined(_DARWIN_C_SOURCE)
#define _DARWIN_C_SOURCE /* for LOCK_EX */
#endif
#include <sys/file.h>
#ifdef LOCK_EX
#define OS_FLOCK 1
#else
#define OS_FLOCK 0
#warning LOCK_EX is not available - will skip locking
#endif
#endif
#ifdef NEED_OS_FORK
#if defined(__DJGPP__) || defined(__CYGWIN__)
#define OS_FORK 0
#else
#define OS_FORK 1
#endif
#endif
#endif