1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
|
#ifndef __IEEEIOSLAVE_HH_
#define __IEEEIOSLAVE_HH_
class IEEEIOslave {
// open two fid's (one for O_DIRECT and the other for buffered)
// determine which sections of the buffer are remainders and
// write them buffered which requires nasty locking
// since this is SGI_specific, we can use aio for the remainders
int fid;
struct ffsw ffopens_status;
public:
IEEEIOslave(char *filename):fid(-1){
// opens read/write
fid = open(fname,O_RDWR,0644);
}
~IEEEIOslave(){
if(fid>=0){
close(fid);
}
}
};
#ifdef T3E
// T3E-specific ffio slaves
// #define open(x,y,z) ffopens(x,y,z, 0, 0, &ffopens_status, "bufa.bufsize=256.num_buffers=4")
class ffIEEEIOslave {
int fid;
public:
IEEEIOslave(char *filename):fid(-1){
// opens read/write
fid = ffopens(fname,O_RDWR,0644);
}
~IEEEIOslave(){
if(fid>=0){
ffclose(fid);
}
}
};
#ifdef SGI
// SGI-specific slaves
class asyncIEEEIOslave {
int fid;
public:
IEEEIOslave(char *filename):fid(-1){
// opens read/write
}
~IEEEIOslave(){
if(fid>=0){
close(fid);
}
}
};
#endif
#endif
|