From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/4594 Path: news.gmane.org!not-for-mail From: =?ISO-8859-2?Q?Daniel_Cegie=B3ka?= Newsgroups: gmane.linux.lib.musl.general Subject: Re: Re: Removing sbrk and brk Date: Fri, 21 Feb 2014 17:03:36 +0100 Message-ID: References: <20131223044609.GZ24286@brightrain.aerifal.cx> <20140102220302.GR24286@brightrain.aerifal.cx> <20140103173301.GU24286@brightrain.aerifal.cx> <20140103181906.GV24286@brightrain.aerifal.cx> <20140103190350.GW24286@brightrain.aerifal.cx> <20140106224036.GC24286@brightrain.aerifal.cx> <20140107160627.GD24286@brightrain.aerifal.cx> <20140107220053.GG24286@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: ger.gmane.org 1392998649 20723 80.91.229.3 (21 Feb 2014 16:04:09 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 21 Feb 2014 16:04:09 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-4598-gllmg-musl=m.gmane.org@lists.openwall.com Fri Feb 21 17:04:17 2014 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 1WGsaC-000335-53 for gllmg-musl@plane.gmane.org; Fri, 21 Feb 2014 17:04:12 +0100 Original-Received: (qmail 25884 invoked by uid 550); 21 Feb 2014 16:04:10 -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 25876 invoked from network); 21 Feb 2014 16:04:09 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=SiR1kgS+8xQUd/iKn7O+X3zy+Ll39htFgx1/BkT4HmU=; b=lvw+tBhymMDSZvHyW1Js1BaNLPIWIG4ZQeCHQFrbtg/8vZH2aXlXKy2DrLXMzGoLrP fsgiVA9mBWhpHhLCLjJZE766RhkWyI8Fxv/0m2i77/ySlJ6L5zbB6e1Zx8cI1rAl84WQ lAj5zr8OD5wDwpplo7S6wQaLBgOdo+AQHY3o6nW3u89lb1A9//yYIjWCVP9DQizksL3m yr8ceBzwSWMFlEG6u3jCnUaUrpAXfMIHF6bFXlHYVFruFBZMkQQWp00JHrw81OqJd+2Z D3g9X/I24qVyjOpUdtyhTK9FWU7Onfepj2G8w8M+6RIdAzOg8TPtSAN602J4Ag/juOtM zt/w== X-Received: by 10.229.72.133 with SMTP id m5mr11067400qcj.12.1392998637324; Fri, 21 Feb 2014 08:03:57 -0800 (PST) In-Reply-To: <20140107220053.GG24286@brightrain.aerifal.cx> Xref: news.gmane.org gmane.linux.lib.musl.general:4594 Archived-At: And what do we do with failures when sbrk is used? # grep -r sbrk /usr/bin/ Binary file /usr/bin/readelf matches Binary file /usr/bin/as matches Binary file /usr/bin/addr2line matches Binary file /usr/bin/c++filt matches Binary file /usr/bin/ld matches Binary file /usr/bin/objdump matches Binary file /usr/bin/size matches Binary file /usr/bin/ar matches Binary file /usr/bin/objcopy matches Binary file /usr/bin/elfedit matches Binary file /usr/bin/strings matches Binary file /usr/bin/ld.bfd matches Binary file /usr/bin/strip matches Binary file /usr/bin/gdb matches Binary file /usr/bin/nm matches Binary file /usr/bin/ranlib matches eg ex/vi doesn't work with new musl (git) - sbrk is used internally: http://ex-vi.cvs.sourceforge.net/viewvc/ex-vi/ex-vi/ex_subr.c?revision=1.8&view=markup 481int 482morelines(void) 483{ 484#ifdef _SC_PAGESIZE 485 static long pg; 486 487 if (pg == 0) { 488 pg = sysconf(_SC_PAGESIZE); 489 if (pg <= 0 || pg >= 65536) 490 pg = 4096; 491 pg /= sizeof (line); 492 } 493 if ((char *)sbrk(pg * sizeof (line)) == (char *)-1) 494 return (-1); 495 endcore += pg; 496 return (0); 497#else /* !_SC_PAGESIZE */ 498 if (sbrk(1024 * sizeof (line)) == (char *)-1) 499 return (-1); 500 endcore += 1024; 501 return (0); 502#endif /* !_SC_PAGESIZE */ 503} and http://ex-vi.cvs.sourceforge.net/viewvc/ex-vi/ex-vi/ex.c?revision=1.4&view=markup 532 fendcore = (line *) sbrk(0); 533 endcore = fendcore - 2; and errors (vi) didn't indicate what failing. Best regards, Daniel