home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!dtix!darwin.sura.net!mips!swrinde!cs.utexas.edu!torn!watserv1!watmath!rbutterw
- From: rbutterw@math.waterloo.edu (Ray Butterworth [MFCF])
- Newsgroups: comp.unix.aix
- Subject: AIX 3.2 equivalent of syscall(2) and <syscall.h>?
- Message-ID: <1992Jul21.203837.9228@math.waterloo.edu>
- Date: 21 Jul 92 20:38:37 GMT
- Sender: rbutterw@math.waterloo.edu (Ray Butterworth [MFCF])
- Organization: Math Faculty Computing Facility, University of Waterloo
- Lines: 22
-
- Does anyone know what AIX 3.2 provides as an equivalent of syscall(2),
- and <syscall.h> that is on all our other architectures?
-
- It's used to allow one to trap kernel system calls and then call
- the real one.
-
- e.g. if one wanted to guarantee that a program would never open
- anything but an absolute pathname, they could compile the program
- with this and it would replace the "open" function in libc.
-
- #include <syscalls.h>
- int
- open(path, flags, mode)
- char *path;
- {
- if (path[0] != '/') {
- errno = EPERM;
- return -1;
- }
-
- return syscall(SYS_open, path, flags, mode);
- }
-