Newsgroups: fj.sys.sun
Path: galaxy.trc.rwcp.or.jp!coconuts.jaist!wnoc-tyo-news!aist-nara!odins-suita!chiba-ns!news.chiba-u.ac.jp!eclnews!yecl-news2.ecl.ntt.co.jp!isl.ntt.co.jp!miura
From: miura@isl.ntt.co.jp (MIURA Fumiaki)
Subject: fchdir(2) in SunOS 4.1.4 sun4c
X-Nntp-Posting-Host: amie.isl.ntt.co.jp
Message-ID: <E4v0HC.H1o@netnews.isl.ntt.co.jp>
Originator: miura@amie.isl.ntt.co.jp
Sender: news@netnews.isl.ntt.co.jp
Organization: NTT, Yokosuka, Japan
X-Newsreader: kstrn3.7.1-0.9.2
Date: Fri, 31 Jan 1997 06:24:48 GMT
Lines: 50
Xref: galaxy.trc.rwcp.or.jp fj.sys.sun:8838
X-originally-archived-at: http://galaxy.rwcp.or.jp/text/cgi-bin/newsarticle2?ng=fj.sys.sun&nb=8838&hd=a
X-reformat-date: Mon, 18 Oct 2004 15:18:22 +0900
X-reformat-comment: Tabs were expanded into 4 column tabstops by the Galaxy's archiver. See http://katsu.watanabe.name/ancientfj/galaxy-format.html for more info.

SunOS 4.1.4 sun4c(SS2IPX)$B$G(B GNU find version 4.1 $B$,(B
    find: cannot return to starting directory: Invalid argument
$B$H$$$&$N$,$3$H$NH/C<$G$9!#(B

fchdir(2)$B$GI,$:<:GT$9$k$h$&$J$N$G!"%F%9%H%W%m%0%i%`$G;n$7$F$_$^$7$?!#(B
$B$"$^$j%Q%9$,?<$/$J$$$H$3$m$G!"(Btest directory$B$,$"$k$H$3$m$G0J2<$rF0$+$9(B
$B$H(B
#include <errno.h>
#include <stdio.h>
#include <fcntl.h>

main() {
    int current;
    char path[256];

    printf("%s\n", getcwd(path,256));
    current=open(".", O_RDONLY);
    chdir("test");
    printf("%s\n", getcwd(path,256));
    if (0>fchdir(current)) {
perror("");
    }
    printf("%s\n", getcwd(path,256));
}

cc$B5Z$S(Bgcc 2.7.2.1$B$G$$$:$l$bF1$87k2L$G(B($B$^$"$=$&$@$m$&$J(B)$B!"(B
4.1.4(sun4c)$B$@$1$O(B
    /tmp
    /tmp/test
    Invalid argument
    /tmp/test
$B$G(B($B$?$@$73:Ev$9$k%[%9%H$3$3$K$O$O(B1$BBf$7$+$J$$(B)$B!"(B

4.1.4  4.1.3U1  4.1.3U1-JLE  4.1.3  4.1.3-JLE($B0J>e(Bsun4m)
4.1.3U1-JLE  4.1.2  4.1.1B-JLE ($B0J>e(Bsun4c)$B$G$O(B
    /tmp
    /tmp/test
    /tmp
$B$H!";n$7$?HO0O$G$O(B4.1.4 sun4c$B$@$1$,<v$o$l$F$$$k$h$&$G$9!#(B

/tmp, /tmp/test$B$NN>J}$r(B777$B$K$7$F$bJQ$o$j$^$;$s$G$7$?!#(B
tmpfs$B$H(B4.2$B$NN>J}$GF1$87k2L$G$9!#(BNFS$B$O:#2s;H$C$F$$$^$;$s!#(B

patch list$B$r8+$F$b$=$l$i$7$$$N$OH/8+$G$-$J$+$C$?$s$G$9$,!"$I$&$7$?$iD>(B
$B$;$k$s$G$7$g$&!#(B
find$B0l$D$NLdBj$J$i2?$H$G$b$7$^$9$1$I!":,$,?<$=$&$G!#(B
--
$B"&(BR$B"+(B $B;01:;K8w(B X;M 
R$B"+(B+/,(?1$B",&Q(BM)/M$B"+(BX$B!b(B.- $B1?L?(B X$B"&(B 
SS2$B$r<N$F$h$H$N?@$N$*9p$2$+$J$"!D(B
