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

sig_block.c: use posix complaint functions on non glibc systems #66

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

listout
Copy link

@listout listout commented Jun 13, 2023

This build error came while building on musl /w clang-16. In contrast to glibc, musl is not having the "legacy" BSD functions and only POSIX sigprocmask.

The exact error was:

sig_block.c:15:3: error: call to undeclared function 'sigblock'; ISO C99 and later do not
      support implicit function declarations [-Wimplicit-function-declaration]
  sigblock(1 << (sig - 1));
  ^
sig_block.c:15:3: note: did you mean 'sig_block'?
sig_block.c:7:6: note: 'sig_block' declared here
void sig_block(int sig)
     ^
1 warning generated.
sig_block.c:27:3: error: call to undeclared function 'sigsetmask'; ISO C99 and later do not
      support implicit function declarations [-Wimplicit-function-declaration]
  sigsetmask(sigsetmask(~0) & ~(1 << (sig - 1)));
  ^
sig_block.c:38:3: error: call to undeclared function 'sigsetmask'; ISO C99 and later do not
      support implicit function declarations [-Wimplicit-function-declaration]
  sigsetmask(0);
  ^

This patch should fix the error

Bug: https://bugs.gentoo.org/898852

This build error came while building on musl /w clang-16.
In contrast to glibc, musl is not having the "legacy" BSD functions and only POSIX sigprocmask.

The exact error was:
sig_block.c:15:3: error: call to undeclared function 'sigblock'; ISO C99 and later do not
      support implicit function declarations [-Wimplicit-function-declaration]
  sigblock(1 << (sig - 1));
  ^
sig_block.c:15:3: note: did you mean 'sig_block'?
sig_block.c:7:6: note: 'sig_block' declared here
void sig_block(int sig)
     ^
1 warning generated.
sig_block.c:27:3: error: call to undeclared function 'sigsetmask'; ISO C99 and later do not
      support implicit function declarations [-Wimplicit-function-declaration]
  sigsetmask(sigsetmask(~0) & ~(1 << (sig - 1)));
  ^
sig_block.c:38:3: error: call to undeclared function 'sigsetmask'; ISO C99 and later do not
      support implicit function declarations [-Wimplicit-function-declaration]
  sigsetmask(0);
  ^

This patch should fix the error

Bug: https://bugs.gentoo.org/898852
Signed-off-by: Brahmajit Das <brahmajit.xyz@gmail.com>
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.

None yet

1 participant