beautypg.com

Figure 5-9 – ADIC Server User Manual

Page 184

background image

5-12

DAS ACI 3.0 Asynchronous Support Layer

601626-B

Figure 5-9

Example of an aci_async_add Function

. . .

/*

* sadmin sample application, dasadmin.c file

* aci_async.h, ACI_INSERT macro

*/

aci_async_entry *async_entry;

if ((async_entry = aci_async_add(

DAS_INSERT,

insert_area,

volser_ranges,

type ) ) != 0)

{

if ((async_entry->pid = fork()) == 0)

{

/* map the current process virtual memory to the

shared buffer */

if ((int)(async_table =

(void*)shmat(async_table_desc, 0, 0)) == -1)

{

d_errno = ENOSHARED;

strcpy(d_text, "shmat failed");

}

res = aci_insert(insert_area, volser_ranges, type);

async_entry->d_errno = d_errno;

strcpy(async_entry->d_text, d_text);

shmdt(async_table);

exit(res);

}

}

. . .