[all-commits] [llvm/llvm-project] f2a7f8: Introduce getenv to LLVM libc

rtenneti-google via All-commits all-commits at lists.llvm.org
Mon Feb 14 10:10:37 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: f2a7f835958f8bd39314acad3210875e83cad326
      https://github.com/llvm/llvm-project/commit/f2a7f835958f8bd39314acad3210875e83cad326
  Author: Raman Tenneti <rtenneti at google.com>
  Date:   2022-02-14 (Mon, 14 Feb 2022)

  Changed paths:
    M libc/config/linux/app.h
    M libc/config/linux/x86_64/entrypoints.txt
    M libc/loader/linux/x86_64/start.cpp
    M libc/spec/posix.td
    M libc/src/__support/CPP/StringView.h
    M libc/src/stdlib/CMakeLists.txt
    A libc/src/stdlib/getenv.cpp
    A libc/src/stdlib/getenv.h
    M libc/test/loader/linux/CMakeLists.txt
    A libc/test/loader/linux/getenv_test.cpp
    M libc/test/loader/linux/loader_test.h
    M libc/test/src/__support/CPP/stringview_test.cpp

  Log Message:
  -----------
  Introduce getenv to LLVM libc

Add support for getenv as defined by the Open Group's "System Interface &
 Header" in https://pubs.opengroup.org/onlinepubs/7908799/xsh/getenv.html

getenv requires a standard way of accessing the environment,
so a pointer to the environment is added to the startup in crt1.
Consquently, this function is not usable on top of other libcs.

Added starts_with method to StringView. getenv function uses it.

Co-authored-by: Jeff Bailey <jeffbailey at google.com>

Reviewed By: sivachandra, rtenneti

Differential Revision: https://reviews.llvm.org/D119403




More information about the All-commits mailing list