Want more features on Pastebin? Sign Up, it's FREE!
Guest

ABORTED trim command

By: a guest on May 2nd, 2011  |  syntax: C  |  size: 0.65 KB  |  views: 142  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. #include <sys/ioctl.h>
  2. #include <stdio.h>
  3. #include <fcntl.h>
  4. #include <sys/nata.h>
  5.  
  6. int main(){
  7.  
  8.         off_t range[2];
  9.         range[0] =100000;
  10.         range[1] =65535;
  11.         printf("start:%llu offset:%llu\n",(unsigned long long) range[0],
  12.                 (unsigned long long) range[1]);
  13.         int fd = open("/dev/ad4",O_RDWR|O_DIRECT);
  14.         ioctl(fd,IOCATADELETE, range);
  15.  
  16.        // usleep(500000);
  17.         range[0] =0;
  18.         range[1] =65535;
  19.         printf("start:%llu offset:%llu\n",(unsigned long long) range[0],
  20.                 (unsigned long long) range[1]);
  21.         ioctl(fd,IOCATADELETE, range);
  22.         close(fd);
  23.  
  24. }
clone this paste RAW Paste Data