Add BufferedFile::fileno.

This commit is contained in:
Victor Zverovich
2014-05-06 06:45:53 -07:00
parent d286efd3d2
commit fb4ccac951
3 changed files with 51 additions and 33 deletions
+7
View File
@@ -65,6 +65,13 @@ void BufferedFile::close() {
fmt::ThrowSystemError(errno, "cannot close file");
}
int BufferedFile::fileno() const {
int fd = ::FMT_POSIX(fileno(file_));
if (fd == -1)
fmt::ThrowSystemError(errno, "cannot get file descriptor");
return fd;
}
File::File(const char *path, int oflag) {
int mode = S_IRUSR | S_IWUSR;
#ifdef _WIN32