summary refs log tree commit diff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1999-07-30 06:32:48 +0000
committerUlrich Drepper <drepper@redhat.com>1999-07-30 06:32:48 +0000
commit66f8fa9bec0c6f0e62ccaad22f8ddd36267a5284 (patch)
tree46f44a7aa841d5385c7104b4261610ddc28086e5
parent53308042259bb73ce10aada138dc6bd26dd9a9c2 (diff)
downloadglibc-66f8fa9bec0c6f0e62ccaad22f8ddd36267a5284.tar.gz
glibc-66f8fa9bec0c6f0e62ccaad22f8ddd36267a5284.tar.xz
glibc-66f8fa9bec0c6f0e62ccaad22f8ddd36267a5284.zip
Update.
	* malloc/malloc.c (ptmalloc_init): Also initialize __libc_pagesize
	if no threads are used.

	* libio/iofwrite.c: Add weak alias for _unlocked function if not
	_IO_MTSAFE_IO.
	* libio/iofread.c: Likewise.
	* libio/iofgets.c: Likewise.
	* libio/iofputs.c: Likewise.

	* sysdeps/generic/bits/libc-lock.h (__libc_cleanup_end): New
	definition.
-rw-r--r--ChangeLog12
-rw-r--r--bits/libc-lock.h5
-rw-r--r--libio/iofgets.c6
-rw-r--r--libio/iofputs.c4
-rw-r--r--libio/iofread.c6
-rw-r--r--libio/iofwrite.c4
-rw-r--r--malloc/malloc.c4
-rw-r--r--manual/startup.texi18
-rw-r--r--sysdeps/generic/bits/libc-lock.h5
9 files changed, 54 insertions, 10 deletions
diff --git a/ChangeLog b/ChangeLog
index 23923c5c84..4437c3b67b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,17 @@
 1999-07-29  H.J. Lu  <hjl@gnu.org>
 
+	* malloc/malloc.c (ptmalloc_init): Also initialize __libc_pagesize
+	if no threads are used.
+
+	* libio/iofwrite.c: Add weak alias for _unlocked function if not
+	_IO_MTSAFE_IO.
+	* libio/iofread.c: Likewise.
+	* libio/iofgets.c: Likewise.
+	* libio/iofputs.c: Likewise.
+
+	* sysdeps/generic/bits/libc-lock.h (__libc_cleanup_end): New
+	definition.
+
 	* stdlib/mbtowc.c: Include <string.h>.
 	* stdlib/wctomb.c: Likewise.
 	* sysdeps/unix/sysv/linux/fstatfs64.c: Likewise.
diff --git a/bits/libc-lock.h b/bits/libc-lock.h
index c24dcd047a..84f9cd4653 100644
--- a/bits/libc-lock.h
+++ b/bits/libc-lock.h
@@ -1,5 +1,5 @@
 /* libc-internal interface for mutex locks.  Stub version.
-   Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+   Copyright (C) 1996, 1997, 1999 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
@@ -90,6 +90,9 @@
 /* End critical region with cleanup.  */
 #define __libc_cleanup_region_end(DOIT)
 
+/* Sometimes we have to exit the block in the middle.  */
+#define __libc_cleanup_end(DOIT)
+
 
 /* We need portable names for some of the functions.  */
 #define __libc_mutex_unlock
diff --git a/libio/iofgets.c b/libio/iofgets.c
index 98e82782ce..63221dfbd7 100644
--- a/libio/iofgets.c
+++ b/libio/iofgets.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
+/* Copyright (C) 1993, 95, 96, 97, 98, 99 Free Software Foundation, Inc.
    This file is part of the GNU IO Library.
 
    This library is free software; you can redistribute it and/or
@@ -64,4 +64,8 @@ _IO_fgets (buf, n, fp)
 
 #ifdef weak_alias
 weak_alias (_IO_fgets, fgets)
+
+# ifndef _IO_MTSAFE_IO
+weak_alias (_IO_fgets, fgets_unlocked)
+# endif
 #endif
diff --git a/libio/iofputs.c b/libio/iofputs.c
index ed41d5a49c..32acf987a5 100644
--- a/libio/iofputs.c
+++ b/libio/iofputs.c
@@ -46,4 +46,8 @@ _IO_fputs (str, fp)
 
 #ifdef weak_alias
 weak_alias (_IO_fputs, fputs)
+
+# ifndef _IO_MTSAFE_IO
+weak_alias (_IO_fputs, fputs_unlocked)
+# endif
 #endif
diff --git a/libio/iofread.c b/libio/iofread.c
index c2d12d8693..a6bda98162 100644
--- a/libio/iofread.c
+++ b/libio/iofread.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993, 1995, 1997, 1998 Free Software Foundation, Inc.
+/* Copyright (C) 1993, 1995, 1997, 1998, 1999 Free Software Foundation, Inc.
    This file is part of the GNU IO Library.
 
    This library is free software; you can redistribute it and/or
@@ -47,4 +47,8 @@ _IO_fread (buf, size, count, fp)
 
 #ifdef weak_alias
 weak_alias (_IO_fread, fread)
+
+# ifndef _IO_MTSAFE_IO
+weak_alias (_IO_fread, fread_unlocked)
+# endif
 #endif
diff --git a/libio/iofwrite.c b/libio/iofwrite.c
index 886de7ae35..9be18bd8e0 100644
--- a/libio/iofwrite.c
+++ b/libio/iofwrite.c
@@ -53,4 +53,8 @@ _IO_fwrite (buf, size, count, fp)
 
 #ifdef weak_alias
 weak_alias (_IO_fwrite, fwrite)
+
+# ifndef _IO_MTSAFE_IO
+weak_alias (_IO_fwrite, fwrite_unlocked)
+# endif
 #endif
diff --git a/malloc/malloc.c b/malloc/malloc.c
index a2b80a9997..db12226828 100644
--- a/malloc/malloc.c
+++ b/malloc/malloc.c
@@ -1663,7 +1663,6 @@ ptmalloc_init __MALLOC_P((void))
   /* Initialize the pthreads interface. */
   if (__pthread_initialize != NULL)
     __pthread_initialize();
