git: libc - Use sbrk() system call, remove brk() (2)

Matthew Dillon dillon at crater.dragonflybsd.org
Tue Feb 19 09:37:19 PST 2019


commit dc676eaefa61b0f47bbea1c53eab86fd5ccd78c6
Author: Matthew Dillon <dillon at apollo.backplane.com>
Date:   Tue Feb 19 09:34:28 2019 -0800

    libc - Use sbrk() system call, remove brk() (2)
    
    * Change the initial TLS allocation to use mmap() instead of sbrk()
      in order to maintain compatibility with older kernels.
    
    * Using sbrk() will work with a fully updated system, but will not
      work with an old kernel because it returns an error and sets errno,
      but setting errno requires the TLS to already be installed.  So
      even though we have back-off code in libc, it seg-faults before
      it gets to it.
    
    * Only affects a few programs in base such as 'chflags' so not a
      disaster.  But still, the intent was to maintain compatibility
      with older kernels.

Summary of changes:
 lib/libc/gen/tls.c | 21 ++++++++++++++++-----
 1 file changed, 16 insertions(+), 5 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/dc676eaefa61b0f47bbea1c53eab86fd5ccd78c6


-- 
DragonFly BSD source repository


More information about the Commits mailing list