diff options
author | Simon Marlow <marlowsd@gmail.com> | 2013-01-23 09:17:11 +0000 |
---|---|---|
committer | Simon Marlow <marlowsd@gmail.com> | 2013-01-23 09:33:14 +0000 |
commit | 94e6d7db907c7f08d3c841c477678387f02c566d (patch) | |
tree | 564f8e2848decf2e3d99ea5f5b940782c12607ee /libraries/base/cbits/sysconf.c | |
parent | c0d723ec700a4211fb9ab4e8585dbc08a816611d (diff) | |
download | haskell-94e6d7db907c7f08d3c841c477678387f02c566d.tar.gz |
Removes the assumption that CLK_TCK is a constant (#7519)
(which is not true on QNXNTO).
Submitted by: Stephen Paul Weber <singpolyma@singpolyma.net>
Diffstat (limited to 'libraries/base/cbits/sysconf.c')
-rw-r--r-- | libraries/base/cbits/sysconf.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/libraries/base/cbits/sysconf.c b/libraries/base/cbits/sysconf.c new file mode 100644 index 0000000000..bbf785326a --- /dev/null +++ b/libraries/base/cbits/sysconf.c @@ -0,0 +1,19 @@ +#include "HsBaseConfig.h" + +/* For _SC_CLK_TCK */ +#if HAVE_UNISTD_H +#include <unistd.h> +#endif + +/* for CLK_TCK */ +#if HAVE_TIME_H +#include <time.h> +#endif + +long clk_tck(void) { +#if defined(CLK_TCK) + return (CLK_TCK); +#else + return sysconf(_SC_CLK_TCK); +#endif +} |