[REORG] build: move syscall redefinition to specific places
Some older libc don't define splice() and and don't define _syscall*()
either, which causes build errors if splicing is enabled.
To solve this, we now split the syscall redefinition into two layers :
- one file per syscall (epoll, splice)
- one common file to declare the _syscall*() macros
The code is cleaner because files using the syscalls just have to include
their respective file. It's not adviced to merge multiple syscall families
into a same file if all are not intended to be used simultaneously, because
defining unused static functions causes warnings to be emitted during build.
As a result, the new USE_MY_SPLICE parameter was added in order to be able
to define the splice() syscall separately.
diff --git a/src/ev_epoll.c b/src/ev_epoll.c
index b976868..958c4e6 100644
--- a/src/ev_epoll.c
+++ b/src/ev_epoll.c
@@ -1,7 +1,7 @@
/*
* FD polling functions for linux epoll()
*
- * Copyright 2000-2008 Willy Tarreau <w@1wt.eu>
+ * Copyright 2000-2011 Willy Tarreau <w@1wt.eu>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -16,6 +16,7 @@
#include <common/compat.h>
#include <common/config.h>
+#include <common/epoll.h>
#include <common/standard.h>
#include <common/ticks.h>
#include <common/time.h>
@@ -27,17 +28,6 @@
#include <proto/signal.h>
#include <proto/task.h>
-#if defined(USE_MY_EPOLL)
-#include <common/epoll.h>
-#include <errno.h>
-#include <sys/syscall.h>
-static _syscall1 (int, epoll_create, int, size);
-static _syscall4 (int, epoll_ctl, int, epfd, int, op, int, fd, struct epoll_event *, event);
-static _syscall4 (int, epoll_wait, int, epfd, struct epoll_event *, events, int, maxevents, int, timeout);
-#else
-#include <sys/epoll.h>
-#endif
-
/* This is what we store in a list. It consists in old values and fds to detect changes. */
struct fd_chg {
unsigned int prev:2; // previous state mask. New one is in fd_evts.