Commit | Line | Data |
---|---|---|
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 | ||
17 | extern int afsd_debug; | |
18 | extern int afsd_verbose; | |
19 | extern char *afsd_cacheMountDir; | |
20 | ||
21 | void afsd_init(void); | |
22 | int afsd_parse(int argc, char **argv); | |
23 | int afsd_run(void); | |
24 | ||
25 | /* a function that is called from afsd_fork in a new process/thread */ | |
26 | typedef void* (*afsd_callback_func) (void *rock); | |
27 | ||
28 | /* syscall nonsense. Here goes! */ | |
29 | #ifdef AFS_DARWIN100_ENV | |
30 | typedef user_addr_t afsd_syscall_param_t; | |
31 | #elif AFS_DARWIN80_ENV | |
32 | typedef unsigned int afsd_syscall_param_t; | |
33 | #else | |
34 | typedef 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 | |
42 | struct 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! */ | |
50 | void afsd_mount_afs(const char *rn, const char *mountdir); | |
51 | int afsd_check_mount(const char *rn, const char *mountdir); | |
52 | void afsd_set_rx_rtpri(void); | |
53 | void afsd_set_afsd_rtpri(void); | |
54 | int afsd_call_syscall(struct afsd_syscall_args *args); | |
55 | int afsd_fork(int wait, afsd_callback_func cbf, void *rock); | |
56 | int afsd_daemon(int nochdir, int noclose); | |
57 | ||
58 | #endif /* AFSD_AFSD_H */ |