From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/3670 Path: news.gmane.org!not-for-mail From: Szabolcs Nagy Newsgroups: gmane.linux.lib.musl.general Subject: Re: time code progress Date: Wed, 17 Jul 2013 15:19:49 +0200 Message-ID: <20130717131948.GU15323@port70.net> References: <20130716194553.GA9438@brightrain.aerifal.cx> <20130717093325.GA12469@brightrain.aerifal.cx> <20130717113906.GT15323@port70.net> <1374062978.20259.243.camel@eris.loria.fr> 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 1374067200 27143 80.91.229.3 (17 Jul 2013 13:20:00 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 17 Jul 2013 13:20:00 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-3674-gllmg-musl=m.gmane.org@lists.openwall.com Wed Jul 17 15:20:02 2013 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1UzReD-0000Ep-V8 for gllmg-musl@plane.gmane.org; Wed, 17 Jul 2013 15:20:02 +0200 Original-Received: (qmail 9574 invoked by uid 550); 17 Jul 2013 13:20:01 -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 9566 invoked from network); 17 Jul 2013 13:20:01 -0000 Content-Disposition: inline In-Reply-To: <1374062978.20259.243.camel@eris.loria.fr> User-Agent: Mutt/1.5.21 (2010-09-15) Xref: news.gmane.org gmane.linux.lib.musl.general:3670 Archived-At: * Jens Gustedt [2013-07-17 14:09:38 +0200]: > Am Mittwoch, den 17.07.2013, 13:39 +0200 schrieb Szabolcs Nagy: > > (i think it did not like the syscall arg counting in case of 0 args in > > #define __SYSCALL_NARGS_X(a,b,c,d,e,f,g,h,n,...) n > > #define __SYSCALL_NARGS(...) __SYSCALL_NARGS_X(__VA_ARGS__,7,6,5,4,3,2,1,0) > > ) > > yes, this is in fact not suitable to test for 0 args. For the > preprocessor 0 args basically doesn't exist, there is always one > argument, but which is empty. > note that the problem is not that __VA_ARGS__ is empty (it's not, contrary to what i might implied), but that if n becomes 0 (== __VA_ARGS__ expands to one argument), then there is no more arguments in the __SYSCALL_NARGS_X call to substitute for '...', so a simple fix would be #define __SYSCALL_NARGS(...) __SYSCALL_NARGS_X(__VA_ARGS__,7,6,5,4,3,2,1,0, tralala) but i'm not sure if this should be fixed (this is internal code and i think there are no 0 argument syscalls) i just wanted to record how i found the close without fd issue (which shows that some kind of type checking for syscall arguments would help libc hacking.. but that's non-trivial to do)