Contents

SCDynamicStoreCopyConsoleUser(_:_:_:)

Returns information about the user currently logged into the system.

Declaration

func SCDynamicStoreCopyConsoleUser(_ store: SCDynamicStore?, _ uid: UnsafeMutablePointer<uid_t>?, _ gid: UnsafeMutablePointer<gid_t>?) -> CFString?

Parameters

  • store:

    The dynamic store session that should be used for communication with the server. Pass NULL to use a temporary session.

  • uid:

    A pointer to memory that, on output, is filled with the user ID of the currently logged-in user. If NULL, this value is not returned.

  • gid:

    A pointer to memory that, on output, is filled with the group ID of the currently logged-in user. If NULL, this value is not returned.

Return Value

Returns the name, user ID, and group ID of the user currently logged into the system, or NULL if no user is logged in or if an error occurred. You must release the returned values.

Discussion

Note that this function only provides information about the primary console. It does not provide any details about console sessions that have fast user switched out or about other consoles.

See Also

Group