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

Fix POSIX signal(3) binding's type signature; remove bsd_signal #24400

Open
wants to merge 2 commits into
base: devel
Choose a base branch
from

Conversation

bptato
Copy link
Contributor

@bptato bptato commented Nov 1, 2024

POSIX signal has an identical definition to ISO C signal: https://pubs.opengroup.org/onlinepubs/9799919799/functions/signal.html

void (*signal(int sig, void (*func)(int)))(int);

/* more readably restated by glibc as */
typedef void (*sighandler_t)(int);

sighandler_t signal(int signum, sighandler_t handler);

However, std/posix had omitted the function's return value; this fixes that.

To prevent breaking every single line of code ever that touched this binding (including mine...), I've also made it discardable.

Additionally, I have noticed that bsd_signal's type signature is wrong - it should have been identical to signal. But bsd_signal was already removed in POSIX 2008, and sigaction is the recommended, portable POSIX signal interface. So I just deleted the bsd_signal binding.

bptato and others added 2 commits November 1, 2024 23:29
POSIX signal has an identical definition to ISO C signal:
https://pubs.opengroup.org/onlinepubs/9799919799/functions/signal.html

```c
void (*signal(int sig, void (*func)(int)))(int);

/* more readably restated by glibc as */
typedef void (*sighandler_t)(int);

sighandler_t signal(int signum, sighandler_t handler);
```

However, std/posix had omitted the function's return value; this fixes
that.

To prevent breaking every single line of code ever that touched this
binding (including mine...), I've also made it discardable.

Additionally, I have noticed that bsd_signal's type signature is wrong
- it should have been identical to signal. But bsd_signal was already
removed in POSIX 2008, and sigaction is the recommended, portable POSIX
signal interface. So I just deleted the bsd_signal binding.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants