zsh-workers
 help / color / mirror / code / Atom feed
* fchdir not implemented in NeXTSTEP/OPENSTEP
@ 1997-03-28  0:22 Leo Turetsky
  1997-03-28  3:09 ` Chris Faylor
  0 siblings, 1 reply; 4+ messages in thread
From: Leo Turetsky @ 1997-03-28  0:22 UTC (permalink / raw)
  To: zsh-workers

Hi! I've been trying to compile zsh 3.1.1 for NeXTSTEP 3.3 and/or OPENSTEP  
4.1. Everything compiles cleanly except for two lines which call the function  
fchdir. NeXTSTEP/OPENSTEP do not implement the fchdir system call so I've  
tried to replace all (all of two) occurances of fchdir(fd) with  
chdir(dirname). Bear with me, I'm only a sys admin not a programmer. Here is  
what I have:

This comes from the Src/compat.c file in the function zchdir(). The variable  
currdir seems to only be assigned file descriptors for the directory "." so  
I replaced fchdir(currdir) with chdir("."). Will this work?

/*    if (currdir == -1 || (currdir >= 0 && fchdir(currdir))) { */
/* Changed by Leo to remove the fchdir function call. */

    if (currdir == -1 || (currdir >= 0 && chdir("."))) {

This comes from the Src/utils.c file in the function lchdir(). The struct d  
seems to always have d->dirname defined (or defined as NULL) so I've replaced  
fchdir(d->dirfd) with chdir(d->dirname). Since both chdir and fchdir have  
the same exit values for the same reasons I assumed the logic wouldn't break.

/*      if (!fchdir(d->dirfd)) { */
/* Changed by Leo to remove the fchdir function call. */

        if (!chdir(d->dirname)) {

If you could help me out I'd really appreciate it. I'm a loyal follower of  
zsh releases but this is the first time I've had to compile it. Obviously, if  
the changes I made are correct and you'd like to add these changes to the  
source code, feel more than free to do so. [my changes do build a working  
executable as far as I can tell.]

I was also told to mention that I'm not a subscriber to the zsh-workers list  
and the output of reporter follows my signature. I can't give you a zsh -f  
report as I can't compile zsh without the changes I made.

Thanks a bundle!

leo.

+---------------------+---------------------------------+
| Leo Turetsky        |  BLaCKSMITH, Inc.   (NeXT/MIME) |
| leo@blacksmith.com  |  OPENSTEP Systems Administrator |
+---------------------+---------------------------------+
| Nah-ne kah-sah tahng-tah? <esp> Leo, your mom called. |
+-------------------------------------------------------+

Reporter breaks with the following output if I use my newly compiled zsh  
(3.1.1) or version 2.6 beta 10:

<uni>74% /usr/local/bin/zsh reporter
# START zsh saveset
# uname:  NEXTSTEP uni Lantern4S 4.1 Generic SPARC

# Aliases.

reporter: bad option: L [204]
reporter: condition expected: == [223]
reporter: condition expected: == [224]
zsh: 7766 segmentation fault  /usr/local/bin/zsh reporter
<uni>75%                       /private/Net/knuth/Users1/leo/tmp/zsh-3.1.1/Util


Working Reporter output using default zsh of NeXTSTEP 3.3:

<tyler>9% /usr/bin/zsh reporter
# START zsh saveset
# uname:  NEXTSTEP tyler Lightning9I 3.3 Intel 586 I386

# Aliases.

reporter: bad option: L [204]
reporter: condition expected: == [223]
reporter: condition expected: == [224]

reporter: bad option: L [226]
reporter: parse error near `}' [227]
reporter: bad option: l [228]
reporter: parse error near `)' [229]
reporter: parse error near `fi' [230]

# Completions.

reporter: compctl: bad option: L [243]

# Undefined functions.


# Defined functions.


# Limits.

limit datasize        6m
limit stacksize       8m
limit coredumpsize    0k

# Modules: zmodload not available.

# Non-array variables.

