Questions tagged [mach]

Mach is the name of the foundational component of the XNU kernel, common to macOS, iOS, tvOS and watchOS. Originally developed by CMU, it was adopted by NeXTSTEP, and integrated into macOS (formally known as Mac OS X) when the former merged with Apple. Though largely undocumented, Mach APIs make up the core of XNU's IPC, scheduling and memory management, supplementing the more widely known POSIX APIs offered in Darwin.

159 questions
3
votes
5 answers

Timeout waiting to lock artifact cache (/path/to/.gradle/caches/modules-2). It is currently in use by another Gradle instance

Not sure if this question is for stackoverflow or superuser EDIT: superuser doesn't even have a gradle tag, so I'm guessing this is for stackoverflow Hi i am trying to run ./mach gradle app:test to test bug fixes in mozillas code When I run it I get…
Matt
  • 2,232
  • 8
  • 35
  • 64
3
votes
1 answer

Dtrace print parent process command

I'd like to have a script that for each new running process, prints its starting command, as well as its parent process. i'm using the following probes : proc::posix_spawn:exec-success,proc::__mac_execve:exec-success From within the script body,…
Zohar81
  • 4,554
  • 5
  • 29
  • 82
3
votes
1 answer

iOS futex support

Is there any way to implement a fast spinlock on iOS that reverts to blocking on an OS primitive if and only if there's contention? I'm looking for something equivalent to these implementations: http://locklessinc.com/articles/keyed_events/ (Fast…
Falcon
  • 445
  • 3
  • 10
3
votes
1 answer

Any lower-latency (than Mach semaphores) means of synchronization for audio programming on OS X?

I'm currently using a TPCircularBuffer to synchronize decoding audio data from an external library (libxmp: http://xmp.sourceforge.net/) and playing it back via the AudioUnits API on OS X. Mach semaphores are used to signal when the buffer needs to…
dcarmich
  • 33
  • 4
3
votes
1 answer

Creating real-time thread on OSX

I'm working on an OSX application that transmits data to a hardware device over USB serial. The hardware has a small serial buffer that is drained at a variable rate and should always stay non-empty. We have a write loop in its own NSThread that…
sct
  • 59
  • 1
  • 3
3
votes
1 answer

GoLang / CGO: Problems calling Mach API host_statistics() from Go

I use the following C code fragment to get the CPU load on OS X: #include #include #include [...] mach_msg_type_number_t count = HOST_CPU_LOAD_INFO_COUNT; …
3
votes
1 answer

Mac OS X Kernel Extension CPU Selection

I was reading the source code for the model-specific register (MSR) driver kernel extension that ships with the Intel Performance Counter Monitor…
Sam Manzer
  • 1,220
  • 10
  • 23
3
votes
1 answer

Mach vm_read not returning the expected values for OSX 10.8.2

I just recently moved to the UNIX platform and currently doing research on operating systems. Right now, I am particularly interested at the design/implementation of XNU and currently on the topic of processes and memory. I have this code snippet…
iookl
  • 51
  • 3
2
votes
1 answer

What is CPU_STATE_MAX?

What is the CPU_STATE_MAX macro and what is it used for? I couldn't find any descriptive/relevant google results or man pages. I am on Mac OSX Snowleopard, if that makes any difference.
fdh
  • 5,256
  • 13
  • 58
  • 101
2
votes
1 answer

mach_inject kick start

Current I am trying to inject a bundle to Finder, it all works well and in Activity Monitor I can see my bundle reside in there. However the code inside my bundle does not execute. I would like to ask how do I kick start the execution of my code in…
Roddy
  • 21
  • 2
2
votes
0 answers

Copy file using just Mach and Hurd functions

I am working on Debian GNU/Hurd with Mach. I have been asked to write a program that given two arguments (origen file and destination file), copies one file into the other. I'm asked to use just Mach and Hurd calls, such as mach_port_deallocate,…
acampana
  • 461
  • 1
  • 3
  • 17
2
votes
0 answers

Xcode default gcc (mis)configured to compile for iOS instead of macOS

It appears Xcode 10.2.1 has broken my gcc installation. For example, if I try to compile a simple file: int main() { printf("Hello, world!\n"); return 0; } And run it I get: dyld: mach-o, but built for simulator (not macOS) Abort trap:…
RichieAHB
  • 2,030
  • 2
  • 20
  • 33
2
votes
1 answer

Smallest size of valid executable Mach-o file

I'm working on file iterator that decide if macho file is runnable or not, and like to add quick check according to file size. It seems like there's no real limitation about macho minimum size, but is there a lower limit valid macho size. This…
Zohar81
  • 4,554
  • 5
  • 29
  • 82
2
votes
1 answer

Launchd flow of spawning new processes

I'm doing some research about the way launchd load it's services from plist files under /Library/LaunchDaemons/ or via the command launchctl load So far I've managed to gather some various sources and compose the following vague picture as I…
Irad K
  • 867
  • 6
  • 20
2
votes
2 answers

What is the difference between the mach headers in /usr/include and the ones in the SDK?

In MacOS X there are Mach kernel headers located both at /usr/include/mach and /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Kernel.framework/Versions/A/Headers/mach These…
gnzlbg
  • 7,135
  • 5
  • 53
  • 106
1 2
3
10 11