mirror of
https://github.com/bol-van/zapret2.git
synced 2026-03-14 06:13:09 +00:00
nfqws2: compile compat
This commit is contained in:
27
nfq2/random.h
Normal file
27
nfq2/random.h
Normal file
@@ -0,0 +1,27 @@
|
||||
#pragma once
|
||||
|
||||
// shim for old NDK and old gcc linux compilers
|
||||
|
||||
#include <sys/syscall.h>
|
||||
|
||||
#if defined(__linux__)
|
||||
|
||||
#if defined(__ANDROID__) && __ANDROID_API__ < 28 || !defined(SYS_getrandom)
|
||||
|
||||
#define NEED_GETRANDOM
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
/* getrandom flags */
|
||||
#define GRND_NONBLOCK 1
|
||||
#define GRND_RANDOM 2
|
||||
|
||||
ssize_t getrandom(void *ptr, size_t len, unsigned int flags);
|
||||
|
||||
#else
|
||||
|
||||
#include <sys/random.h>
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user