From: dlc+@cs.cmu.edu (Daryl Clevenger)
Subject: Bad system calls and SIGSYS
Date: Mon, 12 Jul 1993 06:48:53 GMT [thread overview]
Message-ID: <CA1HLJ.2DF.1@cs.cmu.edu> (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);
}
reply other threads:[~1993-07-12 6:48 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox