Function

SMJobRemove(_:_:_:_:_:)

Removes the job with the given label from the specified domain.

Declaration

macOS
func SMJobRemove(_ domain: CFString!, _ jobLabel: CFString, _ auth: AuthorizationRef!, _ wait: Bool, _ outError: UnsafeMutablePointer<Unmanaged<CFError>?>!) -> Bool
Mac Catalyst
func SMJobRemove(_ domain: CFString!, _ jobLabel: CFString, _ auth: UnsafeMutableRawPointer!, _ wait: Bool, _ outError: UnsafeMutablePointer<Unmanaged<CFError>?>!) -> Bool

Parameters

domain

The job's domain (e.g. kSMDomainSystemLaunchd).

jobLabel

The label for the job to remove.

auth

An AuthorizationRef containing the kSMRightModifySystemDaemons right if the given domain is kSMDomainSystemLaunchd.

wait

Pass true to block until the process for the given job has exited.

outError

An output reference to a CFErrorRef describing the specific error encountered while submitting the job dictionary, or NULL if no error occurred. It is the responsibility of the application to release the error reference. This argument may be NULL.

Return Value

true if the job was removed successfully, otherwise false.

Discussion

SMJobSubmit removes the job specified by label from the domain. If the job is currently running, it will conditionally block until the running process has exited.

See Also

Examining Jobs

func SMCopyAllJobDictionaries(CFString!) -> Unmanaged<CFArray>!

Copy the job description dictionaries for all jobs in the given domain.

Deprecated
func SMJobCopyDictionary(CFString!, CFString) -> Unmanaged<CFDictionary>!

Copy the job description dictionary for the given job label.

Deprecated