[comp.lang.perl] syscall.pl

kayvan@mrspoc.transact.com (Kayvan Sylvan) (02/09/90)

I have seen mention of syscall.pl and surmise that it is a bunch of
definitions of system call numbers.

I am on a Xenix 2.3.2 system that does not have a syscall.h from which to
make syscall.pl. How do I go about using the syscall feature anyway??
A better question might be: How do I go about creating a syscall.pl?

			---Kayvan

| Kayvan Sylvan @ Transact Software, Inc. -*-  Los Altos, CA (415) 961-6112 |
| Internet: kayvan@{mrspoc.Transact.com, eris.berkeley.edu, net.bio.net}    |
| UUCP: ...!{apple,pyramid,bionet,mips}!mrspoc!kayvan "No space for saying" |

tchrist@convex.COM (Tom Christiansen) (02/10/90)

In article <2529@uvaarpa.virginia.edu> kayvan@mrspoc.transact.com writes:
>I am on a Xenix 2.3.2 system that does not have a syscall.h from which to
>make syscall.pl. How do I go about using the syscall feature anyway??
>A better question might be: How do I go about creating a syscall.pl?

The real question is whether your C library contains syscall(3) for
indirect system calls.  If it does, then you should be able to call 
(almost) any system call using it by passing it the index into 
the system call jump table.  This is essentially what syscall.h contains.

For systems that do have a syscall.h, you can use makelib (from the 
perl source directory) to translate /usr/include/syscall.h into (in my
case) /usr/local/lib/perl/syscall.h; note that this is not syscall.pl:
it contains functions like &SYS_setitimer which return the right value.
Your program will die of a fatal run-time error if that function doesn't
exist.  I personally prefer to further process syscall.h into syscall.pl,
which for me contains things like $SYS_setitimer which are already set
to the right values.  However, your program may mysteriously stop working
if you ship it off to a sytsem without a $SYS_setitimer, because it would
come out to be 0 in that case.

I once posted the scripts I use to massage (pound?) .h files from makelib
into .pl files in a posting to perl-users before this newsgroup was 
created.  It should be in the archives at Ohio State, but if there's
demand for it, mail me and I'll send you a copy.  If enough people
ask me I'll repost it.

--tom
--

    Tom Christiansen                       {uunet,uiucdcs,sun}!convex!tchrist 
    Convex Computer Corporation                            tchrist@convex.COM
		 "EMACS belongs in <sys/errno.h>: Editor too big!"