use __linux__ instead of redefined LINUX.
un = GNUNET_new (struct sockaddr_un);
un->sun_family = AF_UNIX;
GNUNET_strlcpy (un->sun_path, unixpath, sizeof(un->sun_path));
-#ifdef LINUX
+#ifdef __linux__
if (GNUNET_YES == abstract)
un->sun_path[0] = '\0';
#endif
unixpath = GNUNET_NETWORK_shorten_unixpath (unixpath);
LOG (GNUNET_ERROR_TYPE_INFO, _ ("Using `%s' instead\n"), unixpath);
}
-#ifdef LINUX
+#ifdef __linux__
abstract = GNUNET_CONFIGURATION_get_value_yesno (cfg,
"TESTING",
"USE_ABSTRACT_SOCKETS");
return;
}
if ((AF_UNIX == sa->sa_family)
-#ifdef LINUX
+#ifdef __linux__
/* Permission settings are not required when abstract sockets are used */
&& ('\0' != ((const struct sockaddr_un *) sa)->sun_path[0])
#endif
}
-#if defined(LINUX) && defined(__GLIBC__)
+#if defined(__linux__) && defined(__GLIBC__)
#include <malloc.h>
/**
#include <semaphore.h>
#include <net/if.h>
#endif
-#if defined(LINUX) || defined(GNU)
+#if defined(__linux__) || defined(GNU)
#include <net/if.h>
#endif
#ifdef SOLARIS
GNUNET_MQ_handler_end ());
-#if defined(LINUX) && defined(__GLIBC__)
+#if defined(__linux__) && defined(__GLIBC__)
#include <malloc.h>
/**
GNUNET_MQ_handler_end ());
-#if defined(LINUX) && defined(__GLIBC__)
+#if defined(__linux__) && defined(__GLIBC__)
#include <malloc.h>
/**
GNUNET_MQ_handler_end ());
-#if defined(LINUX) && defined(__GLIBC__)
+#if defined(__linux__) && defined(__GLIBC__)
#include <malloc.h>
/**
GNUNET_MQ_handler_end ());
-#if defined(LINUX) && defined(__GLIBC__)
+#if defined(__linux__) && defined(__GLIBC__)
#include <malloc.h>
/**
}
-#if defined(LINUX) && defined(__GLIBC__)
+#if defined(__linux__) && defined(__GLIBC__)
#include <malloc.h>
/**
GNUNET_MQ_handler_end ());
-#if defined(LINUX) && defined(__GLIBC__)
+#if defined(__linux__) && defined(__GLIBC__)
#include <malloc.h>
/**
GNUNET_MQ_handler_end ());
-#if defined(LINUX) && defined(__GLIBC__)
+#if defined(__linux__) && defined(__GLIBC__)
#include <malloc.h>
/**
#define DEBUG_STATUSCALLS GNUNET_NO
-#ifdef LINUX
+#ifdef __linux__
static FILE *proc_stat;
#endif
{
currentIOLoad = -1;
currentCPULoad = -1;
-#ifdef LINUX
+#ifdef __linux__
/* under linux, first try %idle/usage using /proc/stat;
if that does not work, disable /proc/stat for the future
by closing the file and use the next-best method. */
}
-#ifdef LINUX
+#ifdef __linux__
#include <dirent.h>
/**
* Returns the number of processes
if ((-1 == ld_cpu) || (-1 == ld_disk))
goto reschedule;
mem_usage = mem_get_usage ();
-#ifdef LINUX
+#ifdef __linux__
nproc = get_nproc ();
#else
nproc = 0;
}
GNUNET_free (fn);
sample_load_task_id = GNUNET_SCHEDULER_add_now (&sample_load_task, NULL);
-#ifdef LINUX
+#ifdef __linux__
proc_stat = fopen ("/proc/stat", "r");
if (NULL == proc_stat)
GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING,
{
if (NULL == bw)
return;
-#ifdef LINUX
+#ifdef __linux__
if (proc_stat != NULL)
{
fclose (proc_stat);
}
-#if defined(LINUX) && defined(__GLIBC__)
+#if defined(__linux__) && defined(__GLIBC__)
#include <malloc.h>
/**
}
-#if defined(LINUX) && defined(__GLIBC__)
+#if defined(__linux__) && defined(__GLIBC__)
#include <malloc.h>
/**
char buf[MAXLINE * 2];
};
-#ifdef LINUX
+#ifdef __linux__
/**
* Devices buffer used to keep a list with all the discoverable devices in
* order to send them HELLO messages one by one when it receive a broadcast message.
/* ************** end of clone ***************** */
-#ifdef LINUX
+#ifdef __linux__
/**
* Function for assigning a port number
*
return -1;
}
- #ifdef LINUX
+ #ifdef __linux__
/* Get the channel used */
int len;
struct sockaddr_rc rc_addr = { 0 };
}
-#ifdef LINUX
+#ifdef __linux__
/**
* Test if the given interface name really corresponds to a bluetooth
* device.
}
-#ifdef LINUX
+#ifdef __linux__
/**
* Broadcast a HELLO message for peer discovery
*
int
main (int argc, char *argv[])
{
-#ifdef LINUX
+#ifdef __linux__
struct HardwareInfos dev;
char readbuf[MAXLINE];
int maxfd;
unixpath = GNUNET_NETWORK_shorten_unixpath (unixpath);
LOG (GNUNET_ERROR_TYPE_INFO, _ ("Using `%s' instead\n"), unixpath);
}
-#ifdef LINUX
+#ifdef __linux__
abstract = GNUNET_CONFIGURATION_get_value_yesno (cfg,
"TESTING",
"USE_ABSTRACT_SOCKETS");
#define LOG(kind, ...) GNUNET_log_from (kind, "transport-udp", __VA_ARGS__)
/* *********** Cryogenic ********** */
-#if LINUX
+#if __linux__
#include <sys/stat.h>
#include <fcntl.h>
socklen_t addrlen;
-#if LINUX
+#if __linux__
/**
* Cryogenic handle.
*/
}
}
-#if LINUX
+#if __linux__
/*
* Cryogenic
*/
GNUNET_a2s ((const struct sockaddr *) &plugin->ipv6_multicast_address,
sizeof(struct sockaddr_in6)));
}
-#if LINUX
+#if __linux__
/*
* Cryogenic
*/
(NULL != plugin->sockv4) &&
(addrlen == sizeof(struct sockaddr_in)))
{
-#if LINUX
+#if __linux__
/*
* setup Cryogenic FD for ipv4 broadcasting
*/
}
else
{
-#if LINUX
+#if __linux__
/*
* setup Cryogenic FD for ipv6 broadcasting
*/
}
}
-#if LINUX
+#if __linux__
GNUNET_DISK_file_close (p->cryogenic_fd);
#endif
GNUNET_CONTAINER_DLL_remove (plugin->broadcast_head,
plugin->env = env;
/* Initialize my flags */
-#ifdef LINUX
+#ifdef __linux__
plugin->is_abstract =
GNUNET_CONFIGURATION_get_value_yesno (plugin->env->cfg,
"testing",
un = GNUNET_new (struct sockaddr_un);
un->sun_family = AF_UNIX;
GNUNET_strlcpy (un->sun_path, unixpath, sizeof(un->sun_path));
-#ifdef LINUX
+#ifdef __linux__
{
int abstract;
un = GNUNET_new (struct sockaddr_un);
un->sun_family = AF_UNIX;
GNUNET_strlcpy (un->sun_path, unixpath, sizeof(un->sun_path));
-#ifdef LINUX
+#ifdef __linux__
if (GNUNET_YES == abstract)
un->sun_path[0] = '\0';
#endif
unixpath = GNUNET_NETWORK_shorten_unixpath (unixpath);
LOG (GNUNET_ERROR_TYPE_INFO, _ ("Using `%s' instead\n"), unixpath);
}
-#ifdef LINUX
+#ifdef __linux__
abstract = GNUNET_CONFIGURATION_get_value_yesno (cfg,
"TESTING",
"USE_ABSTRACT_SOCKETS");
size_t ret;
ret = (iter * iter * iter);
-#ifndef LINUX
+#ifndef __linux__
/* FreeBSD/OSX etc. Unix DGRAMs do not work
* with large messages */
if (0 == strcmp ("unix", ccc->test_plugin))
return GNUNET_SYSERR;
}
-#if ! defined(LINUX) || ! defined(GNU)
+#if ! defined(__linux__) || ! defined(GNU)
return fsync (h->fd) == -1 ? GNUNET_SYSERR : GNUNET_OK;
#else
return fdatasync (h->fd) == -1 ? GNUNET_SYSERR : GNUNET_OK;
GNUNET_MQ_handler_end ());
-#if defined(LINUX) && defined(__GLIBC__)
+#if defined(__linux__) && defined(__GLIBC__)
#include <malloc.h>
/**
{
int ret = 0;
-#if LINUX
+#if __linux__
int value = 0;
if (0 !=
}
-#if LINUX
+#if __linux__
/**
* Try to determine path by reading /proc/PID/exe
*
if (NULL != (ret = get_path_from_GNUNET_PREFIX ()))
return ret;
-#if LINUX
+#if __linux__
if (NULL != (ret = get_path_from_proc_maps ()))
return ret;
/* try path *first*, before /proc/exe, as /proc/exe can be wrong */
{
char *ret = NULL;
-#if LINUX
+#if __linux__
if (NULL != (ret = get_path_from_proc_exe ()))
return ret;
#endif
static int
test_directory_r ()
{
-#if LINUX
+#if __linux__
char *msg;
char readResult[200];
struct GNUNET_BIO_ReadHandle *fileR;
static int
test_fullfile_rw ()
{
-#ifdef LINUX
+#ifdef __linux__
/* /dev/full only seems to exist on Linux */
char *msg;
int64_t testNum;