|
|
|
@ -15,13 +15,12 @@ limitations under the License. */
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
#include <unistd.h>
|
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
|
|
#include "paddle/platform/enforce.h"
|
|
|
|
|
#include "paddle/string/piece.h"
|
|
|
|
|
|
|
|
|
|
extern char** environ;
|
|
|
|
|
|
|
|
|
|
namespace paddle {
|
|
|
|
|
namespace platform {
|
|
|
|
|
|
|
|
|
@ -46,6 +45,7 @@ inline std::string GetEnvValue(const std::string& name) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
inline std::vector<std::string> GetAllEnvVariables() {
|
|
|
|
|
extern char** environ;
|
|
|
|
|
std::vector<std::string> vars;
|
|
|
|
|
for (auto var = environ; *var != nullptr; ++var) {
|
|
|
|
|
auto tail = string::Index(*var, "=");
|
|
|
|
|