From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/7572 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: [PATCH] fix futimes(fd, 0) Date: Wed, 6 May 2015 19:19:01 -0400 Message-ID: <20150506231901.GO17573@brightrain.aerifal.cx> References: <20150506221028.GA29076@euler> <20150506225518.GB29035@port70.net> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1430954358 2703 80.91.229.3 (6 May 2015 23:19:18 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 6 May 2015 23:19:18 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-7585-gllmg-musl=m.gmane.org@lists.openwall.com Thu May 07 01:19:18 2015 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 1Yq8ay-0003Dm-5f for gllmg-musl@m.gmane.org; Thu, 07 May 2015 01:19:16 +0200 Original-Received: (qmail 32443 invoked by uid 550); 6 May 2015 23:19:14 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 32422 invoked from network); 6 May 2015 23:19:14 -0000 Content-Disposition: inline In-Reply-To: <20150506225518.GB29035@port70.net> User-Agent: Mutt/1.5.21 (2010-09-15) Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:7572 Archived-At: On Thu, May 07, 2015 at 12:55:19AM +0200, Szabolcs Nagy wrote: > * Felix Janda [2015-05-07 00:10:28 +0200]: > > Pass on 0 to futimens without trying to dereference it. > > is there a reason to accept 0 argument? > > there are other cases when the libc has to do fixups > to the passed arguments and it dereferences the pointer > which should be valid Yes, see the man page: http://man7.org/linux/man-pages/man3/futimes.3.html It defers to utimes for the actual behavior, which is a standard (albeit deprecated) function, and has specified behavior for the null pointer case. Rich