[Lldb-commits] [lldb] [lldb] split NativeFile in platform specific implementations (PR #196293)

Jonas Devlieghere via lldb-commits lldb-commits at lists.llvm.org
Thu May 7 10:03:15 PDT 2026


================
@@ -562,21 +448,11 @@ Status NativeFile::Flush() {
   return error;
 }
 
-Status NativeFile::Sync() {
-  Status error;
-  if (ValueGuard descriptor_guard = DescriptorIsValid()) {
-#ifdef _WIN32
-    int err = FlushFileBuffers((HANDLE)_get_osfhandle(m_descriptor));
-    if (err == 0)
-      error = Status::FromErrorString("unknown error");
-#else
-    if (llvm::sys::RetryAfterSignal(-1, ::fsync, m_descriptor) == -1)
-      error = Status::FromErrno();
-#endif
-  } else {
-    error = Status::FromErrorString("invalid file handle");
-  }
-  return error;
+Status NativeFileBase::Sync() {
----------------
JDevlieghere wrote:

Can we make this, `Read` and `Write` pure virtual? Or make the `NativeFileBase` constructor protected?

https://github.com/llvm/llvm-project/pull/196293


More information about the lldb-commits mailing list