delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1992/08/24/18:14:44

From: Eric Backus <ericb AT lsid DOT hp DOT com>
Subject: Patch1 for libc.a
To: djgpp AT sun DOT soe DOT clarkson DOT edu (djgpp)
Date: Mon, 24 Aug 92 14:27:17 PDT
Mailer: Elm [revision: 66.25]

Fixes for stat() for djgpp 1.08
-------------------------------

    1. Directories have the S_IWRITE bit set, because on DOS, files
       can be added/deleted from any directory.
    2. The st_uid and st_gid fields are set to be equal to the user
       and group ids as given by getuid() and getgid(), so that all
       files appear to be owned by the caller.
    3. The st_dev field is set to the drive number that the file is
       found on.
    4. The st_ino field returns the same value for two different calls
       to stat() with the same file, and returns different values for
       different files.  This allows programs like "mv" or "cp" to
       detect if they are about to overwrite an input file.  The root
       directory is statable (looks like this was already added
       between 1.07 and 1.08 but I'll leave my modification anyway).
    5. There is some strange bug in stat() which causes the wrong
       value to get used for st_atime, st_mtime, and st_ctime if
       time() has not been previously called, which has been worked
       around.

    To get a fixed version of stat(), remove the existing
    /djgpp/libsrc/c/sys/stat.s and replace it with the stat.c and
    stat_ast.s supplied below.


Fixes for opendir(), readdir(), and closedir() for djgpp 1.08
-------------------------------------------------------------

    1. As written, opendir() appends "/*.*" to the end of the path
       passed to it, even if that path already ends in a slash.  This
       can cause the opendir() to fail.  I now strip trailing slashes
       from the supplied path.
    2. As written, readdir() skips hidden and system files.  I
       personally don't like that, and it makes programs like "du" get
       the wrong answer.  I've modified readdir() to pick up all
       files. 
    3. As written, closedir() does not return a value like it's
       supposed to.  I've modified it to return zero.

    To get a fixed version of these functions, apply the patch
    supplied below to /djgpp/libsrc/c/dos/dir.c.


Fix for umask() for djgpp 1.08
------------------------------

    1. As written, umask() returns 0644, which is the inverse of what
       it should return.  I've modified it to return 022, a more
       reasonable value.

    To get a fixed version of umask(), replace
    /djgpp/libsrc/c/sys/umask.c with the umask.c supplied below.


Fix for strftime() for djgpp 1.08
---------------------------------

    1. For some reason, the existing strftime() has the "%Z" case
       #ifdef'ed out.  The commented out code works, and is needed for
       a program like "date" to correctly print the timezone in the
       date string.  I've removed the #if around "%Z".

    To get a fixed version of strftime(), apply the patch supplied
    below to /djgpp/libsrc/c/str/strftime.c.


Fix for errno.h for djgpp 1.08
------------------------------

    1. The existing errno.h has EBADENV and E2BIG set to different
       values.  On unix, EBADENV does not exist and E2BIG is used for
       both "arg list too long" and "environment too big".  So I
       changed E2BIG to be equal to EBADENV.

    2. The existing errno.h has EXDEV ("cross-device link attempted")
       equal to 22.  However, DOS returns 17 for this situation, so
       EXDEV should be equal to 17.

    3. The existing errno.h does not have EPERM, which is used by
       several GNU programs.  I set EPERM equal to EACCES.

    To get a fixed version of errno.h, apply the patch supplied below
    to /djgpp/include/errno.h.

begin 644 patch1.zoo
M6D]/(#(N,3`@07)C:&EV92X:``#<I\3]*@```-;___\"``$````````#W*?$
M_0(",`(``'$````8&<5Q2<#E`P``OP$```(!``````````!D:7)C+F1I9@``
M````"@`<%T(`````I`%`````0"DC*``!BV.ZPC35/\U/@#^[P);VM"VTHM"9
MD)@TVD3,@/AT<QG-.H=&[J3K=,L1^-W=UH7;$?`OAWC?@VW!:XFW"$(-1TRW
MJ$G:ST(&<J0_"(7\44>*+`())(;CSSRPMZ5KH2<9._6(8%>8H<.+![:P1..+
M7$CL$(8JM AT 2 DOT PQA2#UP*Q3.>]R"]QAS!N78IZD<[BSST2MTU)G,AM>XYRQN8
MV#U:DNW\-\"SH9OX[G*%>`7R#34D^T5)*><Z-8IG+3L-2Z*:!X&$I4`NW:9&
MH<E\EXG("7V&?#8><P;<8I^6?5XJ`M=6Q4.V0=P?+'G7AY AT WO#\P?<'U28OV
MX[_`O\E"0\(/FL7=OW1NW*9#7C0KB![>VZYZ`%;[]VUTFGI-6,\8"_2Z.;Z>
M%J\J>5T"LJVDU7>E"X'Q_VX\"K=15W(K=NJA"[;S'1J0;[U-^MC9FFL9[(,]
M7[$S'33YP'O*NCHR?3)HY^G<K_HR_#K]_8M'+U:,W/8T65(4RG+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JT=N AT NT&-#LT%TYIYP[-4P\BZR3%T9=G:28->R;7JGS>5(]S$*I$E"O[P<N
M'X]7>![PS-50'4:C[VN&,QQQQ2O3^'CZWK8=8;G/,_<9SAL:/TR?2.*MEQXO
M5T8O69<<7A7PB?:T[/*,``#<I\3]`@)7#```F`L``!@9QG%4$UT!``"_````
M`@$``````````'-T<F9T:6UE+F1I9@`*`!R.2`````"D`4````!`*2,H``"N
M6I:AIN4\UO@#^F,58,;)+=<JA AT O0]-X42,<3 AT L@2QX<7QOBQ3&+RX[[,$#3:
M(0@[O=@]?9,[7+V6-8++G`R`@U7'G#P/32C:4I=:E4Z<Z?IC]A'(&IJ/SJ^*
M(TY//93A!^4R#T#,`#9ESE/Q<R0TM>@*6L>MF*J]I1[+P!HCIN[J&_KOJTIH
M$R;GE^G]K?QK%#QX&ZVZ^^3]#EES5L=K\B$9?]+4S(1Q])93+UX?R7]]4OP)
MILZ(9(\=F```W*?$_0(":0T``)X,```8&<5Q<3TI`0``RP````(!````````
M``!U;6%S:RYC`"YD:68`"@`<9-T`````I`%`````0"DC*```UEJ6L<:A6//`
M'^(M*6I2C AT N4X-PE!Q=.[>Z:O23C9O6"(^-VRBB,@`2-'CN'I$Q14S29:#'W
MSUU&TBK\#+:>#)284VV6=1X>//GO%HIA$)4-$X`!)]36KP>3_1,+&^@6FGR+
M%-N`>@?,G2W]#\N7[#2,IUO"M?:R30Z AT E,8/!,>(LC1?;%E1C&IK)*UN)Y44
M9K3;5SL4<*7?>&_QQ]=9.I]2TV/MH$/7IY^PD6$4F?`;N,$FT.S=W/Q$J8GW
MP^KQ/X6W+/*'W````-RGQ/T"````````````````````````````````````
8`````````````````````````````/R#
`
end

--
				Eric Backus
				ericb%hplsla AT hplabs DOT hp DOT com
				(206) 335-2495

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019