/*
- * Sherlock Library -- Large File Support
+ * UCW Library -- Large File Support
*
* (c) 1999--2002 Martin Mares <mj@ucw.cz>
*
#endif /* !CONFIG_LARGE_FILES */
-#define SHERLOCK_HAVE_PREAD
+#define HAVE_PREAD
static inline sh_off_t
sh_file_size(byte *name)
/*
- * Sherlock Library -- File Page Cache
+ * UCW Library -- File Page Cache
*
* (c) 1999--2002 Martin Mares <mj@ucw.cz>
*
uns stat_miss; /* Number of cache misses */
uns stat_write; /* Number of writes */
list *hash_table; /* List heads corresponding to hash buckets */
-#ifndef SHERLOCK_HAVE_PREAD
+#ifndef HAVE_PREAD
sh_off_t pos; /* Current position in the file */
int pos_fd; /* FD the position corresponds to */
#endif
c->hash_table = xmalloc(sizeof(list) * c->hash_size);
for(i=0; i<c->hash_size; i++)
init_list(&c->hash_table[i]);
-#ifndef SHERLOCK_HAVE_PREAD
+#ifndef HAVE_PREAD
c->pos_fd = -1;
#endif
return c;
int s;
ASSERT(p->flags & PG_FLAG_DIRTY);
-#ifdef SHERLOCK_HAVE_PREAD
+#ifdef HAVE_PREAD
s = sh_pwrite(p->fd, p->data, c->page_size, p->pos);
#else
if (c->pos != p->pos || c->pos_fd != (int) p->fd)
else
{
c->stat_miss++;
-#ifdef SHERLOCK_HAVE_PREAD
+#ifdef HAVE_PREAD
s = sh_pread(fd, p->data, c->page_size, pos);
#else
if (c->pos != pos || c->pos_fd != (int)fd)