Re: [PATCH v2 2/3] libc: fix sign extension in fallocate()
Vineet Gupta <[email protected]> Wed, 23 Sep 2015 09:57:30 +0000
| Newsgroups | gmane.comp.lib.uclibc.general |
|---|---|
| Message-ID | <C2D7FE5348E1B147BCA15975FBA23075D78187DA@IN01WEMBXB.internal.synopsys.com> |
On Wednesday 23 September 2015 03:18 PM, Yuriy Kolerov wrote:
> I think it would be easier to call fallocate64 from fallocate:
>
> int attribute_hidden __libc_fallocate(int fd, int mode, __off_t offset, __off_t len)
> {
> # if __WORDSIZE == 32
> return fallocate64(fd, mode, offset, len);
> # elif __WORDSIZE == 64
> int ret;
> ...
Indeed this is even better. You may wanna add a comment though which explains the
subtle upcasting.