2 * Copyright 2000, International Business Machines Corporation and others.
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
12 * NOTE This is NOT the standard physio.cx for venus or, yet alone, vice.
13 * It is a test one for use in src/dir.
17 /* First we have the kernel hacks' include files. */
18 #include <afs/param.h>
19 #include <sys/param.h>
20 #ifdef AFS_VFSINCL_ENV
21 #include <ufs/fsdir.h>
24 #endif AFS_VFSINCL_ENV
27 #include <afs/remote.h>
36 /* Here are the include file(s) for the light-weight process facility. */
42 ReallyRead(fid, block, data)
43 long *fid; /* View the fid as longs. */
46 {/* Do a real read. */
49 sprintf(fname, "F%d", *fid);
50 s = open(fname,O_RDONLY,0644);
51 if (s<0) Die("can't open cache file");
52 code=lseek(s,PAGESIZE*block,0);
53 if (code<0) Die("r:lseek");
54 code=read(s,data,PAGESIZE);
62 ReallyWrite(fid, block, data)
63 long *fid; /* View the fid as longs. */
66 {/* Do a real write. */
69 sprintf(fname, "F%d", *fid);
70 s = open(fname,O_RDWR|O_CREAT,0644);
71 if (s<0) Die("can't find cache file");
72 code = lseek(s,PAGESIZE*block,0);
73 if (code<0) Die("w:lseek");
74 code=write(s,data,PAGESIZE);
75 if (code<0) Die("write");
81 /* The following three routines provide the fid routines used by the buffer and directory packages. */
85 {/* Zero out a file */
91 {/* Zero out a file */
95 int FidEq (afid, bfid)
96 register long *afid, *bfid;
97 {/* Compare two fids for equality. */
98 if (*afid != *bfid) return 0;
102 int FidVolEq (afid, bfid)
103 register long *afid, *bfid;
104 {/* Is fid in a particular volume */
108 int FidCpy (dfid,sfid)
109 register long *dfid, *sfid;
110 {/* Assign one fid to another. */
116 {/* Print an error message and then exit. */
118 printf("Fatal error: %s\n",arg);