|
|
1.1 root 1: /*
2: * Copyright (c) 1988 University of Utah.
3: * Copyright (c) 1990 The Regents of the University of California.
4: * All rights reserved.
5: *
6: * This code is derived from software contributed to Berkeley by
7: * the Systems Programming Group of the University of Utah Computer
8: * Science Department.
9: *
10: * Redistribution and use in source and binary forms, with or without
11: * modification, are permitted provided that the following conditions
12: * are met:
13: * 1. Redistributions of source code must retain the above copyright
14: * notice, this list of conditions and the following disclaimer.
15: * 2. Redistributions in binary form must reproduce the above copyright
16: * notice, this list of conditions and the following disclaimer in the
17: * documentation and/or other materials provided with the distribution.
18: * 3. All advertising materials mentioning features or use of this software
19: * must display the following acknowledgement:
20: * This product includes software developed by the University of
21: * California, Berkeley and its contributors.
22: * 4. Neither the name of the University nor the names of its contributors
23: * may be used to endorse or promote products derived from this software
24: * without specific prior written permission.
25: *
26: * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
27: * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28: * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
29: * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
30: * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
31: * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
32: * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33: * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
34: * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
35: * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36: * SUCH DAMAGE.
37: *
38: * from: Utah $Hdr: hpux_sysent.c 1.1 90/07/09$
39: *
40: * @(#)hpux_sysent.c 7.7 (Berkeley) 4/20/91
41: */
42:
43: /*
44: * System call switch table.
45: */
46:
47: #include "param.h"
48: #include "systm.h"
49:
50: int nosys(),notimp();
51:
52: /* 1.1 processes and protection */
53: int getpid();
54: int hpuxgetdomainname(), hpuxsetdomainname();
55: int fork(),rexit(),hpuxexecv(),execve();
56: int getuid(),getgid(),getgroups(),setgroups();
57: int setuid(),setgid();
58:
59: /* 1.2 memory management */
60:
61: /* 1.3 signals */
62: int sigstack();
63: /* sigreturn is not HPUX, but we need it to make signals work */
64: int sigreturn();
65:
66: /* 1.4 timing and statistics */
67: int gettimeofday(),settimeofday();
68: int getitimer(),setitimer();
69:
70: /* 1.5 descriptors */
71: int dup2(),close();
72: int select();
73:
74: /* 1.6 resource controls */
75:
76: /* 1.7 system operation support */
77: int sync();
78:
79: /* 2.2 file system */
80: int chdir(),chroot();
81: int mkdir(),rmdir(),getdirentries();
82: int ocreat(),mknod(),unlink();
83: int chown(),fchown(),chmod(),fchmod();
84: int link(),symlink(),readlink(),rename();
85: int lseek(),truncate(),ftruncate(),saccess(),fsync();
86:
87: /* 2.3 communications */
88: int pipe();
89:
90: int umask(); /* XXX */
91:
92: /* 2.4 processes */
93:
94: /* 2.5 terminals */
95:
96: /* HPUX junk */
97: int hpuxwait(),hpuxdup(),hpuxutssys(),hpuxulimit();
98: int hpuxadvise(), hpuxstat(), hpuxfstat(), hpuxlstat();
99: int hpuxsigvec(), hpuxsigblock(), hpuxsigsetmask();
100: int hpuxsigpause(), hpuxkill(), hpuxptrace();
101: int hpuxopen(), hpuxfcntl(), hpuxread(), hpuxwrite();
102: int hpuxreadv(), hpuxwritev(), hpuxioctl();
103: int hpuxnetioctl(), hpuxrtprio();
104: int hpuxgetcontext();
105: int hpuxlockf(), hpuxgetpgrp2(), hpuxsetpgrp2();
106: int hpuxsetresuid(), hpuxsetresgid();
107: int hpuxsigprocmask(), hpuxsigaction(), hpuxsigpending(), hpuxsigsuspend();
108: int hpuxwait3(), hpuxwaitpid();
109: int hpuxgetaccess();
110: #ifdef SYSVSHM
111: int hpuxshmctl(),hpuxshmget(),hpuxshmat(),hpuxshmdt();
112: #endif
113: int hpuxsemctl(),hpuxsemget(),hpuxsemop();
114:
115: /*
116: * Old 4.2 compatibility routines.
117: * Still needed for HP-UX?
118: */
119: #define compat(n, name) n, __CONCAT(o,name)
120:
121: int ohpuxtime(); /* now use gettimeofday */
122: int ohpuxstime(); /* now use settimeofday */
123: int ohpuxalarm(); /* now use setitimer */
124: int ohpuxutime(); /* now use utimes */
125: int ohpuxpause(); /* now use sigpause */
126: int ohpuxnice(); /* now use setpriority,getpriority */
127: int ohpuxftime(); /* now use gettimeofday */
128: int ohpuxtimes(); /* now use getrusage */
129: int ohpuxstat(); /* now use stat */
130: int ohpuxfstat(); /* now use fstat */
131: int ohpuxssig(); /* now use sigvec, etc */
132: int ohpuxgtty(); /* now use hpuxioctl */
133: int ohpuxstty(); /* now use hpuxioctl */
134: int ohpuxsetpgrp(); /* SYS5 style setpgrp */
135:
136: /* BEGIN JUNK */
137: int profil(); /* 'cuz sys calls are interruptible */
138: int vfork(); /* awaiting fork w/ copy on write */
139: int obreak(); /* awaiting new sbrk */
140: /* END JUNK */
141:
142: /*
143: * Reserved/unimplemented system calls in the range 0-150 inclusive
144: * are reserved for use in future Berkeley releases.
145: * Additional system calls implemented in vendor and other
146: * redistributions should be placed in the reserved range at the end
147: * of the current calls.
148: */
149: struct sysent hpuxsysent[] = {
150: 0, nosys, /* 0 = out of range */
151: 1, rexit, /* 1 = exit */
152: 0, fork, /* 2 = fork */
153: 3, hpuxread, /* 3 = read */
154: 3, hpuxwrite, /* 4 = write */
155: 3, hpuxopen, /* 5 = open */
156: 1, close, /* 6 = close */
157: 1, hpuxwait, /* 7 = HPUX style wait */
158: 2, ocreat, /* 8 = ocreat */
159: 2, link, /* 9 = link */
160: 1, unlink, /* 10 = unlink */
161: 2, hpuxexecv, /* 11 = execv */
162: 1, chdir, /* 12 = chdir */
163: compat(1,hpuxtime), /* 13 = old time */
164: 3, mknod, /* 14 = mknod */
165: 2, chmod, /* 15 = chmod */
166: 3, chown, /* 16 = chown; now 3 args */
167: 1, obreak, /* 17 = old break */
168: compat(2,hpuxstat), /* 18 = old stat */
169: 3, lseek, /* 19 = lseek */
170: 0, getpid, /* 20 = getpid */
171: 3, notimp, /* 21 = mount */
172: 1, notimp, /* 22 = umount */
173: 1, setuid, /* 23 = setuid */
174: 0, getuid, /* 24 = getuid */
175: compat(1,hpuxstime), /* 25 = old stime */
176: 4, hpuxptrace, /* 26 = ptrace */
177: compat(1,hpuxalarm), /* 27 = old alarm */
178: compat(2,hpuxfstat), /* 28 = old fstat */
179: compat(0,hpuxpause), /* 29 = opause */
180: compat(2,hpuxutime), /* 30 = old utime */
181: compat(2,hpuxstty), /* 31 = HPUX style stty */
182: compat(2,hpuxgtty), /* 32 = HPUX style gtty */
183: 2, saccess, /* 33 = access */
184: compat(1,hpuxnice), /* 34 = old nice */
185: compat(1,hpuxftime), /* 35 = old ftime */
186: 0, sync, /* 36 = sync */
187: 2, hpuxkill, /* 37 = HPUX style kill */
188: 2, hpuxstat, /* 38 = HPUX style stat */
189: compat(1,hpuxsetpgrp), /* 39 = HPUX style old setpgrp */
190: 2, hpuxlstat, /* 40 = HPUX style lstat */
191: 1, hpuxdup, /* 41 = HPUX style dup */
192: 0, pipe, /* 42 = pipe */
193: compat(1,hpuxtimes), /* 43 = old times */
194: 4, profil, /* 44 = profil */
195: 4, notimp, /* 45 = ki_syscall */
196: 1, setgid, /* 46 = setgid */
197: 0, getgid, /* 47 = getgid */
198: compat(2,hpuxssig), /* 48 = old sig */
199: 0, nosys, /* 49 = reserved for USG */
200: 0, nosys, /* 50 = reserved for USG */
201: 1, notimp, /* 51 = acct */
202: 0, nosys, /* 52 = old set phys addr */
203: 0, nosys, /* 53 = old lock in core */
204: 3, hpuxioctl, /* 54 = HPUX ioctl */
205: 4, notimp, /* 55 = reboot */
206: 2, symlink, /* 56 = symlink */
207: 3, hpuxutssys, /* 57 = HPUX utssys */
208: 3, readlink, /* 58 = readlink */
209: 3, execve, /* 59 = execve */
210: 1, umask, /* 60 = umask */
211: 1, chroot, /* 61 = chroot */
212: 3, hpuxfcntl, /* 62 = fcntl (swapped with fstat) */
213: 2, hpuxulimit, /* 63 = HPUX ulimit */
214: 0, nosys, /* 64 = nosys */
215: 0, nosys, /* 65 = nosys */
216: 0, vfork, /* 66 = vfork */
217: 0, hpuxread, /* 67 = old vread */
218: 0, hpuxwrite, /* 68 = old vwrite */
219: 0, nosys, /* 69 = nosys */
220: 0, nosys, /* 70 = nosys */
221: 0, nosys, /* 71 = nosys */
222: 0, nosys, /* 72 = nosys */
223: 0, nosys, /* 73 = nosys */
224: 3, notimp, /* 74 = mprotect */
225: 0, nosys, /* 75 = nosys */
226: 0, nosys, /* 76 = nosys */
227: 0, nosys, /* 77 = nosys */
228: 0, nosys, /* 78 = nosys */
229: 2, getgroups, /* 79 = getgroups */
230: 2, setgroups, /* 80 = setgroups */
231: 1, hpuxgetpgrp2, /* 81 = HPUX getpgrp2 */
232: 2, hpuxsetpgrp2, /* 82 = HPUX setpgrp2 */
233: 3, setitimer, /* 83 = setitimer */
234: 3, hpuxwait3, /* 84 = wait3 */
235: 1, notimp, /* 85 = swapon */
236: 2, getitimer, /* 86 = getitimer */
237: 0, nosys, /* 87 = nosys */
238: 0, nosys, /* 88 = nosys */
239: 0, nosys, /* 89 = nosys */
240: 2, dup2, /* 90 = dup2 */
241: 2, nosys, /* 91 = nosys */
242: 2, hpuxfstat, /* 92 = fstat (swapped with fcntl) */
243: 5, select, /* 93 = select */
244: 0, nosys, /* 94 = nosys */
245: 1, fsync, /* 95 = fsync */
246: 0, nosys, /* 96 = nosys */
247: 3, nosys, /* 97 = nosys */
248: 2, nosys, /* 98 = nosys */
249: 2, nosys, /* 99 = nosys */
250: 0, nosys, /* 100 = nosys */
251: 0, nosys, /* 101 = nosys */
252: 0, nosys, /* 102 = nosys */
253: 1, sigreturn, /* 103 = sigreturn (not HPUX) */
254: 2, nosys, /* 104 = nosys */
255: 0, nosys, /* 105 = nosys */
256: 0, nosys, /* 106 = nosys */
257: 0, nosys, /* 107 = nosys */
258: 3, hpuxsigvec, /* 108 = sigvec */
259: 1, hpuxsigblock, /* 109 = sigblock */
260: 1, hpuxsigsetmask, /* 110 = sigsetmask */
261: 1, hpuxsigpause, /* 111 = sigpause */
262: 2, sigstack, /* 112 = sigstack */
263: 0, nosys, /* 113 = nosys */
264: 0, nosys, /* 114 = nosys */
265: 0, nosys, /* 115 = nosys */
266: 2, gettimeofday, /* 116 = gettimeofday */
267: 0, nosys, /* 117 = nosys */
268: 0, nosys, /* 118 = nosys */
269: 3, notimp, /* 119 = hpib_io_stub */
270: 3, hpuxreadv, /* 120 = readv */
271: 3, hpuxwritev, /* 121 = writev */
272: 2, settimeofday, /* 122 = settimeofday */
273: 3, fchown, /* 123 = fchown */
274: 2, fchmod, /* 124 = fchmod */
275: 0, nosys, /* 125 = nosys */
276: 3, hpuxsetresuid, /* 126 = setresuid */
277: 3, hpuxsetresgid, /* 127 = setresgid */
278: 2, rename, /* 128 = rename */
279: 2, truncate, /* 129 = truncate */
280: 2, ftruncate, /* 130 = ftruncate */
281: 0, nosys, /* 131 = nosys */
282: 1, notimp, /* 132 = sysconf */
283: 0, nosys, /* 133 = nosys */
284: 0, nosys, /* 134 = nosys */
285: 0, nosys, /* 135 = nosys */
286: 2, mkdir, /* 136 = mkdir */
287: 1, rmdir, /* 137 = rmdir */
288: 0, nosys, /* 138 = nosys */
289: 0, nosys, /* 139 = internal (4.2 sigreturn) */
290: 0, nosys, /* 140 = nosys */
291: 0, nosys, /* 141 = nosys */
292: 0, nosys, /* 142 = nosys */
293: 0, nosys, /* 143 = nosys */
294: 0, nosys, /* 144 = nosys */
295: 0, nosys, /* 145 = nosys */
296: 0, nosys, /* 146 = nosys */
297: 0, nosys, /* 147 = nosys */
298: 0, nosys, /* 148 = nosys */
299: 0, nosys, /* 149 = nosys */
300: 0, nosys, /* 150 = nosys */
301: /*
302: * HPUX specific syscalls
303: */
304: 3, notimp, /* 151 = privgrp */
305: 2, hpuxrtprio, /* 152 = rtprio */
306: 1, notimp, /* 153 = plock */
307: 2, hpuxnetioctl, /* 154 = BSD networking */
308: 4, hpuxlockf, /* 155 = HPUX lockf */
309: 3, hpuxsemget, /* 156 = semget */
310: 4, hpuxsemctl, /* 157 = semctl */
311: 3, hpuxsemop, /* 158 = semop */
312: 2, notimp, /* 159 = msgget */
313: 3, notimp, /* 160 = msgctl */
314: 4, notimp, /* 161 = msgsnd */
315: 5, notimp, /* 162 = msgrcv */
316: #ifdef SYSVSHM
317: 3, hpuxshmget, /* 163 = shmget */
318: 3, hpuxshmctl, /* 164 = shmctl */
319: 3, hpuxshmat, /* 165 = shmat */
320: 1, hpuxshmdt, /* 166 = shmdt */
321: #else
322: 3, notimp, /* 163 = shmget */
323: 3, notimp, /* 164 = shmctl */
324: 3, notimp, /* 165 = shmat */
325: 1, notimp, /* 166 = shmdt */
326: #endif
327: 1, hpuxadvise, /* 167 = m68020_advise */
328: 0, notimp, /* 168 = dux_notconfigured */
329: 3, notimp, /* 169 = cluster */
330: 4, notimp, /* 170 = mkrnod */
331: 0, nosys, /* 171 = nosys */
332: 0, notimp, /* 172 = dux_notconfigured */
333: 0, nosys, /* 173 = nosys */
334: 3, hpuxgetcontext, /* 174 = getcontext */
335: 0, nosys, /* 175 = nosys */
336: 0, nosys, /* 176 = nosys */
337: 0, nosys, /* 177 = nosys */
338: 0, notimp, /* 178 = lsync */
339: 0, nosys, /* 179 = nosys */
340: 0, notimp, /* 180 = mysite */
341: 0, notimp, /* 181 = returnzero */
342: 0, nosys, /* 182 = nosys */
343: 0, nosys, /* 183 = nosys */
344: 0, nosys, /* 184 = nosys */
345: 0, nosys, /* 185 = nosys */
346: 3, notimp, /* 186 = setacl */
347: 3, notimp, /* 187 = fsetacl */
348: 3, notimp, /* 188 = getacl */
349: 3, notimp, /* 189 = fgetacl */
350: 6, hpuxgetaccess, /* 190 = getaccess */
351: 0, notimp, /* 191 = getaudid */
352: 1, notimp, /* 192 = setaudid */
353: 0, notimp, /* 193 = getaudproc */
354: 1, notimp, /* 194 = setaudproc */
355: 2, notimp, /* 195 = getevent */
356: 2, notimp, /* 196 = setevent */
357: 1, notimp, /* 197 = audwrite */
358: 1, notimp, /* 198 = audswitch */
359: 4, notimp, /* 199 = audctl */
360: 3, hpuxwaitpid, /* 200 = waitpid */
361: 0, nosys, /* 201 = nosys */
362: 2, notimp, /* 202 = netioctl */
363: 6, nosys, /* 203 = nosys */
364: 0, nosys, /* 204 = nosys */
365: 0, nosys, /* 205 = nosys */
366: 9, nosys, /* 206 = nosys */
367: 0, nosys, /* 207 = nosys */
368: 0, nosys, /* 208 = nosys */
369: 6, nosys, /* 209 = nosys */
370: 5, nosys, /* 210 = nosys */
371: 0, nosys, /* 211 = nosys */
372: 0, nosys, /* 212 = nosys */
373: 0, nosys, /* 213 = nosys */
374: 0, nosys, /* 214 = nosys */
375: 0, nosys, /* 215 = nosys */
376: 0, nosys, /* 216 = nosys */
377: 0, nosys, /* 217 = nosys */
378: 0, nosys, /* 218 = nosys */
379: 0, nosys, /* 219 = nosys */
380: 4, nosys, /* 220 = nosys */
381: 10, nosys, /* 221 = nosys */
382: 0, nosys, /* 222 = nosys */
383: 0, nosys, /* 223 = nosys */
384: 0, nosys, /* 224 = nosys */
385: 2, notimp, /* 225 = pathconf */
386: 2, notimp, /* 226 = fpathconf */
387: 0, nosys, /* 227 = nosys */
388: 0, nosys, /* 228 = nosys */
389: 0, notimp, /* 229 = async_daemon */
390: 3, notimp, /* 230 = nfs_fcntl */
391: 4, getdirentries, /* 231 = getdirentries */
392: 2, hpuxgetdomainname, /* 232 = getdomainname */
393: 2, notimp, /* 233 = nfs_getfh */
394: 4, notimp, /* 234 = vfsmount */
395: 1, notimp, /* 235 = nfs_svc */
396: 2, hpuxsetdomainname, /* 236 = setdomainname */
397: 0, notimp, /* 237 = statfs */
398: 0, notimp, /* 238 = fstatfs */
399: 3, hpuxsigaction, /* 239 = sigaction */
400: 3, hpuxsigprocmask, /* 240 = sigprocmask */
401: 1, hpuxsigpending, /* 241 = sigpending */
402: 1, hpuxsigsuspend, /* 242 = sigsuspend */
403: };
404: int hpuxnsysent = sizeof (hpuxsysent) / sizeof (hpuxsysent[0]);
405:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.