tags:

views:

37

answers:

2

I'm writing an application that runs as a system daemon (root session) for Mac OSX 10.6. As part of this application, I need to list all the active graphical login sessions.

There is an (undocumented, but public) function called SessionGetInfo which will give me more information about a session with a known session Id, but I need a function that tells me the active session Ids on the system.

The ultimate goal here is for the daemon application to launch an agent in each graphical user session.

+2  A: 

If you're on Mac OSX 10.5+, according to this document from Apple you could use the utmpx API.

Some example code can be found here.

Hope this is helpful.

ChristopheD
A: 

If you're not against invoking a shell command, there's always ps aux | grep SystemUIServer

MHarrison