Commit graph

761 commits

Author SHA1 Message Date
okuji
eb5d4d6776 2005-01-30 Yoshinori K. Okuji <okuji@enbug.org>
* configure.ac (AC_INIT): Upgraded to 0.96.
2005-01-30 01:09:34 +00:00
jthomas
cce5686ea2 * docs/kernel.c.texi (cmain): Incremement mod by one, instead of
sizeof(module_t), since it's already a pointer of type module_t.
* docs/kernel.c (cmain): Do the same.
2004-10-10 22:47:23 +00:00
okuji
4022b1bcb5 2004-09-20 Yoshinori K. Okuji <okuji@enbug.org>
* docs/internals.texi (Internals): Changed to an appendix.

  * docs/grub.texi (@setchapternewpage): Changed to odd from off.
  (@contents): Moved to the beginning.
  (Future): Changed to an appendix.
2004-09-20 21:55:00 +00:00
okuji
8243a69201 2004-08-17 Yoshinori K. Okuji <okuji@enbug.org>
* stage2/cmdline.c (run_script): Fix a reversed conditional.
        Reported by Alban Crequy <alban.crequy@apinc.org>.
2004-08-16 23:25:44 +00:00
jthomas
577b70d724 - patch from Michael Hohnbaum <hohnbaum@us.ibm.com> to handle sparse files. 2004-08-07 06:48:58 +00:00
okuji
16ca69f719 2004-07-24 Yoshinori K. Okuji <okuji@enbug.org>
* stage2/stage2.c (cmain): Terminate DEFAULT_FILE with NUL
	correctly. Reported by Alban Crequy <alban.crequy@apinc.org>.
2004-07-24 18:58:02 +00:00
robertmh
255d37589f Patch from David Weinehall <tao@debian.org>
* util/mkbimage: Fix XSI-isms (for supporting POSIX-only shells).
2004-07-21 14:43:04 +00:00
robertmh
31831d933f * util/grub-install.in: Detect GNU/k*BSD systems as well. 2004-07-20 19:30:24 +00:00
okuji
e92d461e1c 2004-07-16 Yoshinori K. Okuji <okuji@enbug.org>
* util/grub-install.in (convert): Fix the sed statement for
        Linux. The expression was ambigious in some cases.
2004-07-16 11:49:58 +00:00
robertmh
b929761836 Fix minor syntax error (non-escaped characters). 2004-06-29 17:45:21 +00:00
robertmh
01eb2cd1f4 * util/grub-install.in: Improve usage message. 2004-06-24 17:10:09 +00:00
robertmh
b84bec9188 * stage1/Makefile.am: Move stage files to pkglibdir.
* stage2/Makefile.am: Likewise.
        * docs/grub.texi: s,/usr/share,/usr/lib,g.
        * util/grub-image.in: Look for stage files in pkglibdir.
        * util/grub-install.in: Likewise.
2004-06-24 17:04:55 +00:00
okuji
5b5f6dc772 2004-06-20 Yoshinori K. Okuji <okuji@enbug.org>
This is a big change on saving a default entry. This change
	makes it possible to set up a quite robust system using GRUB.
	Now we do not use the second sector of Stage 2 to store an
	entry number but use the file /boot/grub/default. This file
	must be generated by grub-set-default, although this file is
	plain-text.

	* util/grub-set-default.in: New file.

	* util/grub-install.in (grub_set_default): New variable.
	Use /grub instead of /boot/grub on OpenBSD as well as NetBSD.
	Run grub-set-default to make a default file.

	* util/Makefile.am (sbin_SCRIPTS): Added grub-set-default.

	* stage2/stage2.c (run_menu): Change the fallback handling to
	support multiple fallback entries.
	(cmain): Likewise. Also, get a saved entry from a default file
	if possible, before reading a config file.

	* stage2/shared.h (DEFAULT_FILE_BUF): New macro.
	(DEFAULT_FILE_BUFLEN): Likewise.
	(CMDLINE_BUF): Set to DEFAULT_FILE_BUF + DEFAULT_FILE_BUFLEN.
	(MENU_BUFLEN): Set to 0x8000 + PASSWORD_BUF - MENU_BUF.
	(fallback_entry): Removed.
	(fallback_entries): Declared.
	(fallback_entryno): Likewise.
	(MAX_FALLBACK_ENTRIES): New macro.

	* stage2/cmdline.c (run_script): Use FALLBACK_ENTRYNO instead of
	FALLBACK_ENTRY.

	* stage2/builtins.c (fallback_entry): Removed.
	(fallback_entryno): New variable.
	(fallback_entries): Likewise.
	(init_config): Initialize FALLBACK_ENTRYNO and FALLBACK_ENTRIES.
	(fallback_func): Rewritten completely.
	(savedefault_func): Likewise.

	* docs/grub.texi (grub-set-default): New direntry.
	(Installation): Describe grub-set-default for manual
	installations.
	(Making your system robust): New section.
	(Booting once-only): New subsection.
	(Booting fallback systems): Likewise.
	(fallback): Describe multiple fallback entries.
	(savedefault): Describe an optional argument.
	(Invoking grub-set-default): New chapter.
	(Future): Replaced with a description about GRUB 2.

	* configure.ac (AC_CONFIG_FILES): Added util/grub-set-default.
