pwd.c 414 B

12345678910111213141516171819
  1. /* vim: tabstop=4 shiftwidth=4 noexpandtab
  2. * This file is part of ToaruOS and is released under the terms
  3. * of the NCSA / University of Illinois License - see LICENSE.md
  4. * Copyright (C) 2018 K. Lange
  5. *
  6. * pwd - Print working directory
  7. */
  8. #include <unistd.h>
  9. #include <stdio.h>
  10. int main(int argc, char * argv[]) {
  11. char tmp[1024];
  12. if (getcwd(tmp, 1023)) {
  13. puts(tmp);
  14. return 0;
  15. } else {
  16. return 1;
  17. }
  18. }