#include <IOKit/serial/ioss.h>
#include <sys/syslimits.h>
#include <mach/mach_time.h>
+#if MAC_OS_X_VERSION_MAX_ALLOWED < 120000 /* Before macOS 12 */
+#define kIOMainPortDefault kIOMasterPortDefault
+#endif
#endif
#ifdef __linux__
#include <dirent.h>
if (!(classes = IOServiceMatching(kIOSerialBSDServiceValue)))
RETURN_FAIL("IOServiceMatching() failed");
- if (IOServiceGetMatchingServices(kIOMasterPortDefault, classes,
+ if (IOServiceGetMatchingServices(kIOMainPortDefault, classes,
&iter) != KERN_SUCCESS)
RETURN_FAIL("IOServiceGetMatchingServices() failed");
}
DEBUG("Getting matching services");
- if (IOServiceGetMatchingServices(kIOMasterPortDefault, classes,
+ if (IOServiceGetMatchingServices(kIOMainPortDefault, classes,
&iter) != KERN_SUCCESS) {
SET_FAIL(ret, "IOServiceGetMatchingServices() failed");
goto out_done;