Re: Compiling O_DIRECT

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Yup.. It solved the problem.
Thank you...
Shesha

matrix reloaded wrote:
  Please add the following line at the starting of your C code and the problem will be 
solved :- 
 
#define _GNU_SOURCE 
 
means finally the program will be like this :- 
 
#define _GNU_SOURCE 
#include <stdio.h> 
#include <fcntl.h> 
 
int main { 
   int dev = open("/dev/sda", O_RDWR | O_DIRECT); 
    close(dev); 
} 
 
Thanks. 
Sumit Sharma. 
IBM, Bangalore. 
 
 
On Sat, 17 Jul 2004 Shesha Sreenivasamurthy wrote : 
  
Hi, 
  I am having trouble in compiling my program with O_direct option. 


#include <stdio.h> 
#include <fcntl.h> 
int main { 
  int dev = open("/dev/sda", O_RDWR | O_DIRECT); 
   close(dev); 
} 

$ gcc -v 
Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/2.96/specs 
gcc version 2.96 20000731 (Red Hat Linux 7.3 2.96-110)   
Any help is appreciated ....  
-Shesha 


-- 
Kernelnewbies: Help each other learn about the Linux kernel. 
Archive:       http://mail.nl.linux.org/kernelnewbies/ 
FAQ:           http://kernelnewbies.org/faq/ 
    

  

[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux