-/* Copyright (C) 1996 Free Software Foundation, Inc.
+/* Copyright (C) 1996, 1998 Free Software Foundation, Inc.
This file is part of GNU Fortran libU77 library.
This library is free software; you can redistribute it and/or modify it
# include <time.h>
# endif
#endif
-#include <sys/times.h>
+#if HAVE_SYS_TIMES_H
+# include <sys/times.h>
+#endif
#include <limits.h>
#if HAVE_UNISTD_H
# include <unistd.h>
#endif
+#include <errno.h> /* for ENOSYS */
#include "f2c.h"
#ifdef KR_headers
int G77_system_clock_0 (integer *count, integer *count_rate, integer *count_max)
#endif
{
+#if defined (HAVE_TIMES)
struct tms buffer;
unsigned long cnt;
if (count_rate) {
*count_rate = CLOCKS_PER_SECOND;
#elif defined CLK_TCK
*count_rate = CLK_TCK;
+#elif defined HZ
+ *count_rate = HZ;
#else
#error Dont know clock tick length
#endif
else
*count = cnt;
return 0;
+#else /* ! HAVE_TIMES */
+ errno = ENOSYS;
+ return -1;
+#endif /* ! HAVE_TIMES */
}