This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libc/5209] return from times() system call treated as errno


------- Additional Comments From jakub at redhat dot com  2008-04-10 07:16 -------
Well, there is a problem with this, because the syscall returning -EFAULT
may mean two things: 1) clock_t equal to -EFAULT 2) invalid address passed to it.
E.g. times ((struct tms *) -4UL) should return -1 and set errno to EFAULT, but
after this change it doesn't.  This can be handled by reading and writing back
the tms structure if -EFAULT was returned - if the address was invalid, it will
segfault, which is ok, if it wasn't, it will return the correct value.

Also, when the syscall returns -1, meaning clock_t right before 0, POSIX says
that errno should be returned, but the kernel didn't return an error case. 
Perhaps we should return 0 instead?


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |


http://sourceware.org/bugzilla/show_bug.cgi?id=5209

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]