add macro define ENODATA for other Unix
parent
fef0a4a7f3
commit
8aceec92ee
|
|
@ -153,6 +153,10 @@ extern int pthread_mutexattr_settype(pthread_mutexattr_t *attr, int kind);
|
|||
#define ECANCELED 125
|
||||
#endif
|
||||
|
||||
#ifndef ENODATA
|
||||
#define ENODATA 61 /* No data available */
|
||||
#endif
|
||||
|
||||
#ifndef ENONET
|
||||
#define ENONET 64 /* Machine is not on the network */
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -72,8 +72,11 @@ int get_sys_total_mem_size(int64_t *mem_size)
|
|||
size_t len;
|
||||
|
||||
mib[0] = CTL_HW;
|
||||
//mib[1] = HW_MEMSIZE;
|
||||
#ifdef DARWIN
|
||||
mib[1] = HW_MEMSIZE;
|
||||
#else
|
||||
mib[1] = HW_PHYSMEM;
|
||||
#endif
|
||||
len = sizeof(*mem_size);
|
||||
if (sysctl(mib, 2, mem_size, &len, NULL, 0) != 0)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue