syscall(2) function

Eduardo Krell ekrell at hector.UUCP
Tue Feb 28 10:06:47 AEST 1989


In article <3740 at ucdavis.ucdavis.edu> kerchen at iris.ucdavis.edu (Paul Kerchen) writes:

>Is the system call "syscall()" necessary?

Yes, and I'll give you an example where I use it. We have a user level
C library which implements an extension to the Unix File System.
This work was originally done inside the kernel (where it belongs), but
for practical reasons we decided to write a user level library which
emulates the semantics of our extensions (we didn't want to force our
users to run a new kernel just to play with our stuff).

This user level library contains functions for all the system calls which
take pathnames as arguments (like stat, open, link, etc.). We do some
magic with the pathnames supplied to these functions and then call the *real*
system calls with maybe different pathnames. The call to the real system
call is accomplished through syscall().

I could have done it without syscall(), but it would have required
major kludges to do it in a portable way.
    
Eduardo Krell                   AT&T Bell Laboratories, Murray Hill, NJ

UUCP: {att,decvax,ucbvax}!ulysses!ekrell  Internet: ekrell at ulysses.att.com



More information about the Comp.unix.wizards mailing list