mirror of
https://github.com/proot-me/proot.git
synced 2025-08-28 16:43:49 +02:00
22 lines
395 B
C
22 lines
395 B
C
#include <unistd.h> /* syscall(2), */
|
|
#include <stdio.h> /* perror(3), */
|
|
#include <limits.h> /* PATH_MAX, */
|
|
#include <stdlib.h> /* exit(3), */
|
|
#include <sys/syscall.h> /* SYS_getcwd, */
|
|
|
|
|
|
int main(void)
|
|
{
|
|
char path[PATH_MAX];
|
|
int status;
|
|
|
|
status = syscall(SYS_getcwd, path, PATH_MAX);
|
|
if (status < 0) {
|
|
perror("getcwd()");
|
|
exit(EXIT_FAILURE);
|
|
}
|
|
|
|
puts(path);
|
|
|
|
exit(EXIT_SUCCESS);
|
|
}
|