Commit f367fa2
committed
Auto merge of #3328 - vincentisambart:apple-additional-decls, r=JohnTitor
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`.2 files changed
+20
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2084 | 2084 | | |
2085 | 2085 | | |
2086 | 2086 | | |
| 2087 | + | |
| 2088 | + | |
2087 | 2089 | | |
2088 | 2090 | | |
2089 | 2091 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4998 | 4998 | | |
4999 | 4999 | | |
5000 | 5000 | | |
5001 | | - | |
5002 | | - | |
5003 | | - | |
5004 | | - | |
5005 | | - | |
5006 | | - | |
| 5001 | + | |
| 5002 | + | |
| 5003 | + | |
| 5004 | + | |
| 5005 | + | |
| 5006 | + | |
5007 | 5007 | | |
5008 | 5008 | | |
5009 | 5009 | | |
| |||
6058 | 6058 | | |
6059 | 6059 | | |
6060 | 6060 | | |
| 6061 | + | |
| 6062 | + | |
| 6063 | + | |
| 6064 | + | |
| 6065 | + | |
| 6066 | + | |
| 6067 | + | |
| 6068 | + | |
| 6069 | + | |
| 6070 | + | |
| 6071 | + | |
| 6072 | + | |
6061 | 6073 | | |
6062 | 6074 | | |
6063 | 6075 | | |
| |||
0 commit comments