/* * File System notifications * These advise clients of various filesystem events. */ #define kNotifyVFSMount "com.apple.system.kernel.mount" #define kNotifyVFSUnmount "com.apple.system.kernel.unmount" #define kNotifyVFSUpdate "com.apple.system.kernel.mountupdate" #define kNotifyVFSLowDiskSpace "com.apple.system.lowdiskspace" #define kNotifyVFSLowDiskSpaceRootFS "com.apple.system.lowdiskspace.system" #define kNotifyVFSLowDiskSpaceOtherFS "com.apple.system.lowdiskspace.user"
/* * System Configuration notifications * These advise clients of changes in the system configuration * managed by the system configuration server (configd). * Note that a much richer set of notifications are available to * clients using the SCDynamicStore API. */ #define kNotifySCHostNameChange "com.apple.system.hostname" #define kNotifySCNetworkChange "com.apple.system.config.network_change"
/* * Time Zone change notification * Sent by notifyd when the system's timezone changes. */ #define kNotifyTimeZoneChange "com.apple.system.timezone"
/* * System clock change notification * Sent when a process modifies the system clock using the settimeofday system call. */ #define kNotifyClockSet "com.apple.system.clock_set"
由此可猜测在 Darwin Notify Center 中还可监听系统时区改变,系统时间改变,系统 hostname 改变的通知,未验证。
This notification center is used to cover the <notify.h> Core OS notification mechanism (see /usr/include/notify.h). An application has only one Darwin notification center, so this function returns the same value each time it is called.
The Darwin Notify Center has no notion of per-user sessions, all notifications are system-wide. As with distributed notifications, the main thread's run loop must be running in one of the common modes (usually kCFRunLoopDefaultMode) for Darwin-style notifications to be delivered.
由此可见, Darwin Notify Center 是系统级别,每次使用接口 CFNotificationCenterGetDarwinNotifyCenter 返回的都是同一个 Darwin Notify Center 实例。