make vfs & filesystems use failable copying
[minix3.git] / include / minix / callnr.h
blob2627b8dca70cdec0937b90e374d0ad1403bbb9a5
1 /* This header file defines the calls to PM and VFS. */
2 #ifndef _MINIX_CALLNR_H
3 #define _MINIX_CALLNR_H
5 /*===========================================================================*
6 * Calls to PM *
7 *===========================================================================*/
9 #define PM_BASE 0x000
11 #define IS_PM_CALL(type) (((type) & ~0xff) == PM_BASE)
13 /* Message type 0 is traditionally reserved. */
14 #define PM_EXIT (PM_BASE + 1)
15 #define PM_FORK (PM_BASE + 2)
16 #define PM_WAITPID (PM_BASE + 3)
17 #define PM_GETPID (PM_BASE + 4)
18 #define PM_SETUID (PM_BASE + 5)
19 #define PM_GETUID (PM_BASE + 6)
20 #define PM_STIME (PM_BASE + 7)
21 #define PM_PTRACE (PM_BASE + 8)
22 #define PM_SETGROUPS (PM_BASE + 9)
23 #define PM_GETGROUPS (PM_BASE + 10)
24 #define PM_KILL (PM_BASE + 11)
25 #define PM_SETGID (PM_BASE + 12)
26 #define PM_GETGID (PM_BASE + 13)
27 #define PM_EXEC (PM_BASE + 14)
28 #define PM_SETSID (PM_BASE + 15)
29 #define PM_GETPGRP (PM_BASE + 16)
30 #define PM_ITIMER (PM_BASE + 17)
31 #define PM_GETMCONTEXT (PM_BASE + 18)
32 #define PM_SETMCONTEXT (PM_BASE + 19)
33 #define PM_SIGACTION (PM_BASE + 20)
34 #define PM_SIGSUSPEND (PM_BASE + 21)
35 #define PM_SIGPENDING (PM_BASE + 22)
36 #define PM_SIGPROCMASK (PM_BASE + 23)
37 #define PM_SIGRETURN (PM_BASE + 24)
38 #define PM_SYSUNAME (PM_BASE + 25)
39 #define PM_GETPRIORITY (PM_BASE + 26)
40 #define PM_SETPRIORITY (PM_BASE + 27)
41 #define PM_GETTIMEOFDAY (PM_BASE + 28)
42 #define PM_SETEUID (PM_BASE + 29)
43 #define PM_SETEGID (PM_BASE + 30)
44 #define PM_ISSETUGID (PM_BASE + 31)
45 #define PM_GETSID (PM_BASE + 32)
46 #define PM_CLOCK_GETRES (PM_BASE + 33)
47 #define PM_CLOCK_GETTIME (PM_BASE + 34)
48 #define PM_CLOCK_SETTIME (PM_BASE + 35)
49 #define PM_GETRUSAGE (PM_BASE + 36)
50 #define PM_REBOOT (PM_BASE + 37)
51 #define PM_SVRCTL (PM_BASE + 38)
52 #define PM_SPROF (PM_BASE + 39)
53 #define PM_CPROF (PM_BASE + 40)
54 #define PM_SRV_FORK (PM_BASE + 41)
55 #define PM_SRV_KILL (PM_BASE + 42)
56 #define PM_EXEC_NEW (PM_BASE + 43)
57 #define PM_EXEC_RESTART (PM_BASE + 44)
58 #define PM_GETEPINFO (PM_BASE + 45)
59 #define PM_GETPROCNR (PM_BASE + 46)
60 #define PM_GETSYSINFO (PM_BASE + 47)
62 #define NR_PM_CALLS 48 /* highest number from base plus one */
64 /* Field names for the getprocnr(2) call. */
65 #define PM_GETPROCNR_PID m1_i1 /* pid_t */
66 #define PM_GETPROCNR_ENDPT m1_i1 /* endpoint_t */
68 /* Field names for the getepinfo(2) call. */
69 #define PM_GETEPINFO_ENDPT m1_i1 /* endpoint_t */
70 #define PM_GETEPINFO_UID m1_i1 /* uid_t */
71 #define PM_GETEPINFO_GID m1_i2 /* gid_t */
73 /* Field names for the exit(2) call. */
74 #define PM_EXIT_STATUS m1_i1 /* int */
76 /* Field names for the waitpid(2) call. */
77 #define PM_WAITPID_PID m1_i1 /* pid_t */
78 #define PM_WAITPID_OPTIONS m1_i2 /* int */
79 #define PM_WAITPID_STATUS m2_i1 /* int */
81 /* Field names for the gettimeofday(2), clock_*(2), adjtime(2), stime(2) calls.
83 #define PM_TIME_CLK_ID m2_i1 /* clockid_t */
84 #define PM_TIME_NOW m2_i2 /* int */
85 #define PM_TIME_SEC m2_ll1 /* time_t */
86 #define PM_TIME_USEC m2_l2 /* long */
87 #define PM_TIME_NSEC m2_l2 /* long */
89 /* Field names for the ptrace(2) call. */
90 #define PM_PTRACE_PID m2_i1 /* pid_t */
91 #define PM_PTRACE_REQ m2_i2 /* int */
92 #define PM_PTRACE_ADDR m2_l1 /* long */
93 #define PM_PTRACE_DATA m2_l2 /* long */
95 /* Field names for the sysuname(2) call. */
96 #define PM_SYSUNAME_REQ m1_i1 /* int */
97 #define PM_SYSUNAME_FIELD m1_i2 /* int */
98 #define PM_SYSUNAME_LEN m1_i3 /* char * */
99 #define PM_SYSUNAME_VALUE m1_p1 /* size_t */
101 /* Field names for the getitimer(2)/setitimer(2) calls. */
102 #define PM_ITIMER_WHICH m1_i1 /* int */
103 #define PM_ITIMER_VALUE m1_p1 /* const struct itimerval * */
104 #define PM_ITIMER_OVALUE m1_p2 /* struct itimerval * */
106 /* Field names for the execve(2) call. */
107 #define PM_EXEC_NAME m1_p1 /* const char * */
108 #define PM_EXEC_NAMELEN m1_i1 /* size_t */
109 #define PM_EXEC_FRAME m1_p2 /* char * */
110 #define PM_EXEC_FRAMELEN m1_i2 /* size_t */
111 #define PM_EXEC_PS_STR m1_p3 /* char * */
113 /* Field names for the kill(2), srv_kill(2), and sigaction(2) calls. */
114 #define PM_SIG_PID m1_i1 /* pid_t */
115 #define PM_SIG_NR m1_i2 /* int */
116 #define PM_SIG_ACT m1_p1 /* const struct sigaction * */
117 #define PM_SIG_OACT m1_p2 /* struct sigaction * */
118 #define PM_SIG_RET m1_p3 /* int (*)(void) */
120 /* Field names for the remaining sigpending(2), sigprocmask(2), sigreturn(2),
121 * sigsuspend(2) calls.
123 #define PM_SIG_HOW m2_i1 /* int */
124 #define PM_SIG_SET m2_sigset /* sigset_t */
125 #define PM_SIG_CTX m2_p1 /* struct sigcontext * */
127 /* Field names for the srv_fork(2) call. */
128 #define PM_SRV_FORK_UID m1_i1 /* uid_t */
129 #define PM_SRV_FORK_GID m1_i2 /* gid_t */
131 /* Field names for the getuid(2) call. */
132 #define PM_GETUID_EUID m1_i1 /* uid_t */
134 /* Field names for the getgid(2) call. */
135 #define PM_GETGID_EGID m1_i1 /* gid_t */
137 /* Field names for the setuid(2)/seteuid(2) calls. */
138 #define PM_SETUID_UID m1_i1 /* uid_t */
140 /* Field names for the setgid(2)/setegid(2) calls. */
141 #define PM_SETGID_GID m1_i1 /* gid_t */
143 /* Field names for the getppid(2) call. */
144 #define PM_GETPID_PARENT m2_i1 /* pid_t */
146 /* Field names for the setsid(2) call. */
147 #define PM_GETSID_PID m1_i1 /* pid_t */
149 /* Field names for the setgroups(2)/setgroups(2) calls. */
150 #define PM_GROUPS_NUM m1_i1 /* int */
151 #define PM_GROUPS_PTR m1_p1 /* gid_t * */
153 /* Field names for the getpriority(2)/setpriority(2) calls. */
154 #define PM_PRIORITY_WHICH m1_i1 /* int */
155 #define PM_PRIORITY_WHO m1_i2 /* int */
156 #define PM_PRIORITY_PRIO m1_i3 /* int */
158 /* Field names for the getmcontext(2)/setmcontext(2) calls. */
159 #define PM_MCONTEXT_CTX m1_p1 /* mcontext_t * */
161 /* Field names for the reboot(2) call. */
162 #define PM_REBOOT_HOW m1_i1 /* int */
164 /* Field names for the PM_EXEC_NEW call. */
165 #define PM_EXEC_NEW_ENDPT m1_i1 /* endpoint_t */
166 #define PM_EXEC_NEW_PTR m1_p1 /* struct exec_info * */
167 #define PM_EXEC_NEW_SUID m1_i2 /* int */
169 /* Field names for the PM_EXEC_RESTART call. */
170 #define PM_EXEC_RESTART_ENDPT m1_i1 /* endpoint_t */
171 #define PM_EXEC_RESTART_RESULT m1_i2 /* int */
172 #define PM_EXEC_RESTART_PC m1_p1 /* vir_bytes */
173 #define PM_EXEC_RESTART_PS_STR m1_p2 /* vir_bytes */
175 /*===========================================================================*
176 * Calls to VFS *
177 *===========================================================================*/
179 #define VFS_BASE 0x100
181 #define IS_VFS_CALL(type) (((type) & ~0xff) == VFS_BASE)
183 #define VFS_READ (VFS_BASE + 0)
184 #define VFS_WRITE (VFS_BASE + 1)
185 #define VFS_LSEEK (VFS_BASE + 2)
186 #define VFS_OPEN (VFS_BASE + 3)
187 #define VFS_CREAT (VFS_BASE + 4)
188 #define VFS_CLOSE (VFS_BASE + 5)
189 #define VFS_LINK (VFS_BASE + 6)
190 #define VFS_UNLINK (VFS_BASE + 7)
191 #define VFS_CHDIR (VFS_BASE + 8)
192 #define VFS_MKDIR (VFS_BASE + 9)
193 #define VFS_MKNOD (VFS_BASE + 10)
194 #define VFS_CHMOD (VFS_BASE + 11)
195 #define VFS_CHOWN (VFS_BASE + 12)
196 #define VFS_MOUNT (VFS_BASE + 13)
197 #define VFS_UMOUNT (VFS_BASE + 14)
198 #define VFS_ACCESS (VFS_BASE + 15)
199 #define VFS_SYNC (VFS_BASE + 16)
200 #define VFS_RENAME (VFS_BASE + 17)
201 #define VFS_RMDIR (VFS_BASE + 18)
202 #define VFS_SYMLINK (VFS_BASE + 19)
203 #define VFS_READLINK (VFS_BASE + 20)
204 #define VFS_STAT (VFS_BASE + 21)
205 #define VFS_FSTAT (VFS_BASE + 22)
206 #define VFS_LSTAT (VFS_BASE + 23)
207 #define VFS_IOCTL (VFS_BASE + 24)
208 #define VFS_FCNTL (VFS_BASE + 25)
209 #define VFS_PIPE2 (VFS_BASE + 26)
210 #define VFS_UMASK (VFS_BASE + 27)
211 #define VFS_CHROOT (VFS_BASE + 28)
212 #define VFS_GETDENTS (VFS_BASE + 29)
213 #define VFS_SELECT (VFS_BASE + 30)
214 #define VFS_FCHDIR (VFS_BASE + 31)
215 #define VFS_FSYNC (VFS_BASE + 32)
216 #define VFS_TRUNCATE (VFS_BASE + 33)
217 #define VFS_FTRUNCATE (VFS_BASE + 34)
218 #define VFS_FCHMOD (VFS_BASE + 35)
219 #define VFS_FCHOWN (VFS_BASE + 36)
220 #define VFS_UTIMENS (VFS_BASE + 37)
221 #define VFS_VMCALL (VFS_BASE + 38)
222 #define VFS_GETVFSSTAT (VFS_BASE + 39)
223 #define VFS_STATVFS1 (VFS_BASE + 40)
224 #define VFS_FSTATVFS1 (VFS_BASE + 41)
225 #define VFS_GETRUSAGE (VFS_BASE + 42)
226 #define VFS_SVRCTL (VFS_BASE + 43)
227 #define VFS_GCOV_FLUSH (VFS_BASE + 44)
228 #define VFS_MAPDRIVER (VFS_BASE + 45)
229 #define VFS_COPYFD (VFS_BASE + 46)
230 #define VFS_CHECKPERMS (VFS_BASE + 47)
231 #define VFS_GETSYSINFO (VFS_BASE + 48)
233 #define NR_VFS_CALLS 49 /* highest number from base plus one */
235 /* Field names for the select(2) call. */
236 #define VFS_SELECT_NFDS m8_i1 /* int */
237 #define VFS_SELECT_READFDS m8_p1 /* fd_set * */
238 #define VFS_SELECT_WRITEFDS m8_p2 /* fd_set * */
239 #define VFS_SELECT_ERRORFDS m8_p3 /* fd_set * */
240 #define VFS_SELECT_TIMEOUT m8_p4 /* struct timeval * */
242 /* Field names for the getvfsstat(2) call. */
243 #define VFS_GETVFSSTAT_BUF m1_p1 /* struct statvfs * */
244 #define VFS_GETVFSSTAT_LEN m1_i1 /* size_t */
245 #define VFS_GETVFSSTAT_FLAGS m1_i2 /* int */
247 /* Field names for the statvfs1(2) and fstatvfs1(2) calls. */
248 #define VFS_STATVFS1_LEN m1_i1 /* size_t */
249 #define VFS_STATVFS1_NAME m1_p1 /* const char * */
250 #define VFS_STATVFS1_FD m1_i1 /* int */
251 #define VFS_STATVFS1_BUF m1_p2 /* struct statvfs * */
252 #define VFS_STATVFS1_FLAGS m1_i2 /* int */
254 /* Field names for the mount(2) call. */
255 #define VFS_MOUNT_FLAGS m11_i1 /* int */
256 #define VFS_MOUNT_DEVLEN m11_s1 /* size_t */
257 #define VFS_MOUNT_PATHLEN m11_s2 /* size_t */
258 #define VFS_MOUNT_TYPELEN m11_s3 /* size_t */
259 #define VFS_MOUNT_LABELLEN m11_s4 /* size_t */
260 #define VFS_MOUNT_DEV m11_p1 /* char * */
261 #define VFS_MOUNT_PATH m11_p2 /* char * */
262 #define VFS_MOUNT_TYPE m11_p3 /* char * */
263 #define VFS_MOUNT_LABEL m11_p4 /* char * */
265 /* Field names for the umount(2) call. */
266 #define VFS_UMOUNT_NAME m1_p1 /* char * */
267 #define VFS_UMOUNT_NAMELEN m1_i1 /* size_t */
268 #define VFS_UMOUNT_LABEL m1_p2 /* char * */
269 #define VFS_UMOUNT_LABELLEN m1_i2 /* size_t */
271 /* Field names for the ioctl(2) call. */
272 #define VFS_IOCTL_FD m2_i1 /* int */
273 #define VFS_IOCTL_REQ m2_i3 /* unsigned long */
274 #define VFS_IOCTL_ARG m2_p1 /* void * */
276 /* Field names for the checkperms(2) call. */
277 #define VFS_CHECKPERMS_ENDPT m2_i1 /* endpoint_t */
278 #define VFS_CHECKPERMS_GRANT m2_i2 /* cp_grant_id_t */
279 #define VFS_CHECKPERMS_COUNT m2_i3 /* size_t */
281 /* Field names for the copyfd(2) call. */
282 #define VFS_COPYFD_ENDPT m1_i1 /* endpoint_t */
283 #define VFS_COPYFD_FD m1_i2 /* int */
284 #define VFS_COPYFD_WHAT m1_i3 /* int */
286 /* Field names for the mapdriver(2) call. */
287 #define VFS_MAPDRIVER_MAJOR m1_i1 /* devmajor_t */
288 #define VFS_MAPDRIVER_LABELLEN m1_i2 /* size_t */
289 #define VFS_MAPDRIVER_LABEL m1_p1 /* char * */
291 /* Field names for the fsync(2) call. */
292 #define VFS_FSYNC_FD m1_i1 /* int */
294 /* Field names for the lseek(2) call. */
295 #define VFS_LSEEK_FD m2_i1 /* int */
296 #define VFS_LSEEK_OFF m2_ll1 /* off_t */
297 #define VFS_LSEEK_WHENCE m2_i2 /* int */
299 /* Field names for the truncate(2) and ftruncate(2) calls. */
300 #define VFS_TRUNCATE_FD m2_i1 /* int */
301 #define VFS_TRUNCATE_NAME m2_p1 /* const char * */
302 #define VFS_TRUNCATE_LEN m2_i1 /* size_t */
303 #define VFS_TRUNCATE_OFF m2_ll1 /* off_t */
305 /* Field names for the pipe2(2) call. */
306 #define VFS_PIPE2_FD0 m1_i1 /* int */
307 #define VFS_PIPE2_FD1 m1_i2 /* int */
308 #define VFS_PIPE2_FLAGS m1_i3 /* int */
310 /* Field names for the umask(2) call. */
311 #define VFS_UMASK_MASK m1_i1 /* mode_t */
313 /* Field names for the link(2), symlink(2), and rename(2) call. */
314 #define VFS_LINK_NAME1 m1_p1 /* const char * */
315 #define VFS_LINK_LEN1 m1_i1 /* size_t */
316 #define VFS_LINK_NAME2 m1_p2 /* const char * */
317 #define VFS_LINK_LEN2 m1_i2 /* size_t */
319 /* Field names for the readlink(2) call. */
320 #define VFS_READLINK_NAME m1_p1 /* const char * */
321 #define VFS_READLINK_NAMELEN m1_i1 /* size_t */
322 #define VFS_READLINK_BUF m1_p2 /* char * */
323 #define VFS_READLINK_BUFSIZE m1_i2 /* size_t */
325 /* Field names for the stat(2) and lstat(2) calls. */
326 #define VFS_STAT_NAME m1_p1 /* const char * */
327 #define VFS_STAT_LEN m1_i1 /* size_t */
328 #define VFS_STAT_BUF m1_p2 /* struct stat * */
330 /* Field names for the fstat(2) call. */
331 #define VFS_FSTAT_FD m1_i1 /* int */
332 #define VFS_FSTAT_BUF m1_p1 /* struct stat * */
334 /* Field names for the fcntl(2) call. */
335 #define VFS_FCNTL_FD m1_i1 /* int */
336 #define VFS_FCNTL_CMD m1_i2 /* int */
337 #define VFS_FCNTL_ARG_INT m1_i3 /* int */
338 #define VFS_FCNTL_ARG_PTR m1_p1 /* struct flock * */
340 /* Field names for the mknod(2) call. */
341 #define VFS_MKNOD_NAME m1_p1 /* const char * */
342 #define VFS_MKNOD_LEN m1_i1 /* size_t */
343 #define VFS_MKNOD_MODE m1_i2 /* mode_t */
344 #define VFS_MKNOD_DEV m1_ull1 /* dev_t */
346 /* Field names for the open(2), chdir(2), chmod(2), chroot(2), rmdir(2), and
347 * unlink(2) calls.
349 #define VFS_PATH_NAME m3_p1 /* const char * */
350 #define VFS_PATH_LEN m3_i1 /* size_t */
351 #define VFS_PATH_FLAGS m3_i2 /* int */
352 #define VFS_PATH_MODE m3_i2 /* mode_t */
353 #define VFS_PATH_BUF m3_ca1 /* char[M3_STRING] */
355 /* Field names for the creat(2) call. */
356 #define VFS_CREAT_NAME m1_p1 /* const char * */
357 #define VFS_CREAT_LEN m1_i1 /* size_t */
358 #define VFS_CREAT_FLAGS m1_i2 /* int */
359 #define VFS_CREAT_MODE m1_i3 /* mode_t */
361 /* Field names for the chown(2) and fchown(2) calls. */
362 #define VFS_CHOWN_NAME m1_p1 /* const char * */
363 #define VFS_CHOWN_LEN m1_i1 /* size_t */
364 #define VFS_CHOWN_FD m1_i1 /* int */
365 #define VFS_CHOWN_OWNER m1_i2 /* uid_t */
366 #define VFS_CHOWN_GROUP m1_i3 /* gid_t */
368 /* Field names for the fchdir(2) call. */
369 #define VFS_FCHDIR_FD m1_i1 /* int */
371 /* Field names for the fchmod(2) call. */
372 #define VFS_FCHMOD_FD m1_i1 /* int */
373 #define VFS_FCHMOD_MODE m1_i2 /* mode_t */
375 /* Field names for the close(2) call. */
376 #define VFS_CLOSE_FD m1_i1 /* int */
378 /* Field names for the read(2), write(2), and getdents(2) calls. */
379 #define VFS_READWRITE_FD m1_i1 /* int */
380 #define VFS_READWRITE_BUF m1_p1 /* char * */
381 #define VFS_READWRITE_LEN m1_i2 /* size_t */
383 #endif /* !_MINIX_CALLNR_H */