All Forums |
Register |
Login |
Search |
Subscriptions |
My Profile |
Inbox |
Tool Warehouse |
FAQs |
Resources |
Help |
Member List |
Address Book |
Logout |
|
|
sigvec
|
Logged in as: Guest |
Users viewing this topic: none |
|
Login  |
|
|
sigvec - Feb. 16, '05, 10:26:15 PM
|
|
|
yoldas
Posts: 5
Status: offline
|
My existing codes uses signal trapping.
#include <signal.h>
void broken_pipe_fnc() {/* handle it*/}
struct sigvec sv;
sv.sv_handler = broken_pipe_fnc;
sv.sv_mask = sigmask(SIGPIPE);
sv.sv_flags = 0;
if(sigvec(SIGPIPE, &vec, (struct sigvec *) NULL) == -1)
// error in handler assignment
error: storage size of sv isn't known.
I looked at signal.h, and then compiled with _ALL_SOURCE macro:
error: structure has no member named 'sv_handler'
error: structure has no member named 'sv_mask'
error: structure has no member named 'sv_flags'
Looking at signal.h I see that the same code for struct sigaction is duplicated except for the name of the structure but members of sigvec are still sigaction members. Why keep it in this way? So, there is no sigvec, then I have to change my codes to sigaction, bad.
|
|
|
RE: sigvec - Feb. 17, '05, 2:37:41 AM
|
|
|
markfunk
Posts: 670
Joined: Mar. 31, '03,
Status: offline
|
sigvec() is provided for compat with old BSD code.
sigvec() is obsolete.
But note SV_INTERRUPT is not supported, so Interix sigvec()
is not fully compat.
On Interix, sigaction() is used to implement sigvec().
It is a 1:1 mapping.
I don't remember why I used sa_* members instead of sv_* members.
Possible workarounds:
1) change your code to use sigaction(). So now it's portable.
2) Add to your code
#define sigvec(a,b,c) sigaction(a,b,c)
or
3) Add to your code
#define sv_mask sa_mask
#define sv_handler sa_handler
#define sv_flags sa_flags
or
|
|
|
New Messages |
No New Messages |
Hot Topic w/ New Messages |
Hot Topic w/o New Messages |
|
Locked w/ New Messages |
Locked w/o New Messages |
|
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts |
|
|
|