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>
24 #include <sys/param.h>
25 #ifdef AFS_VFSINCL_ENV
26 #include <ufs/fsdir.h>
27 #else /* AFS_VFSINCL_ENV */
29 #endif /* AFS_VFSINCL_ENV */
32 #include <afs/remote.h>
41 /* Here are the include file(s) for the light-weight process facility. */
47 ReallyRead(fid, block, data)
48 long *fid; /* View the fid as longs. */
51 { /* Do a real read. */
54 sprintf(fname, "F%d", *fid);
55 s = open(fname, O_RDONLY, 0644);
57 Die("can't open cache file");
58 code = lseek(s, PAGESIZE * block, 0);
61 code = read(s, data, PAGESIZE);
69 ReallyWrite(fid, block, data)
70 long *fid; /* View the fid as longs. */
73 { /* Do a real write. */
76 sprintf(fname, "F%d", *fid);
77 s = open(fname, O_RDWR | O_CREAT, 0644);
79 Die("can't find cache file");
80 code = lseek(s, PAGESIZE * block, 0);
83 code = write(s, data, PAGESIZE);
91 /* The following three routines provide the fid routines used by the buffer and directory packages. */
96 { /* Zero out a file */
103 { /* Zero out a file */
109 register long *afid, *bfid;
110 { /* Compare two fids for equality. */
118 register long *afid, *bfid;
119 { /* Is fid in a particular volume */
125 register long *dfid, *sfid;
126 { /* Assign one fid to another. */
132 { /* Print an error message and then exit. */
134 printf("Fatal error: %s\n", arg);