4
** The author disclaims copyright to this source code. In place of
5
** a legal notice, here is a blessing:
7
** May you do good and not evil.
8
** May you find forgiveness for yourself and forgive others.
9
** May you share freely, never taking more than you give.
11
******************************************************************************
13
** This header file defined OS-specific features for Unix.
15
#ifndef _SQLITE_OS_UNIX_H_
16
#define _SQLITE_OS_UNIX_H_
19
** Helpful hint: To get this to compile on HP/UX, add -D_INCLUDE_POSIX_SOURCE
20
** to the compiler command line.
24
** These #defines should enable >2GB file support on Posix if the
25
** underlying operating system supports it. If the OS lacks
26
** large file support, or if the OS is windows, these should be no-ops.
28
** Large file support can be disabled using the -DSQLITE_DISABLE_LFS switch
29
** on the compiler command line. This is necessary if you are compiling
30
** on a recent machine (ex: RedHat 7.2) but you want your code to work
31
** on an older machine (ex: RedHat 6.0). If you compile on RedHat 7.2
32
** without this option, LFS is enable. But LFS does not exist in the kernel
33
** in RedHat 6.0, so the code won't work. Hence, for maximum binary
34
** portability you should omit LFS.
36
** Similar is true for MacOS. LFS is only supported on MacOS 9 and later.
38
#ifndef SQLITE_DISABLE_LFS
39
# define _LARGE_FILE 1
40
# ifndef _FILE_OFFSET_BITS
41
# define _FILE_OFFSET_BITS 64
43
# define _LARGEFILE_SOURCE 1
47
** standard include files.
49
#include <sys/types.h>
55
** The OsFile structure is a operating-system independing representation
56
** of an open file handle. It is defined differently for each architecture.
58
** This is the definition for Unix.
60
** OsFile.locktype takes one of the values SHARED_LOCK, RESERVED_LOCK,
61
** PENDING_LOCK or EXCLUSIVE_LOCK.
63
typedef struct OsFile OsFile;
65
struct Pager *pPager; /* The pager that owns this OsFile. Might be 0 */
66
struct openCnt *pOpen; /* Info about all open fd's on this inode */
67
struct lockInfo *pLock; /* Info about locks on this inode */
68
int h; /* The file descriptor */
69
unsigned char locktype; /* The type of lock held on this fd */
70
unsigned char isOpen; /* True if needs to be closed */
71
int dirfd; /* File descriptor for the directory */
75
** Maximum number of characters in a temporary file name
77
#define SQLITE_TEMPNAME_SIZE 200
80
** Minimum interval supported by sqlite3OsSleep().
82
#if defined(HAVE_USLEEP) && HAVE_USLEEP
83
# define SQLITE_MIN_SLEEP_MS 1
85
# define SQLITE_MIN_SLEEP_MS 1000
89
#endif /* _SQLITE_OS_UNIX_H_ */