64bit fixes
[AROS-Contrib.git] / sqlite3 / os_aros.h
blobb4b26ff8d20c463ca46683a22f143b545466d8a7
1 /*
2 ** 2004 May 22
3 **
4 ** The author disclaims copyright to this source code. In place of
5 ** a legal notice, here is a blessing:
6 **
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_AROS_H_
16 #define _SQLITE_OS_AROS_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
42 # endif
43 # define _LARGEFILE_SOURCE 1
44 #endif
47 ** standard include files.
49 #include <sys/types.h>
50 #include <sys/stat.h>
51 #include <fcntl.h>
52 #include <unistd.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;
64 struct 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 BOOL isOpen; /* True if needs to be closed */
71 BOOL fullSync; /* Use F_FULLSYNC if available */
72 int dirfd; /* File descriptor for the directory */
76 ** A macro to set the OsFile.fullSync flag, if it exists.
78 #define SET_FULLSYNC(x,y) ((x).fullSync = (y))
81 ** Maximum number of characters in a temporary file name
83 #define SQLITE_TEMPNAME_SIZE 200
86 ** Minimum interval supported by sqlite3OsSleep().
88 #if defined(HAVE_USLEEP) && HAVE_USLEEP
89 # define SQLITE_MIN_SLEEP_MS 1
90 #else
91 # define SQLITE_MIN_SLEEP_MS 1000
92 #endif
95 ** Default permissions when creating a new file
97 #ifndef SQLITE_DEFAULT_FILE_PERMISSIONS
98 # define SQLITE_DEFAULT_FILE_PERMISSIONS 0644
99 #endif
102 #endif /* _SQLITE_OS_AROS_H_ */