2004-06-20 13:48:47 +00:00
okuji
e15e075464 2004-06-19 Yoshinori K. Okuji <okuji@enbug.org>
* stage2/ufs2.h (int8_t): Renamed to ...
	(grub_uint8_t): ... this.
	(int16_t): Renamed to ...
	(grub_int16_t): ... this.
	(int32_t): Renamed to ...
	(grub_int32_t): ... this.
	(int64_t): Renamed to ...
	(grub_int64_t): ... this.
	(uint8_t): Renamed to ...
	(grub_uint8_t): ... this.
	(uint16_t): Renamed to ...
	(grub_uint16_t): ... this.
	(uint32_t): Renamed to ...
	(grub_uint32_t): ... this.
	(uint64_t): Renamed to ...
	(grub_uint64_t): ... this.
	(u_char): Renamed to ...
	(grub_u_char): ... this.
	(u_int): Renamed to ...
	(grub_u_int): ... this.
	(u_int8_t): Renamed to ...
	(grub_u_int8_t): ... this.
	(u_int16_t): Renamed to ...
	(grub_u_int16_t): ... this.
	(u_int32_t): Renamed to ...
	(grub_u_int32_t): ... this.
	(u_int64_t): Renamed to ...
	(grub_u_int64_t): ... this.
	(ino_t): Renamed to ...
	(grub_ino_t): ... this.
	All callers are changed.
2004-06-19 12:17:52 +00:00
jeroen
5b00a4c20d 2004-06-14 Jeroen Dekkers <jeroen@dekkers.cx>
* stage2/ufs2.h (__uint8_t): Remove.
	(__uint16_t): Likewise.
	(__uint32_t): Likewise.
	(__uint64_t): Likewise.
	(ino_t): Typedef to uint32_t.
2004-06-14 16:29:47 +00:00
okuji
4d4f67b1af 2004-06-13 Yoshinori K. Okuji <okuji@enbug.org>
* stage2/Makefile.am (noinst_HEADERS): Added ufs2.h.
2004-06-13 19:15:56 +00:00
okuji
e86d8458da Set the release date of 0.95. 2004-06-13 17:50:27 +00:00
okuji
3a65add281 2004-06-13 Yoshinori K. Okuji <okuji@enbug.org>
* configure.ac (AC_INIT): Upgraded to 0.95.
2004-06-13 17:49:52 +00:00
okuji
e43909c66d 2004-05-23 Yoshinori K. Okuji <okuji@enbug.org>
* stage2/char_io.c (grub_isspace): Use a switch sentense instead
	of an if sentense, because that reduces the size.

	* lib/device.c (read_device_map): Change the max number of DRIVE
	to 127 from 8. This was too strict.

	* stage2/asm.S (stop_floppy): Call pusha and popa outside the
	block of real mode code. Reported by Guillem Jover
	<guillem@debian.org>.
2004-05-23 16:45:45 +00:00
okuji
31def8459d 2004-05-20 Damian Ivereigh <damian@cisco.com>
* netboot/main.c: Fixed bootp only code so that options
        work properly. This fix is obvious when compared with the
        DHCP code.
