sl@0
|
1 |
/*
|
sl@0
|
2 |
** 2004 May 22
|
sl@0
|
3 |
**
|
sl@0
|
4 |
** The author disclaims copyright to this source code. In place of
|
sl@0
|
5 |
** a legal notice, here is a blessing:
|
sl@0
|
6 |
**
|
sl@0
|
7 |
** May you do good and not evil.
|
sl@0
|
8 |
** May you find forgiveness for yourself and forgive others.
|
sl@0
|
9 |
** May you share freely, never taking more than you give.
|
sl@0
|
10 |
**
|
sl@0
|
11 |
******************************************************************************
|
sl@0
|
12 |
**
|
sl@0
|
13 |
** This header file defined OS-specific features for OS/2.
|
sl@0
|
14 |
*/
|
sl@0
|
15 |
#ifndef _SQLITE_OS_OS2_H_
|
sl@0
|
16 |
#define _SQLITE_OS_OS2_H_
|
sl@0
|
17 |
|
sl@0
|
18 |
/*
|
sl@0
|
19 |
** standard include files.
|
sl@0
|
20 |
*/
|
sl@0
|
21 |
#include <sys/types.h>
|
sl@0
|
22 |
#include <sys/stat.h>
|
sl@0
|
23 |
#include <fcntl.h>
|
sl@0
|
24 |
#include <unistd.h>
|
sl@0
|
25 |
|
sl@0
|
26 |
/*
|
sl@0
|
27 |
** Macros used to determine whether or not to use threads. The
|
sl@0
|
28 |
** SQLITE_UNIX_THREADS macro is defined if we are synchronizing for
|
sl@0
|
29 |
** Posix threads and SQLITE_W32_THREADS is defined if we are
|
sl@0
|
30 |
** synchronizing using Win32 threads.
|
sl@0
|
31 |
*/
|
sl@0
|
32 |
/* this mutex implementation only available with EMX */
|
sl@0
|
33 |
#if defined(THREADSAFE) && THREADSAFE
|
sl@0
|
34 |
# include <sys/builtin.h>
|
sl@0
|
35 |
# include <sys/smutex.h>
|
sl@0
|
36 |
# define SQLITE_OS2_THREADS 1
|
sl@0
|
37 |
#endif
|
sl@0
|
38 |
|
sl@0
|
39 |
/*
|
sl@0
|
40 |
** The OsFile structure is a operating-system independing representation
|
sl@0
|
41 |
** of an open file handle. It is defined differently for each architecture.
|
sl@0
|
42 |
**
|
sl@0
|
43 |
** This is the definition for Unix.
|
sl@0
|
44 |
**
|
sl@0
|
45 |
** OsFile.locktype takes one of the values SHARED_LOCK, RESERVED_LOCK,
|
sl@0
|
46 |
** PENDING_LOCK or EXCLUSIVE_LOCK.
|
sl@0
|
47 |
*/
|
sl@0
|
48 |
typedef struct OsFile OsFile;
|
sl@0
|
49 |
struct OsFile {
|
sl@0
|
50 |
int h; /* The file descriptor (LHANDLE) */
|
sl@0
|
51 |
int locked; /* True if this user holds the lock */
|
sl@0
|
52 |
int delOnClose; /* True if file is to be deleted on close */
|
sl@0
|
53 |
char *pathToDel; /* Name of file to delete on close */
|
sl@0
|
54 |
unsigned char locktype; /* The type of lock held on this fd */
|
sl@0
|
55 |
unsigned char isOpen; /* True if needs to be closed */
|
sl@0
|
56 |
unsigned char fullSync;
|
sl@0
|
57 |
};
|
sl@0
|
58 |
|
sl@0
|
59 |
/*
|
sl@0
|
60 |
** Maximum number of characters in a temporary file name
|
sl@0
|
61 |
*/
|
sl@0
|
62 |
#define SQLITE_TEMPNAME_SIZE 200
|
sl@0
|
63 |
|
sl@0
|
64 |
/*
|
sl@0
|
65 |
** Minimum interval supported by sqlite3OsSleep().
|
sl@0
|
66 |
*/
|
sl@0
|
67 |
#define SQLITE_MIN_SLEEP_MS 1
|
sl@0
|
68 |
|
sl@0
|
69 |
#ifndef SQLITE_DEFAULT_FILE_PERMISSIONS
|
sl@0
|
70 |
# define SQLITE_DEFAULT_FILE_PERMISSIONS 0600
|
sl@0
|
71 |
#endif
|
sl@0
|
72 |
|
sl@0
|
73 |
#endif /* _SQLITE_OS_OS2_H_ */
|