Re: Implemented fallocate() syscall in streams
| From: | Michael Wallner | Date: | Tue, 08 Jul 2014 06:52:52 +0000 |
| Subject: | Re: Implemented fallocate() syscall in streams | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-75331@lists.php.net to get a copy of this message | ||
On 8 July 2014 08:42, Anatol Belski <anatol.php@belski.net> wrote:
> Hi Julien,
>
> On Fri, June 13, 2014 16:20, Julien Pauli wrote:
> > Hi,
> >
> >
> > I just wrote a patch to add fallocate() syscall support for streams.
> > It relies on posix_fallocate(), so that it should support many Unixes.
> > Linux's got a specification with a fallocate() function, more powerful
> > than the posix call.
> >
>
Nice!
> I propose two APIs for PHP :
> > - One that adds a function : fallocate()
> > https://github.com/jpauli/php-src/tree/fallocate
> >
> >
> > - One that relies on ftruncate() , and adds a <bool>$use_fallocate
> > flag https://github.com/jpauli/php-src/tree/fallocate_flag
> >
> > Please, note that the latest proposal requires patches in different
> > extensions, as I changed a PHP_API function signature.
>
>
I'd prefer the first option.
> > I don't know if Windows can support that. Pierre, Anatol ? :-)
> >
> >
> > Tests are beeing written at the moment.
> >
> >
> > I didn't implement this is user stream handlers, as this really is a
> > low level implementation design that is kind of useless for usage in user
> > streams.
> >
> > Thoughts ?
> >
> I've found this code
>
>
>
> http://hg.mozilla.org/mozilla-central/file/3d846420a907/xpcom/glue/FileUtils.cpp#l61
Very good catch!
--
Regards,
Mike