{
internal static partial class Sys
{
- [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_FStat2", SetLastError = true)]
+ [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_FStat", SetLastError = true)]
internal static extern int FStat(SafePipeHandle fd, out FileStatus output);
}
}
// without putting too much pressure on the stack.
private const int StackBufferSize = 256;
- [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Stat2", SetLastError = true)]
+ [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Stat", SetLastError = true)]
internal unsafe static extern int Stat(ref byte path, out FileStatus output);
internal unsafe static int Stat(ReadOnlySpan<char> path, out FileStatus output)
return result;
}
- [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_LStat2", SetLastError = true)]
+ [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_LStat", SetLastError = true)]
internal static extern int LStat(ref byte path, out FileStatus output);
internal unsafe static int LStat(ReadOnlySpan<char> path, out FileStatus output)
#endif
}
-// CoreCLR expects the "2" suffixes on these: they should be cleaned up in our
-// next coordinated System.Native changes
-int32_t SystemNative_Stat2(const char* path, FileStatus* output)
+int32_t SystemNative_Stat(const char* path, FileStatus* output)
{
struct stat_ result;
int ret;
return ret;
}
-int32_t SystemNative_FStat2(intptr_t fd, FileStatus* output)
+int32_t SystemNative_FStat(intptr_t fd, FileStatus* output)
{
struct stat_ result;
int ret;
return ret;
}
-int32_t SystemNative_LStat2(const char* path, FileStatus* output)
+int32_t SystemNative_LStat(const char* path, FileStatus* output)
{
struct stat_ result;
int ret = lstat_(path, &result);
return ret;
}
+// These "2" suffix functions are pending removal
+int32_t SystemNative_Stat2(const char* path, FileStatus* output)
+{
+ return SystemNative_Stat(path, output);
+}
+
+int32_t SystemNative_FStat2(intptr_t fd, FileStatus* output)
+{
+ return SystemNative_FStat(fd, output);
+}
+
+int32_t SystemNative_LStat2(const char* path, FileStatus* output)
+{
+ return SystemNative_LStat(path, output);
+}
+
static int32_t ConvertOpenFlags(int32_t flags)
{
int32_t ret;
*
* Returns 0 for success, -1 for failure. Sets errno on failure.
*/
+DLLEXPORT int32_t SystemNative_FStat(intptr_t fd, FileStatus* output);
+
+/**
+ * Get file status from a full path. Implemented as shim to stat(2).
+ *
+ * Returns 0 for success, -1 for failure. Sets errno on failure.
+ */
+DLLEXPORT int32_t SystemNative_Stat(const char* path, FileStatus* output);
+
+/**
+ * Get file stats from a full path. Implemented as shim to lstat(2).
+ *
+ * Returns 0 for success, -1 for failure. Sets errno on failure.
+ */
+DLLEXPORT int32_t SystemNative_LStat(const char* path, FileStatus* output);
+
+/**
+ * Get file status from a descriptor. Implemented as shim to fstat(2).
+ *
+ * Returns 0 for success, -1 for failure. Sets errno on failure.
+ */
DLLEXPORT int32_t SystemNative_FStat2(intptr_t fd, FileStatus* output);
/**