Subject: cerror.S ignores error number returned
To: None <port-i386@netbsd.org>
From: Srinivasa Kanduru <ksraghavan@yahoo.com>
List: port-i386
Date: 11/25/2003 20:20:43
Hi,

Generally in the case of failure, the system calls will store the errnum in
%eax and call cerror which will in turn store the error number in _errno. This
code existed before and somewhere in the middle was deleted during one of the
changes. The net result is that the error number returned by the kernel will be
lost.

Maybe it needs to be reinstated.

Following are the suggested changes:

diff -u cerror.S*
--- cerror.S    Tue Nov 25 11:17:15 2003
+++ cerror.S.orig       Tue Nov 25 10:38:42 2003
@@ -53,12 +53,10 @@
        PIC_PROLOGUE
        call    PIC_PLT(_C_LABEL(__errno))
        PIC_EPILOGUE
-       popl    %ecx
 #else
        call    _C_LABEL(__errno)
-       popl    %ecx
 #endif /* PIC */
-       movl    %ecx,(%eax)
+       popl    (%eax)
        movl    $-1,%eax
        movl    $-1,%edx
        ret


Thanks,
Srini.

__________________________________
Do you Yahoo!?
Free Pop-Up Blocker - Get it now
http://companion.yahoo.com/