From owner-svn-src-user@FreeBSD.ORG Sun May 5 18:18:59 2013 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 543141BB; Sun, 5 May 2013 18:18:59 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 460E885F; Sun, 5 May 2013 18:18:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r45IIxr7092423; Sun, 5 May 2013 18:18:59 GMT (envelope-from dchagin@svn.freebsd.org) Received: (from dchagin@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r45IIxRg092422; Sun, 5 May 2013 18:18:59 GMT (envelope-from dchagin@svn.freebsd.org) Message-Id: <201305051818.r45IIxRg092422@svn.freebsd.org> From: Dmitry Chagin Date: Sun, 5 May 2013 18:18:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r250284 - user/dchagin/lemul/sys/compat/linux X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 May 2013 18:18:59 -0000 Author: dchagin Date: Sun May 5 18:18:58 2013 New Revision: 250284 URL: http://svnweb.freebsd.org/changeset/base/250284 Log: Glibc was switched to the FUTEX_WAIT_BITSET op and CLOCK_REALTIME flag has been added instead of FUTEX_WAIT to replace the FUTEX_WAIT logic which needs to do gettimeofday() calls before and after the futex syscall to convert the absolute timeout to a relative timeout. Before this the CLOCK_MONOTONIC used by the FUTEX_WAIT_BITSET op. Properly calculate the timeout for the CLOCK_MONOTONIC case. Modified: user/dchagin/lemul/sys/compat/linux/linux_futex.c Modified: user/dchagin/lemul/sys/compat/linux/linux_futex.c ============================================================================== --- user/dchagin/lemul/sys/compat/linux/linux_futex.c Sun May 5 18:08:30 2013 (r250283) +++ user/dchagin/lemul/sys/compat/linux/linux_futex.c Sun May 5 18:18:58 2013 (r250284) @@ -753,6 +753,9 @@ linux_sys_futex(struct thread *td, struc if (clockrt) { microtime(&ctv); timevalsub(&utv, &ctv); + } else if (args->op == LINUX_FUTEX_WAIT_BITSET) { + microuptime(&ctv); + timevalsub(&utv, &ctv); } if (utv.tv_sec < 0) timevalclear(&utv);