Sponsored Content
Contact Us Post Here to Contact Site Administrators and Moderators Bits - The Unix and Linux Forums (Experimental) Virtual Currency Post 302520660 by robsonde on Monday 9th of May 2011 12:51:32 AM
Old 05-09-2011
can we have some things posted in the event prediction game?

bets on which big company has a security breach before <DATE>
bets on apple stock value at <DATE>
bets on who USA will invade next.
 

6 More Discussions You Might Find Interesting

1. What is on Your Mind?

The UNIX and Linux Forums Twitter Channel

In case you did not know about this, and are a twitter user, here is the link to the forum twitter channel: http://twitter.com/unixlinux We currently have 406 followers...... (0 Replies)
Discussion started by: Neo
0 Replies

2. What is on Your Mind?

Experimental New UNIX / Linux Project Board (See Toolbar)

We are experimenting with a new project board to help forum members make extra cash; because we have some very talented members, why not make some extra cash working from your computer. See toolbar at bottom of page. Any ideas or comments? ... (0 Replies)
Discussion started by: Neo
0 Replies

3. Post Here to Contact Site Administrators and Moderators

How to Advertise on The Unix and Linux Forums

We added a new way to advertise (to guests and non-registered users) directly on the forums: Advertise directly with The UNIX and Linux Forums https://www.unix.com/members/1-albums112-picture605.png Companies and individuals can buy display ads directly and submit their display ads... (0 Replies)
Discussion started by: Neo
0 Replies

4. How to Post in the The UNIX and Linux Forums

How to Navigate in UNIX & Linux Forums..?

Hi , i am a new user to this forum can anyone please help me in navigation for this forum. also when i am trying to open any thread i am getting below error. Bad Request Your browser sent a request that this server could not understand.] Thanks. (1 Reply)
Discussion started by: nkchand
1 Replies

5. Post Here to Contact Site Administrators and Moderators

VIP Membership - The UNIX and Linux Forums - Get Your UNIX.COM Email Address Here

We work hard to make The UNIX and Linux Forums one of the best UNIX and Linux knowledge sources on the net. The site is certainly one of the top UNIX and Linux Q&A sites on the web. In order to provide certain members the best quality account services, you can now get some great extra features by... (2 Replies)
Discussion started by: Neo
2 Replies

6. What is on Your Mind?

YouTube: Forum Moderation @UNIX.com | The UNIX and Linux Forums

Forum Moderation @UNIX.com | The UNIX and Linux Forums https://youtu.be/WGwgibE4Rq0 Also note: In the video I mentioned removing legacy menu items in the ModCP which are unused. I have already "CSS'ed out" the unused menu items: ... (0 Replies)
Discussion started by: Neo
0 Replies
xpc_events(3)						   BSD Library Functions Manual 					     xpc_events(3)

NAME
xpc_events -- launch-on-demand for high-level events SYNOPSIS
#include <xpc/xpc.h> void xpc_set_event_stream_handler(const char *name, dispatch_queue_t targetq, xpc_handler_t handler); DESCRIPTION
XPC provides a mechanism by which launchd jobs may launch on-demand for certain higher-level events, such as IOKit events or BSD Notifica- tions. These events are delivered to the job through a handler that is set early in its execution. The period between when the event is delivered to the job and when a handler is set is race-free, and any pending events will be queued up for consumption by the job. An event is consumed when it is delivered to the handler. EVENT STREAMS
Providers of events are known as streams. Two example event streams are the IOKit stream and the BSD Notifications stream. Streams are denoted by a reverse-DNS naming scheme. For the aforementioned examples, the stream names are "com.apple.iokit.matching" and "com.apple.noti- fyd.matching", respectively. These are currently the only two supported event streams. EVENT NAMES
A launchd job may be interested in multiple events from different event streams. Each of these events has a name provided by the job in the launchd.plist(5). The occurrence of any of these events will launch the job on-demand if it is not already running. PLIST SCHEMA
Events are specified through the launchd.plist(5) with the LaunchEvents key. The value for this key is a dictionary. Each value of this dic- tionary is itself a dictionary corresponding to an event stream. The values of this inner dictionary are events that may cause the job to be launched on-demand. <key>LaunchEvents</key> <dict> <key>com.apple.iokit.matching</key> <dict> <key>com.apple.device-attach</key> <dict> <key>idProduct</key> <integer>2794</integer> <key>idVendor</key> <integer>725</integer> <key>IOProviderClass</key> <string>IOUSBDevice</string> <key>IOMatchLaunchStream</key> <true/> </dict> </dict> <key>com.apple.notifyd.matching</key> <dict> <key>com.apple.interesting-notification</key> <dict> <key>Notification</key> <string>com.apple.interesting-notification</string> </dict> </dict> </dict> The above specifies that the job will be launched when a node matching the given matching dictionary appears in the IORegistry or when a notification named "com.apple.interesting-notification" is posted using notify_post(3). NOTE: The IOMatchLaunchStream key is required to be present and be a Boolean set to true for use with XPC Events. It will be filtered out of the rest of the dictionary when given to IOKit to match. The reasons for this are historical and not applicable to other event streams. Each event stream has a different plist schema. EVENT CONSUMPTION
Events are consumed with the xpc_set_event_stream_handler() API. The stream argument specifies from which event stream the given handler will receive events. The targetq parameter specifies on which queue the handler will be synchronized. The handler will only ever receive dictio- naries. Each dictionary is guaranteed to have the XPC_EVENT_KEY_NAME key set. The value for this key is the string that was given as the name for the event in the launchd.plist(5). So if the IOKit event in the above example was received, the value of this key would be "com.apple.device-attach". In addition to the standard payload, events from the IOKit stream also have the "IOMatchLaunchServiceID" key set to a uint64_t which speci- fies the unique IORegistry ID of the node which matched the given dictionary as obtained by IORegistryEntryGetRegistryEntryID(). This value may be given to IORegistryEntryIDMatching() to obtain the registry entry which caused the event to fire. BSD Notfication events have no additional payload. xpc_set_event_stream_handler("com.apple.iokit.matching", q, ^(xpc_object_t event) { const char *name = xpc_dictionary_get_string(event, XPC_EVENT_KEY_NAME); uint64_t id = xpc_dictionary_get_uint64(event, "IOMatchLaunchServiceID"); CFMutableDictionaryRef matching = IORegistryEntryIDMatching(id); // Pass to IOServiceGetMatchingServices() or IOServiceAddNotification(). }); IMPORTANT: xpc_set_event_stream_handler() is NOT shareable. Two different subsystems in a process cannot safely both register for events from the same event stream. Therefore, libraries and frameworks should NEVER call this API. SEE ALSO
xpc_object(3), xpc_dictionary_create(3), xpc_array_create(3), notify(3) Darwin 1 July, 2011 Darwin
All times are GMT -4. The time now is 07:26 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy