posix_fallocate
Jeremy Messenger
mezz7 at cox.net
Tue Feb 2 12:55:38 UTC 2010
On Tue, 02 Feb 2010 01:10:39 -0600, Doug Barton <dougb at freebsd.org> wrote:
> I'm working on the port of the 0.15 version of rblibtorrent
> (http://sourceforge.net/projects/qbittorrent/files/qbittorrent-unstable/libtorrent-rasterbar-0.15.svn.r4203.tar.gz/download?use_mirror=heanet)
> and ran into a snag with the following:
>
> int ret = posix_fallocate(m_fd, 0, s);
>
> The only reference in /usr/include is:
>
> /usr/include/fcntl.h: * XXX missing posix_fadvise() and
> posix_fallocate(), and POSIX_FADV_* macros.
> /usr/include/sys/fcntl.h: * XXX missing posix_fadvise() and
> posix_fallocate(), and POSIX_FADV_* macros.
>
> No references at all in /usr/local/include.
>
> There is another block of code that could be a solution, but it doesn't
> look promising either:
>
> #ifdef F_PREALLOCATE
> fstore_t f = {F_ALLOCATECONTIG, F_PEOFPOSMODE, 0, s, 0};
> if (fcntl(m_fd, F_PREALLOCATE, &f) < 0)
> {
> ec = error_code(errno, get_posix_category());
> return false;
> }
>
>
>
> So, any suggestions? :)
I did request for anyone to create posix_fallocate() for FreeBSD long time
ago. You maybe can follow Transmission's same idea for return as nothing.
http://lists.freebsd.org/pipermail/freebsd-hackers/2008-November/026590.html
Cheers,
Mezz
> Doug
--
mezz7 at cox.net - mezz at FreeBSD.org
FreeBSD GNOME Team
http://www.FreeBSD.org/gnome/ - gnome at FreeBSD.org
More information about the freebsd-ports
mailing list