From: Eric Backus Subject: A few more patches for libc.a To: djgpp AT sun DOT soe DOT clarkson DOT edu (djgpp) Date: Mon, 21 Sep 92 16:21:41 PDT Mailer: Elm [revision: 66.25] Here are a few more patches to libc.a. I hope people find them useful. I include here a discription of the patches, and then a zoo archive containing the actual patches. 1. Apparently the patch to dos/dir.c that I posted before was corrupted. I don't know what happenned, but I've included a new copy of it. This patch fixes the problem of trailing slashes on the directory name passed to opendir(). This is a problem in particular for the root directory "/", since it always has a trailing slash. It also fixes closedir() to return zero. It also changes readdir() so that it finds hidden and system files as well as normal files. To use this patch, apply it to /djgpp/libsrc/c/dos/dir.c, and recompile libc.a. 2. While compiling various FSF utilities, I ran into three more errno values that were not defined - ENOSPC, EAGAIN, and ENXIO. To use this patch, apply it to /djgpp/include/errno.h. This patch assumes that you have applied my previous patch to errno.h. 3. I previously supplied source for getgrent() and related functions, and getpwent() and related functions. I am now providing a patch for them which makes them work a little better. To use this patch, apply it to the getgrent.c and getpwent.c that I previously distributed, and recompile libc.a. 4. The link() function in libc.a doesn't do a link, since links are not possible on DOS. However, what it does do is a rename, which seems wrong to me. Included is a version of link() which does a copy instead of rename. This version attempts to make the modes and time of the destination file match those of the source file. To use this patch, remove the existing /djgpp/libsrc/c/sys/link.s, replace it with the supplied link.c, and then recompile libc.a. 5. The stdio.h file distributed with DJGPP 1.08 defines STDC_HEADERS. This okay, but many makefiles try to define STDC_HEADERS on the command line, leading to spurious warnings that STDC_HEADERS was redefined. I fixed this by putting "#ifndef STDC_HEADERS" around the definition in stdio.h. To use this patch, apply it to /djgpp/include/stdio.h. 6. The unistd.h file distributed with DJGPP 1.08 defines FNM_QUOTE and FNM_PATHNAME, which are used by the fnmatch() function. However, many FSF programs supply their own copy of fnmatch() and their own definitions of FNM_QUOTE and FNM_PATHNAME. To avoid spurious warnings, I put "#ifndef"s around these definitions in unistd.h. To usethis patch, apply it to /djgpp/include/unistd.h. On a related subject, the version of fnmatch() included in DJGPP 1.08 seems to have the return value backwards. As I understand it, fnmatch() should return zero for a match an non-zero for a non-match (kind of like strcmp()). The fnmatch() supplied in DJGPP 1.08 seems to have this backwards. I guess I can't be sure what the correct definition is, but FSF code and HP-UX 8.0 both agree with me and disagree with the fnmatch() supplied with DJGPP 1.08. 7. In a previous patch to libc.a, I supplied a simple one-line version of /djgpp/include/sys/wait.h. In order to get a the FSF find and xargs programs to compile, I had to define a few constants in wait.h as well. To get the new version wait.h, copy the supplied wait.h into /djgpp/include/sys/wait.h. -- Eric Backus ericb%hplsla AT hplabs DOT hp DOT com (206) 335-2495 begin 644 newpatch.zoo M6D]/(#(N,3`@07)C:&EV92X:``#0.P0/7KKCCBPV"+Q!P97F`R>'U/`'R^P5>JX$^ M6`*_W+UT#/S:0268R%1=J+9"D$1#M,VOK_-Z[P@`Z*!(9'91LS+Y:R:AX]H: MI\V]L,DDL34Y_P:6-?&VW6+4&M4;N(KS]BE9!U M)E2&? M8:, M-,#*H_I7XJR,T.N-XN/UVXZ_]2K&7+E,\\U>OPY>;/GT="_'5TZOCHY_\P_YOXZ5_U6 MZM9'RY(+7)&DQO#*G?RLRYMDM.#05 AT T```#:P+XT9(?!*F8B\K+_QD%>3N=!?'+ ME3$&QBF`!PMG.<$I6*>6["ZTU5>8J+(/H#R(O2&*#>'X84-M...;$;N746"+ M0CH*?MVO@(-_E!"-I]*,R?S0&0N-M`>%I<;L2$LT_QP,^\\8SIQ-CFRV\\LR MM"_U>98"RN^\QW>R=#$7]D7:`E0^T\\;5Z94E1M3O'^.GHJID8BC5&=(7E78 M0O+CF$XBU5WX7=./VCFG8G!T3P2HADI-A+62_^Q_3,49:?67YZY53+P]S2QR M22U:>[;0``#HL:Q![<<=)CMIQV*+'XW=_C``YIK39&BU">O"R1M+$ M(0$'8A9U&@I6ES*M(>9Z@"0(^[)#)DCQ!%CQQW[S[[^^*9`;YB(HM*C45SG#P0NJ#5Y7[W;RX]C%I4AO,XY M@(&6E8-X3:ZG7K:%SBIZ$^O.*:.CJVNO%L(B9^$H/NQFA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