2004-05-20 22:17:27 +00:00
proski
12ce4272ee * stage2/char_io.c (safe_parse_maxint): Disable for stage 1.5.
(grub_tolower): Disable for stage 1.5 except fat_stage1_5.
(grub_memcmp): Disable for stage 1.5 except iso9660_stage1_5.
2004-05-17 14:10:45 +00:00
okuji
dc8bf1d248 2004-05-14 Yoshinori K. Okuji <okuji@enbug.org>
From Sergey Matveychuk <sem@ciam.ru>:
	* stage2/size_test: Added a check for ufs2_stage1_5.

	* stage2/shared.h (STAGE2_ID_UFS2_STAGE1_5): New macro.
	[FSYS_UFS2] (STAGE2_ID): Set to STAGE2_ID_UFS2_STAGE1_5.

	* stage2/filesys.h (FSYS_UFS2_NUM): New macro.
	[FSYS_UFS2] (ufs2_mount): New prototype.
	[FSYS_UFS2] (ufs2_read): Likewise.
	[FSYS_UFS2] (ufs2_dir): Likewise.
	[FSYS_UFS2] (ufs2_embed): Likewise.
	(NUM_FSYS): Added FSYS_UFS2_NUM.

	* stage2/disk_io.c (fsys_table): Added an ufs2 entry.

	* stage2/builtins.c (setup_func): Added ufs2 into the
	STAGE1_5_MAP.

	* stage2/Makefile.am (libgrub_a_SOURCES): Added fsys_ufs2.c.
	(libgrub_a_CFLAGS): Added -DFSYS_UFS2=1.
	(pkgdata_DATA): Added ufs2_stage1_5.
	(noinst_PROGRAMS): Added ufs2_stage1_5.exec.
	(ufs2_stage1_5_exec_SOURCES): New variable.
	(ufs2_stage1_5_exec_CFLAGS): Likewise.
	(ufs2_stage1_5_exec_CCASFLAGS): Likewise.
	(ufs2_stage1_5_exec_LDFLAGS): Likewise.

	* grub/Makefile.am (AM_CPPFLAGS): Added -DFSYS_ISO9660=1,
	-DFSYS_JFS=1, -DFSYS_REISERFS=1, -DFSYS_UFS2=1, -DFSYS_VSTAFS=1,
	-DFSYS_XFS=1, and -DUSE_MD5_PASSWORDS=1.

	* configure.ac (--disable-ufs2): New option.

	* stage2/fsys_ufs2.c: New file.
	* stage2/ufs2.h: Likewise.
2004-05-14 20:16:55 +00:00
robertmh
7b676b85ea 2004-05-10 Robert Millan <robertmh@gnu.org>
* lib/device.c: Mangle __FreeBSD_* macro usage to support
        kFreeBSD-based non-FreeBSD systems (i.e. GNU/kFreeBSD).

        Implement runtime detection of version of kFreeBSD. Now if
        we build against kFreeBSD 5.x headers the GRUB shell will work on
        both 4.x and 5.x.

        Replace `u_int_t' types with portable `unsigned int' and old
        reference to `geometry' structure to new `geom' one.

        * docs/menu.lst: Split GNU/kFreeBSD and GNU/kNetBSD as separate
        options than FreeBSD and NetBSD, respectively. There are minor
        differences now (different paths).
2004-05-10 21:46:49 +00:00
proski
6355ac9d94 * stage2/char_io.c (convert_to_ascii): Remove "%b" support.
It's non-standard and is not used anymore.
(grub_printf): Likewise.
2004-05-03 13:27:34 +00:00
proski
3fa2fbb8bd Add stage2_eltorito and start_eltorito. 2004-05-02 15:10:27 +00:00
robertmh
84fbf16f40 From Yann Dirson <dirson@debian.org>:
* util/mkbimage: Misc syntax fixes.
2004-04-29 19:45:11 +00:00
jeroen
50396703ad 2004-04-29 Jeroen Dekkers <jeroen@dekkers.cx>
* stage2/char_io.c (grub_memcmp): Define for stage1.5 too.

	* stage2/fsys_iso9660.c (iso9660_mount): Use memcmp() instead of
	__builtin_memcmp().
	(iso9660_dir): Likewise.
2004-04-29 09:57:09 +00:00
jeroen
6525b81507 Fix typo 2004-04-27 21:32:28 +00:00
okuji
11902433a2 Add Christian. 2004-04-27 20:48:50 +00:00
okuji
fcac0d870d 2004-04-26 Christian Jones <chjones@aleph0.com>
* docs/grub.texi (Making a GRUB bootable CD-ROM): minor edits,
        including a few compatibility notes and a change to
        -boot-load-size 4 for the mkisofs command.
