mirror of
https://github.com/facebook/sapling.git
synced 2024-10-10 00:45:18 +03:00
624c185094
Summary: This commit introduces a few types from the watchman codebase: `FileDescriptor` which is on posix systems represents a file descriptor, and on Windows is a HANDLE (which can be a file, pipe or socket descriptor). `Pipe` is a convenience struct that holds the read and write ends of a Pipe. Note that we have a conceptual class with a windows specific Pipe type under eden/fs/win/utils/Pipe.h; I remove that in the next diff in the stack. There are a couple of differences from the watchman code Reviewed By: chadaustin Differential Revision: D23287819 fbshipit-source-id: 6ca90ba345037c6c3e308f588d690a899c9866a5
30 lines
548 B
C++
30 lines
548 B
C++
/*
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
*
|
|
* This software may be used and distributed according to the terms of the
|
|
* GNU General Public License version 2.
|
|
*/
|
|
|
|
#pragma once
|
|
#include "eden/fs/utils/FileDescriptor.h"
|
|
|
|
namespace facebook {
|
|
namespace eden {
|
|
|
|
struct Pipe {
|
|
FileDescriptor read;
|
|
FileDescriptor write;
|
|
|
|
explicit Pipe(bool nonBlocking = false);
|
|
};
|
|
|
|
struct SocketPair {
|
|
FileDescriptor read;
|
|
FileDescriptor write;
|
|
|
|
explicit SocketPair(bool nonBlocking = false);
|
|
};
|
|
|
|
} // namespace eden
|
|
} // namespace facebook
|