• Keith Randall's avatar
    syscall: avoid _getdirentries64 on darwin · 9da6530f
    Keith Randall authored
    Getdirentries is implemented with the __getdirentries64 function
    in libSystem.dylib. That function works, but it's on Apple's
    can't-be-used-in-an-app-store-application list.
    
    Implement Getdirentries using the underlying fdopendir/readdir_r/closedir.
    The simulation isn't faithful, and could be slow, but it should handle
    common cases.
    
    Don't use Getdirentries in the stdlib, use fdopendir/readdir_r/closedir
    instead (via (*os.File).readdirnames).
    
    Fixes #30933
    
    Update #28984
    
    RELNOTE=yes
    
    Change-Id: Ia6b5d003e5bfe43ba54b1e1d9cfa792cc6511717
    Reviewed-on: https://go-review.googlesource.com/c/go/+/168479Reviewed-by: 's avatarEmmanuel Odeke <emm.odeke@gmail.com>
    Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
    Run-TryBot: Emmanuel Odeke <emm.odeke@gmail.com>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    9da6530f