Index: linux/libc/ChangeLog diff -u linux/libc/ChangeLog:1.184 linux/libc/ChangeLog:1.185 --- linux/libc/ChangeLog:1.184 Fri May 30 19:23:08 1997 +++ linux/libc/ChangeLog Fri Jun 27 09:32:56 1997 @@ -1,3 +1,32 @@ +Fri Jun 27 07:31:27 1997 H.J. Lu (hjl@gnu.ai.mit.edu) + + * version 5.4.34 is released. + + * <_G_config.h>: change version to 5.4.34. + + * elf/libc/jump.params: set version to 5.4.34. + + * release.libc: update. + +Wed Jun 25 08:00:46 1997 H.J. Lu (hjl@gnu.ai.mit.edu) + + * nls/msgcat-libc.c (libc_nls_init): save errno. + + * libio/genops.c: + * libio/strops.c: + * libio/libioP.h: + * libio/fileops.c: update from glibc 2. + +Thu Jun 12 02:10:32 1997 Helmut Geyer + + * grp/getgrnam.c: don't segfault if a /etc/groups entry for a + NIS group lacks the ':' or does not contain any members, + +Sun Jun 8 09:25:41 1997 H.J. Lu (hjl@gnu.ai.mit.edu) + + * (tftphdr): change "tu_block" to unsigned + short. + Fri May 30 21:06:03 1997 H.J. Lu (hjl@gnu.ai.mit.edu) * version 5.4.33 is released. Index: linux/libc/release.libc diff -u linux/libc/release.libc:1.51 linux/libc/release.libc:1.54 --- linux/libc/release.libc:1.51 Fri May 30 19:23:08 1997 +++ linux/libc/release.libc Fri Jun 27 09:45:09 1997 @@ -1,27 +1,7 @@ Hi, Gals and Guys, -I would like to release libc 5.4.33 to public in a day or 2. But -I was told libc 5.4.26 doesn't work with shadow-970211. I couldn't -reproduce the problem. I'd like to hear the results of libc 5.4.33 -and shadow-970211 before I release 5.4.33 to public. Thanks. - -I added the glibc stat support so that I can run netscape with -XFree86 compiled for glibc 2. Please check it out. - -I modified sysdeps/linux/i386/crt/gcrt0.S to call sbrk () before any -calls to malloc () which may be used by atexit () since not all malloc -implemenation allow the outside sbrk () calls. Please check if profile -still works fine. - -The NYS bug is suppposed to be fixed. If a service is not available, -the some NIS/NIS+ routines will give back a NULL pointer, but the -other functions expect a struct with the error code. Please check -it out. - -glibc's putenv () was used in libc 5.4.23 which breaks many TeX -binaries. You have to re-compile them with -DSMART_PUTENV. Otherwise -they won't work. Please see kpathsea/xputenv.c in those packages for -details. I backed this change out in libc 5.4.33. +I updated libio from glibc 2. libg++ 2.7.2.7 or above should be used +with this release. I have modified the NIS support in libc, which is not compatible with the previous version, but is compatible with SunOS, Solaris, ... @@ -42,20 +22,20 @@ so that the old XFree86 binaries will run fine with the new XFree86 shared librraries compiled with libc 6.x/glibc 2.x. -If you use linux 2.1.x, you need libc 5.4.33 or above to compile libc +If you use linux 2.1.x, you need libc 5.4.34 or above to compile libc yourself. The pre-compiled libc should run fine under linux 2.1.x. Also this library is compiled with -D_REENTRANT so that errno is MT safe. The shared libraries are now compiled with -g1 which can provide minimum information when core dump happens. You can strip -libc.so.5.4.33 if you want. +libc.so.5.4.34 if you want. -Due to the new, improved locale, the Linux C library 5.4.33 is binary +Due to the new, improved locale, the Linux C library 5.4.34 is binary compatible with libc 5.3.12 but not vice versa. The binaries -compiled/linked with libc.so.5.4.33 may not run with libc.so.5.3.12. +compiled/linked with libc.so.5.4.34 may not run with libc.so.5.3.12. You may need to regenerate locale files for the new locale in libc -5.4.33 if you use locales other tha C/POSIX which are the defaults. +5.4.34 if you use locales other tha C/POSIX which are the defaults. The locale sources are at @@ -64,7 +44,7 @@ There are many security bug fixes. Please consult ChangeLog for details. Please let me know if there are more security bugs remains. -This is the beta release of the Linux C library 5.4.33. Please read +This is the beta release of the Linux C library 5.4.34. Please read the ChangeLog for details regarding changes/bug fixes. DISTRIBUTION SITES: @@ -85,11 +65,11 @@ DISTRIBUTION FILES: -1. libc-5.4.33.bin.tar.gz +1. libc-5.4.34.bin.tar.gz REQUIRED. This package contains the header files for libc, shared and static ELF libraries libc and libm, and the static ELF library libbsd.a. -The header files in libc-5.4.33.bin.tar.gz are not complete. You need to +The header files in libc-5.4.34.bin.tar.gz are not complete. You need to install the kernel source tree for the system-dependent header files. The header files are in lib-x.y.z.bin.tar.gz and libc-x.y.z.tar.gz. You @@ -100,11 +80,11 @@ to extract the header files without the binaries files. A separate tar file for the header files may cause unnecessary confusion. -2. libc-5.4.33.tar.gz +2. libc-5.4.34.tar.gz Source tree for libc and header files. -3. libc-5.4.32-5.4.33.diff.gz +3. libc-5.4.33-5.4.34.diff.gz Context diffs against the source tree from the previous libc release. Please make sure the empty libc/regex/rx.h is deleted. @@ -175,7 +155,7 @@ rm -f /usr/include/wcstr.h /usr/include/mbstr.h rm -f /usr/include/ld_so_config.h /usr/include/localeinfo.h rm -rf /usr/include/netinet /usr/include/net /usr/include/pthread -gzip -dc libc-5.4.33.bin.tar.gz | tar xvf - +gzip -dc libc-5.4.34.bin.tar.gz | tar xvf - SOURCE INSTALLATION: @@ -241,4 +221,4 @@ H.J. hjl@gnu.ai.mit.edu -05/30/97 +06/27/97 Index: linux/libc/elf/libc/jump.params diff -u linux/libc/elf/libc/jump.params:1.86 linux/libc/elf/libc/jump.params:1.87 --- linux/libc/elf/libc/jump.params:1.86 Fri May 30 19:18:47 1997 +++ linux/libc/elf/libc/jump.params Fri Jun 27 09:32:58 1997 @@ -1 +1 @@ -Version=5.4.33 +Version=5.4.34 Index: linux/libc/grp/getgrnam.c diff -u linux/libc/grp/getgrnam.c:1.3 linux/libc/grp/getgrnam.c:1.4 --- linux/libc/grp/getgrnam.c:1.3 Fri Oct 4 15:52:50 1996 +++ linux/libc/grp/getgrnam.c Fri Jun 27 09:32:58 1997 @@ -111,7 +111,8 @@ outtmp[i-1] = '\0'; i = 0; c = strrchr(outtmp, ':'); - *(c+1) = '\0'; + if (c != NULL) + *(c+1) = '\0'; while (more_members[i] != NULL) { outtmp = realloc(outtmp, strlen(outtmp) @@ -120,7 +121,8 @@ strcat(outtmp, ","); i++; } - *(strrchr(outtmp, ',')) = '\0'; + c = strrchr(outtmp, ','); + if (c != NULL) *(c) = '\0'; strcat(outtmp, "\n"); outkey = outtmp; } Index: linux/libc/libio/fileops.c diff -u linux/libc/libio/fileops.c:1.14 linux/libc/libio/fileops.c:1.15 --- linux/libc/libio/fileops.c:1.14 Mon Apr 7 09:47:29 1997 +++ linux/libc/libio/fileops.c Fri Jun 27 09:32:59 1997 @@ -1,4 +1,4 @@ -/* +/* Copyright (C) 1993, 1995 Free Software Foundation This file is part of the GNU IO Library. This library is free @@ -24,7 +24,9 @@ /* written by Per Bothner (bothner@cygnus.com) */ -#define _POSIX_SOURCE +#ifndef _POSIX_SOURCE +# define _POSIX_SOURCE +#endif #include "libioP.h" #include #include @@ -35,11 +37,16 @@ extern int errno; #endif + +#ifdef _LIBC +# define open(Name, Flags, Prot) __open ((Name), (Flags), (Prot)) +#endif + /* An fstream can be in at most one of put mode, get mode, or putback mode. Putback mode is a variant of get mode. In a filebuf, there is only one current position, instead of two - separate get and put pointers. In get mode, the current posistion + separate get and put pointers. In get mode, the current position is that of gptr(); in put mode that of pptr(). The position in the buffer that corresponds to the position @@ -73,14 +80,14 @@ (The pointers save_gptr() and save_egptr() are the values of gptr() and egptr() at the time putback mode was entered.) The OS position corresponds to that of save_egptr(). - + LINE BUFFERED OUTPUT: During line buffered output, _IO_write_base==base() && epptr()==base(). However, ptr() may be anywhere between base() and ebuf(). This forces a call to filebuf::overflow(int C) on every put. If there is more space in the buffer, and C is not a '\n', then C is inserted, and pptr() incremented. - + UNBUFFERED STREAMS: If a filebuf is unbuffered(), the _shortbuf[1] is used as the buffer. */ @@ -100,9 +107,7 @@ fp->_IO_file_flags |= CLOSED_FILEBUF_FLAGS; _IO_link_in(fp); -#if 0 fp->_fileno = -1; -#endif } int @@ -133,8 +138,8 @@ } void -DEFUN(_IO_file_finish, (fp), - register _IO_FILE* fp) +DEFUN(_IO_file_finish, (fp, dummy), + register _IO_FILE* fp AND int dummy) { if (_IO_file_is_open(fp)) { @@ -142,7 +147,7 @@ if (!(fp->_flags & _IO_DELETE_DONT_CLOSE)) _IO_SYSCLOSE (fp); } - _IO_default_finish(fp); + _IO_default_finish(fp, 0); } _IO_FILE * @@ -184,7 +189,7 @@ _IO_mask_flags(fp, read_write,_IO_NO_READS+_IO_NO_WRITES+_IO_IS_APPENDING); if (read_write & _IO_IS_APPENDING) if (_IO_SEEKOFF (fp, (_IO_off_t)0, _IO_seek_end, _IOS_INPUT|_IOS_OUTPUT) - == _IO_pos_BAD && errno != ESPIPE) + == _IO_pos_BAD && errno != ESPIPE) return NULL; _IO_link_in(fp); return fp; @@ -223,11 +228,11 @@ } /* Write TO_DO bytes from DATA to FP. - Then mark FP has having empty buffers. */ + Then mark FP as having empty buffers. */ int DEFUN(_IO_do_write, (fp, data, to_do), - register _IO_FILE *fp AND const char* data AND _IO_size_t to_do) + register _IO_FILE *fp AND const char* data AND _IO_size_t to_do) { _IO_size_t count; if (to_do == 0) @@ -240,7 +245,7 @@ unpredictable. */ fp->_offset = _IO_pos_BAD; else if (fp->_IO_read_end != fp->_IO_write_base) - { + { _IO_pos_t new_pos = _IO_SYSSEEK(fp, fp->_IO_write_base - fp->_IO_read_end, 1); if (new_pos == _IO_pos_BAD) @@ -269,7 +274,10 @@ #endif if (fp->_flags & _IO_NO_READS) - return EOF; + { + errno = EBADF; + return EOF; + } if (fp->_IO_read_ptr < fp->_IO_read_end) return *(unsigned char*)fp->_IO_read_ptr; @@ -287,28 +295,10 @@ fp->_IO_buf_end - fp->_IO_buf_base); if (count <= 0) { - /* - * I think EAGAIN and EWOULDBLOCK should be treated as - * EOF. H.J. - */ -#ifdef EAGAIN -#if defined(EWOULDBLOCK) && EWOULDBLOCK != EAGAIN - if (count == 0 || errno == EAGAIN - || errno == EWOULDBLOCK) -#else - if (count == 0 || errno == EAGAIN) -#endif -#else -#ifdef EWOULDBLOCK - if (count == 0 || errno == EWOULDBLOCK) -#else if (count == 0) -#endif -#endif fp->_flags |= _IO_EOF_SEEN; else - fp->_flags |= _IO_ERR_SEEN; - count = 0; + fp->_flags |= _IO_ERR_SEEN, count = 0; } fp->_IO_read_base = fp->_IO_read_ptr = fp->_IO_buf_base; fp->_IO_read_end = fp->_IO_buf_base + count; @@ -326,10 +316,11 @@ register _IO_FILE* f AND int ch) { if (f->_flags & _IO_NO_WRITES) /* SET ERROR */ - { - f->_flags |= _IO_ERR_SEEN; - return EOF; - } + { + f->_flags |= _IO_ERR_SEEN; + errno = EBADF; + return EOF; + } /* If currently reading or no buffer allocated. */ if ((f->_flags & _IO_CURRENTLY_PUTTING) == 0) { @@ -378,7 +369,7 @@ /* char* ptr = cur_ptr(); */ if (fp->_IO_write_ptr > fp->_IO_write_base) if (_IO_do_flush(fp)) return EOF; - delta = fp->_IO_read_ptr - fp->_IO_read_end; + delta = fp->_IO_read_ptr - fp->_IO_read_end; if (delta != 0) { #ifdef TODO @@ -408,6 +399,10 @@ _IO_pos_t result; _IO_off_t delta, new_offset; long count; + /* POSIX.1 8.2.3.7 says that after a call the fflush() the file + offset of the underlying file must be exact. */ + int must_be_exact = (fp->_IO_read_base == fp->_IO_read_end + && fp->_IO_write_base == fp->_IO_write_ptr); if (mode == 0) dir = _IO_seek_cur, offset = 0; /* Don't move any pointers. */ @@ -524,7 +519,8 @@ else { count = _IO_SYSREAD (fp, fp->_IO_buf_base, - fp->_IO_buf_end - fp->_IO_buf_base); + (must_be_exact + ? delta : fp->_IO_buf_end - fp->_IO_buf_base)); if (count < delta) { /* We weren't allowed to read, but try to seek the remainder. */ @@ -557,7 +553,11 @@ for (;;) { _IO_ssize_t count = _IO_read(fp->_fileno, buf, size); -#ifdef EINTR +#if 0 && defined EINTR + /* We must not do this optimization since POSIX.1 explicitly + requests that the stream operations must return with the + error EINTR if this happens. There must be the possibility + that stream operations time out. --drepper */ if (count == -1 && errno == EINTR) continue; #endif @@ -596,7 +596,11 @@ _IO_ssize_t count = _IO_write(f->_fileno, data, to_do); if (count == EOF) { -#ifdef EINTR +#if 0 && defined EINTR + /* We must not do this optimization since POSIX.1 explicitly + requests that the stream operations must return with the + error EINTR if this happens. There must be the + possibility that stream operations time out. --drepper */ if (errno == EINTR) continue; else @@ -680,7 +684,7 @@ if (_IO_do_write(f, s, count) == EOF) return n - to_do; to_do = dont_write; - + /* Now write out the remainder. Normally, this will fit in the buffer, but it's somewhat messier for line-buffered files, so we let _IO_default_xsputn handle the general case. */ @@ -745,7 +749,7 @@ else fp->_flags |= _IO_ERR_SEEN, count = 0; } - + s += count; more -= count; } Index: linux/libc/libio/genops.c diff -u linux/libc/libio/genops.c:1.11 linux/libc/libio/genops.c:1.12 --- linux/libc/libio/genops.c:1.11 Tue Apr 8 09:11:14 1997 +++ linux/libc/libio/genops.c Fri Jun 27 09:32:59 1997 @@ -53,7 +53,7 @@ int _IO_default_doallocate( _IO_FILE * ); void _IO_init( register _IO_FILE *, int ); int _IO_default_sync( _IO_FILE * ); -void _IO_default_finish( _IO_FILE * ); +void _IO_default_finish( _IO_FILE * , int); _IO_pos_t _IO_default_seekoff( register _IO_FILE *, _IO_off_t, int, int ); int _IO_sputbackc( register _IO_FILE *, int ); int _IO_sungetc( register _IO_FILE * ); @@ -326,11 +326,7 @@ _IO_FILE *f AND char *b AND char *eb AND int a) { if (f->_IO_buf_base && !(f->_flags & _IO_USER_BUF)) -#ifdef __linux__ FREE_BUF(f->_IO_buf_base, _IO_blen(f)); -#else - FREE_BUF(f->_IO_buf_base); -#endif f->_IO_buf_base = b; f->_IO_buf_end = eb; if (a) @@ -517,7 +513,6 @@ fp->_IO_save_end = NULL; fp->_markers = NULL; fp->_cur_column = 0; - fp->_fileno = -1; } int @@ -531,17 +526,13 @@ current implementation, this function can get called twice! */ void -DEFUN(_IO_default_finish, (fp), - _IO_FILE *fp) +DEFUN(_IO_default_finish, (fp, dummy), + _IO_FILE *fp AND int dummy) { struct _IO_marker *mark; if (fp->_IO_buf_base && !(fp->_flags & _IO_USER_BUF)) { -#ifdef __linux__ FREE_BUF(fp->_IO_buf_base, _IO_blen(fp)); -#else - FREE_BUF(fp->_IO_buf_base); -#endif fp->_IO_buf_base = fp->_IO_buf_end = NULL; } Index: linux/libc/libio/libioP.h diff -u linux/libc/libio/libioP.h:1.16 linux/libc/libio/libioP.h:1.17 --- linux/libc/libio/libioP.h:1.16 Sun Nov 3 02:51:28 1996 +++ linux/libc/libio/libioP.h Fri Jun 27 09:32:59 1997 @@ -112,8 +112,8 @@ /* The 'finish' function does any final cleaning up of an _IO_FILE object. It does not delete (free) it, but does everything else to finalize it/ It matches the streambuf::~streambuf virtual destructor. */ -typedef void (*_IO_finish_t) __P((_IO_FILE*)); /* finalize */ -#define _IO_FINISH(FP) JUMP0(__finish, FP) +typedef void (*_IO_finish_t) __P((_IO_FILE*, int)); /* finalize */ +#define _IO_FINISH(FP) JUMP1(__finish, FP, 0) /* The 'overflow' hook flushes the buffer. The second argument is a character, or EOF. @@ -303,7 +303,7 @@ extern int _IO_default_underflow __P((_IO_FILE*)); extern int _IO_default_uflow __P((_IO_FILE*)); extern int _IO_default_doallocate __P((_IO_FILE*)); -extern void _IO_default_finish __P((_IO_FILE *)); +extern void _IO_default_finish __P((_IO_FILE *, int)); extern int _IO_default_pbackfail __P((_IO_FILE*, int)); extern _IO_FILE* _IO_default_setbuf __P((_IO_FILE *, char*, _IO_ssize_t)); extern _IO_size_t _IO_default_xsputn __P((_IO_FILE *, const void*, _IO_size_t)); @@ -360,7 +360,7 @@ extern int _IO_file_sync __P((_IO_FILE*)); extern int _IO_file_close_it __P((_IO_FILE*)); extern _IO_fpos_t _IO_file_seek __P((_IO_FILE *, _IO_off_t, int)); -extern void _IO_file_finish __P((_IO_FILE*)); +extern void _IO_file_finish __P((_IO_FILE*, int)); /* Other file functions. */ extern _IO_FILE* _IO_file_attach __P((_IO_FILE *, int)); @@ -417,7 +417,7 @@ MAP_PRIVATE|MAP_ANONYMOUS, -1, 0); \ if (_B == (char *) -1) return (_R) #else -#define FREE_BUF(_B) free(_B) +#define FREE_BUF(_B, _S) free(_B) #define ALLOC_BUF(_B,_S,_R) _B = (char*)malloc(_S); \ if (_B == NULL) return (_R) #endif Index: linux/libc/libio/strops.c diff -u linux/libc/libio/strops.c:1.5 linux/libc/libio/strops.c:1.6 --- linux/libc/libio/strops.c:1.5 Fri Oct 4 15:52:58 1996 +++ linux/libc/libio/strops.c Fri Jun 27 09:33:00 1997 @@ -65,7 +65,7 @@ _IO_ssize_t _IO_str_count( register _IO_FILE * ); _IO_pos_t _IO_str_seekoff( register _IO_FILE *, _IO_off_t, int, int ); int _IO_str_pbackfail( register _IO_FILE *, int ); -void _IO_str_finish( register _IO_FILE * ); +void _IO_str_finish( register _IO_FILE *, int); void DEFUN(_IO_str_init_static, (fp, ptr, size, pstart), @@ -267,14 +267,14 @@ } void -DEFUN (_IO_str_finish, (fp), - register _IO_FILE* fp) +DEFUN (_IO_str_finish, (fp, dummy), + register _IO_FILE* fp AND int dummy) { if (fp->_IO_buf_base && !(fp->_flags & _IO_USER_BUF)) (((_IO_strfile*)fp)->_s._free_buffer)(fp->_IO_buf_base); fp->_IO_buf_base = NULL; - _IO_default_finish(fp); + _IO_default_finish(fp, 0); } struct _IO_jump_t _IO_str_jumps = { Index: linux/libc/nls/msgcat-libc.c diff -u linux/libc/nls/msgcat-libc.c:1.1.1.1 linux/libc/nls/msgcat-libc.c:1.2 --- linux/libc/nls/msgcat-libc.c:1.1.1.1 Fri Feb 17 21:33:23 1995 +++ linux/libc/nls/msgcat-libc.c Fri Jun 27 09:33:01 1997 @@ -7,12 +7,14 @@ #ifdef __linux__ #include #include +#include #include "nl_types.h" #define CATALOGUE "libc" nl_catd _libc_cat = 0; void libc_nls_init(void) { extern nl_catd _libc_cat; + int saved_errno = errno; if (_libc_cat != 0) /* * Either a previous catopen() failed @@ -24,6 +26,7 @@ /* Get the environment setting for LC_MESSAGES */ setlocale(LC_MESSAGES,""); _libc_cat=catopen(CATALOGUE,0); + errno = saved_errno; } #endif Index: linux/include/_G_config.h diff -u linux/include/_G_config.h:1.92 linux/include/_G_config.h:1.93 --- linux/include/_G_config.h:1.92 Fri May 30 19:23:13 1997 +++ linux/include/_G_config.h Fri Jun 27 09:33:22 1997 @@ -2,10 +2,10 @@ #ifndef _G_config_h #define _G_config_h -#define _LINUX_C_LIB_VERSION "5.4.33" +#define _LINUX_C_LIB_VERSION "5.4.34" #define _LINUX_C_LIB_VERSION_MAJOR 5 #define _LINUX_C_LIB_VERSION_MINOR 4 -#define _LINUX_C_LIB_VERSION_SUBMINOR 33 +#define _LINUX_C_LIB_VERSION_SUBMINOR 34 #define _G_LIB_VERSION "2.7.2" Index: linux/include/arpa/tftp.h diff -u linux/include/arpa/tftp.h:1.1.1.1 linux/include/arpa/tftp.h:1.2 --- linux/include/arpa/tftp.h:1.1.1.1 Fri Feb 17 21:34:08 1995 +++ linux/include/arpa/tftp.h Fri Jun 27 09:33:23 1997 @@ -53,7 +53,7 @@ struct tftphdr { short th_opcode; /* packet type */ union { - short tu_block; /* block # */ + unsigned short tu_block; /* block # */ short tu_code; /* error code */ char tu_stuff[1]; /* request packet stuff */ } th_u;