-  __libc_pagesize = __getpagesize();
 #endif
   mutex_init(&main_arena.mutex);
   mutex_init(&list_lock);
@@ -1671,6 +1670,9 @@ ptmalloc_init __MALLOC_P((void))
   tsd_setspecific(arena_key, (Void_t *)&main_arena);
   thread_atfork(ptmalloc_lock_all, ptmalloc_unlock_all, ptmalloc_init_all);
 #endif /* !defined NO_THREADS */
+#ifdef _LIBC
+  __libc_pagesize = __getpagesize();
+#endif
 #if defined _LIBC || defined MALLOC_HOOKS
   if((s = getenv("MALLOC_TRIM_THRESHOLD_")))
     mALLOPt(M_TRIM_THRESHOLD, atoi(s));
diff --git a/manual/startup.texi b/manual/startup.texi
index 1c75d3cabd..c8a525903b 100644
--- a/manual/startup.texi
+++ b/manual/startup.texi
@@ -317,6 +317,13 @@ definition is added to the environment.  Otherwise, the @var{string} is
 interpreted as the name of an environment variable, and any definition
 for this variable in the environment is removed.
 
+The difference to the @code{setenv} function is that the exact string
+given as the parameter @var{string} is put into the environment.  If the
+user should change the string after the @code{putenv} call this will
+reflect in automatically in the environment.  This also requires that
+@var{string} is no automatic variable which scope is left before the
+variable is removed from the environment.
+
 This function is part of the extended Unix interface.  Since it was also
 available in old SVID libraries you should define either
 @var{_XOPEN_SOURCE} or @var{_SVID_SOURCE} before including any header.
@@ -329,11 +336,12 @@ available in old SVID libraries you should define either
 The @code{setenv} function can be used to add a new definition to the
 environment.  The entry with the name @var{name} is replaced by the
 value @samp{@var{name}=@var{value}}.  Please note that this is also true
-if @var{value} is the empty string.  A null pointer for the @var{value}
-parameter is illegal.  If the environment already contains an entry with
-key @var{name} the @var{replace} parameter controls the action.  If
-replace is zero, nothing happens.  otherwise the old entry is replaced
-by the new one.
+if @var{value} is the empty string.  To do this a new string is created
+and the strings @var{name} and @var{value} are copied.  A null pointer
+for the @var{value} parameter is illegal.  If the environment already
+contains an entry with key @var{name} the @var{replace} parameter
+controls the action.  If replace is zero, nothing happens.  Otherwise
+the old entry is replaced by the new one.
 
 Please note that you cannot remove an entry completely using this function.
 
diff --git a/sysdeps/generic/bits/libc-lock.h b/sysdeps/generic/bits/libc-lock.h
index c24dcd047a..84f9cd4653 100644
--- a/sysdeps/generic/bits/libc-lock.h
+++ b/sysdeps/generic/bits/libc-lock.h
@@ -1,5 +1,5 @@
 /* libc-internal interface for mutex locks.  Stub version.
-   Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+   Copyright (C) 1996, 1997, 1999 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
@@ -90,6 +90,9 @@
 /* End critical region with cleanup.  */
 #define __libc_cleanup_region_end(DOIT)
 
+/* Sometimes we have to exit the block in the middle.  */
+#define __libc_cleanup_end(DOIT)
+
 
 /* We need portable names for some of the functions.  */
 #define __libc_mutex_unlock