Remove building with NOCRYPTO option
[minix3.git] / minix / lib / libsffs / main.c
blobdccbf54e7d12e371860eb8ca150ead33dcefdeb4
1 /* This file contains the SFFS initialization code and message loop.
3 * The entry points into this file are:
4 * sffs_init initialization
5 * sffs_signal signal handler
6 * sffs_loop main message loop
8 * Created:
9 * April 2009 (D.C. van Moolenbroek)
12 #include "inc.h"
14 /*===========================================================================*
15 * sffs_init *
16 *===========================================================================*/
17 int sffs_init(char *name, const struct sffs_table *table,
18 struct sffs_params *params)
20 /* Initialize this file server. Called at startup time.
22 int i;
24 /* Make sure that the given path prefix doesn't end with a slash. */
25 i = strlen(params->p_prefix);
26 while (i > 0 && params->p_prefix[i - 1] == '/') i--;
27 params->p_prefix[i] = 0;
29 sffs_name = name;
30 sffs_table = table;
31 sffs_params = params;
33 return OK;
36 /*===========================================================================*
37 * sffs_signal *
38 *===========================================================================*/
39 void sffs_signal(int signo)
42 /* Only check for termination signal, ignore anything else. */
43 if (signo != SIGTERM) return;
45 dprintf(("%s: got SIGTERM\n", sffs_name));
47 fsdriver_terminate();
50 /*===========================================================================*
51 * sffs_loop *
52 *===========================================================================*/
53 void sffs_loop(void)
55 /* The main function of this file server. Libfsdriver does the real work.
58 fsdriver_task(&sffs_dtable);