]> andersk Git - moira.git/blame - afssync/ubik.c
from Richard
[moira.git] / afssync / ubik.c
CommitLineData
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
12struct ubik_dbase *dbase;
13
dba0cf81 14int ubik_ServerInit()
15{
16 return(0);
17}
18
19int ubik_BeginTrans()
20{
21 return(0);
22}
23
24int ubik_BeginTransReadAny()
25{
26 return(0);
27}
28
29int ubik_AbortTrans()
30{
31 return(0);
32}
33
34int ubik_EndTrans()
35{
36 return(0);
37}
38
39int ubik_Tell()
40{
41 return(0);
42}
43
44int ubik_Truncate()
e1f001e5 45{
46 return(0);
47}
48
49long ubik_SetLock()
50{
51 return(0);
52}
53
dba0cf81 54int ubik_WaitVersion()
e1f001e5 55{
56 return(0);
57}
58
dba0cf81 59int ubik_CacheUpdate()
e1f001e5 60{
e1f001e5 61 return(0);
62}
63
dba0cf81 64int panic(a, b, c, d)
65char *a, *b, *c, *d;
e1f001e5 66{
dba0cf81 67 printf(a, b, c, d);
68 abort();
69 printf("BACK FROM ABORT\n"); /* shouldn't come back from floating pt exception */
70 exit(1); /* never know, though */
71}
72
73int ubik_GetVersion(dummy, ver)
74int dummy;
75struct ubik_version *ver;
76{
77 bzero(ver, sizeof(struct ubik_version));
e1f001e5 78 return(0);
79}
80
81
82extern int dbase_fd;
83
dba0cf81 84int ubik_Seek(tt, afd, pos)
e1f001e5 85struct ubik_trans *tt;
86long afd;
87long pos;
88{
89 if (lseek(dbase_fd, pos+HDRSIZE, 0) < 0) {
90 perror("ubik_Seek");
91 return(-1);
92 }
93 return(0);
94}
95
dba0cf81 96int ubik_Write(tt, buf, len)
e1f001e5 97struct ubik_trans *tt;
98char *buf;
99long len;
100{
101 int status;
102
103 status = write(dbase_fd, buf, len);
104 if (status < len) {
105 perror("ubik_Write");
106 return(1);
107 }
108 return(0);
109}
110
dba0cf81 111int ubik_Read(tt, buf, len)
e1f001e5 112struct ubik_trans *tt;
113char *buf;
114long len;
115{
116 int status;
117
118 status = read(dbase_fd, buf, len);
119 if (status < 0) {
120 perror("ubik_Read");
121 return(1);
122 }
123 if (status < len)
124 bzero(&buf[status], len - status);
125 return(0);
126}
127
128
dba0cf81 129/* Global declarations from ubik.c */
130long ubik_quorum=0;
131struct ubik_dbase *ubik_dbase=0;
132struct ubik_stats ubik_stats;
133long ubik_host;
134long ubik_epochTime = 0;
135long urecovery_state = 0;
136
137struct rx_securityClass *ubik_sc[3];
138
139
140/* Other declarations */
e1f001e5 141
142afsconf_GetNoAuthFlag()
143{
144 return(1);
145}
146
147
dba0cf81 148char *prdir = "/dev/null";
e1f001e5 149struct prheader cheader;
dba0cf81 150int pr_realmNameLen;
151char *pr_realmName;
This page took 0.076675 seconds and 5 git commands to generate.