snapshot.o malloc.o mymemory.o common.o mutex.o conditionvariable.o \
context.o execution.o libannotate.o plugins.o pthread.o futex.o fuzzer.o \
sleeps.o history.o funcnode.o funcinst.o predicate.o printf.o newfuzzer.o \
- concretepredicate.o waitobj.o hashfunction.o pipe.o actionlist.o
+ concretepredicate.o waitobj.o hashfunction.o pipe.o epoll.o actionlist.o
CPPFLAGS += -Iinclude -I.
LDFLAGS := -ldl -lrt -rdynamic -lpthread
#include "context.h"
#include "classlist.h"
#include "pthread.h"
+#include <sys/epoll.h>
struct thread_params {
thrd_start_t func;
return id;
}
+int real_epoll_wait(int epfd, struct epoll_event *events, int maxevents, int timeout);
int real_pthread_mutex_init(pthread_mutex_t *__mutex, const pthread_mutexattr_t *__mutexattr);
int real_pthread_mutex_lock (pthread_mutex_t *__mutex);
int real_pthread_mutex_unlock (pthread_mutex_t *__mutex);
#include "schedule.h"
#include "clockvector.h"
-#ifdef TLS
#include <dlfcn.h>
+
+#ifdef TLS
uintptr_t get_tls_addr() {
uintptr_t addr;
asm ("mov %%fs:0, %0" : "=r" (addr));
#endif
}
+
+static int (*real_epoll_wait_p)(int epfd, struct epoll_event *events, int maxevents, int timeout) = NULL;
+
+int real_epoll_wait(int epfd, struct epoll_event *events, int maxevents, int timeout) {
+ return real_epoll_wait_p(epfd, events, maxevents, timeout);
+}
+
static int (*pthread_mutex_init_p)(pthread_mutex_t *__mutex, const pthread_mutexattr_t *__mutexattr) = NULL;
int real_pthread_mutex_init(pthread_mutex_t *__mutex, const pthread_mutexattr_t *__mutexattr) {
void real_init_all() {
char * error;
+ if (!real_epoll_wait_p) {
+ real_epoll_wait_p = (int (*)(int epfd, struct epoll_event *events, int maxevents, int timeout))dlsym(RTLD_NEXT, "epoll_wait");
+ if ((error = dlerror()) != NULL) {
+ fputs(error, stderr);
+ exit(EXIT_FAILURE);
+ }
+ }
if (!pthread_mutex_init_p) {
pthread_mutex_init_p = (int (*)(pthread_mutex_t *__mutex, const pthread_mutexattr_t *__mutexattr))dlsym(RTLD_NEXT, "pthread_mutex_init");
if ((error = dlerror()) != NULL) {