Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automated pull from rust-lang/libc #79

Merged
merged 12 commits into from
Nov 2, 2023

Conversation

mbyzhang and others added 12 commits April 18, 2023 22:46
feat: add new constants from fanotify linux api

Since it's introduction in Linux and in this repo (#1699), several new features have been introduced in the fanotify API.
In the original fanotify API, only a limited set of events was supported.  In particular, there was no support for create, delete, and move events.  The support for those events was added in Linux 5.1.

This PR adds missing constants from `fanotify.h` to support the newest features.
linux: add PTRACE_GETSIGMASK and PTRACE_SETSIGMASK

linux: add PTRACE_GETSIGMASK and PTRACE_SETSIGMASK
…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`.
feat: Added ifconf struct

Adding ifconf struct

As per defined in C

```c
struct ifconf
  {
    int	ifc_len;			/* Size of buffer.  */
    union
      {
	__caddr_t ifcu_buf;
	struct ifreq *ifcu_req;
      } ifc_ifcu;
  };
```
@github-actions github-actions bot added automation Issue or PR created by an automation backport:never PR that should never be backported labels Nov 2, 2023
Copy link
Member

@tshepang tshepang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bors merge

@bors-ferrocene
Copy link
Contributor

bors-ferrocene bot commented Nov 2, 2023

Build succeeded:

  • full

@bors-ferrocene bors-ferrocene bot merged commit 9860065 into main Nov 2, 2023
2 checks passed
@bors-ferrocene bors-ferrocene bot deleted the automation/pull-subtrees/sqboqow6 branch November 2, 2023 10:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automation Issue or PR created by an automation backport:never PR that should never be backported
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants