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 | /* | |
11 | * This file defines the interface to the libkopenafs library, which provides | |
12 | * a reduced set of functions for compatibility with the Heimdal/KTH libkafs | |
13 | * library. This interface and the corresponding library are the best way to | |
14 | * get a completely standalone setpag() function from OpenAFS (in the form of | |
15 | * the k_setpag() interface defined here). | |
16 | * | |
17 | * The calls here only work on systems with native AFS clients and *will not* | |
18 | * work through the NFS translator. | |
19 | */ | |
20 | ||
21 | #ifndef KOPENAFS_H | |
22 | #define KOPENAFS_H 1 | |
23 | ||
24 | /* Get the VIOC* constants and struct ViceIoctl. */ | |
25 | #include <afs/vioc.h> | |
26 | ||
27 | /* | |
28 | * Initialization function. Returns true if AFS is available on the system | |
29 | * and false otherwise. Should be called before any of the other functions, | |
30 | * and if it returns false, the other functions should not be called. | |
31 | */ | |
32 | int k_hasafs(void); | |
33 | ||
34 | /* | |
35 | * Create a new PAG and put the current process in it. Returns 0 on success, | |
36 | * non-zero on system call failure. Equivalent to lsetpag(). | |
37 | */ | |
38 | int k_setpag(void); | |
39 | ||
40 | /* | |
41 | * Returns true if the current process is in a PAG and false if it is not or | |
42 | * if an error was encountered in determining whether it is in a PAG. | |
43 | */ | |
44 | int k_haspag(void); | |
45 | ||
46 | /* | |
47 | * Remove the tokens in the current PAG. Returns 0 on success, non-zero on | |
48 | * system call failure. | |
49 | */ | |
50 | int k_unlog(void); | |
51 | ||
52 | /* | |
53 | * Perform an arbitrary pioctl system call with the specified arguments. | |
54 | * Returns 0 on success, non-zero on system call failure. Equivalent to | |
55 | * lpioctl(). | |
56 | */ | |
57 | int k_pioctl(char *path, int cmd, struct ViceIoctl *cmarg, int follow); | |
58 | ||
59 | #endif /* KOPENAFS_H */ |