netsniff-ng: Check return value of poll()
[netsniff-ng.git] / lockme.h
blob7cce97bb55330fbe1e755f11865836e25d8ddbe4
1 #ifndef LOCKME_H
2 #define LOCKME_H
4 #include <sys/mman.h>
6 #include "die.h"
8 static inline void xlockme(void)
10 if (mlockall(MCL_CURRENT | MCL_FUTURE) != 0)
11 panic("Cannot lock pages!\n");
14 static inline void xunlockme(void)
16 munlockall();
19 #endif /* LOCKME_H */