Disable r2k for GNU Hurd

This commit is contained in:
Rakholiya Jenish 2017-02-08 17:03:29 +05:30 committed by radare
parent 6e9ae1772b
commit be6622e318
2 changed files with 10 additions and 6 deletions

View File

@ -9,7 +9,7 @@
#if __WINDOWS__
#include "io_r2k_windows.h"
#elif __linux__
#elif defined (__linux__) && !defined (__GNU__)
#include "io_r2k_linux.h"
struct io_r2k_linux r2k_struct;
#endif
@ -18,7 +18,7 @@ int r2k__write(RIO *io, RIODesc *fd, const ut8 *buf, int count) {
#if __WINDOWS__
//eprintf("writing to: 0x%"PFMT64x" len: %x\n",io->off, count);
return WriteKernelMemory (io->off, buf, count);
#elif __linux__
#elif defined (__linux__) && !defined (__GNU__)
if (r2k_struct.beid == 0) {
return WriteMemory (io, fd, IOCTL_WRITE_KERNEL_MEMORY, r2k_struct.pid, io->off, buf, count);
} else if (r2k_struct.beid == 1) {
@ -38,7 +38,7 @@ int r2k__write(RIO *io, RIODesc *fd, const ut8 *buf, int count) {
static int r2k__read(RIO *io, RIODesc *fd, ut8 *buf, int count) {
#if __WINDOWS__
return ReadKernelMemory (io->off, buf, count);
#elif __linux__
#elif defined (__linux__) && !defined (__GNU__)
if (r2k_struct.beid == 0) {
return ReadMemory (io, fd, IOCTL_READ_KERNEL_MEMORY, r2k_struct.pid, io->off, buf, count);
} else if (r2k_struct.beid == 1) {
@ -63,7 +63,7 @@ static int r2k__close(RIODesc *fd) {
CloseHandle (gHandleDriver);
StartStopService ("r2k",TRUE);
}
#elif __linux__
#elif defined (__linux__) && !defined (__GNU__)
if (fd) {
close (fd->fd);
}
@ -88,7 +88,7 @@ static int r2k__system(RIO *io, RIODesc *fd, const char *cmd) {
GetSystemModules (io);
#endif
} else {
#if __linux__
#if defined (__linux__) && !defined (__GNU__)
return run_ioctl_command (io, fd, cmd);
#else
eprintf ("Try: '=!mod'\n '.=!mod'\n");
@ -107,7 +107,7 @@ static RIODesc *r2k__open(RIO *io, const char *pathname, int rw, int mode) {
return NULL;
}
return r_io_desc_new (&r_io_plugin_r2k, -1, pathname, rw, mode, w32);
#elif __linux__
#elif defined (__linux__) && !defined (__GNU__)
int fd = open ("/dev/r2k", O_RDONLY);
if (fd == -1) {
io->cb_printf ("r2k__open: Error in opening /dev/r2k.");

View File

@ -1,3 +1,5 @@
#ifndef __GNU__
#include "io_r2k_linux.h"
#define fset(num, shift) (((num & (((ut64) 1) << shift)) == 0) ? 0 : 1)
@ -753,3 +755,5 @@ int run_ioctl_command(RIO *io, RIODesc *iodesc, const char *buf) {
free (databuf);
return 0;
}
#endif