site_archiver@lists.apple.com Delivered-To: darwin-kernel@lists.apple.com 2 questions related to kern_control in OS X 10.3.0 or later: XXXX is the same value both in the Kernel Extension and UserLand. _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-kernel mailing list (Darwin-kernel@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-kernel/site_archiver%40lists.a... * Can registered IDs used for PF_NKE be used for a kern_control too? Or is a new registration required? * I'm using the equivalent of the sample code in the NKE documentation (without the CTL_FLAG_PRIVILEGED) and the following code in UserLand: bzero(&addr, sizeof(addr)); // sets the sc_unit field to 0 addr.sc_len = sizeof(addr); addr.sc_family = AF_SYSTEM; addr.ss_sysaddr = AF_SYS_CONTROL; addr.sc_id = 'XXXX'; // should be unique - use a registered Creator ID here fd = socket(PF_SYSTEM, SOCK_DGRAM, SYSPROTO_CONTROL); if (fd) { result = connect(fd, (struct sockaddr *)&addr, sizeof(addr)); if (result) fprintf(stderr, "connect failed %d\n", errno); } else fprintf(stderr, "failed to open socket\n"); if (!result) { /*result = setsockopt( fd, SYSPROTO_CONTROL, kEPCommand1, NULL, 0); if (result) fprintf(stderr, "setsockopt failed on kEPCommand1 call - result was %d\n", result); */ } I'm getting a errno 2 (No such file or directory) on the connect call. Is there something to change in the code showed in the documentation to make it work? The ctl_register call is saying everything is fine in the Kernel Extenstion. This email sent to site_archiver@lists.apple.com
participants (1)
-
Stephane Sudre