Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 02 Feb 2010 06:58:17 -0600
From:      "Jeremy Messenger" <mezz7@cox.net>
To:        "Doug Barton" <dougb@freebsd.org>
Cc:        "freebsd-ports@FreeBSD.org" <freebsd-ports@freebsd.org>
Subject:   Re: posix_fallocate
Message-ID:  <op.u7h3n3hi9aq2h7@localhost>
In-Reply-To: <4B67CFEF.1020107@FreeBSD.org>
References:  <4B67CFEF.1020107@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 02 Feb 2010 01:10:39 -0600, Doug Barton <dougb@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@cox.net  -  mezz@FreeBSD.org
FreeBSD GNOME Team
http://www.FreeBSD.org/gnome/  -  gnome@FreeBSD.org



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?op.u7h3n3hi9aq2h7>