Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!samsung!gem.mps.ohio-state.edu!apple!mips!sony.com!dce From: dce@sony.com (David Elliott) Newsgroups: comp.unix.wizards Subject: Re: Indirect system call Message-ID: <1989Nov9.051446.21295@sony.com> Date: 9 Nov 89 05:14:46 GMT References: <28945@shemp.CS.UCLA.EDU> Reply-To: dce@icky.Sony.COM (David Elliott) Organization: Sony Microsystems Corp. Lines: 35 In article <28945@shemp.CS.UCLA.EDU> dieter@lynn.cs.ucla.edu (Dieter Rothmeier) writes: >While browsing through section 2 of the Unix manual, >I came upon the concept of an indirect system call, >as in syscall(2). Now that puzzled me. What might be >the use for such a facility? 1. You're adding a system call to the kernel and you want to be able to test it without having to make a new libc. 2. You're modifying a common system call and you want to be able to test it without other software (i.e., ls, cat, your editor) possibly crashing. 3. You want to be able to print out the arguments to a certain system call or set of calls without having to mess around with macros. (This is a lame one, but it has happened). 4. You have a set of object files or a library but no source, and you have found a bug that you can work around if you can wrap one or more system calls with special-case code. (I actually had to do this once with a package that used curses. I couldn't rebuild the library for some reason, but screen redraw and shell escapes were broken, so I made a shell for read() that called syscall(READ) and then handled ^L and ! specially.) Now, none of these are really that big a deal, and, as has been said here before, a system doesn't need this mechanism to be useable. On the other hand, many people would assume that a system without adb or sdb but with an improved dbx would be acceptable, but checkoff items being what they are... -- David Elliott dce@sony.com | ...!{uunet,mips}!sonyusa!dce (408)944-4073 "You can lead a robot to water, but you can not make him compute."