aboutsummaryrefslogtreecommitdiffstats
path: root/src/aio_event.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2012-03-27 18:46:21 +0400
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2012-03-27 18:46:21 +0400
commitd450657c9040e77057fdcaf2151537f7ad46580f (patch)
tree015a75b1387a05950bab52fc2a6d18872764d547 /src/aio_event.c
parentbbc501fbfd1f8ffe67b97cc684ca5c1152ccbfd1 (diff)
downloadrspamd-d450657c9040e77057fdcaf2151537f7ad46580f.tar.gz
rspamd-d450657c9040e77057fdcaf2151537f7ad46580f.zip
Use 64 bit offset while compiled in 32 bit mode.
Diffstat (limited to 'src/aio_event.c')
-rw-r--r--src/aio_event.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/aio_event.c b/src/aio_event.c
index e11b7ec83..8608e9d4c 100644
--- a/src/aio_event.c
+++ b/src/aio_event.c
@@ -307,7 +307,7 @@ rspamd_aio_open (struct aio_context *ctx, const gchar *path, int flags)
* Asynchronous read of file
*/
gint
-rspamd_aio_read (gint fd, gpointer buf, gsize len, off_t offset, struct aio_context *ctx, rspamd_aio_cb cb, gpointer ud)
+rspamd_aio_read (gint fd, gpointer buf, gsize len, guint64 offset, struct aio_context *ctx, rspamd_aio_cb cb, gpointer ud)
{
struct io_cbdata *cbdata;
gint r = -1;
@@ -354,7 +354,11 @@ rspamd_aio_read (gint fd, gpointer buf, gsize len, off_t offset, struct aio_cont
else {
/* Blocking variant */
blocking:
+#ifdef _LARGEFILE64_SOURCE
+ r = lseek64 (fd, offset, SEEK_SET);
+#else
r = lseek (fd, offset, SEEK_SET);
+#endif
if (r > 0) {
r = read (fd, buf, len);
if (r >= 0) {
@@ -373,7 +377,7 @@ blocking:
* Asynchronous write of file
*/
gint
-rspamd_aio_write (gint fd, gpointer buf, gsize len, off_t offset, struct aio_context *ctx, rspamd_aio_cb cb, gpointer ud)
+rspamd_aio_write (gint fd, gpointer buf, gsize len, guint64 offset, struct aio_context *ctx, rspamd_aio_cb cb, gpointer ud)
{
struct io_cbdata *cbdata;
gint r = -1;
@@ -424,7 +428,11 @@ rspamd_aio_write (gint fd, gpointer buf, gsize len, off_t offset, struct aio_con
else {
/* Blocking variant */
blocking:
+#ifdef _LARGEFILE64_SOURCE
+ r = lseek64 (fd, offset, SEEK_SET);
+#else
r = lseek (fd, offset, SEEK_SET);
+#endif
if (r > 0) {
r = write (fd, buf, len);
if (r >= 0) {