示例#1
0
func Fadvise(fd uintptr, off int64, size int64, advise int) (err error) {
	var errno int
	if errno = int(C.posix_fadvise(C.int(fd), C.__off_t(off), C.__off_t(size), C.int(advise))); errno != 0 {
		err = syscall.Errno(errno)
	}
	return
}
示例#2
0
func DropBufferCache(fd int, length int64) {
	C.posix_fadvise(C.int(fd), C.__off_t(0), C.__off_t(length), C.int(4))
}