From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/9202 Path: news.gmane.org!not-for-mail From: Hauke Mehrtens Newsgroups: gmane.linux.lib.musl.general Subject: Re: [PATCH v2] mips: add vdso support Date: Tue, 26 Jan 2016 19:17:53 +0100 Message-ID: <56A7B851.80907@hauke-m.de> References: <1453762812-3187-1-git-send-email-hauke@hauke-m.de> <20160125232118.GD238@brightrain.aerifal.cx> <20160126153216.GA3074@debian> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1453832291 25064 80.91.229.3 (26 Jan 2016 18:18:11 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 26 Jan 2016 18:18:11 +0000 (UTC) Cc: nullplan@gmx.net To: musl@lists.openwall.com Original-X-From: musl-return-9215-gllmg-musl=m.gmane.org@lists.openwall.com Tue Jan 26 19:18:10 2016 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1aO8Bu-0002AD-0i for gllmg-musl@m.gmane.org; Tue, 26 Jan 2016 19:18:10 +0100 Original-Received: (qmail 22055 invoked by uid 550); 26 Jan 2016 18:18:06 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 22037 invoked from network); 26 Jan 2016 18:18:06 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Icedove/38.5.0 In-Reply-To: <20160126153216.GA3074@debian> X-Spam-Status: No, score=-1.0 required=7.0 tests=ALL_TRUSTED,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on hauke-m.de Xref: news.gmane.org gmane.linux.lib.musl.general:9202 Archived-At: On 01/26/2016 04:32 PM, Markus Wichmann wrote: > On Mon, Jan 25, 2016 at 06:21:18PM -0500, Rich Felker wrote: >> This could probably be written better as: >> >> if (ret != -ENOSYS) return ret; >> #endif >> return sc_clock_gettime(clk, ts); >> > > And one additional idea: If the kernel did return ENOSYS, set cgt to > sc_clock_gettime. Because if the kernel returned ENOSYS, we can assume > this is a permanent failure and not a temporary one, so there's no point > in keeping to try the VDSO version. It is not permanently, but it depends on the input parameters, see this code: http://lxr.free-electrons.com/source/arch/mips/vdso/gettimeofday.c?v=4.4#L207 It only returns -ENOSYS if it can not handle requested clkid. > >> i.e. reject any error but EINVAL from the vdso and try the syscall, >> since EINVAL is the only one that should be possible. >> > > clock_gettime() takes a pointer argument, so EFAULT is always possible. > > Ciao, > Markus >