From owner-freebsd-ports@FreeBSD.ORG Tue Feb 2 12:55:38 2010 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 513D1106570B for ; Tue, 2 Feb 2010 12:55:38 +0000 (UTC) (envelope-from mezz7@cox.net) Received: from eastrmmtao102.cox.net (eastrmmtao102.cox.net [68.230.240.8]) by mx1.freebsd.org (Postfix) with ESMTP id B1ED58FC0C for ; Tue, 2 Feb 2010 12:55:37 +0000 (UTC) Received: from eastrmimpo02.cox.net ([68.1.16.120]) by eastrmmtao102.cox.net (InterMail vM.8.00.01.00 201-2244-105-20090324) with ESMTP id <20100202125536.YMGI13474.eastrmmtao102.cox.net@eastrmimpo02.cox.net>; Tue, 2 Feb 2010 07:55:36 -0500 Received: from localhost ([68.103.37.153]) by eastrmimpo02.cox.net with bizsmtp id d0vb1d00G3JFCbG020vcoG; Tue, 02 Feb 2010 07:55:36 -0500 X-VR-Score: -227.00 X-Authority-Analysis: v=1.1 cv=YOmZyEpYKr/CFfngC08LOA+nJ5dYZZhuDa+cpVvg9iA= c=1 sm=1 a=N4x68aYdfVlkKDflYggXRA==:17 a=6I5d2MoRAAAA:8 a=FP58Ms26AAAA:8 a=kviXuzpPAAAA:8 a=BkoZPbm9cWtNPPknel0A:9 a=WlnlRCQZJL6J4u2T3SGoxZ4WyhoA:4 a=b6GYKxM_394A:10 a=SV7veod9ZcQA:10 a=4vB-4DCPJfMA:10 a=N4x68aYdfVlkKDflYggXRA==:117 X-CM-Score: 0.00 Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes References: <4B67CFEF.1020107@FreeBSD.org> To: "Doug Barton" Date: Tue, 02 Feb 2010 06:58:17 -0600 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: "Jeremy Messenger" Message-ID: In-Reply-To: <4B67CFEF.1020107@FreeBSD.org> User-Agent: Opera Mail/10.10 (Linux) Cc: "freebsd-ports@FreeBSD.org" Subject: Re: posix_fallocate X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Feb 2010 12:55:38 -0000 On Tue, 02 Feb 2010 01:10:39 -0600, Doug Barton 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