DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
SVR5

cm_begin_trans(D3)


cm_begin_trans -- begin a resource manager transaction

Synopsis

   #include <sys/types.h>
   #include <sys/confmgr.h>
   #include <sys/ddi.h>
   

void cm_begin_trans(rm_key_t key, int mode);

Description

cm_begin_trans( ) begins a resource manager transaction on the specified record. For read/write transactions, cm_begin_trans( ) blocks until no other transaction is pending on the same record. In some implementations, cm_begin_trans( ) may serialize all transactions, regardless of which record they use, so drivers must not begin a transaction while another transaction is pending.

Arguments


key
identifies the resource manager record to be accessed

mode
specifies the type of access. Valid values are:

RM_RDWR
read/write transaction

RM_READ
read-only transaction.

Return values

None

Usage

All accesses to the resource manager database through functions such as cm_addval(D3), cm_delval(D3), and cm_getval(D3) must be part of a resource manager transaction. This allows complex queries and update to be performed automically.

Transactions should be kept as short as possible; holding a transaction for a long period of time can seriously degrade system performance.

Context and synchronization

User or blockable context.

Hardware applicability

All

Version applicability

ddi: 8, 8mp

Differences between versions

In DDI versions prior to version 8, cm_begin_trans(D3) and cm_end_trans(D3) are not supported. Calls to functions that access the resource manager database are only atomic with respect to other simultaneous resource manager database accesses.

References

config(D2), cm_args(D4), cm_params(D5)

cm_abort_trans(D3), cm_addval(D3), cm_end_trans(D3), cm_delkey(D3), cm_delval(D3), cm_newkey(D3), cm_read_devconfig(D3), cm_read_devconfig8(D3), cm_read_devconfig16(D3), cm_read_devconfig32(D3), cm_write_devconfig(D3), cm_write_devconfig8(D3), cm_write_devconfig16(D3), cm_write_devconfig32(D3)

``Hotplug devices'' in HDK Technical Reference
``Autoconfiguration'' in HDK Technical Reference

Examples

See the "Examples" section of the cm_getval(D3) manual page for a code example of this function.
19 June 2005
© 2005 The SCO Group, Inc. All rights reserved.
OpenServer 6 and UnixWare (SVR5) HDK - June 2005