sigaction seems to return new action as old action
Created by: egrimley
This seems to happen on all architectures. Test program:
#include <signal.h>
#include <stdio.h>
#include <string.h>
int main()
{
struct sigaction act, oldact;
memset(&act, 0, sizeof(act));
memset(&oldact, 0, sizeof(act));
act.sa_handler = (void *)0x1001;
sigaction(28, &act, &oldact);
printf("%p\n", oldact.sa_handler);
act.sa_handler = (void *)0x1002;
sigaction(28, &act, &oldact);
printf("%p\n", oldact.sa_handler);
act.sa_handler = (void *)0x1003;
sigaction(28, &act, &oldact);
printf("%p\n", oldact.sa_handler);
return 0;
}
Output running natively:
(nil)
0x1001
0x1002
Output running under DynamoRIO:
0x1001
0x1002
0x1003