This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cmake_minimum_required(VERSION 3.18) | |
project(fifo) | |
set(CMAKE_CXX_STANDARD 11) | |
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread") | |
find_package(Boost 1.74.0 COMPONENTS iostreams system) | |
include_directories(${Boost_INCLUDE_DIR}) | |
add_executable(fifo fifo.cpp) | |
target_link_libraries(fifo ${Boost_LIBRARIES}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <boost/iostreams/device/file_descriptor.hpp> | |
#include <boost/iostreams/stream.hpp> | |
#include <boost/asio.hpp> | |
#include <iostream> | |
void read_pipe() | |
{ | |
int fifo_d; | |
boost::asio::io_service io_service; | |
std::vector<uint8_t> buffer(10); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
int main() { | |
std::cout << "Hello World!" << std::endl; | |
return 0; | |
} |