toaruos/apps/pwd.c

21 lines
402 B
C
Raw Permalink Normal View History

/**
* @brief Print the current working directory
*
* @copyright
2018-08-15 04:07:33 +03:00
* This file is part of ToaruOS and is released under the terms
2018-08-02 08:10:46 +03:00
* of the NCSA / University of Illinois License - see LICENSE.md
* Copyright (C) 2018 K. Lange
*/
#include <unistd.h>
#include <stdio.h>
int main(int argc, char * argv[]) {
char tmp[1024];
if (getcwd(tmp, 1023)) {
puts(tmp);
return 0;
} else {
return 1;
}
}