diff --git a/dataplane/standalone/port.cc b/dataplane/standalone/port.cc index 27f3fb89..ea828531 100644 --- a/dataplane/standalone/port.cc +++ b/dataplane/standalone/port.cc @@ -20,6 +20,7 @@ #include #include #include +#include #include "absl/strings/str_split.h" #include "dataplane/standalone/translator.h" @@ -50,7 +51,9 @@ sai_status_t Port::create(_In_ uint32_t attr_count, break; } } - bool exists = std::experimental::filesystem::exists("/sys/class/net/" + name); + std::string filename("/sys/class/net/" + name); + struct stat buffer; + bool exists = stat(filename.c_str(), &buffer) == 0; // TODO(dgrau): Figure out what to do with these ports. if (type != SAI_PORT_TYPE_CPU && !exists) {