|
Lines 39-46
Link Here
|
| 39 |
|
39 |
|
| 40 |
// FIXME: On 64-bit architectures, we need to use "long" not "int" here for |
40 |
// FIXME: On 64-bit architectures, we need to use "long" not "int" here for |
| 41 |
// "offset" and "len" |
41 |
// "offset" and "len" |
| 42 |
[DllImport ("libc", SetLastError=true)] |
|
|
| 43 |
static extern int posix_fadvise (int fd, int offset, int len, int advice); |
| 44 |
|
42 |
|
| 45 |
// The following are from /usr/include/linux/fadvise.h and will not change |
43 |
// The following are from /usr/include/linux/fadvise.h and will not change |
| 46 |
private const int AdviseNormal = 0; // POSIX_FADV_NORMAL |
44 |
private const int AdviseNormal = 0; // POSIX_FADV_NORMAL |
|
Lines 52-59
Link Here
|
| 52 |
|
50 |
|
| 53 |
static private int GiveAdvice (FileStream file, int advice) |
51 |
static private int GiveAdvice (FileStream file, int advice) |
| 54 |
{ |
52 |
{ |
| 55 |
int fd = file.Handle.ToInt32 (); |
53 |
return 0; |
| 56 |
return posix_fadvise (fd, 0, 0, advice); |
|
|
| 57 |
} |
54 |
} |
| 58 |
|
55 |
|
| 59 |
static public void FlushCache (FileStream file) |
56 |
static public void FlushCache (FileStream file) |