# define LP_POISON ((void *)(long)0x5a5a5a5a)
#endif
-#if (defined(__x86_64__) && defined(__KERNEL__))
+/* this is a bit chunky */
+
+#if defined(__KERNEL__)
+ #define _LWORDSIZE BITS_PER_LONG
+#else
+ #define _LWORDSIZE __WORDSIZE
+#endif
+
+#if (defined(__x86_64__) && (defined(__KERNEL__) || defined(CRAY_XT3)))
/* x86_64 defines __u64 as "long" in userspace, but "long long" in the kernel */
# define LPU64 "%Lu"
# define LPD64 "%Ld"
# define LPF64 "L"
# define LPSZ "%lu"
# define LPSSZ "%ld"
-#elif (BITS_PER_LONG == 32 || __WORDSIZE == 32)
+#elif (_LWORDSIZE == 32)
# define LPU64 "%Lu"
# define LPD64 "%Ld"
# define LPX64 "%#Lx"
# define LPF64 "L"
# define LPSZ "%u"
# define LPSSZ "%d"
-#elif (BITS_PER_LONG == 64 || __WORDSIZE == 64)
+#elif (_LWORDSIZE == 64)
# define LPU64 "%lu"
# define LPD64 "%ld"
# define LPX64 "%#lx"
# error "No word size defined"
#endif
+#undef _LWORDSIZE
+
#endif
static inline void cfs_duration_usec(cfs_duration_t d, struct timeval *s)
{
#if (BITS_PER_LONG == 32) && (HZ > 4096)
- uint64_t t;
+ __u64 t;
s->tv_sec = d / HZ;
t = (d - (cfs_duration_t)s->tv_sec * HZ) * ONE_MILLION;
static inline void cfs_duration_nsec(cfs_duration_t d, struct timespec *s)
{
#if (BITS_PER_LONG == 32)
- uint64_t t;
+ __u64 t;
s->tv_sec = d / HZ;
t = (d - s->tv_sec * HZ) * ONE_BILLION;
}
buffer[n] = 0;
- n = sscanf (buffer, "%u %u %u %u %u %u %u %Lu %Lu %Lu %Lu",
+ n = sscanf (buffer, "%lu %lu %lu %lu %lu %lu %lu %Lu %Lu %Lu %Lu",
&new_counter.msgs_alloc, &new_counter.msgs_max,
&new_counter.errors,
&new_counter.send_count, &new_counter.recv_count,
-#!/bin/sh
+#!/bin/bash
LC_COLLATE="C"
progname="${0##*/}"