fchdir.c 269 B

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