From: "Daniel Cegiełka" <daniel.cegielka@gmail.com>
To: musl@lists.openwall.com
Subject: Re: Re: Removing sbrk and brk
Date: Fri, 21 Feb 2014 17:03:36 +0100 [thread overview]
Message-ID: <CAPLrYEQ-McrP2USf46QzthwLq2oFa9yUURa+tv82PkrQ=jVG=g@mail.gmail.com> (raw)
In-Reply-To: <20140107220053.GG24286@brightrain.aerifal.cx>
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
next prev parent reply other threads:[~2014-02-21 16:03 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-21 23:40 Rich Felker
2013-12-22 2:15 ` Luca Barbato
2013-12-22 17:58 ` Richard Pennington
2013-12-22 18:21 ` Luca Barbato
2013-12-22 18:48 ` Szabolcs Nagy
2013-12-22 21:55 ` Christian Neukirchen
2013-12-23 4:46 ` Rich Felker
2014-01-02 22:03 ` Rich Felker
2014-01-03 11:51 ` Thorsten Glaser
2014-01-03 12:59 ` Daniel Cegiełka
2014-01-03 17:33 ` Rich Felker
2014-01-03 18:19 ` Rich Felker
2014-01-03 19:03 ` Rich Felker
2014-01-06 14:51 ` Thorsten Glaser
2014-01-06 22:40 ` Rich Felker
2014-01-07 9:43 ` Thorsten Glaser
2014-01-07 16:06 ` Rich Felker
2014-01-07 22:00 ` Rich Felker
2014-02-21 16:03 ` Daniel Cegiełka [this message]
2014-02-21 16:36 ` Szabolcs Nagy
2014-02-21 16:47 ` Daniel Cegiełka
2014-02-21 17:09 ` Rich Felker
2014-02-21 22:34 ` Daniel Cegiełka
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAPLrYEQ-McrP2USf46QzthwLq2oFa9yUURa+tv82PkrQ=jVG=g@mail.gmail.com' \
--to=daniel.cegielka@gmail.com \
--cc=musl@lists.openwall.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/musl/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).