bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

vm_size_t is unsigned, add vm_ssize_t?


From: Samuel Thibault
Subject: vm_size_t is unsigned, add vm_ssize_t?
Date: Tue, 22 Feb 2011 01:37:10 +0100
User-agent: Mutt/1.5.12-2006-07-14

Hello,

The getifaddrs bug is due to the following:

/* Return a list of interfaces as expected by the SIOCGIFCONF ioctl.
   The maximum number of bytes returned can be given in AMOUNT, but if
   AMOUNT is negative, all interfaces will be returned. Always
   succeeds (and interface list will be truncated to fit into AMOUNT
   space) for BSD compatibility.  */
routine pfinet_siocgifconf (
        port: io_t;
        amount: vm_size_t;
        out buf: data_t, dealloc
);

notably this: "if AMOUNT is negative" ; vm_size_t can never be negative
since it's unsigned, and thus the test in pfinet always fails.  Should
we perhaps simply introduce vm_ssize_t, just like ssize_t exists along
size_t?

Samuel



reply via email to

[Prev in Thread] Current Thread [Next in Thread]