Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #3328 - vincentisambart:apple-additional-decls, r=JohnT…
…itor Add a few declarations for Apple systems I added the following definitions for Apple systems: <del> - `_POSIX_SPAWN_DISABLE_ASLR` - It is a private flag for `posix_spawnattr_setflags` that disables [ASLR](https://en.wikipedia.org/wiki/Address_space_layout_randomization) for the child process. - It is mainly used by debuggers. Its declaration in LLDB's source code: https://github.com/llvm/llvm-project/blob/2051a4121957a4bfc015b5102d06ffd6d0852d33/lldb/tools/debugserver/source/MacOSX/MachProcess.mm#L507-L509 - `pthread_chdir_np` and `pthread_fchdir_np` - Private functions that change the working directory only for the current thread. - They are declared and documented in Apple's libpthread: https://github.com/apple-oss-distributions/libpthread/blob/67e155c94093be9a204b69637d198eceff2c7c46/private/pthread/private.h#L44-L89 - They are for example used by Chromium in [this file](https://chromium.googlesource.com/chromium/src/base/+/master/process/launch_mac.cc). - LLDB also uses the [equivalent](https://github.com/apple-oss-distributions/libpthread/blob/main/src/pthread_cwd.c) `__pthread_chdir` and `__pthread_fchdir` in [this file](https://github.com/llvm/llvm-project/blob/main/lldb/source/Host/macosx/objcxx/Host.mm). </del> - `posix_spawnattr_getbinpref_np` and `posix_spawnattr_setbinpref_np` - These methods are public and declared in `/usr/include/spawn.h`. - They are pretty close to the already present `posix_spawnattr_getarchpref_np` and `posix_spawnattr_setarchpref_np`, but you can see that in [this file](https://github.com/llvm/llvm-project/blob/main/lldb/source/Host/macosx/objcxx/Host.mm) LLDB does use both `binpref` and `archpref`.
- Loading branch information