Share Pastebin
Guest
Public paste!

scsi_detail (LVM, verbose)

By: a guest | Mar 15th, 2010 | Syntax: C | Size: 0.34 KB | Hits: 42 | Expires: Never
This paste has a previous version, view the difference. Copy text to clipboard
  1. #define _XOPEN_SOURCE 600
  2. #include <unistd.h>
  3. #include <fcntl.h>
  4. int main(int argc, char *argv[]) {
  5.   int fd, nfiles, i;
  6.   nfiles=argc-1;
  7.   for (i = 1; i<= nfiles; i++) {
  8.     fd = open(argv[i], O_RDONLY);
  9. //  replaced:    fdatasync(fd);
  10.     fsync(fd);
  11.     posix_fadvise(fd, 0,0,POSIX_FADV_DONTNEED);
  12.     close(fd);
  13.   }
  14.     return 0;
  15. }