24 #include "pedigree/kernel/Log.h" 25 #include "pedigree/kernel/compiler.h" 26 #include "pedigree/kernel/process/Semaphore.h" 27 #include "pedigree/kernel/processor/types.h" 28 #include "pedigree/kernel/time/Time.h" 29 #include "pedigree/kernel/utilities/Buffer.h" 30 #include "pedigree/kernel/utilities/String.h" 32 #define PIPE_BUF_MAX 2048 45 FATAL(
"Casting non-pipe/fifo File to Pipe!");
46 return reinterpret_cast<Pipe *
>(pF);
61 const String &name, Time::Timestamp accessedTime,
62 Time::Timestamp modifiedTime, Time::Timestamp creationTime,
63 uintptr_t inode,
class Filesystem *pFs,
size_t size,
File *pParent,
64 bool bIsAnonymous =
false);
69 virtual int select(
bool bWriting =
false,
int timeout = 0);
73 uint64_t location, uint64_t size, uintptr_t buffer,
74 bool bCanBlock =
true);
77 uint64_t location, uint64_t size, uintptr_t buffer,
78 bool bCanBlock =
true);
81 virtual bool isPipe()
const;
83 virtual bool isFifo()
const;
85 virtual void increaseRefCount(
bool bIsWriter);
89 virtual void decreaseRefCount(
bool bIsWriter);
91 size_t getReaderCount()
const 96 size_t getWriterCount()
const 102 bool waitForReader();
virtual bool isFifo() const
virtual bool isBytewise() const
virtual int select(bool bWriting=false, int timeout=0)
virtual uint64_t readBytewise(uint64_t location, uint64_t size, uintptr_t buffer, bool bCanBlock=true)
Buffer< uint8_t > m_Buffer
virtual bool isPipe() const
virtual uint64_t writeBytewise(uint64_t location, uint64_t size, uintptr_t buffer, bool bCanBlock=true)
static Pipe * fromFile(File *pF)