home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.aix
- Path: sparky!uunet!iWarp.intel.com|ichips!tmcconne
- From: tmcconne@sedona.intel.com (Tom McConnell)
- Subject: Re: AIX 3.2 equivalent of syscall(2) and <syscall.h>?
- Message-ID: <1992Jul21.234645.5504@ichips.intel.com>
- Originator: tmcconne@sedona
- Sender: tmcconne@sedona (Tom McConnell)
- Reply-To: tmcconne@sedona.intel.com
- Organization: Intel Corporation
- References: <1992Jul21.203837.9228@math.waterloo.edu>
- Date: Tue, 21 Jul 1992 23:46:45 GMT
- Lines: 66
-
-
- The short answer:
-
- There isn't any.
-
- The long answer:
-
- > From: dan@watson.ibm.com (Walt Daniels)
- > Subject: syscall on RS/6000 for XView 3.0
- >
- > I read the information in info by searching on the string syscall and
- > looking at all the information. However some of the information
- > I see may not be available outside IBM. Here is my retyping of what I
- > found - not guaranteed to be accurate.
- > ------------
- > 10/02/91 NEED AIX EQUIVALENT OF THE SUN SYSCALL ROUTINE
- > Item Number: Q557045
- > ...
- > Question:
- > We are try to port an application that runs on a SUN. One of the
- > programs uses a routine called 'syscall' to do its low-level
- > read, write and fnctl's. What, if any, can we use on the RS/6000
- > to accomplish this task. Without this or an equivalent feature we will
- > have to write an EXTENSIVE work-around.
- >
- > Answer:
- > There aren't any routines that you can use on the RS/600 to duplicate
- > the function of the "syscall" system call. The "syscall" system call
- > is an indirect system call on BSD. That is, the first argument
- > indicates which other system call the kernel should perform and
- > subsequent arguments are passed to the other call. This is inherently
- > non-portable, since the system call numbers become visible at
- > user-level, instead of being hidden in a C wrapper in libc. The
- > system call numbers are defined in syscall.h (which is not included in
- > AIX V3). [since the kernel can be and is extended dynamically]
- >
- > To port code which uses this call, you need to understand which calls
- > are being made and write your own version of syscall which basically
- > consists of a switch statement on the first argument, and then calls
- > the appropriate system call with the correct number of arguments.
- >
- > Suitable use of varagrs.h (stdarg.h) may be needed depending on the
- > systems calls being made.
- >
-
-
- The work around looks like this:
-
- Replace such constructs as
- syscall(SYS_read .....
-
- with
- read(....)
-
-
- I had to do this in a big way to port XView to the RS/6000. It's a pain, but
- relatively easy to do.
-
- Cheers,
-
- Tom McConnell
- --
- Tom McConnell | Internet: tmcconne@sedona.intel.com
- Intel, Corp. C3-21 | Phone: (602)-554-8229
- 5000 W. Chandler Blvd. | The opinions expressed are my own. No one in
- Chandler, AZ 85226 | their right mind would claim them.
-