* Bad system calls and SIGSYS
@ 1993-07-12 6:48 Daryl Clevenger
0 siblings, 0 replies; only message in thread
From: Daryl Clevenger @ 1993-07-12 6:48 UTC (permalink / raw)
Hardware: DEC 3000/400
Software: DEC OSF/1 V1.2 (Rev. 10); Mon Jul 12 00:34:40 EDT 1993
I have stumbled across an oddity which I can not explain.
Let's say you perform some system call which is not implemented. Furthermore,
before the call to the unimplemented system call you call
"signal(SIGSYS, SIG_IGN)".
My experience has always been this is the "standard" way (I don't have my
POSIX spec handy so don't know what they have to say) to test to see if
some system call is available. System call returns -1 and errno is set
to EINVAL.
On the Dec Alpha OSF/1 implementation, this has no effect. Instead, the
process receives a SIGTRAP and drops core. If you ignore SIGTRAP and SIGSYS,
then things work as expected. System call returns -1 and errno is EINVAL.
Can anyone shed any light on this? Is this a bug in the OSF/1 implementation,
or am I just confused?
I will include files to demonstrate at the end of this message.
Daryl Clevenger
CMU SCS Facilities Staff
dlc@cs.cmu.edu
------------------------------------------------------------------------
% as -o s.o s.s
% cc -g -o x x.c s.o
% cc -g -o y y.c s.o
% ./x
Trace/BPT trap (core dumped)
% ./y
syscall #53: Invalid argument
%
s.s:
#include <alpha/regdef.h>
#include <alpha/asm.h>
#include <syscall.h>
#define SYS_call_53 53
SYSCALL(call_53)
RET
.end call_53
x.c:
#include <sys/types.h>
#include <signal.h>
#include <stdio.h>
main()
{
signal(SIGSYS, SIG_IGN);
/* 53 is not used see /usr/include/syscall.h */
if (call_53() < 0) {
perror("syscall #53");
}
exit(0);
}
y.c:
#include <sys/types.h>
#include <signal.h>
#include <stdio.h>
main()
{
signal(SIGTRAP, SIG_IGN);
signal(SIGSYS, SIG_IGN);
/* 53 is not used see /usr/include/syscall.h */
if (call_53() < 0) {
perror("syscall #53");
}
exit(0);
}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~1993-07-12 6:48 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1993-07-12 6:48 Bad system calls and SIGSYS Daryl Clevenger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox