diff --git a/posixunix.scm b/posixunix.scm
index 3e578d9..eeed8ac 100644
a
|
b
|
static C_TLS struct stat C_statbuf; |
143 | 143 | |
144 | 144 | #define C_mkdir(str) C_fix(mkdir(C_c_string(str), S_IRWXU | S_IRWXG | S_IRWXO)) |
145 | 145 | #define C_chdir(str) C_fix(chdir(C_c_string(str))) |
| 146 | #define C_fchdir(fd) C_fix(fchdir(C_unfix(fd))) |
146 | 147 | #define C_rmdir(str) C_fix(rmdir(C_c_string(str))) |
147 | 148 | |
148 | 149 | #define C_opendir(x,h) C_set_block_item(h, 0, (C_word) opendir(C_c_string(x))) |
… |
… |
EOF |
768 | 769 | (posix-error #:file-error 'change-directory "cannot change current directory" name) ) |
769 | 770 | name))) |
770 | 771 | |
| 772 | (define change-directory/fd |
| 773 | (lambda (fd) |
| 774 | (##sys#check-exact fd 'change-directory/fd) |
| 775 | (unless (fx= 0 (##core#inline "C_fchdir" fd)) |
| 776 | (posix-error #:file-error 'change-directory/fd "cannot change current directory" fd) ) |
| 777 | fd)) |
| 778 | |
771 | 779 | |
772 | 780 | ;;; Pipes: |
773 | 781 | |