mirror of
git://sourceware.org/git/glibc.git
synced 2025-03-06 20:58:33 +01:00
Update from main archive 961219
Thu Dec 19 23:28:33 1996 Ulrich Drepper <drepper@cygnus.com> * resolv/resolv.h: Update from BIND 4.9.5-P1. * resolv/res_comp.c: Likewise. * resolv/res_debug.c: Likewise. * resolv/Banner: Update version number. Thu Dec 19 20:58:53 1996 Ulrich Drepper <drepper@cygnus.com> * elf/dlfcn.h: Add extern "C" wrapper. * io/utime.h: Don't define NULL since this isn't allowed in POSIX. * io/sys/stat.h: Declare `lstat' only if __USE_BSD || __USE_XOPEN_EXTENDED. * locale/locale.h: Define NULL. * math/math.c: Don't include <errno.h> to define math errors. * stdlib/stdlib.h: Likewise. * posix/unistd.h: Don't declare environ. * posix/sys/utsname.h (struct utsname): Declare member domainname as __domainname is !__USE_GNU. * signal/signal.h: Declare size_t only if __USE_BSD || __USE_XOPEN_EXTENDED. * stdio/stdio.h: Don't declare cuserid when __USE_POSIX, but instead when __USE_XOPEN. * string/string.h: Define strndup only if __USE_GNU. * sysdeps/unix/sysv/linux/clock.c: New file. * sysdeps/unix/sysv/linux/timebits.h: Define CLOCKS_PER_SEC as 1000000 per X/Open standard. * features.h: Add code to recognize _POSIX_C_SOURCE value 199309. Define __USE_POSIX199309. * posix/unistd.h: Declare fdatasync only if __USE_POSIX199309. * time/time.c: Declare nanosleep only if __USE_POSIX199309. Patches by Rdiger Helsch <rh@unifix.de>. * locale/locale.h: Add declaration of newlocale and freelocale. * new-malloc/Makefile (distibute): Add mtrace.awk. (dist-routines): Add mcheck and mtrace. (install-lib, non-lib.a): Define as libmcheck.a. * new-malloc/malloc.h: Add declaration of __malloc_initialized. * new-malloc/mcheck.c: New file. * new-malloc/mcheck.h: New file. * new-malloc/mtrace.c: New file. * new-malloc/mtrace.awk: New file. * posix/unistd.h: Correct prototype for usleep. * sysdeps/unix/bsd/usleep.c: De-ANSI-declfy. Correct return type. * sysdeps/unix/sysv/linux/usleep.c: Real implementation based on nanosleep. * signal/signal.h: Change protoype of __sigpause to take two arguments. Remove prototype for sigpause. Add two different macros named sigpause selected when __USE_BSD or __USE_XOPEN are defined. This is necessary since the old BSD definition of theis function collides with the X/Open definition. * sysdeps/posix/sigpause.c: Change function definition to also fit X/Open definition. * sysdeps/libm-i387/e_exp.S: Make sure stack is empty when the function is left. * sysdeps/libm-i387/e_expl.S: Likewise. Patch by HJ Lu. 1996-12-17 Paul Eggert <eggert@twinsun.com> * many, many files: Spelling corrections. * catgets/catgetsinfo.h (mmapped): Renamed from mmaped (in struct catalog_info.status). * mach/err_kern.sub (err_codes_unix), string/stratcliff.c (main): Fix spelling in message. * po/libc.pot: Fix spelling in message for `zic'; this anticipates a fix in the tzcode distribution. Wed Dec 18 15:48:02 1996 Ulrich Drepper <drepper@cygnus.com> * time/strftime.c: Implement ^ flag to cause output be converted to use upper case characters. * time/zic.c: Update from ADO tzcode1996n. Wed Dec 18 14:29:24 1996 Erik Naggum <erik@naggum.no> * time/strftime.c (add): Don't change global `i' until all is over. Define NULL is not already defined. Tue Dec 17 09:49:03 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * libio/iovsprintf.c (_IO_vsprintf): Change `&sf' to `&sf._sbf._f' to avoid the need for a cast. * libio/iovsscanf.c (_IO_vsscanf): Likewise. * sunrpc/rpc/xdr.h: Add prototype for xdr_free.
This commit is contained in:
parent
10dc2a90b7
commit
6d52618b15
262 changed files with 2828 additions and 1949 deletions
93
ChangeLog
93
ChangeLog
|
@ -1,3 +1,94 @@
|
|||
Thu Dec 19 23:28:33 1996 Ulrich Drepper <drepper@cygnus.com>
|
||||
|
||||
* resolv/resolv.h: Update from BIND 4.9.5-P1.
|
||||
* resolv/res_comp.c: Likewise.
|
||||
* resolv/res_debug.c: Likewise.
|
||||
* resolv/Banner: Update version number.
|
||||
|
||||
Thu Dec 19 20:58:53 1996 Ulrich Drepper <drepper@cygnus.com>
|
||||
|
||||
* elf/dlfcn.h: Add extern "C" wrapper.
|
||||
|
||||
* io/utime.h: Don't define NULL since this isn't allowed in POSIX.
|
||||
* io/sys/stat.h: Declare `lstat' only if __USE_BSD ||
|
||||
__USE_XOPEN_EXTENDED.
|
||||
* locale/locale.h: Define NULL.
|
||||
* math/math.c: Don't include <errno.h> to define math errors.
|
||||
* stdlib/stdlib.h: Likewise.
|
||||
* posix/unistd.h: Don't declare environ.
|
||||
* posix/sys/utsname.h (struct utsname): Declare member domainname
|
||||
as __domainname is !__USE_GNU.
|
||||
* signal/signal.h: Declare size_t only if __USE_BSD ||
|
||||
__USE_XOPEN_EXTENDED.
|
||||
* stdio/stdio.h: Don't declare cuserid when __USE_POSIX, but
|
||||
instead when __USE_XOPEN.
|
||||
* string/string.h: Define strndup only if __USE_GNU.
|
||||
* sysdeps/unix/sysv/linux/clock.c: New file.
|
||||
* sysdeps/unix/sysv/linux/timebits.h: Define CLOCKS_PER_SEC as
|
||||
1000000 per X/Open standard.
|
||||
* features.h: Add code to recognize _POSIX_C_SOURCE value 199309.
|
||||
Define __USE_POSIX199309.
|
||||
* posix/unistd.h: Declare fdatasync only if __USE_POSIX199309.
|
||||
* time/time.c: Declare nanosleep only if __USE_POSIX199309.
|
||||
Patches by Rüdiger Helsch <rh@unifix.de>.
|
||||
|
||||
* locale/locale.h: Add declaration of newlocale and freelocale.
|
||||
|
||||
* new-malloc/Makefile (distibute): Add mtrace.awk.
|
||||
(dist-routines): Add mcheck and mtrace.
|
||||
(install-lib, non-lib.a): Define as libmcheck.a.
|
||||
* new-malloc/malloc.h: Add declaration of __malloc_initialized.
|
||||
* new-malloc/mcheck.c: New file.
|
||||
* new-malloc/mcheck.h: New file.
|
||||
* new-malloc/mtrace.c: New file.
|
||||
* new-malloc/mtrace.awk: New file.
|
||||
|
||||
* posix/unistd.h: Correct prototype for usleep.
|
||||
* sysdeps/unix/bsd/usleep.c: De-ANSI-declfy. Correct return type.
|
||||
* sysdeps/unix/sysv/linux/usleep.c: Real implementation based on
|
||||
nanosleep.
|
||||
|
||||
* signal/signal.h: Change protoype of __sigpause to take two
|
||||
arguments. Remove prototype for sigpause. Add two different
|
||||
macros named sigpause selected when __USE_BSD or __USE_XOPEN
|
||||
are defined. This is necessary since the old BSD definition
|
||||
of theis function collides with the X/Open definition.
|
||||
* sysdeps/posix/sigpause.c: Change function definition to also
|
||||
fit X/Open definition.
|
||||
|
||||
* sysdeps/libm-i387/e_exp.S: Make sure stack is empty when the
|
||||
function is left.
|
||||
* sysdeps/libm-i387/e_expl.S: Likewise.
|
||||
Patch by HJ Lu.
|
||||
|
||||
1996-12-17 Paul Eggert <eggert@twinsun.com>
|
||||
|
||||
* many, many files: Spelling corrections.
|
||||
* catgets/catgetsinfo.h (mmapped):
|
||||
Renamed from mmaped (in struct catalog_info.status).
|
||||
* mach/err_kern.sub (err_codes_unix), string/stratcliff.c (main):
|
||||
Fix spelling in message.
|
||||
* po/libc.pot: Fix spelling in message for `zic'; this anticipates
|
||||
a fix in the tzcode distribution.
|
||||
|
||||
Wed Dec 18 15:48:02 1996 Ulrich Drepper <drepper@cygnus.com>
|
||||
|
||||
* time/strftime.c: Implement ^ flag to cause output be converted
|
||||
to use upper case characters.
|
||||
|
||||
* time/zic.c: Update from ADO tzcode1996n.
|
||||
|
||||
Wed Dec 18 14:29:24 1996 Erik Naggum <erik@naggum.no>
|
||||
|
||||
* time/strftime.c (add): Don't change global `i' until all is over.
|
||||
Define NULL is not already defined.
|
||||
|
||||
Tue Dec 17 09:49:03 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
|
||||
|
||||
* libio/iovsprintf.c (_IO_vsprintf): Change `&sf' to `&sf._sbf._f'
|
||||
to avoid the need for a cast.
|
||||
* libio/iovsscanf.c (_IO_vsscanf): Likewise.
|
||||
|
||||
Wed Dec 18 03:31:58 1996 Ulrich Drepper <drepper@cygnus.com>
|
||||
|
||||
* dirent/scandir.c: Undo change from Mon Dec 2 15:32:15 1996.
|
||||
|
@ -21,7 +112,7 @@ Wed Dec 18 03:31:58 1996 Ulrich Drepper <drepper@cygnus.com>
|
|||
* new-malloc/malloc.h: Likewise.
|
||||
|
||||
* nis/ypclnt.c: Remove prototype for xdr_free.
|
||||
* snrpc/rpc/xdr.h: Add prototype for xdr_free.
|
||||
* sunrpc/rpc/xdr.h: Add prototype for xdr_free.
|
||||
|
||||
* manual/nss.texi: Correct description of default values and don't
|
||||
meantion NSS as an add-on.
|
||||
|
|
|
@ -403,7 +403,7 @@ M4 = m4
|
|||
.NOEXPORT:
|
||||
|
||||
# We want to echo the commands we're running without
|
||||
# umpteem zillion filenames along with it (we use `...' instead)
|
||||
# umpteen zillion filenames along with it (we use `...' instead)
|
||||
# but we don't want this echoing done when the user has said
|
||||
# he doesn't want to see commands echoed by using -s.
|
||||
ifneq "$(findstring s,$(MAKEFLAGS))" "" # if -s
|
||||
|
|
4
NEWS
4
NEWS
|
@ -190,7 +190,7 @@ Version 2.0
|
|||
`struct sockaddr *' type, does not generate a type-clash warning.
|
||||
|
||||
* New function `error' declared in header file <error.h> is a convenient
|
||||
function for printing error messages and optionally exitting; this is the
|
||||
function for printing error messages and optionally exiting; this is the
|
||||
canonical function used in GNU programs. The new functions `err', `warn',
|
||||
and friends in header file <err.h> are the canonical 4.4 BSD interface for
|
||||
doing the same thing.
|
||||
|
@ -205,7 +205,7 @@ Version 2.0
|
|||
* We have incorporated the 4.4 BSD `db' library (version 1.85). New header
|
||||
files <db.h> and <mpool.h> provide a rich set of functions for several
|
||||
types of simple databases stored in memory and in files, and <ndbm.h> is
|
||||
an old `ndbm'-compatbile interface using the `db' functions. Link with
|
||||
an old `ndbm'-compatible interface using the `db' functions. Link with
|
||||
`-ldb' to get these functions.
|
||||
|
||||
* New macro `strdupa' copies a string like `strdup', but uses local stack
|
||||
|
|
17
PROJECTS
17
PROJECTS
|
@ -74,26 +74,13 @@ contact <bug-glibc@prep.ai.mit.edu>
|
|||
It is planed to do a complete rewrite.
|
||||
|
||||
|
||||
[10] Add mmap() support to malloc().
|
||||
Doug Lea's malloc implementation might give some ideas. Perhaps
|
||||
switching completly to his implementation is an option if it
|
||||
a) can work without mmap() support (not all system GNU libc
|
||||
is running on have mmap)
|
||||
b) is without mmap support at least as fast as the current
|
||||
implementation
|
||||
c) will be extended with the current hooks and additional functions
|
||||
|
||||
Please contact bug-glibc@prep.ai.mit.edu before starting to avoid
|
||||
duplicated work.
|
||||
|
||||
|
||||
[11] Write access function for netmasks, bootparams, and automount
|
||||
[10] Write access function for netmasks, bootparams, and automount
|
||||
databases for nss_files and nss_db module.
|
||||
The functions should be embedded in the nss scheme. This is not
|
||||
hard and not all services must be supported at once.
|
||||
|
||||
|
||||
[12] Rewrite utmp/wtmp functions to use database functions. This is much
|
||||
[11] Rewrite utmp/wtmp functions to use database functions. This is much
|
||||
better than the normal flat file format.
|
||||
|
||||
Please contact bug-glibc@prep.ai.mit.edu before starting to avoid
|
||||
|
|
2
Rules
2
Rules
|
@ -77,7 +77,7 @@ $(common-objpfx)empty.c:
|
|||
cp -f /dev/null $@
|
||||
common-generated := $(common-generated) dummy.o dummy.c empty.c empty.o
|
||||
|
||||
# This makes all the auxilliary and test programs.
|
||||
# This makes all the auxiliary and test programs.
|
||||
|
||||
.PHONY: others tests
|
||||
others: $(addprefix $(objpfx),$(others) $(extra-objs))
|
||||
|
|
|
@ -154,7 +154,7 @@ catclose (nl_catd catalog_desc)
|
|||
|
||||
catalog = (__nl_catd) catalog_desc;
|
||||
|
||||
if (catalog->status == mmaped)
|
||||
if (catalog->status == mmapped)
|
||||
munmap ((void *) catalog->file_ptr, catalog->file_size);
|
||||
else if (catalog->status == malloced)
|
||||
free ((void *) catalog->file_ptr);
|
||||
|
|
|
@ -1,21 +1,21 @@
|
|||
/* Copyright (C) 1996 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper, <drepper@gnu.ai.mit.edu>.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper, <drepper@gnu.ai.mit.edu>.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with the GNU C Library; see the file COPYING.LIB. If
|
||||
not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with the GNU C Library; see the file COPYING.LIB. If not,
|
||||
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
|
@ -34,7 +34,7 @@ struct catalog_obj
|
|||
/* This structure will be filled after loading the catalog. */
|
||||
typedef struct catalog_info
|
||||
{
|
||||
enum { closed, nonexisting, mmaped, malloced } status;
|
||||
enum { closed, nonexisting, mmapped, malloced } status;
|
||||
|
||||
const char *cat_name;
|
||||
const char *env_var;
|
||||
|
|
|
@ -353,7 +353,7 @@ read_input_file (struct catalog *current, const char *fname)
|
|||
}
|
||||
else
|
||||
{
|
||||
/* We have found seomthing which looks like a
|
||||
/* We have found seomthing that looks like a
|
||||
correct identifier. */
|
||||
struct set_list *runp;
|
||||
|
||||
|
@ -980,7 +980,7 @@ read_old (struct catalog *catalog, const char *file_name)
|
|||
/* Try to open catalog, but don't look through the NLSPATH. */
|
||||
__open_catalog (&old_cat_obj, 0);
|
||||
|
||||
if (old_cat_obj.status != mmaped && old_cat_obj.status != malloced)
|
||||
if (old_cat_obj.status != mmapped && old_cat_obj.status != malloced)
|
||||
if (errno == ENOENT)
|
||||
/* No problem, the catalog simply does not exist. */
|
||||
return;
|
||||
|
|
|
@ -185,7 +185,7 @@ __open_catalog (__nl_catd catalog, int with_path)
|
|||
MAP_FILE|MAP_COPY|MAP_INHERIT, fd, 0);
|
||||
if (catalog->file_ptr != (struct catalog_obj *) -1)
|
||||
/* Tell the world we managed to mmap the file. */
|
||||
catalog->status = mmaped;
|
||||
catalog->status = mmapped;
|
||||
else
|
||||
{
|
||||
/* mmap failed perhaps because the system call is not
|
||||
|
@ -229,7 +229,7 @@ __open_catalog (__nl_catd catalog, int with_path)
|
|||
{
|
||||
/* Illegal file. Free he resources and mark catalog as not
|
||||
usable. */
|
||||
if (catalog->status == mmaped)
|
||||
if (catalog->status == mmapped)
|
||||
__munmap ((void *) catalog->file_ptr, catalog->file_size);
|
||||
else
|
||||
free (catalog->file_ptr);
|
||||
|
|
|
@ -14,9 +14,9 @@
|
|||
# Library General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU Library General Public
|
||||
# License along with the GNU C Library; see the file COPYING.LIB. If
|
||||
# not, write to the Free Software Foundation, Inc., 675 Mass Ave,
|
||||
# Cambridge, MA 02139, USA.
|
||||
# License along with the GNU C Library; see the file COPYING.LIB. If not,
|
||||
# write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
# Boston, MA 02111-1307, USA.
|
||||
|
||||
# This directory contains the C startup code (that which calls main). This
|
||||
# consists of the startfile, built from start.c and installed as crt0.o
|
||||
|
@ -71,7 +71,7 @@ generated += $(crtstuff:=.s)
|
|||
omit-deps += $(crtstuff)
|
||||
|
||||
# Compile initfini.c to assembly code, which contains embedded shell
|
||||
# commands that prodice crti.s-new and crtn.s-new when run. We need to
|
||||
# commands that produce crti.s-new and crtn.s-new when run. We need to
|
||||
# disable emission of .size directives and debugging information, since
|
||||
# they will get confused by the splitting of the output we do.
|
||||
$(objpfx)cr%i.s $(objpfx)cr%n.s: initfini.c; $(initfini)
|
||||
|
@ -113,4 +113,3 @@ $(addprefix $(objpfx),$(filter-out $(start-installed-name),$(csu-dummies))):
|
|||
cp /dev/null $(@:.o=.c)
|
||||
$(COMPILE.c) $(@:.o=.c) $(OUTPUT_OPTION)
|
||||
rm -f $(@:.o=.c)
|
||||
|
||||
|
|
|
@ -1,21 +1,21 @@
|
|||
/* Code to enable profiling at program startup.
|
||||
Copyright (C) 1995, 1996 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Copyright (C) 1995, 1996 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with the GNU C Library; see the file COPYING.LIB. If
|
||||
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
|
||||
Cambridge, MA 02139, USA. */
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with the GNU C Library; see the file COPYING.LIB. If not,
|
||||
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/gmon.h>
|
||||
|
@ -52,7 +52,7 @@ __gmon_start__ (void)
|
|||
/* Start keeping profiling records. */
|
||||
monstartup ((u_long) &_start, (u_long) &etext);
|
||||
|
||||
/* Call _mcleanup before exitting; it will write out gmon.out from the
|
||||
/* Call _mcleanup before exiting; it will write out gmon.out from the
|
||||
collected data. */
|
||||
atexit (&_mcleanup);
|
||||
}
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
License, the Free Software Foundation gives you unlimited
|
||||
permission to link the compiled version of this file with other
|
||||
programs, and to distribute those programs without any restriction
|
||||
coming from the use of this file. (The Libraty General Public
|
||||
coming from the use of this file. (The Library General Public
|
||||
License restrictions do apply in other respects; for example, they
|
||||
cover modification of the file, and distribution when not linked
|
||||
into another program.)
|
||||
|
|
|
@ -92,7 +92,7 @@ __bt_seq(dbp, key, data, flags)
|
|||
}
|
||||
|
||||
/*
|
||||
* If scan unitialized as yet, or starting at a specific record, set
|
||||
* If scan uninitialized as yet, or starting at a specific record, set
|
||||
* the scan to a specific key. Both __bt_seqset and __bt_seqadv pin
|
||||
* the page the cursor references if they're successful.
|
||||
*/
|
||||
|
@ -364,7 +364,7 @@ __bt_first(t, key, erval, exactp)
|
|||
*erval = *ep;
|
||||
return (RET_SUCCESS);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Walk backwards, as long as the entry matches and there are
|
||||
* keys left in the tree. Save a copy of each match in case
|
||||
|
|
|
@ -76,7 +76,7 @@ __bt_ret(t, e, key, rkey, data, rdata, copy)
|
|||
bl = GETBLEAF(e->page, e->index);
|
||||
|
||||
/*
|
||||
* We must copy big keys/data to make them contigous. Otherwise,
|
||||
* We must copy big keys/data to make them contiguous. Otherwise,
|
||||
* leave the page pinned and don't copy unless the user specified
|
||||
* concurrent access.
|
||||
*/
|
||||
|
|
|
@ -161,7 +161,7 @@ typedef struct _rinternal {
|
|||
#define NRINTERNAL \
|
||||
LALIGN(sizeof(recno_t) + sizeof(pgno_t))
|
||||
|
||||
/* Copy a RINTERAL entry to the page. */
|
||||
/* Copy a RINTERNAL entry to the page. */
|
||||
#define WR_RINTERNAL(p, nrecs, pgno) { \
|
||||
*(recno_t *)p = nrecs; \
|
||||
p += sizeof(recno_t); \
|
||||
|
|
|
@ -104,7 +104,7 @@ typedef struct htab { /* Memory resident data structure */
|
|||
int cbucket; /* Current bucket */
|
||||
int cndx; /* Index of next item on cpage */
|
||||
int errnum; /* Error Number -- for DBM
|
||||
* compatability */
|
||||
* compatibility */
|
||||
int new_file; /* Indicates if fd is backing store
|
||||
* or no */
|
||||
int save_file; /* Indicates whether we need to flush
|
||||
|
|
|
@ -90,7 +90,7 @@ dataonly:
|
|||
return (RET_SUCCESS);
|
||||
|
||||
/*
|
||||
* We must copy big keys/data to make them contigous. Otherwise,
|
||||
* We must copy big keys/data to make them contiguous. Otherwise,
|
||||
* leave the page pinned and don't copy unless the user specified
|
||||
* concurrent access.
|
||||
*/
|
||||
|
|
|
@ -117,7 +117,7 @@ extern struct dirent *__readdir __P ((DIR *__dirp));
|
|||
extern struct dirent *readdir __P ((DIR *__dirp));
|
||||
|
||||
#ifdef __USE_REENTRANT
|
||||
/* Reentrant versio of `readdir'. Return in RESULT a pointer to the
|
||||
/* Reentrant version of `readdir'. Return in RESULT a pointer to the
|
||||
next entry. */
|
||||
extern int __readdir_r __P ((DIR *__dirp, struct dirent *entry,
|
||||
struct dirent **result));
|
||||
|
|
|
@ -38,6 +38,8 @@
|
|||
objects were loaded. */
|
||||
#define RTLD_NEXT ((void *) -1l)
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* Open the shared object FILE and map it in; return a handle that can be
|
||||
passed to `dlsym' to get symbol values from it. */
|
||||
extern void *dlopen __P ((__const char *__file, int __mode));
|
||||
|
@ -66,4 +68,6 @@ typedef struct
|
|||
} Dl_info;
|
||||
extern int dladdr __P ((void *__address, Dl_info *__info));
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* dlfcn.h */
|
||||
|
|
|
@ -44,7 +44,7 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
|
|||
--version print version information and exit
|
||||
Report bugs to <bug-glibc@prep.ai.mit.edu>."
|
||||
exit 0 ;;
|
||||
--) # Stop option prcessing.
|
||||
--) # Stop option processing.
|
||||
shift; break ;;
|
||||
*)
|
||||
break ;;
|
||||
|
|
|
@ -40,7 +40,7 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.'
|
|||
--version print version information and exit
|
||||
Report bugs to <bug-glibc@prep.ai.mit.edu>.'
|
||||
exit 0 ;;
|
||||
--) # Stop option prcessing.
|
||||
--) # Stop option processing.
|
||||
shift; break ;;
|
||||
*)
|
||||
break ;;
|
||||
|
|
18
features.h
18
features.h
|
@ -25,7 +25,8 @@
|
|||
|
||||
__STRICT_ANSI__ ANSI Standard C.
|
||||
_POSIX_SOURCE IEEE Std 1003.1.
|
||||
_POSIX_C_SOURCE If ==1, like _POSIX_SOURCE; if ==2 add IEEE Std 1003.2.
|
||||
_POSIX_C_SOURCE If ==1, like _POSIX_SOURCE; if >=2 add IEEE Std 1003.2;
|
||||
if >=199309L, add IEEE Std 1003.1b-1993
|
||||
_XOPEN_SOURCE Includes POSIX and XPG things.
|
||||
_XOPEN_SOURCE_EXTENDED XPG things and X/Open Unix extensions.
|
||||
_BSD_SOURCE ANSI, POSIX, and 4.3BSD things.
|
||||
|
@ -45,6 +46,7 @@
|
|||
|
||||
__USE_POSIX Define IEEE Std 1003.1 things.
|
||||
__USE_POSIX2 Define IEEE Std 1003.2 things.
|
||||
__USE_POSIX199309 Define IEEE Std 1003.1b things.
|
||||
__USE_XOPEN Define XPG things.
|
||||
__USE_XOPEN_EXTENDED Define X/Open Unix things.
|
||||
__USE_BSD Define 4.3BSD things.
|
||||
|
@ -66,6 +68,7 @@
|
|||
/* Undefine everything, so we get a clean slate. */
|
||||
#undef __USE_POSIX
|
||||
#undef __USE_POSIX2
|
||||
#undef __USE_POSIX199309
|
||||
#undef __USE_XOPEN
|
||||
#undef __USE_XOPEN_EXTENDED
|
||||
#undef __USE_BSD
|
||||
|
@ -99,7 +102,7 @@
|
|||
#undef _POSIX_SOURCE
|
||||
#define _POSIX_SOURCE 1
|
||||
#undef _POSIX_C_SOURCE
|
||||
#define _POSIX_C_SOURCE 2
|
||||
#define _POSIX_C_SOURCE 199309L
|
||||
#undef _XOPEN_SOURCE
|
||||
#define _XOPEN_SOURCE 1
|
||||
#undef _XOPEN_SOURCE_EXTENDED
|
||||
|
@ -120,11 +123,16 @@
|
|||
#define _SVID_SOURCE 1
|
||||
#endif
|
||||
|
||||
/* If none of the ANSI/POSIX macros are defined, use POSIX.1 and POSIX.2. */
|
||||
/* If none of the ANSI/POSIX macros are defined, use POSIX.1 and POSIX.2
|
||||
(and IEEE Std 1003.1b-1993 unless _XOPEN_SOURCE is defined). */
|
||||
#if (!defined (__STRICT_ANSI__) && !defined (_POSIX_SOURCE) && \
|
||||
!defined (_POSIX_C_SOURCE))
|
||||
#define _POSIX_SOURCE 1
|
||||
#if defined(_XOPEN_SOURCE)
|
||||
#define _POSIX_C_SOURCE 2
|
||||
#else
|
||||
#define _POSIX_C_SOURCE 199309L
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if (defined (_POSIX_SOURCE) || _POSIX_C_SOURCE >= 1 || \
|
||||
|
@ -137,6 +145,10 @@
|
|||
#define __USE_POSIX2 1
|
||||
#endif
|
||||
|
||||
#if (defined (_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 199309L)
|
||||
#define __USE_POSIX199309 1
|
||||
#endif
|
||||
|
||||
#ifdef _XOPEN_SOURCE
|
||||
#define __USE_XOPEN 1
|
||||
#ifdef _XOPEN_SOURCE_EXTENDED
|
||||
|
|
|
@ -31,7 +31,7 @@ include ../Rules
|
|||
CFLAGS-mcount.c := -fno-omit-frame-pointer
|
||||
|
||||
# We cannot compile mcount.c with -pg because that would
|
||||
# create resursive calls. Just copy the normal static object.
|
||||
# create recursive calls. Just copy the normal static object.
|
||||
# On systems where `profil' is not a system call, the same
|
||||
# problem exists for the internal functions in profil.c.
|
||||
|
||||
|
|
|
@ -222,7 +222,7 @@ extern error_t _hurd_exec (task_t task,
|
|||
char *const envp[]);
|
||||
|
||||
|
||||
/* Inform the proc server we have exitted with STATUS, and kill the
|
||||
/* Inform the proc server we have exited with STATUS, and kill the
|
||||
task thoroughly. This function never returns, no matter what. */
|
||||
|
||||
extern void _hurd_exit (int status) __attribute__ ((noreturn));
|
||||
|
|
|
@ -143,7 +143,7 @@ error_t file_name_path_scan (const char *file_name, const char *path,
|
|||
|
||||
/* Lookup FILE_NAME and return the node opened with FLAGS & MODE in result
|
||||
(see hurd_file_name_lookup for details), but a simple filename (without
|
||||
any directory prefixes) will be consectutively prefixed with the pathnames
|
||||
any directory prefixes) will be consecutively prefixed with the pathnames
|
||||
in the `:' separated list PATH until one succeeds in a successful lookup.
|
||||
If none succeed, then the first error that wasn't ENOENT is returned, or
|
||||
ENOENT if no other errors were returned. If PREFIXED_NAME is non-NULL,
|
||||
|
|
|
@ -37,6 +37,9 @@
|
|||
/*
|
||||
* HISTORY
|
||||
* $Log$
|
||||
* Revision 1.13 1996/12/20 01:32:01 drepper
|
||||
* Update from main archive 961219
|
||||
*
|
||||
* Revision 1.12 1996/11/15 19:44:13 thomas
|
||||
* Tue Nov 12 16:58:41 1996 Thomas Bushnell, n/BSG <thomas@gnu.ai.mit.edu>
|
||||
*
|
||||
|
@ -58,8 +61,8 @@
|
|||
* (union header): Only define if !MCHECK.
|
||||
* (HEADER_SIZE, HEADER_NEXT, HEADER_FREE, HEADER_CHECK): New macros.
|
||||
* [MCHECK] (MIN_SIZE): Add correct definition for this case.
|
||||
* (more_memory, malloc, free, realloc): Use above macros, and add appropiate
|
||||
* checks & frobs in MCHECK case.
|
||||
* (more_memory, malloc, free, realloc): Use above macros, and add
|
||||
* appropriate checks & frobs in MCHECK case.
|
||||
*
|
||||
* Revision 1.6 1996/03/07 21:13:08 miles
|
||||
* (realloc):
|
||||
|
@ -75,39 +78,39 @@
|
|||
* (HEADER_SIZE, HEADER_NEXT, HEADER_FREE, HEADER_CHECK): New macros.
|
||||
* [MCHECK] (MIN_SIZE): Add correct definition for this case.
|
||||
* (more_memory, malloc, free, realloc):
|
||||
* Use above macros, and add appropiate checks & frobs in MCHECK case.
|
||||
* Use above macros, and add appropriate checks & frobs in MCHECK case.
|
||||
*
|
||||
* Revision 1.4 1994/05/05 11:21:42 roland
|
||||
* entered into RCS
|
||||
*
|
||||
* Revision 2.7 91/05/14 17:57:34 mrt
|
||||
* Correcting copyright
|
||||
*
|
||||
*
|
||||
* Revision 2.6 91/02/14 14:20:26 mrt
|
||||
* Added new Mach copyright
|
||||
* [91/02/13 12:41:21 mrt]
|
||||
*
|
||||
*
|
||||
* Revision 2.5 90/11/05 14:37:33 rpd
|
||||
* Added malloc_fork* code.
|
||||
* [90/11/02 rwd]
|
||||
*
|
||||
*
|
||||
* Add spin_lock_t.
|
||||
* [90/10/31 rwd]
|
||||
*
|
||||
*
|
||||
* Revision 2.4 90/08/07 14:31:28 rpd
|
||||
* Removed RCS keyword nonsense.
|
||||
*
|
||||
*
|
||||
* Revision 2.3 90/06/02 15:14:00 rpd
|
||||
* Converted to new IPC.
|
||||
* [90/03/20 20:56:57 rpd]
|
||||
*
|
||||
*
|
||||
* Revision 2.2 89/12/08 19:53:59 rwd
|
||||
* Removed conditionals.
|
||||
* [89/10/23 rwd]
|
||||
*
|
||||
*
|
||||
* Revision 2.1 89/08/03 17:09:46 rwd
|
||||
* Created.
|
||||
*
|
||||
*
|
||||
*
|
||||
* 13-Sep-88 Eric Cooper (ecc) at Carnegie Mellon University
|
||||
* Changed realloc() to copy min(old size, new size) bytes.
|
||||
|
@ -330,7 +333,7 @@ free(base)
|
|||
|
||||
#ifdef MCHECK
|
||||
assert (HEADER_CHECK (h) == CHECK_BUSY);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
fl = HEADER_FREE (h);
|
||||
i = fl - malloc_free_list;
|
||||
|
@ -352,7 +355,7 @@ free(base)
|
|||
HEADER_NEXT (h) = fl->head;
|
||||
#ifdef MCHECK
|
||||
HEADER_CHECK (h) = CHECK_FREE;
|
||||
#endif
|
||||
#endif
|
||||
fl->head = h;
|
||||
#ifdef DEBUG
|
||||
fl->in_use -= 1;
|
||||
|
@ -454,7 +457,7 @@ print_malloc_free_list()
|
|||
}
|
||||
#endif DEBUG
|
||||
|
||||
static void
|
||||
static void
|
||||
malloc_fork_prepare(void)
|
||||
/*
|
||||
* Prepare the malloc module for a fork by insuring that no thread is in a
|
||||
|
@ -462,13 +465,13 @@ malloc_fork_prepare(void)
|
|||
*/
|
||||
{
|
||||
register int i;
|
||||
|
||||
|
||||
for (i = 0; i < NBUCKETS; i++) {
|
||||
spin_lock(&malloc_free_list[i].lock);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
static void
|
||||
malloc_fork_parent(void)
|
||||
/*
|
||||
* Called in the parent process after a fork() to resume normal operation.
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* XXX this file is a tempoary hack.
|
||||
/* XXX this file is a temporary hack.
|
||||
|
||||
All hurd-internal code which uses malloc et al includes this file so it
|
||||
will use the internal malloc routines _hurd_{malloc,realloc,free}
|
||||
|
|
|
@ -80,7 +80,7 @@ file_name_path_scan (const char *file_name, const char *path,
|
|||
|
||||
/* Lookup FILE_NAME and return the node opened with FLAGS & MODE in result
|
||||
(see hurd_file_name_lookup for details), but a simple filename (without
|
||||
any directory prefixes) will be consectutively prefixed with the pathnames
|
||||
any directory prefixes) will be consecutively prefixed with the pathnames
|
||||
in the `:' separated list PATH until one succeeds in a successful lookup.
|
||||
If none succeed, then the first error that wasn't ENOENT is returned, or
|
||||
ENOENT if no other errors were returned. If PREFIXED_NAME is non-NULL,
|
||||
|
|
|
@ -93,7 +93,7 @@ describe_port (string_t description, mach_port_t port)
|
|||
}
|
||||
|
||||
|
||||
/* Common defn so we don't link in the itimer code unnecssarily. */
|
||||
/* Common defn so we don't link in the itimer code unnecessarily. */
|
||||
thread_t _hurd_itimer_thread; /* XXX */
|
||||
|
||||
kern_return_t
|
||||
|
|
|
@ -96,7 +96,7 @@ extern char *telcmds[];
|
|||
#define TELOPT_NAOVTS 14 /* negotiate about vertical tab stops */
|
||||
#define TELOPT_NAOVTD 15 /* negotiate about vertical tab disposition */
|
||||
#define TELOPT_NAOLFD 16 /* negotiate about output LF disposition */
|
||||
#define TELOPT_XASCII 17 /* extended ascic character set */
|
||||
#define TELOPT_XASCII 17 /* extended ascii character set */
|
||||
#define TELOPT_LOGOUT 18 /* force logout */
|
||||
#define TELOPT_BM 19 /* byte macro */
|
||||
#define TELOPT_DET 20 /* data entry terminal */
|
||||
|
@ -200,7 +200,7 @@ char *telopts[NTELOPTS+1] = {
|
|||
#define NSLC 18
|
||||
|
||||
/*
|
||||
* For backwards compatability, we define SLC_NAMES to be the
|
||||
* For backwards compatibility, we define SLC_NAMES to be the
|
||||
* list of names if SLC_NAMES is not defined.
|
||||
*/
|
||||
#define SLC_NAMELIST "0", "SYNCH", "BRK", "IP", "AO", "AYT", "EOR", \
|
||||
|
|
|
@ -81,7 +81,7 @@ typedef struct {
|
|||
typedef struct {
|
||||
u_char vers; /* protocol version */
|
||||
u_char type; /* type of request message, see below */
|
||||
u_char answer; /* respose to request message, see below */
|
||||
u_char answer; /* response to request message, see below */
|
||||
u_char pad;
|
||||
u_int32_t id_num; /* message id */
|
||||
struct osockaddr addr; /* address for establishing conversation */
|
||||
|
|
2
interp.c
2
interp.c
|
@ -1,4 +1,4 @@
|
|||
/* interp - add information about dynamic loader to shared libray obejcts.
|
||||
/* interp - add information about dynamic loader to shared library obejcts.
|
||||
Copyright (C) 1996 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
|
|
|
@ -336,7 +336,7 @@ DCGETTEXT (domainname, msgid, category)
|
|||
{
|
||||
/* The whole contents of CATEGORYVALUE has been searched but
|
||||
no valid entry has been found. We solve this situation
|
||||
by implicitely appending a "C" entry, i.e. no translation
|
||||
by implicitly appending a "C" entry, i.e. no translation
|
||||
will take place. */
|
||||
single_locale[0] = 'C';
|
||||
single_locale[1] = '\0';
|
||||
|
|
|
@ -166,7 +166,7 @@ _nl_explode_name (name, language, modifier, territory, codeset,
|
|||
}
|
||||
}
|
||||
|
||||
/* For CEN sytnax values it might be important to have the
|
||||
/* For CEN syntax values it might be important to have the
|
||||
separator character in the file name, not for XPG syntax. */
|
||||
if (syntax == xpg)
|
||||
{
|
||||
|
|
|
@ -171,7 +171,7 @@ _nl_find_domain (dirname, locale, domainname)
|
|||
&sponsor, &revision);
|
||||
|
||||
/* Create all possible locale entries which might be interested in
|
||||
generalzation. */
|
||||
generalization. */
|
||||
retval = _nl_make_l10nflist (&_nl_loaded_domains, dirname,
|
||||
strlen (dirname) + 1, mask, language, territory,
|
||||
codeset, normalized_codeset, modifier, special,
|
||||
|
|
|
@ -318,8 +318,8 @@ _nl_make_l10nflist (l10nfile_list, dirlist, dirlist_len, mask, language,
|
|||
}
|
||||
|
||||
entries = 0;
|
||||
/* If the DIRLIST is a real list the RETVAL entry correcponds not to
|
||||
a real file. So we have to use the DIRLIST separation machanism
|
||||
/* If the DIRLIST is a real list the RETVAL entry corresponds not to
|
||||
a real file. So we have to use the DIRLIST separation mechanism
|
||||
of the inner loop. */
|
||||
cnt = __argz_count (dirlist, dirlist_len) == 1 ? mask - 1 : mask;
|
||||
for (; cnt >= 0; --cnt)
|
||||
|
|
|
@ -297,7 +297,7 @@ read_alias_file (fname, fname_len)
|
|||
}
|
||||
}
|
||||
|
||||
/* Possibily not the whole line fitted into the buffer. Ignore
|
||||
/* Possibly not the whole line fits into the buffer. Ignore
|
||||
the rest of the line. */
|
||||
while (strchr (cp, '\n') == NULL)
|
||||
{
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
License, the Free Software Foundation gives you unlimited
|
||||
permission to link the compiled version of this file with other
|
||||
programs, and to distribute those programs without any restriction
|
||||
coming from the use of this file. (The Libraty General Public
|
||||
coming from the use of this file. (The Library General Public
|
||||
License restrictions do apply in other respects; for example, they
|
||||
cover modification of the file, and distribution when not linked
|
||||
into another program.)
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
License, the Free Software Foundation gives you unlimited
|
||||
permission to link the compiled version of this file with other
|
||||
programs, and to distribute those programs without any restriction
|
||||
coming from the use of this file. (The Libraty General Public
|
||||
coming from the use of this file. (The Library General Public
|
||||
License restrictions do apply in other respects; for example, they
|
||||
cover modification of the file, and distribution when not linked
|
||||
into another program.)
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
License, the Free Software Foundation gives you unlimited
|
||||
permission to link the compiled version of this file with other
|
||||
programs, and to distribute those programs without any restriction
|
||||
coming from the use of this file. (The Libraty General Public
|
||||
coming from the use of this file. (The Library General Public
|
||||
License restrictions do apply in other respects; for example, they
|
||||
cover modification of the file, and distribution when not linked
|
||||
into another program.)
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
License, the Free Software Foundation gives you unlimited
|
||||
permission to link the compiled version of this file with other
|
||||
programs, and to distribute those programs without any restriction
|
||||
coming from the use of this file. (The Libraty General Public
|
||||
coming from the use of this file. (The Library General Public
|
||||
License restrictions do apply in other respects; for example, they
|
||||
cover modification of the file, and distribution when not linked
|
||||
into another program.)
|
||||
|
|
|
@ -214,8 +214,10 @@ extern __inline__ int stat (__const char *__path, struct stat *__statbuf)
|
|||
|
||||
extern __inline__ int __lstat(__const char *__path, struct stat *__statbuf)
|
||||
{ return __lxstat (_STAT_VER, __path, __statbuf); }
|
||||
#if defined(__USE_BSD) || defined(__USE_XOPEN_EXTENDED)
|
||||
extern __inline__ int lstat(__const char *__path, struct stat *__statbuf)
|
||||
{ return __lxstat (_STAT_VER, __path, __statbuf); }
|
||||
#endif
|
||||
|
||||
extern __inline__ int __fstat (int __fd, struct stat *__statbuf)
|
||||
{ return __fxstat (_STAT_VER, __fd, __statbuf); }
|
||||
|
|
|
@ -27,9 +27,6 @@
|
|||
|
||||
__BEGIN_DECLS
|
||||
|
||||
#define __need_NULL
|
||||
#include <stddef.h>
|
||||
|
||||
#include <gnu/types.h>
|
||||
|
||||
/* Structure describing file times. */
|
||||
|
@ -46,4 +43,4 @@ extern int utime __P ((__const char *__file,
|
|||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* utime.h */
|
||||
#endif /* utime.h */
|
||||
|
|
|
@ -46,7 +46,7 @@ extern int errno;
|
|||
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
|
||||
|
|
|
@ -635,7 +635,7 @@ DEFUN_VOID(_IO_cleanup)
|
|||
|
||||
/* We currently don't have a reliable mechanism for making sure that
|
||||
C++ static destructors are executed in the correct order.
|
||||
So it is possible that other static destructord might want to
|
||||
So it is possible that other static destructors might want to
|
||||
write to cout - and they're supposed to be able to do so.
|
||||
|
||||
The following will make the standard streambufs be unbuffered,
|
||||
|
@ -691,7 +691,7 @@ DEFUN(_IO_marker_difference, (mark1, mark2),
|
|||
return mark1->_pos - mark2->_pos;
|
||||
}
|
||||
|
||||
/* Return difference between MARK and current posistion of MARK's stream. */
|
||||
/* Return difference between MARK and current position of MARK's stream. */
|
||||
int
|
||||
DEFUN(_IO_marker_delta, (mark),
|
||||
struct _IO_marker *mark)
|
||||
|
|
|
@ -24,7 +24,7 @@ the executable file might be covered by the GNU General Public License. */
|
|||
|
||||
#include "libioP.h"
|
||||
#include <errno.h>
|
||||
/* ANSI explicily requires setting errno to a positive value on failure. */
|
||||
/* ANSI explicitly requires setting errno to a positive value on failure. */
|
||||
|
||||
int
|
||||
_IO_fgetpos (fp, posp)
|
||||
|
|
|
@ -36,7 +36,8 @@ _IO_fsetpos (fp, posp)
|
|||
_IO_flockfile (fp);
|
||||
if (_IO_seekpos (fp, *posp, _IOS_INPUT|_IOS_OUTPUT) == _IO_pos_BAD)
|
||||
{
|
||||
/*ANSI explicily requires setting errno to a positive value on failure.*/
|
||||
/* ANSI explicitly requires setting errno to a positive value on
|
||||
failure. */
|
||||
#ifdef EIO
|
||||
if (errno == 0)
|
||||
__set_errno (EIO);
|
||||
|
|
|
@ -40,13 +40,14 @@ _IO_vsprintf (string, format, args)
|
|||
#ifdef _IO_MTSAFE_IO
|
||||
sf._sbf._f._lock = &lock;
|
||||
#endif
|
||||
_IO_init ((_IO_FILE *) &sf, 0);
|
||||
_IO_JUMPS ((_IO_FILE *) &sf) = &_IO_str_jumps;
|
||||
_IO_init (&sf._sbf._f, 0);
|
||||
_IO_JUMPS (&sf._sbf._f) = &_IO_str_jumps;
|
||||
_IO_str_init_static (&sf._sbf._f, string, -1, string);
|
||||
_IO_str_init_static ((_IO_FILE *) &sf, string, -1, string);
|
||||
_IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile, &sf);
|
||||
_IO_flockfile ((_IO_FILE *) &sf);
|
||||
ret = _IO_vfprintf ((_IO_FILE *) &sf, format, args);
|
||||
_IO_putc_unlocked ('\0', (_IO_FILE *) &sf);
|
||||
_IO_flockfile (&sf._sbf._f);
|
||||
ret = _IO_vfprintf (&sf._sbf._f, format, args);
|
||||
_IO_putc_unlocked ('\0', &sf._sbf._f);
|
||||
_IO_cleanup_region_end (1);
|
||||
return ret;
|
||||
}
|
||||
|
|
|
@ -35,12 +35,12 @@ DEFUN(_IO_vsscanf, (string, format, args),
|
|||
_IO_lock_t lock;
|
||||
sf._sbf._f._lock = &lock;
|
||||
#endif
|
||||
_IO_init((_IO_FILE*)&sf, 0);
|
||||
_IO_JUMPS((_IO_FILE*)&sf) = &_IO_str_jumps;
|
||||
_IO_str_init_static ((_IO_FILE*)&sf, (char*)string, 0, NULL);
|
||||
_IO_init(&sf._sbf._f, 0);
|
||||
_IO_JUMPS(&sf._sbf._f) = &_IO_str_jumps;
|
||||
_IO_str_init_static (&sf._sbf._f, (char*)string, 0, NULL);
|
||||
_IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile, &sf);
|
||||
_IO_flockfile ((_IO_FILE *) &sf);
|
||||
ret = _IO_vfscanf((_IO_FILE*)&sf, format, args, NULL);
|
||||
_IO_flockfile (&sf._sbf._f);
|
||||
ret = _IO_vfscanf(&sf._sbf._f, format, args, NULL);
|
||||
_IO_cleanup_region_end (1);
|
||||
return ret;
|
||||
}
|
||||
|
|
|
@ -66,11 +66,11 @@ extern "C" {
|
|||
* a jump table (of pointers to functions). The pointer is accessed
|
||||
* with the _IO_JUMPS macro. The jump table has a eccentric format,
|
||||
* so as to be compatible with the layout of a C++ virtual function table.
|
||||
* (as implemented by g++). When a pointer to a steambuf object is
|
||||
* (as implemented by g++). When a pointer to a streambuf object is
|
||||
* coerced to an (_IO_FILE*), then _IO_JUMPS on the result just
|
||||
* happens to point to the virtual function table of the streambuf.
|
||||
* Thus the _IO_JUMPS function table used for C stdio/libio does
|
||||
* double duty as the virtual functiuon table for C++ streambuf.
|
||||
* double duty as the virtual function table for C++ streambuf.
|
||||
*
|
||||
* The entries in the _IO_JUMPS function table (and hence also the
|
||||
* virtual functions of a streambuf) are described below.
|
||||
|
@ -112,7 +112,7 @@ typedef int (*_IO_overflow_t) __P((_IO_FILE*, int));
|
|||
|
||||
/* The 'underflow' hook tries to fills the get buffer.
|
||||
It returns the next character (as an unsigned char) or EOF. The next
|
||||
character remains in the get buffer, and the get postion is not changed.
|
||||
character remains in the get buffer, and the get position is not changed.
|
||||
It matches the streambuf::underflow virtual function. */
|
||||
typedef int (*_IO_underflow_t) __P((_IO_FILE*));
|
||||
#define _IO_UNDERFLOW(FP) JUMP0(__underflow, FP)
|
||||
|
@ -178,7 +178,7 @@ typedef int (*_IO_doallocate_t) __P((_IO_FILE*));
|
|||
|
||||
/* The following four hooks (sysread, syswrite, sysclose, sysseek, and
|
||||
sysstat) are low-level hooks specific to this implementation.
|
||||
There is no correspondance in the ANSI/ISO C++ standard library.
|
||||
There is no correspondence in the ANSI/ISO C++ standard library.
|
||||
The hooks basically correspond to the Unix system functions
|
||||
(read, write, close, lseek, and stat) except that a _IO_FILE*
|
||||
parameter is used instead of a integer file descriptor; the default
|
||||
|
@ -190,21 +190,21 @@ typedef int (*_IO_doallocate_t) __P((_IO_FILE*));
|
|||
/* The 'sysread' hook is used to read data from the external file into
|
||||
an existing buffer. It generalizes the Unix read(2) function.
|
||||
It matches the streambuf::sys_read virtual function, which is
|
||||
specific to this implementaion. */
|
||||
specific to this implementation. */
|
||||
typedef _IO_ssize_t (*_IO_read_t) __P((_IO_FILE*, void*, _IO_ssize_t));
|
||||
#define _IO_SYSREAD(FP, DATA, LEN) JUMP2(__read, FP, DATA, LEN)
|
||||
|
||||
/* The 'syswrite' hook is used to write data from an existing buffer
|
||||
to an external file. It generalizes the Unix write(2) function.
|
||||
It matches the streambuf::sys_write virtual function, which is
|
||||
specific to this implementaion. */
|
||||
specific to this implementation. */
|
||||
typedef _IO_ssize_t (*_IO_write_t) __P((_IO_FILE*,const void*,_IO_ssize_t));
|
||||
#define _IO_SYSWRITE(FP, DATA, LEN) JUMP2(__write, FP, DATA, LEN)
|
||||
|
||||
/* The 'sysseek' hook is used to re-position an external file.
|
||||
It generalizes the Unix lseek(2) function.
|
||||
It matches the streambuf::sys_seek virtual function, which is
|
||||
specific to this implementaion. */
|
||||
specific to this implementation. */
|
||||
typedef _IO_fpos_t (*_IO_seek_t) __P((_IO_FILE*, _IO_off_t, int));
|
||||
#define _IO_SYSSEEK(FP, OFFSET, MODE) JUMP2(__seek, FP, OFFSET, MODE)
|
||||
|
||||
|
@ -218,7 +218,7 @@ typedef int (*_IO_close_t) __P((_IO_FILE*)); /* finalize */
|
|||
/* The 'sysstat' hook is used to get information about an external file
|
||||
into a struct stat buffer. It generalizes the Unix fstat(2) call.
|
||||
It matches the streambuf::sys_stat virtual function, which is
|
||||
specific to this implementaion. */
|
||||
specific to this implementation. */
|
||||
typedef int (*_IO_stat_t) __P((_IO_FILE*, void*));
|
||||
#define _IO_SYSSTAT(FP, BUF) JUMP1(__stat, FP, BUF)
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ the executable file might be covered by the GNU General Public License. */
|
|||
|
||||
#if 0
|
||||
/* The following definitions are for exposition only.
|
||||
They map the terminlogy used in the ANSI/ISO C++ draft standard
|
||||
They map the terminology used in the ANSI/ISO C++ draft standard
|
||||
to the implementation. */
|
||||
|
||||
/* allocated: set when a dynamic array object has been allocated, and
|
||||
|
|
|
@ -1,27 +1,27 @@
|
|||
/* Copyright (C) 1995, 1996 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with the GNU C Library; see the file COPYING.LIB. If
|
||||
not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with the GNU C Library; see the file COPYING.LIB. If not,
|
||||
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#include <endian.h>
|
||||
#include "localeinfo.h"
|
||||
|
||||
/* These tables' entries contain values which make the function behave
|
||||
accoriding to POSIX.2 Table 2-8 ``LC_COLLATE Category Definition in
|
||||
according to POSIX.2 Table 2-8 ``LC_COLLATE Category Definition in
|
||||
the POSIX Locale''. */
|
||||
|
||||
const u_int32_t _nl_C_LC_COLLATE_symbol_hash[446] =
|
||||
|
|
|
@ -1,27 +1,27 @@
|
|||
/* Copyright (C) 1995, 1996 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with the GNU C Library; see the file COPYING.LIB. If
|
||||
not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with the GNU C Library; see the file COPYING.LIB. If not,
|
||||
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#include "localeinfo.h"
|
||||
#include <endian.h>
|
||||
|
||||
/* This table's entries are taken from POSIX.2 Table 2-6
|
||||
``LC_CTYPE Category Definitionin the POSIX Locale''.
|
||||
``LC_CTYPE Category Definition in the POSIX Locale''.
|
||||
|
||||
The `_nl_C_LC_CTYPE_width' array is a GNU extension.
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
*
|
||||
* !!! The list has to be sorted !!!
|
||||
*/
|
||||
DEFINE_INT_CURR("AED ") /* United Arab Emirats */
|
||||
DEFINE_INT_CURR("AED ") /* United Arab Emirates */
|
||||
DEFINE_INT_CURR("AFA ") /* Afghanistan */
|
||||
DEFINE_INT_CURR("ALL ") /* Albania */
|
||||
DEFINE_INT_CURR("ANG ") /* Netherlands Antilles */
|
||||
|
@ -91,7 +91,7 @@ DEFINE_INT_CURR("LKR ") /* Sri Lanka */
|
|||
DEFINE_INT_CURR("LRD ") /* Liberia */
|
||||
DEFINE_INT_CURR("LSM ") /* Lesotho */
|
||||
DEFINE_INT_CURR("LTL ") /* Lithuania */
|
||||
DEFINE_INT_CURR("LUF ") /* Luxemburg */
|
||||
DEFINE_INT_CURR("LUF ") /* Luxembourg */
|
||||
DEFINE_INT_CURR("LVL ") /* Latvia */
|
||||
DEFINE_INT_CURR("LYD ") /* Libyan Arab Jamahiriya */
|
||||
DEFINE_INT_CURR("MAD ") /* Morocco */
|
||||
|
|
|
@ -1,23 +1,23 @@
|
|||
/* Copyright (C) 1991, 1992, 1995, 1996 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with the GNU C Library; see the file COPYING.LIB. If
|
||||
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
|
||||
Cambridge, MA 02139, USA. */
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with the GNU C Library; see the file COPYING.LIB. If not,
|
||||
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
/*
|
||||
* ANSI Standard: 4.4 LOCALIZATION <locale.h>
|
||||
* ISO C Standard: 4.4 LOCALIZATION <locale.h>
|
||||
*/
|
||||
|
||||
#ifndef _LOCALE_H
|
||||
|
@ -25,6 +25,9 @@ Cambridge, MA 02139, USA. */
|
|||
#define _LOCALE_H 1
|
||||
#include <features.h>
|
||||
|
||||
#define __need_NULL
|
||||
#include <stddef.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* These are the possibilities for the first argument to setlocale.
|
||||
|
@ -76,9 +79,9 @@ struct lconv
|
|||
/* Positive and negative sign positions:
|
||||
0 Parentheses surround the quantity and currency_symbol.
|
||||
1 The sign string precedes the quantity and currency_symbol.
|
||||
2 The sign string succedes the quantity and currency_symbol.
|
||||
2 The sign string follows the quantity and currency_symbol.
|
||||
3 The sign string immediately precedes the currency_symbol.
|
||||
4 The sign string immediately succedes the currency_symbol. */
|
||||
4 The sign string immediately follows the currency_symbol. */
|
||||
char p_sign_posn;
|
||||
char n_sign_posn;
|
||||
};
|
||||
|
@ -90,6 +93,37 @@ extern char *setlocale __P ((int __category, __const char *__locale));
|
|||
/* Return the numeric/monetary information for the current locale. */
|
||||
extern struct lconv *localeconv __P ((void));
|
||||
|
||||
#ifdef __USE_GNU
|
||||
/* The concept of one static locale per category is not very well
|
||||
thought out. Many applications will need to process its data using
|
||||
information from several different locales. Another application is
|
||||
the implementation of the internationalization handling in the
|
||||
upcoming ISO C++ standard library. To support this another set of
|
||||
the functions using locale data exist which have an additional
|
||||
argument.
|
||||
|
||||
Attention: all these functions are *not* standardized in any form.
|
||||
This is a proof-of-concept implementation. */
|
||||
|
||||
/* Structure for reentrant locale using functions. This is an opaque
|
||||
type for the user level programs. */
|
||||
typedef struct locale_data *locale_t[LC_ALL];
|
||||
|
||||
/* Return a reference to a data structure representing a set of locale
|
||||
datasets. Unlike for the CATEGORY parameter for `setlocale' the
|
||||
CATEGORY_MASK parameter here uses a single bit for each category.
|
||||
I.e., 1 << LC_CTYPE means to load data for this category. If
|
||||
BASE is non-null the appropriate category information in the BASE
|
||||
record is replaced. */
|
||||
extern __const locale_t *__newlocale __P ((int __category_mask,
|
||||
__const char *__locale,
|
||||
__const locale_t *__base));
|
||||
|
||||
/* Free the data associated with a locale dataset previously returned
|
||||
by a call to `setlocale_r'. */
|
||||
extern void __freelocale __P ((__const locale_t *__dataset));
|
||||
#endif
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* locale.h */
|
||||
|
|
|
@ -1,21 +1,21 @@
|
|||
/* Copyright (C) 1996 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper, <drepper@gnu.ai.mit.edu>.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper, <drepper@gnu.ai.mit.edu>.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with the GNU C Library; see the file COPYING.LIB. If
|
||||
not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with the GNU C Library; see the file COPYING.LIB. If not,
|
||||
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#ifndef _CHARSET_H
|
||||
#define _CHARSET_H
|
||||
|
@ -59,7 +59,7 @@ struct charset_t
|
|||
/* Prototypes for charmap handling functions. */
|
||||
struct charset_t *charmap_read (const char *filename);
|
||||
|
||||
/* Prototypes for funciton to insert new character. */
|
||||
/* Prototypes for function to insert new character. */
|
||||
void charset_new_char (struct linereader *lr, struct charset_t *cs, int bytes,
|
||||
unsigned int value, const char *from, const char *to);
|
||||
|
||||
|
|
|
@ -1,21 +1,21 @@
|
|||
/* Copyright (C) 1995, 1996 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with the GNU C Library; see the file COPYING.LIB. If
|
||||
not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with the GNU C Library; see the file COPYING.LIB. If not,
|
||||
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
|
@ -119,7 +119,7 @@ struct locale_collate_t
|
|||
/* What kind of symbol is current element. */
|
||||
enum coll_symbol kind;
|
||||
|
||||
/* While collecting the weigths we need some temporary space. */
|
||||
/* While collecting the weights we need some temporary space. */
|
||||
unsigned int current_order;
|
||||
int *weight_cnt;
|
||||
unsigned int weight_idx;
|
||||
|
@ -379,8 +379,8 @@ Computing table size for collation information might take a while..."),
|
|||
= collate->nrules * sizeof (u_int32_t);
|
||||
/* Another trick here. Describing the collation method needs only a
|
||||
few bits (3, to be exact). But the binary file should be
|
||||
accessible by maschines with both endianesses and so we store both
|
||||
information in the same word. */
|
||||
accessible by machines with both endianesses and so we store both
|
||||
forms in the same word. */
|
||||
for (cnt = 0; cnt < collate->nrules; ++cnt)
|
||||
table[cnt] = collate->rules[cnt] | SWAPU32 (collate->rules[cnt]);
|
||||
|
||||
|
@ -646,7 +646,7 @@ Computing table size for collation information might take a while..."),
|
|||
where N is the number of keys.
|
||||
|
||||
If we now choose M to be the next prime bigger than 4 / 3 * N,
|
||||
we get the values 4 and 1.85 resp. Because unsuccesful searches
|
||||
we get the values 4 and 1.85 resp. Because unsuccessful searches
|
||||
are unlikely this is a good value. Formulas: [Knuth, The Art of
|
||||
Computer Programming, Volume 3, Sorting and Searching, 1973,
|
||||
Addison Wesley] */
|
||||
|
@ -880,7 +880,7 @@ Computing table size for collation information might take a while..."),
|
|||
symbols_class_ob[cnt] = SWAPU32 (symbols_class[cnt]);
|
||||
|
||||
|
||||
/* Store table adresses and lengths. */
|
||||
/* Store table addresses and lengths. */
|
||||
#if __BYTE_ORDER == __BIG_ENDIAN
|
||||
iov[2 + _NL_ITEM_INDEX (_NL_COLLATE_TABLE_EB)].iov_base = table;
|
||||
iov[2 + _NL_ITEM_INDEX (_NL_COLLATE_TABLE_EB)].iov_len
|
||||
|
@ -1659,7 +1659,7 @@ collate_simple_weight (struct linereader *lr, struct localedef_t *locale,
|
|||
|
||||
case tok_string:
|
||||
/* This can become difficult. We have to get the weights which
|
||||
correspind the the single wide chars in the string. But some
|
||||
correspond to the single wide chars in the string. But some
|
||||
of the `chars' might not be real characters, but collation
|
||||
elements or symbols. And so the string decoder might have
|
||||
signaled errors. The string at this point is not translated.
|
||||
|
|
|
@ -1119,7 +1119,7 @@ character `%s' not defined while needed as default value"),
|
|||
}
|
||||
|
||||
if (ctype->toupper_done == 0)
|
||||
/* "If this keyword [toupper] is not spcified, the lowercase letters
|
||||
/* "If this keyword [toupper] is not specified, the lowercase letters
|
||||
`a' through `z', and their corresponding uppercase letters `A' to
|
||||
`Z', ..., shall automatically be included, with implementation-
|
||||
defined character values." [P1003.2, 2.5.2.1] */
|
||||
|
@ -1181,16 +1181,17 @@ allocate_arrays (struct locale_ctype_t *ctype, struct charset_t *charset)
|
|||
{
|
||||
size_t idx;
|
||||
|
||||
/* First we have to decide how we organize the arrays. It is easy for
|
||||
a one-byte character set. But multi-byte character set cannot be
|
||||
stored flat because they might be sparsly used. So we determine an
|
||||
optimal hashing function for the used characters.
|
||||
/* First we have to decide how we organize the arrays. It is easy
|
||||
for a one-byte character set. But multi-byte character set
|
||||
cannot be stored flat because the chars might be sparsely used.
|
||||
So we determine an optimal hashing function for the used
|
||||
characters.
|
||||
|
||||
We use a very trivial hashing function to store the sparse table.
|
||||
CH % TABSIZE is used as an index. To solve multiple hits we have
|
||||
N planes. This gurantees a fixed search time for a character [N
|
||||
/ 2]. In the following code we determine the minmum value for
|
||||
TABSIZE * N, where TABSIZE >= 256. */
|
||||
We use a very trivial hashing function to store the sparse
|
||||
table. CH % TABSIZE is used as an index. To solve multiple hits
|
||||
we have N planes. This guarantees a fixed search time for a
|
||||
character [N / 2]. In the following code we determine the minmum
|
||||
value for TABSIZE * N, where TABSIZE >= 256. */
|
||||
size_t min_total = UINT_MAX;
|
||||
size_t act_size = 256;
|
||||
|
||||
|
|
|
@ -1,21 +1,21 @@
|
|||
/* Copyright (C) 1995, 1996 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper, <drepper@gnu.ai.mit.edu>.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper, <drepper@gnu.ai.mit.edu>.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with the GNU C Library; see the file COPYING.LIB. If
|
||||
not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with the GNU C Library; see the file COPYING.LIB. If not,
|
||||
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
|
@ -260,7 +260,7 @@ time_finish (struct localedef_t *locale)
|
|||
}
|
||||
}
|
||||
|
||||
/* Next is the stoping date in ISO format. */
|
||||
/* Next is the stopping date in ISO format. */
|
||||
if (strncmp (str, "-*", 2) == 0)
|
||||
{
|
||||
time->era_entries[idx].stop_date[0] =
|
||||
|
|
|
@ -1,22 +1,22 @@
|
|||
/* locale - Implementation of the locale program according to POSIX 1003.2
|
||||
Copyright (C) 1995, 1996 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
|
||||
Copyright (C) 1995, 1996 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with the GNU C Library; see the file COPYING.LIB. If
|
||||
not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with the GNU C Library; see the file COPYING.LIB. If not,
|
||||
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
|
@ -145,7 +145,7 @@ main (int argc, char *argv[])
|
|||
show_keyword_name = 0;
|
||||
|
||||
/* Set locale. Do not set LC_ALL because the other categories must
|
||||
not be affected (acccording to POSIX.2). */
|
||||
not be affected (according to POSIX.2). */
|
||||
setlocale (LC_CTYPE, "");
|
||||
setlocale (LC_MESSAGES, "");
|
||||
|
||||
|
@ -446,7 +446,7 @@ show_info (const char *name)
|
|||
}
|
||||
}
|
||||
|
||||
/* When we get to here the name is not standard ones. For testing
|
||||
and perhpas advanced use we allow some more symbols. */
|
||||
/* The name is not a standard one.
|
||||
For testing and perhaps advanced use allow some more symbols. */
|
||||
locale_special (name, show_category_name, show_keyword_name);
|
||||
}
|
||||
|
|
|
@ -112,14 +112,14 @@ main (int argc, char *argv[])
|
|||
struct localedef_t *localedef;
|
||||
struct copy_def_list_t *act_add_locdef;
|
||||
|
||||
/* Set initial values for global varaibles. */
|
||||
/* Set initial values for global variables. */
|
||||
copy_list = NULL;
|
||||
posix_conformance = getenv ("POSIXLY_CORRECT") != NULL;
|
||||
error_print_progname = error_print;
|
||||
verbose = 0;
|
||||
|
||||
/* Set locale. Do not set LC_ALL because the other categories must
|
||||
not be affected (acccording to POSIX.2). */
|
||||
not be affected (according to POSIX.2). */
|
||||
setlocale (LC_MESSAGES, "");
|
||||
setlocale (LC_CTYPE, "");
|
||||
|
||||
|
@ -187,7 +187,7 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\
|
|||
/* Help is requested. */
|
||||
if (do_help)
|
||||
/* Possible violation: POSIX.2 4.35.8 defines the return value 0 as
|
||||
"No errors occured and the locale(s) were successfully created."
|
||||
"No errors occurred and the locale(s) were successfully created."
|
||||
But giving a other value than 0 does not make sense here. It
|
||||
is perhaps not that important because POSIX does not specify the
|
||||
-h option for localedef. */
|
||||
|
@ -424,7 +424,7 @@ error_print ()
|
|||
|
||||
|
||||
/* The parameter to localedef describes the output path. If it does
|
||||
contain a '/' character it is a relativ path. Otherwise it names the
|
||||
contain a '/' character it is a relative path. Otherwise it names the
|
||||
locale this definition is for. */
|
||||
static const char *
|
||||
construct_output_path (char *path)
|
||||
|
|
|
@ -1,21 +1,21 @@
|
|||
/* Copyright (C) 1996 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper, <drepper@gnu.ai.mit.edu>.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper, <drepper@gnu.ai.mit.edu>.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with the GNU C Library; see the file COPYING.LIB. If
|
||||
not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with the GNU C Library; see the file COPYING.LIB. If not,
|
||||
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
|
@ -628,7 +628,7 @@ syntax error in `order_start' directive"));
|
|||
}
|
||||
|
||||
/* If no argument to `order_start' is given, one `forward'
|
||||
argument is implicitely assumed. */
|
||||
argument is implicitly assumed. */
|
||||
if (cnt == 0)
|
||||
collate_new_order (ldfile, result, sort_forward);
|
||||
|
||||
|
|
|
@ -1,21 +1,21 @@
|
|||
/* Copyright (C) 1996 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper, <drepper@gnu.ai.mit.edu>.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper, <drepper@gnu.ai.mit.edu>.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with the GNU C Library; see the file COPYING.LIB. If
|
||||
not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with the GNU C Library; see the file COPYING.LIB. If not,
|
||||
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#ifndef _LOCFILE_H
|
||||
#define _LOCFILE_H
|
||||
|
@ -24,7 +24,7 @@ Boston, MA 02111-1307, USA. */
|
|||
|
||||
#include "charset.h"
|
||||
|
||||
/* Opaque types for the different loales. */
|
||||
/* Opaque types for the different locales. */
|
||||
struct locale_ctype_t;
|
||||
struct locale_collate_t;
|
||||
struct locale_monetary_t;
|
||||
|
|
|
@ -1,21 +1,21 @@
|
|||
/* Copyright (C) 1996 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Written by Ulrich Drepper, <drepper@gnu.ai.mit.edu>.
|
||||
This file is part of the GNU C Library.
|
||||
Written by Ulrich Drepper, <drepper@gnu.ai.mit.edu>.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with the GNU C Library; see the file COPYING.LIB. If
|
||||
not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with the GNU C Library; see the file COPYING.LIB. If not,
|
||||
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#include <alloca.h>
|
||||
#include <langinfo.h>
|
||||
|
@ -41,8 +41,8 @@ typedef struct weight_t
|
|||
} weight_t;
|
||||
|
||||
|
||||
/* The following five macros grant access to the non-byte order
|
||||
dependend values in the collate locale file. */
|
||||
/* The following five macros grant access to the values in the
|
||||
collate locale file that do not depend on byte order. */
|
||||
#define collate_nrules \
|
||||
(_NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_NRULES))
|
||||
#define collate_hash_size \
|
||||
|
|
|
@ -67,7 +67,7 @@ logwtmp (const char *line, const char *name, const char *host)
|
|||
__flock (fd, LOCK_EX | LOCK_NB);
|
||||
}
|
||||
|
||||
/* Remeber original size of log file: */
|
||||
/* Remember original size of log file: */
|
||||
if (__fstat (fd, &st) < 0)
|
||||
goto done;
|
||||
|
||||
|
|
30
login/pty.h
30
login/pty.h
|
@ -1,21 +1,21 @@
|
|||
/* pty.h - Functions for pseudo TTY handlung.
|
||||
Copyright (C) 1996 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
/* pty.h - Functions for pseudo TTY handling.
|
||||
Copyright (C) 1996 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with the GNU C Library; see the file COPYING.LIB. If
|
||||
not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with the GNU C Library; see the file COPYING.LIB. If not,
|
||||
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#ifndef _PTY_H
|
||||
|
||||
|
|
|
@ -130,7 +130,7 @@ $(objpfx)mach-shortcuts.h: $(objpfx)mach/mach_interface.h \
|
|||
$(objpfx)mach/mach_port.h
|
||||
# The first line gets us one paragraph per line, with @s separating real lines.
|
||||
# The second line selects paragraphs for the shortcutted functions.
|
||||
# The third line removes `_rpc' from the names and rerealifies the lines.
|
||||
# The third line removes `_rpc' from the names and reconstitutes the lines.
|
||||
cat $^ | tr \\012 @ | sed s/@@/@%/g | tr % \\012 \
|
||||
| grep '^/\* Routine [a-z0-9_]*_rpc \*/' \
|
||||
| sed 's/_rpc//g' | tr @ \\012 > $@-new
|
||||
|
|
|
@ -1,48 +1,54 @@
|
|||
/*
|
||||
/*
|
||||
* Mach Operating System
|
||||
* Copyright (c) 1991,1990,1989 Carnegie Mellon University
|
||||
* All Rights Reserved.
|
||||
*
|
||||
*
|
||||
* Permission to use, copy, modify and distribute this software and its
|
||||
* documentation is hereby granted, provided that both the copyright
|
||||
* notice and this permission notice appear in all copies of the
|
||||
* software, derivative works or modified versions, and any portions
|
||||
* thereof, and that both notices appear in supporting documentation.
|
||||
*
|
||||
* CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS
|
||||
*
|
||||
* CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS
|
||||
* CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
|
||||
* ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
|
||||
*
|
||||
*
|
||||
* Carnegie Mellon requests users of this software to return to
|
||||
*
|
||||
*
|
||||
* Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
|
||||
* School of Computer Science
|
||||
* Carnegie Mellon University
|
||||
* Pittsburgh PA 15213-3890
|
||||
*
|
||||
*
|
||||
* any improvements or extensions that they make and grant Carnegie the
|
||||
* rights to redistribute these changes.
|
||||
*/
|
||||
/*
|
||||
* HISTORY
|
||||
* $Log$
|
||||
* Revision 1.5 1996/12/20 01:32:34 drepper
|
||||
* Update from main archive 961219
|
||||
*
|
||||
* Revision 1.5 1996/12/19 20:23:39 drepper
|
||||
* Spelling corrections.
|
||||
*
|
||||
* Revision 1.4 1993/12/17 06:14:52 mib
|
||||
* entered into RCS
|
||||
*
|
||||
* Revision 2.3 92/04/01 19:38:02 rpd
|
||||
* Added err_codes_device.
|
||||
* [92/03/09 rpd]
|
||||
*
|
||||
*
|
||||
* Revision 2.2 92/01/16 00:08:50 rpd
|
||||
* Moved from user collection to mk collection.
|
||||
*
|
||||
*
|
||||
* Revision 2.3 91/08/29 15:51:22 rpd
|
||||
* Updated err_codes_kern.
|
||||
* [91/08/15 rpd]
|
||||
*
|
||||
*
|
||||
* Revision 2.2 91/03/27 16:05:27 mrt
|
||||
* First checkin
|
||||
*
|
||||
*
|
||||
*/
|
||||
/*
|
||||
* File: err_kern.sub
|
||||
|
@ -130,12 +136,12 @@ static char * err_codes_unix[] = {
|
|||
"(os/unix) result is out of range",
|
||||
"(os/unix) operation on device would block",
|
||||
"(os/unix) operation is now in progress",
|
||||
"(os/unix) operation is already in progress",
|
||||
"(os/unix) operation is already in progress",
|
||||
"(os/unix) socket operation attempted on non-socket object",
|
||||
"(os/unix) destination address is required",
|
||||
"(os/unix) message is too long",
|
||||
"(os/unix) protocol type is incorrect for socket",
|
||||
"(os/unix) protocol type is not availaible",
|
||||
"(os/unix) protocol type is not available",
|
||||
"(os/unix) protocol type is not supported",
|
||||
"(os/unix) socket type is not supported",
|
||||
"(os/unix) operation is not supported on sockets",
|
||||
|
|
|
@ -3,71 +3,77 @@
|
|||
* Mach Operating System
|
||||
* Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University
|
||||
* All Rights Reserved.
|
||||
*
|
||||
*
|
||||
* Permission to use, copy, modify and distribute this software and its
|
||||
* documentation is hereby granted, provided that both the copyright
|
||||
* notice and this permission notice appear in all copies of the
|
||||
* software, derivative works or modified versions, and any portions
|
||||
* thereof, and that both notices appear in supporting documentation.
|
||||
*
|
||||
*
|
||||
* CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
|
||||
* CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
|
||||
* ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
|
||||
*
|
||||
*
|
||||
* Carnegie Mellon requests users of this software to return to
|
||||
*
|
||||
*
|
||||
* Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
|
||||
* School of Computer Science
|
||||
* Carnegie Mellon University
|
||||
* Pittsburgh PA 15213-3890
|
||||
*
|
||||
*
|
||||
* any improvements or extensions that they make and grant Carnegie Mellon
|
||||
* the rights to redistribute these changes.
|
||||
*/
|
||||
/*
|
||||
* HISTORY
|
||||
* $Log$
|
||||
* Revision 1.2 1996/12/20 01:32:36 drepper
|
||||
* Update from main archive 961219
|
||||
*
|
||||
* Revision 1.2 1996/12/19 20:23:56 drepper
|
||||
* Spelling corrections.
|
||||
*
|
||||
* Revision 1.1 1993/12/17 21:40:28 roland
|
||||
* entered into RCS
|
||||
*
|
||||
* Revision 2.6 93/01/14 17:41:31 danner
|
||||
* Standardized include symbol name.
|
||||
* [92/06/10 pds]
|
||||
*
|
||||
*
|
||||
* Revision 2.5 92/03/31 15:18:11 rpd
|
||||
* Added err_bootstrap for bootstrap errors.
|
||||
* [92/03/09 rpd]
|
||||
*
|
||||
*
|
||||
* Revision 2.4 91/05/14 16:51:24 mrt
|
||||
* Correcting copyright
|
||||
*
|
||||
*
|
||||
* Revision 2.3 91/02/05 17:31:48 mrt
|
||||
* Changed to new Mach copyright
|
||||
* [91/02/01 17:16:50 mrt]
|
||||
*
|
||||
*
|
||||
* Revision 2.2 90/06/02 14:57:47 rpd
|
||||
* Added err_mach_ipc for new IPC.
|
||||
* [90/03/26 22:28:42 rpd]
|
||||
*
|
||||
*
|
||||
* Revision 2.1 89/08/03 16:02:07 rwd
|
||||
* Created.
|
||||
*
|
||||
*
|
||||
* Revision 2.4 89/02/25 18:13:18 gm0w
|
||||
* Changes for cleanup.
|
||||
*
|
||||
*
|
||||
* Revision 2.3 89/02/07 00:51:57 mwyoung
|
||||
* Relocated from sys/error.h
|
||||
*
|
||||
*
|
||||
* Revision 2.2 88/10/18 00:37:31 mwyoung
|
||||
* Added {system,sub and code}_emask
|
||||
* Added {system,sub and code}_emask
|
||||
* [88/10/17 17:06:58 mrt]
|
||||
*
|
||||
* Added {system,sub and code}_emask
|
||||
*
|
||||
* Added {system,sub and code}_emask
|
||||
*
|
||||
* 12-May-88 Mary Thompson (mrt) at Carnegie Mellon
|
||||
* Changed mach_error_t from unsigned int to kern_return_t
|
||||
* which is a 32 bit integer regardless of machine type.
|
||||
* insigned int was incompatible with old usages of mach_error.
|
||||
* unsigned int was incompatible with old usages of mach_error.
|
||||
*
|
||||
* 10-May-88 Douglas Orr (dorr) at Carnegie-Mellon University
|
||||
* Missing endif replaced
|
||||
|
|
|
@ -1,20 +1,20 @@
|
|||
/* Copyright (C) 1994 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
/* Copyright (C) 1994, 1996 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with the GNU C Library; see the file COPYING.LIB. If
|
||||
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
|
||||
Cambridge, MA 02139, USA. */
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with the GNU C Library; see the file COPYING.LIB. If not,
|
||||
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
/* Declare the few Mach system calls (except mach_msg, in <mach/message.h>).
|
||||
This does not include the kernel RPC shortcut calls (in <mach-shortcuts.h>).
|
||||
|
@ -52,12 +52,12 @@ extern boolean_t __swtch (void);
|
|||
|
||||
/* Attempt to context switch the current thread off the processor. Lower
|
||||
the thread's priority as much as possible. The thread's priority will
|
||||
be restored when it runs again. PRIORITY is currently unused. Return
|
||||
be restored when it runs again. PRIORITY is currently unused. Return
|
||||
true if there are other threads that can be run and false if not. */
|
||||
extern boolean_t swtch_pri (int priority);
|
||||
extern boolean_t __swtch_pri (int priority);
|
||||
|
||||
/* Attempt to context switch the current thread of the rpocessor. Try
|
||||
/* Attempt to context switch the current thread of the processor. Try
|
||||
to run NEW_THREAD next, ignoring normal scheduling policies. The
|
||||
OPTION value comes from <mach/thread_switch.h>. If OPTION is
|
||||
SWITCH_OPTION_WAIT, then block the current thread for TIME
|
||||
|
@ -67,7 +67,7 @@ extern boolean_t __swtch_pri (int priority);
|
|||
kern_return_t thread_switch (mach_port_t new_thread, int option, int time);
|
||||
kern_return_t __thread_switch (mach_port_t new_thread, int option, int time);
|
||||
|
||||
/* Block the current thread until the kernel (or device) event
|
||||
/* Block the current thread until the kernel (or device) event
|
||||
identified by EVENT occurs. */
|
||||
kern_return_t evc_wait (unsigned int event);
|
||||
kern_return_t __evc_wait (unsigned int event);
|
||||
|
|
|
@ -1,20 +1,20 @@
|
|||
/* Copyright (C) 1993, 1994, 1995 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
/* Copyright (C) 1993, 1994, 1995, 1996 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with the GNU C Library; see the file COPYING.LIB. If
|
||||
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
|
||||
Cambridge, MA 02139, USA. */
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with the GNU C Library; see the file COPYING.LIB. If not,
|
||||
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
/* Based on CMU's mach_msg_server.c revision 2.4 of 91/05/14, and thus
|
||||
under the following copyright. Rewritten by Roland McGrath (FSF)
|
||||
|
@ -49,6 +49,12 @@ Cambridge, MA 02139, USA. */
|
|||
/*
|
||||
* HISTORY
|
||||
* $Log$
|
||||
* Revision 1.5 1996/12/20 01:32:35 drepper
|
||||
* Update from main archive 961219
|
||||
*
|
||||
* Revision 1.5 1996/12/19 20:23:45 drepper
|
||||
* Spelling corrections.
|
||||
*
|
||||
* Revision 1.4 1996/01/29 15:44:23 roland
|
||||
* Declare DEMUX arg with prototype.
|
||||
*
|
||||
|
@ -162,7 +168,7 @@ __mach_msg_server_timeout (boolean_t (*demux) (mach_msg_header_t *request,
|
|||
{
|
||||
case MACH_RCV_TOO_LARGE:
|
||||
/* The request message is larger than MAX_SIZE, and has not
|
||||
been dequued. The message header has the actual size of
|
||||
been dequeued. The message header has the actual size of
|
||||
the message. We recurse here in hopes that the compiler
|
||||
will optimize the tail-call and allocate some more stack
|
||||
space instead of way too much. */
|
||||
|
@ -171,7 +177,7 @@ __mach_msg_server_timeout (boolean_t (*demux) (mach_msg_header_t *request,
|
|||
|
||||
case MACH_SEND_INVALID_DEST:
|
||||
/* The reply can't be delivered, so destroy it. This error
|
||||
indicates only that the requestor went away, so we
|
||||
indicates only that the requester went away, so we
|
||||
continue and get the next request. */
|
||||
__mach_msg_destroy (&request->Head);
|
||||
break;
|
||||
|
|
|
@ -27,15 +27,27 @@ dist-headers := malloc.h
|
|||
headers := $(dist-headers) obstack.h
|
||||
tests := mallocbug
|
||||
|
||||
distribute = thread-m.h
|
||||
distribute = thread-m.h mtrace.awk
|
||||
|
||||
# Things which get pasted together into gmalloc.c.
|
||||
gmalloc-routines := malloc morecore
|
||||
# Things to include in the standalone distribution.
|
||||
dist-routines = $(gmalloc-routines)
|
||||
dist-routines = $(gmalloc-routines) mcheck mtrace
|
||||
routines = $(dist-routines) obstack
|
||||
|
||||
install-lib := libmcheck.a
|
||||
non-lib.a := libmcheck.a
|
||||
|
||||
# These should be removed by `make clean'.
|
||||
extra-objs = mcheck-init.o libmcheck.a
|
||||
|
||||
include ../Rules
|
||||
|
||||
$(objpfx)libmcheck.a: $(objpfx)mcheck-init.o
|
||||
-rm -f $@
|
||||
ln $< $@
|
||||
|
||||
lib: $(objpfx)libmcheck.a
|
||||
|
||||
|
||||
CPPFLAGS-malloc.o += -DMALLOC_DEBUG
|
||||
CFLAGS-obstack.c = -Wno-strict-prototypes
|
||||
|
|
|
@ -140,7 +140,7 @@
|
|||
|
||||
Maximum overhead wastage per allocated chunk: normally 15 bytes
|
||||
|
||||
Alignnment demands, plus the minimum allocatable size restriction
|
||||
Alignment demands, plus the minimum allocatable size restriction
|
||||
make the normal worst-case wastage 15 bytes (i.e., up to 15
|
||||
more bytes will be allocated than were requested in malloc), with
|
||||
two exceptions:
|
||||
|
@ -343,7 +343,7 @@ extern "C" {
|
|||
checking is fairly extensive, and will slow down execution
|
||||
noticeably. Calling malloc_stats or mallinfo with MALLOC_DEBUG set will
|
||||
attempt to check every non-mmapped allocated and free chunk in the
|
||||
course of computing the summmaries. (By nature, mmapped regions
|
||||
course of computing the summaries. (By nature, mmapped regions
|
||||
cannot be checked very much automatically.)
|
||||
|
||||
Setting MALLOC_DEBUG may also be helpful if you are trying to modify
|
||||
|
@ -999,7 +999,7 @@ nextchunk-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|||
the malloc code, but "mem" is the pointer that is returned to the
|
||||
user. "Nextchunk" is the beginning of the next contiguous chunk.
|
||||
|
||||
Chunks always begin on even word boundries, so the mem portion
|
||||
Chunks always begin on even word boundaries, so the mem portion
|
||||
(which is returned to the user) is also on an even word boundary, and
|
||||
thus double-word aligned.
|
||||
|
||||
|
@ -1144,7 +1144,7 @@ typedef struct _arena {
|
|||
} arena;
|
||||
|
||||
|
||||
/* A heap is a single contiguous memory region holding (coalescable)
|
||||
/* A heap is a single contiguous memory region holding (coalesceable)
|
||||
malloc_chunks. It is allocated with mmap() and always starts at an
|
||||
address aligned to HEAP_MAX_SIZE. Not used unless compiling for
|
||||
multiple threads. */
|
||||
|
@ -1489,6 +1489,8 @@ static unsigned long max_mmapped_mem = 0;
|
|||
|
||||
|
||||
|
||||
/* Already initialized? */
|
||||
int __malloc_initialized;
|
||||
|
||||
|
||||
/* Initialization routine. */
|
||||
|
@ -1504,13 +1506,12 @@ void
|
|||
ptmalloc_init __MALLOC_P((void))
|
||||
#endif
|
||||
{
|
||||
static int first = 1;
|
||||
#if defined(_LIBC) || defined(MALLOC_HOOKS)
|
||||
const char* s;
|
||||
#endif
|
||||
|
||||
if(!first) return;
|
||||
first = 0;
|
||||
if(__malloc_initialized) return;
|
||||
__malloc_initialized = 1;
|
||||
#if defined(_LIBC)
|
||||
/* Initialize the pthreads interface. */
|
||||
if (__pthread_initialize != NULL)
|
||||
|
@ -3589,7 +3590,7 @@ dump_heap(heap) heap_info *heap;
|
|||
|
||||
malloc_stats:
|
||||
|
||||
For all arenas seperately and in total, prints on stderr the
|
||||
For all arenas separately and in total, prints on stderr the
|
||||
amount of space obtained from the system, and the current number
|
||||
of bytes allocated via malloc (or realloc, etc) but not yet
|
||||
freed. (Note that this is the number of bytes allocated, not the
|
||||
|
@ -3964,10 +3965,10 @@ History:
|
|||
Wolfram Gloger (Gloger@lrz.uni-muenchen.de).
|
||||
* Use last_remainder in more cases.
|
||||
* Pack bins using idea from colin@nyx10.cs.du.edu
|
||||
* Use ordered bins instead of best-fit threshhold
|
||||
* Use ordered bins instead of best-fit threshold
|
||||
* Eliminate block-local decls to simplify tracing and debugging.
|
||||
* Support another case of realloc via move into top
|
||||
* Fix error occuring when initial sbrk_base not word-aligned.
|
||||
* Fix error occurring when initial sbrk_base not word-aligned.
|
||||
* Rely on page size for units instead of SBRK_UNIT to
|
||||
avoid surprises about sbrk alignment conventions.
|
||||
* Add mallinfo, mallopt. Thanks to Raymond Nijssen
|
||||
|
|
|
@ -73,6 +73,9 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Nonzero if the malloc is already initialized. */
|
||||
extern int __malloc_initialized;
|
||||
|
||||
/* Initialize global configuration. Not needed with GNU libc. */
|
||||
#ifndef __GLIBC__
|
||||
extern void ptmalloc_init __MALLOC_P ((void));
|
||||
|
|
30
malloc/mcheck-init.c
Normal file
30
malloc/mcheck-init.c
Normal file
|
@ -0,0 +1,30 @@
|
|||
/* Copyright (C) 1991, 1994, 1995 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with the GNU C Library; see the file COPYING.LIB. If
|
||||
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
|
||||
Cambridge, MA 02139, USA. */
|
||||
|
||||
/* The object of this file should be installed as libmcheck.a,
|
||||
so one can do -lmcheck to turn on mcheck. */
|
||||
|
||||
#include <malloc.h>
|
||||
|
||||
static void
|
||||
turn_on_mcheck __P ((void))
|
||||
{
|
||||
mcheck (NULL);
|
||||
}
|
||||
|
||||
void (*__malloc_initialize_hook) __P ((void)) = turn_on_mcheck;
|
232
malloc/mcheck.c
Normal file
232
malloc/mcheck.c
Normal file
|
@ -0,0 +1,232 @@
|
|||
/* Standard debugging hooks for `malloc'.
|
||||
Copyright (C) 1990,91,92,93,94,95,96 Free Software Foundation, Inc.
|
||||
Written May 1989 by Mike Haertel.
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; see the file COPYING.LIB. If not,
|
||||
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA.
|
||||
|
||||
The author may be reached (Email) at the address mike@ai.mit.edu,
|
||||
or (US mail) as Mike Haertel c/o Free Software Foundation. */
|
||||
|
||||
#ifndef _MALLOC_INTERNAL
|
||||
#define _MALLOC_INTERNAL
|
||||
#include <malloc.h>
|
||||
#include <mcheck.h>
|
||||
#include <stdio.h>
|
||||
#endif
|
||||
|
||||
/* Old hook values. */
|
||||
static void (*old_free_hook) __P ((__ptr_t ptr));
|
||||
static __ptr_t (*old_malloc_hook) __P ((__malloc_size_t size));
|
||||
static __ptr_t (*old_realloc_hook) __P ((__ptr_t ptr, __malloc_size_t size));
|
||||
|
||||
/* Function to call when something awful happens. */
|
||||
static void (*abortfunc) __P ((enum mcheck_status));
|
||||
|
||||
/* Arbitrary magical numbers. */
|
||||
#define MAGICWORD 0xfedabeeb
|
||||
#define MAGICFREE 0xd8675309
|
||||
#define MAGICBYTE ((char) 0xd7)
|
||||
#define MALLOCFLOOD ((char) 0x93)
|
||||
#define FREEFLOOD ((char) 0x95)
|
||||
|
||||
struct hdr
|
||||
{
|
||||
__malloc_size_t size; /* Exact size requested by user. */
|
||||
unsigned long int magic; /* Magic number to check header integrity. */
|
||||
};
|
||||
|
||||
#if defined(_LIBC) || defined(STDC_HEADERS) || defined(USG)
|
||||
#define flood memset
|
||||
#else
|
||||
static void flood __P ((__ptr_t, int, __malloc_size_t));
|
||||
static void
|
||||
flood (ptr, val, size)
|
||||
__ptr_t ptr;
|
||||
int val;
|
||||
__malloc_size_t size;
|
||||
{
|
||||
char *cp = ptr;
|
||||
while (size--)
|
||||
*cp++ = val;
|
||||
}
|
||||
#endif
|
||||
|
||||
static enum mcheck_status checkhdr __P ((const struct hdr *));
|
||||
static enum mcheck_status
|
||||
checkhdr (hdr)
|
||||
const struct hdr *hdr;
|
||||
{
|
||||
enum mcheck_status status;
|
||||
switch (hdr->magic)
|
||||
{
|
||||
default:
|
||||
status = MCHECK_HEAD;
|
||||
break;
|
||||
case MAGICFREE:
|
||||
status = MCHECK_FREE;
|
||||
break;
|
||||
case MAGICWORD:
|
||||
if (((char *) &hdr[1])[hdr->size] != MAGICBYTE)
|
||||
status = MCHECK_TAIL;
|
||||
else
|
||||
status = MCHECK_OK;
|
||||
break;
|
||||
}
|
||||
if (status != MCHECK_OK)
|
||||
(*abortfunc) (status);
|
||||
return status;
|
||||
}
|
||||
|
||||
static void freehook __P ((__ptr_t));
|
||||
static void
|
||||
freehook (ptr)
|
||||
__ptr_t ptr;
|
||||
{
|
||||
if (ptr)
|
||||
{
|
||||
struct hdr *hdr = ((struct hdr *) ptr) - 1;
|
||||
checkhdr (hdr);
|
||||
hdr->magic = MAGICFREE;
|
||||
flood (ptr, FREEFLOOD, hdr->size);
|
||||
ptr = (__ptr_t) hdr;
|
||||
}
|
||||
__free_hook = old_free_hook;
|
||||
free (ptr);
|
||||
__free_hook = freehook;
|
||||
}
|
||||
|
||||
static __ptr_t mallochook __P ((__malloc_size_t));
|
||||
static __ptr_t
|
||||
mallochook (size)
|
||||
__malloc_size_t size;
|
||||
{
|
||||
struct hdr *hdr;
|
||||
|
||||
__malloc_hook = old_malloc_hook;
|
||||
hdr = (struct hdr *) malloc (sizeof (struct hdr) + size + 1);
|
||||
__malloc_hook = mallochook;
|
||||
if (hdr == NULL)
|
||||
return NULL;
|
||||
|
||||
hdr->size = size;
|
||||
hdr->magic = MAGICWORD;
|
||||
((char *) &hdr[1])[size] = MAGICBYTE;
|
||||
flood ((__ptr_t) (hdr + 1), MALLOCFLOOD, size);
|
||||
return (__ptr_t) (hdr + 1);
|
||||
}
|
||||
|
||||
static __ptr_t reallochook __P ((__ptr_t, __malloc_size_t));
|
||||
static __ptr_t
|
||||
reallochook (ptr, size)
|
||||
__ptr_t ptr;
|
||||
__malloc_size_t size;
|
||||
{
|
||||
struct hdr *hdr;
|
||||
__malloc_size_t osize;
|
||||
|
||||
if (ptr)
|
||||
{
|
||||
hdr = ((struct hdr *) ptr) - 1;
|
||||
osize = hdr->size;
|
||||
|
||||
checkhdr (hdr);
|
||||
if (size < osize)
|
||||
flood ((char *) ptr + size, FREEFLOOD, osize - size);
|
||||
}
|
||||
else
|
||||
{
|
||||
osize = 0;
|
||||
hdr = NULL;
|
||||
}
|
||||
__free_hook = old_free_hook;
|
||||
__malloc_hook = old_malloc_hook;
|
||||
__realloc_hook = old_realloc_hook;
|
||||
hdr = (struct hdr *) realloc ((__ptr_t) hdr, sizeof (struct hdr) + size + 1);
|
||||
__free_hook = freehook;
|
||||
__malloc_hook = mallochook;
|
||||
__realloc_hook = reallochook;
|
||||
if (hdr == NULL)
|
||||
return NULL;
|
||||
|
||||
hdr->size = size;
|
||||
hdr->magic = MAGICWORD;
|
||||
((char *) &hdr[1])[size] = MAGICBYTE;
|
||||
if (size > osize)
|
||||
flood ((char *) (hdr + 1) + osize, MALLOCFLOOD, size - osize);
|
||||
return (__ptr_t) (hdr + 1);
|
||||
}
|
||||
|
||||
static void mabort __P ((enum mcheck_status status));
|
||||
static void
|
||||
mabort (status)
|
||||
enum mcheck_status status;
|
||||
{
|
||||
const char *msg;
|
||||
switch (status)
|
||||
{
|
||||
case MCHECK_OK:
|
||||
msg = _("memory is consistent, library is buggy");
|
||||
break;
|
||||
case MCHECK_HEAD:
|
||||
msg = _("memory clobbered before allocated block");
|
||||
break;
|
||||
case MCHECK_TAIL:
|
||||
msg = _("memory clobbered past end of allocated block");
|
||||
break;
|
||||
case MCHECK_FREE:
|
||||
msg = _("block freed twice");
|
||||
break;
|
||||
default:
|
||||
msg = _("bogus mcheck_status, library is buggy");
|
||||
break;
|
||||
}
|
||||
#ifdef _LIBC
|
||||
__libc_fatal (msg);
|
||||
#else
|
||||
fprintf (stderr, "mcheck: %s\n", msg);
|
||||
fflush (stderr);
|
||||
abort ();
|
||||
#endif
|
||||
}
|
||||
|
||||
static int mcheck_used = 0;
|
||||
|
||||
int
|
||||
mcheck (func)
|
||||
void (*func) __P ((enum mcheck_status));
|
||||
{
|
||||
abortfunc = (func != NULL) ? func : &mabort;
|
||||
|
||||
/* These hooks may not be safely inserted if malloc is already in use. */
|
||||
if (!__malloc_initialized && !mcheck_used)
|
||||
{
|
||||
old_free_hook = __free_hook;
|
||||
__free_hook = freehook;
|
||||
old_malloc_hook = __malloc_hook;
|
||||
__malloc_hook = mallochook;
|
||||
old_realloc_hook = __realloc_hook;
|
||||
__realloc_hook = reallochook;
|
||||
mcheck_used = 1;
|
||||
}
|
||||
|
||||
return mcheck_used ? 0 : -1;
|
||||
}
|
||||
|
||||
enum mcheck_status
|
||||
mprobe (__ptr_t ptr)
|
||||
{
|
||||
return mcheck_used ? checkhdr (ptr) : MCHECK_DISABLED;
|
||||
}
|
70
malloc/mcheck.h
Normal file
70
malloc/mcheck.h
Normal file
|
@ -0,0 +1,70 @@
|
|||
/* Copyright (C) 1996 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with the GNU C Library; see the file COPYING.LIB. If not,
|
||||
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#ifndef _MCHECK_H
|
||||
#define _MCHECK_H 1
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if defined (__cplusplus) || (defined (__STDC__) && __STDC__)
|
||||
#undef __P
|
||||
#define __P(args) args
|
||||
#undef __ptr_t
|
||||
#define __ptr_t void *
|
||||
#else /* Not C++ or ANSI C. */
|
||||
#undef __P
|
||||
#define __P(args) ()
|
||||
#undef __ptr_t
|
||||
#define __ptr_t char *
|
||||
#endif /* C++ or ANSI C. */
|
||||
|
||||
|
||||
/* Return values for `mprobe': these are the kinds of inconsistencies that
|
||||
`mcheck' enables detection of. */
|
||||
enum mcheck_status
|
||||
{
|
||||
MCHECK_DISABLED = -1, /* Consistency checking is not turned on. */
|
||||
MCHECK_OK, /* Block is fine. */
|
||||
MCHECK_FREE, /* Block freed twice. */
|
||||
MCHECK_HEAD, /* Memory before the block was clobbered. */
|
||||
MCHECK_TAIL /* Memory after the block was clobbered. */
|
||||
};
|
||||
|
||||
|
||||
/* Activate a standard collection of debugging hooks. This must be called
|
||||
before `malloc' is ever called. ABORTFUNC is called with an error code
|
||||
(see enum above) when an inconsistency is detected. If ABORTFUNC is
|
||||
null, the standard function prints on stderr and then calls `abort'. */
|
||||
extern int mcheck __P ((void (*__abortfunc) __P ((enum mcheck_status))));
|
||||
|
||||
/* Check for aberrations in a particular malloc'd block. You must have
|
||||
called `mcheck' already. These are the same checks that `mcheck' does
|
||||
when you free or reallocate a block. */
|
||||
extern enum mcheck_status mprobe __P ((__ptr_t __ptr));
|
||||
|
||||
/* Activate a standard collection of tracing hooks. */
|
||||
extern void mtrace __P ((void));
|
||||
extern void muntrace __P ((void));
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* mcheck.h */
|
50
malloc/mtrace.awk
Normal file
50
malloc/mtrace.awk
Normal file
|
@ -0,0 +1,50 @@
|
|||
#
|
||||
# Awk program to analyze mtrace.c output.
|
||||
#
|
||||
{
|
||||
if ($1 == "@") {
|
||||
where = " (" $2 ")"
|
||||
n = 3
|
||||
} else {
|
||||
where = ""
|
||||
n = 1
|
||||
}
|
||||
if ($n == "+") {
|
||||
if (allocated[$(n+1)] != "")
|
||||
print "+", $(n+1), "Alloc", NR, "duplicate:", allocated[$(n+1)], wherewas[$(n+1)], where;
|
||||
else {
|
||||
wherewas[$(n+1)] = where;
|
||||
allocated[$(n+1)] = $(n+2);
|
||||
}
|
||||
} else if ($n == "-") {
|
||||
if (allocated[$(n+1)] != "") {
|
||||
wherewas[$(n+1)] = "";
|
||||
allocated[$(n+1)] = "";
|
||||
if (allocated[$(n+1)] != "")
|
||||
print "DELETE FAILED", $(n+1), allocated[$(n+1)];
|
||||
} else
|
||||
print "-", $(n+1), "Free", NR, "was never alloc'd", where;
|
||||
} else if ($n == "<") {
|
||||
if (allocated[$(n+1)] != "") {
|
||||
wherewas[$(n+1)] = "";
|
||||
allocated[$(n+1)] = "";
|
||||
} else
|
||||
print "-", $(n+1), "Realloc", NR, "was never alloc'd", where;
|
||||
} else if ($n == ">") {
|
||||
if (allocated[$(n+1)] != "")
|
||||
print "+", $(n+1), "Realloc", NR, "duplicate:", allocated[$(n+1)], where;
|
||||
else {
|
||||
wherewas[$(n+1)] = $(n+2);
|
||||
allocated[$(n+1)] = $(n+2);
|
||||
}
|
||||
} else if ($n == "=") {
|
||||
# Ignore "= Start"
|
||||
} else if ($n == "!") {
|
||||
# Ignore failed realloc attempts for now
|
||||
}
|
||||
}
|
||||
END {
|
||||
for (x in allocated)
|
||||
if (allocated[x] != "")
|
||||
print "+", x, allocated[x], wherewas[x];
|
||||
}
|
211
malloc/mtrace.c
Normal file
211
malloc/mtrace.c
Normal file
|
@ -0,0 +1,211 @@
|
|||
/* More debugging hooks for `malloc'.
|
||||
Copyright (C) 1991, 1992, 1993, 1994, 1996 Free Software Foundation, Inc.
|
||||
Written April 2, 1991 by John Gilmore of Cygnus Support.
|
||||
Based on mcheck.c by Mike Haertel.
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; see the file COPYING.LIB. If not,
|
||||
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA.
|
||||
|
||||
The author may be reached (Email) at the address mike@ai.mit.edu,
|
||||
or (US mail) as Mike Haertel c/o Free Software Foundation. */
|
||||
|
||||
#ifndef _MALLOC_INTERNAL
|
||||
#define _MALLOC_INTERNAL
|
||||
#include <malloc.h>
|
||||
#include <mcheck.h>
|
||||
#include <libc-lock.h>
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#ifndef __GNU_LIBRARY__
|
||||
extern char *getenv ();
|
||||
#else
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
|
||||
static FILE *mallstream;
|
||||
static char mallenv[]= "MALLOC_TRACE";
|
||||
static char mallbuf[BUFSIZ]; /* Buffer for the output. */
|
||||
|
||||
__libc_lock_define_initialized (static, lock);
|
||||
|
||||
/* Address to breakpoint on accesses to... */
|
||||
__ptr_t mallwatch;
|
||||
|
||||
/* File name and line number information, for callers that had
|
||||
the foresight to call through a macro. */
|
||||
char *_mtrace_file;
|
||||
int _mtrace_line;
|
||||
|
||||
/* Old hook values. */
|
||||
static void (*tr_old_free_hook) __P ((__ptr_t ptr));
|
||||
static __ptr_t (*tr_old_malloc_hook) __P ((__malloc_size_t size));
|
||||
static __ptr_t (*tr_old_realloc_hook) __P ((__ptr_t ptr, __malloc_size_t size));
|
||||
|
||||
/* This function is called when the block being alloc'd, realloc'd, or
|
||||
freed has an address matching the variable "mallwatch". In a debugger,
|
||||
set "mallwatch" to the address of interest, then put a breakpoint on
|
||||
tr_break. */
|
||||
|
||||
void tr_break __P ((void));
|
||||
void
|
||||
tr_break ()
|
||||
{
|
||||
}
|
||||
|
||||
static void tr_where __P ((void));
|
||||
static void
|
||||
tr_where ()
|
||||
{
|
||||
if (_mtrace_file)
|
||||
{
|
||||
fprintf (mallstream, "@ %s:%d ", _mtrace_file, _mtrace_line);
|
||||
_mtrace_file = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
static void tr_freehook __P ((__ptr_t));
|
||||
static void
|
||||
tr_freehook (ptr)
|
||||
__ptr_t ptr;
|
||||
{
|
||||
tr_where ();
|
||||
fprintf (mallstream, "- %p\n", ptr); /* Be sure to print it first. */
|
||||
if (ptr == mallwatch)
|
||||
tr_break ();
|
||||
__libc_lock_lock (lock);
|
||||
__free_hook = tr_old_free_hook;
|
||||
free (ptr);
|
||||
__free_hook = tr_freehook;
|
||||
__libc_lock_unlock (lock);
|
||||
}
|
||||
|
||||
static __ptr_t tr_mallochook __P ((__malloc_size_t));
|
||||
static __ptr_t
|
||||
tr_mallochook (size)
|
||||
__malloc_size_t size;
|
||||
{
|
||||
__ptr_t hdr;
|
||||
|
||||
__libc_lock_lock (lock);
|
||||
|
||||
__malloc_hook = tr_old_malloc_hook;
|
||||
hdr = (__ptr_t) malloc (size);
|
||||
__malloc_hook = tr_mallochook;
|
||||
|
||||
__libc_lock_unlock (lock);
|
||||
|
||||
tr_where ();
|
||||
/* We could be printing a NULL here; that's OK. */
|
||||
fprintf (mallstream, "+ %p %lx\n", hdr, (unsigned long)size);
|
||||
|
||||
if (hdr == mallwatch)
|
||||
tr_break ();
|
||||
|
||||
return hdr;
|
||||
}
|
||||
|
||||
static __ptr_t tr_reallochook __P ((__ptr_t, __malloc_size_t));
|
||||
static __ptr_t
|
||||
tr_reallochook (ptr, size)
|
||||
__ptr_t ptr;
|
||||
__malloc_size_t size;
|
||||
{
|
||||
__ptr_t hdr;
|
||||
|
||||
if (ptr == mallwatch)
|
||||
tr_break ();
|
||||
|
||||
__libc_lock_lock (lock);
|
||||
|
||||
__free_hook = tr_old_free_hook;
|
||||
__malloc_hook = tr_old_malloc_hook;
|
||||
__realloc_hook = tr_old_realloc_hook;
|
||||
hdr = (__ptr_t) realloc (ptr, size);
|
||||
__free_hook = tr_freehook;
|
||||
__malloc_hook = tr_mallochook;
|
||||
__realloc_hook = tr_reallochook;
|
||||
|
||||
__libc_lock_unlock (lock);
|
||||
|
||||
tr_where ();
|
||||
if (hdr == NULL)
|
||||
/* Failed realloc. */
|
||||
fprintf (mallstream, "! %p %lx\n", ptr, (unsigned long)size);
|
||||
else if (ptr == NULL)
|
||||
fprintf (mallstream, "+ %p %lx\n", hdr, (unsigned long)size);
|
||||
else
|
||||
fprintf (mallstream, "< %p\n> %p %lx\n", ptr, hdr, (unsigned long)size);
|
||||
|
||||
if (hdr == mallwatch)
|
||||
tr_break ();
|
||||
|
||||
return hdr;
|
||||
}
|
||||
|
||||
/* We enable tracing if either the environment variable MALLOC_TRACE
|
||||
is set, or if the variable mallwatch has been patched to an address
|
||||
that the debugging user wants us to stop on. When patching mallwatch,
|
||||
don't forget to set a breakpoint on tr_break! */
|
||||
|
||||
void
|
||||
mtrace ()
|
||||
{
|
||||
char *mallfile;
|
||||
|
||||
/* Don't panic if we're called more than once. */
|
||||
if (mallstream != NULL)
|
||||
return;
|
||||
|
||||
#ifdef _LIBC
|
||||
/* When compiling the GNU libc we use the secure getenv function
|
||||
which prevents the misuse in case of SUID or SGID enabled
|
||||
programs. */
|
||||
mallfile = __secure_getenv (mallenv);
|
||||
#else
|
||||
mallfile = getenv (mallenv);
|
||||
#endif
|
||||
if (mallfile != NULL || mallwatch != NULL)
|
||||
{
|
||||
mallstream = fopen (mallfile != NULL ? mallfile : "/dev/null", "w");
|
||||
if (mallstream != NULL)
|
||||
{
|
||||
/* Be sure it doesn't malloc its buffer! */
|
||||
setbuf (mallstream, mallbuf);
|
||||
fprintf (mallstream, "= Start\n");
|
||||
tr_old_free_hook = __free_hook;
|
||||
__free_hook = tr_freehook;
|
||||
tr_old_malloc_hook = __malloc_hook;
|
||||
__malloc_hook = tr_mallochook;
|
||||
tr_old_realloc_hook = __realloc_hook;
|
||||
__realloc_hook = tr_reallochook;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
muntrace ()
|
||||
{
|
||||
if (mallstream == NULL)
|
||||
return;
|
||||
|
||||
fprintf (mallstream, "= End\n");
|
||||
fclose (mallstream);
|
||||
mallstream = NULL;
|
||||
__free_hook = tr_old_free_hook;
|
||||
__malloc_hook = tr_old_malloc_hook;
|
||||
__realloc_hook = tr_old_realloc_hook;
|
||||
}
|
|
@ -11,7 +11,7 @@ fractional parts. These functions are declared in the header file
|
|||
* Predicates on Floats:: Testing for infinity and for NaNs.
|
||||
* Absolute Value:: Absolute value functions.
|
||||
* Normalization Functions:: Hacks for radix-2 representations.
|
||||
* Rounding and Remainders:: Determinining the integer and
|
||||
* Rounding and Remainders:: Determining the integer and
|
||||
fractional parts of a float.
|
||||
* Integer Division:: Functions for performing integer
|
||||
division.
|
||||
|
@ -495,8 +495,8 @@ to @code{ERANGE} to indicate there was overflow.
|
|||
|
||||
Because the value @code{0l} is a correct result for @code{strtol} the
|
||||
user who is interested in handling errors should set the global variable
|
||||
@code{errno} to @code{0} before calling this function. So it can be
|
||||
tested whether an error occured or not.
|
||||
@code{errno} to @code{0} before calling this function, so that the program
|
||||
can later test whether an error occurred.
|
||||
|
||||
There is an example at the end of this section.
|
||||
@end deftypefun
|
||||
|
@ -699,7 +699,7 @@ call since all failures set @code{errno} to a non-zero value.
|
|||
@deftypefun float strtof (const char *@var{string}, char **@var{tailptr})
|
||||
This function is similar to the @code{strtod} function but it returns a
|
||||
@code{float} value instead of a @code{double} value. If the precision
|
||||
of a @code{float} value is sufficent this function should be used since
|
||||
of a @code{float} value is sufficient this function should be used since
|
||||
it is much faster than @code{strtod} on some architectures. The reasons
|
||||
are obvious: @w{IEEE 754} defines @code{float} to have a mantissa of 23
|
||||
bits while @code{double} has 53 bits and every additional bit of
|
||||
|
@ -718,9 +718,9 @@ This function is a GNU extension.
|
|||
@deftypefun {long double} strtold (const char *@var{string}, char **@var{tailptr})
|
||||
This function is similar to the @code{strtod} function but it returns a
|
||||
@code{long double} value instead of a @code{double} value. It should be
|
||||
used when high presision is used. On systems which define a @code{long
|
||||
used when high precision is needed. On systems which define a @code{long
|
||||
double} type (i.e., on which it is not the same as @code{double})
|
||||
running this function might take significently more time since more bits
|
||||
running this function might take significantly more time since more bits
|
||||
of precision are required.
|
||||
|
||||
If the string has valid syntax for a floating-point number but the value
|
||||
|
|
|
@ -73,13 +73,13 @@ included as well as the @w{ISO C}, POSIX.1, POSIX.2, and X/Open material.
|
|||
@comment (none)
|
||||
@comment XOPEN
|
||||
@defvr Macro _XOPEN_SOURCE
|
||||
If you define these macro, functionality described in the X/Open
|
||||
Portability Guide is included. This is an superset of the POSIX.1 and
|
||||
If you define this macro, functionality described in the X/Open
|
||||
Portability Guide is included. This is a superset of the POSIX.1 and
|
||||
POSIX.2 functionality and in fact @code{_POSIX_SOURCE} and
|
||||
@code{_POSIX_C_SOURCE} get automatically be defined.
|
||||
@code{_POSIX_C_SOURCE} are automatically defined.
|
||||
|
||||
But as the great unifiction of all Unices there is also functionality
|
||||
only available in BSD and SVID is included.
|
||||
As the unification of all Unices, functionality only available in
|
||||
BSD and SVID is also included.
|
||||
|
||||
If the macro @code{_XOPEN_SOURCE_EXTENDED} is also defined, even more
|
||||
functionality is available. The extra functions will make all functions
|
||||
|
|
|
@ -144,7 +144,7 @@ No process matches the specified process ID.
|
|||
@comment POSIX.1: Interrupted system call
|
||||
@deftypevr Macro int EINTR
|
||||
@comment errno 4 @c DO NOT REMOVE
|
||||
Interrupted function call; an asynchronous signal occured and prevented
|
||||
Interrupted function call; an asynchronous signal occurred and prevented
|
||||
completion of the call. When this happens, you should try the call
|
||||
again.
|
||||
|
||||
|
|
|
@ -338,15 +338,15 @@ value. Use @code{readdir_r} when this is critical.
|
|||
@deftypefun int readdir_r (DIR *@var{dirstream}, struct *@var{entry}, struct **@var{result})
|
||||
This function is the reentrant version of @code{reentrant}. Like
|
||||
@code{readdir} it returns the next entry from the directory. But to
|
||||
prevent conflicts for simultanously running threads the result is not
|
||||
prevent conflicts for simultaneously running threads the result is not
|
||||
stored in some internal memory. Instead the argument @var{entry} has to
|
||||
point to a place where the result is stored.
|
||||
|
||||
The return value is @code{0} in case the next entry was read
|
||||
successfully. In this case a pointer to the result is returned in
|
||||
*@var{result}. It is not required that *@var{result} is the same as
|
||||
@var{entry}. If somethings goes wrong while exeucting @code{readdir_r}
|
||||
the function return @code{-1}. The @code{errno} variable is set like
|
||||
@var{entry}. If something goes wrong while executing @code{readdir_r}
|
||||
the function returns @code{-1}. The @code{errno} variable is set like
|
||||
described for @code{readdir}.
|
||||
|
||||
@strong{Portability Note:} On some systems, @code{readdir_r} may not
|
||||
|
|
|
@ -92,7 +92,7 @@ standards each function or symbol comes from.
|
|||
The GNU C library is compatible with the C standard adopted by the
|
||||
American National Standards Institute (ANSI):
|
||||
@cite{American National Standard X3.159-1989---``ANSI C''} and later
|
||||
by the International Standardization Organizaion (ISO):
|
||||
by the International Standardization Organization (ISO):
|
||||
@cite{ISO/IEC 9899:1990, ``Programming languages---C''}.
|
||||
We here refer to the standard as @w{ISO C} since this is the more
|
||||
general standard in respect of ratification.
|
||||
|
|
|
@ -54,7 +54,7 @@ terminate all the processes in the foreground process group.
|
|||
|
||||
@cindex session
|
||||
A @dfn{session} is a larger group of processes. Normally all the
|
||||
proccesses that stem from a single login belong to the same session.
|
||||
processes that stem from a single login belong to the same session.
|
||||
|
||||
Every process belongs to a process group. When a process is created, it
|
||||
becomes a member of the same process group and session as its parent
|
||||
|
@ -154,7 +154,7 @@ calls @code{setsid} to become the leader of a new session.
|
|||
@cindex controlling terminal, access to
|
||||
|
||||
Processes in the foreground job of a controlling terminal have
|
||||
unrestricted access to that terminal; background proesses do not. This
|
||||
unrestricted access to that terminal; background processes do not. This
|
||||
section describes in more detail what happens when a process in a
|
||||
background job tries to access its controlling terminal.
|
||||
|
||||
|
@ -213,7 +213,7 @@ involved.
|
|||
|
||||
@iftex
|
||||
@itemize @bullet
|
||||
@item
|
||||
@item
|
||||
@ref{Data Structures}, introduces the example and presents
|
||||
its primary data structures.
|
||||
|
||||
|
@ -310,7 +310,7 @@ job *
|
|||
find_job (pid_t pgid)
|
||||
@{
|
||||
job *j;
|
||||
|
||||
|
||||
for (j = first_job; j; j = j->next)
|
||||
if (j->pgid == pgid)
|
||||
return j;
|
||||
|
@ -324,7 +324,7 @@ int
|
|||
job_is_stopped (job *j)
|
||||
@{
|
||||
process *p;
|
||||
|
||||
|
||||
for (p = j->first_process; p; p = p->next)
|
||||
if (!p->completed && !p->stopped)
|
||||
return 0;
|
||||
|
@ -338,7 +338,7 @@ int
|
|||
job_is_completed (job *j)
|
||||
@{
|
||||
process *p;
|
||||
|
||||
|
||||
for (p = j->first_process; p; p = p->next)
|
||||
if (!p->completed)
|
||||
return 0;
|
||||
|
@ -355,7 +355,7 @@ job_is_completed (job *j)
|
|||
|
||||
When a shell program that normally performs job control is started, it
|
||||
has to be careful in case it has been invoked from another shell that is
|
||||
already doing its own job control.
|
||||
already doing its own job control.
|
||||
|
||||
A subshell that runs interactively has to ensure that it has been placed
|
||||
in the foreground by its parent shell before it can enable job control
|
||||
|
@ -413,7 +413,7 @@ int shell_is_interactive;
|
|||
void
|
||||
init_shell ()
|
||||
@{
|
||||
|
||||
|
||||
/* @r{See if we are running interactively.} */
|
||||
shell_terminal = STDIN_FILENO;
|
||||
shell_is_interactive = isatty (shell_terminal);
|
||||
|
@ -512,7 +512,7 @@ send a @code{SIGTSTP} signal to the process group of the process, not
|
|||
just to the process itself. @xref{Signaling Another Process}.
|
||||
|
||||
Finally, each child process should call @code{exec} in the normal way.
|
||||
This is also the point at which redirection of the standard input and
|
||||
This is also the point at which redirection of the standard input and
|
||||
output channels should be handled. @xref{Duplicating Descriptors},
|
||||
for an explanation of how to do this.
|
||||
|
||||
|
@ -564,9 +564,9 @@ launch_process (process *p, pid_t pgid,
|
|||
@{
|
||||
dup2 (errfile, STDERR_FILENO);
|
||||
close (errfile);
|
||||
@}
|
||||
|
||||
/* @r{Exec the new process. Make sure we exit.} */
|
||||
@}
|
||||
|
||||
/* @r{Exec the new process. Make sure we exit.} */
|
||||
execvp (p->argv[0], p->argv);
|
||||
perror ("execvp");
|
||||
exit (1);
|
||||
|
@ -590,7 +590,7 @@ launch_job (job *j, int foreground)
|
|||
process *p;
|
||||
pid_t pid;
|
||||
int mypipe[2], infile, outfile;
|
||||
|
||||
|
||||
infile = j->stdin;
|
||||
for (p = j->first_process; p; p = p->next)
|
||||
@{
|
||||
|
@ -638,7 +638,7 @@ launch_job (job *j, int foreground)
|
|||
close (outfile);
|
||||
infile = mypipe[0];
|
||||
@}
|
||||
|
||||
|
||||
format_job_info (j, "launched");
|
||||
|
||||
if (!shell_is_interactive)
|
||||
|
@ -704,13 +704,13 @@ put_job_in_foreground (job *j, int cont)
|
|||
perror ("kill (SIGCONT)");
|
||||
@}
|
||||
@end group
|
||||
|
||||
|
||||
/* @r{Wait for it to report.} */
|
||||
wait_for_job (j);
|
||||
|
||||
|
||||
/* @r{Put the shell back in the foreground.} */
|
||||
tcsetpgrp (shell_terminal, shell_pgid);
|
||||
|
||||
|
||||
@group
|
||||
/* @r{Restore the shell's terminal modes.} */
|
||||
tcgetattr (shell_terminal, &j->tmodes);
|
||||
|
@ -722,7 +722,7 @@ put_job_in_foreground (job *j, int cont)
|
|||
@cindex background job, launching
|
||||
If the process group is launched as a background job, the shell should
|
||||
remain in the foreground itself and continue to read commands from
|
||||
the terminal.
|
||||
the terminal.
|
||||
|
||||
In the sample shell, there is not much that needs to be done to put
|
||||
a job into the background. Here is the function it uses:
|
||||
|
@ -833,7 +833,7 @@ update_status (void)
|
|||
@{
|
||||
int status;
|
||||
pid_t pid;
|
||||
|
||||
|
||||
do
|
||||
pid = waitpid (WAIT_ANY, &status, WUNTRACED|WNOHANG);
|
||||
while (!mark_process_status (pid, status));
|
||||
|
@ -849,11 +849,11 @@ wait_for_job (job *j)
|
|||
@{
|
||||
int status;
|
||||
pid_t pid;
|
||||
|
||||
|
||||
do
|
||||
pid = waitpid (WAIT_ANY, &status, WUNTRACED);
|
||||
while (!mark_process_status (pid, status)
|
||||
&& !job_is_stopped (j)
|
||||
while (!mark_process_status (pid, status)
|
||||
&& !job_is_stopped (j)
|
||||
&& !job_is_completed (j));
|
||||
@}
|
||||
@end group
|
||||
|
@ -880,7 +880,7 @@ do_job_notification (void)
|
|||
|
||||
/* @r{Update status information for child processes.} */
|
||||
update_status ();
|
||||
|
||||
|
||||
jlast = NULL;
|
||||
for (j = first_job; j; j = jnext)
|
||||
@{
|
||||
|
@ -976,7 +976,7 @@ allocated and initialized.
|
|||
Most real shells provide a complex user interface that has support for
|
||||
a command language; variables; abbreviations, substitutions, and pattern
|
||||
matching on file names; and the like. All of this is far too complicated
|
||||
to explain here! Instead, we have concentrated on showing how to
|
||||
to explain here! Instead, we have concentrated on showing how to
|
||||
implement the core process creation and job control functions that can
|
||||
be called from such a shell.
|
||||
|
||||
|
@ -1058,7 +1058,7 @@ represents the size of a string large enough to hold the file name
|
|||
returned by @code{ctermid}.
|
||||
@end deftypevr
|
||||
|
||||
See also the @code{isatty} and @code{ttyname} functions, in
|
||||
See also the @code{isatty} and @code{ttyname} functions, in
|
||||
@ref{Is It a Terminal}.
|
||||
|
||||
|
||||
|
|
|
@ -616,7 +616,7 @@ Pseudo-Random Numbers
|
|||
Low-Level Arithmetic Functions
|
||||
|
||||
* Normalization Functions:: Hacks for radix-2 representations.
|
||||
* Rounding and Remainders:: Determinining the integer and
|
||||
* Rounding and Remainders:: Determining the integer and
|
||||
fractional parts of a float.
|
||||
* Integer Division:: Functions for performing integer division.
|
||||
* Parsing of Numbers:: Functions for ``reading'' numbers from strings.
|
||||
|
|
|
@ -505,7 +505,7 @@ precede the amount.
|
|||
|
||||
We can only guess which of these (if either) matches the usual
|
||||
conventions for printing international currency symbols. Our guess is
|
||||
that they should always preceed the amount. If we find out a reliable
|
||||
that they should always precede the amount. If we find out a reliable
|
||||
answer, we will put it here.
|
||||
|
||||
@item char p_sep_by_space
|
||||
|
|
|
@ -165,7 +165,7 @@ either positive or negative @code{HUGE_VAL}.
|
|||
|
||||
@node Inverse Trig Functions
|
||||
@section Inverse Trigonometric Functions
|
||||
@cindex inverse trigonmetric functions
|
||||
@cindex inverse trigonometric functions
|
||||
|
||||
These are the usual arc sine, arc cosine and arc tangent functions,
|
||||
which are the inverses of the sine, cosine and tangent functions,
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
@cindex Name Service Switch
|
||||
@cindex NSS
|
||||
@cindex databses
|
||||
@cindex databases
|
||||
Various functions in the C Library need to be configured to work
|
||||
correctly in the local environment. Traditionally, this was done by
|
||||
using files (e.g., @file{/etc/passwd}), but other nameservices (line the
|
||||
|
@ -128,7 +128,7 @@ the reaction on lookup result line @code{[NOTFOUND=return]}.
|
|||
|
||||
@menu
|
||||
* Services in the NSS configuration:: Service names in the NSS configuration.
|
||||
* Actions in the NSS configuration:: React approprite on the lookup result.
|
||||
* Actions in the NSS configuration:: React appropriately to the lookup result.
|
||||
* Notes on NSS Configuration File:: Things to take care about while
|
||||
configuring NSS.
|
||||
@end menu
|
||||
|
@ -181,7 +181,7 @@ service. They mean
|
|||
|
||||
@ftable @samp
|
||||
@item success
|
||||
No error occured an the wanted entry is returned. The default action
|
||||
No error occurred and the wanted entry is returned. The default action
|
||||
for this is @code{return}.
|
||||
|
||||
@item notfound
|
||||
|
|
|
@ -178,7 +178,7 @@ To return this vector, @code{glob} stores both its address and its
|
|||
length (number of elements, not counting the terminating null pointer)
|
||||
into @code{*@var{vector-ptr}}.
|
||||
|
||||
Normally, @code{glob} sorts the file names alphabetically before
|
||||
Normally, @code{glob} sorts the file names alphabetically before
|
||||
returning them. You can turn this off with the flag @code{GLOB_NOSORT}
|
||||
if you want to get the information as fast as possible. Usually it's
|
||||
a good idea to let @code{glob} sort them---if you process the files in
|
||||
|
@ -224,7 +224,7 @@ In the event of an error, @code{glob} stores information in
|
|||
@node Flags for Globbing
|
||||
@subsection Flags for Globbing
|
||||
|
||||
This section describes the flags that you can specify in the
|
||||
This section describes the flags that you can specify in the
|
||||
@var{flags} argument to @code{glob}. Choose the flags you want,
|
||||
and combine them with the C bitwise OR operator @code{|}.
|
||||
|
||||
|
@ -483,7 +483,7 @@ One of the endpoints in a range expression was invalid.
|
|||
|
||||
These are the bit flags that you can use in the @var{cflags} operand when
|
||||
compiling a regular expression with @code{regcomp}.
|
||||
|
||||
|
||||
@table @code
|
||||
@comment regex.h
|
||||
@comment POSIX.2
|
||||
|
@ -530,7 +530,7 @@ This function tries to match the compiled regular expression
|
|||
@code{regexec} returns @code{0} if the regular expression matches;
|
||||
otherwise, it returns a nonzero value. See the table below for
|
||||
what nonzero values mean. You can use @code{regerror} to produce an
|
||||
error message string describing the reason for a nonzero value;
|
||||
error message string describing the reason for a nonzero value;
|
||||
see @ref{Regexp Cleanup}.
|
||||
|
||||
The argument @var{eflags} is a word of bit flags that enable various
|
||||
|
@ -538,7 +538,7 @@ options.
|
|||
|
||||
If you want to get information about what part of @var{string} actually
|
||||
matched the regular expression or its subexpressions, use the arguments
|
||||
@var{matchptr} and @var{nmatch}. Otherwise, pass @code{0} for
|
||||
@var{matchptr} and @var{nmatch}. Otherwise, pass @code{0} for
|
||||
@var{nmatch}, and @code{NULL} for @var{matchptr}. @xref{Regexp
|
||||
Subexpressions}.
|
||||
@end deftypefun
|
||||
|
@ -549,7 +549,7 @@ locales that were in effect when you compiled the regular expression.
|
|||
The function @code{regexec} accepts the following flags in the
|
||||
@var{eflags} argument:
|
||||
|
||||
@table @code
|
||||
@table @code
|
||||
@comment regex.h
|
||||
@comment POSIX.2
|
||||
@item REG_NOTBOL
|
||||
|
@ -594,7 +594,7 @@ subexpression.
|
|||
@comment POSIX.2
|
||||
@deftp {Data Type} regmatch_t
|
||||
This is the data type of the @var{matcharray} array that you pass to
|
||||
@code{regexec}. It containes two structure fields, as follows:
|
||||
@code{regexec}. It contains two structure fields, as follows:
|
||||
|
||||
@table @code
|
||||
@item rm_so
|
||||
|
@ -661,7 +661,7 @@ appears within another, then the results reported for the inner
|
|||
subexpression reflect whatever happened on the last match of the outer
|
||||
subexpression. For an example, consider @samp{\(ba\(na\)*s \)*} matching
|
||||
the string @samp{bananas bas }. The last time the inner expression
|
||||
actually matches is near the end of the first word. But it is
|
||||
actually matches is near the end of the first word. But it is
|
||||
@emph{considered} again in the second word, and fails to match there.
|
||||
@code{regexec} reports nonuse of the ``na'' subexpression.
|
||||
|
||||
|
@ -738,7 +738,7 @@ char *get_regerror (int errcode, regex_t *compiled)
|
|||
@cindex word expansion
|
||||
@cindex expansion of shell words
|
||||
|
||||
@dfn{Word expansion} means the process of splitting a string into
|
||||
@dfn{Word expansion} means the process of splitting a string into
|
||||
@dfn{words} and substituting for variables, commands, and wildcards
|
||||
just as the shell does.
|
||||
|
||||
|
@ -936,7 +936,7 @@ data it points to.
|
|||
@node Flags for Wordexp
|
||||
@subsection Flags for Word Expansion
|
||||
|
||||
This section describes the flags that you can specify in the
|
||||
This section describes the flags that you can specify in the
|
||||
@var{flags} argument to @code{wordexp}. Choose the flags you want,
|
||||
and combine them with the C operator @code{|}.
|
||||
|
||||
|
@ -1139,7 +1139,7 @@ characters in the value of @var{variable}. @samp{$@{#foo@}} stands for
|
|||
@end table
|
||||
|
||||
These variants of variable substitution let you remove part of the
|
||||
variable's value before substituting it. The @var{prefix} and
|
||||
variable's value before substituting it. The @var{prefix} and
|
||||
@var{suffix} are not mere strings; they are wildcard patterns, just
|
||||
like the patterns that you use to match multiple file names. But
|
||||
in this context, they match against parts of the variable value
|
||||
|
|
|
@ -135,7 +135,7 @@ process that receives them. These signals arrive at unpredictable times
|
|||
during execution. External events generate signals asynchronously, and
|
||||
so do explicit requests that apply to some other process.
|
||||
|
||||
A given type of signal is either typically synchrous or typically
|
||||
A given type of signal is either typically synchronous or typically
|
||||
asynchronous. For example, signals for errors are typically synchronous
|
||||
because errors generate signals synchronously. But any type of signal
|
||||
can be generated synchronously or asynchronously with an explicit
|
||||
|
@ -608,7 +608,7 @@ code profiling facilities, hence the name of this signal.
|
|||
|
||||
The signals listed in this section are used in conjunction with
|
||||
asynchronous I/O facilities. You have to take explicit action by
|
||||
calling @code{fcntl} to enable a particular file descriptior to generate
|
||||
calling @code{fcntl} to enable a particular file descriptor to generate
|
||||
these signals (@pxref{Interrupt Input}). The default action for these
|
||||
signals is to ignore them.
|
||||
|
||||
|
@ -2310,7 +2310,7 @@ signals to any random process. These are intended to prevent antisocial
|
|||
behavior such as arbitrarily killing off processes belonging to another
|
||||
user. In typical use, @code{kill} is used to pass signals between
|
||||
parent, child, and sibling processes, and in these situations you
|
||||
normally do have permission to send signals. The only common execption
|
||||
normally do have permission to send signals. The only common exception
|
||||
is when you run a setuid program in a child process; if the program
|
||||
changes its real UID as well as its effective UID, you may not have
|
||||
permission to send a signal. The @code{su} program does this.
|
||||
|
@ -2692,7 +2692,7 @@ install_handler (void)
|
|||
@end smallexample
|
||||
|
||||
This is more reliable than blocking the other signals explicitly in the
|
||||
code for the handler. If you block signals explicity in the handler,
|
||||
code for the handler. If you block signals explicitly in the handler,
|
||||
you can't avoid at least a short interval at the beginning of the
|
||||
handler where they are not yet blocked.
|
||||
|
||||
|
@ -2837,7 +2837,7 @@ these things in the other order, like this,
|
|||
|
||||
@noindent
|
||||
then a signal arriving in between the @code{if} statement and the decrement
|
||||
would be effetively ``lost'' for an indefinite amount of time. The
|
||||
would be effectively ``lost'' for an indefinite amount of time. The
|
||||
handler would merely set @code{defer_signal}, but the program having
|
||||
already tested this variable, it would not test the variable again.
|
||||
|
||||
|
@ -3081,7 +3081,7 @@ For most cases, just using @code{SIGSTKSZ} for @code{ss_size} is
|
|||
sufficient. But if you know how much stack space your program's signal
|
||||
handlers will need, you may want to use a different size. In this case,
|
||||
you should allocate @code{MINSIGSTKSZ} additional bytes for the signal
|
||||
stack and increase @code{ss_size} accordinly.
|
||||
stack and increase @code{ss_size} accordingly.
|
||||
@end vtable
|
||||
|
||||
@item int ss_flags
|
||||
|
|
|
@ -236,7 +236,7 @@ must compare the external variable @code{optind} against the @var{argc}
|
|||
parameter to check this.
|
||||
|
||||
If the option has an argument, @code{getopt} returns the argument by
|
||||
storing it in the varables @var{optarg}. You don't ordinarily need to
|
||||
storing it in the variable @var{optarg}. You don't ordinarily need to
|
||||
copy the @code{optarg} string, since it is a pointer into the original
|
||||
@var{argv} array, not into a static area that might be overwritten.
|
||||
|
||||
|
|
|
@ -62,7 +62,7 @@ input/output library functions. Don't try to create your own objects of
|
|||
type @code{FILE}; let the library do it. Your programs should
|
||||
deal only with pointers to these objects (that is, @code{FILE *} values)
|
||||
rather than the objects themselves.
|
||||
@c !!! should say that FILE's have "No user-servicable parts inside."
|
||||
@c !!! should say that FILE's have "No user-serviceable parts inside."
|
||||
|
||||
@node Standard Streams
|
||||
@section Standard Streams
|
||||
|
@ -1800,7 +1800,7 @@ a base type of @code{PA_DOUBLE} to indicate a type of @code{long double}.
|
|||
@end table
|
||||
|
||||
@ifinfo
|
||||
For an example of using these facilitles, see @ref{Example of Parsing}.
|
||||
For an example of using these facilities, see @ref{Example of Parsing}.
|
||||
@end ifinfo
|
||||
|
||||
@node Example of Parsing
|
||||
|
|
|
@ -18,9 +18,9 @@ descriptor is and how to open a file descriptor for a terminal device.
|
|||
* Canonical or Not:: Two basic styles of input processing.
|
||||
* Terminal Modes:: How to examine and modify flags controlling
|
||||
details of terminal I/O: echoing,
|
||||
signals, editing.
|
||||
signals, editing.
|
||||
* Line Control:: Sending break sequences, clearing
|
||||
terminal buffers @dots{}
|
||||
terminal buffers @dots{}
|
||||
* Noncanon Example:: How to read single characters without echo.
|
||||
@end menu
|
||||
|
||||
|
@ -149,9 +149,9 @@ constants are all declared in the header file @file{termios.h}.
|
|||
|
||||
@menu
|
||||
* Mode Data Types:: The data type @code{struct termios} and
|
||||
related types.
|
||||
related types.
|
||||
* Mode Functions:: Functions to read and set the terminal
|
||||
attributes.
|
||||
attributes.
|
||||
* Setting Modes:: The right way to set terminal attributes
|
||||
reliably.
|
||||
* Input Modes:: Flags controlling low-level input handling.
|
||||
|
@ -486,7 +486,7 @@ signal for the foreground process group associated with the terminal.
|
|||
|
||||
If neither @code{BRKINT} nor @code{IGNBRK} are set, a break condition is
|
||||
passed to the application as a single @code{'\0'} character if
|
||||
@code{PARMRK} is not set, or otherwise as a three-character sequence
|
||||
@code{PARMRK} is not set, or otherwise as a three-character sequence
|
||||
@code{'\377'}, @code{'\0'}, @code{'\0'}.
|
||||
@end deftypevr
|
||||
|
||||
|
@ -906,7 +906,7 @@ attempt to write to the terminal. @xref{Access to the Terminal}.
|
|||
|
||||
The following bits are BSD extensions; they exist only in BSD systems
|
||||
and the GNU system.
|
||||
|
||||
|
||||
@comment termios.h
|
||||
@comment BSD
|
||||
@deftypevr Macro tcflag_t ALTWERASE
|
||||
|
@ -1431,7 +1431,7 @@ itself.
|
|||
The LNEXT character is recognized only when @code{IEXTEN} is set, but in
|
||||
both canonical and noncanonical mode. It disables any special
|
||||
significance of the next character the user types. Even if the
|
||||
character would normally perform some editting function or generate a
|
||||
character would normally perform some editing function or generate a
|
||||
signal, it is read as a plain character. This is the analogue of the
|
||||
@kbd{C-q} command in Emacs. ``LNEXT'' stands for ``literal next.''
|
||||
|
||||
|
@ -1532,7 +1532,7 @@ TIME elapses with no further input.
|
|||
TIME elapses first. @code{read} can return more than MIN characters if
|
||||
more than MIN happen to be in the queue.
|
||||
|
||||
@item
|
||||
@item
|
||||
Both MIN and TIME are zero.
|
||||
|
||||
In this case, @code{read} always returns immediately with as many
|
||||
|
|
|
@ -877,7 +877,7 @@ password database file.
|
|||
|
||||
If the function returns null @var{result} points to the structure with
|
||||
the wanted data (normally this is in @var{result_buf}). If errors
|
||||
occured the return value is non-null and @var{result} contains a null
|
||||
occurred the return value is non-null and @var{result} contains a null
|
||||
pointer.
|
||||
@end deftypefun
|
||||
|
||||
|
@ -916,7 +916,7 @@ buffer or length @var{buflen} starting at @var{buffer}.
|
|||
|
||||
If the function returns zero @var{result} points to the structure with
|
||||
the wanted data (normally this is in @var{result_buf}). If errors
|
||||
occured the return value is non-zero and @var{result} contains a null
|
||||
occurred the return value is non-zero and @var{result} contains a null
|
||||
pointer.
|
||||
@end deftypefun
|
||||
|
||||
|
@ -1100,7 +1100,7 @@ group database file.
|
|||
|
||||
If the function returns zero @var{result} points to the structure with
|
||||
the wanted data (normally this is in @var{result_buf}). If errors
|
||||
occured the return value is non-zero and @var{result} contains a null
|
||||
occurred the return value is non-zero and @var{result} contains a null
|
||||
pointer.
|
||||
@end deftypefun
|
||||
|
||||
|
@ -1137,7 +1137,7 @@ buffer or length @var{buflen} starting at @var{buffer}.
|
|||
|
||||
If the function returns zero @var{result} points to the structure with
|
||||
the wanted data (normally this is in @var{result_buf}). If errors
|
||||
occured the return value is non-zero and @var{result} contains a null
|
||||
occurred the return value is non-zero and @var{result} contains a null
|
||||
pointer.
|
||||
@end deftypefun
|
||||
|
||||
|
@ -1173,7 +1173,7 @@ them individual names. More concrete: a netgroup is a list of triples
|
|||
consisting of a host name, a user name, and a domain name, where any of
|
||||
the entries can be a wildcard entry, matching all inputs. A last
|
||||
possibility is that names of other netgroups can also be given in the
|
||||
list specifying a netgroup. So one can construct arbitrary hierachies
|
||||
list specifying a netgroup. So one can construct arbitrary hierarchies
|
||||
without loops.
|
||||
|
||||
Sun's implementation allows netgroups only for the @code{nis} or
|
||||
|
@ -1208,7 +1208,7 @@ in the netgroup with name @var{netgroup}.
|
|||
|
||||
When the call is successful (i.e., when a netgroup with this name exist)
|
||||
the return value is @code{1}. When the return value is @code{0} no
|
||||
netgroup of this name is known or some other error occured.
|
||||
netgroup of this name is known or some other error occurred.
|
||||
@end deftypefun
|
||||
|
||||
It is important to remember that there is only one single state for
|
||||
|
@ -1235,7 +1235,7 @@ The returned string pointers are only valid unless no of the netgroup
|
|||
related functions are called.
|
||||
|
||||
The return value is @code{1} if the next entry was successfully read. A
|
||||
value of @code{0} means no further entry exist or internal errors occured.
|
||||
value of @code{0} means no further entries exist or internal errors occurred.
|
||||
@end deftypefun
|
||||
|
||||
@comment netdb.h
|
||||
|
@ -1249,7 +1249,7 @@ even after other netgroup related functions are called.
|
|||
The return value is @code{1} if the next entry was successfully read and
|
||||
the buffer contains enough room to place the strings in it. @code{0} is
|
||||
returned in case no more entries are found, the buffer is too small, or
|
||||
internal errors occured.
|
||||
internal errors occurred.
|
||||
|
||||
This function is a GNU extension. The original implementation in the
|
||||
SunOS libc does not provide this function.
|
||||
|
@ -1292,7 +1292,7 @@ otherwise.
|
|||
The return value is @code{1} if an entry matching the given triple is
|
||||
found in the netgroup. The return value is @code{0} if the netgroup
|
||||
itself is not found, the netgroup does not contain the triple or
|
||||
internal errors occured.
|
||||
internal errors occurred.
|
||||
@end deftypefun
|
||||
|
||||
@node Database Example, , Netgroup Database, Users and Groups
|
||||
|
|
|
@ -28,9 +28,6 @@
|
|||
|
||||
__BEGIN_DECLS
|
||||
|
||||
#define __need_Emath
|
||||
#include <errno.h>
|
||||
|
||||
/* Get machine-dependent HUGE_VAL value (returned on overflow).
|
||||
On all IEEE754 machines, this is +Infinity. */
|
||||
#include <huge_val.h>
|
||||
|
|
|
@ -84,7 +84,7 @@ __MATHCALL (atanh,, (_Mdouble_ __x));
|
|||
|
||||
/* Exponential and logarithmic functions. */
|
||||
|
||||
/* Exponentional function of X. */
|
||||
/* Exponential function of X. */
|
||||
__MATHCALL (exp,, (_Mdouble_ __x));
|
||||
|
||||
/* Break VALUE into a normalized fraction and an integral power of 2. */
|
||||
|
|
|
@ -1,26 +1,26 @@
|
|||
/* Copyright (C) 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
/* Copyright (C) 1992,1993,1994,1995,1996 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with the GNU C Library; see the file COPYING.LIB. If
|
||||
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
|
||||
Cambridge, MA 02139, USA. */
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with the GNU C Library; see the file COPYING.LIB. If not,
|
||||
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <termios.h>
|
||||
#include <unistd.h>
|
||||
|
||||
/* It is desireable to use this bit on systems that have it.
|
||||
/* It is desirable to use this bit on systems that have it.
|
||||
The only bit of terminal state we want to twiddle is echoing, which is
|
||||
done in software; there is no need to change the state of the terminal
|
||||
hardware. */
|
||||
|
|
|
@ -118,7 +118,7 @@ hdestroy_r (htab)
|
|||
}
|
||||
|
||||
|
||||
/* This is the search function. It uses double hashing with open adressing.
|
||||
/* This is the search function. It uses double hashing with open addressing.
|
||||
The argument item.key has to be a pointer to an zero terminated, most
|
||||
probably strings of chars. The function for generating a number of the
|
||||
strings is simple but fast. It can be replaced by a more complex function
|
||||
|
|
|
@ -93,7 +93,7 @@ extern void hdestroy_r __P ((struct hsearch_data *htab));
|
|||
|
||||
|
||||
/* The tsearch routines are very interesting. They make many
|
||||
assumptions about the compiler. It assumpts that the first field
|
||||
assumptions about the compiler. It assumes that the first field
|
||||
in node must be the "key" field, which points to the datum.
|
||||
Everything depends on that. */
|
||||
/* For tsearch */
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue