From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/1004 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: bug? sysinfo() and getopt_long() misbehavior Date: Fri, 8 Jun 2012 10:12:39 -0400 Message-ID: <20120608141239.GK163@brightrain.aerifal.cx> References: <20120608005148.7d82c40b@sibserver.ru> <20120608031243.GG163@brightrain.aerifal.cx> <20120608132731.042df3b2@sibserver.ru> <20120608201206.009e6c7d@sibserver.ru> 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: dough.gmane.org 1339165040 24835 80.91.229.3 (8 Jun 2012 14:17:20 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 8 Jun 2012 14:17:20 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-1005-gllmg-musl=m.gmane.org@lists.openwall.com Fri Jun 08 16:17:19 2012 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 1Sd003-0005DJ-CS for gllmg-musl@plane.gmane.org; Fri, 08 Jun 2012 16:17:15 +0200 Original-Received: (qmail 9339 invoked by uid 550); 8 Jun 2012 14:17:15 -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 9327 invoked from network); 8 Jun 2012 14:17:15 -0000 Content-Disposition: inline In-Reply-To: <20120608201206.009e6c7d@sibserver.ru> User-Agent: Mutt/1.5.21 (2010-09-15) Xref: news.gmane.org gmane.linux.lib.musl.general:1004 Archived-At: On Fri, Jun 08, 2012 at 08:12:06PM +0800, orc wrote: > > Binutils 2.20, musl compiled with -Bsymbolic-functions. But statically > > or dynamically linked iptables still rejects to accept arguments. > > It required ugly fix to work, mostly same as iproute2, removing some > > non-conformant extensions, correct headers, maybe there is a fault. It > > also expects somewhere that we have glibc (#ifdef __GLIBC__) headers. > > Maybe it's code is non-conformant in whole. I will try to see where it > > fails on host. > Iptables fails because it sets optind to zero and getopt_long > immidately returns with -1 in the first line (argv[0][0] != > '-'). But problem does not fixed with just removing 'optind = 0;' from > source code. > For what reason one can set optind to zero? I believe it's a common but non-portable way of restarting option scanning. Of course that would make no sense if this is the first scan of options anyway. I'll try to look into what's going wrong here.. Rich