*
*/
-#include "internal.h"
#include <stdio.h>
#include <dirent.h>
-#include <sys/param.h>
+#include <errno.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include "busybox.h"
extern int pwd_main(int argc, char **argv)
{
- char buf[PATH_MAX + 1];
+ char buf[BUFSIZ + 1];
- if (getcwd(buf, sizeof(buf)) == NULL) {
- perror("get working directory");
- exit(FALSE);
- }
+ if (getcwd(buf, sizeof(buf)) == NULL)
+ perror_msg_and_die("getcwd");
- printf("%s\n", buf);
- exit(TRUE);
+ puts(buf);
+ return EXIT_SUCCESS;
}