2004-04-27 20:47:43 +00:00
jeroen
3316fed9db Regenerated 2004-04-23 13:49:16 +00:00
jeroen
b9d0cc9dcf 2004-04-22 Jeroen Dekkers <jeroen@dekkers.cx>
* Makefile.am (AUTOMAKE_OPTIONS): Add "gnu".
	* configure.ac: Update to work with automake 1.8, quote all
	AC_DEFUN's correctly and provide descriptions for AC_DEFINE's.
	* acinclude.m4: Likewise.
	* acconfig.h: Removed.

	* stage1/Makefile.am (.exec): Use suffix rules instead of pattern
	rules.
	* stage2/Makefile.am (.exec): Likewise.
2004-04-23 13:43:40 +00:00
jeroen
5d759a9d09 Update 2004-04-23 13:40:51 +00:00
jeroen
caa7c3508b Add autom4te.cache 2004-04-23 13:25:15 +00:00
okuji
de89ab8289 2004-04-18 Yoshinori K. Okuji <okuji@enbug.org>
* docs/grub.texi (Making a GRUB bootable CD-ROM): New section.

	* stage2/disk_io.c (set_device): Use CH instead of *DEVICE to
	test the first character of DEVICE, because DEVICE is
	incremented.
	Reported by Bernhard Treutwein.
2004-04-18 12:39:39 +00:00
okuji
4e69adb6ab 2004-04-15 Yoshinori K. Okuji <okuji@enbug.org>
* netboot/fsys_tftp.c (buf_fill): Cast 1 to unsigned short
	explicitly so that the constant doesn't extend unsigned short
	to int automatically.
	Reported by Eduard Guzovsky <eguzovsk@enterasys.com>.

	* docs/grub.texi (Invoking grub-md5-crypt): Fixed the chapter
	name.
	Reported by Martin Pool <mbp@sourcefrog.net>.
2004-04-15 11:50:29 +00:00
okuji
0accb2cab8 2004-04-04 Yoshinori K. Okuji <okuji@enbug.org>
* configure.ac (STAGE2_CFLAGS): Check if -fno-stack-protector is
	supported by GCC. If yes, added the option. This is necessary
	for OpenBSD, because the stack protector defines additional
	symbols. Reported by uc.sheda <uc.sheda@laposte.net>.
