http://www.riscos.info/bugzilla3/show_bug.cgi?id=233
Summary: sendto function not returning number of characters
sent
Product: GCC/GCCSDK
Version: other
Platform: Other
OS/Version: RISC OS
Status: NEW
Severity: normal
Priority: P1
Component: GCCSDK Build
AssignedTo: John.Tytgat@aaug.net
ReportedBy: chrisg@care4free.net
Estimated Hours: 0.0
The sendto function should return the number of characters sent as per similar
functions send and sendmsg. Below is a patch for _sendto in socket.h to match
functionality of send and sendmsg.
--- libunixlib/incl-local/sys/socket.h.orig 2011-05-01 10:13:13.000000000
+0100
+++ libunixlib/incl-local/sys/socket.h 2012-04-30 09:51:41.000000000 +0100
@@ -294,15 +294,17 @@
register int flags __asm ("r3") = __flags;
register __CONST_SOCKADDR_ARG addr __asm ("r4") = __addr;
register socklen_t addrlen __asm ("r5") = __addrlen;
- register const _kernel_oserror *err;
+ register ssize_t rtrn __asm ("r0");
+ const _kernel_oserror *err;
__asm__ volatile ("SWI\t%[SWI_XSocket_Sendto]\n\t"
- "MOVVC\tr0, #0\n\t"
- : [err] "=r" (err)
+ "MOVVC\t%[err], #0\n\t"
+ "MOVVS\t%[err], r0\n\t"
+ : [err] "=r" (err), "=r" (rtrn)
: "r" (fd), "r" (buf), "r" (len), "r" (flags),
"r" (addr), "r" (addrlen),
[SWI_XSocket_Sendto] "i" (Socket_Sendto | (1<<17))
: "r14", "cc");
- return __net_error (0, err);
+ return __net_error (rtrn, err);
}
static __inline__ int __attribute__ ((always_inline))
--
Configure bugmail: http://www.riscos.info/bugzilla3/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.
_______________________________________________
GCCSDK mailing list gcc@gccsdk.riscos.info
Bugzilla: http://www.riscos.info/bugzilla/index.cgi
List Info: http://www.riscos.info/mailman/listinfo/gcc
Main Page: http://www.riscos.info/index.php/GCCSDK
No comments:
Post a Comment