Browse code

move pread_cb

Török Edvin authored on 2012/01/09 19:43:21
Showing 1 changed files
... ...
@@ -50,7 +50,11 @@ static inline unsigned int fmap_which_page(fmap_t *m, size_t at);
50 50
 
51 51
 #ifndef _WIN32
52 52
 /* vvvvv POSIX STUFF BELOW vvvvv */
53
-static ssize_t pread_cb(void *handle, void *buf, size_t count, off_t offset);
53
+static off_t pread_cb(void *handle, void *buf, size_t count, off_t offset)
54
+{
55
+    return pread((int)(ssize_t)handle, buf, count, offset);
56
+}
57
+
54 58
 
55 59
 /* pread proto here in order to avoid the use of XOPEN and BSD_SOURCE
56 60
    which may in turn prevent some mmap constants to be defined */
... ...
@@ -272,11 +276,6 @@ extern cl_fmap_t *cl_fmap_open_handle(void *handle, size_t offset, size_t len,
272 272
     return m;
273 273
 }
274 274
 
275
-static ssize_t pread_cb(void *handle, void *buf, size_t count, off_t offset)
276
-{
277
-    return pread((int)(ssize_t)handle, buf, count, offset);
278
-}
279
-
280 275
 static void fmap_aging(fmap_t *m) {
281 276
 #ifdef ANONYMOUS_MAP
282 277
     if(!m->aging) return;