System Configuration Reference

Framework
Declared in
SystemConfiguration.h

Overview

The SystemConfiguration programming interface provides functions you can use to get and interpret status and error codes generated as a result of calling functions of the System Configuration framework.

Functions

SCCopyLastError

Returns an error or status code associated with the most recent function call.

CFErrorRef SCCopyLastError (
   void
);
Return Value

The most recent status or error code generated as the result of calling a function defined by the System Configuration framework. The code is represented by a Core Foundation CFErrorRef opaque type.

Discussion

Call the CFErrorGetCode function on the returned object to get the underlying error-code integer. See “Status and Error Codes” for descriptions of these codes. For more on CFErrorRef objects, see CFError Reference.

Availability
  • Available in OS X v10.5 and later.
Declared In
SystemConfiguration.h

SCError

Returns an error or status code associated with the most recent function call.

int SCError (
   void
);
Return Value

The most recent status or error code generated as the result of calling a function defined by the System Configuration framework. See “Status and Error Codes” for descriptions of these codes.

Availability
  • Available in OS X v10.1 and later.
Declared In
SystemConfiguration.h

SCErrorString

Returns a string describing the specified status code or error code.

const char * SCErrorString (
   int status
);
Parameters
status

A status or error code described in “Status and Error Codes.” You typically get this code by calling SCError or SCCopyLastError.

Return Value

The message string associated with the status or error identified by status.

Availability
  • Available in OS X v10.1 and later.
Declared In
SystemConfiguration.h

Constants

Status and Error Codes

The status or error code generated by the most recent System Configuration function call.

enum {
   kSCStatusOK = 0,
   kSCStatusFailed = 1001,
   kSCStatusInvalidArgument = 1002,
   kSCStatusAccessError = 1003,
   kSCStatusNoKey = 1004,
   kSCStatusKeyExists = 1005,
   kSCStatusLocked = 1006,
   kSCStatusNeedLock = 1007,
   kSCStatusNoStoreSession = 2001,
   kSCStatusNoStoreServer = 2002,
   kSCStatusNotifierActive = 2003,
   kSCStatusNoPrefsSession = 3001,
   kSCStatusPrefsBusy = 3002,
   kSCStatusNoConfigFile = 3003,
   kSCStatusNoLink = 3004,
   kSCStatusStale = 3005,
   kSCStatusMaxLink = 3006,
   kSCStatusReachabilityUnknown = 4001,
   kSCStatusConnectionNoService = 5001
};
Constants
kSCStatusOK

The call was successful.

Available in OS X v10.1 and later.

Declared in SystemConfiguration.h.

kSCStatusFailed

A nonspecific failure occurred.

Available in OS X v10.1 and later.

Declared in SystemConfiguration.h.

kSCStatusInvalidArgument

An invalid argument was specified.

Available in OS X v10.1 and later.

Declared in SystemConfiguration.h.

kSCStatusAccessError

Permission is denied; you must be root to obtain a lock. As a result, the function could not create or access preferences.

Available in OS X v10.1 and later.

Declared in SystemConfiguration.h.

kSCStatusNoKey

No such key.

Available in OS X v10.1 and later.

Declared in SystemConfiguration.h.

kSCStatusKeyExists

The key is already defined.

Available in OS X v10.1 and later.

Declared in SystemConfiguration.h.

kSCStatusLocked

A lock is already held.

Available in OS X v10.1 and later.

Declared in SystemConfiguration.h.

kSCStatusNeedLock

A lock is required for this operation.

Available in OS X v10.1 and later.

Declared in SystemConfiguration.h.

kSCStatusNoStoreSession

The configuration daemon session is not active.

Available in OS X v10.1 and later.

Declared in SystemConfiguration.h.

kSCStatusNoStoreServer

The configuration daemon is not available or no longer available.

Available in OS X v10.1 and later.

Declared in SystemConfiguration.h.

kSCStatusNotifierActive

Notifier is currently active.

Available in OS X v10.1 and later.

Declared in SystemConfiguration.h.

kSCStatusNoPrefsSession

The preferences session is not active.

Available in OS X v10.1 and later.

Declared in SystemConfiguration.h.

kSCStatusPrefsBusy

A preferences update is currently in progress.

Available in OS X v10.1 and later.

Declared in SystemConfiguration.h.

kSCStatusNoConfigFile

The configuration file cannot be found.

Available in OS X v10.1 and later.

Declared in SystemConfiguration.h.

kSCStatusNoLink

No such link exists.

Available in OS X v10.1 and later.

Declared in SystemConfiguration.h.

kSCStatusStale

A write was attempted on a stale version of the object.

Available in OS X v10.1 and later.

Declared in SystemConfiguration.h.

kSCStatusMaxLink

The maximum link count is exceeded.

Available in OS X v10.2 and later.

Declared in SystemConfiguration.h.

kSCStatusReachabilityUnknown

Network reachability cannot be determined.

Available in OS X v10.1 and later.

Declared in SystemConfiguration.h.

kSCStatusConnectionNoService

Network service for the connection is not available.

Available in OS X v10.6 and later.

Declared in SystemConfiguration.h.

Error Domain

The error domain associated with errors reported by the System Configuration framework.

const CFStringRef kCFErrorDomainSystemConfiguration;
Constants
kCFErrorDomainSystemConfiguration

A string constant identifying a Core Foundation error domain. See CFError Reference for further information on error domains.

Available in OS X v10.5 and later.

Declared in SystemConfiguration.h.