This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
[patch] SPU readlink
- From: Ken Werner <ken at linux dot vnet dot ibm dot com>
- To: newlib at sources dot redhat dot com
- Date: Mon, 5 May 2008 21:20:12 +0200
- Subject: [patch] SPU readlink
Hi,
since the declaration of readlink (libc/include/sys/unistd.h) is now conform
to POSIX:
http://sourceware.org/cgi-bin/cvsweb.cgi/src/newlib/libc/include/sys/unistd.h?cvsroot=src
the SPU readlink implementation should also be adjusted. Ok for apply?
Ken
libgloss/ChangeLog:
2008-04-23 Ken Werner <ken.werner@de.ibm.com>
* spu/readlink.c: Align readlink implementation to POSIX
Index: src/libgloss/spu/readlink.c
===================================================================
--- src.orig/libgloss/spu/readlink.c
+++ src/libgloss/spu/readlink.c
@@ -44,14 +44,8 @@ typedef struct
unsigned int pad2[3];
} syscall_readlink_t;
-/*
- * POSIX says readlink returns ssize_t, and has an size_t bufsiz, but
- * newlib has it prototyped as returning int, and int bufsiz. ssize_t,
- * size_t and int are ally currently 4 bytes for SPU, so just leave them
- * as ints for now.
- */
-int
-readlink (const char *path, char *buf, int bufsiz)
+ssize_t
+readlink (const char *path, char *buf, size_t bufsiz)
{
syscall_readlink_t sys;