-/* $Header$ */
+/* $Id$ */
#include <sys/types.h>
+#include <netinet/in.h>
+
#include <lock.h>
#define UBIK_INTERNALS
#include <ubik.h>
#include "print.h"
#include "prserver.h"
-
+extern int dbase_fd;
struct ubik_dbase *dbase;
int ubik_ServerInit()
int ubik_BeginTrans()
{
+ static int init=0;
+ struct ubik_hdr thdr;
+
+ if (!init) {
+ thdr.version.epoch = htonl(0);
+ thdr.version.counter = htonl(0);
+ thdr.magic = htonl(UBIK_MAGIC);
+ thdr.size = htonl(HDRSIZE);
+ lseek(dbase_fd, 0, 0);
+ write(dbase_fd, &thdr, sizeof(thdr));
+ fsync(dbase_fd);
+ init = 1;
+ }
return(0);
}
}
-extern int dbase_fd;
-
int ubik_Seek(tt, afd, pos)
struct ubik_trans *tt;
long afd;