fchdir.c 238 B

123456789101112
  1. #include <unistd.h>
  2. #include <fcntl.h>
  3. #include <stdio.h>
  4. int main(void) {
  5. int fd = open("..", 0, 0);
  6. int status;
  7. status = fchdir(fd);
  8. printf("fchdir exited with status code %d\n", status);
  9. close(fd);
  10. return 0;
  11. }