This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libc/7083] New: Please add direct support for the Linux system call fallocate(2)


Currently, the Linux fallocate system call is only exposed via glibc's
posix_fallocate() interface.    Unfortunately, this means it is not possible for
the user to pass in the FALLOC_FL_KEEP_SIZE flag.   This flag reserves blocks
for use by the inode, but without changing the size of the file as reported by
i_size.   This can be useful in some circumstances.   For example, a program
that rotates logfiles might want to use fallocate() with FALLOC_FL_KEEP_SIZE to
reserve space for the new /var/log/messages file, without changing the reported
i_size of the file.   This allows the new /var/log/messages file to be
contiguous, while still allowing tail -f to work, and log analyzers to read from
the file without getting a large number of trailing zero's --- which would be
the case if posix_fallocate() (which does not use FALLOC_FL_KEEP_SIZE flag, as
required by POSIX specification) were used to preallocate the file.

For this reason, we need a glibc-mediated interface that exposes the Linux
fallocate system call's flags field.  Without this, I will have to recommend
that programs that wish to use this functionality (which is implemented in ext4
and xfs) will have to call the system call directly, which would be hard to make
portable across different Linux architectures.

Many thanks!

-- 
           Summary: Please add direct support for the Linux system call
                    fallocate(2)
           Product: glibc
           Version: unspecified
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: libc
        AssignedTo: drepper at redhat dot com
        ReportedBy: tytso at mit dot edu
                CC: glibc-bugs at sources dot redhat dot com


http://sourceware.org/bugzilla/show_bug.cgi?id=7083

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]