================
@@ -21,21 +23,28 @@ namespace lldb_dap {
/// The file is destroyed when the destructor is invoked.
struct FifoFile {
FifoFile(llvm::StringRef path);
+ FifoFile(llvm::StringRef path, FILE *f);
+ FifoFile(FifoFile &&other);
+
+ FifoFile(const FifoFile &) = delete;
+ FifoFile &operator=(const FifoFile &) = delete;
~FifoFile();
std::string m_path;
+ FILE *m_file;
};
-/// Create a fifo file in the filesystem.
+/// Create and open a named pipe with a unique name.
///
-/// \param[in] path
-/// The path for the fifo file.
+/// The arguments have identical meanings to those of
+/// llvm::sys::fs::createTemporaryFile.
///
-/// \return
-/// A \a std::shared_ptr<FifoFile> if the file could be created, or an
-/// \a llvm::Error in case of failures.
-llvm::Expected<std::shared_ptr<FifoFile>> CreateFifoFile(llvm::StringRef path);
+/// Note that the resulting filename is further prepended by \c
\\.\pipe\\LOCAL\
+/// on Windows and \c /tmp on other platforms.
+std::error_code createUniqueNamedPipe(const llvm::Twine &prefix,
----------------
SuibianP wrote:
Changed.
https://github.com/llvm/llvm-project/pull/121269
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits