Fix: Replace sighandler_t with sig_t for Apple and BSDs#5008
Open
chengr4 wants to merge 2 commits intorust-lang:mainfrom
Open
Fix: Replace sighandler_t with sig_t for Apple and BSDs#5008chengr4 wants to merge 2 commits intorust-lang:mainfrom
chengr4 wants to merge 2 commits intorust-lang:mainfrom
Conversation
Collaborator
Expected Error:
error[E0432]: unresolved import `libc::sig_t`
|
3108 | sig_t,
| ^^^^^ no `sig_t` in the root
- Result: Tests pass
- Check Apple type at local
```bash
grep -r "sig_t" /usr/include /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include 2>/dev/null
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/kern/kcdata.h: uint8_t ceri_page_codesig_tainted;
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/signal.h:typedef void (*sig_t)(int); /* type of signal function */
```
> Aarch MacOS 26.3.1
- Check Other OS from the Internet
Source:
- (Freebsd) https://github.com/freebsd/freebsd-src/blob/016570c4463d5908953355ee1cf9a385ad9601b4/sys/sys/signal.h
- (Dragonfly) https://github.com/DragonFlyBSD/DragonFlyBSD/blob/51591aff67978c86de99839e31d8c8fcc54bc316/sys/sys/signal.h
- https://www.gnu.org/software/gnulib/manual/html_node/signal_002eh.html
- The type sighandler_t (a GNU extension) is not defined on most non-glibc platforms: macOS 11.1, FreeBSD 14.0, NetBSD 10.0, OpenBSD 7.5, AIX 5.1, HP-UX 11, Solaris 11.4, Cygwin, mingw, MSVC 14.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR tries to fix #1273.
Sources
c316/sys/sys/signal.h
sighandler_t(a GNU extension) is not defined on most non-glibc platforms: macOS 11.1, FreeBSD 14.0, NetBSD 10.0, OpenBSD 7.5, AIX 5.1, HP-UX 11, Solaris 11.4, Cygwin, mingw, MSVC 14.
Checklist
libc-test/semverhave been updated*LASTor*MAXareincluded (see #3131)
cd libc-test && cargo test --target mytarget);especially relevant for platforms that may not be checked in CI