summaryrefslogtreecommitdiff
path: root/ace/CLASSIX/Group_Stamp.cpp
blob: 990c5a05463313cb0994ba3c02bc4fccf5e8da32 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/* -*- C++ -*- */
// $Id$

// ============================================================================
//
// = LIBRARY
//     ACE
// 
// = FILENAME
//     CLASSIX/Group_Stamp.cpp
//
// = AUTHOR(S)
//     Wei Chiang
// 
// = COPYRIGHT
//     Copyright 1998 Nokia Telecommunications
//
// ============================================================================

#include "CLASSIX/Group_Stamp.h"

#if !defined (__ACE_INLINE__)
#include "CLASSIX/Group_Stamp.i"
#endif /* __ACE_INLINE__ */
/* ------------------------------------------------------------------------- */
void
ACE_CLASSIX_Group_Stamp::set_addr(void* theStamp, int)
{
    // Get the group capability
    this->stamp_ = *((u_int*)theStamp);
    KnActorPrivilege     actor;
    actorPrivilege(K_MYACTOR, &actor, NULL);
    if (::grpAllocate((actor == K_SUPACTOR) ?  K_STATSYS : K_STATUSER,
		      &this->addr_.group_, 
		      this->stamp_) < 0 )
    {
	ACE_DEBUG((LM_DEBUG, "ACE_CLASSIX_Group_Stamp()::"
		   "group allocation failed\n"));
	this->init_();
	this->stamp_ = ACE_CLASSIX_Group_Stamp::ILLEGAL_STAMP;
    }
    else
    {
	this->set_config_();
    }
}

void
ACE_CLASSIX_Group_Stamp::dump(void) const
{
  ACE_DEBUG ((LM_DEBUG, "ACE_CLASSIX_Group_Stamp...\n"));
  ACE_DEBUG ((LM_DEBUG, "\nStamp = %d\n", this->get_stamp()));
  this->ACE_CLASSIX_Group::dump();
  ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP));    
}