add macro define ENODATA for other Unix

use_iouring
YuQing 2024-05-20 08:22:35 +08:00
parent fef0a4a7f3
commit 8aceec92ee
2 changed files with 8 additions and 1 deletions

View File

@ -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

View File

@ -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)
{