TERMCAP=''
TERM='vt100'
ARGC="0"
AWK="awk"
BAUD="0"
CDPATH=""
COLUMNS="80"
CPP="/lib/cpp"
DIRSTACKSIZE="-1"
DISPLAY="tyler:0.0"
EDITOR="emacs"
EGID="20"
ENSCRIPT="-2Gr"
ERRNO="9"
EUID="140"
FCEDIT="vi"
FIGNORE=""
FPATH=""
GID="20"
HACKPAGER="more"
HISTCHARS="!^#"
HISTSIZE="30"
HOME="/Net/knuth/Users1/leo"
HOST="tyler"
HOSTTYPE="next"
KEYTIMEOUT="40"
LINENO="348"
LINES="24"
LISTMAX="100"
LITHISTSIZE="5"
LOGCHECK="60"
LOGNAME="leo"
MAIL=""
MAILCHECK="60"
MAILPATH=""
MANPAGER="more"
MANPATH="/usr/host/man:/usr/local/imagetools/man:/usr/local/cvs/man:/usr/local/man:/usr/man:/usr/gnu/man:/usr/local/lib/tcl:/usr/X11R6/man"
NULLCMD="cat"
OLDPWD="/private/Net/knuth/Users1/leo/src/zsh-3.1.1/Util"
OPTARG=""
OPTIND="1"
PAGER="more"
PATH="/usr/X11R6/bin:/usr/local/gnu/bin:/usr/local/gnu/etc:/usr/local/bin:/usr/local/etc:/usr/bin:/usr/ucb:/usr/etc:/etc:/bin:/Net/knuth/Users1/leo/bin:/Net/knuth/Users1/leo/Apps:/usr/host/bin:/usr/gnu/bin:/Net/knuth/Users1/lindberg/Unix/bin:/LocalApps:/LocalDeveloper/Demos:/NextApps:/NextAdmin:/NextDeveloper/Demos:/Games:."
PERIOD="0"
POSTEDIT=""
PPID="15761"
PRINTER="Ginsberg"
PROMPT="%b<%m>%B%h%#%b "
PROMPT2="%B>%b "
PROMPT3="%B?#%b "
PROMPT4="%B+%b "
PS1="%b<%m>%B%h%#%b "
PS2="%B>%b "
PS3="%B?#%b "
PS4="%B+%b "
PSVAR=""
PWD="/private/Net/knuth/Users1/leo/src/zsh-3.1.1/Util"
RANDOM="27781"
READNULLCMD="more"
REPORTTIME="-1"
RPROMPT=" %B%~%b"
RPS1=" %B%~%b"
SAVEHIST="0"
SECONDS="3"
SHELL="/usr/local/bin/zsh"
SHLVL="3"
SPROMPT="zsh: correct \`%R\' to \`%r\' [nyae]? "
TERMINFO="/usr/local/gnu/lib/terminfo"
TIMEFMT="%E real  %U user  %S system  %P"
TMOUT="0"
TMPPREFIX="/tmp/zsh"
TTY=""
UID="140"
USER="leo"
USERNAME="leo"
VERSION="zsh 2.5.02"
WATCH=""
WATCHFMT="%n has %a %l from %m."
WORDCHARS="*?_-.[]~=/&;!#$%^(){}<>"
each="/Net/knuth/Users1/lindberg/Unix/bin"
reporter_OSVersion="NEXTSTEP_3.3"
reporter_junkiequotes="no"
status="1"
str="NEXTSTEP tyler Lightning9I 3.3 Intel 586 I386"
prompt='test%'

# Array variables.

argv=()
cdpath=()
fignore=()
fpath=()
mailpath=()
manpath=(/usr/host/man /usr/local/imagetools/man /usr/local/cvs/man  
/usr/local/man /usr/man /usr/gnu/man /usr/local/lib/tcl /usr/X11R6/man)
path=(/usr/X11R6/bin /usr/local/gnu/bin /usr/local/gnu/etc /usr/local/bin  
/usr/local/etc /usr/bin /usr/ucb /usr/etc /etc /bin /Net/knuth/Users1/leo/bin  
/Net/knuth/Users1/leo/Apps /usr/host/bin /usr/gnu/bin  
/Net/knuth/Users1/lindberg/Unix/bin /LocalApps /LocalDeveloper/Demos  
/NextApps /NextAdmin /NextDeveloper/Demos /Games .)
psvar=()
signals=(EXIT HUP INT QUIT ILL TRAP IOT EMT FPE KILL BUS SEGV SYS PIPE ALRM  
TERM URG STOP TSTP CONT CHLD TTIN TTOU IO XCPU XFSZ VTALRM PROF WINCH USR1  
USR2 ZERR DEBUG)
watch=()

