mirror of
https://git.busybox.net/busybox.git
synced 2024-11-28 08:03:28 +08:00
20 lines
328 B
C
20 lines
328 B
C
#include "internal.h"
|
|
#include <stdio.h>
|
|
#include <dirent.h>
|
|
|
|
const char pwd_usage[] = "Print the current directory.\n";
|
|
|
|
extern int
|
|
pwd_main(int argc, char * * argv)
|
|
{
|
|
char buf[NAME_MAX];
|
|
|
|
if ( getcwd(buf, sizeof(buf)) == NULL ) {
|
|
perror("get working directory");
|
|
exit( FALSE);
|
|
}
|
|
|
|
printf("%s\n", buf);
|
|
exit( TRUE);
|
|
}
|