Re: [Aarch64] Fix _lseek prototype

Christophe Lyon <[email protected]>
Newsgroups gmane.comp.lib.newlib
Message-ID <CAKdteOaDa2TUCVUp+s0bdqhuaUFTJ=75WXZApxKC9SiBSbt3ig@mail.gmail.com>
On Tue, 2 Oct 2018 at 08:38, Christophe Lyon <[email protected]> wrote:
>
> On Tue, 2 Oct 2018 at 00:18, Eric Blake <[email protected]> wrote:
> >
> > On 10/1/18 4:35 PM, Christophe Lyon wrote:
> > > Hi,
> > >
> > > While building newlib for Aarch64, I noticed a warning in _lseek. This
> > > small patch fixes the prototype.
> > >
> >
> > > +++ b/libgloss/aarch64/syscalls.c
> > > @@ -449,6 +449,7 @@ _swilseek (int fd, int ptr, int dir)
> > >       return -1;
> > >   }
> > >
> > > +int
> > >   _lseek (int fd, int ptr, int dir)
> >
> > Why int and not off_t?
> >
> Because that's how the prototype is defined at the beginning of the same file.
>
> Maybe time to revisit this?
>

Here is an updated version using "off_t" instead of "int".
OK?

> > --
> > Eric Blake, Principal Software Engineer
> > Red Hat, Inc.           +1-919-301-3266
> > Virtualization:  qemu.org | libvirt.org
newlib-4.txt (text/plain, 949 B)
commit 93793741f0e43f091186f6ebf3690577f5388ba0
Author: Christophe Lyon <[email protected]>
Date:   Mon Oct 1 19:10:10 2018 +0000

    [Aarch64] Fix _lseek prototype
    
    2018-10-01  Christophe Lyon  <[email protected]>
    
    	* libgloss/aarch64/syscalls.c (_lseek): Fix prototype.

diff --git a/libgloss/aarch64/syscalls.c b/libgloss/aarch64/syscalls.c
index e6dd4bd..9e77230 100644
--- a/libgloss/aarch64/syscalls.c
+++ b/libgloss/aarch64/syscalls.c
@@ -66,7 +66,7 @@ int _open (const char *, int, ...);
 int _swiopen (const char *, int);
 int _write (int, char *, int);
 int _swiwrite (int, char *, int);
-int _lseek (int, int, int);
+off_t _lseek (int, int, int);
 int _swilseek (int, int, int);
 int _read (int, char *, int);
 int _swiread (int, char *, int);
@@ -449,6 +449,7 @@ _swilseek (int fd, int ptr, int dir)
     return -1;
 }
 
+off_t
 _lseek (int fd, int ptr, int dir)
 {
   return _swilseek (fd, ptr, dir);
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.