home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / unix / aix / 8042 < prev    next >
Encoding:
Text File  |  1992-07-21  |  2.8 KB  |  80 lines

  1. Newsgroups: comp.unix.aix
  2. Path: sparky!uunet!iWarp.intel.com|ichips!tmcconne
  3. From: tmcconne@sedona.intel.com (Tom McConnell)
  4. Subject: Re: AIX 3.2 equivalent of syscall(2) and <syscall.h>?
  5. Message-ID: <1992Jul21.234645.5504@ichips.intel.com>
  6. Originator: tmcconne@sedona
  7. Sender: tmcconne@sedona (Tom McConnell)
  8. Reply-To: tmcconne@sedona.intel.com
  9. Organization: Intel Corporation
  10. References:  <1992Jul21.203837.9228@math.waterloo.edu>
  11. Date: Tue, 21 Jul 1992 23:46:45 GMT
  12. Lines: 66
  13.  
  14.  
  15.   The short answer:
  16.  
  17.     There isn't any.
  18.  
  19.   The long answer:
  20.  
  21. > From: dan@watson.ibm.com (Walt Daniels)
  22. > Subject: syscall on RS/6000 for XView 3.0
  23. > I read the information in info by searching on the string syscall and
  24. > looking at all the information. However some of the information
  25. > I see may not be available outside IBM.  Here is my retyping of what I
  26. > found - not guaranteed to be accurate.
  27. > ------------
  28. > 10/02/91 NEED AIX EQUIVALENT OF THE SUN SYSCALL ROUTINE
  29. > Item Number: Q557045
  30. > ...
  31. > Question:
  32. > We are try to port an application that runs on a SUN. One of the
  33. > programs uses a routine called 'syscall' to do its low-level
  34. > read, write and fnctl's. What, if any, can we use on the RS/6000
  35. > to accomplish this task. Without this or an equivalent feature we will
  36. > have to write an EXTENSIVE work-around.
  37. > Answer:
  38. > There aren't any routines that you can use on the RS/600 to duplicate
  39. > the function of the "syscall" system call.  The "syscall" system call
  40. > is an indirect system call on BSD.  That is, the first argument
  41. > indicates which other system call the kernel should perform and
  42. > subsequent arguments are passed to the other call.  This is inherently
  43. > non-portable, since the system call numbers become visible at
  44. > user-level, instead of being hidden in a C wrapper in libc.  The
  45. > system call numbers are defined in syscall.h (which is not included in
  46. > AIX V3).  [since the kernel can be and is extended dynamically]
  47. > To port code which uses this call, you need to understand which calls
  48. > are being made and write your own version of syscall which basically
  49. > consists of a switch statement on the first argument, and then calls
  50. > the appropriate system call with the correct number of arguments.
  51. > Suitable use of varagrs.h (stdarg.h) may be needed depending on the
  52. > systems calls being made.
  53.  
  54.  
  55.   The work around looks like this:
  56.  
  57.   Replace such constructs as
  58.     syscall(SYS_read .....
  59.  
  60.   with
  61.     read(....)
  62.  
  63.  
  64.   I had to do this in a big way to port XView to the RS/6000. It's a pain, but
  65. relatively easy to do.
  66.  
  67.     Cheers,
  68.  
  69.     Tom McConnell
  70. -- 
  71.  Tom McConnell          |     Internet: tmcconne@sedona.intel.com
  72.  Intel, Corp. C3-21     |     Phone: (602)-554-8229
  73.  5000 W. Chandler Blvd. | The opinions expressed are my own. No one in 
  74.  Chandler, AZ  85226    | their right mind would claim them.
  75.