Skip to content

Commit 0f7bdf2

Browse files
committed
Move the declaration of create_file_from_fd to linux/file.h
1 parent 5f70faa commit 0f7bdf2

File tree

4 files changed

+5
-4
lines changed

4 files changed

+5
-4
lines changed

libc/src/__support/File/file.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -304,8 +304,6 @@ class File {
304304
// library.
305305
ErrorOr<File *> openfile(const char *path, const char *mode);
306306

307-
ErrorOr<File *> create_file_from_fd(int fd, const char *mode);
308-
309307
// The platform_file library should implement it if it relevant for that
310308
// platform.
311309
int get_fileno(File *f);

libc/src/__support/File/linux/file.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ ErrorOr<File *> openfile(const char *path, const char *mode) {
119119
return file;
120120
}
121121

122-
ErrorOr<File *> create_file_from_fd(int fd, const char *mode) {
122+
ErrorOr<LinuxFile *> create_file_from_fd(int fd, const char *mode) {
123123
using ModeFlags = File::ModeFlags;
124124
ModeFlags modeflags = File::mode_flags(mode);
125125
if (modeflags == 0) {

libc/src/__support/File/linux/file.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,7 @@ class LinuxFile : public File {
2929
int get_fd() const { return fd; }
3030
};
3131

32+
// Create a File object and associate it with a fd.
33+
ErrorOr<LinuxFile *> create_file_from_fd(int fd, const char *mode);
34+
3235
} // namespace LIBC_NAMESPACE

libc/src/stdio/linux/fdopen.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
#include "src/stdio/fdopen.h"
1010

11-
#include "src/__support/File/file.h"
11+
#include "src/__support/File/linux/file.h"
1212
#include "src/errno/libc_errno.h"
1313

1414
namespace LIBC_NAMESPACE {

0 commit comments

Comments
 (0)