diff options
Diffstat (limited to 'hurd')
46 files changed, 5874 insertions, 0 deletions
diff --git a/hurd/=pending-changes b/hurd/=pending-changes new file mode 100644 index 00000000..d57270a9 --- /dev/null +++ b/hurd/=pending-changes @@ -0,0 +1,24 @@ +User visible: + +Add notification calls to process.defs (and create process_notify.defs). +(not yet) + +Add file_exchange_contents (not yet) + +Change file_getfh and fsys_getfile to use more convenient interface. + +Add serverport arg to auth_user_authenticate; change auth to use it to +abort auth_user_authenticate when it's dead. + +Add optional timeout arg to msg.defs. + +Add file_fetch_dir. + +Delete release arg from register version crap. + +Delete non-string args from io_server_version; separate name and version. + +Not user visible: + +Format of /var/login should be user:1 not user-1. + [Or as subdirectories, if a server supplies directory ops anyway] diff --git a/hurd/ChangeLog b/hurd/ChangeLog new file mode 100644 index 00000000..a066268c --- /dev/null +++ b/hurd/ChangeLog @@ -0,0 +1,969 @@ +1999-10-11 Roland McGrath <roland@baalperazim.frob.com> + + * fs.defs (dir_readdir): Replace dealloc with dealloc[] on out data. + +1999-09-13 Roland McGrath <roland@baalperazim.frob.com> + + * io.defs: Reverted changes related to io_map_segment. + +1999-09-07 Thomas Bushnell, BSG <tb@mit.edu> + + * io.defs (io_map_segment): New RPC. + (io_map): Refer to io_map_segment; label as deprecated. + (io_map_cntl, io_get_conch, io_release_conch, io_prenotify, + io_eofnotify, io_postnotify, io_readnotify, io_readsleep, + io_sigio): Label as deprecated. + +Tue May 11 13:38:50 1999 Thomas Bushnell, BSG <tb@mit.edu> + + * startup.defs: Doc fixes. + +1999-04-27 Roland McGrath <roland@baalperazim.frob.com> + + * hurd_types.h (EXEC_SIGTRAP): New macro. + +Mon Mar 15 14:48:24 1999 Thomas Bushnell, BSG <tb@mit.edu> + + * term.defs (term_get_peername): New RPC, suggested by Mark + Kettenis (kettenis@wins.uva.nl). + +Thu Feb 18 00:29:43 1999 Thomas Bushnell, BSG <tb@mit.edu> + + * tioctl.defs, term.defs: Mark with INTR_INTERFACE. + +Tue Feb 16 04:34:02 1999 Thomas Bushnell, BSG <tb@mit.edu> + + * io.defs (io_revoke): New RPC. + +Sun Jan 31 18:21:58 1999 Thomas Bushnell, BSG <tb@mit.edu> + + * fs.defs (file_utimes): Extend documentation. + +1999-01-24 Roland McGrath <roland@baalperazim.frob.com> + + * Makefile: Add rules for generating prototype ?ioctl.defs files from + a list of C headers that define the ioctl request macros. + (DIST_FILES): Add ioctl-tmpl.sym ioctl.awk gensym.awk. + * gensym.awk, ioctl-decode.h, ioctl-tmpl.sym, ioctl.awk: New files + supporting those rules. + + * ioctls.defs: New file. + +1998-12-27 Roland McGrath <roland@baalperazim.frob.com> + + * hurd_types.h (enum file_storage_class): New values STORAGE_REMAP, + STORAGE_COPY; moved with their comments from libstore/store.h. + +1998-11-29 Roland McGrath <roland@baalperazim.frob.com> + + * hurd_types.defs: Include <bits/utsname.h> instead of + <utsnamelen.h>. Reported by Mark Kettenis <kettenis@phys.uva.nl>. + +Wed Oct 28 22:49:18 1998 Joel N. Weber II <devnull@methedrine.ai.mit.edu> + + * hurd_types.h: Added FSTYPE_HTTP, FSTYPE_MEMFS, and + FSTYPE_ISO9660. + +Tue Aug 11 21:12:06 1998 Thomas Bushnell, BSG <tb@mit.edu> + + * hurd_types.h (dir_changed_type, file_changed_type): Doc fix. + +Thu Jul 30 10:38:30 1998 Thomas Bushnell, BSG <tb@mit.edu> + + * fs.defs (file_notice_changes, dir_notice_changes): Doc fix. + +1998-07-20 Roland McGrath <roland@baalperazim.frob.com> + + * process_request.defs: Delete proc_sethostid, proc_gethostid, + proc_sethostname, and proc_gethostname. + + * password.defs: Fix subsystem decl and random mig syntax errors. + +Wed Jul 15 10:37:44 1998 Thomas Bushnell, n/BSG <tb@mit.edu> + + * fs.defs (dir_lookup): Update interface specification in the + comment to reflect current reality. + +Tue Sep 23 15:52:35 1997 Thomas Bushnell, n/BSG <thomas@gnu.ai.mit.edu> + + * password.defs: New file. + * paths.h (_SERVERS_PASSWORD): New entry. + * subsystems: Add password at 38000. + +Tue Sep 16 15:24:37 1997 Thomas Bushnell, n/BSG <thomas@gnu.ai.mit.edu> + + * process.defs: Delete proc_sethostid, proc_gethostid, + proc_sethostname, and proc_gethostname. + +1997-09-04 Miles Bader <miles@gnu.ai.mit.edu> + + * fsys.defs: Add INTR_INTERFACE. + +Thu Feb 13 19:21:03 1997 Miles Bader <miles@gnu.ai.mit.edu> + + * fs.defs (file_reparent): Renamed from dir_reparent. + +Mon Jan 20 16:34:12 1997 Miles Bader <miles@gnu.ai.mit.edu> + + * fs.defs (dir_reparent): Make PARENT a mach_port_t, not a file_t, + so that libraries that do type translations of file_t won't get + bogus arguments for ports in other filesystems. + +Thu Jan 9 16:44:52 1997 Miles Bader <miles@gnu.ai.mit.edu> + + * fs.defs (dir_reparent): New rpc. + +Thu Sep 26 14:21:01 1996 Thomas Bushnell, n/BSG <thomas@gnu.ai.mit.edu> + + * tioctl.defs (tioctl_tiocext): Add missing "mode" arg. + +Tue Sep 10 11:11:20 1996 Thomas Bushnell, n/BSG <thomas@gnu.ai.mit.edu> + + * Makefile (INSTHDRS): Omit `version.h'. + +Thu Sep 5 10:39:40 1996 Thomas Bushnell, n/BSG <thomas@gnu.ai.mit.edu> + + * version.h: File removed. + +Wed Jul 17 14:30:36 1996 Michael I. Bushnell, p/BSG <mib@gnu.ai.mit.edu> + + * Makefile: gs/install-hdrs/install-headers/g. + +Tue Jul 16 11:37:35 1996 Michael I. Bushnell, p/BSG <mib@gnu.ai.mit.edu> + + * Makefile (INSTHDRS): Repair syntax. + (install-hdrs install): Correctly form pathname. + +Sat Jul 13 20:55:59 1996 Michael I. Bushnell, p/BSG <mib@gnu.ai.mit.edu> + + * Makefile: Rewritten to get the right things installed in the + right places. + + * Makefile (install-hdrs): New target; eq to install. + +Mon Jul 1 16:28:01 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu> + + * crash.defs (crash_dump_task): Use integer_t for sigcode. Add exc, + code, subcode, cttyid_port args. + +Wed Jun 12 15:56:49 1996 Michael I. Bushnell, p/BSG <mib@gnu.ai.mit.edu> + + * startup_notify.defs (subsystem declaration): Use correct value + 29500 from subsystems file. + +Sat May 25 17:09:00 1996 Miles Bader <miles@gnu.ai.mit.edu> + + * msg_request.defs (msg_sig_post_request, + msg_sig_post_untraced_request): Add SIGCODE argument. + +Wed May 22 18:50:14 1996 Miles Bader <miles@gnu.ai.mit.edu> + + * process_reply.defs (proc_wait_reply): Add SIGCODE argument. + +Tue May 14 17:39:24 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu> + + * Makefile (install): Depend on $(includedir)/hurd and add rule to + create it. + +Sat May 11 17:32:20 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu> + + * Makefile: Quick hack for installing headers prior to building libc. + (hdrs): New variable, do wildcarding in $(srcdir). + (DIST_FILES): Use that. + (install): Install $(hdrs) in $(includedir)/hurd from $(srcdir). + +Thu May 9 12:44:43 1996 Michael I. Bushnell, p/BSG <mib@gnu.ai.mit.edu> + + * Makefile (DIST_FILES): Reference *.h, instead of individual + files. + + * Makefile (REMHDRS, dohdrs): Deleted targets. + +Tue May 7 12:54:19 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu> + + * io.defs (io_identity): Server passes back fs id port and st_ino + value. + +Mon May 6 15:28:50 1996 Miles Bader <miles@gnu.ai.mit.edu> + + * msg.defs (msg_describe_ports): New rpc. + + * fs.defs (file_get_storage_info): Change arguments & comment. + +Mon May 6 13:31:04 1996 Michael I. Bushnell, p/BSG <mib@gnu.ai.mit.edu> + + * version.h (hurd_versions): Add version 0.0. + * hurd_types.h (HURD_RELEASE): Update to 0.0. + + * hurd_types.h (struct procinfo): Add exitstatus and sigcode + members. + + * hurd_types.h (FSTYPE_SOCKET): Doc fix. + + * hurd_types.h (retry_type) [FS_RETRY_REAUTH]: Doc fix. + + * hurd_types.h (file_storage_class): Add STORAGE_NULL, + STORAGE_CONCAT, STORAGE_INTERLEAVE, and STORAGE_LAYER. + + * hurd_types.h (struct fsys_statfsbuf): Delete type. + (fsys_statfsbuf_t): Now based upon struct statfs. + * hurd_types.defs (fsys_statfsbuf_t): Now 16 long. + Import <sys/statfs.h>. + + * fsys.defs (fsys_get_options): Add RPT. + + * startup_notify.defs: New file. + * startup.defs (startup_request_notification): NOTIFY_PORT now + mach_port_send_t. New arg NAME. + * subsystems: Add startup_notify. + + * process.defs (proc_getprocinfo): Make FLAGS inout. + + * process.defs (proc_get_tty): New RPC. + * process_request.defs (proc_get_tty_request): Likewise. + + * process.defs (proc_mark_stop, proc_mark_exit): Add SIGCODE arg. + (proc_wait): Return SIGCODE parm too. + * process_request.defs (proc_mark_stop_request, + proc_mark_exit_request): Likewise. + + * process.defs (proc_setowner): Add CLEAR parm. + * process_request.defs (proc_setowner_request): Likewise. + + * process.defs (proc_setmsgport): Return old message port with + mach_port_send_t to permit more flexibility in proc server. + + * fs.defs (file_sync): New parm `omit_metadata'. + (dir_link, dir_rename): Add parm `excl'. + + * io.defs (io_verify_identity): Delete RPC. + (io_identity): New RPC. + +Fri May 3 16:56:22 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu> + + * hurd_types.h (EXEC_INHERITED): Macro removed. + (EXEC_TRACED): Macro removed. + (INIT_TRACEMASK): New enum constant. + + * msg.defs (msg_*_exec_flags): RPCs removed. + + * msg.defs (msg_sig_post, msg_sig_post_untraced): Add SIGCODE arg. + (msg_startup_dosync): RPC removed. + + * io.defs (io_select): Remove ID_TAG arg. + (io_verify_identity): New RPC. + + * auth.defs (auth_user_authenticate, auth_server_authenticate): Remove + second rendezvous port arg, leaving just one, of type mach_port_send_t. + +Tue Apr 30 13:54:34 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu> + + * auth.defs: Mark with INTR_INTERFACE. + (auth_user_authenticate): Remove sreplyport arg. + +Sun Apr 28 19:13:42 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu> + + * interrupt.defs: Remove 1 second waittime spec. + (interrupt_operation): Add waittime arg. + * msg.defs (msg_startup_dosync): Add waittime arg. + +Thu Apr 25 16:27:20 1996 Michael I. Bushnell, p/BSG <mib@gnu.ai.mit.edu> + + * pfinet.defs: New file. + * subsystems: Added pfinet. + +Fri Feb 9 11:30:08 1996 Roland McGrath <roland@churchy.gnu.ai.mit.edu> + + * tioctl.defs: Import hurd/ioctl_types.h with <> instead of "". + +Thu Feb 8 20:35:34 1996 Roland McGrath <roland@churchy.gnu.ai.mit.edu> + + * ioctl_types.h: Protect from multiple inclusion. + +Tue Dec 26 17:47:03 1995 Miles Bader <miles@gnu.ai.mit.edu> + + * io.defs (io_select): Fix ifdefs around the reply port decls to + work properly when the server side ports are desired. + +Wed Dec 20 15:21:41 1995 Miles Bader <miles@gnu.ai.mit.edu> + + * process.defs (proc_getsidport): Use mach_port_send_t instead of + mach_port_make_send_t. + +Tue Dec 19 18:28:35 1995 Miles Bader <miles@gnu.ai.mit.edu> + + * process.defs (proc_getsidport): Make SESSPORT's type + mach_port_make_send_t, since proc always just holds a receive right. + +Mon Dec 11 15:21:42 1995 Michael I. Bushnell, p/BSG <mib@gnu.ai.mit.edu> + + * Makefile (DIST_FILES): Added netfs.h. + (REMHDRS): Added ../libnetfs/netfs.h. + +Fri Dec 1 15:45:11 1995 Michael I. Bushnell, p/BSG <mib@gnu.ai.mit.edu> + + * tioctl.defs (tioctl_tiocsig): Needs one int arg. + +Tue Nov 21 09:58:13 1995 Michael I. Bushnell, p/BSG <mib@gnu.ai.mit.edu> + + * interrupt.defs (interrupt_operation): Include SEQNO server + argument. + +Mon Nov 20 18:26:52 1995 Miles Bader <miles@gnu.ai.mit.edu> + + * msg_request.defs: Add skip for `Obsolete io_select_done' + to match msg.defs. + * msg_reply.defs: Ditto. + +Sat Nov 18 23:33:55 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu> + + * crash.defs (crash_dump_task): Add sreplyport arg. + * crash_reply.defs: New file. + +Mon Nov 13 15:05:04 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu> + + * exec.defs (exec_startup): RPC removed; replaced with skip. + +Fri Nov 10 10:02:17 1995 Miles Bader <miles@gnu.ai.mit.edu> + + * process_request.defs: New file. + +Sat Nov 4 23:15:01 1995 Miles Bader <miles@gnu.ai.mit.edu> + + * fsys_reply.defs (fsys_startup_reply, fsys_get_options_reply): Tyop. + +Tue Oct 31 15:54:20 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu> + + * hurd_types.h: Add missing */. + +Tue Oct 31 14:14:39 1995 Michael I. Bushnell, p/BSG <mib@gnu.ai.mit.edu> + + * process.defs (proc_getprocinfo): New parm THREADWAITS. + +Tue Oct 31 02:23:55 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu> + + * msg.defs (msg_report_wait): Add string out arg. + +Mon Oct 30 10:41:06 1995 Michael I. Bushnell, p/BSG <mib@gnu.ai.mit.edu> + + * hurd_types.h (PI_FETCH_TASKINFO, PI_FETCH_THREADS, + PI_FETCH_THREAD_BASIC, PI_FETCH_THREAD_SCHED, + PI_FETCH_THREAD_WAITS): New flags. + (procinfo): New (buried) members `rpc_block' and `died'. + * msg.defs (msg_report_wait): Change second arg to be a real + thread_t. Change returned reason from a string to an rpc code. + + * process.defs (proc_getprocinfo): New parm FLAGS. + + * hurd_types.h (enum file_storage_class): Added new classes + STORAGE_MEMORY and STORAGE_TASK. Doc fixes. Drop all the MUTATED + bits. + (STORAGE_MUTATED) New flag. + * fs.defs (file_get_storage_info): New parm FLAGS. + + * hurd_types.h (PI_LOGINLD, PI_WAITING, PI_TRACED, PI_GETMSG): New + flags. + + * io.defs (io_select): Make sreply port also available if + IO_SELECT_REPLY_PORT is defined. + +Fri Oct 27 14:43:17 1995 Michael I. Bushnell, p/BSG <mib@gnu.ai.mit.edu> + + * fsys.defs (fsys_startup): New parm OPENFLAGS. + + * hurd_types.defs (SCP): New macro. + * io.defs (io_write, io_restrict_auth): Add SCP to incoming + variable sized arrays. + * socket.defs (socket_create_address, socket_setopt, socket_send): + Likewise. + * fs.defs (file_exec, file_set_translator): Likewise. + + * socket.defs (socket_create_address): Drop parm `binding'. + + * fs.defs: Added reply port option to all RPC's. + + * fsys.defs (fsys_get_options): New RPC. + * fsys_reply.defs (fsys_get_options_reply): New stub. + * fs.defs (file_get_fs_options): New RPC. + + * msg.defs (msg_report_wait): New RPC. + + * fs.defs (file_invoke_translator): Function deleted. + + * fsys_reply.defs (fsys_startup_reply, fsys_getfile_reply, + fsys_syncfs_reply, fsys_set_options_reply, fsys_getpriv_reply, + fsys_forward_reply): New functions, completing interface. + + * fsys.defs: Doc fix. + +Wed Oct 25 15:59:25 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu> + + * exec_startup.defs: New file. + * subsystems: Add exec_startup at 30500. + +Thu Oct 12 16:56:52 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu> + + * exec.defs: Add INTR_INTERFACE marker. + + * fs.defs (file_exec): Remove dealloc[] keywords, and revert + EXEC_TASK arg to task_t from mach_port_send_t. We cannot safely + use dealloc ool or move rights with the current RPC system. + +Tue Oct 10 17:29:31 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu> + + * exec.defs [EXEC_IMPORTS]: Use this if defined. + (exec_exec, exec_init, exec_setexecdata): Use file_t for receiver. + (exec_exec): Use mach_port_send_t for FILE. + +Sat Oct 7 05:26:20 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu> + + * fs.defs (file_exec): Add dealloc[] flag to most args. + +Fri Oct 6 17:18:36 1995 Miles Bader <miles@gnu.ai.mit.edu> + + * fsys.defs (fsys_getpriv): Change types of returned ports to + mach_port_send_t. + + * fs.defs (file_get_storage_info): Change type of ADDRESSES to + off_array_t. Add ADDRESS_UNITS out parameter. + (dir_link): Swap the DIR and FILE parameters. + + * hurd_types.defs (off_array_t, size_t, ssize_t): New types. + * hurd_types.h (off_array_t): New type. + +Tue Oct 3 13:51:00 1995 Michael I. Bushnell, p/BSG <mib@gnu.ai.mit.edu> + + * hurd_types.h (struct fsys_statfsbuf): fsys_stb_bsize -> + fsys_stb_iosize. fsys_stb_fsize -> fsys_stb_bsize. + +Tue Sep 26 11:16:56 1995 Michael I. Bushnell, p/BSG <mib@gnu.ai.mit.edu> + + * hurd_types.h (file_storage_class): New type. + * fs.defs (file_get_storage_info): New RPC; use the slot that used + to hold file_pathconf. + +Sun Sep 17 17:57:48 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu> + + * fs.defs (file_truncate): RPC renamed to file_set_size. + + * io.defs (io_pathconf): New RPC. + * fs.defs (file_pathconf): RPC removed (replaced with skip). + + * hurd_types.h (EXEC_STACK_ARGS): New macro. + +Fri Sep 15 21:32:15 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu> + + * subsystems: core renamed to crash. + * paths.h (_SERVERS_CRASH): New macro. + (_SERVERS_CORE): Macro removed. + * core.defs: Renamed to crash.defs. + * crash.defs (crash_dump_task): Renamed from core_dump_task. + +Thu Aug 24 11:55:28 1995 Miles Bader <miles@churchy.gnu.ai.mit.edu> + + * fsys.defs (fsys_forward): New rpc. + * subsystems: Remove tserver. + * tserver.defs: Removed. + +Mon Aug 21 14:08:52 1995 Miles Bader <miles@churchy.gnu.ai.mit.edu> + + * tserver.defs (tserver_translate): New file. + * subsystems: Add tserver. + +Mon Jul 17 15:05:16 1995 Miles Bader <miles@churchy.gnu.ai.mit.edu> + + * socket.defs (socket_create): Change type of SERVER to pf_t. + (socket_create_address, socket_fabricate_address): Rename first + arg to `server', of type mach_port_t (so it can be either pf_t or + socket_t). + (socket_recv): Change type of ADDR to mach_port_send_t. + (socket_send, socket_recv): Change type of AMOUNT to + mach_msg_type_number_t. + * hurd_types.h (pf_t): New type. + * hurd_types.defs (pf_t): New type. + +Mon Jun 26 19:23:38 1995 Michael I Bushnell <mib@duality.gnu.ai.mit.edu> + + * fsys_reply.defs (fsys_goaway_reply): New routine, in its proper + place. + +Fri May 12 18:54:17 1995 Miles Bader <miles@churchy.gnu.ai.mit.edu> + + * fsys.defs (fsys_set_options, fsys_mod_readonly): Replace + mod_readonly with the more general set_options interface. + +Mon Mar 20 21:44:59 1995 Michael I Bushnell <mib@duality.gnu.ai.mit.edu> + + * Makefile (REMHDRS): Add ../libps/ps.h. + +Mon Mar 6 15:25:27 1995 Miles Bader <miles@churchy.gnu.ai.mit.edu> + + * process.defs: Doc fix. + +Tue Jan 17 03:14:22 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu> + + * msg_request.defs: Fix typo reply->request. + + * io.defs (io_select): Add user reply port and reply timeout args. + Make arg SELECT_TYPE inout, remove SELECT_RESULT out arg. + * io_reply.defs: Synchronize with new io_select definition. + + * hurd_types.h (EXEC_INHERITED): New macro. + + * msg_reply.defs: Prepend `msg_' to all RPC names. + (dir_changed, file_changed): Remove these skips. + * msg_request.defs: Prepend `msg_' to all RPC names. Add + msg_sig_post_untraced_reply and intervening skips. + * msg.defs: Prepend `msg_' to all RPC names. + (dir_changed, file_changed): RPCs moved to fs_notify.defs. + (msg_get_exec_flags, msg_set_exec_flags, + msg_set_some_exec_flags, msg_clear_some_exec_flags): New RPCs. + * fs_notify.defs: New file, broken out of msg.defs. + * subsystems: Add fs_notify at 20500. + + * msg_reply.defs: Add sig_post_untraced_reply, and intervening skips. + +Mon Jan 16 17:34:34 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu> + + * hurd_types.h (EXEC_TRACED): New macro. + * msg.defs (sig_post_untraced): New RPC. + + * msg.defs (io_select_done): RPC removed, replaced with a skip. + * io_reply.defs: Add ID_TAG arg. + * io_request.defs (io_select_request): Remove RETURN_PORT arg. + * io.defs (io_select): Remove RETURN_PORT arg; make ID_TAG inout. + +Fri Dec 9 00:35:47 1994 Roland McGrath <roland@churchy.gnu.ai.mit.edu> + + * io.defs (io_read, io_write, io_readable): Use + mach_msg_type_number_t in place of int. + +Tue Sep 13 11:03:23 1994 Michael I Bushnell <mib@churchy.gnu.ai.mit.edu> + + * auth.defs (auth_getids, auth_server_authenticate): Reverse + these changes; the auth server doesn't want them. + + * msg.defs (get_init_ports, get_init_ints, get_dtable, + get_env_variable): Added `dealloc' to variable sized OUT parameters. + +Mon Sep 12 19:28:35 1994 Michael I Bushnell <mib@churchy.gnu.ai.mit.edu> + + * auth.defs (auth_getids, auth_server_authenticate): Added + `dealloc' to variable sized OUT parameters. + * fs.defs (file_getfh, dir_readdir, file_get_translator): Likewise. + * io.defs (io_read): Likewise. + * login.defs (login_get_location, login_get_input_devices): Likewise. + * process.defs (proc_gethostname, proc_getallpids, + proc_getexecdata, proc_getprocargs, proc_getprocenv, + proc_getloginpids, proc_getsessionpgids, proc_getsessionpids, + proc_getpgrppids): Likewise. + * socket.defs (socket_whatis_address, socket_getopt, socket_recv): + Likewise. + +Sat Sep 10 06:08:19 1994 Roland McGrath <roland@churchy.gnu.ai.mit.edu> + + * tioctl.defs (sizes_t): Rename to winsize_t; make struct, not array. + * ioctl_types.h (sizes_t): Removed. + (winsize_t): New typedef for struct winsize. + (modes_t, speeds_t, cc_t): Use proper termios.h types. + +Tue Aug 30 04:23:25 1994 Roland McGrath <roland@churchy.gnu.ai.mit.edu> + + * fs.defs (dir_pathtrans): Renamed to dir_lookup; fixed comment. + +Fri Aug 26 12:45:51 1994 Michael I Bushnell <mib@geech.gnu.ai.mit.edu> + + * fs.defs (file_set_translator): Separate FLAGS arg into PASSIVE_FLAGS + and ACTIVE_FLAGS; rename TRANS and EXISTING args to less confusing + names. + * hurd_types.h: New flag FS_TRANS_SET. + +Thu Aug 25 11:55:27 1994 Michael I Bushnell <mib@geech.gnu.ai.mit.edu> + + * auth.defs (auth_user_authenticate, auth_server_authenticate): + Changed rend_int to be a port; mach_port_send_t on both sides. + * io.defs (io_reauthenticate): Pass a port instead of an int + for secondary rendezvous. + * process.defs (proc_reauthenticate): Pass a port instead of an + int for secondary rendezvous. + + * hurd_types.h (retry_type): Removed FS_RETRY_NONE; added + explicit initializers to keep the values constant. + + * hurd_types.h (FSTYPE_EXT2FS): New macroo. + + * hurd_types.h (struct procinfo): New member `logincollection'. + + * fsys.defs (fsys_syncfs, fsys_mod_readonly): New RPC's. + * fsys_reply.defs: Added two skips corresponding to new RPC's. + +Wed Aug 17 20:03:29 1994 Roland McGrath <roland@churchy.gnu.ai.mit.edu> + + * io.defs (io_select): Make RETURN_PORT arg mach_port_poly_t. + * msg.defs (io_select_done): Make NOTIFY_PORT arg mach_port_poly_t. + +Wed Aug 17 15:23:03 1994 Michael I Bushnell <mib@geech.gnu.ai.mit.edu> + + * term.defs (termctty_open_terminal): New RPC. + +Mon Aug 15 11:49:54 1994 Michael I Bushnell <mib@geech.gnu.ai.mit.edu> + + * startup.defs (startup_essential_task): Add sreplyport arg. + * startup_reply.defs: Add startup_essential_task_reply. + +Tue Aug 9 19:43:50 1994 Roland McGrath <roland@churchy.gnu.ai.mit.edu> + + * core.defs (core_dump_task): Add SIGERROR arg. + + * interrupt.defs (INTERRUPT_TIMEOUT): New macro. + Specify `waittime' with that value. + +Mon Aug 8 15:49:30 1994 Michael I Bushnell <mib@churchy.gnu.ai.mit.edu> + + * Makefile: Rewritten in accord with new scheme. + +Thu Jul 21 15:44:43 1994 Michael I Bushnell <mib@geech.gnu.ai.mit.edu> + + * Makefile (DIST_FILES, HDRS): Name header files explicitly. + +Fri Jul 15 22:53:29 1994 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * subsystems: Rename utmp to login. + Mark begin and end of spread of subsystems used by ioctls. + * login.defs: Renamed from utmp.defs; renamed all calls. + +Fri Jul 15 18:20:34 1994 Michael I Bushnell (mib@churchy.gnu.ai.mit.edu) + + * fsys.defs (fsys_startup): Remove DOTDOT_NODE. + (fsys_getroot): Add arg DOTDOT_NODE. + +Thu Jul 14 11:46:56 1994 Michael I Bushnell (mib@churchy.gnu.ai.mit.edu) + + * utmp.defs: New file. + +Mon Jul 11 20:07:52 1994 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * hurd_types.defs (INTR_ROUTINE): Macro removed. + (INTR_INTERFACE): New macro. + * fs.defs: Invoke INTR_INTERFACE. Remove all INTR_ROUTINE uses. + * io.defs, process.defs, socket.defs: Likewise. + +Fri Jul 8 15:53:02 1994 Michael I Bushnell (mib@churchy.gnu.ai.mit.edu) + + * hurd_types.h (retry_type): Added new magical types "machtype" + and "/". + * fs.defs (dir_pathtrans): Doc fix. + + * msg.defs: Doc fix. + + * process.defs (proc_wait): Doc fix. + + * socket.defs (socket_fabricate_address): Added sockaddr_type + arg. + +Fri Jul 8 15:26:19 1994 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * fs.defs (file_invoke_translator): New RPC. + + * hurd_types.defs (INTR_ROUTINE): New macro. + * socket.defs: Use INTR_ROUTINE for all interruptible RPCs. + * process.defs: Likewise. + * fs.defs: Likewise. + (dir_readdir): Make this interruptible. + +Fri Jul 8 14:22:11 1994 Michael I Bushnell (mib@churchy.gnu.ai.mit.edu) + + * tioctl.defs: Remove ifdefs that were omitting most of the + ioctls. Added RPCs for missing codes 118-123. Added + block of skips between 99 and 100. Added INTR to appropriate + calls. + +Tue Jul 5 14:46:49 1994 Michael I Bushnell (mib@churchy.gnu.ai.mit.edu) + + * Makefile (DIST_FILES): Added subsystems. + + * fsys_reply.defs: Added fsys_getroot_reply in its proper place. + +Wed Jun 29 13:06:42 1994 Michael I Bushnell (mib@geech.gnu.ai.mit.edu) + + * ifsock.defs (ifsock_setsockaddr, ifsock_assume_responsibility): + Deleted RPCs. + + * msg.defs (set_init_port, set_fd): Change back to using + mach_port_send_t instead of mach_port_t for PORT arg. + +Tue Jun 28 18:39:02 1994 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * msg.defs (get_dtable, set_dtable): Add REFPORT arg. + (get_fd, set_fd): Add REFPORT and FD args. + (set_init_port, set_fd): Use mach_port_t instead of + mach_port_send_t for PORT arg. + (get_environment): Add dealloc flag to VALUE arg. + + * fsys.defs: Add RPT arg to all routines except fsys_init (which + has an unconditional sreplyport arg). + + * hurd_types.defs (sreply_port_t): New type. + (RPTDECL, RPT, RPTLAST): New macros (moved from io.defs). + * io.defs (reply_port_t): Type removed. + (RPTDECL, RPT, RPTLAST): Macros moved to hurd_types.defs. + * auth.defs (reply_port_t): Type removed. + (auth_user_authenticate, auth_server_authenticate): Use + sreply_port_t in place of reply_port_t. + * fsys.defs (fsys_init): Likewise. + + * msg.defs (sig_post): Likewise. + * process.defs (proc_getmsgport, proc_setmsgport, proc_wait): Likewise. + * startup.defs (startup_procinit, startup_authinit): Likewise. + +Fri Jun 24 03:54:53 1994 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * term.defs (term_become_ctty): Renamed to term_open_ctty. + + * process.defs (proc_setprocargs): Renamed to proc_set_arg_locations. + (proc_get_arg_locations): New rpc. + * process_reply.defs: Add skip for proc_get_arg_locations. + +Thu Jun 23 11:59:49 1994 Michael I Bushnell (mib@churchy.gnu.ai.mit.edu) + + * term.defs (term_become_ctty): Delete SIGPT arg. + +Wed Jun 22 16:34:51 1994 Michael I Bushnell (mib@churchy.gnu.ai.mit.edu) + + * term.defs: Changed NEWTTY arg to be mach_port_send_t. + +Thu Jun 16 00:48:45 1994 Roland McGrath (roland@geech.gnu.ai.mit.edu) + + * hurd_types.defs (file_changed_type_t, dir_changed_type_t): New types. + * hurd_types.h (INIT_PORT_LOGINCOLL): Removed. + (dir_changed_type_t, file_changed_type_t): New typedefs. + + * fs.defs (file_check_access): Renamed from file_access, interface + changed. + +Wed Jun 15 21:24:46 1994 Michael I Bushnell (mib@churchy.gnu.ai.mit.edu) + + * fsys.defs (fsys_getroot): New interface; similar to + fs.defs:dir_pathtrans. This eliminates the noxious need for + dir_pathtrans to work on null pathnames for non directories. This + is the Right Thing. + + * fs.defs (file_get_translator_cntl): Return port as + `mach_port_send_t' not `fsys_t'. + +Wed Jun 15 12:13:35 1994 Michael I Bushnell (mib@geech.gnu.ai.mit.edu) + + * fs.defs (file_access): New RPC. + +Tue Jun 14 13:57:18 1994 Michael I Bushnell (mib@geech.gnu.ai.mit.edu) + + * hurd_types.h: Reorganized; many comments fixed or improved. + + * hurd_types.h (enum verstype): Removed declaration. + (enum term_bottom_type): New type. + (TERM_ON_MACHDEV, TERM_ON_HURDIO, TERM_ON_MASTERPTY): Moved + into enum above. + (FSTYPE_SOCKET, FSTYPE_MISC): New macros. + + * msg.defs (dir_changed, file_changed): New RPCs. + * fs.defs (dir_notice_changes, file_notice_changes): New RPCs. + * hurd_types.h (enum dir_changed_type, enum file_changed_type): + New declarations. + + * fs.defs (dir_readdir): Totally new interface. + +Mon Jun 13 07:14:23 1994 Roland McGrath (roland@geech.gnu.ai.mit.edu) + + * socket.defs: Corrected subsystem to 26000; was 20000, same as fs. + +Mon Jun 6 23:07:08 1994 Roland McGrath (roland@geech.gnu.ai.mit.edu) + + * ioctl_types.h (modes_t, speeds_t, ccs_t, sizes_t): Make these + arrays of the appopriate sizes, not pointers. + +Sun Jun 5 22:41:08 1994 Roland McGrath (roland@geech.gnu.ai.mit.edu) + + * tioctl.defs: Fix subsystem. + +Fri May 27 07:53:15 1994 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * exec.defs (exec_exec): Add `servercopy' flag to DTABLE, + PORTARRAY, and INTARRAY args. + (exec_startup): Add `dealloc' flag to ARGV, ENVP, PORTARRAY, and + INTARRAY args. + (exec_setexecdata): Add `servercopy' flag to PORTS and INTS args. + +Wed May 25 13:32:31 1994 Michael I Bushnell (mib@churchy.gnu.ai.mit.edu) + + * io_reply.defs (io_readable_reply, io_get_openmodes_reply): Fix + typos. + +Thu May 12 00:43:08 1994 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * fsys_reply.defs: New file. + * fsys.defs (reply_port_t): Define type. + (fsys_init): Add sreplyport arg. + + * process.defs (proc_setmsgport): Add sreplyport arg. + * process_reply.defs: Add proc_setmsgport_reply. + + * version.h: Added multiple inclusion protection. + (struct hurd_version): Fixed `vers' member. + (hurd_versions): Add braces. + +Wed May 11 16:05:43 1994 Michael I Bushnell (mib@geech.gnu.ai.mit.edu) + + * startup.defs (startup_uname, startup_register_version): For + some bizzaro reason these didn't get removed. Now they are for real. + +Tue May 10 18:17:41 1994 Michael I Bushnell (mib@geech.gnu.ai.mit.edu) + + * tioctl.defs, ioctl_types.h: New files. + +Mon May 9 14:28:06 1994 Michael I Bushnell (mib@geech.gnu.ai.mit.edu) + + * version.h: New file. + + * startup.defs (startup_uname, startup_register_version): Removed + * process.defs (proc_uname, proc_register_version): New RPCs. + * process_reply.defs: Added skips corresponding to proc_name + and proc_register_version. + +Wed May 4 01:01:11 1994 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * msg_request.defs: New file. + +Sun May 1 17:40:48 1994 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * hurd_types.h (utsname_t): New typedef. + * hurd_types.defs (utsname_t): Define type for MiG. + Import <sys/utsname.h>. + +Fri Apr 29 16:19:10 1994 Michael I Bushnell (mib@churchy.gnu.ai.mit.edu) + + * io.defs (io_prenotify, io_postnotify): File offsets should be + vm_offset_t. + + * io.defs (io_async): NOTIFY_PORT and ASYNC_ID_PORT + should be mach_port_send_t. + (io_get_icky_async_id): ICKY_ASYNC_ID_PORT should be + mach_port_send_t. + (io_map_cntl): Returned object should be mach_port_send_t. + + * io.defs: Added new type reply_port_t; added sreplyport of + that type to all the stubs when REPLY_PORTS is defined. + + * term.defs (term_getctty): CTTY arg should be mach_port_send_t + for the convenience of servers. + + * io.defs (io_readnotify): New RPC. + * shared.h (use_readnotify_size, readnotify_size): New members. + + * socket.defs: Change ports returned from servers to be + mach_port_send_t for the convenience of servers. + + * ifsock.defs (ifsock_assume_responsibility): Just take over the + bootstrap port directly; this is more reliable anyway. + + * fs.defs (file_set_translator): EXISTING arg should be + mach_port_send_t. + + * shared.h (shared_io): Added optimal_transfer_size. + + * hurd_types.h (HURD_RELEASE): New macro. + + * startup.defs (startup_uname, startup_register_version): New + RPCs. + + * startup.defs (startup_essential_task): require host priv port + for security. + + * exec.defs (exec_exec) : FILE arg should be mach_port_send_t. + +Thu Apr 28 22:58:14 1994 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * msg.defs (reply_port_t): Define type. + (sig_post): Use reply_port_t for sreplyport arg; remove #ifdef. + * msg_reply.defs (reply_port_t): Define type. + (sig_post_reply): Use reply_port_t for first arg. + +Wed Apr 27 06:39:46 1994 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * msg.defs (sig_post): Put sreplyport arg inside #ifdef MSG_SREPLYPORT. + +Thu Apr 21 21:17:37 1994 Roland McGrath (roland@geech.gnu.ai.mit.edu) + + * msg.defs (get_init_port, set_init_port, get_fd, set_fd): Make + PORT arg mach_port_send_t. + (get_environment, set_environment, + get_env_variable, set_env_variable): New routines. + +Thu Feb 17 17:59:13 1994 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * hurd_types.defs (io_statbuf_t): Change size to 32 ints. + +Tue Feb 8 20:53:25 1994 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * msg_reply.defs: Change subsystem to `msg_reply'. MiG-generated + header files use `#ifndef _subsystem_user_' to protect against + multiple inclusion, so two headers with the same subsystem conflict. + +Thu Feb 3 03:45:18 1994 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * hurd_types.h: Include <mach/task_info.h> and <mach/thread_info.h> + before using task_basic_info and thread_basic_info in sturct procinfo. + +Mon Jan 24 17:33:00 1994 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * msg_reply.defs: New file. + +Tue Dec 21 01:11:04 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * socket.defs: Fix typos. + +Mon Dec 6 22:52:00 1993 Michael I Bushnell (mib@geech.gnu.ai.mit.edu) + + * Made snapshot. + +Mon Dec 6 22:36:33 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * hurd_types.defs (flock_t): Defined. + * hurd_types.h (flock_t): Added typedef. + +Mon Dec 6 19:28:27 1993 Michael I Bushnell (mib@geech.gnu.ai.mit.edu) + + * process.defs (proc_get_collports): Designate as INTR, also + return the pids. + +Wed Dec 1 21:41:06 1993 Michael I Bushnell (mib@geech.gnu.ai.mit.edu) + + * hurd_types.h: Remove deprecated information: + INBAND_MAX_DATA, FS_LOOKUP_* bits. + Added PI_ZOMBIE. + + * process.defs (proc_getmsgport): Now is INTR. + + * io.defs (io_get_conch, io_release_conch, io_eofnotify, + io_prenotify, io_postnotify, io_readsleep, io_sigio): + Remove cntl argument. + +Tue Nov 23 12:18:21 1993 Michael I. Bushnell (mib at ernst.gnu.ai.mit.edu) + + * fsys.defs (fsys_startup): control_port is now mach_port_send_t. + + * io.defs (io_map): remove `xx' argument. + + * process.defs (proc_handle_exceptions): forwardport is now + mach_port_send_t. + + * auth.defs, auth_reply.defs: Removed auth_combine and extended + auth_makeauth to take multiple auth ports. + + * shared.h, io.defs: Changed `it' terminology to `conch'. + +Mon Nov 22 22:58:59 1993 Michael I Bushnell (mib@geech.gnu.ai.mit.edu) + + * io.defs: Changed io_map to use mach_port_send_t. + + * auth.defs: Changed auth_user_authenticate arg newport to be + mach_port_send_t. diff --git a/hurd/Makefile b/hurd/Makefile new file mode 100644 index 00000000..1b133aaa --- /dev/null +++ b/hurd/Makefile @@ -0,0 +1,79 @@ +# +# Copyright (C) 1993, 94, 95, 96, 99 Free Software Foundation +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation; either version 2, or (at +# your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +dir := hurd +makemode := misc + +hdrs = $(wildcard $(srcdir)/*.defs $(srcdir)/*.h) +DIST_FILES = subsystems $(notdir $(hdrs)) ioctl-tmpl.sym ioctl.awk gensym.awk + +INSTHDRS = hurd_types.h ioctl_types.h paths.h shared.h \ + $(notdir $(wildcard $(srcdir)/*.defs)) + +include ../Makeconf + +install-headers install: $(includedir)/hurd \ + $(addprefix $(includedir)/hurd/,$(INSTHDRS)) + +$(includedir)/hurd/%: $(srcdir)/%; $(INSTALL_DATA) $< $@ + +$(includedir)/hurd:;mkdir -p $@ + + + +# +# The following rules assist in creating an `Xioctl.defs' file +# to define RPCs that are sent primarily by ioctl commands. +# To use them, write a file `Xioctl-headers.h', e.g. for `mioctl-headers.h': +# #include <sys/mtio.h> +# with an #include for each header that defines ioctl request macros +# using _IO('X') et al. Then `make Xioctl-proto.defs' will create +# a prototype file for you to hand-edit into `Xioctl.defs'. + +# Building foo.h from foo.sym: +%.symc: %.sym + $(AWK) -f $(srcdir)/gensym.awk $< >$*.symc +%.symc.o: %.symc + $(CC) -S $(CPPFLAGS) $(CFLAGS) $(CPPFLAGS-$@) -x c -o $@ $< +%.h: %.symc.o + sed <$< -e 's/^[^*].*$$//' | \ + sed -e 's/^[*]/#define/' -e 's/mAgIc[^-0-9]*//' -e '/^ *$$/d' >$@ + +%-ioctls.sym: tmpl-ioctls.sym + sed 's|HEADER|<$(subst +,/,$*)>|' $< > $@ + +cpp = $(CC) $(CPPFLAGS) $(CFLAGS) $(CPPFLAGS-$@) -E -x c + +%ioctl-requests.list: %ioctl-headers.h + $(cpp) $< | sed -n 's/^#.*"\([^"]*\)".*$$/\1/p' | sort | uniq | \ + while read f; do \ + sed -n 's/^[ ]*#[ ]*define[ ]*\([A-Z0-9_]*\)[^A-Z0-9_][^A-Z0-9_]*_IO.*'\'$*\'.*$$'/\1/p' $$f; \ + done | sort | uniq > $@ + +%ioctl.defs: %ioctl.sym + +%ioctl-values.sym: %ioctl-headers.h %ioctl-requests.list ioctl-tmpl.sym + (sed 's%@HEADER_LIST@%$<%;s/@GROUP@/$*/g' < $(filter %.sym,$^); \ + while read r; do \ + for x in CMD SUBID INOUT TYPE \ + TYPE0 TYPE1 TYPE2 COUNT0 COUNT1 COUNT2; do \ + echo "expr $${x}($${r}) $${r}_$${x}"; \ + done; \ + done < $(filter %.list,$^)) > $@ + +%ioctl-proto.defs: %ioctl-values.h ioctl.awk + sed 's/^#define//;s/_/ /g' $< | $(AWK) -f $(filter %.awk,$^) > $@ diff --git a/hurd/auth.defs b/hurd/auth.defs new file mode 100644 index 00000000..ad80cfb5 --- /dev/null +++ b/hurd/auth.defs @@ -0,0 +1,80 @@ +/* Definitions for the authentication server + Copyright (C) 1991, 1992, 1993, 1994, 1996 Free Software Foundation + +This file is part of the GNU Hurd. + +The GNU Hurd is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +The GNU Hurd is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with the GNU Hurd; see the file COPYING. If not, write to +the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ + +subsystem auth 25000; + +#include <hurd/hurd_types.defs> + +#ifdef AUTH_IMPORTS +AUTH_IMPORTS +#endif + +INTR_INTERFACE + +/* Throughout, uid's and gid's are passed as arrays. One of these + arrays is called the "effective" ids; these id's should be used to + compute whether a given user is permitted a given operation. The + other array is called the "available" ids; these should not be used + for such computation (though they can be turned into effective ids + when calling auth_makeauth). The first available id is + conventionally called the "real" id, and the second the "saved" id. */ + +/* Given an authentication handle, return the identification. */ +routine auth_getids ( + handle: auth_t; + out euids: idarray_t; + out auids: idarray_t; + out egids: idarray_t; + out agids: idarray_t); + +/* Create a new authentication handle. */ +routine auth_makeauth ( + handle: auth_t; + other_handles: portarray_t; + euids: idarray_t; + auids: idarray_t; + egids: idarray_t; + agids: idarray_t; + out newhandle: mach_port_make_send_t); + +/* Called by a user in a reauthentication transaction. The rendezvous + port is used to match the request up with the server's + auth_server_authenticate call. The newport is a port provided by + the server. */ +routine auth_user_authenticate ( + handle: auth_t; + rendezvous: mach_port_send_t; + out newport: mach_port_send_t); + +/* Called by a server in a reauthentication transaction. The + rendezvous port is used to match the request up with the user's + auth_user_authenticate call. The newport is passed to the user + through the authentication server. The identification information + is returned. */ +routine auth_server_authenticate ( + handle: auth_t; + sreplyport reply: mach_port_poly_t; + rendezvous: mach_port_send_t; + newport: mach_port_poly_t; + out euids: idarray_t; + out auids: idarray_t; + out egids: idarray_t; + out agids: idarray_t); + + diff --git a/hurd/auth_reply.defs b/hurd/auth_reply.defs new file mode 100644 index 00000000..10530fa7 --- /dev/null +++ b/hurd/auth_reply.defs @@ -0,0 +1,44 @@ +/* Reply-only side of auth interface + Copyright (C) 1991, 1993, 1994 Free Software Foundation + +This file is part of the GNU Hurd. + +The GNU Hurd is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +The GNU Hurd is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with the GNU Hurd; see the file COPYING. If not, write to +the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ + +/* Written by Michael I. Bushnell. */ + +subsystem auth_reply 25100; /* must match auth.defs + 100 */ + +#include <hurd/hurd_types.defs> + +type reply_port_t = polymorphic | MACH_MSG_TYPE_PORT_SEND_ONCE + ctype: mach_port_t; + +skip; /* auth_getids */ +skip; /* auth_makeauth */ + +simpleroutine auth_user_authenticate_reply ( + reply_port: reply_port_t; + in return_code: kern_return_t; + in newhandle: mach_port_send_t); + +simpleroutine auth_server_authenticate_reply ( + reply_port: reply_port_t; + in return_code: kern_return_t; + in gen_uids: idarray_t; + in aux_uids: idarray_t; + in gen_gids: idarray_t; + in aux_gids: idarray_t); + diff --git a/hurd/crash.defs b/hurd/crash.defs new file mode 100644 index 00000000..442957d1 --- /dev/null +++ b/hurd/crash.defs @@ -0,0 +1,45 @@ +/* MiG protocol for handling program crashes. + Copyright (C) 1992, 1994, 1995, 1996 Free Software Foundation, Inc. + +This file is part of the GNU Hurd. + +The GNU Hurd is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +The GNU Hurd is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with the GNU Hurd; see the file COPYING. If not, write to +the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ + +/* Written by Roland McGrath. */ + +subsystem crash 32000; + +#include <hurd/hurd_types.defs> + +/* Handle a crashing task, whose task control port is TASK. + + FILE is a file port open for writing. The caller will link it to "core" + (or whatever name) if the RPC returns success. + + SIGNO, SIGCODE, and SIGERROR indicate the signal that killed the + process. EXC is zero for a software signal; otherwise EXC, CODE, and + SUBCODE are the original Mach exception codes. + + CTTYID_PORT is the process's ctty's identification port, for use + in sending stop signals to the process group. */ + +routine crash_dump_task ( + crashserver: mach_port_t; + sreplyport reply: sreply_port_t; + task: task_t; + file: file_t; + signo: int; sigcode: integer_t; sigerror: int; + exc: natural_t; code: natural_t; subcode: natural_t; + cttyid_port: mach_port_send_t); diff --git a/hurd/crash_reply.defs b/hurd/crash_reply.defs new file mode 100644 index 00000000..6231650a --- /dev/null +++ b/hurd/crash_reply.defs @@ -0,0 +1,30 @@ +/* MiG protocol for handling program crashes, reply half. + Copyright (C) 1992, 1994, 1995 Free Software Foundation + +This file is part of the GNU Hurd. + +The GNU Hurd is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +The GNU Hurd is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with the GNU Hurd; see the file COPYING. If not, write to +the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ + +/* Written by Roland McGrath. */ + +subsystem crash_reply 32100; /* must match crash + 100 */ + +#include <hurd/hurd_types.defs> + +/* This file must correspond to crash.defs. */ + +simpleroutine crash_dump_task_reply ( + ureply_port: mach_port_poly_t; + result: int); diff --git a/hurd/exec.defs b/hurd/exec.defs new file mode 100644 index 00000000..8c9b1491 --- /dev/null +++ b/hurd/exec.defs @@ -0,0 +1,57 @@ +/* Interface definitions for the exec servers. + Copyright (C) 1991, 1992, 1993, 1994, 1995 Free Software Foundation, Inc. + +This file is part of the GNU Hurd. + +The GNU Hurd is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +The GNU Hurd is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with the GNU Hurd; see the file COPYING. If not, write to +the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ + +/* Written by Michael I. Bushnell and Roland McGrath. */ + +subsystem exec 30000; + +#include <hurd/hurd_types.defs> + +#ifdef EXEC_IMPORTS +EXEC_IMPORTS +#endif + +INTR_INTERFACE + +routine exec_exec ( + execserver: file_t; + file: mach_port_send_t; + oldtask: task_t; + flags: int; + argv: data_t, servercopy; + envp: data_t, servercopy; + dtable: portarray_t, servercopy; + portarray: portarray_t, servercopy; + intarray: intarray_t, servercopy; + deallocnames: mach_port_name_array_t; + destroynames: mach_port_name_array_t); + +skip; /* obsolete exec_startup */ + +/* This call is made by the bootstrapping filesystem to give the + execserver its auth handle. */ +routine exec_init ( + execserver: file_t; + auth_handle: auth_t; + proc_server: mach_port_send_t); + +simpleroutine exec_setexecdata ( + execserver: file_t; + ports: portarray_t, servercopy; + ints: intarray_t, servercopy); diff --git a/hurd/exec_startup.defs b/hurd/exec_startup.defs new file mode 100644 index 00000000..9dfb79aa --- /dev/null +++ b/hurd/exec_startup.defs @@ -0,0 +1,46 @@ +/* Interface definitions for process startup. + Copyright (C) 1995 Free Software Foundation, Inc. + +This file is part of the GNU Hurd. + +The GNU Hurd is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +The GNU Hurd is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with the GNU Hurd; see the file COPYING. If not, write to +the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ + +/* Written by Roland McGrath. */ + +subsystem exec_startup 30500; + +#include <hurd/hurd_types.defs> + +/* This call is made by a new task to its bootstrap port to get its + startup ports and information. */ + +routine exec_startup_get_info ( + bootstrap: mach_port_t; + /* These describe the entry point and program header data + of the user program loaded into the task. */ + out user_entry: vm_address_t; + out phdr_data: vm_address_t; + out phdr_size: vm_size_t; + /* These are the base address and size of the initial stack + allocated by the exec server. */ + out stack_base: vm_address_t; + out stack_size: vm_size_t; + /* The rest of the information is that passed by exec_exec. */ + out flags: int; + out argv: data_t, dealloc; + out envp: data_t, dealloc; + out dtable: portarray_t, dealloc; + out portarray: portarray_t, dealloc; + out intarray: intarray_t, dealloc); diff --git a/hurd/fs.defs b/hurd/fs.defs new file mode 100644 index 00000000..f6344e1b --- /dev/null +++ b/hurd/fs.defs @@ -0,0 +1,354 @@ +/* Definitions for the filesystem interface. + Copyright (C) 1994,95,96,97,98,99 Free Software Foundation, Inc. + +This file is part of the GNU Hurd. + +The GNU Hurd is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +The GNU Hurd is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with the GNU Hurd; see the file COPYING. If not, write to +the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ + + +/* All these objects also implement the generic IO facilities. */ + +subsystem fs 20000; + +#include <hurd/hurd_types.defs> + +#ifdef FILE_IMPORTS +FILE_IMPORTS +#endif + +/* Operations supported on all files */ + +INTR_INTERFACE + +/* Overlay a task with a file. Necessary initialization, including + authentication changes associated with set[ug]id execution must be + handled by the filesystem. Filesystems normally implement this by + using exec_newtask or exec_loadtask as appropriate. */ +routine file_exec ( + exec_file: file_t; + RPT + exec_task: task_t; + flags: int; + argv: data_t SCP; + envp: data_t SCP; + fdarray: portarray_t SCP; + portarray: portarray_t SCP; + intarray: intarray_t SCP; + deallocnames: mach_port_name_array_t SCP; + destroynames: mach_port_name_array_t SCP); + +/* Change owner and/or group */ +routine file_chown ( + chown_file: file_t; + RPT + new_owner: uid_t; + new_group: gid_t); + +/* +Whan that Aprill with hith thoureth thoote +The droghte of March hath perthed to the roote, +And bathed every veyne in thwith licour, +Of which vertu engendred is the flour; +Whan Zephiruth eek with hith thweete breeth +Inthpired hath in every holt and heeth +The tender croppeth, and the yonge thonne +Hath in the Ram his halve courth yronne, +And thmale foweleth maken melodye, +That thlepen all the nyght with open ye +(Tho Priketh hem Nature in hir corageth), +Thanne longen folk to goon on pligrimageth, +And palmereth for to theken thtraunge thtrondeth, +To ferne halweth, kowthe in thondry londeth: +And thpethially, from every thireth ende +Of Engelond to Cantebury they wende, +The hooly blithful martyr for to theke, +That hem hath holpen whan that they were theeke. +*/ +routine file_chauthor ( + chauth_file: file_t; + RPT + new_author: uid_t); + +/* Change mode bits */ +routine file_chmod ( + chmod_file: file_t; + RPT + new_mode: mode_t); + +/* Change file flags */ +routine file_chflags ( + chflags_file: file_t; + RPT + new_flags: int); + +/* Change access and modify times */ +/* If the microseconds value is -1 (all bits on) then the time should be + set to the current time and the remainder of the time_value_t ignored. */ +routine file_utimes ( + utimes_file: file_t; + RPT + new_atime: time_value_t; + new_mtime: time_value_t); + +/* Change the size of the file. If the size increases, new blocks are + zero-filled. After successful return, it is safe to reference mapped + areas of the file up to NEW_SIZE. */ +routine file_set_size ( + trunc_file: file_t; + RPT + new_size: off_t); + +/* Apply/manipulate advisory lock */ +routine file_lock ( + lock_file: file_t; + RPT + flags: int); + +/* Return current lock status. Mystatus tells what kind of lock the + caller has; otherstatus tells what kind of lock anyone has + (including the caller). */ +routine file_lock_stat ( + lock_file: file_t; + RPT + out mystatus: int; + out otherstatus: int); + +/* Find out what kind of access this file permits the current user + (regardless of the current open modes for this port). ALLOWED is a + bitwise OR of O_READ, O_WRITE, and O_EXEC. This is not necessarily the + same as what an open or exec would allow; O_EXEC is set for root even if + no executable bits are on (in which case file_exec should fail) and + O_WRITE is set a directory can be modified, even though it can't be + written directly. */ +routine file_check_access ( + file: file_t; + RPT + out allowed: int); + +/* Notice changes to file FILE. Send notification messages (see + fs_notify.defs) to PORT as they occur. */ +routine file_notice_changes ( + file: file_t; + RPT + port: mach_port_send_t); + +/* Return control port for this filesystem */ +routine file_getcontrol ( + file: file_t; + RPT + out control: mach_port_send_t); + +/* Return filesystem status */ +routine file_statfs ( + file: file_t; + RPT + out info: fsys_statfsbuf_t); + +/* Sync the individual file. If OMIT_METADATA is set, then it is only +necessary for the server to updated the actual contents of the file, +not any associated metadata. */ +routine file_sync ( + file: file_t; + RPT + wait: int; + omit_metadata: int); + +/* Sync the entire filesystem */ +routine file_syncfs ( + file: file_t; + RPT + wait: int; + do_children: int); + +/* Return information on the storage used to hold this file. See the comment + for enum file_storage_class in <hurd/hurd_types.h> the details. */ +routine file_get_storage_info ( + file: file_t; + RPT + out ports: portarray_t; + out ints: intarray_t; + out offsets: off_array_t; + out data: data_t); + +/* Return the node for hard links to this potentially translated file. + This returns a potentially unauthenticated node. */ +routine file_getlinknode ( + file: file_t; + RPT + out linknode: mach_port_send_t); + +/* Return a file handle for this file. This can be used by NFS and such. + It is not guaranteed that this call will work...if it doesn't, then this + filesystem cannot be NFS mounted. */ +routine file_getfh ( + file: file_t; + RPT + out filehandle: data_t, dealloc); + +/* Operations supported on directories */ + +/* Translate a file name, following all symlinks. Upon return, if DO_RETRY + is FS_RETRY_MAGICAL then RETRY_NAME specifies what to do, the list + of possibilities is documented in <hurd/hurd_types.h>; if + FS_RETRY_REAUTH, then RESULT should be reauthenticated before being + used. If RETRY_NAME is the empty string and the retry type is + FS_RETRY_NORMAL, then no further dir_lookup calls are required; + RESULT is the port to use. Otherwise the dir_lookup call should be + repeated, sent to RESULT (or the reauthenticated port) with + RETRY_NAME passed for FILE_NAME. This call is required to be + supported by all files (even non-directories) if the filename is + null, and should function in that case as a re-open of the file. */ +routine dir_lookup ( + start_dir: file_t; + RPT + file_name: string_t; + flags: int; + mode: mode_t; + out do_retry: retry_type; + out retry_name: string_t; + out result: mach_port_send_t); + +/* Read entries from the directory. Each entry is identified + by an index number starting at 0 and running through the file. This + call fetches NENTRIES (or any convenient number if NENTRIES is -1) + entries starting at ENTRY, returning an array of struct directs in DATA. + The number of entries successfully read is returned in AMOUNT. If ENTRY + is bigger than the index of the last entry, then 0 is returned in + AMOUNT. If BUFSIZE is nonzero, never return more than BUFSIZE bytes of + data regardless. */ +routine dir_readdir ( + dir: file_t; + RPT + out data: data_t, dealloc[]; + entry: int; + nentries: int; + bufsiz: vm_size_t; + out amount: int); + +/* Create directory */ +routine dir_mkdir ( + directory: file_t; + RPT + name: string_t; + mode: mode_t); + +/* Remove directory */ +routine dir_rmdir ( + directory: file_t; + RPT + name: string_t); + +/* Remove non-directory */ +routine dir_unlink ( + directory: file_t; + RPT + name: string_t); + +/* Create a hard link. + + If DIR and FILE are not implemented by the same filesystem, + EXDEV should be returned. If the two filesystems, however can + inter-operate and guarantee the appropriate Posix semantics, they can + communicate by a private protocol and allow hard links between them. + If EXCL is set, then fail if NAME already exists in DIR. */ +routine dir_link ( + dir: file_t; + RPT + file: file_t; + name: string_t; + excl: int); + +/* Rename file -- comments similar to those for dir_link apply here + about EXDEV. If EXCL is set, then fail if NEWNAME already exists in + NEWDIRECTORY. */ +routine dir_rename ( + olddirectory: file_t; + RPT + oldname: string_t; + newdirectory: file_t; + newname: string_t; + excl: int); + +/* Create a new file without linking it into the filesystem. You + still must have write permission on the specified directory, even + though it will not actually be written. Return in *newnode a port + to the file. Flags are the same as for dir_pathtrans, but + O_CREAT and O_TRUNC are assumed even if not specified. */ +routine dir_mkfile ( + directory: file_t; + RPT + flags: int; + mode: mode_t; + out newnode: mach_port_send_t); + +/* Notice changes to directory DIR. Send directory change notifications + (see fs_notify.defs) to PORT as they occur. */ +routine dir_notice_changes ( + directory: file_t; + RPT + port: mach_port_send_t); + +/* To get or set the translator currently running on a file, use + file_set_translator, file_get_translator, or + file_get_translator_cntl on a port gotten with the + FS_LOOKUP_NOTRANS flag to dir_pathtrans. You can send these RPCs + to a port to a translated node (looked up without + FS_LOOKUP_NOTRANS) to stack a new translator on top of the existing + one. */ + +/* Set a translator for future lookups to a file. + + PASSIVE is the passive translator; + ACTIVE is the active translator. + + The FLAGS are FS_TRANS_*, defined in <hurd/hurd_types.h>. + OLDFLAGS are sent in an fsys_goaway to an existing active translator + if there is one and it is to be killed. */ +routine file_set_translator ( + file: file_t; + RPT + passive_flags: int; + active_flags: int; + oldtrans_flags: int; + passive: data_t SCP; + active: mach_port_send_t); + +/* Return the stored permanent translator for this file. */ +routine file_get_translator ( + file: file_t; + RPT + out translator: data_t, dealloc); + +/* Return the translator control port to the + active translator (if any) for this file. */ +routine file_get_translator_cntl ( + file: file_t; + RPT + out translator_cntl: mach_port_send_t); + +/* Return the options describing the way the receiving filesystem is + running. (Suitable as an arg for fsys_set_options). */ +routine file_get_fs_options ( + file: file_t; + RPT + out options: data_t); + +/* Return a new file, NEW_FILE, with the same semantics as FILE, but + with lookups of `..' (if FILE is a directory) redirected to PARENT. */ +routine file_reparent ( + file: file_t; + RPT + parent: mach_port_t; + out new_file: mach_port_send_t); diff --git a/hurd/fs_notify.defs b/hurd/fs_notify.defs new file mode 100644 index 00000000..47ee2df0 --- /dev/null +++ b/hurd/fs_notify.defs @@ -0,0 +1,46 @@ +/* Miscellaneous callbacks from Hurd fs servers to their clients. + Copyright (C) 1991, 1992, 1993, 1994, 1995 Free Software Foundation, Inc. + +This file is part of the GNU Hurd. + +The GNU Hurd is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +The GNU Hurd is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with the GNU Hurd; see the file COPYING. If not, write to +the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ + +subsystem fs_notify 20500; + +#include <hurd/hurd_types.defs> + +#ifdef FS_NOTIFY_IMPORTS +FS_NOTIFY_IMPORTS +#endif + + +/* This is sent by a filesystem (after being requested with + dir_notice_changes) every time a directory is changed. + CHANGE identifies the sort of change that has occurred (see hurd_types.h); + NAME is the name that was changed. */ +routine dir_changed ( + notify_port: mach_port_t; + change: dir_changed_type_t; + name: string_t); + +/* This is sent by a filesystem (after being requested with + file_notice_changes) every time a file or its stat info is changed. + CHANGE identifies the sort of change that has occurred (see hurd_types.h); + START and END identify the affected regions of the file's data. */ +routine file_changed ( + notify_port: mach_port_t; + change: file_changed_type_t; + start: off_t; + end: off_t); diff --git a/hurd/fsys.defs b/hurd/fsys.defs new file mode 100644 index 00000000..0989f169 --- /dev/null +++ b/hurd/fsys.defs @@ -0,0 +1,129 @@ +/* Definitions for the filesystem control interface + Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997 Free Software Foundation + +This file is part of the GNU Hurd. + +The GNU Hurd is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +The GNU Hurd is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with the GNU Hurd; see the file COPYING. If not, write to +the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ + +subsystem fsys 22000; + +#include <hurd/hurd_types.defs> + +/* When modifying this file in any way, please remember to keep + fsys_reply.defs up to date. */ + +/* Note that libdiskfs/start-translator-long.c depends silently on the + definition of fsys_startup below. */ + +#ifdef FSYS_IMPORTS +FSYS_IMPORTS +#endif + +INTR_INTERFACE + +/* Sent by filesystem on its bootstrap port upon startup. + REALNODE is the node this filesystem is the translator for, + opened with flags FLAGS (O_NOTRANS is assumed even if not + provided). */ +routine fsys_startup ( + bootstrap: mach_port_t; + RPT + openflags: int; + control_port: mach_port_send_t; + out realnode: mach_port_send_t); + +/* Filesystem should go away. Bye. */ +routine fsys_goaway ( + fsys: fsys_t; + RPT + flags: int); + +/* Return a file to the root of the filesystem. + FLAGS are as for dir_pathtrans (but O_CREAT and O_EXCL are not + meaningful). DO_RETRY, RETRY_NAME, and RESULT are as + for dir_pathtrans. The port should be authenticated with GEN_UIDS + and GEN_GIDS (except, of course, for FS_RETRY_REAUTH and + FS_RETRY_MAGICAL). DOTDOT_NODE is an unauthenticated port for the + directory in which this root is located. */ +routine fsys_getroot( + fsys: fsys_t; + RPT +#ifdef FSYS_GETROOT_UREPLY + ureplyport ureply: mig_reply_port_t; +#endif + dotdot_node: mach_port_send_t; + gen_uids: idarray_t; + gen_gids: idarray_t; + flags: int; + out do_retry: retry_type; + out retry_name: string_t; + out file: mach_port_send_t); + +/* Get a file given a file handle (see file_getfh). */ +routine fsys_getfile ( + fsys: fsys_t; + RPT + gen_uids: idarray_t; + gen_gids: idarray_t; + filehandle: data_t; + out file: mach_port_send_t); + +/* Sync a filesystem. Args are the same as for file_syncfs in fs.defs. */ +routine fsys_syncfs ( + fsys: fsys_t; + RPT + wait: int; + do_children: int); + +/* Pass a server-specific options string. This usually includes flags + similar to command line options, e.g., --readonly, or --sync=30. */ +routine fsys_set_options ( + fsys: fsys_t; + RPT + options: data_t; + do_children: int); + +/* The following two calls are only implemented by bootstrap filesystems. */ + +routine fsys_getpriv ( + fsys: fsys_t; + RPT + out host_priv: mach_port_send_t; + out device_master: mach_port_send_t; + out fstask: mach_port_send_t); + +routine fsys_init ( + fsys: fsys_t; + sreplyport reply_port: sreply_port_t; + proc_server: mach_port_send_t; + auth_handle: auth_t); + +/* Ask SERVER to provide fsys translation service for us. REQUESTOR is + the bootstrap port supplied to the original translator, and ARGV are + the command line arguments. If the recipient accepts the request, he + (or some delegate) should send fsys_startup to REQUESTOR to start the + filesystem up. */ +routine fsys_forward ( + server: mach_port_t; + RPT + requestor: mach_port_send_t; + argv: data_t); + +/* Return the options describing the operation of the receiving + filesystem (sutiable for fsys_set_options). */ +routine fsys_get_options ( + server: fsys_t; + RPT + out options: data_t); diff --git a/hurd/fsys_reply.defs b/hurd/fsys_reply.defs new file mode 100644 index 00000000..b3676e64 --- /dev/null +++ b/hurd/fsys_reply.defs @@ -0,0 +1,77 @@ +/* Reply half of fsys + Copyright (C) 1991, 1993, 1994, 1995 Free Software Foundation + +This file is part of the GNU Hurd. + +The GNU Hurd is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +The GNU Hurd is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with the GNU Hurd; see the file COPYING. If not, write to +the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ + +/* Written by Roland McGrath. */ + +subsystem fsys_reply 22100; /* must match fsys.defs + 100 */ + +#include <hurd/hurd_types.defs> + +type reply_port_t = polymorphic | MACH_MSG_TYPE_PORT_SEND_ONCE + ctype: mach_port_t; + +simpleroutine fsys_startup_reply ( + repsy_port: reply_port_t; + retcode: kern_return_t; + realnode: mach_port_send_t); + +simpleroutine fsys_goaway_reply ( + reply_port: reply_port_t; + retcode: kern_return_t); + +simpleroutine fsys_getroot_reply ( + reply_port: reply_port_t; + retcode: kern_return_t; + do_retry: retry_type; + retry_name: string_t; + file: mach_port_send_t); + +simpleroutine fsys_getfile_reply ( + reply_port: reply_port_t; + retcode: kern_return_t; + file: mach_port_send_t); + +simpleroutine fsys_syncfs_reply ( + reply_port: reply_port_t; + retocde: kern_return_t); + +simpleroutine fsys_set_options_reply ( + reply_port: reply_port_t; + retcode: kern_return_t); + +simpleroutine fsys_getpriv_reply ( + reply_port_: reply_port_t; + retcode: kern_return_t; + host_priv: mach_port_send_t; + device_master: mach_port_send_t; + fstask: mach_port_send_t); + +simpleroutine fsys_init_reply ( + reply_port: reply_port_t; + retcode: kern_return_t); + +simpleroutine fsys_forward_reply ( + reply_port: reply_port_t; + retcode: kern_return_t); + +simpleroutine fsys_get_options_reply ( + reply_port: reply_port_t; + retcode: kern_return_t; + options: data_t); + diff --git a/hurd/gensym.awk b/hurd/gensym.awk new file mode 100644 index 00000000..21283214 --- /dev/null +++ b/hurd/gensym.awk @@ -0,0 +1,78 @@ +# +# Copyright (c) 1994 The University of Utah and +# the Computer Systems Laboratory (CSL). All rights reserved. +# +# Permission to use, copy, modify and distribute this software and its +# documentation is hereby granted, provided that both the copyright +# notice and this permission notice appear in all copies of the +# software, derivative works or modified versions, and any portions +# thereof, and that both notices appear in supporting documentation. +# +# THE UNIVERSITY OF UTAH AND CSL ALLOW FREE USE OF THIS SOFTWARE IN ITS "AS +# IS" CONDITION. THE UNIVERSITY OF UTAH AND CSL DISCLAIM ANY LIABILITY OF +# ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. +# +# CSL requests users of this software to return to csl-dist@cs.utah.edu any +# improvements that they make and grant CSL redistribution rights. +# +# Author: Bryan Ford, University of Utah CSL +# + +BEGIN { + bogus_printed = "no" +} + +# Start the bogus function just before the first sym directive, +# so that any #includes higher in the file don't get stuffed inside it. +/^[a-z]/ { + if (bogus_printed == "no") + { + print "void bogus() {"; + bogus_printed = "yes"; + } +} + +# Take an arbitrarily complex C symbol or expression and constantize it. +/^expr/ { + print "__asm (\""; + if ($3 == "") + printf "* %s mAgIc%%0\" : : \"i\" (%s));\n", $2, $2; + else + printf "* %s mAgIc%%0\" : : \"i\" (%s));\n", $3, $2; +} + +# Output a symbol defining the size of a C structure. +/^size/ { + print "__asm (\""; + if ($4 == "") + printf "* %s_SIZE mAgIc%%0\" : : \"i\" (sizeof(struct %s)));\n", + toupper($3), $2; + else + printf "* %s mAgIc%%0\" : : \"i\" (sizeof(struct %s)));\n", + $4, $2; +} + +# Output a symbol defining the byte offset of an element of a C structure. +/^offset/ { + print "__asm (\""; + if ($5 == "") + { + printf "* %s_%s mAgIc%%0\" : : \"i\" (&((struct %s*)0)->%s));\n", + toupper($3), toupper($4), $2, $4; + } + else + { + printf "* %s mAgIc%%0\" : : \"i\" (&((struct %s*)0)->%s));\n", + toupper($5), $2, $4; + } +} + +# Copy through all preprocessor directives. +/^#/ { + print +} + +END { + print "}" +} + diff --git a/hurd/hurd_types.defs b/hurd/hurd_types.defs new file mode 100644 index 00000000..4f6c5b4c --- /dev/null +++ b/hurd/hurd_types.defs @@ -0,0 +1,225 @@ +/* MiG type declarations for Hurd interfaces -*- C -*- + Copyright (C) 1993, 94, 95, 96, 98 Free Software Foundation, Inc. + +This file is part of the GNU Hurd. + +The GNU Hurd is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +The GNU Hurd is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with the GNU Hurd; see the file COPYING. If not, write to +the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ + + +#include <mach/std_types.defs> +#include <mach/mach_types.defs> +#include <device/device_types.defs> + +type file_t = mach_port_copy_send_t +#ifdef FILE_INTRAN +intran: FILE_INTRAN +#endif +#ifdef FILE_OUTTRAN +outtran: FILE_OUTTRAN +#endif +#ifdef FILE_DESTRUCTOR +destructor: FILE_DESTRUCTOR +#endif +; + +type fsys_t = mach_port_copy_send_t +#ifdef FSYS_INTRAN +intran: FSYS_INTRAN +#endif +#ifdef FSYS_OUTTRAN +outtran: FSYS_OUTTRAN +#endif +#ifdef FSYS_DESTRUCTOR +destructor: FSYS_DESTRUCTOR +#endif +; + + +type io_t = mach_port_copy_send_t +#ifdef IO_INTRAN +intran: IO_INTRAN +#endif +#ifdef IO_OUTTRAN +outtran: IO_OUTTRAN +#endif +#ifdef IO_DESTRUCTOR +destructor: IO_DESTRUCTOR +#endif +; + +type process_t = mach_port_copy_send_t +#ifdef PROCESS_INTRAN +intran: PROCESS_INTRAN +#endif +#ifdef PROCESS_OUTTRAN +outtran: PROCESS_OUTTRAN +#endif +#ifdef PROCESS_DESTRUCTOR +destructor: PROCESS_DESTRUCTOR +#endif +; + +type auth_t = mach_port_copy_send_t +#ifdef AUTH_INTRAN +intran: AUTH_INTRAN +#endif +#ifdef AUTH_OUTTRAN +outtran: AUTH_OUTTRAN +#endif +#ifdef AUTH_DESTRUCTOR +destructor: AUTH_DESTRUCTOR +#endif +; + +type socket_t = mach_port_copy_send_t +#ifdef SOCKET_INTRAN +intran: SOCKET_INTRAN +#endif +#ifdef SOCKET_OUTTRAN +outtran: SOCKET_OUTTRAN +#endif +#ifdef SOCKET_DESTRUCTOR +destructor: SOCKET_DESTRUCTOR +#endif +; + +/* Protocol family */ +type pf_t = mach_port_copy_send_t +#ifdef PF_INTRAN +intran: PF_INTRAN +#endif +#ifdef PF_OUTTRAN +outtran: PF_OUTTRAN +#endif +#ifdef PF_DESTRUCTOR +destructor: PF_DESTRUCTOR +#endif +; + +type addr_port_t = mach_port_copy_send_t +#ifdef ADDRPORT_INTRAN +intran: ADDRPORT_INTRAN +#endif +#ifdef ADDRPORT_OUTTRAN +outtran: ADDRPORT_OUTTRAN +#endif +#ifdef ADDRPORT_DESTRUCTOR +destructor: ADDRPORT_DESTRUCTOR +#endif +; + +type term_t = mach_port_copy_send_t +#ifdef TERM_INTRAN +intran: TERM_INTRAN +#endif +#ifdef TERM_OUTTRAN +outtran: TERM_OUTTRAN +#endif +#ifdef TERM_DESTRUCTOR +destructor: TERM_DESTRUCTOR +#endif +; + +type startup_t = mach_port_copy_send_t +#ifdef STARTUP_INTRAN +intran: STARTUP_INTRAN +#endif +#ifdef STARTUP_OUTTRAN +outtran: STARTUP_OUTTRAN +#endif +#ifdef STARTUP_DESTRUCTOR +destructor: STARTUP_DESCTRUCTOR +#endif +; + +type proccoll_t = mach_port_copy_send_t; + +type sreply_port_t = MACH_MSG_TYPE_MAKE_SEND_ONCE | polymorphic + ctype: mach_port_t; + +/* These macros are used in some .defs files so that every routine has a + server reply port argument #ifdef REPLY_PORTS. */ +#ifdef REPLY_PORTS +#define RPTDECL sreplyport reply: sreply_port_t +#define RPT RPTDECL; +#define RPTLAST ; RPTDECL +#else +#define RPTLAST +#define RPT +#endif + +/* This macros are used in some .defs files so that every out data_t + (or equivalent) has a servercopy keyword #ifdef SERVERCOPY. */ +#ifdef SERVERCOPY +#define SCP , servercopy +#else +#define SCP +#endif + + +#ifdef USERPREFIX +userprefix USERPREFIX; +#endif + +#ifdef SERVERPREFIX +serverprefix SERVERPREFIX; +#endif + +/* RPC interfaces which are interrupt compliant (see interrupt.defs) + should put ``INTR_INTERFACE'' at the beginning of their .defs file. */ +#ifndef INTR_INTERFACE +#define INTR_INTERFACE /* Nothing special. */ +#endif + +type data_t = array[] of char; +type string_t = c_string[1024]; /* XXX */ +type io_statbuf_t = struct[32] of int; +type uid_t = int; +type gid_t = int; +type mode_t = int; +type dev_t = short; +type retry_type = int; +type pid_t = int; +type wait_status_t = int; +type off_t = int; +type size_t = unsigned; +type ssize_t = int; +type file_changed_type_t = int; +type dir_changed_type_t = int; + +type portarray_t = array[] of mach_port_send_t; +type intarray_t = array[] of int; +type off_array_t = array[] of off_t; + +type pidarray_t = array[] of pid_t; +type procinfo_t = array[] of int; +type fsys_statfsbuf_t=struct[16] of int; + +type idarray_t = array[] of uid_t; + +type rusage_t = struct[18] of int; /* XXX */ + +type flock_t = struct[5] of int; + +#define _SYS_UTSNAME_H /* Inhibit warning from <bits/utsname.h>. */ +#include <bits/utsname.h> +type utsname_t = struct[5 * _UTSNAME_LENGTH] of char; + +import <sys/types.h>; +import <sys/stat.h>; +import <sys/statfs.h>; +import <sys/resource.h>; +import <sys/utsname.h>; +import <hurd/hurd_types.h>; diff --git a/hurd/hurd_types.h b/hurd/hurd_types.h new file mode 100644 index 00000000..3595d049 --- /dev/null +++ b/hurd/hurd_types.h @@ -0,0 +1,350 @@ +/* C declarations for Hurd server interfaces + Copyright (C) 1993, 94, 95, 96, 98, 99 Free Software Foundation, Inc. + +This file is part of the GNU Hurd. + +The GNU Hurd is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +The GNU Hurd is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with the GNU Hurd; see the file COPYING. If not, write to +the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ + +#ifndef _HURD_TYPES_H +#define _HURD_TYPES_H + +#include <mach/std_types.h> /* For mach_port_t et al. */ +#include <sys/types.h> /* For pid_t and uid_t. */ + +/* A string identifying this release of the GNU Hurd. Our + interpretation of the term "release" is that it refers to a set of + server interface definitions. A "version" in Posix terminology is + a distribution of the Hurd; there may be more than one distribution + without changing the release number. */ +#define HURD_RELEASE "0.0" + + +/* Simple type declarations */ + +/* These types identify certain kinds of ports used by the Hurd. */ +typedef mach_port_t file_t; +typedef mach_port_t fsys_t; +typedef mach_port_t io_t; +typedef mach_port_t process_t; +typedef mach_port_t auth_t; +typedef mach_port_t socket_t; +typedef mach_port_t pf_t; /* Protocol family */ +typedef mach_port_t addr_port_t; +typedef mach_port_t startup_t; +typedef mach_port_t proccoll_t; + +#include <errno.h> /* Defines `error_t'. */ + +/* These names exist only because of MiG deficiencies. + You should not use them in C source; use the normal C types instead. */ +typedef char *data_t; +typedef char string_t [1024]; +typedef int *intarray_t; +typedef int *fd_mask_t; +typedef mach_port_t *portarray_t; +typedef pid_t *pidarray_t; +typedef uid_t *idarray_t; +typedef off_t *off_array_t; +typedef struct rusage rusage_t; +typedef struct flock flock_t; +typedef struct utsname utsname_t; +typedef struct stat io_statbuf_t; +typedef struct statfs fsys_statfsbuf_t; + + +/* Parameters and flags in RPC calls */ + +/* Many such parameters and flags are also defined in various libc + headers. */ + +/* Bits for flags in fs.defs:file_exec and exec.defs:exec_* calls: */ +#define EXEC_NEWTASK 0x00000001 /* Create new task; kill old one. */ +#define EXEC_SECURE 0x00000002 /* Use secure values of portarray, etc. */ +#define EXEC_DEFAULTS 0x00000004 /* Use defaults for unspecified ports. */ +#define EXEC_SIGTRAP 0x00000008 /* Simulate SIGTRAP on startup. */ +/* This flag is passed through by the exec server but not examined by it. */ +#define EXEC_STACK_ARGS 0x00000010 /* Use arguments from stack, not RPC. */ + +/* Bits for flags in fs.defs:file_set_translator call: */ +#define FS_TRANS_FORCE 0x00000001 /* Must use translator(no sht circuit) */ +#define FS_TRANS_EXCL 0x00000002 /* Don't do it if already translated. */ +#define FS_TRANS_SET 0x00000004 /* Set or clear translator */ + +/* Values for retry field in fs.defs:dir_pathtrans call: */ +enum retry_type +{ + FS_RETRY_NORMAL = 1, /* Retry normally if retry_name is not null. */ + FS_RETRY_REAUTH = 2, /* Retry after reauthenticating retry port. + Even if the retry name is null, a retry + is still necessary with this code after the + reauthentication is complete. */ + FS_RETRY_MAGICAL = 3, /* Retry string is magical. */ + /* "tty" means controlling tty; + + "fd/%u" means file descriptor N; + + "machtype/..." means replace `machtype' with the numbers in decimal + returned by the user's kernel as the cpu_type (N) and + cpu_subtype (M) (producing N/M/...) and then retry + as for FS_RETRY_NORMAL. + + "/..." means retry "...", but starting from the users root directory. + */ +}; +typedef enum retry_type retry_type; + +/* Types for fs_notify.defs:dir_changed call: */ +enum dir_changed_type +{ + DIR_CHANGED_NULL, /* Always sent first for sync. */ + DIR_CHANGED_NEW, /* Specified name has been added. */ + DIR_CHANGED_UNLINK, /* Specified name has been removed. */ + DIR_CHANGED_RENUMBER, /* Name has been the target of rename. */ +}; +typedef enum dir_changed_type dir_changed_type_t; + +/* Types for fs_notify.defs:file_changed call: */ +enum file_changed_type +{ + FILE_CHANGED_NULL, /* Always sent first for sync. */ + FILE_CHANGED_WRITE, /* File data has been written. */ + FILE_CHANGED_EXTEND, /* File has grown. */ + FILE_CHANGED_TRUNCATE, /* File has been truncated. */ + FILE_CHANGED_META, /* Stat information has changed, and none + of the previous three apply. Not sent + for changes in node times. */ +}; +typedef enum file_changed_type file_changed_type_t; + +/* Select types for io.defs:io_select call: */ +#define SELECT_READ 0x00000001 +#define SELECT_WRITE 0x00000002 +#define SELECT_URG 0x00000004 + +/* Flags for fsys.defs:fsys_goaway. Also, these flags are sent as the + oldtrans_flags in fs.defs:file_set_translator to describe how to + terminate the old translator. */ +#define FSYS_GOAWAY_NOWAIT 0x00000001 /* Return immediately. */ +#define FSYS_GOAWAY_NOSYNC 0x00000002 /* Don't update physical media. */ +#define FSYS_GOAWAY_FORCE 0x00000004 /* Go away despite current users. */ +#define FSYS_GOAWAY_UNLINK 0x00000008 /* Go away only if non-directory. */ +#define FSYS_GOAWAY_RECURSE 0x00000010 /* Shutdown children too. */ + +/* Types of ports the terminal driver can run on top of; + used in term.defs:term_get_bottom_type. */ +enum term_bottom_type +{ + TERM_ON_MACHDEV, + TERM_ON_HURDIO, + TERM_ON_MASTERPTY, +}; + +/* Types of storage, as returned by file_get_storage_info. + + STORAGE_DEVICE is a mach device_t (for random access devices) + STORAGE_HURD_FILE is a hurd file_t (as if a file were mapped) + STORAGE_TASK is a task_t (the storage is in the vm of the task) + STORAGE_MEMORY is a memory object port + STORAGE_NULL is a fixed-size constant source of zeros + STORAGE_INTERLEAVE is a set of other storage types interleaved at a fixed + interval + STORAGE_CONCAT is a set of other storage types concatenated end-to-end + STORAGE_LAYER is a set of storage types, representing the same address + range; all will be written too, and will be read in turn until one + succeeds + STORAGE_REMAP is a layer on top of another store that remaps its blocks + STORAGE_COPY is a memory snapshot of another store + STORAGE_NETWORK means that the file is stored elsewhere on the + network; all the remaining fields contan type-specific information. + STORAGE_OTHER means none of these apply; and should be used when no + meaningful answer can be given + + The vectors returned by file_get_storage_info encode each of the above + (note that the first int is always the storage type). There are four: + ports, ints, offsets (off_t), and data (char); each type of store uses the + following entries in each vector: + + -type- -ports- -ints- -offsets- -data- -kids- + device DEVICE TY, FL, BS, NR, NL, ML NR * (OFFS, LEN) NL + ML - + file FILE TY, FL, BS, NR, NL, ML NR * (OFFS, LEN) NL + ML - + memory MEMOBJ TY, FL, BS, NR, NL, ML NR * (OFFS, LEN) NL + ML - + task TASK TY, FL, BS, NR, NL, ML NR * (OFFS, LEN) NL + ML - + (the data for the above is a name (incl '\0') and a misc data block) + null - TY, FL SIZE - - + (BS is 1) + ileave - TY, FL, IL, NC - - NC + (BS is the LCM of its children; SIZE is the minimum of theirs * IL) + concat - TY, FL, NC - - NC + (BS is the LCM of its children; SIZE is the sum of theirs) + layer - TY, FL, NC - - NC + (BS is the LCM of its children; SIZE is the minimum of theirs) + remap - TY, FL, NR NR * (OFFS, LEN) - 1 + (BS and SIZE are that of the child) + copy - TY, FL, SIZE - DATA - + (DATA is preceeded by padding to the next page boundary, and is + SIZE bytes long itself) + + For ileave, concat, and layer, the children are encoded following the parent. + The first int must always be TY. + + key: TY = type code, FL = flags, BS = block size, NR = num runs, + NL = name len, ML = misc len, NC = num children, + IL = interleave (bytes), SIZE = Size of storage (blocks), + LEN = run length (blocks), OFFS = run offset (blocks), + + The NR * (OFFS, LEN) offsets for some of the types is the set of block + ranges in the underlying address space that, concatenated, make up the + contents of the storage -- for instance, doing file_get_storage_info on a + file may return storage of type STORAGE_DEVICE, and the accompanying block + ranges are the set of blocks on the given device that correspond to that + file. Any OFFS == -1 designates a hole in the address range. Note that + the total size (SIZE) for these types is the sum of their LEN's. + + The optional NAME returned by some types (if NL != 0) is a type specific + name for the same object referenced by the port also returned. E.g.: + device -- The mach device name + file -- The file name (unreliable, as the root may not be the same) + task -- The pid + Unless it is MACH_PORT_NULL, the port should generally be used instead of + trying to regenerate it from the associated name, which is intended more for + printing messages, etc. */ +enum file_storage_class +{ + STORAGE_OTHER, + STORAGE_DEVICE, + STORAGE_HURD_FILE, + STORAGE_NETWORK, + STORAGE_MEMORY, + STORAGE_TASK, + STORAGE_ZERO, + STORAGE_CONCAT, + STORAGE_INTERLEAVE, + STORAGE_LAYER, + STORAGE_REMAP, + STORAGE_COPY, +}; + +/* Flags for the flags word returned by some types . */ +#define STORAGE_MUTATED 0x00000001 /* data as stored is munged from file */ + +/* Data types */ + +#include <mach/task_info.h> +#include <mach/thread_info.h> + +/* Flags sent in proc_getprocinfo request. */ +#define PI_FETCH_TASKINFO 0x00000001 +#define PI_FETCH_THREADS 0x00000002 +#define PI_FETCH_THREAD_BASIC 0x00004 +#define PI_FETCH_THREAD_SCHED 0x00008 +#define PI_FETCH_THREAD_WAITS 0x00010 + +struct procinfo +{ + int state; + uid_t owner; + pid_t ppid; + pid_t pgrp; + pid_t session; + pid_t logincollection; + int exitstatus; + int sigcode; + + int nthreads; /* size of pi_threadinfos */ + + struct task_basic_info taskinfo; + struct + { + int died; /* this thread died in the middle of call */ + int rpc_block; /* thred is blocked on this RPC */ + struct thread_basic_info pis_bi; + struct thread_sched_info pis_si; + } threadinfos[0]; +}; +typedef int *procinfo_t; + +/* Bits in struct procinfo state: */ +#define PI_STOPPED 0x00000001 /* Proc server thinks is stopped. */ +#define PI_EXECED 0x00000002 /* Has called proc_exec. */ +#define PI_WAITING 0x00000004 /* Process is waiting for child to exit */ +#define PI_ORPHAN 0x00000008 /* Process group is orphaned. */ +#define PI_NOMSG 0x00000010 /* Process has no message port. */ +#define PI_SESSLD 0x00000020 /* Session leader. */ +#define PI_NOTOWNED 0x0000040 /* Process has no owner. */ +#define PI_NOPARENT 0x0000080 /* Hasn't identified a parent. */ +#define PI_ZOMBIE 0x00000100 /* Has no associated task. */ +#define PI_TRACED 0x00000200 /* Process is being traced */ +#define PI_GETMSG 0x00000400 /* Process is blocked in proc_getmsgport. */ +#define PI_LOGINLD 0x00000800 /* Process is leader of login collection */ + + +/* Conventions */ + + +/* st_fstype in struct stat and fsys_stb_type in fsys_statfsbuf is one of: */ +#define FSTYPE_UFS 0x00000000 /* 4.x BSD Fast File System */ +#define FSTYPE_NFS 0x00000001 /* Network File System ala Sun */ +#define FSTYPE_GFS 0x00000002 /* GNU file system */ +#define FSTYPE_LFS 0x00000003 /* Logging File System ala Sprite */ +#define FSTYPE_SYSV 0x00000004 /* Old U*x filesystem ala System V */ +#define FSTYPE_FTP 0x00000005 /* Transparent FTP */ +#define FSTYPE_TAR 0x00000006 /* Transparent TAR */ +#define FSTYPE_AR 0x00000007 /* Transparent AR */ +#define FSTYPE_CPIO 0x00000008 /* Transparent CPIO */ +#define FSTYPE_MSLOSS 0x00000009 /* MS-DOS */ +#define FSTYPE_CPM 0x0000000a /* CP/M */ +#define FSTYPE_HFS 0x0000000b /* Don't ask */ +#define FSTYPE_DTFS 0x0000000c /* used by desktop to provide more info */ +#define FSTYPE_GRFS 0x0000000d /* GNU Remote File System */ +#define FSTYPE_TERM 0x0000000e /* GNU Terminal driver */ +#define FSTYPE_DEV 0x0000000f /* GNU Special file server */ +#define FSTYPE_PROC 0x00000010 /* /proc filesystem ala Version 9 */ +#define FSTYPE_IFSOCK 0x00000011 /* PF_LOCAL socket naming point */ +#define FSTYPE_AFS 0x00000012 /* Andrew File System 3.xx */ +#define FSTYPE_DFS 0x00000013 /* Distributed File Sys (OSF) == AFS 4.xx */ +#define FSTYPE_PROC9 0x00000014 /* /proc filesystem ala Plan 9 */ +#define FSTYPE_SOCKET 0x00000015 /* io_t that isn't a file but a socket */ +#define FSTYPE_MISC 0x00000016 /* generic trivfs server */ +#define FSTYPE_EXT2FS 0x00000017 /* Linux filesystem by Remy Card */ +#define FSTYPE_HTTP 0x00000018 /* Transparent HTTP */ +#define FSTYPE_MEMFS 0x00000019 /* In-core filesystem */ +#define FSTYPE_ISO9660 0x0000001a /* ISO9660 */ + +/* Standard port assignments for file_exec and exec_* */ +enum + { + INIT_PORT_CWDIR, + INIT_PORT_CRDIR, + INIT_PORT_AUTH, + INIT_PORT_PROC, + INIT_PORT_CTTYID, + /* If MACH_PORT_NULL is given for the bootstrap port, + the bootstrap port of the old task is used. */ + INIT_PORT_BOOTSTRAP, + INIT_PORT_MAX + }; + +/* Standard ints for file_exec and exec_* */ +enum + { + INIT_UMASK, + INIT_SIGMASK, + INIT_SIGIGN, + INIT_SIGPENDING, + INIT_TRACEMASK, + INIT_INT_MAX, + }; + +#endif diff --git a/hurd/ifsock.defs b/hurd/ifsock.defs new file mode 100644 index 00000000..dbccc420 --- /dev/null +++ b/hurd/ifsock.defs @@ -0,0 +1,35 @@ +/* S_IFSOCK filesystem node protocol + Copyright (C) 1991, 1993, 1994 Free Software Foundation + +This file is part of the GNU Hurd. + +The GNU Hurd is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +The GNU Hurd is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with the GNU Hurd; see the file COPYING. If not, write to +the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ + +/* Written by Michael I. Bushnell. */ + +/* This protocol is a superset of the filesystem protocol. */ + +subsystem ifsock 34000; +#include <hurd/hurd_types.defs> + +#ifdef IFSOCK_IMPORTS +IFSOCK_IMPORTS +#endif + +routine +ifsock_getsockaddr ( + file: file_t; + out sockaddr: mach_port_copy_send_t); + diff --git a/hurd/interrupt.defs b/hurd/interrupt.defs new file mode 100644 index 00000000..6e3cc7d6 --- /dev/null +++ b/hurd/interrupt.defs @@ -0,0 +1,33 @@ +/* Interrup [get the phone, will ya?] tion. -*- C -*- + Copyright (C) 1993, 1994, 1995, 1996 Free Software Foundation, Inc. + +This file is part of the GNU Hurd. + +The GNU Hurd is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +The GNU Hurd is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with the GNU Hurd; see the file COPYING. If not, write to +the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ + +/* Written by Michael I. Bushnell. */ + +subsystem interrupt 33000; + +#include <hurd/hurd_types.defs> + +/* Cause a pending request on this object to immediately return. The + exact semantics are dependent on the specific object. */ + +routine +interrupt_operation (object: mach_port_t; + waittime timeout: natural_t; + msgseqno seqno: mach_port_seqno_t); + diff --git a/hurd/io.defs b/hurd/io.defs new file mode 100644 index 00000000..75a8f58b --- /dev/null +++ b/hurd/io.defs @@ -0,0 +1,325 @@ +/* Definitions for generic IO interface + Copyright (C) 1991, 1993, 1994, 1995, 1996, 1999 Free Software Foundation, Inc. + +This file is part of the GNU Hurd. + +The GNU Hurd is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +The GNU Hurd is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with the GNU Hurd; see the file COPYING. If not, write to +the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ + + +/* All changes to this file must be reflected in io_request.defs and + io_reply.defs. */ + +subsystem io 21000; + +#include <hurd/hurd_types.defs> + +#ifdef IO_IMPORTS +IO_IMPORTS +#endif + +INTR_INTERFACE + + +/* Write data to an IO object. If offset is -1, write at the object + maintained file pointer. If the object is not seekable, offset is + ignored. The amount successfully written is returned in amount. A + given user should not have more than one outstanding io_write on an + object at a time; servers implement congestion control by delaying + responses to io_write. Servers may drop data (returning ENOBUFS) + if they recevie more than one write when not prepared for it. */ +routine io_write ( + io_object: io_t; + RPT + data: data_t SCP; + offset: off_t; + out amount: mach_msg_type_number_t); + +/* Read data from an IO object. If offset if -1, read from the object + maintained file pointer. If the object is not seekable, offset is + ignored. The amount desired to be read is in amount. */ +routine io_read ( + io_object: io_t; + RPT + out data: data_t, dealloc; + offset: off_t; + amount: mach_msg_type_number_t); + +/* Change current read/write offset */ +routine io_seek ( + io_object: io_t; + RPT + offset: off_t; + whence: int; + out newp: off_t); + +/* Tell how much data can be read from the object without blocking for + a "long time" (this should be the same meaning of "long time" used + by the nonblocking flag. */ +routine io_readable ( + io_object: io_t; + RPT + out amount: mach_msg_type_number_t); + +/* These four routines modify the O_APPEND, O_ASYNC, O_FSYNC, and + O_NONBLOCK bits for the IO object. In addition, io_get_openmodes + will tell you which of O_READ, O_WRITE, and O_EXEC the object can + be used for. The O_ASYNC bit affects icky async I/O; good async + I/O is done through io_async which is orthogonal to these calls. */ +routine io_set_all_openmodes ( + io_object: io_t; + RPT + newbits: int); + +routine io_get_openmodes ( + io_object: io_t; + RPT + out bits: int); + +routine io_set_some_openmodes ( + io_object: io_t; + RPT + bits_to_set: int); + +routine io_clear_some_openmodes ( + io_object: io_t; + RPT + bits_to_clear: int); + +/* This requests that the IO object send SIGIO and SIGURG signals, + when appropriate, to the designated port using sig_post. A + port is also returned which will be used as the reference port in + sending such signals (this is the "async IO ID" port). The async + call is cancelled by deleting all refernces to the async_id_port. + Each call to io_async generates a new ASYNC_ID_PORT. + */ +routine io_async ( + io_object: io_t; + RPT + notify_port: mach_port_send_t; + out async_id_port: mach_port_send_t); + +/* Get/set the owner of the IO object. For terminals, this affects + controlling terminal behavior (see term_become_ctty). For all + objects this affects old-style async IO. Negative values represent + pgrps. This has nothing to do with the owner of a file (as + returned by io_stat, and as used for various permission checks by + filesystems). An owner of 0 indicates that there is no owner. */ +routine io_mod_owner ( + io_object: io_t; + RPT + owner: pid_t); + +routine io_get_owner ( + io_object: io_t; + RPT + out owner: pid_t); + +/* This provides "old style" async IO. This is deprecated, and + provided only for backward compatibility with 4.3 BSD. This + implements a per-object (not per-open) flag controlling old-style + async mode (O_ASYNC). If the flag is set, then the IO object will + send SIGIO and SIGURG signals (in precisely the same circumstances + as io_async) to the current owner (pid or pgrp) as set by + io_set_own. The reference port for the signal sends is the + icky_async_id_port returned by this call; it is up to the caller to + communicate this to potential recipients of the signal. (Such + communication needs to be done both by the caller of the call and + the caller of io_mod_owner, in order to get the BSD functionality.) + One async_id_port is shared by all users of io_get_icky_async_id. */ +/* Fetch the current old-style async ID port. */ +routine io_get_icky_async_id ( + io_object: io_t; + RPT + out icky_async_id_port: mach_port_send_t); + +/* SELECT_TYPE is the bitwise OR of SELECT_READ, SELECT_WRITE, and SELECT_URG. + Block until one of the indicated types of i/o can be done "quickly", and + return the types that are then available. ID_TAG is returned as passed; it + is just for the convenience of the user in matching up reply messages with + specific requests sent. */ +/* INTR */ +routine io_select ( + io_object: io_t; +#if defined (REPLY_PORTS) || defined (IO_SELECT_REPLY_PORT) + replyport reply: sreply_port_t; +#else + ureplyport reply: mach_port_make_send_t; +#endif + waittime timeout: natural_t; + inout select_type: int); + +/* Return the current status of the object. Not all the fields of the + io_statuf_t are meaningful for all objects; however, the access and + modify times, the optimal IO size, and the fs type are meaningful + for all objects. */ +routine io_stat ( + stat_object: io_t; + RPT + out stat_info: io_statbuf_t); + +/* Get a reauthenticated port to an io object. The user should follow + this with a call to auth_user_authenticate. The new_port passed + through the auth server will be a port usable with the new + authentication. */ +simpleroutine io_reauthenticate ( + auth_object: io_t; + RPT + rendezvous2: mach_port_send_t); + +/* Return another port which has been restricted to do only those + things which both the current user and the newly specified user can + do. */ +routine io_restrict_auth ( + io_object: io_t; + RPT + out new_object: mach_port_send_t; + uids: idarray_t SCP; + gids: idarray_t SCP); + +/* Return a new port with the same semantics as the existing port. */ +routine io_duplicate ( + io_object: io_t; + RPT + out newport: mach_port_send_t); + +/* Get version information about the server exporting the IO object. */ +routine io_server_version ( + vers_object: io_t; + RPT + out server_name: string_t; + out server_major_version: int; + out server_minor_version: int; + out server_edit_level: int); + +/* Definitions for mapped io */ + +/* Return objects mapping the data underlying this memory object. If + the object can be read then memobjrd will be provided; if the + object can be written then memobjwr will be provided. For objects + where read data and write data are the same, these objects will be + equal, otherwise they will be disjoint. Servers are permitted to + implement io_map but not io_map_cntl. Some objects do not provide + mapping; they will set none of the ports and return an error. Such + objects can still be accessed by io_read and io_write. */ +routine io_map ( + io_object: io_t; + RPT + out memobjrd: mach_port_send_t; + out memobjwt: mach_port_send_t); + +/* This call can only be made once per request port. If it returns + EBUSY, then the user should duplicate the port (using io_duplicate) + and try again. This maps the shared page data structures + corresponding to the data maps in io_map. The format and meaning + of the shared page is described in shared.h and the calls below. + This call may be unimplemented by some servers; they will return + EOPNOTSUPP. + */ +routine io_map_cntl ( + io_object: io_t; + RPT + out memobj: mach_port_send_t); + +/* Users of the shared page who don't have the conch and want it + should call this function. The server will endeavor to have + USER_HAS_CONCH when this returns, but users should call io_get_it + in a loop for safety. */ +routine io_get_conch ( + io_object: io_t RPTLAST); + +/* When the user is done with the shared page, while holding the + conch, the filesystem may have changed the conch status to + USER_RELEASE_CONCH. In that case, rather than downgrading + USER_HAS_CONCH to USER_COULD_HAVE_CONCH, the user should call + io_release_conch. Also, when the user is done with an IO object + and wants permanent characteristics of the object (like file size) + to be updated, the user should call io_release_conch. Upon return, + the conch status might be either USER_COULD_HAVE_CONCH or + USER_HAS_NOT_CONCH. */ +routine io_release_conch ( + io_object: io_t RPTLAST); + +/* This routine should be called while the user has the conch, after + the user has encountered an eof condition (where the file pointer + is equal to the file size). This could be used by terminals, for + example, to clear the eof condition after it is read once. The + routine should be called while the user has the conch. The user + will keep it upon return. */ +routine io_eofnotify ( + io_object: io_t RPTLAST); + +/* If the user wants to write past the prenotify size, a call needs to + be made to io_prenotify giving the paramters of the write. Upon + return from io_prenotify, there is no guarantee that the prenotify + size will now permit the write, so it should be re-checked. The + routine should be called while the user has the conch. The user + will keep it upon return. */ +routine io_prenotify ( + io_object: io_t; + RPT + write_start: vm_offset_t; + write_end: vm_offset_t); + +/* After doing a write which extends past the postnotify_size, the + user needs to call io_postnotify. The routine should be called + while the user has the conch. The user will keep it upon return. + */ +routine io_postnotify ( + io_object: io_t; + RPT + write_start: vm_offset_t; + write_end: vm_offset_t); + +/* After moving rd_file_pointer past readnotify_size, the user should + call this routine, while holding the conch. The user will keep the + conch upon return. */ +routine io_readnotify ( + io_object: io_t RPTLAST); + +/* This routine sleeps until the read_size is increased. The routine + should be called while the user has the conch. The user will keep + it upon return. */ +routine io_readsleep ( + io_object: io_t RPTLAST); + +/* The shared user has just done some IO, and a signal needs to be + sent for async users. */ +routine io_sigio ( + io_object: io_t RPTLAST); + +/* Return Posix.1 pathconf information. */ +routine io_pathconf ( + io_object: io_t; + RPT + name: int; + out value: int); + +/* Return the identity port for the object underlying IO_OBJECT. + Different I/O ports for the same object all have the same identity port. + FSIDPORT is an identity port returned by for all objects in the same + filesystem. FILENO is the same value returned by io_stat for `st_ino'. + */ +routine io_identity ( + io_object: io_t; + RPT + out idport: mach_port_send_t; + out fsidport: mach_port_send_t; + out fileno: int); + +/* Revoke the access of all descriptors except this one currently open + on the specified object. */ +routine io_revoke ( + io_object: io_t RPTLAST); + diff --git a/hurd/io_reply.defs b/hurd/io_reply.defs new file mode 100644 index 00000000..68bd2f1c --- /dev/null +++ b/hurd/io_reply.defs @@ -0,0 +1,155 @@ +/* Definitions for generic IO interface + Copyright (C) 1991, 1993, 1994, 1995 Free Software Foundation + +This file is part of the GNU Hurd. + +The GNU Hurd is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +The GNU Hurd is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with the GNU Hurd; see the file COPYING. If not, write to +the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ + +subsystem io_reply 21100; /* much mach io.defs + 100 */ + +/* These functions are server reply stubs for the functions in io.defs; + all the comments there apply exactly to here. */ + +#include <hurd/hurd_types.defs> + +#ifdef IO_IMPORTS +IO_IMPORTS +#endif + +type reply_port_t = polymorphic | MACH_MSG_TYPE_MAKE_SEND_ONCE + ctype: mach_port_t; + +simpleroutine io_write_reply ( + reply: reply_port_t; + return_code: kern_return_t; + amount: int); + +simpleroutine io_read_reply ( + reply: reply_port_t; + return_code: kern_return_t; + data: data_t); + +simpleroutine io_seek_reply ( + reply: reply_port_t; + return_code: kern_return_t; + newp: off_t); + +simpleroutine io_readable_reply ( + reply: reply_port_t; + return_code: kern_return_t; + amount: int); + +simpleroutine io_set_all_openmodes_reply ( + reply: reply_port_t; + return_code: kern_return_t); + +simpleroutine io_get_openmodes_reply ( + reply: reply_port_t; + return_code: kern_return_t; + bits: int); + +simpleroutine io_set_some_openmodes_reply ( + reply: reply_port_t; + return_code: kern_return_t); + +simpleroutine io_clear_some_openmodes_reply ( + reply: reply_port_t; + return_code: kern_return_t); + +simpleroutine io_async_reply ( + reply: reply_port_t; + return_code: kern_return_t; + async_id_port: mach_port_send_t); + +simpleroutine io_mod_owner_reply ( + reply: reply_port_t; + return_code: kern_return_t); + +simpleroutine io_get_owner_reply ( + reply: reply_port_t; + return_code: kern_return_t; + owner: pid_t); + +simpleroutine io_get_icky_async_id_reply ( + reply: reply_port_t; + return_code: kern_return_t; + id_port: mach_port_send_t); + +simpleroutine io_select_reply ( + reply: reply_port_t; + return_code: kern_return_t; + select_result: int; + id_tag: int); + +simpleroutine io_stat_reply ( + reply: reply_port_t; + return_code: kern_return_t; + stat_info: io_statbuf_t); + +skip; /* io_reauthenticate has no reply */ + +simpleroutine io_restrict_auth_reply ( + reply: reply_port_t; + return_code: kern_return_t; + new_object: mach_port_send_t); + +simpleroutine io_duplicate_reply ( + reply: reply_port_t; + return_code: kern_return_t; + newport: mach_port_send_t); + +simpleroutine io_map_reply ( + reply: reply_port_t; + return_code: kern_return_t; + rdobject: mach_port_send_t; + wrobject: mach_port_send_t); + +simpleroutine io_map_cntl_reply ( + reply: reply_port_t; + return_code: kern_return_t; + memobj: mach_port_send_t); + +simpleroutine io_get_conch_reply ( + reply: reply_port_t; + return_code: kern_return_t); + +simpleroutine io_release_conch_reply ( + reply: reply_port_t; + return_code: kern_return_t); + +simpleroutine io_eofnotify_reply ( + reply: reply_port_t; + return_code: kern_return_t); + +simpleroutine io_prenotify_reply ( + reply: reply_port_t; + return_code: kern_return_t); + +simpleroutine io_postnotify_reply ( + reply: reply_port_t; + return_code: kern_return_t); + +simpleroutine io_readnotify_reply ( + reply: reply_port_t; + return_code: kern_return_t); + +simpleroutine io_readsleep_reply ( + reply: reply_port_t; + return_code: kern_return_t); + +simpleroutine io_sigio_reply ( + reply: reply_port_t; + return_code: kern_return_t); + diff --git a/hurd/io_request.defs b/hurd/io_request.defs new file mode 100644 index 00000000..366963f2 --- /dev/null +++ b/hurd/io_request.defs @@ -0,0 +1,166 @@ +/* Definitions for generic IO interface + Copyright (C) 1991, 1993, 1994, 1995 Free Software Foundation + +This file is part of the GNU Hurd. + +The GNU Hurd is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +The GNU Hurd is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with the GNU Hurd; see the file COPYING. If not, write to +the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ + +subsystem io 21000; + +/* These functions are user-side stubs for the functions in io.defs; + all the comments there apply exactly to here. */ + +#include <hurd/hurd_types.defs> + +#ifdef IO_IMPORTS +IO_IMPORTS +#endif + +type reply_port_t = MACH_MSG_TYPE_MAKE_SEND_ONCE | polymorphic + ctype: mach_port_t; + +simpleroutine io_write_request ( + io_object: io_t; + reply: reply_port_t; + data: data_t; + offset: off_t); + +simpleroutine io_read_request ( + io_object: io_t; + reply: reply_port_t; + offset: off_t; + amount: int); + +simpleroutine io_seek_request ( + io_object: io_t; + reply: reply_port_t; + offset: off_t; + whence: int); + +simpleroutine io_readable_request ( + io_object: io_t; + reply: reply_port_t); + +simpleroutine io_set_all_openmodes_request ( + io_object: io_t; + reply: reply_port_t; + newbits: int); + +simpleroutine io_get_openmodes_request ( + io_object: io_t; + reply: reply_port_t); + +simpleroutine io_set_some_openmodes_request ( + io_object: io_t; + reply: reply_port_t; + bits_to_set: int); + +simpleroutine io_clear_some_openmodes_request ( + io_object: io_t; + reply: reply_port_t; + bits_to_clear: int); + +simpleroutine io_async_request ( + io_object: io_t; + reply: reply_port_t; + notify_port: mach_port_send_t); + +simpleroutine io_mod_owner_request ( + io_object: io_t; + reply: reply_port_t; + owner: pid_t); + +simpleroutine io_get_owner_request ( + io_object: io_t; + reply: reply_port_t); + +simpleroutine io_get_icky_async_id_request ( + io_object: io_t; + reply: reply_port_t); + +simpleroutine io_select_request ( + io_object: io_t; + reply: reply_port_t; + select_type: int; + id_tag: int); + +simpleroutine io_stat_request ( + stat_object: io_t; + reply: reply_port_t); + +/* io_reauthenticate is a simpleroutine already. */ +skip; + +simpleroutine io_restrict_auth_request ( + io_object: io_t; + reply: reply_port_t; + uids: idarray_t; + gids: idarray_t); + +simpleroutine io_duplicate_request ( + io_object: io_t; + reply: reply_port_t); + +simpleroutine io_server_version_request ( + vers_object: io_t; + reply: reply_port_t); + +simpleroutine io_map_request ( + io_object: io_t; + reply: reply_port_t); + +simpleroutine io_map_cntl_request ( + io_object: io_t; + reply: reply_port_t); + +simpleroutine io_get_conch_request ( + io_object: io_t; + reply: reply_port_t); + +simpleroutine io_release_conch_request ( + io_object: io_t; + reply: reply_port_t); + +simpleroutine io_eofnotify_request ( + io_object: io_t; + reply: reply_port_t); + +simpleroutine io_prenotify_request ( + io_object: io_t; + reply: reply_port_t; + write_start: vm_offset_t; + write_end: vm_offset_t); + +simpleroutine io_postnotify_request ( + io_object: io_t; + reply: reply_port_t; + write_start: vm_offset_t; + write_end: vm_offset_t); + +simpleroutine io_readnotify_request ( + io_object: io_t; + reply: reply_port_t); + +simpleroutine io_readsleep_request ( + io_object: io_t; + reply: reply_port_t); + +simpleroutine io_sigio_request ( + io_object: io_t; + reply: reply_port_t); + + + + diff --git a/hurd/ioctl-decode.h b/hurd/ioctl-decode.h new file mode 100644 index 00000000..f65880cf --- /dev/null +++ b/hurd/ioctl-decode.h @@ -0,0 +1,15 @@ +/* This file is used by the Makefile rules for generating + Xioctl-proto.defs, see Makefile for details. */ + +#define CMD(request) _IOC_COMMAND (request) +#define TYPE(request) _IOC_TYPE (request) +#define INOUT(request) _IOC_INOUT (request) + +#define SUBID(request) IOC_COMMAND_SUBID (_IOC_COMMAND (request)) + +#define TYPE0(request) _IOT_TYPE0 (_IOC_TYPE (request)) +#define TYPE1(request) _IOT_TYPE1 (_IOC_TYPE (request)) +#define TYPE2(request) _IOT_TYPE2 (_IOC_TYPE (request)) +#define COUNT0(request) _IOT_COUNT0 (_IOC_TYPE (request)) +#define COUNT1(request) _IOT_COUNT1 (_IOC_TYPE (request)) +#define COUNT2(request) _IOT_COUNT2 (_IOC_TYPE (request)) diff --git a/hurd/ioctl-tmpl.sym b/hurd/ioctl-tmpl.sym new file mode 100644 index 00000000..8029ec00 --- /dev/null +++ b/hurd/ioctl-tmpl.sym @@ -0,0 +1,13 @@ +/* This file is used by the Makefile rules for generating + Xioctl-proto.defs, see Makefile for details. */ + +#include <sys/ioctl.h> +#include <hurd/ioctls.defs> + +#include "ioctl-decode.h" + +#include "@HEADER_LIST@" +#define GROUPCHAR '@GROUP@' + +expr GROUPCHAR GROUP +expr IOC_GROUP_SUBSYSTEM(GROUPCHAR) SUBSYSTEM diff --git a/hurd/ioctl.awk b/hurd/ioctl.awk new file mode 100644 index 00000000..289a9ab9 --- /dev/null +++ b/hurd/ioctl.awk @@ -0,0 +1,127 @@ +# +# This awk script is used by the Makefile rules for generating +# Xioctl-proto.defs, see Makefile for details. +# + +$1 == "SUBSYSTEM" { subsystem = $2 + 0; next } +$1 == "GROUP" { groupchar = $2; next } + +$2 == "CMD" { cmd[tolower($1)] = $3; + c = $3 + 0; + if (c > highcmd) highcmd = c; + icmd[c] = tolower($1); + next } +$2 == "SUBID" { subid[tolower($1)] = $3; + c = $3 + 0; + if (c > highid) highid = c; + id2cmdname[c] = tolower($1); + next } +$2 == "TYPE" { type[tolower($1)] = $3; next } +$2 == "INOUT" { inout[tolower($1)] = $3; next } +$2 == "TYPE0" { type0[tolower($1)] = $3; next } +$2 == "TYPE1" { type1[tolower($1)] = $3; next } +$2 == "TYPE2" { type2[tolower($1)] = $3; next } +$2 == "COUNT0" { count0[tolower($1)] = $3; next } +$2 == "COUNT1" { count1[tolower($1)] = $3; next } +$2 == "COUNT2" { count2[tolower($1)] = $3; next } + +END { + group = sprintf("%cioctl", groupchar); + + printf "subsystem %s %d; /* see ioctls.defs for calculation */\n\n", \ + group, subsystem; + + typemap[0] = "char"; + typemap[1] = "char"; + typemap[2] = "short"; + typemap[3] = "int"; + typemap[4] = "???64 bits???"; + inoutmap[1] = "out"; + inoutmap[2] = "in"; + inoutmap[3] = "inout"; + + print ""; + for (cmdname in type0) { + if (count0[cmdname] > 1) { + typecount = type0[cmdname] "," count0[cmdname]; + if (!tc[typecount]) { + tc[typecount] = typemap[type0[cmdname]] "array_" count0[cmdname] "_t"; + print "type", tc[typecount], "=", ("array[" count0[cmdname] "]"), \ + "of", (typemap[type0[cmdname]] ";"), "/* XXX rename this! */"; + } + argtype["0," cmdname] = tc[typecount]; + } + else if (count0[cmdname] == 1) { + argtype["0," cmdname] = typemap[type0[cmdname]] + } + } + + for (cmdname in type1) { + if (count1[cmdname] > 1) { + typecount = type1[cmdname] "," count1[cmdname]; + if (!tc[typecount]) { + tc[typecount] = typemap[type1[cmdname]] "array_" count1[cmdname] "_t"; + print "type", tc[typecount], "=", ("array[" count1[cmdname] "]"), \ + "of", (typemap[type1[cmdname]] ";"), "/* XXX rename this! */"; + } + argtype["1," cmdname] = tc[typecount]; + } + else if (count1[cmdname] == 1) { + argtype["1," cmdname] = typemap[type1[cmdname]] + } + } + + for (cmdname in type2) { + if (count2[cmdname] > 1) { + typecount = type2[cmdname] "," count2[cmdname]; + if (!tc[typecount]) { + tc[typecount] = typemap[type2[cmdname]] "array_" count2[cmdname] "_t"; + print "type", tc[typecount], "=", ("array[" count2[cmdname] "]"), \ + "of", (typemap[type2[cmdname]] ";"), "/* XXX rename this! */"; + } + argtype["2," cmdname] = tc[typecount]; + } + else if (count2[cmdname] == 1) { + argtype["2," cmdname] = typemap[type2[cmdname]] + } + } + print ""; + + lastid = -1; + for (i = 0; i <= highid; ++i) + if (id2cmdname[i]) { + cmdname = id2cmdname[i]; + + if (lastid < 100 && i > 100) { + if (lastid == 98) + print "\nskip; /* 99 unused */" + else + printf "\nskip %d; /* %d-99 unused */\n", 100 - lastid, lastid + 1; + print "\n\ +/* Because MiG defines reply ports as 100 more than request ports, we\n\ + have to leave one hundred empty RPC's here. */\n\ +skip 100;"; + lastid = 199; + } + + if (i == lastid + 2) + print "\nskip; /*", lastid + 1, "unused */"; + else if (i != lastid + 1) + printf "\nskip %d; /* %d-%d unused */\n", \ + i - lastid - 1, lastid + 1, i - 1; + lastid = i; + print "\n/*", i, toupper(cmdname), "*/"; + printf "routine %s_%s (\n\treqport: io_t", group, cmdname; + if (inout[cmdname]) { + io = inoutmap[inout[cmdname]]; + for (argidx = 0; argidx <= 2; ++argidx) + if (argtype[argidx "," cmdname]) + printf ";\n\t%s\targ%d: %s", \ + io, argidx, argtype[argidx "," cmdname]; + } + else { + printf ";\n\tin\trequest: int"; + } + print ");" + } +} diff --git a/hurd/ioctl_types.h b/hurd/ioctl_types.h new file mode 100644 index 00000000..01a1e2e6 --- /dev/null +++ b/hurd/ioctl_types.h @@ -0,0 +1,29 @@ +/* Types used in RPC definitions corresponding to ioctls. + Copyright (C) 1994, 1996 Free Software Foundation + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2, or (at + your option) any later version. + + This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ + +#ifndef _HURD_IOCTL_TYPES_H +#define _HURD_IOCTL_TYPES_H + +#include <termios.h> +typedef tcflag_t modes_t[4]; +typedef speed_t speeds_t[2]; +typedef cc_t ccs_t[NCCS]; + +#include <sys/ioctl.h> +typedef struct winsize winsize_t; + +#endif /* hurd/ioctl_types.h */ diff --git a/hurd/ioctls.defs b/hurd/ioctls.defs new file mode 100644 index 00000000..bcad5489 --- /dev/null +++ b/hurd/ioctls.defs @@ -0,0 +1,48 @@ +/* Macro definitions for defining and using ioctl-based RPC interfaces. + Copyright (C) 1999 Free Software Foundation, Inc. + +This file is part of the GNU Hurd. + +The GNU Hurd is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +The GNU Hurd is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with the GNU Hurd; see the file COPYING. If not, write to +the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ + +#ifndef _HURD_IOCTLS_DEFS +#define _HURD_IOCTLS_DEFS 1 + +#ifndef _SYS_IOCTL_H +#define _SYS_IOCTL_H /* Suppress #error in <bits/ioctl.h>. */ +#endif +#include <bits/ioctls.h> + + +/* Calculate the MiG subsystem (i.e. first message ID) + for the RPCs produced by ioctl requests in the given group. */ +#define IOC_GROUP_SUBSYSTEM(group) (100000 + ((group) - 'f') * 4000) + +/* Because of MiG's poorly chosen algorithm of adding 100 to a request + msgid to produce the reply msgid, we cannot just add the command part of + the ioctl request to the subsystem base msgid. For ioctl requests past + 99, we must skip blocks of 100 msgids to allow for the reply msgids + corresponding to the earlier requests. Since our ioctl request format + allows only 7 bits for the command portion, we know that it cannot + exceed 127 and thus we can handle just 100+ as a special case. */ +#define IOC_COMMAND_SUBID(cmd) ((cmd) + ((cmd) < 100 ? 0 : 100)) + +#define IOC_CONSTRUCT_MSGID(group, cmd) \ + (IOC_GROUP_SUBSYSTEM (group) + IOC_COMMAND_SUBID (cmd)) +#define IOC_MSGID(request) \ + IOC_CONSTRUCT_MSGID (_IOC_GROUP (request), _IOC_COMMAND (request)) + + +#endif /* !_HURD_IOCTLS_DEFS */ diff --git a/hurd/kernel_boot.defs b/hurd/kernel_boot.defs new file mode 100644 index 00000000..d3b3975e --- /dev/null +++ b/hurd/kernel_boot.defs @@ -0,0 +1,29 @@ +/* Communication between the kernel and the startup task. + Copyright (C) 1992, 1993 Free Software Foundation, Inc. + +This file is part of the GNU Hurd. + +The GNU Hurd is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +The GNU Hurd is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with the GNU Hurd; see the file COPYING. If not, write to +the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ + +/* Written by Roland McGrath. */ + +subsystem kernel_boot 999999; + +#include <mach/mach_types.defs> + +routine kernel_boot_get_priv_ports ( + bootstrap: mach_port_t; /* Bootstrap port of the startup task. */ + out host_priv: mach_port_t; + out device_master: mach_port_t); diff --git a/hurd/login.defs b/hurd/login.defs new file mode 100644 index 00000000..7adcbcd7 --- /dev/null +++ b/hurd/login.defs @@ -0,0 +1,58 @@ +/* Definitions for the database of logged-in users + Copyright (C) 1994 Free Software Foundation + +This file is part of the GNU Hurd. + +The GNU Hurd is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +The GNU Hurd is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with the GNU Hurd; see the file COPYING. If not, write to +the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ + +subsystem login 36000; + +#include <hurd/hurd_types.defs> + +#ifdef LOGIN_IMPORTS +LOGIN_IMPORTS +#endif + +/* For each logged in user, a file is conventionally created in the + directory `/var/logins' with the name of the user, a hyphen, and a small + integer. (The suffix is there to distinguish multiple logons of the + same user.) On each such node an active translator should be found + which implements this interface. */ + +/* Send an immediate message to the user. */ +routine login_message_user ( + login: file_t; + message: data_t); + +/* Return a human-readable string describing the user's physical location. */ +routine login_get_location ( + login: file_t; + out location: data_t, dealloc); + +/* Return how much time has passed since the user last used an input device. */ +routine login_get_idle_time ( + login: file_t; + out idletime: time_value_t); + +/* Return a list of file names for input devices being used, separated by null + characters. This call is optional; clients should not depend on it. */ +routine login_get_input_devices ( + login: file_t; + out devices: data_t, dealloc); + +/* Return the process collection ID for the user's login collection. */ +routine login_get_login_collection ( + login: file_t; + out id: pid_t); diff --git a/hurd/msg.defs b/hurd/msg.defs new file mode 100644 index 00000000..32c962af --- /dev/null +++ b/hurd/msg.defs @@ -0,0 +1,204 @@ +/* RPCs which a friendly Hurd process will understand on its message port. + Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996 Free Software + Foundation, Inc. + +This file is part of the GNU Hurd. + +The GNU Hurd is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +The GNU Hurd is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with the GNU Hurd; see the file COPYING. If not, write to +the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ + +subsystem msg 23000; + +#include <hurd/hurd_types.defs> + +#ifdef MSG_IMPORTS +MSG_IMPORTS +#endif + +/* WARNING: The file hurd/proc/stubs.c knows the RPC message ID's + and formats for some of the RPC's in this file. */ + +/* Post a signal to the process. The refport indicates some + permission attribute that the caller provides in the hope that the + receiver will honor the signal. Conventional values include: + +Port Signals honored + +task port all +session ID (see proc_getsidport) CONT +ctty port (see term_getctty) INT, QUIT, TSTP, HUP +async IO ID (see io_async) URG, IO +*/ +routine msg_sig_post ( + process: mach_port_t; + sreplyport reply_port: sreply_port_t; + signal: int; + sigcode: natural_t; + refport: mach_port_t); + +/* The parent or the process group of a process has been changed, or + the orphaned status has changed. The task port is sent so that the + recipient can know it's OK to honor the call. */ +routine msg_proc_newids ( + process: mach_port_t; + task: task_t; + ppid: pid_t; + pgrp: pid_t; + orphaned: int); + +/* Do a reauth after or-ing in new id's. */ +routine msg_add_auth ( + process: mach_port_t; + auth: auth_t); + +/* Do a reauth after removing auth information. The task port is + provided as an attempt at security. */ +routine msg_del_auth ( + process: mach_port_t; + task: task_t; + uids: intarray_t; + gids: intarray_t); + +/* These eight calls fetch and store the ports and other information + that were passed to the process at exec time (see hurd_types.h). + The REFPORT can be the task port or the auth port. */ + +routine msg_get_init_port ( + process: mach_port_t; + refport: mach_port_t; + which: int; + out port: mach_port_send_t); + +routine msg_set_init_port ( + process: mach_port_t; + refport: mach_port_t; + which: int; + port: mach_port_send_t); + +routine msg_get_init_ports ( + process: mach_port_t; + refport: mach_port_t; + out ports: portarray_t, dealloc); + +routine msg_set_init_ports ( + process: mach_port_t; + refport: mach_port_t; + ports: portarray_t); + +routine msg_get_init_int ( + process: mach_port_t; + refport: mach_port_t; + which: int; + out value: int); + +routine msg_set_init_int ( + process: mach_port_t; + refport: mach_port_t; + which: int; + value: int); + +routine msg_get_init_ints ( + process: mach_port_t; + refport: mach_port_t; + out values: intarray_t, dealloc); + +routine msg_set_init_ints ( + process: mach_port_t; + refport: mach_port_t; + values: intarray_t); + +/* These two calls fetch and store the file descriptor table. */ + +routine msg_get_dtable ( + process: mach_port_t; + refport: mach_port_t; + out dtable: portarray_t, dealloc); + +routine msg_set_dtable ( + process: mach_port_t; + refport: mach_port_t; + dtable: portarray_t); + +/* These two calls fetch and store a single file descriptor. */ + +routine msg_get_fd ( + process: mach_port_t; + refport: mach_port_t; + fd: int; + out port: mach_port_send_t); + +routine msg_set_fd ( + process: mach_port_t; + refport: mach_port_t; + fd: int; + port: mach_port_send_t); + +/* These two calls fetch and store the whole environment, + in "a=b\0c=d\0" form. */ + +routine msg_get_environment ( + process: mach_port_t; + out value: data_t, dealloc); + +routine msg_set_environment ( + process: mach_port_t; + refport: mach_port_t; + value: data_t); + +/* These two calls fetch and store a single environment variable. */ + +routine msg_get_env_variable ( + process: mach_port_t; + variable: string_t; + out value: data_t, dealloc); + +routine msg_set_env_variable ( + process: mach_port_t; + refport: mach_port_t; + variable: string_t; + value: string_t; + replace: boolean_t); + +skip; /* Obsolete io_select_done. */ +skip; /* Obsolete msg_startup_dosync. */ + +/* Like msg_sig_post, but the receiver should ignore his trace bit + and deliver the signal normally even if traced, first resuming if + he was suspended. */ +routine msg_sig_post_untraced ( + process: mach_port_t; + sreplyport reply_port: sreply_port_t; + signal: int; + sigcode: natural_t; + refport: mach_port_t); + +/* Return a description of why THREAD is waiting. THREAD must + be a thread in this task. If the thread is not waiting, or the reason + is unknown, return zero. WAIT_RPC is the RPC code of the RPC the thread + is waiting on, or zero if it is not blocked in an RPC. */ +routine msg_report_wait ( + process: mach_port_t; + thread: thread_t; + out wait_desc: string_t; + out wait_rpc: int); + +/* Given a list of port names in NAMES, return a description of the + corresponding port from libc's point of view, in a '\0'-separated vector. + Ports that libc doesn't know about should result in a zero-length entry. */ +routine msg_describe_ports ( + process: mach_port_t; + refport: mach_port_t; + names: mach_port_name_array_t; + out descriptions: data_t); + diff --git a/hurd/msg_reply.defs b/hurd/msg_reply.defs new file mode 100644 index 00000000..357224f9 --- /dev/null +++ b/hurd/msg_reply.defs @@ -0,0 +1,55 @@ +/* Reply side of miscellaneous callbacks from Hurd servers to their clients + Copyright (C) 1994, 1995 Free Software Foundation, Inc. + +This file is part of the GNU Hurd. + +The GNU Hurd is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +The GNU Hurd is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with the GNU Hurd; see the file COPYING. If not, write to +the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ + +subsystem msg_reply 23100; /* must match msg.defs + 100 */ + +#include <hurd/hurd_types.defs> + +type reply_port_t = polymorphic | MACH_MSG_TYPE_PORT_SEND_ONCE + ctype: mach_port_t; + +simpleroutine msg_sig_post_reply ( + reply_port: reply_port_t; + in return_code: kern_return_t); + +skip; /* msg_proc_newids */ +skip; /* msg_add_auth */ +skip; /* msg_del_auth */ +skip; /* msg_get_init_port */ +skip; /* msg_set_init_port */ +skip; /* msg_get_init_ports */ +skip; /* msg_set_init_ports */ +skip; /* msg_get_init_int */ +skip; /* msg_set_init_int */ +skip; /* msg_get_init_ints */ +skip; /* msg_set_init_ints */ +skip; /* msg_get_dtable */ +skip; /* msg_set_dtable */ +skip; /* msg_get_fd */ +skip; /* msg_set_fd */ +skip; /* msg_get_environment */ +skip; /* msg_set_environment */ +skip; /* msg_get_env_variable */ +skip; /* msg_set_env_variable */ +skip; /* Obsolete io_select_done. */ +skip; /* msg_startup_dosync */ + +simpleroutine msg_sig_post_untraced_reply ( + reply_port: reply_port_t; + in return_code: kern_return_t); diff --git a/hurd/msg_request.defs b/hurd/msg_request.defs new file mode 100644 index 00000000..e3c0ad3f --- /dev/null +++ b/hurd/msg_request.defs @@ -0,0 +1,61 @@ +/* Reply side of canonical Hurd process message port RPCs. + Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc. + +This file is part of the GNU Hurd. + +The GNU Hurd is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +The GNU Hurd is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with the GNU Hurd; see the file COPYING. If not, write to +the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ + +subsystem msg_request 23000; /* must match msg.defs */ + +#include <hurd/hurd_types.defs> + +type reply_port_t = polymorphic | polymorphic + ctype: mach_port_t; + +simpleroutine msg_sig_post_request ( + process: mach_port_t; + replyport reply_port: reply_port_t; + signal: int; + sigcode: natural_t; + refport: mach_port_t); + +skip; /* msg_proc_newids */ +skip; /* msg_add_auth */ +skip; /* msg_del_auth */ +skip; /* msg_get_init_port */ +skip; /* msg_set_init_port */ +skip; /* msg_get_init_ports */ +skip; /* msg_set_init_ports */ +skip; /* msg_get_init_int */ +skip; /* msg_set_init_int */ +skip; /* msg_get_init_ints */ +skip; /* msg_set_init_ints */ +skip; /* msg_get_dtable */ +skip; /* msg_set_dtable */ +skip; /* msg_get_fd */ +skip; /* msg_set_fd */ +skip; /* msg_get_environment */ +skip; /* msg_set_environment */ +skip; /* msg_get_env_variable */ +skip; /* msg_set_env_variable */ +skip; /* Obsolete io_select_done. */ +skip; /* msg_startup_dosync */ + +simpleroutine msg_sig_post_untraced_request ( + process: mach_port_t; + replyport reply_port: reply_port_t; + signal: int; + sigcode: natural_t; + refport: mach_port_t); diff --git a/hurd/newterm.defs b/hurd/newterm.defs new file mode 100644 index 00000000..9371bdfb --- /dev/null +++ b/hurd/newterm.defs @@ -0,0 +1,38 @@ +/* Creation of terminal processors + Copyright (C) 1991, 1993 Free Software Foundation + +This file is part of the GNU Hurd. + +The GNU Hurd is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +The GNU Hurd is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with the GNU Hurd; see the file COPYING. If not, write to +the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ + +/* Written by Michael I. Bushnell. */ + +subsystem newterm 27000; + +#include <hurd/hurd_types.defs> + +/* Create a new terminal thingie with no bottom half. (You need to do + one of term_on_* before this can be used for I/O.) */ +newterm_from_device ( + newterm: mach_port_t; + out terminal: io_t); + +/* Register a terminal as a node in the filesystem. */ +newterm_makenode ( + newterm: mach_port_t; + terminal: io_t; + mode: mode_t; + server_picks_name: int; + name: string_t); diff --git a/hurd/password.defs b/hurd/password.defs new file mode 100644 index 00000000..b6d74198 --- /dev/null +++ b/hurd/password.defs @@ -0,0 +1,50 @@ +/* Protocol for password checker + Copyright (C) 1997, 1998 Free Software Foundation, Inc. + +This file is part of the GNU Hurd. + +The GNU Hurd is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +The GNU Hurd is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with the GNU Hurd; see the file COPYING. If not, write to +the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ + +/* Written by Thomas Bushnell, n/BSG. */ + +subsystem password 38000; + +#ifdef PASSWORD_IMPORTS +PASSWORD_IMPORTS +#endif + +#include <hurd/hurd_types.defs> + +/* Service for this protocol normally lives on /servers/password as + specified by _SERVERS_PASSWORD in <hurd/paths.h>. */ + +/* Check to see if the password for user USER is really PW. Return + an error if it fails, and return an auth port for the id in AUTH + if it succeeded. */ +routine password_check_user ( + server: io_t; + user: uid_t; + pw: string_t; + out auth: mach_port_send_t); + + +/* Check to see if the password for GROUP is really PW. Return + an error if it fails, and return an auth port for the id in AUTH + if it succeeded. */ +routine password_check_group ( + server: io_t; + group: uid_t; + pw: string_t; + out auth: mach_port_send_t); diff --git a/hurd/paths.h b/hurd/paths.h new file mode 100644 index 00000000..e35f51bc --- /dev/null +++ b/hurd/paths.h @@ -0,0 +1,56 @@ +/* Standard Hurd pathnames. + Copyright (C) 1992, 1994, 1995, 1997 Free Software Foundation, Inc. + +This file is part of the GNU Hurd. + +The GNU Hurd is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +The GNU Hurd is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with the GNU Hurd; see the file COPYING. If not, write to +the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ + +#ifndef _HURD_PATHS_H +#define _HURD_PATHS_H + +/* Port rendezvous points are specified by symbols _SERVERS_FOO, + the canonical pathname being /servers/foo. */ + +#define _SERVERS "/servers/" +#define _SERVERS_CRASH _SERVERS "crash" +#define _SERVERS_EXEC _SERVERS "exec" +#define _SERVERS_STARTUP _SERVERS "startup" +#define _SERVERS_PROC _SERVERS "proc" +#define _SERVERS_PASSWORD _SERVERS "password" + +/* Directory containing naming points for socket servers. + Entries are named by the string representing the domain number + in simple decimal (e.g. "/servers/socket/23"). */ +#define _SERVERS_SOCKET _SERVERS "socket" + +/* Hurd servers are specified by symbols _HURD_FOO, + the canonical pathname being /hurd/foo. */ + +#define _HURD "/hurd/" +#define _HURD_INIT _HURD "init" +#define _HURD_PROC _HURD "proc" +#define _HURD_AUTH _HURD "auth" + +/* Standard translators for special node types. + These pathnames are used by the C library. + UFS and perhaps other filesystems short-circuit these translators. */ +#define _HURD_SYMLINK _HURD "symlink" /* S_IFLNK */ +#define _HURD_CHRDEV _HURD "chrdev" /* S_IFCHR */ +#define _HURD_BLKDEV _HURD "blkdev" /* S_IFBLK */ +#define _HURD_FIFO _HURD "fifo" /* S_IFIFO */ +#define _HURD_IFSOCK _HURD "ifsock" /* S_IFSOCK */ + + +#endif /* hurd/paths.h */ diff --git a/hurd/pfinet.defs b/hurd/pfinet.defs new file mode 100644 index 00000000..abaf14d8 --- /dev/null +++ b/hurd/pfinet.defs @@ -0,0 +1,61 @@ +/* Definitions for pfinet-specific calls + Copyright (C) 1999 Free Software Foundation + +This file is part of the GNU Hurd. + +The GNU Hurd is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +The GNU Hurd is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with the GNU Hurd; see the file COPYING. If not, write to +the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ + +subsystem pfinet 21000; + +#include <hurd/hurd_types.defs> + +#ifdef SOCKET_IMPORTS +SOCKET_IMPORTS +#endif + +INTR_INTERFACE + + +/* Register a new interface. This call is made on the main socket + rendezvous port (/servers/socket/pfinet). */ +routine pfinet_register_interface ( + server: pf_t; + name: string_t; + address: int; /* in net byte order */ + network: int; /* in net byte order */ + mask: int; /* in net byte order */ + broadcast: int; /* in net byte order */ + mac_hdr_len: int; + xmit: mach_port_send_t; + out recv: mach_port_send_t); + +/* Process an incoming packet. This is made on the RECVXMIT port returned + by a previous call to pfinet_register_interface. */ +simpleroutine pfinet_recv ( + rx: mach_port_t; + packet: data_t); + +/* Sent by pfinet TO an interface for each packet that needs to be sent. + The first mac_hdr_len bytes of the buffer are unfilled; the actual + IP packet begins that many bytes in. */ +simpleroutine pfinet_xmit ( + tx: mach_port_t; + is_broadcast: int; + packet: data_t); + + + + + diff --git a/hurd/process.defs b/hurd/process.defs new file mode 100644 index 00000000..6c171ac8 --- /dev/null +++ b/hurd/process.defs @@ -0,0 +1,367 @@ +/* Definitions for process server interface + Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997 Free Software Foundation + +This file is part of the GNU Hurd. + +The GNU Hurd is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +The GNU Hurd is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with the GNU Hurd; see the file COPYING. If not, write to +the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ + +subsystem process 24000; + +#include <hurd/hurd_types.defs> + +/* If any calls are added or deleted, modify process_reply.defs + and process_request.defs accordingly. */ + +#ifdef PROCESS_IMPORTS +PROCESS_IMPORTS +#endif + +INTR_INTERFACE + + +/*** Host management ***/ + +skip; /* Was proc_sethostid */ +skip; /* Was proc_gethostid */ +skip; /* Was proc_sethostname */ +skip; /* Was proc_gethostname */ + +/* Get the privileged host port and the device master port. */ +routine proc_getprivports ( + process: process_t; + out host_priv: host_priv_t; + out device_master: device_t); + +/* Return all the pids of all live processes. */ +routine proc_getallpids ( + process: process_t; + out pidarray: pidarray_t, dealloc); + +/* Set the "standard exec data", used by programs that want predefined + values for exec. */ +routine proc_setexecdata ( + process: process_t; + ports: portarray_t; + ints: intarray_t); + +/* Get the standard exec data */ +routine proc_getexecdata ( + process: process_t; + out ports: portarray_t, dealloc; + out ints: intarray_t, dealloc); + +/* Request notification with exec_setexecdata on NOTIFY. */ +routine proc_execdata_notify ( + process: process_t; + notify: mach_port_send_t); + +/* Return a uname structure for the currently running system. */ +routine proc_uname ( + process: process_t; + out uname: utsname_t); + +/* Tell the server who we are for inclusion in the uname string. */ +routine proc_register_version ( + process: process_t; + credential: host_priv_t; + name: string_t; + release: string_t; + version: string_t); + +/*** Process creation and simple management. ***/ + +/* There is a 1-1 relationship between tasks and processes; to create + a new process, just create a new task and use proc_task2proc. */ + +/* Change the current authentication of the process. The user should + follow this call with a call to auth_user_authenticate. The + new_port passed back through the auth server will be + MACH_PORT_NULL. */ +simpleroutine proc_reauthenticate ( + process: process_t; + rendezvous2: mach_port_send_t); + +/* Declare that a task is a child of the caller. The task's state + will then inherit from the caller. This call can be made only once + per task. */ +routine proc_child ( + process: process_t; + child: task_t); + +/* Atomically change the message port of a process. */ +routine proc_setmsgport ( + process: process_t; + sreplyport reply_port: sreply_port_t; + newmsgport: mach_port_t; + out oldmsgport: mach_port_send_t); + +/* Cause a task to take over the pid and all other state from an + existing task, and kill the old task with task_terminate. The + message port will be set to MACH_PORT_NULL. This is principally + used for doing exec's with the EXEC_NEWTASK bit set. The request + port assigned to NEWTASK does not change. The new task cannot have + had proc_child called on its behalf, it cannot have a pgrp, a session, + a login name set with proc_setlogin, it cannot have called proc_child, + and it cannot have a message port. */ +/* If this call is made for a process which is no longer alive or + does not exist, then newtask will be killed (and no error + is returned). */ +routine proc_reassign ( + process: process_t; + newtask: task_t); + +/* Set the owner of the process. The new owner must be within the + current authentication of the caller. If CLEAR is set, then ignore + OWNER and restore the process to unowned status. */ +routine proc_setowner ( + process: process_t; + owner: uid_t; + clear: int); + +/* Get the process ID and the parent process ID, also find out if we + are orphaned. */ +routine proc_getpids ( + process: process_t; + out pid: pid_t; + out ppid: pid_t; + out orphaned: int); + +/* Set the locations of ARGV and ENVP which will be examined + by proc_getprocargs and proc_getprocenv. */ +routine proc_set_arg_locations ( + process: process_t; + argv: vm_address_t; + envp: vm_address_t); + +/* Fetch the locations set by proc_set_arg_locations. */ +routine proc_get_arg_locations ( + process: process_t; + out argv: vm_address_t; + out envp: vm_address_t); + +/* Fetch the message port of a process */ +routine proc_getmsgport ( + process: process_t; + sreplyport reply_port: sreply_port_t; + pid: pid_t; + out msgport: mach_port_t); + +/* Wait for a child process to exit. If pid is zero, it waits for any + child in the same pgrp as the parent. If pid is -1, it waits for + any child. Otherwise, if pid is negative, it waits for any process + in the specified process group. If pid is positive, it waits for + the specified process. The exit status and resource usage of the + process are returned in status and rusage respectively. */ +routine proc_wait ( + process: process_t; + sreplyport reply_port: sreply_port_t; + pid: pid_t; + options: int; + out status: int; + out sigcode: int; + out rusage: rusage_t; + out pid_status: pid_t); + +/* Have the process server stop all threads except contthread. */ +routine proc_dostop ( + process: process_t; + contthread: thread_t); + +/* Take over exception messages received on MSGPORT. Any exception + messages received will be forwarded to FORWARDPORT. In addition, + the thread causing the exception will be aborted (with thread_abort) + and have its state adjusted (as by thread_set_state). */ +routine proc_handle_exceptions ( + process: process_t; + msgport: mach_port_move_receive_t; + forwardport: mach_port_send_t; + flavor: int; + new_state: thread_state_t); + + + +/*** Mark bits. Some of these (exec, traced, eg) modify small pieces + of the proc server's behavior; others are purely informational. ***/ + +/* Mark the process as stopped on a signal. */ +routine proc_mark_stop ( + process: process_t; + signo: int; + sigcode: int); + +/* Mark the process as continued after a stop. */ +routine proc_mark_cont ( + process: process_t); + +/* Tell the process server that the process is going away. If it dies + without calling this, it will look to the parent like the process + died with SIGKILL. This call allows for a cleaner exit. */ +routine proc_mark_exit ( + process: process_t; + status: int; + sigcode: int); + +/* Inform the process server that the process has completed an exec. */ +routine proc_mark_exec ( + process: process_t); + +/* Inform the process server that the process has asked to be traced. + The only result of this is to change the behavior of wait by the + parent slightly. */ +routine proc_mark_traced ( + process: process_t); + +/* Inform the process server whether SIGCHLD should be sent for stopped + child processes. */ +routine proc_mod_stopchild ( + process: process_t; + doit: int); + + +/*** Miscellaneous process information queries. ***/ + +routine proc_pid2task ( + process: process_t; + pid: pid_t; + out task: task_t); + +routine proc_task2pid ( + process: process_t; + task: task_t; + out pid: pid_t); + +/* Return the procserver port for the specified task. */ +routine proc_task2proc ( + process: process_t; + task: task_t; + out proc: mach_port_make_send_t); + +routine proc_proc2task ( + process: process_t; + out task: task_t); + +routine proc_pid2proc ( + process: process_t; + pid: pid_t; + out proc: mach_port_make_send_t); + +routine proc_getprocinfo ( + process: process_t; + which: pid_t; + inout flags: int; + out procinfo: procinfo_t; + out threadwaits: data_t, dealloc); + +routine proc_getprocargs ( + process: process_t; + which: pid_t; + out procargs: data_t, dealloc); + +routine proc_getprocenv ( + process: process_t; + which: pid_t; + out procenv: data_t, dealloc); + +/* Create a new login collection. The pid of PROCESS will be the id + of the collection. All the children (and their children, and so forth) of + PROCESS will automatically join the collection. If PROCESS dies its + children (and their children, and so forth) will become part of init's + process collection. */ +routine proc_make_login_coll ( + process: process_t); + +/* Get the process collection ID for the process specified by pid. */ +routine proc_getloginid ( + process: process_t; + pid: pid_t; + out login_id: pid_t); + +/* Get the pids of all the members of process collection ID. */ +routine proc_getloginpids ( + process: process_t; + id: pid_t; + out pids: pidarray_t, dealloc); + +/* These next two should not actually be used; they are here + for "historic reasons." You are not expected to understand this. */ +routine proc_setlogin ( + process: process_t; + logname: string_t); + +routine proc_getlogin ( + process: process_t; + out logname: string_t); + + + +/*** Sessions and process groups. ***/ + +/* Create a new session. The process's pgrp is set to its pid, and + becomes the session leader. */ +routine proc_setsid ( + process: process_t); + +/* Return the pid of a process's session leader. */ +routine proc_getsid ( + process: process_t; + pid: pid_t; + out sid: pid_t); + +/* Get the pgids of all the members of a session. */ +routine proc_getsessionpgids ( + process: process_t; + sid: pid_t; + out pgidset: pidarray_t, dealloc); + +/* Get the pids of all the members of a session. */ +routine proc_getsessionpids ( + process: process_t; + sid: pid_t; + out pidset: pidarray_t, dealloc); + +/* Return a "session ID" port for the session of the caller. + This port is generally only available to members of the session. + (It has no listener, but is useful for identification purposes.) */ +routine proc_getsidport ( + process: process_t; + out sessport: mach_port_send_t); + +/* Set the process group of a process. */ +routine proc_setpgrp ( + process: process_t; + pid: pid_t; + pgrp: pid_t); + +/* Get the process group of a process. */ +routine proc_getpgrp ( + process: process_t; + pid: pid_t; + out pgrp: pid_t); + +/* Get the pids of all the members of a pgrp. */ +routine proc_getpgrppids ( + process: process_t; + pgrp: pid_t; + out pidset: pidarray_t, dealloc); + + +/*** Another miscelleneous info query ***/ + +/* Return the controlling TTY used by PID in TTY; opened without read or + write access. */ +routine proc_get_tty ( + calling_process: process_t; + target_process: pid_t; + out tty: mach_port_send_t); diff --git a/hurd/process_reply.defs b/hurd/process_reply.defs new file mode 100644 index 00000000..c8a6c3c0 --- /dev/null +++ b/hurd/process_reply.defs @@ -0,0 +1,63 @@ +/* Reply half of wait + Copyright (C) 1991, 1993, 1994, 1996 Free Software Foundation + +This file is part of the GNU Hurd. + +The GNU Hurd is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +The GNU Hurd is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with the GNU Hurd; see the file COPYING. If not, write to +the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ + +/* Written by Michael I. Bushnell. */ + +subsystem process_reply 24100; /* must match process.defs + 100 */ + +#include <hurd/hurd_types.defs> + +type reply_port_t = polymorphic | MACH_MSG_TYPE_PORT_SEND_ONCE + ctype: mach_port_t; + +skip; skip; /* get/set hostid */ +skip; skip; /* get/set hostname */ +skip; /* getprivports */ +skip; /* getallpids */ +skip; skip; /* set/get execdata */ +skip; /* execdata_notify */ +skip; skip; /* proc_uname, proc_register_version */ + +skip; /* reauthenticate */ +skip; /* child */ + +simpleroutine proc_setmsgport_reply ( + reply_port: reply_port_t; + retcode: kern_return_t; + in oldmsgport: mach_port_t); + +skip; /* reassign */ +skip; /* setowner */ +skip; /* getpids */ +skip; /* set_arg_locations */ +skip; /* get_arg_locations */ + +simpleroutine proc_getmsgport_reply ( + reply_port: reply_port_t; + retcode: kern_return_t; + in msgports: mach_port_t); + +simpleroutine proc_wait_reply ( + reply_port: reply_port_t; + retcode: kern_return_t; + in status: int; + in sigcode: int; + in rusage: rusage_t; + in pid_status: pid_t); + diff --git a/hurd/process_request.defs b/hurd/process_request.defs new file mode 100644 index 00000000..8669e443 --- /dev/null +++ b/hurd/process_request.defs @@ -0,0 +1,367 @@ +/* Definitions for process server interface (request-only version) + + Copyright (C) 1992, 93, 94, 95, 96, 98 Free Software Foundation, Inc. + +This file is part of the GNU Hurd. + +The GNU Hurd is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +The GNU Hurd is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with the GNU Hurd; see the file COPYING. If not, write to +the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ + +subsystem process 24000; + +#include <hurd/hurd_types.defs> + +#ifdef PROCESS_IMPORTS +PROCESS_IMPORTS +#endif + +type reply_port_t = MACH_MSG_TYPE_MAKE_SEND_ONCE | polymorphic + ctype: mach_port_t; + + +/*** Host management ***/ + +skip; /* Was proc_sethostid */ +skip; /* Was proc_gethostid */ +skip; /* Was proc_sethostname */ +skip; /* Was proc_gethostname */ + +/* Get the privileged host port and the device master port. */ +simpleroutine proc_getprivports_request ( + process: process_t; + ureplyport reply: reply_port_t); + +/* Return all the pids of all live processes. */ +simpleroutine proc_getallpids_request ( + process: process_t; + ureplyport reply: reply_port_t); + +/* Set the "standard exec data", used by programs that want predefined + values for exec. */ +simpleroutine proc_setexecdata_request ( + process: process_t; + ureplyport reply: reply_port_t; + ports: portarray_t; + ints: intarray_t); + +/* Get the standard exec data */ +simpleroutine proc_getexecdata_request ( + process: process_t; + ureplyport reply: reply_port_t); + +/* Request notification with exec_setexecdata on NOTIFY. */ +simpleroutine proc_execdata_notify_request ( + process: process_t; + ureplyport reply: reply_port_t; + notify: mach_port_send_t); + +/* Return a uname structure for the currently running system. */ +simpleroutine proc_uname_request ( + process: process_t; + ureplyport reply: reply_port_t); + +/* Tell the server who we are for inclusion in the uname string. */ +simpleroutine proc_register_version_request ( + process: process_t; + ureplyport reply: reply_port_t; + credential: host_priv_t; + name: string_t; + release: string_t; + version: string_t); + +/*** Process creation and simple management. ***/ + +/* There is a 1-1 relationship between tasks and processes; to create + a new process, just create a new task and use proc_task2proc. */ + +/* Change the current authentication of the process. The user should + follow this call with a call to auth_user_authenticate. The + new_port passed back through the auth server will be + MACH_PORT_NULL. */ +simpleroutine proc_reauthenticate_request ( + process: process_t; + ureplyport reply: reply_port_t; + rendezvous2: mach_port_send_t); + +/* Declare that a task is a child of the caller. The task's state + will then inherit from the caller. This call can be made only once + per task. */ +simpleroutine proc_child_request ( + process: process_t; + ureplyport reply: reply_port_t; + child: task_t); + +/* Atomically change the message port of a process. */ +simpleroutine proc_setmsgport_request ( + process: process_t; + replyport reply: reply_port_t; + newmsgport: mach_port_t); + +/* Cause a task to take over the pid and all other state from an + existing task, and kill the old task with task_terminate. The + message port will be set to MACH_PORT_NULL. This is principally + used for doing exec's with the EXEC_NEWTASK bit set. The request + port assigned to NEWTASK does not change. The new task cannot have + had proc_child called on its behalf, it cannot have a pgrp, a session, + a login name set with proc_setlogin, it cannot have called proc_child, + and it cannot have a message port. */ +/* If this call is made for a process which is no longer alive or + does not exist, then newtask will be killed (and no error + is returned). */ +simpleroutine proc_reassign_request ( + process: process_t; + ureplyport reply: reply_port_t; + newtask: task_t); + +/* Set the owner of the process. The new owner must be within the + current authentication of the caller. */ +simpleroutine proc_setowner_request ( + process: process_t; + ureplyport reply: reply_port_t; + owner: uid_t; + clear: int); + +/* Get the process ID and the parent process ID, also find out if we + are orphaned. */ +simpleroutine proc_getpids_request ( + process: process_t; + ureplyport reply: reply_port_t); + +/* Set the locations of ARGV and ENVP which will be examined + by proc_getprocargs and proc_getprocenv. */ +simpleroutine proc_set_arg_locations_request ( + process: process_t; + ureplyport reply: reply_port_t; + argv: vm_address_t; + envp: vm_address_t); + +/* Fetch the locations set by proc_set_arg_locations. */ +simpleroutine proc_get_arg_locations_request ( + process: process_t; + ureplyport reply: reply_port_t); + +/* Fetch the message port of a process */ +simpleroutine proc_getmsgport_request ( + process: process_t; + replyport reply: reply_port_t; + pid: pid_t); + +/* Wait for a child process to exit. If pid is zero, it waits for any + child in the same pgrp as the parent. If pid is -1, it waits for + any child. Otherwise, if pid is negative, it waits for any process + in the specified process group. If pid is positive, it waits for + the specified process. The exit status and resource usage of the + process are returned in status and rusage respectively. */ +simpleroutine proc_wait_request ( + process: process_t; + replyport reply: reply_port_t; + pid: pid_t; + options: int); + +/* Have the process server stop all threads except contthread. */ +simpleroutine proc_dostop_request ( + process: process_t; + ureplyport reply: reply_port_t; + contthread: thread_t); + +/* Take over exception messages received on MSGPORT. Any exception + messages received will be forwarded to FORWARDPORT. In addition, + the thread causing the exception will be aborted (with thread_abort) + and have its state adjusted (as by thread_set_state). */ +simpleroutine proc_handle_exceptions_request ( + process: process_t; + ureplyport reply: reply_port_t; + msgport: mach_port_move_receive_t; + forwardport: mach_port_send_t; + flavor: int; + new_state: thread_state_t); + + + +/*** Mark bits. Some of these (exec, traced, eg) modify small pieces + of the proc server's behavior; others are purely informational. ***/ + +/* Mark the process as stopped on a signal. */ +simpleroutine proc_mark_stop_request ( + process: process_t; + ureplyport reply: reply_port_t; + signo: int; + sigcode: int); + +/* Mark the process as continued after a stop. */ +simpleroutine proc_mark_cont_request ( + process: process_t; + ureplyport reply: reply_port_t); + +/* Tell the process server that the process is going away. If it dies + without calling this, it will look to the parent like the process + died with SIGKILL. This call allows for a cleaner exit. */ +simpleroutine proc_mark_exit_request ( + process: process_t; + ureplyport reply: reply_port_t; + status: int; + sigcode:int ); + +/* Inform the process server that the process has completed an exec. */ +simpleroutine proc_mark_exec_request ( + process: process_t; + ureplyport reply: reply_port_t); + +/* Inform the process server that the process has asked to be traced. + The only result of this is to change the behavior of wait by the + parent slightly. */ +simpleroutine proc_mark_traced_request ( + process: process_t; + ureplyport reply: reply_port_t); + +/* Inform the process server whether SIGCHLD should be sent for stopped + child processes. */ +simpleroutine proc_mod_stopchild_request ( + process: process_t; + ureplyport reply: reply_port_t; + doit: int); + + +/*** Miscellaneous process information queries. ***/ + +simpleroutine proc_pid2task_request ( + process: process_t; + ureplyport reply: reply_port_t; + pid: pid_t); + +simpleroutine proc_task2pid_request ( + process: process_t; + ureplyport reply: reply_port_t; + task: task_t); + +/* Return the procserver port for the specified task. */ +simpleroutine proc_task2proc_request ( + process: process_t; + ureplyport reply: reply_port_t; + task: task_t); + +simpleroutine proc_proc2task_request ( + process: process_t; + ureplyport reply: reply_port_t); + +simpleroutine proc_pid2proc_request ( + process: process_t; + ureplyport reply: reply_port_t; + pid: pid_t); + +simpleroutine proc_getprocinfo_request ( + process: process_t; + ureplyport reply: reply_port_t; + which: pid_t; + flags: int); + +simpleroutine proc_getprocargs_request ( + process: process_t; + ureplyport reply: reply_port_t; + which: pid_t); + +simpleroutine proc_getprocenv_request ( + process: process_t; + ureplyport reply: reply_port_t; + which: pid_t); + +/* Create a new login collection. The pid of PROCESS will be the id + of the collection. All the children (and their children, and so forth) of + PROCESS will automatically join the collection. If PROCESS dies its + children (and their children, and so forth) will become part of init's + process collection. */ +simpleroutine proc_make_login_coll_request ( + process: process_t; + ureplyport reply: reply_port_t); + +/* Get the process collection ID for the process specified by pid. */ +simpleroutine proc_getloginid_request ( + process: process_t; + ureplyport reply: reply_port_t; + pid: pid_t); + +/* Get the pids of all the members of process collection ID. */ +simpleroutine proc_getloginpids_request ( + process: process_t; + ureplyport reply: reply_port_t; + id: pid_t); + +/* These next two should not actually be used; they are here + for "historic reasons." You are not expected to understand this. */ +simpleroutine proc_setlogin_request ( + process: process_t; + ureplyport reply: reply_port_t; + logname: string_t); + +simpleroutine proc_getlogin_request ( + process: process_t; + ureplyport reply: reply_port_t); + + +/*** Sessions and process groups. ***/ + +/* Create a new session. The process's pgrp is set to its pid, and + becomes the session leader. */ +simpleroutine proc_setsid_request ( + process: process_t; + ureplyport reply: reply_port_t); + +/* Return the pid of a process's session leader. */ +simpleroutine proc_getsid_request ( + process: process_t; + ureplyport reply: reply_port_t; + pid: pid_t); + +/* Get the pgids of all the members of a session. */ +simpleroutine proc_getsessionpgids_request ( + process: process_t; + ureplyport reply: reply_port_t; + sid: pid_t); + +/* Get the pids of all the members of a session. */ +simpleroutine proc_getsessionpids_request ( + process: process_t; + ureplyport reply: reply_port_t; + sid: pid_t); + +/* Return a "session ID" port for the session of the caller. + This port is generally only available to members of the session. + (It has no listener, but is useful for identification purposes.) */ +simpleroutine proc_getsidport_request ( + process: process_t; + ureplyport reply: reply_port_t); + +/* Set the process group of a process. */ +simpleroutine proc_setpgrp_request ( + process: process_t; + ureplyport reply: reply_port_t; + pid: pid_t; + pgrp: pid_t); + +/* Get the process group of a process. */ +simpleroutine proc_getpgrp_request ( + process: process_t; + ureplyport reply: reply_port_t; + pid: pid_t); + +/* Get the pids of all the members of a pgrp. */ +simpleroutine proc_getpgrppids_request ( + process: process_t; + ureplyport reply: reply_port_t; + pgrp: pid_t); + +simpleroutine proc_get_tty_request ( + process: process_t; + ureplyport reply: reply_port_t; + pid: pid_t); diff --git a/hurd/shared.h b/hurd/shared.h new file mode 100644 index 00000000..a63cdb91 --- /dev/null +++ b/hurd/shared.h @@ -0,0 +1,158 @@ +/* Definitions for shared IO control pages + Copyright (C) 1992, 1993, 1994 Free Software Foundation + +This file is part of the GNU Hurd. + +The GNU Hurd is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +The GNU Hurd is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with the GNU Hurd; see the file COPYING. If not, write to +the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ + +#include <sys/types.h> /* Defines `off_t'. */ + +struct shared_io +{ + int shared_page_magic; + + /* This lock protects against modification to conch_status. */ + spin_lock_t lock; + + enum + { + USER_HAS_CONCH, /* User is it */ + USER_COULD_HAVE_CONCH, /* User can become it */ + USER_RELEASE_CONCH, /* User is it, should release it promptly */ + USER_HAS_NOT_CONCH, /* User is not it */ + } conch_status; + + + /* While you hold the conch, the shared page will not change (except the + conch-status word might be changed from USER_HAS_CONCH to + USER_RELEASE_CONCH). In addition, cooperating users will not change + the contents of the file. The I/O server is a cooperating user itself + in its implementation of io_read, io_write, and so forth. The I/O + server is a separate user from all the shared I/O users. If a user + does not release the conch "promptly" then the conch may be stolen + from that user by the I/O server. "Promptly" will probably mean a few + seconds. + + As a consequence of these rules, if you hold the shared page, io_read + and so forth will block until you release the conch. You cannot + reliably predict what I/O operations in the server (in the io.defs + preceding the comment `Definitions for mapped I/O') might need the + conch, as a consequence, you should normally not call such functions + while you are holding the conch if that could cause a deadlock. */ + + + /* These values are set by the IO server only: */ + + int append_mode; /* append on each write */ + + int eof_notify; /* notify filesystem upon read of eof */ + int do_sigio; /* call io_sigio after each operation */ + + int use_file_size; /* file_size is meaningful */ + + int use_read_size; /* read_size is meaningful */ + off_t read_size; + + size_t optimal_transfer_size; /* users should try to have the + arguments to io_prenotify, etc. be + multiples of this value if it is + nonzero. */ + + enum + { + /* This means that there isn't any data to be read */ + RBR_NO_DATA, + + /* This means that more data cannot be added to the buffer. If + the rd_file_pointer is advanced, then more data might become + readable. This condition has priority over NO_DATA: protocols + might refuse to receive data when the buffer is full; then this + will be BUFFER_FULL. If file pointer gets advanced, then the + protocol will tell the sender to go ahead, and the read_block_reason + will be NO_DATA until the first data arrives. + */ + RBR_BUFFER_FULL, + + /* These conditions are generally only meaningful for nonseekable + objects. */ + } + read_block_reason; /* identifies what holds up reading */ + + int seekable; /* the file pointer can be reduced */ + + int use_prenotify_size; /* prenotify_size is meaningful */ + int use_postnotify_size; /* postnotify_size is meaningful */ + int use_readnotify_size; /* readnotify_size is meaningful */ + + off_t prenotify_size; + off_t postnotify_size; + off_t readnotify_size; + + + /* These are set by both the IO server and the user: */ + + /* If the read and write objects returned by io_map are the same, + then use the xx_file_pointer for read, write, and seek. If the + read and write objects are not the same, then use the + rd_file_pointer for read and the wr_file_pointer for write. + Normally in this case the seekable value will be false. + The unused file pointers will be set to -1 by the I/O server. */ + off_t rd_file_pointer; + off_t wr_file_pointer; + off_t xx_file_pointer; + + off_t file_size; + + /* These two indicate that the appropriate times need updated */ + int written; + int accessed; + + + /* File structuring: */ + + /* If the file is not seekable and read data is separate from write + data, then the read data might be structured. Each record is + identified by one of these structures. The "auxil" field + contains extra data which might be of interest to some readers, + but is not part of the data proper (for example, UDP and raw IP + put the internet headers there). + + The IO server guarantees that these will be consecutive, and that + the file_pointer_start of each record will be that of the last + plus its data_length. The last valid structure might grow + whenever the server is it. All previous records from the + rd_file_pointer to the current read_size/file_size will not + change. Records before that can be dropped and the valid records + moved forward in the array (when the server is it); if this + happens indexes_changed will be set to the number of records + dropped. */ + + int indexes_changed; /* users can clear this when they want */ + + /* Users should not modify the rest of this: */ + int use_structure; /* structure is being used */ + struct iomap_structure + { + int file_pointer_start; /* file pointer offset of data */ + int object_start; /* offset of auxil in memory object */ + int auxil_length; /* length of auxil data */ + int data_length; /* length of real data */ + } structure[0]; +}; + +/* Look at this value to determine the byte order the server is using, + and then use it. */ +#define SHARED_PAGE_MAGIC 0xaabbccdd + diff --git a/hurd/socket.defs b/hurd/socket.defs new file mode 100644 index 00000000..f71930ea --- /dev/null +++ b/hurd/socket.defs @@ -0,0 +1,136 @@ +/* Definitions for socket interface + Copyright (C) 1991, 1993, 1994, 1995 Free Software Foundation + +This file is part of the GNU Hurd. + +The GNU Hurd is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +The GNU Hurd is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with the GNU Hurd; see the file COPYING. If not, write to +the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ + + +/* Sockets also support the generic IO facilities. */ + +subsystem socket 26000; + +#include <hurd/hurd_types.defs> + +#ifdef SOCKET_IMPORTS +SOCKET_IMPORTS +#endif + +INTR_INTERFACE + +/* Create a new socket. Sock type is, for example, SOCK_STREAM, + SOCK_DGRAM, or some such. */ +routine socket_create ( + server: pf_t; + sock_type: int; + protocol: int; + out sock: mach_port_send_t); + +/* Prepare a socket of appropriate type for future accept operations. */ +routine socket_listen ( + sock: socket_t; + queue_limit: int); + +/* Return a new connection from a socket previously listened. */ +routine socket_accept ( + sock: socket_t; + out conn_sock: mach_port_send_t; + out peer_addr: mach_port_send_t); + +/* Connect to an address. */ +routine socket_connect ( + sock: socket_t; + addr: addr_port_t); + +/* Bind a socket to an address. */ +routine socket_bind ( + sock: socket_t; + addr: addr_port_t); + +/* Find out the name of a socket. */ +routine socket_name ( + sock: socket_t; + out addr: mach_port_send_t); + +/* Find out the name of the socket's peer. */ +routine socket_peername ( + sock: socket_t; + out addr: mach_port_send_t); + +/* Connect two sockets */ +routine socket_connect2 ( + sock1: socket_t; + sock2: socket_t); + +/* Create an address from a sockaddr. */ +routine socket_create_address ( + server: mach_port_t; /* Can be either pf_t or socket_t. */ + sockaddr_type: int; + sockaddr: data_t SCP; + out addr: mach_port_send_t); + +/* Create an address without any sockaddr. */ +routine socket_fabricate_address ( + server: mach_port_t; /* Can be either pf_t or socket_t. */ + sockaddr_type: int; + out addr: mach_port_send_t); + +/* Find the sockaddr name of an address. */ +routine socket_whatis_address( + addr: addr_port_t; + out sockaddr_type: int; + out sockaddr: data_t, dealloc); + +/* Shutdown a socket for reading or writing. */ +routine socket_shutdown ( + sock: socket_t; + direction: int); + +/* XXX to become ioctl hack */ +/* Get a socket option. */ +routine socket_getopt ( + sock: socket_t; + level: int; + option: int; + out optval: data_t, dealloc); + +/* XXX to become ioctl hack */ +/* Set a socket option. */ +routine socket_setopt ( + sock: socket_t; + level: int; + option: int; + optval: data_t SCP); + +/* Send data over a socket, possibly including Mach ports. */ +routine socket_send ( + sock: socket_t; + addr: addr_port_t; + flags: int; + data: data_t SCP; + ports: portarray_t SCP; + control: data_t SCP; + out amount: mach_msg_type_number_t); + +/* Receive data from a socket, possibly including Mach ports. */ +routine socket_recv ( + sock: socket_t; + out addr: mach_port_send_t; + flags: int; + out data: data_t, dealloc; + out ports: portarray_t, dealloc; + out control: data_t, dealloc; + out outflags: int; + amount: mach_msg_type_number_t); diff --git a/hurd/startup.defs b/hurd/startup.defs new file mode 100644 index 00000000..bd5cd6e1 --- /dev/null +++ b/hurd/startup.defs @@ -0,0 +1,81 @@ +/* Definitions for startup server interface + Copyright (C) 1991, 1992, 1993, 1994, 1996, 1999 Free Software Foundation + +This file is part of the GNU Hurd. + +The GNU Hurd is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +The GNU Hurd is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with the GNU Hurd; see the file COPYING. If not, write to +the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ + +/* Written by Michael I. Bushnell. */ + +subsystem startup 29000; + +#include <hurd/hurd_types.defs> + +#ifdef STARTUP_IMPORTS +STARTUP_IMPORTS +#endif + + +/* This call registers a task as "essential", which means that if it + dies, the system should crash. If the specified task dies or an + exception message is sent to the exception port, then we will print + a message on the console and do the crash. */ +routine startup_essential_task ( + server: startup_t; + sreplyport reply_port: sreply_port_t; + task: task_t; + excpt: mach_port_move_receive_t; + name: string_t; + credential: host_priv_t); + +/* This call registers a task as "notified", which means that if the + system is going down, we should be told about it and get a chance to + run. A startup_dosync message (see startup_notify.defs) will be + sent to the notify port. NAME will be used to provide a helpful + message to the user when the system is shutting down. */ +routine startup_request_notification ( + server: startup_t; + notify_port: mach_port_send_t; + name: string_t); + +/* This call causes the system to die. */ +routine startup_reboot ( + server: startup_t; + refport: mach_port_t; + reboot_code: int); + +/* NOTE: All changes to these last two must be reflected in + startup_reply.defs. */ + +/* This call is made by the proc server for its initialization, on its + bootstrap port. */ +routine startup_procinit ( + server: startup_t; + sreplyport reply_port: sreply_port_t; + startup_proc: process_t; + out startup_task: task_t; + out auth: auth_t; + out host_priv: mach_port_send_t; + out device_master: mach_port_send_t); + +/* This call is made by the auth server for its initialization. + The auth server will create an all-root authentication handle + to give to the startup server. */ +routine startup_authinit ( + server: startup_t; + sreplyport reply_port: sreply_port_t; + auth: mach_port_send_t; + out proc: mach_port_send_t); + diff --git a/hurd/startup_notify.defs b/hurd/startup_notify.defs new file mode 100644 index 00000000..2388f882 --- /dev/null +++ b/hurd/startup_notify.defs @@ -0,0 +1,37 @@ +/* Callbacks issued by startup server + Copyright (C) 1996 Free Software Foundation + +This file is part of the GNU Hurd. + +The GNU Hurd is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +The GNU Hurd is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with the GNU Hurd; see the file COPYING. If not, write to +the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ + +/* Written by Michael I. Bushnell. */ + +subsystem startup_notify 29500; + +#include <hurd/hurd_types.defs> + +#ifdef STARTUP_NOTIFY_IMPORTS +STARTUP_NOTIFY_IMPORTS +#endif + +/* The system is going down; the recipient of this call is receiving + the notification previously requested by + startup_request_notification. */ +routine startup_dosync ( + notify_port: mach_port_t; + waittime timeout: natural_t); + + diff --git a/hurd/startup_reply.defs b/hurd/startup_reply.defs new file mode 100644 index 00000000..1776dc3d --- /dev/null +++ b/hurd/startup_reply.defs @@ -0,0 +1,52 @@ +/* Server-reply definitions for startup server interface + NOTE: All changes here must be reflected in startup.defs. + Copyright (C) 1991, 1992, 1993, 1994 Free Software Foundation + +This file is part of the GNU Hurd. + +The GNU Hurd is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +The GNU Hurd is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with the GNU Hurd; see the file COPYING. If not, write to +the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ + +/* Written by Michael I. Bushnell and Roland McGrath. */ + +subsystem startup_reply 29100; /* Must 100 more than startup subsystem. */ + +#include <hurd/hurd_types.defs> + +type reply_port_t = polymorphic | MACH_MSG_TYPE_PORT_SEND_ONCE + ctype: mach_port_t; + +#ifdef STARTUP_IMPORTS +STARTUP_IMPORTS +#endif + +simpleroutine startup_essential_task_reply ( + reply_port: reply_port_t; + retcode: kern_return_t); + +skip; /* startup_request_notification */ +skip; /* startup_reboot */ + +simpleroutine startup_procinit_reply ( + reply_port: reply_port_t; + retcode: kern_return_t; + startup_task: task_t; + auth: auth_t; + host_priv: mach_port_send_t; + device_master: mach_port_send_t); + +simpleroutine startup_authinit_reply ( + reply_port: reply_port_t; + retcode: kern_return_t; + proc: mach_port_send_t); diff --git a/hurd/subsystems b/hurd/subsystems new file mode 100644 index 00000000..c05895c2 --- /dev/null +++ b/hurd/subsystems @@ -0,0 +1,45 @@ +These are the base MiG code numbers for each subsystem in the GNU +Hurd. Each subsystem takes 200 in space. Subsystems marked with a * +are Mach kernel subsystems. Subsystems marked with ? may or may not +be used in the Hurd and are defined by Mach non-kernel source. + + +* notify 64 IPC notifications +* mach 2000 Generic kernel calls +* memory_object 2200 Kernel -> pager calls +* memory_object_default 2250 Extension to memory_object for default pager +? default_pager 2275 Default pager control +* exc 2400 Exceptions +* mach_host 2600 Kernel calls, mostly for multiprocessors +* device 2800 Physical device interface +* mach_debug 3000 Kernel debugging and statistics +* mach_port 3200 Port name and IPC frobbing +* mach4 4000 PC sampling +fs 20000 Filesystem nodes +fs_notify 20500 Notification callbacks from fs servers to their clients +io 21000 Generic IO +fsys 22000 Filesystem control operations +msg 23000 Calls made on process message ports +process 24000 Process abstraction +auth 25000 Authentication +socket 26000 Sockets +newterm 27000 Creation of terminal processing thingies +term 28000 Terminal-specific operations +startup 29000 System initialization and destruction +startup_notify 29500 Callbacks from startup server +exec 30000 Process execution +exec_startup 30500 Process startup communication +crash 32000 Program crash handling (core dumps) +intr 33000 Interruption +ifsock 34000 S_IFSOCK node protocol for AF_LOCAL rendezvous +tape 35000 Special control operations for magtapes +login 36000 Database of logged-in users +pfinet 37000 Internet configuration calls +password 38000 Password checker +<ioctl space> 100000- First subsystem of ioctl class 'f' (lowest class) +tioctl 156000 Ioctl class 't' (terminals) +tioctl 156200 (continued) +<ioctl space> 164200 Last subsystem of ioctl class 'v' (highest class) +* mach_norma 555000 NORMA machine additions; sort of deprecated right now +* norma_task 666000 NORMA remote execution +? dp_helper 888888 pager -> fileserver; asking for more paging space diff --git a/hurd/term.defs b/hurd/term.defs new file mode 100644 index 00000000..dbc03b76 --- /dev/null +++ b/hurd/term.defs @@ -0,0 +1,123 @@ +/* Special protocol for terminal driver + Copyright (C) 1991, 1993, 1994, 1999 Free Software Foundation, Inc. + +This file is part of the GNU Hurd. + +The GNU Hurd is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +The GNU Hurd is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with the GNU Hurd; see the file COPYING. If not, write to +the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ + +/* Written by Michael I. Bushnell. */ + +subsystem term 28000; + +#include <hurd/hurd_types.defs> + +#ifdef TERM_IMPORTS +TERM_IMPORTS +#endif + +INTR_INTERFACE + +/* Find out what the controlling terminal ID port is. */ +routine term_getctty ( + terminal: io_t; + out ctty: mach_port_send_t); + +/* +Return a controlling terminal port for this terminal. This has the +following effects: + +Certain input characters in certain modes will cause signals to be +sent to foreground processes which have made this call. The ctty ID +will be used as the reference port. Certain conditions will cause +SIGHUP to be sent. The foreground process group is the same as the +owner defined by io_set_owner and io_get_owner. + +When background processes do certain operations on a port returned by +term_become_ctty, the EBACKGROUND error may be returned. This occurs +for io_read always, io_write if the appropriate bit is set in the +status, and various control operations always. The vanilla port to +the terminal can still be used to do these operations. + +A "foreground process" is one making a request over a port returned by +term_become_ctty whose pid (as provided in the term_become_ctty call) +matches the current owner (as set by io_mod_owner) or whose pgrp +matches the owner in the same fashion. A "background process" is one +making a request over a port returned by term_become_ctty which is not +a foreground process. */ +routine term_open_ctty ( + terminal: io_t; + pid: pid_t; + pgrp: pid_t; + out newtty: mach_port_send_t); + +/* This sets the name returned by future get_nodename calls. This is + conventionally the name of a file which can be opened, resulting in + a clone of this port. */ +routine term_set_nodename ( + terminal: io_t; + name: string_t); + +/* Return the last value set with set_nodename. */ +routine term_get_nodename ( + terminal: io_t; + out name: string_t); + +/* Set the underlying file to be used for chown/chmod, etc. */ +routine term_set_filenode ( + terminal: io_t; + filenode: file_t); + +/* Find out what the bottom half of this terminal is using. */ +routine term_get_bottom_type ( + terminal: io_t; + out ttype: int); + +/* Start running with the bottom half as a device port using the Mach + kernel device interface. The old bottom half (if any) is + discarded. */ +routine term_on_machdev ( + terminal: io_t; + machdev: device_t); + +/* Start running with the bottom half as a hurd I/O port. (It is + assumed that io_t is being served by a Hurd I/O server). */ +routine term_on_hurddev ( + terminal: io_t; + hurddev: io_t); + +/* Start running with the bottom half being an exported hurd I/O port. + This differs from term_on_hurddev in that with term_on_pty the + terminal driver will serve the port. The returned port is a pty, + similar in operation to the entity of the same name in BSD. */ +routine term_on_pty ( + terminal: io_t; + out ptymaster: io_t); + +/* This call is made to the ctty port returned by term_getctty; it may + not be made to terminal I/O ports. Return an unauthenticated I/O + port for the terminal opened as with flags FLAGS. */ +routine termctty_open_terminal ( + ctty: mach_port_t; + flags: int; + out terminal: mach_port_send_t); + +/* This call is only supported for PTY-based terminals. For a slave, + it returns a filename which, when opened, would yield the master for + this terminal. For a master, it returns a filename which, when + opened, would yield the slave for this terminal. */ +routine term_get_peername ( + terminal: io_t; + out name: string_t); + diff --git a/hurd/tioctl.defs b/hurd/tioctl.defs new file mode 100644 index 00000000..4eb634b9 --- /dev/null +++ b/hurd/tioctl.defs @@ -0,0 +1,254 @@ +/* Definitions for terminal ioctls + Copyright (C) 1991, 1993, 1994, 1995, 1996, 1999 Free Software Foundation, Inc. + +This file is part of the GNU Hurd. + +The GNU Hurd is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +The GNU Hurd is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with the GNU Hurd; see the file COPYING. If not, write to +the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ + + +#include <hurd/hurd_types.defs> + +INTR_INTERFACE + +/* Ioctl class `t'; the subsystem is derived from calculations in + <ioctls.h>. */ +subsystem tioctl 156000; /* XXX */ + +import <hurd/ioctl_types.h>; /* XXX */ + +/* These are the pieces of a struct termios as specified by the + definition of _IOT_termios in <termbits.h>. */ +type modes_t = array[4] of int; +type ccs_t = array[20] of char; +type speeds_t = array[2] of int; + +/* This is the arg for a struct winsize as specified by the + definition of _IOT_winsize in <sys/ioctl.h>. */ +type winsize_t = struct[4] of short; + +skip; skip; skip; /* 0 1 2 unused */ + +/* 3 TIOCMODG */ +routine tioctl_tiocmodg ( + reqport: io_t; + out state: int); + +/* 4 TIOCMODS */ +routine tioctl_tiocmods ( + reqport: io_t; + state: int); + +skip; skip; skip; skip; /* 5 6 7 8 unused */ +skip; skip; skip; skip; /* 9 10 11 12 unused */ + +/* 13 TIOCEXCL */ +routine tioctl_tiocexcl ( + reqport: io_t); + +/* 14 TIOCNXCL */ +routine tioctl_tiocnxcl ( + reqport: io_t); + +skip; /* 15 unused */ + +/* 16 TIOCFLUSH */ +routine tioctl_tiocflush ( + reqport: io_t; + queue_selector: int); + +skip; skip; /* 17 18 unused */ + +/* 19 TIOCGETA */ +routine tioctl_tiocgeta ( + port: io_t; + out modes: modes_t; + out ccs: ccs_t; + out speeds: speeds_t); + +/* 20 TIOCSETA */ +routine tioctl_tiocseta ( + port: io_t; + modes: modes_t; + ccs: ccs_t; + speeds: speeds_t); + +/* 21 TIOCSETAW */ +/* INTR */ +routine tioctl_tiocsetaw ( + port: io_t; + modes: modes_t; + ccs: ccs_t; + speeds: speeds_t); + +/* 22 TIOCSETAF */ +/* INTR */ +routine tioctl_tiocsetaf ( + port: io_t; + modes: modes_t; + ccs: ccs_t; + speeds: speeds_t); + +skip; skip; skip; /* 23 24 25 unused */ + +/* 26 TIOCGETD */ +routine tioctl_tiocgetd ( + port: io_t; + out discipline: int); + +/* 27 TIOCSETD */ +routine tioctl_tiocsetd ( + port: io_t; + discipline: int); + +skip; skip; /* 28 29 unused */ +skip; skip; skip; skip; skip; skip; skip; skip; skip; skip; /* 30-39 unused */ +skip; skip; skip; skip; skip; skip; skip; skip; skip; skip; /* 40-49 unused */ +skip; skip; skip; skip; skip; skip; skip; skip; skip; skip; /* 50-59 unused */ +skip; skip; skip; skip; skip; skip; skip; skip; skip; skip; /* 60-69 unused */ +skip; skip; skip; skip; skip; skip; skip; skip; skip; skip; /* 70-79 unused */ +skip; skip; skip; skip; skip; skip; skip; skip; skip; skip; /* 80-89 unused */ +skip; skip; skip; skip; /* 90 91 92 93 unused */ + +/* 94 TIOCDRAIN */ +/* INTR */ +routine tioctl_tiocdrain ( + port: io_t); + +/* 95 TIOCSIG */ +routine tioctl_tiocsig ( + port: io_t; + signal: int); + +/* 96 TIOCEXT */ +routine tioctl_tiocext ( + port: io_t; + mode: int); + +skip; /* 97 TIOCSCTTY -- implemented in C library */ +skip; /* 98 TIOCCONS -- implemented in C library */ + +skip; /* 99 unused */ + +/* Because MiG defines reply ports as 100 more than request ports, we + have to leave one hundred empty RPC's here. */ +skip; skip; skip; skip; skip; skip; skip; skip; skip; skip; +skip; skip; skip; skip; skip; skip; skip; skip; skip; skip; +skip; skip; skip; skip; skip; skip; skip; skip; skip; skip; +skip; skip; skip; skip; skip; skip; skip; skip; skip; skip; +skip; skip; skip; skip; skip; skip; skip; skip; skip; skip; + +skip; skip; skip; skip; skip; skip; skip; skip; skip; skip; +skip; skip; skip; skip; skip; skip; skip; skip; skip; skip; +skip; skip; skip; skip; skip; skip; skip; skip; skip; skip; +skip; skip; skip; skip; skip; skip; skip; skip; skip; skip; +skip; skip; skip; skip; skip; skip; skip; skip; skip; skip; + + +skip; skip; /* 100 101 unused */ + +/* 102 TIOCUCNTL */ +routine tioctl_tiocucntl ( + port: io_t; + set_or_clear: int); + +/* 103 TIOCSWINSZ */ +routine tioctl_tiocswinsz ( + port: io_t; + sizes: winsize_t); + +/* 104 TIOCGWINSZ */ +routine tioctl_tiocgwinsz ( + port: io_t; + out sizes: winsize_t); + +/* 105 TIOCREMOTE */ +routine tioctl_tiocremote ( + port: io_t; + on_or_off: int); + +/* 106 TIOCMGET */ +routine tioctl_tiocmget ( + port: io_t; + out bits: int); + +/* 107 TIOCMBIC */ +routine tioctl_tiocmbic ( + port: io_t; + bits: int); + +/* 108 TIOCMBIS */ +routine tioctl_tiocmbis ( + port: io_t; + bits: int); + +/* 109 TIOCMSET */ +routine tioctl_tiocmset ( + port: io_t; + bits: int); + +/* 110 TIOCSTART */ +routine tioctl_tiocstart ( + port: io_t); + +/* 111 TIOCSTOP */ +routine tioctl_tiocstop ( + port: io_t); + +/* 112 TIOCPKT */ +routine tioctl_tiocpkt ( + port: io_t; + on_or_off: int); + +skip; /* 113 TIOCNOTTY -- implemented in C library */ + +/* 114 TIOCSTI */ +routine tioctl_tiocsti ( + port: io_t; + datum: char); + +/* 115 TIOCOUTQ */ +routine tioctl_tiocoutq ( + port: io_t; + out queue_size: int); + +skip; skip; /* 116 117 unused */ + +/* 118 TIOCSPGRP */ +routine tioctl_tiocspgrp ( + port: io_t; + pgrp: int); + +/* 119 TIOCGPGRP */ +routine tioctl_tiocgpgrp ( + port: io_t; + out pgrp: int); + +/* 120 TIOCCDTR */ +routine tioctl_tioccdtr ( + port: io_t); + +/* 121 TIOCSDTR */ +routine tioctl_tiocsdtr ( + port: io_t); + +/* 122 TIOCCBRK */ +routine tioctl_tioccbrk ( + port: io_t); + +/* 123 TIOCSBRK */ +routine tioctl_tiocsbrk ( + port: io_t); + +/* 124 - 256 unused */ |