2004-04-04 09:15:43 +00:00
proski
065f6e0a20 * stage2/boot.c: Imply --no-mem-option for Linux kernels with
protocol version 2.03 and above (Linux 2.4.18 and newer).
2004-03-29 14:54:30 +00:00
okuji
4f29a8af45 2004-03-27 Yoshinori K. Okuji <okuji@enbug.org>
* stage2/char_io.c [!GRUB_UTIL] (memcpy): New function. It is
	defined as an alias of grub_memmove. This is copied from GRUB 2.

	* stage2/disk_io.c (print_completions): Simplified conditionals
	to make it easier to edit the file with Emacs.
	Added support for (cd).
	(set_device): Likewise.

	* stage2/common.c (init_bios_info): Check if BOOT_DRIVE is a
	CDROM drive. If it is true, set CDROM_DRIVE to BOOT_DRIVE.
	(cdrom_drive): New variable.

	From Leonid Lisovskiy <lly@pisem.net>:
	* stage2/start_eltorito.S: New file.

	* stage2/stage2.c (run_menu): Use GRUB_INVALID_DRIVE instead of
	0xFF.

	* stage2/shared.h (STAGE2_ID_ISO9660_STAGE1_5): New macro.
	[FSYS_ISO9660] (STAGE2_ID): Set to STAGE2_ID_ISO9660_STAGE1_5.
	(struct geometry): Added a new member ``sector_size''.
	(BIOSDISK_FLAG_CDROM): New macro.
	(cdrom_drive): Declared.

	* stage2/fsys_iso9660.c: New file.
	* stage2/iso9660.h: Likewise.

	* stage2/filesys.h (FSYS_ISO9660_NUM): New macro.
	[FSYS_ISO9660] (iso9660_mount): Declared.
	[FSYS_ISO9660] (iso9660_read): Likewise.
	[FSYS_ISO9660] (iso9660_dir): Likewise.
	(NUM_FSYS): Added FSYS_ISO9660_NUM.

	* stage2/disk_io.c (fsys_table) [FSYS_ISO9660]: Added iso9660.
	(current_drive): Use GRUB_INVALID_DRIVE.
	(log2): New function.
	(rawread): Use BUF_GEOM.SECTOR_SIZE instead of SECTOR_SIZE.
	Change the type of BUFADDR from int to char *.
	Use a virtual track to make sure that one track fits in the
	buffer.
	(sane_partition): Allow CURRENT_DRIVE to be CDROM_DRIVE, because
	a bios drive for a CD-ROM is often assigned to greater than
	0x88.
	(set_device): Use GRUB_INVALID_DRIVE instead of 0xFF.
	(setup_part): Likewise.

	* stage2/cmdline.c (init_cmdline): Use GRUB_INVALID_DRIVE.

	* stage2/builtins.c (install_func): Use GRUB_INVALID_DRIVE.
	(setup_func): Added iso9660_stage1_5.

	* stage2/bios.c (biosdisk): Don't fall back to the CHS mode
	if the drive is a CDROM.
	(get_cdinfo): New function.
	(get_diskinfo): Call get_cdinfo if the drive is greater than or
	equal to 0x88 or the drive supports LBA.
	Set the sector size to SECTOR_SIZE if it is not a CD-ROM.

	* stage2/asm.S (biosdisk_int13_extensions): Take a word
	argument AX instead of a byte argument AH.
	(get_diskinfo_int13_extensions): Removed.

	* stage2/Makefile.am (noinst_HEADERS): Added iso9660.h.
	(libgrub_a_SOURCES): Added fsys_iso9660.c.
	(libgrub_a_CFLAGS): Added -DFSYS_ISO9660=1.
	(pkgdata_DATA): Added iso9660_stage1_5 and stage2_eltorito.
	(noinst_PROGRAMS): Added iso9660_stage1_5.exec and
	start_eltorito.exec.
	(noinst_DATA): Added start_eltorito.
	(pre_stage2_exec_SOURCES): Added fsys_iso9660.c.
	(START_ELTORITO_LINK): New variable.
	(start_eltorito_exec_SOURCES): Likewise.
	(start_eltorito_exec_CCASFLAGS): Likewise.
	(start_eltorito_exec_LDFLAGS): Likewise.
	(start_eltorito_exec-start.$(OBJEXT)): New dependency.
	(stage2_eltorito): New target.
	(iso9660_stage1_5_exec_SOURCES): New variable.
	(iso9660_stage1_5_exec_CFLAGS): Likewise.
	(iso9660_stage1_5_exec_CCASFLAGS): Likewise.
	(iso9660_stage1_5_exec_LDFLAGS): Likewise.

	* stage1/stage1.h (GRUB_INVALID_DRIVE): New macro.

	* stage1/stage1.S (boot_drive): Use the macro GRUB_INVALID_DRIVE.
	(real_start): Likewise.

	* lib/device.c (get_drive_geometry): Set GEOM->SECTOR_SIZE to
	SECTOR_SIZE by default.

	* configure.ac (--disable-iso9660): New option.
2004-03-27 17:02:54 +00:00
okuji
a1d48b992f 2004-03-13 Yoshinori K. Okuji <okuji@enbug.org>
From Daniele Zelante <zeldan@email.it>:
	* stage2/asm.S (stop_floppy): Use INT 13, AH=00h to stop the
	floppy controller instead of a direct I/O.
2004-03-13 10:28:46 +00:00
okuji
7b43bbe40e 2004-03-12 Yoshinori K. Okuji <okuji@enbug.org>
* stage2/serial.c (serial_putchar): Handle the character code
	127 as a backspace. Reported by Florian Engelhardt
	<f.engelhardt@gmx.net>.
2004-03-12 18:27:23 +00:00
okuji
b42b9b7e22 2004-03-12 Yoshinori K. Okuji <okuji@enbug.org>
From Boji Tony Kannanthanam <boji.t.kannanthanam@intel.com>:
	* util/grub-install.in (convert): Add support for ATARAID
	device names.
	* lib/device.c (get_ataraid_disk_name) [__linux__]: New
	function.
	(init_device_map) [__linux__]: Probe ATARAID disks.

	* stage2/size_test (check): Don't use the local statement any
	longer. It was unneeded actually. Reported by Paul Jarc.
