Skip to content

Commit

Permalink
Adding workaround for differences in glibc/libc6 >= & < 2.30 versions…
Browse files Browse the repository at this point in the history
… and gettid()
  • Loading branch information
tpiekarski committed Aug 19, 2020
1 parent 1546b3f commit 2760f0b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pocs/io-port-permissions/permissions-revisited.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@
#include <sys/wait.h>
#include <unistd.h>

#if __GLIBC__ == 2 && __GLIBC_MINOR__ < 30
// Workaround for missing gettid() - it is only available with glibc >= 2.30.
#include <sys/syscall.h>
#define gettid() (int)syscall(SYS_gettid)
#endif

#define PORT 0x378 // lp0
#define STACK_SIZE 1024 * 1024
#define EXECVE_TARGET "permissions-with-execve-target"
Expand Down

0 comments on commit 2760f0b

Please sign in to comment.