From owner-freebsd-arch@freebsd.org Wed Feb 15 21:38:55 2017 Return-Path: Delivered-To: freebsd-arch@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3B79ECDF216 for ; Wed, 15 Feb 2017 21:38:55 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from smtp.vangyzen.net (hotblack.vangyzen.net [199.48.133.146]) by mx1.freebsd.org (Postfix) with ESMTP id 28A21855 for ; Wed, 15 Feb 2017 21:38:54 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from sweettea.beer.town (unknown [76.164.8.130]) by smtp.vangyzen.net (Postfix) with ESMTPSA id 978C4564C4 for ; Wed, 15 Feb 2017 15:38:53 -0600 (CST) To: "freebsd-arch@freebsd.org" From: Eric van Gyzen Subject: sem_timedwait3(..., ..., clockid_t) Message-ID: <1d1cb3d6-a2d2-1a3e-5d20-51206524ffbe@FreeBSD.org> Date: Wed, 15 Feb 2017 15:38:52 -0600 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Feb 2017 21:38:55 -0000 Would anyone else be interested in me adding a sem_timedwait3() function? int sem_timedwait3(sem_t *sem, const struct timespec *abs_timeout, clockid_t clock_id); The clock_id would specify the reference clock for the absolute timeout. The standard sem_timedwait() API uses CLOCK_REALTIME, which does not play nicely with large clock adjustments. I realize it would be non-standard. I also realize that there are standard APIs that should probably be used instead, such as Pthread condition variables with pthread_condattr_setclock(3). On the other hand, the diff is [currently] tiny, so I thought I would offer it. Cheers, Eric