Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Lots of stuff on macOS gone weird / mental. Try to set thread affinity, for example. Look at their source in /usr/include/mach/thread_policy.h under thread_policy_set and thread_policy_get


Lots of stuff on macOS gone weird / mental. Try to allocate large blocks of memory in a dynamically loaded function. The pointer you get back is a raw non-virtual pointer, then you need to use non-posix calls to map that region into your process's virtual memory space.


There is no such thing as posix memory allocation.


could you expound on this? which syscall exactly are you making?


POSIX != SysCalls

Libc (or the various other libs that compose libc) are not necessarily system calls, often they are wrappings of severals.

I'm talking about the `dlfnc.h` interfaces.


Are you saying that when you call dlsym(3) on OS X you get back a non-null pointer to memory that is not mapped inside your address space? That can't be, right? So where does your "weird" pointer actually come from and how is it connected to the allocation of huge blocks?


Seconded. Please post a test case that shows this failure.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: