INCLUDE(TestBigEndian)
#
-# Check for various posix specific header files:
+# Check for various posix (and linux) specific header files:
#
+CHECK_INCLUDE_FILE("unistd.h" HAVE_UNISTD_H)
CHECK_INCLUDE_FILE("sys/resource.h" HAVE_SYS_RESOURCE_H)
CHECK_INCLUDE_FILE("sys/time.h" HAVE_SYS_TIME_H)
CHECK_INCLUDE_FILE("sys/times.h" HAVE_SYS_TIMES_H)
CHECK_INCLUDE_FILE("sys/types.h" HAVE_SYS_TYPES_H)
-CHECK_INCLUDE_FILE("unistd.h" HAVE_UNISTD_H)
#
#include <deal.II/base/job_identifier.h>
#include <ctime>
-#ifdef HAVE_GETHOSTNAME
+#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
time_t t = std::time(0);
id = std::string("JobId ");
-#if defined(HAVE_GETHOSTNAME) && !defined(DEAL_II_BROKEN_GETHOSTNAME) && !defined(DEBUG)
+#if defined(HAVE_UNISTD_H) && defined(HAVE_GETHOSTNAME)
char name[100];
gethostname(name,99);
id += std::string(name) + std::string(" ");
{
prefixes.push("DEAL:");
std_out->setf(std::ios::showpoint | std::ios::left);
-#if defined(HAVE_TIMES) && defined(HAVE_UNISTD_H)
+#if defined(HAVE_UNISTD_H) && defined(HAVE_TIMES)
reference_time_val = 1./sysconf(_SC_CLK_TCK) * times(&reference_tms);
#endif
}
LogStream::timestamp ()
{
struct tms current_tms;
-#if defined(HAVE_TIMES) && defined(HAVE_UNISTD_H)
+#if defined(HAVE_UNISTD_H) && defined(HAVE_TIMES)
const clock_t tick = sysconf(_SC_CLK_TCK);
const double time = 1./tick * times(¤t_tms);
#else
{
#ifdef SYS_gettid
const pid_t this_id = syscall(SYS_gettid);
-#elif defined(HAVE_GETPID)
+#elif defined(HAVE_UNISTD_H) && defined(HAVE_GETPID)
const pid_t this_id = getpid();
#else
const unsigned int this_id = 0;
In the beginning the Universe was created. This has made a lot of
people very angry and has been widely regarded as a bad move.
Douglas Adams