phunix/minix/fs/isofs/main.c
Cristiano Giuffrida 0e78c0166c Switch to stateful restart.
The following services have been updated to support stateful restarts:
 - Drivers: tty
 - Filesystems: isofs, mfs, pfs, libvtreefs-based file servers
 - System servers: tty, ds, pm, vfs, vm

Change-Id: Ie84baa3ba1774047b3ae519808fe4116928edabb
2015-09-17 13:26:22 +00:00

67 lines
1.3 KiB
C

/*
* This file contains the main function for the server. It waits for a request
* and then send a response.
*/
#include "inc.h"
#include <minix/optset.h>
static struct optset optset_table[] = {
{ "norock", OPT_BOOL, &opt.norock, TRUE },
{ NULL, 0, NULL, 0 }
};
static int sef_cb_init_fresh(int __unused type,
sef_init_info_t * __unused info)
{
/* Initialize the iso9660fs server. */
int i;
/* Defaults */
opt.norock = FALSE;
/* If we have been given an options string, parse options here. */
for (i = 1; i < env_argc - 1; i++)
if (!strcmp(env_argv[i], "-o"))
optset_parse(optset_table, env_argv[++i]);
setenv("TZ","",1); /* Used to calculate the time */
lmfs_buf_pool(NR_BUFS);
return OK;
}
static void sef_cb_signal_handler(int signo)
{
/* Only check for termination signal, ignore anything else. */
if (signo != SIGTERM) return;
fsdriver_terminate();
}
static void sef_local_startup(void)
{
/* Register init callbacks. */
sef_setcb_init_fresh(sef_cb_init_fresh);
/* No live update support for now. */
/* Register signal callbacks. */
sef_setcb_signal_handler(sef_cb_signal_handler);
/* Let SEF perform startup. */
sef_startup();
}
int main(int argc, char *argv[])
{
/* SEF local startup. */
env_setargs(argc, argv);
sef_local_startup();
fsdriver_task(&isofs_table);
return 0;
}