【问题标题】:secure_getenv() on macOSmacOS 上的secure_getenv()
【发布时间】:2018-11-23 13:51:59
【问题描述】:

为什么secure_getenv() 只能在我的 GNU/Linux 系统上运行,而不能在 macOS 上运行? 在那里编译它会导致以下错误:

main.cpp:31:26: error: use of undeclared identifier 'secure_getenv'
    char* env_custom_path = secure_getenv("MY_ENV_VAR");

为什么会这样?

【问题讨论】:

    标签: c++ macos clang darwin


    【解决方案1】:

    来自this manual page

    GNU 特定 secure_getenv() 函数

    [强调我的]

    它不是标准功能,因此在 macOS 上根本不可用。

    【讨论】:

      猜你喜欢
      • 2017-06-10
      • 2014-04-11
      • 1970-01-01
      • 1970-01-01
      • 2020-04-11
      • 2017-03-31
      • 2020-04-07
      • 2019-11-13
      • 2017-06-28
      相关资源
      最近更新 更多