1 #include "ace/IO_SAP.h"
3 #include "ace/Log_Category.h"
4 #include "ace/OS_NS_unistd.h"
5 #include "ace/OS_NS_errno.h"
6 #include "ace/OS_NS_fcntl.h"
7 #include "ace/os_include/os_signal.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/IO_SAP.inl"
14 #endif /* __ACE_INLINE__ */
16 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
18 ACE_ALLOC_HOOK_DEFINE(ACE_IO_SAP
)
20 // This is the do-nothing constructor. It does not perform a
21 // ACE_OS::open system call.
23 ACE_IO_SAP::ACE_IO_SAP ()
24 : handle_ (ACE_INVALID_HANDLE
)
26 ACE_TRACE ("ACE_IO_SAP::ACE_IO_SAP");
30 ACE_IO_SAP::dump () const
32 #if defined (ACE_HAS_DUMP)
33 ACE_TRACE ("ACE_IO_SAP::dump");
35 ACELIB_DEBUG ((LM_DEBUG
, ACE_BEGIN_DUMP
, this));
36 ACELIB_DEBUG ((LM_DEBUG
, ACE_TEXT ("handle_ = %d"), this->handle_
));
37 ACELIB_DEBUG ((LM_DEBUG
, ACE_END_DUMP
));
38 #endif /* ACE_HAS_DUMP */
42 ACE_IO_SAP::enable (int value
) const
44 ACE_TRACE ("ACE_IO_SAP::enable");
51 #if defined (F_SETOWN)
52 return ACE_OS::fcntl (this->handle_
,
56 ACE_NOTSUP_RETURN (-1);
62 #if defined (F_SETOWN) && defined (FASYNC)
63 if (ACE_OS::fcntl (this->handle_
,
65 ACE_OS::getpid ()) == -1
66 || ACE::set_flags (this->handle_
,
71 ACE_NOTSUP_RETURN (-1);
72 #endif /* F_SETOWN && FASYNC */
74 ACE_NOTSUP_RETURN (-1);
75 #endif /* SIGIO <== */
77 if (ACE::set_flags (this->handle_
,
89 ACE_IO_SAP::disable (int value
) const
91 ACE_TRACE ("ACE_IO_SAP::disable");
98 #if defined (F_SETOWN)
99 if (ACE_OS::fcntl (this->handle_
,
104 ACE_NOTSUP_RETURN (-1);
105 #endif /* F_SETOWN */
110 #if defined (F_SETOWN) && defined (FASYNC)
111 if (ACE_OS::fcntl (this->handle_
,
114 || ACE::clr_flags (this->handle_
, FASYNC
) == -1)
118 ACE_NOTSUP_RETURN (-1);
119 #endif /* F_SETOWN && FASYNC */
121 ACE_NOTSUP_RETURN (-1);
122 #endif /* SIGIO <== */
124 if (ACE::clr_flags (this->handle_
,
134 ACE_END_VERSIONED_NAMESPACE_DECL