head 1.2; access; symbols pkgsrc-2013Q2:1.2.0.8 pkgsrc-2013Q2-base:1.2 pkgsrc-2012Q4:1.2.0.6 pkgsrc-2012Q4-base:1.2 pkgsrc-2011Q4:1.2.0.4 pkgsrc-2011Q4-base:1.2 pkgsrc-2011Q2:1.2.0.2 pkgsrc-2011Q2-base:1.2 pkgsrc-2011Q1:1.1.1.1.0.6 pkgsrc-2011Q1-base:1.1.1.1 pkgsrc-2010Q4:1.1.1.1.0.4 pkgsrc-2010Q4-base:1.1.1.1 pkgsrc-2010Q3:1.1.1.1.0.2 pkgsrc-2010Q3-base:1.1.1.1 pkgsrc-base:1.1.1.1 TNF:1.1.1; locks; strict; comment @# @; 1.2 date 2011.04.18.16.19.48; author manu; state dead; branches; next 1.1; 1.1 date 2010.08.26.14.26.19; author manu; state Exp; branches 1.1.1.1; next ; 1.1.1.1 date 2010.08.26.14.26.19; author manu; state Exp; branches; next ; desc @@ 1.2 log @Update glusterfs to 3.1.4. Major new features according to http://www.gluster.org/ - Elastic Volume Management - New Gluster Console Manager - Dynamic Storage for the data center and cloud @ text @$NetBSD: patch-aq,v 1.1 2010/08/26 14:26:19 manu Exp $ Emulate missing sem_timedwait(3) on NetBSD --- xlators/performance/io-threads/src/io-threads.c.orig 2010-08-23 17:49:40.000000000 +0200 +++ xlators/performance/io-threads/src/io-threads.c 2010-08-23 18:43:35.000000000 +0200 @@@@ -32,8 +32,36 @@@@ #include #include #include "locking.h" +#ifdef __NetBSD__ +static inline int sem_timedwait(sem_t *sem, struct timespec *ts) { + struct timespec onems = { 0, 1000000 }; + struct timespec total = { 0, 0 }; + struct timespec unslept; + struct timespec elapsed; + struct timespec tmp; + + while (timespeccmp(ts, &total, >)) { + if (sem_trywait(sem) == 0) + return 0; + + if (errno != EAGAIN) + return -1; + + (void)nanosleep(&onems, &unslept); + + timespecsub(&onems, &unslept, &elapsed); + timespecadd(&total, &elapsed, &tmp); + total.tv_sec = tmp.tv_sec; + total.tv_nsec = tmp.tv_nsec; + } + + errno = ETIMEDOUT; + return -1; +} +#endif /* __NetBSD__ */ + typedef void *(*iot_worker_fn)(void*); void iot_stop_worker (iot_worker_t *worker); @ 1.1 log @Initial revision @ text @d1 1 a1 1 $NetBSD$ @ 1.1.1.1 log @This is an experimental port of glusterfs on NetBSD. Don't do this at home! @ text @@