Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!rutgers!umd5!decuac!felix!chuck From: chuck@felix.UUCP Newsgroups: comp.unix.ultrix Subject: Re: Ultrix 2.0 executable dumps core on 1.2 Message-ID: <13564@felix.UUCP> Date: Fri, 20-Nov-87 11:49:20 EST Article-I.D.: felix.13564 Posted: Fri Nov 20 11:49:20 1987 Date-Received: Sun, 22-Nov-87 09:26:54 EST References: <12683@felix.UUCP> Sender: chuck@felix.UUCP Reply-To: richl@penguin.USS.TEK.COM (Rick Lindsley) Organization: Tektronix, Inc., Beaverton, OR. Lines: 28 Approved: zemon@felix.UUCP Reply-Path: In article <12683@felix.UUCP> mark@applix.UUCP (Mark Fox) writes: > Two questions: > > 1) How can I *reliably* tell at runtime that I am on a pre-2.0 version of > Ultrix so that my application doesn't issue this or other "Bad system calls"? > (A compile-time check that would force me to have separate 1.2 and 2.0 > distributions of my application is not acceptable. Requiring all of my > users to upgrade to 2.0 isn't either.) It's grody, but it could be done: catch SIGSYS. That tells you (after the fact) that you just did a boo-boo. You could checkpoint with setjmp and longjmp out of your interrupt handler. For complex programs this gets tiresome, but it may work well for simple to medium strength utilities. You might also just be able to increment a flag and check it later. > 2) Will subsequent versions of Ultrix simply return an error to a > "Bad system call" or will they continue to rudely and inexcusably dump > core? Really, dumping core is a bug not a feature, isn't it? Well, it is arguable whether it is a bug or a feature. I would consider it a feature, though a useless one for most people. It did allow you to figure out which system call was bad, didn't it? As I mentioned, I think you are getting a SIGSYS and the default action for that is to dump core. You could ignore that signal ... but it doesn't solve the problem of getting the information you were hoping to get with your system call! Rick