xref: /minix/minix/servers/rs/proto.h (revision 83133719)
1 /* Function prototypes. */
2 
3 /* Structs used in prototypes must be declared as such first. */
4 struct rproc;
5 
6 /* exec.c */
7 int srv_execve(int proc_e, char *exec, size_t exec_len, char *argv[],
8 	char **env);
9 
10 /* main.c */
11 int main(void);
12 
13 /* request.c */
14 int do_up(message *m);
15 int do_down(message *m);
16 int do_refresh(message *m);
17 int do_restart(message *m);
18 int do_clone(message *m);
19 int do_edit(message *m);
20 int do_shutdown(message *m);
21 void do_period(message *m);
22 int do_init_ready(message *m);
23 int do_update(message *m);
24 int do_upd_ready(message *m);
25 void do_sigchld(void);
26 int do_getsysinfo(message *m);
27 int do_lookup(message *m);
28 
29 /* manager.c */
30 int check_call_permission(endpoint_t caller, int call, struct rproc
31 	*rp);
32 int copy_rs_start(endpoint_t src_e, char *src_rs_start, struct rs_start
33 	*rs_start);
34 int copy_label(endpoint_t src_e, char *src_label, size_t src_len, char
35 	*dst_label, size_t dst_len);
36 void build_cmd_dep(struct rproc *rp);
37 int srv_update(endpoint_t src_e, endpoint_t dst_e);
38 #define kill_service(rp, errstr, err) \
39 	kill_service_debug(__FILE__, __LINE__, rp, errstr, err)
40 int kill_service_debug(char *file, int line, struct rproc *rp, char
41 	*errstr, int err);
42 #define crash_service(rp) \
43 	crash_service_debug(__FILE__, __LINE__, rp)
44 int crash_service_debug(char *file, int line, struct rproc *rp);
45 #define cleanup_service(rp) \
46 	cleanup_service_debug(__FILE__, __LINE__, rp)
47 void cleanup_service_debug(char *file, int line, struct rproc *rp);
48 int create_service(struct rproc *rp);
49 int clone_service(struct rproc *rp, int instance_flag);
50 int publish_service(struct rproc *rp);
51 int unpublish_service(struct rproc *rp);
52 int run_service(struct rproc *rp, int init_type);
53 int start_service(struct rproc *rp);
54 void stop_service(struct rproc *rp,int how);
55 int update_service(struct rproc **src_rpp, struct rproc **dst_rpp, int
56 	swap_flag);
57 void activate_service(struct rproc *rp, struct rproc *ex_rp);
58 void terminate_service(struct rproc *rp);
59 void restart_service(struct rproc *rp);
60 void inherit_service_defaults(struct rproc *def_rp, struct rproc *rp);
61 void get_service_instances(struct rproc *rp, struct rproc ***rps, int
62 	*length);
63 int read_exec(struct rproc *rp);
64 void share_exec(struct rproc *rp_src, struct rproc *rp_dst);
65 void free_exec(struct rproc *rp);
66 int init_slot(struct rproc *rp, struct rs_start *rs_start, endpoint_t
67 	source);
68 int edit_slot(struct rproc *rp, struct rs_start *rs_start, endpoint_t
69 	source);
70 int clone_slot(struct rproc *rp, struct rproc **clone_rpp);
71 void swap_slot(struct rproc **src_rpp, struct rproc **dst_rpp);
72 struct rproc* lookup_slot_by_label(char *label);
73 struct rproc* lookup_slot_by_pid(pid_t pid);
74 struct rproc* lookup_slot_by_dev_nr(dev_t dev_nr);
75 struct rproc* lookup_slot_by_flags(int flags);
76 int alloc_slot(struct rproc **rpp);
77 void free_slot(struct rproc *rp);
78 char *get_next_label(char *ptr, char *label, char *caller_label);
79 void add_forward_ipc(struct rproc *rp, struct priv *privp);
80 void add_backward_ipc(struct rproc *rp, struct priv *privp);
81 void init_privs(struct rproc *rp, struct priv *privp);
82 void update_period(message *m_ptr);
83 void end_update(int result, int reply_flag);
84 
85 /* utility.c */
86 int init_service(struct rproc *rp, int type);
87 void fill_send_mask(sys_map_t *send_mask, int set_bits);
88 void fill_call_mask( int *calls, int tot_nr_calls, bitchunk_t
89 	*call_mask, int call_base, int is_init);
90 char* srv_to_string(struct rproc *rp);
91 void reply(endpoint_t who, struct rproc *rp, message *m_ptr);
92 void late_reply(struct rproc *rp, int code);
93 int rs_isokendpt(endpoint_t endpoint, int *proc);
94 int sched_init_proc(struct rproc *rp);
95 int update_sig_mgrs(struct rproc *rp, endpoint_t sig_mgr, endpoint_t
96 	bak_sig_mgr);
97 
98 /* error.c */
99 char * init_strerror(int errnum);
100 char * lu_strerror(int errnum);
101 
102