extern sh_time_t now; /* Current time */
extern uns main_shutdown;
+extern clist main_timer_list, main_file_list, main_hook_list, main_process_list;
/* User-defined fields are marked with [*], all other fields must be initialized to zero. */
void file_add(struct main_file *fi);
void file_chg(struct main_file *fi);
void file_del(struct main_file *fi);
-void file_read(struct main_file *fi, byte *buf, uns len);
-void file_write(struct main_file *fi, byte *buf, uns len);
+void file_read(struct main_file *fi, void *buf, uns len);
+void file_write(struct main_file *fi, void *buf, uns len);
void file_set_timeout(struct main_file *fi, sh_time_t expires);
/* Hooks to be called in each iteration of the main loop */
struct main_process {
cnode n;
- int pid;
- int status; /* Exit status */
+ int pid; /* Process id (0=not running) */
+ int status; /* Exit status (-1=fork failed) */
+ byte status_msg[EXIT_STATUS_MSG_SIZE];
void (*handler)(struct main_process *mp); /* [*] Called when the process exits; process_del done automatically */
void *data; /* [*] For use by the handler */
};