aboutsummaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorHeikki Lindholm <holin@iki.fi>2010-04-09 20:24:34 +0000
committerHeikki Lindholm <holin@iki.fi>2010-04-09 20:24:34 +0000
commit8f0658b93c8fe2b7d243a6cd38cd569a9f24101f (patch)
tree2d65e8e26963de2ead6b26e2d511d43a72797dc8 /src/include
parente330680665c97ce4ec3e2ccca1b24981830ab5da (diff)
downloadgnunet-8f0658b93c8fe2b7d243a6cd38cd569a9f24101f.tar.gz
gnunet-8f0658b93c8fe2b7d243a6cd38cd569a9f24101f.zip
rehash since gethostname is used in resolver as well
Diffstat (limited to 'src/include')
-rw-r--r--src/include/gnunet_os_lib.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/include/gnunet_os_lib.h b/src/include/gnunet_os_lib.h
index 32d9dc7ff..3aa1f1bad 100644
--- a/src/include/gnunet_os_lib.h
+++ b/src/include/gnunet_os_lib.h
@@ -155,6 +155,18 @@ void GNUNET_OS_network_interfaces_list (GNUNET_OS_NetworkInterfaceProcessor
155 proc, void *proc_cls); 155 proc, void *proc_cls);
156 156
157/** 157/**
158 * @brief Get maximum string length returned by gethostname()
159 */
160#if HAVE_SYSCONF && defined(_SC_HOST_NAME_MAX)
161#define GNUNET_OS_get_hostname_max_length() ({ int __sc_tmp = sysconf(_SC_HOST_NAME_MAX); __sc_tmp <= 0 ? 255 : __sc_tmp; })
162#elif defined(HOST_NAME_MAX)
163#define GNUNET_OS_get_hostname_max_length() HOST_NAME_MAX
164#else
165#define GNUNET_OS_get_hostname_max_length() 255
166#endif
167
168
169/**
158 * Get the current CPU load. 170 * Get the current CPU load.
159 * 171 *
160 * @param cfg to determine acceptable load level (LOAD::MAXCPULOAD) 172 * @param cfg to determine acceptable load level (LOAD::MAXCPULOAD)