From c7f7281eca160b12767b9e3c25b443bce13512a2 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Mon, 26 Jul 1999 02:38:26 +0000 Subject: Update. * libio/iofclose.c (_IO_new_fclose): Detect new streams and handle them appropriately. * libio/oldiofclose.c (_IO_old_fclose): Likewise. --- ChangeLog | 4 ++++ FAQ | 20 ++++++++++++++++++++ libio/iofclose.c | 8 +++++++- libio/oldiofclose.c | 6 ++++++ manual/sysinfo.texi | 15 +++++++++++++++ 5 files changed, 52 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index b9c5c23ab0..0e39609a09 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 1999-07-25 Ulrich Drepper + * libio/iofclose.c (_IO_new_fclose): Detect new streams and handle + them appropriately. + * libio/oldiofclose.c (_IO_old_fclose): Likewise. + * misc/mntent_r.c: Allow spaces and tabs in entry names by encoding these characters. * misc/tst-mntent.c: Add test case for addmntent and getmntent. diff --git a/FAQ b/FAQ index 08ed73ec3c..ac9fd12684 100644 --- a/FAQ +++ b/FAQ @@ -41,6 +41,9 @@ please let me know. 1.15. What's the problem with configure --enable-omitfp? 1.16. I get failures during `make check'. What should I do? 1.17. What is symbol versioning good for? Do I need it? +1.18. How can I compile on my fast ix86 machine a working libc for my slow + i386? After installing libc, programs abort with "Illegal + Instruction". 2. Installation and configuration issues @@ -514,6 +517,23 @@ compatibility - forever! The binary compatibility you lose is not only against the previous version of the GNU libc (version 2.0) but also against all future versions. + +1.18. How can I compile on my fast ix86 machine a working libc for my slow + i386? After installing libc, programs abort with "Illegal + Instruction". + +{AJ} glibc and gcc might generate some instructions on your machine that +aren't available on i386. You've got to tell glibc that you're configuring +for i386 with adding i386 as your machine, for example: + + ../configure --prefix=/usr i386-pc-linux-gnu + +And you need to tell gcc to only generate i386 code, just add `-mcpu=i386' +(just -m386 doesn't work) to your CFLAGS. + +{UD} This applies not only to the i386. Compiling on a i686 for any older +model will also fail if the above methods are not used. + . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . diff --git a/libio/iofclose.c b/libio/iofclose.c index 61f7800ed8..b9cb0a9980 100644 --- a/libio/iofclose.c +++ b/libio/iofclose.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1993, 1995, 1997, 1998 Free Software Foundation, Inc. +/* Copyright (C) 1993, 1995, 1997, 1998, 1999 Free Software Foundation, Inc. This file is part of the GNU IO Library. This library is free software; you can redistribute it and/or @@ -36,6 +36,12 @@ _IO_new_fclose (fp) CHECK_FILE(fp, EOF); + /* We desperately try to help programs which are using streams in a + strange way and mix old and new functions. Detect old streams + here. */ + if (fp->_vtable_offset != 0) + return _IO_old_fclose (fp); + _IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile, fp); _IO_flockfile (fp); if (fp->_IO_file_flags & _IO_IS_FILEBUF) diff --git a/libio/oldiofclose.c b/libio/oldiofclose.c index 51781366d6..8ddad32b04 100644 --- a/libio/oldiofclose.c +++ b/libio/oldiofclose.c @@ -37,6 +37,12 @@ _IO_old_fclose (fp) CHECK_FILE(fp, EOF); + /* We desperately try to help programs which are using streams in a + strange way and mix old and new functions. Detect new streams + here. */ + if (fp->_vtable_offset == 0) + return _IO_new_fclose (fp); + _IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile, fp); _IO_flockfile (fp); if (fp->_IO_file_flags & _IO_IS_FILEBUF) diff --git a/manual/sysinfo.texi b/manual/sysinfo.texi index 5f599c44e5..08283c070b 100644 --- a/manual/sysinfo.texi +++ b/manual/sysinfo.texi @@ -495,6 +495,14 @@ a pointer to a static variable of type @code{struct mntent} which is filled with the information from the next entry from the file currently read. +The file format used prescribes the use of spaces or tab characters to +separate the fields. This makes it harder to use name containing one of +these characters (e.g., mount points using spaces). Therefore these +characters are encoded in the files and the @code{getmntent} function +takes care of the decoding while reading the entries back in. +@code{'\040'} is used to encode a space character, @code{'\012'} to +encode a tab character and @code{'\\'} to encode a backslash. + If there was an error or the end of the file is reached the return value is @code{NULL}. @@ -514,6 +522,9 @@ pointed to by the @var{result} parameter. Additional information (e.g., the strings pointed to by the elements of the result) are kept in the buffer of size @var{bufsize} pointed to by @var{buffer}. +Escaped characters (space, tab, backslash) are converted back in the +same way as it happens for @code{getmentent}. + The function returns a @code{NULL} pointer in error cases. Errors could be: @itemize @bullet @item @@ -539,6 +550,10 @@ to create a new file while leaving out the entry to be removed and after closing the file remove the old one and rename the new file to the chosen name. +This function takes care of spaces and tab characters in the names to be +written to the file. It converts them and the backslash character into +the format describe in the @code{getmntent} description above. + This function returns @math{0} in case the operation was successful. Otherwise the return value is @math{1} and @code{errno} is set appropriately. -- cgit v1.2.3