]>
Commit | Line | Data |
---|---|---|
e1f001e5 | 1 | /* $Header$ */ |
2 | ||
3 | #include <sys/types.h> | |
4 | #include <lock.h> | |
5 | #define UBIK_INTERNALS | |
6 | #include <ubik.h> | |
7 | #include <rx/xdr.h> | |
8 | #include "print.h" | |
9 | #include "prserver.h" | |
10 | ||
11 | ||
12 | struct ubik_dbase *dbase; | |
13 | ||
14 | long ubik_BeginTrans() | |
15 | { | |
16 | return(0); | |
17 | } | |
18 | ||
19 | long ubik_SetLock() | |
20 | { | |
21 | return(0); | |
22 | } | |
23 | ||
24 | long ubik_AbortTrans() | |
25 | { | |
26 | return(0); | |
27 | } | |
28 | ||
29 | long ubik_GetVersion(dummy, ver) | |
30 | int dummy; | |
31 | struct ubik_version *ver; | |
32 | { | |
33 | bzero(ver, sizeof(struct ubik_version)); | |
34 | return(0); | |
35 | } | |
36 | ||
37 | long ubik_EndTrans() | |
38 | { | |
39 | return(0); | |
40 | } | |
41 | ||
42 | ||
43 | extern int dbase_fd; | |
44 | ||
45 | long ubik_Seek(tt, afd, pos) | |
46 | struct ubik_trans *tt; | |
47 | long afd; | |
48 | long pos; | |
49 | { | |
50 | if (lseek(dbase_fd, pos+HDRSIZE, 0) < 0) { | |
51 | perror("ubik_Seek"); | |
52 | return(-1); | |
53 | } | |
54 | return(0); | |
55 | } | |
56 | ||
57 | long ubik_Write(tt, buf, len) | |
58 | struct ubik_trans *tt; | |
59 | char *buf; | |
60 | long len; | |
61 | { | |
62 | int status; | |
63 | ||
64 | status = write(dbase_fd, buf, len); | |
65 | if (status < len) { | |
66 | perror("ubik_Write"); | |
67 | return(1); | |
68 | } | |
69 | return(0); | |
70 | } | |
71 | ||
72 | long ubik_Read(tt, buf, len) | |
73 | struct ubik_trans *tt; | |
74 | char *buf; | |
75 | long len; | |
76 | { | |
77 | int status; | |
78 | ||
79 | status = read(dbase_fd, buf, len); | |
80 | if (status < 0) { | |
81 | perror("ubik_Read"); | |
82 | return(1); | |
83 | } | |
84 | if (status < len) | |
85 | bzero(&buf[status], len - status); | |
86 | return(0); | |
87 | } | |
88 | ||
89 | ||
90 | char *prdir = "/dev/null"; | |
91 | ||
92 | afsconf_GetNoAuthFlag() | |
93 | { | |
94 | return(1); | |
95 | } | |
96 | ||
97 | ||
98 | struct prheader cheader; |