Import Upstream version 1.8.5
[hcoop/debian/openafs.git] / src / afsd / afsd.h
CommitLineData
805e021f
CE
1/*
2 * Copyright 2000, International Business Machines Corporation and others.
3 * All Rights Reserved.
4 *
5 * This software has been released under the terms of the IBM Public
6 * License. For details, see the LICENSE file in the top-level source
7 * directory or online at http://www.openafs.org/dl/license10.html
8 */
9
10#ifndef AFSD_AFSD_H
11#define AFSD_AFSD_H
12
13#ifdef IGNORE_SOME_GCC_WARNINGS
14# pragma GCC diagnostic warning "-Wstrict-prototypes"
15#endif
16
17extern int afsd_debug;
18extern int afsd_verbose;
19extern char *afsd_cacheMountDir;
20
21void afsd_init(void);
22int afsd_parse(int argc, char **argv);
23int afsd_run(void);
24
25/* a function that is called from afsd_fork in a new process/thread */
26typedef void* (*afsd_callback_func) (void *rock);
27
28/* syscall nonsense. Here goes! */
29#ifdef AFS_DARWIN100_ENV
30typedef user_addr_t afsd_syscall_param_t;
31#elif AFS_DARWIN80_ENV
32typedef unsigned int afsd_syscall_param_t;
33#else
34typedef long afsd_syscall_param_t;
35#endif
36
37#ifdef AFS_DARWIN100_ENV
38#define CAST_SYSCALL_PARAM(X) CAST_USER_ADDR_T(X)
39#else
40#define CAST_SYSCALL_PARAM(X) ((afsd_syscall_param_t) X)
41#endif
42struct afsd_syscall_args {
43 int syscall;
44 afsd_syscall_param_t params[7];
45 const char *rn;
46 int rxpri;
47};
48
49/* afsd.c expects these to be implemented; it does not implement them itself! */
50void afsd_mount_afs(const char *rn, const char *mountdir);
51int afsd_check_mount(const char *rn, const char *mountdir);
52void afsd_set_rx_rtpri(void);
53void afsd_set_afsd_rtpri(void);
54int afsd_call_syscall(struct afsd_syscall_args *args);
55int afsd_fork(int wait, afsd_callback_func cbf, void *rock);
56int afsd_daemon(int nochdir, int noclose);
57
58#endif /* AFSD_AFSD_H */