1 #include "ace/IPC_SAP.h"
3 #include "ace/Log_Category.h"
4 #include "ace/OS_NS_unistd.h"
5 #include "ace/os_include/os_signal.h"
6 #include "ace/OS_NS_errno.h"
7 #include "ace/OS_NS_fcntl.h"
8 #if defined (ACE_HAS_ALLOC_HOOKS)
9 # include "ace/Malloc_Base.h"
10 #endif /* ACE_HAS_ALLOC_HOOKS */
12 #if !defined (__ACE_INLINE__)
13 #include "ace/IPC_SAP.inl"
14 #endif /* __ACE_INLINE__ */
16 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
18 ACE_ALLOC_HOOK_DEFINE(ACE_IPC_SAP
)
21 ACE_IPC_SAP::dump () const
23 #if defined (ACE_HAS_DUMP)
24 ACE_TRACE ("ACE_IPC_SAP::dump");
26 ACELIB_DEBUG ((LM_DEBUG
, ACE_BEGIN_DUMP
, this));
27 ACELIB_DEBUG ((LM_DEBUG
, ACE_TEXT ("handle_ = %d"), this->handle_
));
28 ACELIB_DEBUG ((LM_DEBUG
, ACE_END_DUMP
));
29 #endif /* ACE_HAS_DUMP */
32 // This is the do-nothing constructor. It does not perform a
33 // ACE_OS::socket system call.
35 ACE_IPC_SAP::ACE_IPC_SAP ()
36 : handle_ (ACE_INVALID_HANDLE
)
38 // ACE_TRACE ("ACE_IPC_SAP::ACE_IPC_SAP");
42 ACE_IPC_SAP::enable (int value
) const
44 ACE_TRACE ("ACE_IPC_SAP::enable");
46 #if defined (ACE_WIN32) || defined (ACE_VXWORKS)
51 // nonblocking argument (1)
54 return ACE_OS::ioctl (this->handle_
,
59 ACE_NOTSUP_RETURN (-1);
61 #else /* ! ACE_WIN32 && ! ACE_VXWORKS */
67 #if defined (F_SETOWN)
68 return ACE_OS::fcntl (this->handle_
,
72 ACE_NOTSUP_RETURN (-1);
78 #if defined (F_SETOWN) && defined (FASYNC)
79 if (ACE_OS::fcntl (this->handle_
,
81 ACE_OS::getpid ()) == -1
82 || ACE::set_flags (this->handle_
,
87 ACE_NOTSUP_RETURN (-1);
88 #endif /* F_SETOWN && FASYNC */
89 #endif /* SIGIO <== */
92 // Enables the close-on-exec flag.
93 if (ACE_OS::fcntl (this->handle_
,
100 if (ACE::set_flags (this->handle_
,
101 ACE_NONBLOCK
) == ACE_INVALID_HANDLE
)
108 #endif /* ! ACE_WIN32 && ! ACE_VXWORKS */
114 ACE_IPC_SAP::disable (int value
) const
116 ACE_TRACE ("ACE_IPC_SAP::disable");
118 #if defined (ACE_WIN32) || defined (ACE_VXWORKS)
122 // nonblocking argument (1)
126 return ACE_OS::ioctl (this->handle_
,
131 ACE_NOTSUP_RETURN (-1);
133 #else /* ! ACE_WIN32 && ! ACE_VXWORKS */
139 #if defined (F_SETOWN)
140 return ACE_OS::fcntl (this->handle_
,
144 ACE_NOTSUP_RETURN (-1);
145 #endif /* F_SETOWN */
150 #if defined (F_SETOWN) && defined (FASYNC)
151 if (ACE_OS::fcntl (this->handle_
,
154 || ACE::clr_flags (this->handle_
,
159 ACE_NOTSUP_RETURN (-1);
160 #endif /* F_SETOWN && FASYNC */
161 #endif /* SIGIO <== */
162 #if defined (F_SETFD)
164 // Disables the close-on-exec flag.
165 if (ACE_OS::fcntl (this->handle_
,
172 if (ACE::clr_flags (this->handle_
,
180 #endif /* ! ACE_WIN32 && ! ACE_VXWORKS */
184 ACE_END_VERSIONED_NAMESPACE_DECL