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>
22 #include <sys/param.h>
23 #ifdef AFS_VFSINCL_ENV
24 #include <ufs/fsdir.h>
25 #else /* AFS_VFSINCL_ENV */
27 #endif /* AFS_VFSINCL_ENV */
30 #include <afs/remote.h>
39 /* Here are the include file(s) for the light-weight process facility. */
45 ReallyRead(fid
, block
, data
)
46 long *fid
; /* View the fid as longs. */
49 { /* Do a real read. */
52 sprintf(fname
, "F%d", *fid
);
53 s
= open(fname
, O_RDONLY
, 0644);
55 Die("can't open cache file");
56 code
= lseek(s
, PAGESIZE
* block
, 0);
59 code
= read(s
, data
, PAGESIZE
);
67 ReallyWrite(fid
, block
, data
)
68 long *fid
; /* View the fid as longs. */
71 { /* Do a real write. */
74 sprintf(fname
, "F%d", *fid
);
75 s
= open(fname
, O_RDWR
| O_CREAT
, 0644);
77 Die("can't find cache file");
78 code
= lseek(s
, PAGESIZE
* block
, 0);
81 code
= write(s
, data
, PAGESIZE
);
89 /* The following three routines provide the fid routines used by the buffer and directory packages. */
94 { /* Zero out a file */
101 { /* Zero out a file */
108 { /* Compare two fids for equality. */
117 { /* Is fid in a particular volume */
124 { /* Assign one fid to another. */
130 { /* Print an error message and then exit. */
132 printf("Fatal error: %s\n", arg
);