From: Saurabh De Date: Tue, 9 Oct 2012 20:46:24 +0000 (-0600) Subject: solaris: fix compile error on ctime_r() X-Git-Tag: fio-2.0.10~7 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=45054cbec0e624de3b79a795d7dfe1c64cdea934;p=fio.git solaris: fix compile error on ctime_r() On Solaris, it takes a 3rd length argument. Signed-off-by: Jens Axboe --- diff --git a/os/os-solaris.h b/os/os-solaris.h index d97643d0..e7a544e1 100644 --- a/os/os-solaris.h +++ b/os/os-solaris.h @@ -49,6 +49,9 @@ struct solaris_rand_seed { #define POSIX_MADV_RANDOM MADV_RANDOM #endif +#define os_ctime_r(x, y, z) ctime_r((x), (y), (z)) +#define FIO_OS_HAS_CTIME_R + typedef psetid_t os_cpu_mask_t; typedef struct solaris_rand_seed os_random_state_t; diff --git a/os/os.h b/os/os.h index 8d2a6ae8..c6da0c3d 100644 --- a/os/os.h +++ b/os/os.h @@ -142,6 +142,10 @@ typedef unsigned long os_cpu_mask_t; typedef socklen_t fio_socklen_t; #endif +#ifndef FIO_OS_HAS_CTIME_R +#define os_ctime_r(x, y, z) ctime_r((x), (y)) +#endif + #ifdef FIO_USE_GENERIC_SWAP static inline uint16_t fio_swap16(uint16_t val) { diff --git a/stat.c b/stat.c index 26659526..d041ef3c 100644 --- a/stat.c +++ b/stat.c @@ -534,7 +534,7 @@ void show_thread_status(struct thread_stat *ts, struct group_run_stats *rs) return; time(&time_p); - ctime_r((const time_t *) &time_p, time_buf); + os_ctime_r((const time_t *) &time_p, time_buf, sizeof(time_buf)); if (!ts->error) { log_info("%s: (groupid=%d, jobs=%d): err=%2d: pid=%d: %s",