[PATCH 1/2] libc: fix setting return value and errno in fallocate()

Yuriy Kolerov Yuriy.Kolerov at synopsys.com
Fri Sep 18 13:37:15 UTC 2015


I think it's meant that posix_fallocate must use fallocate as it is implemented now.

int posix_fallocate(int fd, __off_t offset, __off_t len)
{
    return __libc_fallocate(fd, 0, offset, len);
}

Regards,
Yuriy Kolerov


-----Original Message-----
From: Rich Felker [mailto:dalias at aerifal.cx] On Behalf Of Rich Felker
Sent: Friday, September 18, 2015 12:53 AM
To: Bernhard Reutner-Fischer
Cc: Yuriy Kolerov; uclibc at uclibc.org; Vineet.Gupta1 at synopsys.com; Alexey.Brodkin at synopsys.com; Francois.Bedard at synopsys.com
Subject: Re: [PATCH 1/2] libc: fix setting return value and errno in fallocate()

On Thu, Sep 17, 2015 at 09:27:40PM +0200, Bernhard Reutner-Fischer wrote:
> On September 17, 2015 6:16:48 PM GMT+02:00, Yuriy Kolerov <Yuriy.Kolerov at synopsys.com> wrote:
> >Hi Rich.
> >
> >fallocate must return 0 or -1. However posix_fallocate my return an 
> >error code. So I think it would be better to allow posix_fallocate 
> >change errno as fallocate does it and fix posix_fallocate return 
> >value according to POSIX.
> 
> fallocate () should be implemented on top of posix_fallocate, yes.

I don't think this is possible. fallocate has an extra mode argument which posix_fallocate lacks.

Rich


More information about the uClibc mailing list