aboutsummaryrefslogtreecommitdiff
path: root/src/fifo.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/fifo.cpp')
-rw-r--r--src/fifo.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/fifo.cpp b/src/fifo.cpp
index 1bbab37..eaf1705 100644
--- a/src/fifo.cpp
+++ b/src/fifo.cpp
@@ -12,6 +12,8 @@
12#include <fcntl.h> 12#include <fcntl.h>
13#include <unistd.h> 13#include <unistd.h>
14 14
15#include "win32_compatibility.h"
16
15namespace Bu { subExceptionDef( FifoException ) } 17namespace Bu { subExceptionDef( FifoException ) }
16 18
17Bu::Fifo::Fifo( const Bu::FString &sName, int iFlags, mode_t mAcc ) : 19Bu::Fifo::Fifo( const Bu::FString &sName, int iFlags, mode_t mAcc ) :
@@ -19,6 +21,7 @@ Bu::Fifo::Fifo( const Bu::FString &sName, int iFlags, mode_t mAcc ) :
19 iIn( -1 ), 21 iIn( -1 ),
20 iOut( -1 ) 22 iOut( -1 )
21{ 23{
24#ifndef WIN32
22 if( iFlags&Create ) 25 if( iFlags&Create )
23 { 26 {
24 if( mkfifo( sName.getStr(), mAcc ) ) 27 if( mkfifo( sName.getStr(), mAcc ) )
@@ -40,6 +43,9 @@ Bu::Fifo::Fifo( const Bu::FString &sName, int iFlags, mode_t mAcc ) :
40 O_WRONLY 43 O_WRONLY
41 ); 44 );
42 } 45 }
46#else
47 #warning Bu::Fifo::Fifo IS A STUB for WIN32!!!!
48#endif
43} 49}
44 50
45Bu::Fifo::~Fifo() 51Bu::Fifo::~Fifo()
@@ -126,15 +132,23 @@ bool Bu::Fifo::isSeekable()
126 132
127bool Bu::Fifo::isBlocking() 133bool Bu::Fifo::isBlocking()
128{ 134{
135#ifndef WIN32
129 return ((fcntl( iIn, F_GETFL, 0 )&O_NONBLOCK) == O_NONBLOCK); 136 return ((fcntl( iIn, F_GETFL, 0 )&O_NONBLOCK) == O_NONBLOCK);
137#else
138 #warning Bu::Fifo::isBlocking IS A STUB for WIN32!!!!
139#endif
130} 140}
131 141
132void Bu::Fifo::setBlocking( bool bBlocking ) 142void Bu::Fifo::setBlocking( bool bBlocking )
133{ 143{
144#ifndef WIN32
134 if( bBlocking ) 145 if( bBlocking )
135 fcntl( iIn, F_SETFL, fcntl( iIn, F_GETFL, 0 )&(~O_NONBLOCK) ); 146 fcntl( iIn, F_SETFL, fcntl( iIn, F_GETFL, 0 )&(~O_NONBLOCK) );
136 else 147 else
137 fcntl( iIn, F_SETFL, fcntl( iIn, F_GETFL, 0 )|O_NONBLOCK ); 148 fcntl( iIn, F_SETFL, fcntl( iIn, F_GETFL, 0 )|O_NONBLOCK );
149#else
150 #warning Bu::Fifo::setBlocking IS A STUB for WIN32!!!!
151#endif
138} 152}
139 153
140void Bu::Fifo::flush() 154void Bu::Fifo::flush()