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 <afsconfig.h>
19 #include <afs/param.h>
23 #include <sys/param.h>
24 #ifdef AFS_VFSINCL_ENV
25 #include <ufs/fsdir.h>
28 #endif AFS_VFSINCL_ENV
31 #include <afs/remote.h>
40 /* Here are the include file(s) for the light-weight process facility. */
46 ReallyRead(fid, block, data)
47 long *fid; /* View the fid as longs. */
50 {/* Do a real read. */
53 sprintf(fname, "F%d", *fid);
54 s = open(fname,O_RDONLY,0644);
55 if (s<0) Die("can't open cache file");
56 code=lseek(s,PAGESIZE*block,0);
57 if (code<0) Die("r:lseek");
58 code=read(s,data,PAGESIZE);
66 ReallyWrite(fid, block, data)
67 long *fid; /* View the fid as longs. */
70 {/* Do a real write. */
73 sprintf(fname, "F%d", *fid);
74 s = open(fname,O_RDWR|O_CREAT,0644);
75 if (s<0) Die("can't find cache file");
76 code = lseek(s,PAGESIZE*block,0);
77 if (code<0) Die("w:lseek");
78 code=write(s,data,PAGESIZE);
79 if (code<0) Die("write");
85 /* The following three routines provide the fid routines used by the buffer and directory packages. */
89 {/* Zero out a file */
95 {/* Zero out a file */
99 int FidEq (afid, bfid)
100 register long *afid, *bfid;
101 {/* Compare two fids for equality. */
102 if (*afid != *bfid) return 0;
106 int FidVolEq (afid, bfid)
107 register long *afid, *bfid;
108 {/* Is fid in a particular volume */
112 int FidCpy (dfid,sfid)
113 register long *dfid, *sfid;
114 {/* Assign one fid to another. */
120 {/* Print an error message and then exit. */
122 printf("Fatal error: %s\n",arg);