I tried to register the network_change event in MAC OS X 10.7 (lion) with the following code:
#define kNotifySCNetworkChange "com.apple.system.config.network_change"
void init()
{
status = notify_register_check(kNotifySCNetworkChange, &token);
if (status != NOTIFY_STATUS_OK)
{
cout << "Event Registration failed" <<endl;
}
cout << "Event Registration Success" << endl;
}
.....
If I use this code in a sample program, it is successfully registered. If I use this in my application, the notify_register_check () function returns with a status of 1,000,000 (NOTIFY_STATUS_FAILED). In addition, the errno return value is 0.
Note. My application works in Leopard and Snow Leopard without any problems (registration success)
I searched for this status, but could not find the relevant information. Can someone tell me when this NOTIFY_STATUS_FAILED is returned?
, :
fork() .
, Parent Process. . Child Process??? !!!