ALSA project - the C library reference
Loading...
Searching...
No Matches
shmarea.c File Reference

shared memory helpers More...

Functions

struct snd_shm_area * snd_shm_area_create (int shmid, void *ptr)
 Create a shm area record.
 
struct snd_shm_area * snd_shm_area_share (struct snd_shm_area *area)
 Increase the reference counter of shm area record.
 
int snd_shm_area_destroy (struct snd_shm_area *area)
 Release the shared area record.
 

Detailed Description

shared memory helpers

Author
Jaroslav Kysela perex.nosp@m.@per.nosp@m.ex.cz
Date
2001

Shared memory helpers

Function Documentation

◆ snd_shm_area_create()

struct snd_shm_area * snd_shm_area_create ( int shmid,
void * ptr )

Create a shm area record.

Parameters
shmidIPC SHM ID
ptrthe shared area pointer
Returns
The allocated shm area record, NULL if fail

Allocates a shared area record with the given SHM ID and pointer. The record has a reference counter, which is initialized to 1 by this function.

◆ snd_shm_area_destroy()

int snd_shm_area_destroy ( struct snd_shm_area * area)

Release the shared area record.

Parameters
areathe shared are record
Returns
0 if successful, or a negative error code

Decreases the reference counter of the given shared area record, and releases the resources automaticall if it reaches to 0.

◆ snd_shm_area_share()

struct snd_shm_area * snd_shm_area_share ( struct snd_shm_area * area)

Increase the reference counter of shm area record.

Parameters
areashm area record
Returns
the shm area record (identical with the argument)

Increases the reference counter of the given shared area record.