diff mbox

Updated fsx.c program (fixed fallocate)

Message ID 4AC6C7C2.8030706@redhat.com
State Not Applicable, archived
Headers show

Commit Message

Eric Sandeen Oct. 3, 2009, 3:40 a.m. UTC
Nick Dokos wrote:
> Mingming wrote:
>>> I think that
>>>
>>> #define _GNU_SOURCE
>>>
>>> will pull in the glibc headers' definition rather than doing our own....
>>>
>> Oh? that's sounds good...
>>
>> I tried to replace above with 
>> #define _GNU_SOURCE	1
>>
>> gcc complained O_DIRECT is still not defined. what did I missing?
>>
> 
> 
> ,----
> | #define _GNU_SOURCE 1
> | 
> | #include <fcntl.h>
> `----
> 
> should do it.
> 
> Nick

yep, works for me as long as I define it ahead of any #includes (not 
sure just fcntl is enough, but anyway; just put it at the top).

-Eric

--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Andreas Dilger Oct. 4, 2009, 7:37 a.m. UTC | #1
On Oct 02, 2009  22:40 -0500, Eric Sandeen wrote:
> yep, works for me as long as I define it ahead of any #includes (not  
> sure just fcntl is enough, but anyway; just put it at the top).

My bad - our Makefile defines _GNU_SOURCE for all of our test programs...

> --- fsx.c.orig	2009-10-02 22:40:15.816142278 -0500
> +++ fsx.c	2009-10-02 22:40:26.886145268 -0500
> @@ -42,6 +42,8 @@
>   *
>   */
>
> +#define _GNU_SOURCE
> +
>  #include <sys/types.h>
>  #include <sys/stat.h>
>  #if defined(_UWIN) || defined(__linux__)

Cheers, Andreas
--
Andreas Dilger
Sr. Staff Engineer, Lustre Group
Sun Microsystems of Canada, Inc.

--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

--- fsx.c.orig	2009-10-02 22:40:15.816142278 -0500
+++ fsx.c	2009-10-02 22:40:26.886145268 -0500
@@ -42,6 +42,8 @@ 
   *
   */

+#define _GNU_SOURCE
+
  #include <sys/types.h>
  #include <sys/stat.h>
  #if defined(_UWIN) || defined(__linux__)