24 #include <sys/types.h>
41 const int res = mkfifo(path.c_str(),0660);
43 std::cerr <<
"could not make fifo at '" << path <<
"' (" << errno <<
")\n";
46 fd_ = open(path.c_str(),O_RDONLY|O_NONBLOCK);
49 std::cerr <<
"failed to open fifo at '" << path <<
"' (" << errno <<
")\n";
51 std::cerr <<
"opened fifo at '" << path <<
"'. Server commands may be written to this file.\n";
68 unlink(
path_.c_str());
81 const size_t block_size = 4096;
82 char block[block_size];
84 const size_t nbytes =
read(
fd_,block,block_size);
85 if (nbytes == static_cast<size_t>(-1)) {
88 std::copy(block,block+nbytes,std::back_inserter(
data_));
91 if(itor !=
data_.end()) {
92 str.resize(itor -
data_.begin());
93 std::copy(
data_.begin(),
itor,str.begin());
GLsizei const char ** path
static void block(LexState *ls)
std::map< std::string, tfilter >::iterator itor
void read(config &cfg, std::istream &in, abstract_validator *validator)
bool find(E event, F functor)
Tests whether an event handler is available.
GLsizei const GLcharARB ** string