This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug libc/19995] New: Linux syscall return value unnecessarily relies on implementation-defined behaviour
- From: "mt at debian dot org" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sourceware dot org
- Date: Tue, 26 Apr 2016 13:42:18 +0000
- Subject: [Bug libc/19995] New: Linux syscall return value unnecessarily relies on implementation-defined behaviour
- Auto-submitted: auto-generated
https://sourceware.org/bugzilla/show_bug.cgi?id=19995
Bug ID: 19995
Summary: Linux syscall return value unnecessarily relies on
implementation-defined behaviour
Product: glibc
Version: unspecified
Status: NEW
Severity: normal
Priority: P2
Component: libc
Assignee: unassigned at sourceware dot org
Reporter: mt at debian dot org
CC: drepper.fsp at gmail dot com
Target Milestone: ---
It seems that ever since the very initial import (~14 years ago) the return
values of syscalls in sysdep.h were declared unsigned (unsigned int, unsigned
long), even though:
- Linux syscalls return signed values
- They are then cast back to signed (int, long)
The unsigned -> signed conversion is implementation-defined for any values that
cannot be represented in the signed type (as will be the case with any negative
return value if it's two's complement). This seems to be case where relying on
implementation-defined behaviour could be avoided.
Best,
Michael
--
You are receiving this mail because:
You are on the CC list for the bug.