Re: [PATCH] fallocate.2: mention <linux/falloc.h> for flag definitions

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

 



Hello Eric,

I am not sure of the right answer to your initial question. Ulrich
Drepper should be able to tell us.

On Thu, Jun 9, 2011 at 12:17 AM, Eric Gouriou <egouriou@xxxxxxxxxx> wrote:
> Document that <linux/falloc.h> is needed to have the definition
> of FALLOC_FL_* flags.

I was about to apply this patch, and then I realized that the problem
may be really lie outside the man page.

Ulrich, the glibc headers declare Linux's fallocate() syscall is
_GNU_SOURCE is defined, but not the associated FALLOC_FL_PUNCH_HOLE
and FALLOC_FL_KEEP_SIZE constants. Probably this needs to be fixed. Is
this a glibc lack or is it that the constants are not exported from
kernel headers in the way that glibc needs?

> ---
> Notes:
> 1) <linux/falloc.h> also defines fallocate(), so one does not have
> to include <fcntl.h> or define _GNU_SOURCE when <linux/falloc.h> is used.
> However it is true that including <fcntl.h> defines fallocate() if and only
> if _GNU_SOURCE is defined.

Yes, but probably don't need to document this. See my question to Ulrich above.

> Please let me know if this kind of minutiae deserves to be noted in
> the page. If so, please direct me to other pages I could use as guides
> on how to convey such subtleties.
>
> 2) Currently only FALLOC_FL_KEEP_SIZE is defined. In progress patches
> may add FALLOC_FL_PUNCH_HOLE when they land.

See the other mail that I just CCed you.

Cheers,

Michael


> ---
>  man2/fallocate.2 |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/man2/fallocate.2 b/man2/fallocate.2
> index 42eefbd..963c39f 100644
> --- a/man2/fallocate.2
> +++ b/man2/fallocate.2
> @@ -9,6 +9,7 @@ fallocate \- manipulate file space
>  .nf
>  .BR "#define _GNU_SOURCE" "             /* See feature_test_macros(7) */"
>  .B #include <fcntl.h>
> +.BR "#include <linux/falloc.h>" "       /* For FALLOC_FL_* definitions */"
>
>  .BI "int fallocate(int " fd ", int " mode ", off_t " offset \
>  ", off_t " len ");
> --
> 1.7.3.1
>
>



-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Author of "The Linux Programming Interface"; http://man7.org/tlpi/
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Kernel Documentation]     [Netdev]     [Linux Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux