* elf/dl-load.c (fillin_rpath): In SUID binaries, don't mark
non-system-dirs in LD_LIBRARY_PATH as nonexisting, simply drop them.
- * libio/iovdprintf.c (_IO_vdprintf): Call __fsetlocking for temporary
- stream.
+ * libio/iovdprintf.c (_IO_vdprintf): Set _IO_USER_LOCK flag for
+ temporary stream. Don't define lock.
* libio/obprintf.c (_IO_obstack_vprintf): Likewise.
* libio/strops.c (_IO_str_init_static): Likewise.
* libio/vasprintf.c (_IO_vasprintf): Likewise.
* libio/wstrops.c (_IO_wstr_init_static): Likewise.
+ * libio/iovsprintf.c: Likewise.
+ * libio/iovsnprintf.c: Likewise.
+ * libio/iovswprintf.c: Likewise.
+ * libio/iovsscanf.c: Likewise.
+ * libio/iovswscanf.c: Likewise.
+ * stdio-common/vfprintf.c [USE_IN_LIBIO] (buffered_vfprintf): Likewise.
+ * libio/genops.c (_IO_no_init): Don't call _IO_lock_init if _lock
+ is NULL.
+ (_IO_default_finish): Likewise.
+ * libio/wgenops.c (_IO_wdefault_finish): Likewise.
2001-08-10 Andreas Jaeger <aj@suse.de>
fp->_vtable_offset = 0;
#endif
#ifdef _IO_MTSAFE_IO
- _IO_lock_init (*fp->_lock);
+ if (fp->_lock != NULL)
+ _IO_lock_init (*fp->_lock);
#endif
fp->_mode = orientation;
#if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T
}
#ifdef _IO_MTSAFE_IO
- _IO_lock_fini (*fp->_lock);
+ if (fp->_lock != NULL)
+ _IO_lock_fini (*fp->_lock);
#endif
_IO_un_link ((struct _IO_FILE_plus *) fp);
int dir;
int mode;
{
- return _IO_pos_BAD;
+ return _IO_pos_BAD;
}
int
_IO_va_list arg;
{
struct _IO_FILE_plus tmpfil;
-#ifdef _IO_MTSAFE_IO
- _IO_lock_t lock;
-#endif
struct _IO_wide_data wd;
int done;
#ifdef _IO_MTSAFE_IO
- tmpfil.file._lock = &lock;
+ tmpfil.file._lock = NULL;
#endif
- _IO_no_init (&tmpfil.file, 0, 0, &wd, &_IO_wfile_jumps);
+ _IO_no_init (&tmpfil.file, _IO_USER_LOCK, 0, &wd, &_IO_wfile_jumps);
_IO_JUMPS (&tmpfil) = &_IO_file_jumps;
_IO_file_init (&tmpfil);
#if !_IO_UNIFIED_JUMPTABLES
tmpfil.vtable = NULL;
#endif
- if (_IO_file_attach ((_IO_FILE *) &tmpfil, d) == NULL)
+ if (_IO_file_attach (&tmpfil.file, d) == NULL)
{
_IO_un_link (&tmpfil);
return EOF;
(_IO_mask_flags (&tmpfil.file, _IO_NO_READS,
_IO_NO_READS+_IO_NO_WRITES+_IO_IS_APPENDING)
| _IO_DELETE_DONT_CLOSE);
-#ifdef _IO_MTSAFE_IO
- __fsetlocking ((FILE *) &tmpfil, FSETLOCKING_BYCALLER);
-#endif
- done = _IO_vfprintf ((_IO_FILE *) &tmpfil, format, arg);
+ done = _IO_vfprintf (&tmpfil.file, format, arg);
- _IO_FINISH ((_IO_FILE *) &tmpfil);
+ _IO_FINISH (&tmpfil.file);
return done;
}
-/* Copyright (C) 1993, 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
+/* Copyright (C) 1993, 1997-2000, 2001 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
_IO_va_list args;
{
_IO_strfile sf;
-#ifdef _IO_MTSAFE_IO
- _IO_lock_t lock;
-#endif
int ret;
#ifdef _IO_MTSAFE_IO
- sf._sbf._f._lock = &lock;
+ sf._sbf._f._lock = NULL;
#endif
- _IO_no_init (&sf._sbf._f, 0, -1, NULL, NULL);
+ _IO_no_init (&sf._sbf._f, _IO_USER_LOCK, -1, NULL, NULL);
_IO_JUMPS ((struct _IO_FILE_plus *) &sf._sbf) = &_IO_str_jumps;
_IO_str_init_static (&sf, string, -1, string);
ret = _IO_vfprintf ((_IO_FILE *) &sf._sbf, format, args);
-/* Copyright (C) 1993, 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
+/* Copyright (C) 1993, 1997-2000, 2001 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
int ret;
_IO_strfile sf;
#ifdef _IO_MTSAFE_IO
- _IO_lock_t lock;
- sf._sbf._f._lock = &lock;
+ sf._sbf._f._lock = NULL;
#endif
- _IO_no_init (&sf._sbf._f, 0, -1, NULL, NULL);
+ _IO_no_init (&sf._sbf._f, _IO_USER_LOCK, -1, NULL, NULL);
_IO_JUMPS ((struct _IO_FILE_plus *) &sf._sbf) = &_IO_str_jumps;
_IO_str_init_static (&sf, (char*)string, 0, NULL);
ret = _IO_vfscanf ((_IO_FILE *) &sf._sbf, format, args, NULL);
-/* Copyright (C) 1993, 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
+/* Copyright (C) 1993, 1997-2000, 2001 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
_IO_strfile sf;
struct _IO_wide_data wd;
#ifdef _IO_MTSAFE_IO
- _IO_lock_t lock;
- sf._sbf._f._lock = &lock;
+ sf._sbf._f._lock = NULL;
#endif
- _IO_no_init (&sf._sbf._f, 0, 0, &wd, &_IO_wstr_jumps);
+ _IO_no_init (&sf._sbf._f, _IO_USER_LOCK, 0, &wd, &_IO_wstr_jumps);
_IO_fwide (&sf._sbf._f, 1);
_IO_wstr_init_static (&sf._sbf._f, (wchar_t *)string, 0, NULL);
ret = _IO_vfwscanf ((_IO_FILE *) &sf._sbf, format, args, NULL);
struct obstack_FILE
{
struct _IO_obstack_file ofile;
-#ifdef _IO_MTSAFE_IO
- _IO_lock_t lock;
-#endif
} new_f;
int result;
int size;
int room;
#ifdef _IO_MTSAFE_IO
- new_f.ofile.file.file._lock = &new_f.lock;
+ new_f.ofile.file.file._lock = NULL;
#endif
- _IO_no_init (&new_f.ofile.file.file, 0, -1, NULL, NULL);
+ _IO_no_init (&new_f.ofile.file.file, _IO_USER_LOCK, -1, NULL, NULL);
_IO_JUMPS (&new_f.ofile.file) = &_IO_obstack_jumps;
room = obstack_room (obstack);
size = obstack_object_size (obstack) + room;
assert (size != 0);
}
- _IO_str_init_static ((struct _IO_strfile_ *) &new_f.ofile, obstack_base (obstack),
+ _IO_str_init_static ((struct _IO_strfile_ *) &new_f.ofile,
+ obstack_base (obstack),
size, obstack_next_free (obstack));
/* Now allocate the rest of the current chunk. */
assert (size == (new_f.ofile.file.file._IO_write_end
obstack_blank_fast (obstack, room);
new_f.ofile.obstack = obstack;
-#ifdef _IO_MTSAFE_IO
- __fsetlocking ((FILE *) &new_f.ofile.file, FSETLOCKING_BYCALLER);
-#endif
- result = _IO_vfprintf ((_IO_FILE *) &new_f.ofile.file, format, args);
+ result = _IO_vfprintf (&new_f.ofile.file.file, format, args);
/* Shrink the buffer to the space we really currently need. */
obstack_blank_fast (obstack, (new_f.ofile.file.file._IO_write_ptr
}
/* A null _allocate_buffer function flags the strfile as being static. */
sf->_s._allocate_buffer = (_IO_alloc_type) 0;
-
-#ifdef _IO_MTSAFE_IO
- /* We never have to lock this stream. */
- __fsetlocking ((FILE *) fp, FSETLOCKING_BYCALLER);
-#endif
}
void
const _IO_size_t init_string_size = 100;
char *string;
_IO_strfile sf;
-#ifdef _IO_MTSAFE_IO
- _IO_lock_t lock;
-#endif
int ret;
_IO_size_t needed;
_IO_size_t allocated;
if (string == NULL)
return -1;
#ifdef _IO_MTSAFE_IO
- sf._sbf._f._lock = &lock;
+ sf._sbf._f._lock = NULL;
#endif
- _IO_no_init ((_IO_FILE *) &sf._sbf, 0, -1, NULL, NULL);
+ _IO_no_init ((_IO_FILE *) &sf._sbf, _IO_USER_LOCK, -1, NULL, NULL);
_IO_JUMPS ((struct _IO_FILE_plus *) &sf._sbf) = &_IO_str_jumps;
_IO_str_init_static (&sf, string, init_string_size, string);
sf._sbf._f._flags &= ~_IO_USER_BUF;
sf._s._allocate_buffer = (_IO_alloc_type) malloc;
sf._s._free_buffer = (_IO_free_type) free;
-#ifdef _IO_MTSAFE_IO
- __fsetlocking ((FILE *) &sf, FSETLOCKING_BYCALLER);
-#endif
- ret = _IO_vfprintf ((_IO_FILE *) &sf, format, args);
+ ret = _IO_vfprintf (&sf._sbf._f, format, args);
if (ret < 0)
return ret;
/* Only use realloc if the size we need is of the same order of
-/* Copyright (C) 1994, 1997, 1999, 2000 Free Software Foundation, Inc.
+/* Copyright (C) 1994, 1997, 1999, 2000, 2001 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
_IO_strnfile sf;
int ret;
#ifdef _IO_MTSAFE_IO
- _IO_lock_t lock;
- sf.f._sbf._f._lock = &lock;
+ sf.f._sbf._f._lock = NULL;
#endif
/* We need to handle the special case where MAXLEN is 0. Use the
maxlen = sizeof (sf.overflow_buf);
}
- _IO_no_init (&sf.f._sbf._f, 0, -1, NULL, NULL);
+ _IO_no_init (&sf.f._sbf._f, _IO_USER_LOCK, -1, NULL, NULL);
_IO_JUMPS ((struct _IO_FILE_plus *) &sf.f._sbf) = &_IO_strn_jumps;
string[0] = '\0';
_IO_str_init_static (&sf.f, string, maxlen - 1, string);
int ret;
struct _IO_wide_data wd;
#ifdef _IO_MTSAFE_IO
- _IO_lock_t lock;
- sf.f._sbf._f._lock = &lock;
+ sf.f._sbf._f._lock = NULL;
#endif
if (maxlen == 0)
length of zero always makes the function fail. */
return -1;
- _IO_no_init (&sf.f._sbf._f, 0, 0, &wd, &_IO_wstrn_jumps);
+ _IO_no_init (&sf.f._sbf._f, _IO_USER_LOCK, 0, &wd, &_IO_wstrn_jumps);
_IO_fwide (&sf.f._sbf._f, 1);
string[0] = L'\0';
_IO_wstr_init_static (&sf.f._sbf._f, string, maxlen - 1, string);
}
#ifdef _IO_MTSAFE_IO
- _IO_lock_fini (*fp->_lock);
+ if (fp->_lock != NULL)
+ _IO_lock_fini (*fp->_lock);
#endif
_IO_un_link ((struct _IO_FILE_plus *) fp);
}
/* A null _allocate_buffer function flags the strfile as being static. */
(((_IO_strfile *) fp)->_s._allocate_buffer) = (_IO_alloc_type)0;
-
-#ifdef _IO_MTSAFE_IO
- /* We never have to lock this stream. */
- __fsetlocking ((FILE *) fp, FSETLOCKING_BYCALLER);
-#endif
}
void
_IO_setp (hp, buf, buf + sizeof buf);
hp->_mode = -1;
#endif
- hp->_IO_file_flags = _IO_MAGIC|_IO_NO_READS;
+ hp->_IO_file_flags = _IO_MAGIC|_IO_NO_READS|_IO_USER_LOCK;
#if _IO_JUMPS_OFFSET
hp->_vtable_offset = 0;
#endif
#ifdef _IO_MTSAFE_IO
- hp->_lock = &helper.lock;
- __libc_lock_init (*hp->_lock);
+ hp->_lock = NULL;
#endif
_IO_JUMPS (&helper._f) = (struct _IO_jump_t *) &_IO_helper_jumps;