public inbox for newlib-cvs@sourceware.org
help / color / mirror / Atom feed
From: Richard Earnshaw <rearnsha@sourceware.org>
To: newlib-cvs@sourceware.org
Subject: [newlib-cygwin] [Aarch64] Syscalls: fix prototypes
Date: Mon, 08 Oct 2018 13:41:00 -0000	[thread overview]
Message-ID: <20181008134118.65492.qmail@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=b6ba19e355986d0d940520ce361edc70f7fcd8be

commit b6ba19e355986d0d940520ce361edc70f7fcd8be
Author: Christophe Lyon <christophe.lyon@linaro.org>
Date:   Mon Oct 1 19:10:10 2018 +0000

    [Aarch64] Syscalls: fix prototypes
    
    This patch is similar the arm one committed recently.
    
    2018-10-08  Christophe Lyon  <christophe.lyon@linaro.org>
    
    	* libgloss/aarch64/syscalls.c (_sbrk): Fix prototype.
    	(_getpid, _write, _swiwrite, _lseek, _swilseek, _read, _wriread):
    	Likewise.

Diff:
---
 libgloss/aarch64/syscalls.c | 37 +++++++++++++++++++------------------
 1 file changed, 19 insertions(+), 18 deletions(-)

diff --git a/libgloss/aarch64/syscalls.c b/libgloss/aarch64/syscalls.c
index e6dd4bd..7343cc6 100644
--- a/libgloss/aarch64/syscalls.c
+++ b/libgloss/aarch64/syscalls.c
@@ -57,19 +57,19 @@ int _link (void);
 int _stat (const char *, struct stat *);
 int _fstat (int, struct stat *);
 int _swistat (int fd, struct stat * st);
-caddr_t _sbrk (int);
-int _getpid (int);
+void * _sbrk (ptrdiff_t);
+pid_t _getpid (void);
 int _close (int);
 clock_t _clock (void);
 int _swiclose (int);
 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);
-int _swilseek (int, int, int);
-int _read (int, char *, int);
-int _swiread (int, char *, int);
+int _write (int, const char *, size_t);
+int _swiwrite (int, const char *, size_t);
+off_t _lseek (int, off_t, int);
+off_t _swilseek (int, off_t, int);
+int _read (int, void *, size_t);
+int _swiread (int, void *, size_t);
 void initialise_monitor_handles (void);
 
 static int checkerror (int);
@@ -349,7 +349,7 @@ checkerror (int result)
    len, is the length in bytes to read.
    Returns the number of bytes *not* written. */
 int
-_swiread (int fh, char *ptr, int len)
+_swiread (int fh, void *ptr, size_t len)
 {
   param_block_t block[3];
 
@@ -364,7 +364,7 @@ _swiread (int fh, char *ptr, int len)
    Translates the return of _swiread into
    bytes read. */
 int
-_read (int fd, char *ptr, int len)
+_read (int fd, void *ptr, size_t len)
 {
   int res;
   struct fdent *pfd;
@@ -389,8 +389,8 @@ _read (int fd, char *ptr, int len)
 }
 
 /* fd, is a user file descriptor. */
-int
-_swilseek (int fd, int ptr, int dir)
+off_t
+_swilseek (int fd, off_t ptr, int dir)
 {
   int res;
   struct fdent *pfd;
@@ -449,7 +449,8 @@ _swilseek (int fd, int ptr, int dir)
     return -1;
 }
 
-_lseek (int fd, int ptr, int dir)
+off_t
+_lseek (int fd, off_t ptr, int dir)
 {
   return _swilseek (fd, ptr, dir);
 }
@@ -457,7 +458,7 @@ _lseek (int fd, int ptr, int dir)
 /* fh, is a valid internal file handle.
    Returns the number of bytes *not* written. */
 int
-_swiwrite (int fh, char *ptr, int len)
+_swiwrite (int fh, const char *ptr, size_t len)
 {
   param_block_t block[3];
 
@@ -470,7 +471,7 @@ _swiwrite (int fh, char *ptr, int len)
 
 /* fd, is a user file descriptor. */
 int
-_write (int fd, char *ptr, int len)
+_write (int fd, const char *ptr, size_t len)
 {
   int res;
   struct fdent *pfd;
@@ -620,7 +621,7 @@ _close (int fd)
 }
 
 int __attribute__((weak))
-_getpid (int n __attribute__ ((unused)))
+_getpid (void)
 {
   return 1;
 }
@@ -628,8 +629,8 @@ _getpid (int n __attribute__ ((unused)))
 /* Heap limit returned from SYS_HEAPINFO Angel semihost call.  */
 ulong __heap_limit __attribute__ ((aligned (8))) = 0xcafedead;
 
-caddr_t
-_sbrk (int incr)
+void *
+_sbrk (ptrdiff_t incr)
 {
   extern char end asm ("end");	/* Defined by the linker.  */
   static char *heap_end;


                 reply	other threads:[~2018-10-08 13:41 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181008134118.65492.qmail@sourceware.org \
    --to=rearnsha@sourceware.org \
    --cc=newlib-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).