NAME

IPC::SysV::SemDS - Class to hold semaphore id data structures

SYNOPSIS

require IPC::SysV::SemDS;

use IPC::SysV qw(IPC_STAT IPC_SET);
semctl($sid,0,IPC_STAT,$semid_ds);

$semds_obj = IPC::SysV::SemDS->new($semid_ds);
$semds_obj->perm_mode();
$semds_obj->perm_gid();
$semds_obj->perm_uid();
$semds_obj->perm_cuid();
$semds_obj->perm_cgid();
$semds_obj->ctime();
$semds_obj->otime();
$semds_obj->nsems();
$semds_obj->mode();
$semds_obj->set_uid_gid_mode($uid, $gid, $mode);
msgctl($qid,0,IPC_SET,$semds_obj->repack());

DESCRIPTION

This package provides an interface to a semaphore id data structure (SEMID_DS).

Given a string holding a SEMID_DS array ($semid_ds, for example as obtained with 'semctl($sid,0,IPC_STAT,$semid_ds)') you can get the object with

$semds_obj = IPC::SysV::SemDS->new($semid_ds);

This object holds the individual parts of the data structure, and has the following access methods to access the items returned by IPC::SysV::sem_unpack_semid_ds().

$semds_obj->perm_mode();
$semds_obj->perm_gid();
$semds_obj->perm_uid();
$semds_obj->perm_cuid();
$semds_obj->perm_cgid();
$semds_obj->ctime();
$semds_obj->otime();
$semds_obj->nsems();

In addition, one other access method, 'mode', accesses the perm_mode in a string readable format ('RW-RW-RW-').

$semds_obj->mode()

One updating method is available, 'set_uid_gid_mode' which takes three arguments, the UID, GID, and MODE, to update the parts perm_uid, perm_gid, and perm_mode respectively. Any of these can be undef, in which case the corresponding value is not altered. The perm_mode argument can be numeric or in 'RW-RW-RW-' format.

$semid_ds_obj->set_uid_gid_mode(UID,GID,MODE)

Finally, you can retrieve the packed object for the current state of the object with the repack method,

$semid_ds_obj->repack()

This is useful to reset values.

Jack Shirazi

This program is free software; you can redistribute it and/or
modify it under the same terms as Perl itself.
Version 1.0

Base version.

3 POD Errors

The following errors were encountered while parsing the POD:

Around line 118:

Unknown directive: =AUTHOR

Around line 125:

Unknown directive: =MODIFICATION

Around line 127:

'=item' outside of any '=over'

=over without closing =back