mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-23 02:05:57 +01:00
futex: move required includes to header
This commit is contained in:
@@ -1,6 +1,13 @@
|
|||||||
#ifndef LKMC_FUTEX_H
|
#ifndef LKMC_FUTEX_H
|
||||||
#define LKMC_FUTEX_H
|
#define LKMC_FUTEX_H
|
||||||
|
|
||||||
|
#ifndef _GNU_SOURCE
|
||||||
|
#define _GNU_SOURCE
|
||||||
|
#endif
|
||||||
|
#include <linux/futex.h>
|
||||||
|
#include <sys/syscall.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
static int
|
static int
|
||||||
lkmc_futex(int *uaddr, int futex_op, int val,
|
lkmc_futex(int *uaddr, int futex_op, int val,
|
||||||
const struct timespec *timeout, int *uaddr2, int val3)
|
const struct timespec *timeout, int *uaddr2, int val3)
|
||||||
|
|||||||
@@ -1,13 +1,10 @@
|
|||||||
/* https://cirosantilli.com/linux-kernel-module-cheat#futex-system-call */
|
/* https://cirosantilli.com/linux-kernel-module-cheat#futex-system-call */
|
||||||
|
|
||||||
#define _GNU_SOURCE
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <linux/futex.h>
|
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <sys/syscall.h>
|
|
||||||
|
|
||||||
#include <lkmc/futex.h>
|
#include <lkmc/futex.h>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user