# Exported variables.

export TERMCAP
export TERM
export DISPLAY
export EDITOR
export ENSCRIPT
export HACKPAGER
export HOME
export LOGNAME
export MANPAGER
export MANPATH
export PAGER
export PATH
export PRINTER
export PROMPT
export PROMPT2
export PROMPT3
export PROMPT4
export PWD
export RPROMPT
export SHELL
export SHLVL
export TERM
export TERMINFO
export TIMEFMT
export USER

# Setopt.

setopt bgnice
setopt hashcmds
setopt hashdirs
setopt hashlistall
setopt notify

# END zsh saveset
<tyler>10%                     /private/Net/knuth/Users1/leo/src/zsh-3.1.1/Util


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: fchdir not implemented in NeXTSTEP/OPENSTEP
  1997-03-28  0:22 fchdir not implemented in NeXTSTEP/OPENSTEP Leo Turetsky
@ 1997-03-28  3:09 ` Chris Faylor
  1997-03-28  6:28   ` Zoltan Hidvegi
  0 siblings, 1 reply; 4+ messages in thread
From: Chris Faylor @ 1997-03-28  3:09 UTC (permalink / raw)
  To: zsh-workers

In article <199703280022.TAA07810@uni.BLaCKSMITH.com>,
Leo Turetsky  <leo@BLaCKSMITH.com> wrote:
>Hi! I've been trying to compile zsh 3.1.1 for NeXTSTEP 3.3 and/or OPENSTEP  
>4.1. Everything compiles cleanly except for two lines which call the function  
>fchdir. NeXTSTEP/OPENSTEP do not implement the fchdir system call...

I just joined this mailing list to research this very problem.

fchdir is also not implemented on Ultrix, SCO v3.2, and AIX 3.2.5, as far
as I can tell.  I tried scanning the archives for patches that might
rectify this, but possibly I missed something.

If there is any solution for this problem I would appreciate hearing about
it.
-- 
http://www.bbc.com/	cgf@bbc.com			"Strange how unreal
VMS=>UNIX Solutions	Boston Business Computing	 the real can be."


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: fchdir not implemented in NeXTSTEP/OPENSTEP
  1997-03-28  3:09 ` Chris Faylor
@ 1997-03-28  6:28   ` Zoltan Hidvegi
  1997-03-28 16:26     ` Zoltan T. Hidvegi
  0 siblings, 1 reply; 4+ messages in thread
From: Zoltan Hidvegi @ 1997-03-28  6:28 UTC (permalink / raw)
  To: cgf; +Cc: zsh-workers

> In article <199703280022.TAA07810@uni.BLaCKSMITH.com>,
> Leo Turetsky  <leo@BLaCKSMITH.com> wrote:
> >Hi! I've been trying to compile zsh 3.1.1 for NeXTSTEP 3.3 and/or OPENSTEP  
> >4.1. Everything compiles cleanly except for two lines which call the function  
> >fchdir. NeXTSTEP/OPENSTEP do not implement the fchdir system call...
> 
> I just joined this mailing list to research this very problem.
> 
> fchdir is also not implemented on Ultrix, SCO v3.2, and AIX 3.2.5, as far
> as I can tell.  I tried scanning the archives for patches that might
> rectify this, but possibly I missed something.

I also noticed this as I now have to use AIX 3.2.5 at work (but it will be
upgraded to 4.1.? till June).  I made some ugly dirty hacks to circumvent
the problem.  I do not have the patch here at home, but I'll post it
tomorrow.

I thought that fchdir was a standard function, mandated by POSIX.1.
Anyway, an OS which calls itself Unix and does not have fchdir is really
broken in my opinion.  Fortunately AIX 4.x already has this.

Zoltan


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: fchdir not implemented in NeXTSTEP/OPENSTEP
  1997-03-28  6:28   ` Zoltan Hidvegi
