]> andersk Git - moira.git/blame - afssync/ubik.c
Groups with GID between 32768 and 66535 aren't special anymore.
[moira.git] / afssync / ubik.c
CommitLineData
1c2c987d 1/* $Id$ */
e1f001e5 2
3#include <sys/types.h>
1c2c987d 4#include <netinet/in.h>
5
e1f001e5 6#include <lock.h>
7#define UBIK_INTERNALS
c7e4633e 8#include <stds.h>
e1f001e5 9#include <ubik.h>
10#include <rx/xdr.h>
11#include "print.h"
12#include "prserver.h"
13
1c2c987d 14extern int dbase_fd;
e1f001e5 15struct ubik_dbase *dbase;
16
dba0cf81 17int ubik_ServerInit()
18{
19 return(0);
20}
21
22int ubik_BeginTrans()
23{
1c2c987d 24 static int init=0;
25 struct ubik_hdr thdr;
26
27 if (!init) {
28 thdr.version.epoch = htonl(0);
29 thdr.version.counter = htonl(0);
30 thdr.magic = htonl(UBIK_MAGIC);
31 thdr.size = htonl(HDRSIZE);
32 lseek(dbase_fd, 0, 0);
33 write(dbase_fd, &thdr, sizeof(thdr));
34 fsync(dbase_fd);
35 init = 1;
36 }
dba0cf81 37 return(0);
38}
39
40int ubik_BeginTransReadAny()
41{
42 return(0);
43}
44
45int ubik_AbortTrans()
46{
47 return(0);
48}
49
50int ubik_EndTrans()
51{
52 return(0);
53}
54
55int ubik_Tell()
56{
57 return(0);
58}
59
60int ubik_Truncate()
e1f001e5 61{
62 return(0);
63}
64
65long ubik_SetLock()
66{
67 return(0);
68}
69
dba0cf81 70int ubik_WaitVersion()
e1f001e5 71{
72 return(0);
73}
74
dba0cf81 75int ubik_CacheUpdate()
e1f001e5 76{
e1f001e5 77 return(0);
78}
79
dba0cf81 80int panic(a, b, c, d)
81char *a, *b, *c, *d;
e1f001e5 82{
dba0cf81 83 printf(a, b, c, d);
84 abort();
85 printf("BACK FROM ABORT\n"); /* shouldn't come back from floating pt exception */
86 exit(1); /* never know, though */
87}
88
89int ubik_GetVersion(dummy, ver)
90int dummy;
91struct ubik_version *ver;
92{
c7e4633e 93 memset(ver, 0, sizeof(struct ubik_version));
e1f001e5 94 return(0);
95}
96
97
dba0cf81 98int ubik_Seek(tt, afd, pos)
e1f001e5 99struct ubik_trans *tt;
100long afd;
101long pos;
102{
103 if (lseek(dbase_fd, pos+HDRSIZE, 0) < 0) {
104 perror("ubik_Seek");
105 return(-1);
106 }
107 return(0);
108}
109
dba0cf81 110int ubik_Write(tt, buf, len)
e1f001e5 111struct ubik_trans *tt;
112char *buf;
113long len;
114{
115 int status;
116
117 status = write(dbase_fd, buf, len);
118 if (status < len) {
119 perror("ubik_Write");
120 return(1);
121 }
122 return(0);
123}
124
dba0cf81 125int ubik_Read(tt, buf, len)
e1f001e5 126struct ubik_trans *tt;
127char *buf;
128long len;
129{
130 int status;
131
132 status = read(dbase_fd, buf, len);
133 if (status < 0) {
134 perror("ubik_Read");
135 return(1);
136 }
137 if (status < len)
c7e4633e 138 memset(&buf[status], 0, len - status);
e1f001e5 139 return(0);
140}
141
dba0cf81 142struct rx_securityClass *ubik_sc[3];
143
dba0cf81 144/* Other declarations */
e1f001e5 145
146afsconf_GetNoAuthFlag()
147{
148 return(1);
149}
150
151
dba0cf81 152char *prdir = "/dev/null";
e1f001e5 153struct prheader cheader;
dba0cf81 154int pr_realmNameLen;
155char *pr_realmName;
This page took 0.572306 seconds and 5 git commands to generate.