2004-03-12 18:16:40 +00:00
okuji
9b1392428c 2004-03-12 Yoshinori K. Okuji <okuji@enbug.org>
From Sergey Matveychuk <sem@ciam.ru>:
	* lib/device.c (get_drive_geometry): Do not open the same device
	more than once unnecessarily.
	(get_drive_geometry) [__FreeBSD_version >= 500040]: Use new
	ioctl methods.
	(get_floppy_disk_name) [__FreeBSD__ >= 4]: Use /dev/fd%d rather
	than /dev/rfd%d.
	(get_ide_disk_name) [__FreeBSD__ >= 4]: Use /dev/ad%d rather
	than /dev/rad%d.
	(get_scsi_disk_name) [__FreeBSD__ >= 4]: Use /dev/da%d rather
	than /dev/rda%d.
	* grub/asmstub.c (get_diskinfo): Check if ERRNO is EPERM as
	well.
2004-03-12 17:31:51 +00:00
jeroen
8f31d2ff88 2004-02-28 Jeroen Dekkers <jeroen@dekkers.cx>
* docs/grub.texi (partnew): Change @var{to} to @var{len}.
2004-03-01 10:52:31 +00:00
okuji
54566a13ae 2004-02-18 Yoshinori K. Okuji <okuji@enbug.org>
From Yury V. Umanets <umka@namesys.com>:
	* stage2/fsys_reiserfs.c (REISER3FS_SUPER_MAGIC_STRING): New
	macro.
	(reiserfs_mount): Added checks for ReiserFS 3.
	(reiserfs_embed): Likewise.

2004-01-25  Yoshinori K. Okuji  <okuji@enbug.org>

	* docs/grub.texi (Obtaining and Building GRUB): Instead of
	describing how to use the anoncvs method, specify the URL of
	the description page on Savannah.
	Reported by Bernhard Treutwein.
2004-02-18 22:10:00 +00:00
okuji
36caa9beb0 Add the release date of 0.94. 2004-01-25 15:54:11 +00:00
okuji
2524288202 Add some entries. 2004-01-18 20:03:05 +00:00
okuji
dcf4389bde 2004-01-18 Yoshinori K. Okuji <okuji@enbug.org>
From Thomas Schwinge <kischde@gmx.net>:
	* grub/Makefile.am (AM_CPPFLAGS): New variable.
	(AM_CFLAGS): Removed all cpp flags.

	* stage2/xfs.h (__int8_t): Renamed to ...
	(xfs_int8_t): ... this.
	(__uint8_t): Renamed to ...
	(xfs_uint8_t): ... this.
	(__int16_t): Renamed to ...
	(xfs_int16_t): ... this.
	(__uint16_t): Renamed to ...
	(xfs_uint16_t): ... this.
	(__int32_t): Renamed to ...
	(xfs_int32_t): ... this.
	(__uint32_t): Renamed to ...
	(xfs_uint32_t): ... this.
	(__int64_t): Renamed to ...
	(xfs_int64_t): ... this.
	(__uint64_t): Renamed to ...
	(xfs_uint64_t): ... this.
	All callers are changed.x

	From Egmont Koblinger <egmont@uhulinux.hu>:
	* util/grub-install.in: Support an install devices in GRUB's
	notation without parentheses.

	* docs/grub.texi (Installing GRUB using grub-install): Added an
	example of using grub-install without parentheses.
2004-01-18 19:47:18 +00:00
okuji
469abceb70 2004-01-18 Yoshinori K. Okuji <okuji@enbug.org>
* util/grub-install.in: Use the first word of GRUB_SHELL when
	checking if the grub shell is present. This is necessary to
	support options to the grub shell (e.g. grub --read-only).

	From Eric Kvaalen <E_Kvaalen.Arnesen@noos.fr>:
	* docs/grub.texi: Many bug fixes.
2004-01-18 18:33:30 +00:00
okuji
7b7b9a3f1b 2004-01-17 Yoshinori K. Okuji <okuji@enbug.org>
* lib/device.c [__linux__] (MAJOR): Support 32 bit and 64 bit
	dev_t. This code is stolen from glibc.
	Suggested by Shen Feng <shen@nanjing-fnst.com>.
2004-01-17 16:00:03 +00:00