Squirre17 / Autokd

automate kernel exploit environment deploy
1 stars 0 forks source link

add this header, mmap will not have undefined macro error #25

Closed Squirre17 closed 1 year ago

Squirre17 commented 1 year ago
#include <assert.h>
#include <fcntl.h>
#include <linux/userfaultfd.h>
#include <poll.h>
#include <pthread.h>
#include <sched.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/syscall.h>
#include <sys/types.h>
#include <unistd.h>
Squirre17 commented 1 year ago

define _GNU_SOURCE

https://stackoverflow.com/questions/24034631/error-message-undefined-reference-for-cpu-zero

Squirre17 commented 1 year ago

_GNU_SOURCE must be header of file

#ifndef __COMMON_H__
#define __COMMON_H__
#define _GNU_SOURCE

#include <stdio.h>
#include <pthread.h>
#include <unistd.h>
#include <stdlib.h>
#include <sys/ioctl.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <string.h>
#include <fcntl.h>
#include <sys/mman.h>
#include <errno.h>
#include <signal.h>
#include <sys/syscall.h>
#include <stdint.h>
#include <sys/prctl.h>
#include <linux/userfaultfd.h>
#include <poll.h>
#include <assert.h>
#include <sched.h>
#include <stdint.h>