IT lexicon › Programming › MIG (Mach Interface Generator)

MIG (Mach Interface Generator)

Programming På svenska → Updated: 2026-11-08

The code generator that turns interface descriptions into C for sending and receiving Mach messages. Without it, nobody would have bothered building a Mach system.

In Mach you don't call a service; you marshal a message, send it to a port and wait for the reply. Writing that marshalling by hand is tedious and error-prone. MIG takes a .defs file listing routines and argument types, and emits client stubs that look like ordinary function calls plus server code that unpacks each message and dispatches it to the right handler.

It is the same pattern as Sun RPC and, later, Protocol Buffers, applied to local IPC. MIG survives wherever Mach does: GNU Mach and the Hurd servers depend on it, and XNU still uses it for interfaces between the macOS kernel and user space. Mishandled MIG messages have been a recurring source of Apple kernel vulnerabilities.

← Back to the lexicon