@ 1997-03-28 16:26     ` Zoltan T. Hidvegi
  0 siblings, 0 replies; 4+ messages in thread
From: Zoltan T. Hidvegi @ 1997-03-28 16:26 UTC (permalink / raw)
  To: Zsh workers list; +Cc: cgf

> > >fchdir. NeXTSTEP/OPENSTEP do not implement the fchdir system call...
[...]
> > fchdir is also not implemented on Ultrix, SCO v3.2, and AIX 3.2.5, as far
[...]
> the problem.  I do not have the patch here at home, but I'll post it
> tomorrow.

Here is the patch, gzipped and uuencoded since the local mail system still
converts TABs to spaces.

Zoltan


begin 644 aixfix.gz
M'XL("$CJ.S,``V%I>&9I>`#M6.MSTT80_YS\%6N726);MO7RFZ23)J&A#8$A
MP,!@ZBK2R;Z)+&DD.6`*_WOW[O2.[+8\2CN#/EBZU=[>[F^?LD5M&]HF7`5F
MU_26OA%US(X7T'F!LMML-N^R[%P9$?QBN*`HH`S'VF"LJ:",1H/==KM=8-]Y
MMB+P@%QS3F4L]\?*0'`VBQ<_2-%D2='ZP`E,E"`,`9_;N\`OWR*W<`CA]<KN
MA-$,5Y/X#;7AP&K@8L=J'U'70RX?;Q+@4FSR.7<+?J"V16PX/WYQ-GMP<G[Z
M\&DL@C@A8>^):U&;25IXCD7=*#AHL%-B+ML+X&`R:<`?U5;H/4GIJ<(*E,'T
MXNH(?6!O#[@Z0A\F!9D2`VIHUVO?"]]P0W;8JMUF:U1_O[L_V:UEO,+8G8!$
MJ\#E5M+`-98$6=]'@;7R#W`[M`"W<_7YQO?F`MFJWKA>T5I.C(6G[!/A%WV`
M)HX2OWQ-$W%OC3G,+7L,N78JC&'DHB6UG#__+E@MH<+'+X9:9:`,54D9Z6F@
ML)VX):3OH7D(*I?&-5B2I>FOL],E<,6S*H%#7'%N%A$Y#;;:B;]*ME=86.]T
MZHU4RG5`C)LDOSXBDL70BP^Y?'YQD4_")I[`WY=12P^\"QR/JN%(4N4LJCX#
MCPTY_ND@Y8O")Z"U+8HSR&K5P1:K@&\W!W;!%2U(@O=S7%(5LJK:DU1=R2JT
MJLN2VE=3G_':&"*.>`K*?G+\['SVZ/@EH'<G$,(1IV-Y:(90$^D.8;N=16'(
M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!=WX'C/5=^.O[,T;
M$XN+`NJB5,0HYK#Z'Z#(860X<B"_/9)5\:D/-$D?C)+X+%Z8BXXWIR[:%OES
M:C%"1)?$LRUCS1;,>IZGRQN;VAZ\-6BD`<M#Q@;3.Q)#.K]V//.&/:#0I1'R
MQX#77'Q@'R)P0QW'G[.EP9.?G10X=$FC:HE^X)E"$K9EU!)O)+X'V4,8/X7L
MANL@P&^6:=PGLLNEX<RAZ&#JTF@>>"L_9+4_<?L]:XT&4Q-]N"9ASH?')[.3
M\[.37V</GE^>7!U8#IN)L+J*<T25M1S>W9@\F_+`3N#/C8'?X2_!'_>6K^2%
MNTVCV#%*[:*Z5VA*1:\H-PIEK*A;.KBN]/%;2DW_0$3=^&#ZCVH.5IQI!ZO-
M-Z\UXD^"Q*0XO#_)I/]4,ZIL\8J.'QBYOWZ_9W%%%K..ZC'@N;\-<^9"W5P0
M\X:Z<_[7.J.Q<:^.WY$=OC+KH!SM]9--]32S,-]ZVABJM\/17D\,#:E?OE?7
0OZRN_ZY[_@0^2E>UAAH``#+K
`
end


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~1997-03-28 16:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-03-28  0:22 fchdir not implemented in NeXTSTEP/OPENSTEP Leo Turetsky
1997-03-28  3:09 ` Chris Faylor
1997-03-28  6:28   ` Zoltan Hidvegi
1997-03-28 16:26     ` Zoltan T. Hidvegi

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).