/ Check-in [2a4014b7]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fix test_osinst.c so that it does not depend on gettimeofday() unless SQLITE_OS_UNIX is defined and NO_GETTOD is not defined.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 2a4014b79b852d8b62b4941495b826f154308d86
User & Date: dan 2010-05-14 10:43:29
Context
2010-05-14
11:30
Change the OSTRACEn() macro to OSTRACE(()). Also rename some internal fields and variables in os_unix.c to be more meaningful and searchable. check-in: 5fe529f2 user: drh tags: trunk
10:43
Fix test_osinst.c so that it does not depend on gettimeofday() unless SQLITE_OS_UNIX is defined and NO_GETTOD is not defined. check-in: 2a4014b7 user: dan tags: trunk
08:39
Add xShmXXX methods to test_osinst.c. check-in: b8a9b37a user: dan tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/test_osinst.c.

64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
...
211
212
213
214
215
216
217

218
219
220
221
222
223
224
225
226

227


228

229
230
231
232
233
234
235
**       );
*/

#include "sqlite3.h"
#include <string.h>
#include <assert.h>

/* 
** hwtime.h contains inline assembler code for implementing 
** high-performance timing routines.
*/
#include "hwtime.h"


/*
** Maximum pathname length supported by the vfslog backend.
*/
#define INST_MAX_PATHNAME 512

#define OS_ACCESS            1
................................................................................
  vfslogShmSize,                  /* xShmSize */
  vfslogShmGet,                   /* xShmGet */
  vfslogShmRelease,               /* xShmRelease */
  vfslogShmLock,                  /* xShmLock */
  vfslogShmClose                  /* xShmClose */
};


#include <sys/time.h>

static sqlite3_uint64 vfslog_time(){
#if 0
  return sqlite3Hwtime();
#else
  struct timeval sTime;
  gettimeofday(&sTime, 0);
  return sTime.tv_usec + (sqlite3_uint64)sTime.tv_sec * 1000000;

#endif


}


static void vfslog_call(sqlite3_vfs *, int, int, int, int, int, int);
static void vfslog_string(sqlite3_vfs *, const char *);

/*
** Close an vfslog-file.
*/







<
<
<
<
<
<







 







>

<

<
<
<



>
|
>
>

>







64
65
66
67
68
69
70






71
72
73
74
75
76
77
...
205
206
207
208
209
210
211
212
213

214



215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
**       );
*/

#include "sqlite3.h"
#include <string.h>
#include <assert.h>








/*
** Maximum pathname length supported by the vfslog backend.
*/
#define INST_MAX_PATHNAME 512

#define OS_ACCESS            1
................................................................................
  vfslogShmSize,                  /* xShmSize */
  vfslogShmGet,                   /* xShmGet */
  vfslogShmRelease,               /* xShmRelease */
  vfslogShmLock,                  /* xShmLock */
  vfslogShmClose                  /* xShmClose */
};

#if defined(SQLITE_OS_UNIX) && !defined(NO_GETTOD)
#include <sys/time.h>

static sqlite3_uint64 vfslog_time(){



  struct timeval sTime;
  gettimeofday(&sTime, 0);
  return sTime.tv_usec + (sqlite3_uint64)sTime.tv_sec * 1000000;
}
#else
static sqlite3_uint64 vfslog_time(){
  return 0;
}
#endif

static void vfslog_call(sqlite3_vfs *, int, int, int, int, int, int);
static void vfslog_string(sqlite3_vfs *, const char *);

/*
** Close an vfslog-file.
*/