[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-bugs] #14802 [Tor]: Return 0 when we fail to get the amount of system memory on some obscure OS
#14802: Return 0 when we fail to get the amount of system memory on some obscure OS
--------------------+------------------------------------
Reporter: sysrqb | Owner:
Type: defect | Status: new
Priority: normal | Milestone:
Component: Tor | Version: Tor: 0.2.5.4-alpha
Keywords: | Actual Points:
Parent ID: | Points:
--------------------+------------------------------------
Currently we incorrectly return -1 when sysctl fails in
{{{
#elif defined(HAVE_SYSCTL) && defined(HW_PHYSMEM)
/* On some systems (like FreeBSD I hope) you can use a size_t with
* HW_PHYSMEM. */
size_t memsize=0;
size_t len = sizeof(memsize);
int mib[2] = {CTL_HW, HW_USERMEM};
if (sysctl(mib,2,&memsize,&len,NULL,0))
return -1;
return memsize;
}}}
--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/14802>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
_______________________________________________
tor-bugs mailing list
tor-bugs@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs