+Sat Sep 7 14:00:33 1996 David Mosberger-Tang <davidm@azstarnet.com>
+
+ * catgets/catgets.c (catopen): Allocate sizeof(*result) bytes
+ instead of sizeof(nl_catd) (which is just a pointer!).
+
+Sat Sep 7 19:39:19 1996 Ulrich Drepper <drepper@cygnus.com>
+
+ * Makefile ($(objpfx)version-info.h): Generate from Banner files.
+ * version.c (banner): Add contents of version-info.h to string.
+
+ * Makerules: If $($(subdir)-version) is available name versioned
+ shared library according to this value instead of glibc's version.
+
+ * libio/Banner: New file.
+
+ * elf/eval.c (funcall): Write error message in case function is
+ not found.
+ (eval): Recognize `_' in names.
+
Sat Sep 7 05:15:45 1996 Ulrich Drepper <drepper@cygnus.com>
* libio/iofdopen: Initialize _lock field only if _IO_MTSAFE_IO.
echo endef) > $@-tmp
mv -f $@-tmp $@
\f
+$(objpfx)version-info.h: $(..)Makefile $(+sysdir_pfx)config.make
+ (first=yes; \
+ for dir in $(subdirs); do \
+ if [ -r $$dir/Banner ]; then \
+ if [ $$first = yes ]; then \
+ echo "\"Available extensions:"; \
+ first=no; \
+ fi; \
+ sed -e '/^#/d' -e 's/^[[:space:]]*/ /' $$dir/Banner; \
+ fi; \
+ done; \
+ [ $first = yes ] || echo "\"") > $@-tmp
+ mv -f $@-tmp $@
+
+version.c-objects := $(addprefix $(objpfx)version,$(object-suffixes))
+$(version.c-objects): $(objpfx)version-info.h
+\f
# Makerules creates a file `stub-$(subdir)' for each subdirectory, which
# contains `#define __stub_FUNCTION' for each function which is a stub.
# Here we paste all of these together into <stubs.h>.
include $(o-iterator)
+ifeq (,$($(subdir)-version))
define o-iterator-doit
$(libdir)/$o$($o-version): $(libdir)/$(o:.so=)-$(version).so; $$(make-link)
endef
endef
object-suffixes-left := $(versioned)
include $(o-iterator)
+else
+define o-iterator-doit
+$(libdir)/$o$($o-version): $(libdir)/$(o:.so=)-$($(subdir)-version).so;
+ $$(make-link)
+endef
+object-suffixes-left := $(versioned)
+include $(o-iterator)
+
+define o-iterator-doit
+$(libdir)/$(o:.so=)-$($(subdir)-version).so: $(objpfx)$o;
+ $$(do-install-program)
+endef
+object-suffixes-left := $(versioned)
+include $(o-iterator)
+endif
endif
define do-install-so
__nl_catd result;
const char *env_var;
- result = (__nl_catd) malloc (sizeof (__nl_catd));
+ result = (__nl_catd) malloc (sizeof (*result));
if (result == NULL)
/* We cannot get enough memory. */
return (nl_catd) -1;
#include <stdio.h>
#include <ctype.h>
#include <stdlib.h>
+#include <unistd.h>
#include <dlfcn.h>
static void *funcall (char **stringp);
/* Swallow closing paren. */
++*stringp;
+ if (args[0] == NULL)
+ {
+ static const char unknown[] = "Unknown function\n";
+ write (1, unknown, sizeof unknown - 1);
+ return NULL;
+ }
+
/* Do it to it. */
__builtin_return (__builtin_apply (args[0],
&argcookie,
value = p;
do
++p;
- while (*p != '\0' && !isspace (*p) && !ispunct (*p));
+ while (*p != '\0' && !isspace (*p) && (!ispunct (*p) || *p == '_'));
c = *p;
*p = '\0';
value = dlsym (NULL, value);
--- /dev/null
+GNU libio by Per Bothner
struct locked_FILE
{
struct _IO_FILE_plus fp;
+#ifdef _IO_MTSAFE_IO
_IO_lock_t lock;
+#endif
} *new_f;
int fd_flags;
new_f = (struct locked_FILE *) malloc (sizeof (struct locked_FILE));
if (new_f == NULL)
return NULL;
+#ifdef _IO_MTSAFE_IO
new_f->fp.file._lock = &new_f->lock;
+#endif
_IO_init (&new_f->fp.file, 0);
_IO_JUMPS (&new_f->fp.file) = &_IO_file_jumps;
_IO_file_init (&new_f->fp.file);
struct locked_FILE
{
struct _IO_FILE_plus fp;
+#ifdef _IO_MTSAFE_IO
_IO_lock_t lock;
+#endif
} *new_f = (struct locked_FILE *) malloc (sizeof (struct locked_FILE));
if (new_f == NULL)
return NULL;
+#ifdef _IO_MTSAFE_IO
new_f->fp.file._lock = &new_f->lock;
+#endif
_IO_init (&new_f->fp.file, 0);
_IO_JUMPS (&new_f->fp.file) = &_IO_file_jumps;
_IO_file_init (&new_f->fp.file);
struct locked_FILE
{
struct _IO_cookie_file cfile;
+#ifdef _IO_MTSAFE_IO
_IO_lock_t lock;
+#endif
} *new_f;
switch (*mode++)
new_f = (struct locked_FILE *) malloc (sizeof (struct locked_FILE));
if (new_f == NULL)
return NULL;
+#ifdef _IO_MTSAFE_IO
new_f->cfile.file._lock = &new_f->lock;
+#endif
_IO_init (&new_f->cfile.file, 0);
_IO_JUMPS (&new_f->cfile.file) = &_IO_cookie_jumps;
struct locked_FILE
{
struct _IO_proc_file fpx;
+#ifdef _IO_MTSAFE_IO
_IO_lock_t lock;
+#endif
} *new_f;
_IO_FILE *fp;
new_f = (struct locked_FILE *) malloc (sizeof (struct locked_FILE));
if (new_f == NULL)
return NULL;
+#ifdef _IO_MTSAFE_IO
new_f->fpx.file.file._lock = &new_f->lock;
+#endif
fp = (_IO_FILE*)&new_f->fpx;
_IO_init(fp, 0);
_IO_JUMPS(fp) = &_IO_proc_jumps;
_IO_va_list args;
{
_IO_strfile sf;
+#ifdef _IO_MTSAFE_IO
_IO_lock_t lock;
+#endif
int ret;
+#ifdef _IO_MTSAFE_IO
sf._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, string, -1, string);
const char *string AND const char *format AND _IO_va_list args)
{
_IO_strfile sf;
+#ifdef _IO_MTSAFE_IO
_IO_lock_t lock;
sf._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);
#ifdef _IO_MTSAFE_IO
#include <pthread.h>
typedef pthread_mutex_t _IO_lock_t;
+#define _IO_lock_init PTHREAD_MUTEX_INITIALIZER
#else
typedef void _IO_lock_t;
#endif
#else
#define _IO_FJUMP &_IO_file_jumps,
#endif
+#ifdef _IO_MTSAFE_IO
/* check following! */
#define FILEBUF_LITERAL(CHAIN, FLAGS, FD) \
{ _IO_MAGIC+_IO_LINKED+_IO_IS_FILEBUF+FLAGS, \
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, CHAIN, _IO_FJUMP FD}
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, CHAIN, _IO_FJUMP FD, \
+ 0, 0, 0, 0, { 0 }, &_IO_stdfile_##FD##_lock }
+#else
+/* check following! */
+#define FILEBUF_LITERAL(CHAIN, FLAGS, FD) \
+ { _IO_MAGIC+_IO_LINKED+_IO_IS_FILEBUF+FLAGS, \
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, CHAIN, _IO_FJUMP FD }
+#endif
/* VTABLE_LABEL defines NAME as of the CLASS class.
CNLENGTH is strlen(#CLASS). */
struct locked_FILE
{
struct _IO_FILE_memstream fp;
+#ifdef _IO_MTSAFE_IO
_IO_lock_t lock;
+#endif
} *new_f;
char *buf;
new_f = (struct locked_FILE *) malloc (sizeof (struct locked_FILE));
if (new_f == NULL)
return NULL;
+#ifdef _IO_MTSAFE_IO
new_f->fp._sf._f._lock = &new_f->lock;
+#endif
buf = ALLOC_BUF (_IO_BUFSIZ);
_IO_init (&new_f->fp._sf._f, 0);
#include "libioP.h"
-
+#ifdef _IO_MTSAFE_IO
+#define DEF_STDFILE(NAME, FD, CHAIN, FLAGS) \
+ static _IO_lock_t _IO_stdfile_##FD##_lock = _IO_lock_init; \
+ struct _IO_FILE_plus NAME \
+ = {FILEBUF_LITERAL(CHAIN, FLAGS, FD), &_IO_file_jumps}
+#else
#define DEF_STDFILE(NAME, FD, CHAIN, FLAGS) \
struct _IO_FILE_plus NAME \
= {FILEBUF_LITERAL(CHAIN, FLAGS, FD), &_IO_file_jumps}
+#endif
DEF_STDFILE(_IO_stdin_, 0, 0, _IO_NO_WRITES);
DEF_STDFILE(_IO_stdout_, 1, &_IO_stdin_.file, _IO_NO_READS);
const _IO_size_t init_string_size = 100;
char *string;
_IO_strfile sf;
+#ifdef _IO_MTSAFE_IO
_IO_lock_t lock;
+#endif
int ret;
string = ALLOC_BUF(init_string_size);
if (string == NULL)
return -1;
+#ifdef _IO_MTSAFE_IO
sf._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, string, init_string_size, string);
_IO_va_list arg;
{
struct _IO_FILE_plus tmpfil;
+#ifdef _IO_MTSAFE_IO
_IO_lock_t lock;
+#endif
int done;
+#ifdef _IO_MTSAFE_IO
tmpfil.file._lock = &lock;
+#endif
_IO_init (&tmpfil.file, 0);
_IO_JUMPS (&tmpfil.file) = &_IO_file_jumps;
_IO_file_init (&tmpfil.file);
_IO_va_list args;
{
_IO_strfile sf;
- _IO_lock_t lock;
int ret;
+#ifdef _IO_MTSAFE_IO
+ _IO_lock_t lock;
sf._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, string, maxlen - 1, string);
Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.\n\
This is free software; see the source for copying conditions.\n\
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A\n\
-PARTICULAR PURPOSE.\n\
-Report bugs to <bug-glibc@gnu.ai.mit.edu>.\n";
+PARTICULAR PURPOSE.\n"
+#include "version-info.h"
+"Report bugs to <bug-glibc@gnu.ai.mit.edu>.\n";
#include <unistd.h>