Allow SSLSessionCallbacks to be used on SSL* that isn't attached to AsyncSSLSocket
[folly.git] / folly / File.cpp
index 379efe62eb0c650c5d06b82650635594240f4e1d..3c53573355fc6a9d2dec13e50d36a323d83680e2 100644 (file)
@@ -18,6 +18,7 @@
 
 #include <fcntl.h>
 #include <unistd.h>
+#include <sys/file.h>
 
 #include <folly/Exception.h>
 #include <folly/FileUtil.h>
@@ -52,6 +53,12 @@ File::File(const char* name, int flags, mode_t mode)
   ownsFd_ = true;
 }
 
+File::File(const std::string& name, int flags, mode_t mode)
+  : File(name.c_str(), flags, mode) {}
+
+File::File(StringPiece name, int flags, mode_t mode)
+  : File(name.str(), flags, mode) {}
+
 File::File(File&& other) noexcept
   : fd_(other.fd_)
   , ownsFd_(other.ownsFd_) {