From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,8e4e155f3d2dcd05,start X-Google-Attributes: gidfee84,public X-Google-ArrivalTime: 1993-07-12 00:03:21 PST Newsgroups: comp.unix.osf.osf1 Path: gmd.de!xlink.net!howland.reston.ans.net!darwin.sura.net!udel!rochester!cantaloupe.srv.cs.cmu.edu!crabapple.srv.cs.cmu.edu!dlc From: dlc+@cs.cmu.edu (Daryl Clevenger) Subject: Bad system calls and SIGSYS Message-ID: Sender: news@cs.cmu.edu (Usenet News System) Nntp-Posting-Host: dlc.fac.cs.cmu.edu Organization: School of Computer Science, Carnegie Mellon Date: Mon, 12 Jul 1993 06:48:53 GMT 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 #include #include #define SYS_call_53 53 SYSCALL(call_53) RET .end call_53 x.c: #include #include #include 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 #include #include 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); }