
Путь: Toys/Other, команды версии: Ver.4 Ver.9 pwdx Комментарии в файле pwdx.c :
Исходный текст в файле pwdx.c #include "toys.h"
void pwdx_main(void)
{
char **optargs;
for (optargs = toys.optargs; *optargs; optargs++) {
char *path = toybuf;
sprintf(toybuf, "/proc/%d/cwd", atoi(*optargs));
if (!readlink0(path, toybuf, sizeof(toybuf))) {
path = strerror(errno);
toys.exitval = 1;
}
xprintf("%s: %s\n", *optargs, path);
}
} |
![]() |