env.c 382 B

1234567891011121314151617181920
  1. /*
  2. * Copyright (c) 2006-2021, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2010-11-17 Bernard first version
  9. */
  10. #include <stdio.h>
  11. #include <stdlib.h>
  12. int libc_env()
  13. {
  14. printf("PATH=%s\n", getenv("PATH"));
  15. putenv("foo=bar");
  16. printf("foo=%s\n", getenv("foo"));
  17. return 0;
  18. }