8#include "daq/slc/system/Fifo.h"
10#include <daq/slc/base/IOException.h>
20Fifo Fifo::mkfifo(
const std::string& path)
22 ::mkfifo(path.c_str(), 0666);
24 fifo.open(path.c_str());
28void Fifo::open(
const std::string& path,
const std::string& mode_s)
31 if (mode_s.find(
"w") != std::string::npos) {
33 if (mode_s.find(
"r") != std::string::npos) {
37 if ((m_fd = ::open(path.c_str(), mode)) < 0) {
43void Fifo::unlink(
const std::string& path)
45 if ((::unlink(path.c_str())) < 0) {
51size_t Fifo::write(
const void* buf,
size_t count)
53 return ::write(m_fd, buf, count);
56size_t Fifo::read(
void* buf,
size_t count)
58 return ::read(m_fd, buf, count);
Abstract base class for different kinds of events.