Commit Graph

448 Commits

Author SHA1 Message Date
Andreas Schwab 49a43d80ec Fix syntax error in __THROW macro 2011-10-17 11:49:44 +02:00
Ulrich Drepper aa78043a4a Use leaf function attribute in __THROW 2011-10-16 21:29:11 -04:00
Andreas Schwab e529793b50 Avoid macro clash between <sys/select.h> and <linux/posix_types.h> 2011-09-13 15:16:38 +02:00
Ulrich Drepper 3ce1f29594 Cleanup of configuration options
Make several tool features mandatory and simplify the code.
2011-09-10 14:34:15 -04:00
Ulrich Drepper a0f33f996f Add range checking for FD_SET, FD_CLR, and FD_ISSET 2011-09-08 19:48:47 -04:00
Marek Polacek 295e904fe6 Add const attr to gnu_dev_{major,minor,makedev} 2011-07-20 12:35:29 -04:00
Roland McGrath 5615eaf264 Quash some new warnings from GCC 4.6. 2011-06-10 22:44:20 -07:00
Ulrich Drepper 68a3f91fca Fix reporting of invalid timeouts in emulated pselect 2011-05-16 09:35:51 -04:00
Ulrich Drepper 15cc7dd182 Fix test for error_one_per_line mode in error 2011-05-16 09:10:36 -04:00
Ulrich Drepper e1fb097f44 Report write error in addmnt even for cached streams. 2011-05-11 23:37:25 -04:00
Jim Meyering ded5b9b7c7 Remove doubled words. 2011-04-22 21:34:32 -04:00
Andreas Schwab 81a5726bd2 Add syncfs syscall. 2011-04-01 13:08:28 -04:00
Ulrich Drepper ab00f4eac8 Fix handling if newline in addmntent. 2010-05-02 12:12:55 -07:00
Ulrich Drepper caa6e77293 Fix endless loop with invalid /etc/shells file. 2010-02-03 06:23:31 -08:00
Ulrich Drepper a7bbf3d742 Remove unnecessary returns. 2010-01-19 12:04:34 -08:00
Jakub Jelinek 34df851b33 Fix preadv, pwritev and fallocate for -D_FILE_OFFSET_BITS=64.
As reported in http://bugzilla.redhat.com/533063 , preadv/pwritev prototypes
are wrong on 32-bit arches with -D_FILE_OFFSET_BITS=64 and as I've just
found, fallocate is wrong too.
The problem is that only off_t is remapped to the 64-bit type transparently,
__off_t is not.
2009-11-06 09:26:31 -08:00
Ulrich Drepper 3a83202db6 Implement mkostemps and mkostemps64. 2009-10-30 08:02:30 -07:00
Ulrich Drepper 7f3146e789 Implement mkstemps and mkstemps64. 2009-10-30 00:11:07 -07:00
Ulrich Drepper eb0b6cb6e1 Fix warnings when using <sys/select.h>.
gcc 4.4 is more picky.  And the x86-64 version of <bits/select.h>
contained a now unnecessary asm optimization.  Remove it.
2009-06-14 16:09:42 -07:00
Andreas Schwab ff6ff38db2 Remove redundant .gitignore files. 2009-05-16 10:18:34 +02:00
Jim Meyering 2e180a2622 rename each .cvsignore file to .gitignore 2009-05-15 18:13:37 +02:00
Ulrich Drepper c2d5bd5b00 [BZ #10100]
2009-04-24  Ulrich Drepper  <drepper@redhat.com>
	[BZ #10100]
	* misc/hsearch_r.c (hsearch_r): Add back ensurance that hval is
	not zero.
2009-04-24 18:20:10 +00:00
Ulrich Drepper 7f8a28efb5 * sysdeps/unix/sysv/linux/preadv.c: The kernel API changed. Adjust.
* sysdeps/unix/sysv/linux/pwritev.c: Likewise.

2009-04-23  Jakub Jelinek  <jakub@redhat.com>

	* sysdeps/posix/pwritev.c (PWRITEV): Fix up comment.  Copy
	data from vector to temporary buffer and call PWRITEV after it
	instead of vice versa.
	* sysdeps/posix/preadv.c: Fix up comment.
	* misc/preadv.c: Likewise.
	* misc/preadv64.c: Likewise.
	* misc/pwritev.c: Likewise.
	* misc/pwritev64.c: Likewise.
	* misc/sys/uio.h (preadv, pwritev, preadv64, pwritev64): Likewise.

2009-04-23  Ulrich Drepper  <drepper@redhat.com>
2009-04-23 22:52:24 +00:00
Ulrich Drepper e109c6124f * misc/Makefile (routines): Add preadv, preadv64, pwritev, pwritev64.
* misc/Versions: Export preadv, preadv64, pwritev, pwritev64 for
	GLIBC_2.10.
	* misc/sys/uio.h: Declare preadv, preadv64, pwritev, pwritev64.
	* sysdeps/unix/sysv/linux/kernel-features.h: Add entries for preadv
	and pwritev.
	* misc/preadv.c: New file.
	* misc/preadv64.c: New file.
	* misc/pwritev.c: New file.
	* misc/pwritev64.c: New file.
	* sysdeps/posx/preadv.c: New file.
	* sysdeps/posx/preadv64.c: New file.
	* sysdeps/posx/pwritev.c: New file.
	* sysdeps/posx/pwritev64.c: New file.
	* sysdeps/unix/sysv/linux/preadv.c: New file.
	* sysdeps/unix/sysv/linux/preadv64.c: New file.
	* sysdeps/unix/sysv/linux/pwritev.c: New file.
	* sysdeps/unix/sysv/linux/pwritev64.c: New file.
	* sysdeps/unix/sysv/linux/wordsize-64/preadv64.c: New file.
	* sysdeps/unix/sysv/linux/wordsize-64/pwritev64.c: New file.
2009-04-03 19:57:16 +00:00
Jakub Jelinek 6219e3cc0e * misc/sys/cdefs.h (__extern_always_inline): Add __artificial__
attribute also for non-C99 inline semantics variant.
2009-03-02  Richard Guenther  <rguenther@suse.de>

	* misc/sys/cdefs.h (__extern_always_inline): Add __artificial__
	attribute also for non-C99 inline semantics variant.
2009-03-02 15:56:03 +00:00
Ulrich Drepper 1fdd89a78d * malloc/malloc.c (sYSMALLOc): Don't use assert when detecting
manipulated brk, use malloc_printerr.
	* misc/sbrk.c (__sbrk): Better error handling for nonsense
	requests.
2009-01-30 17:47:23 +00:00
Ulrich Drepper 25e8417764 ..
2009-01-23  Ulrich Drepper  <drepper@redhat.com>

	* sysdeps/unix/sysv/linux/tst-clone.c (do_test): Avoid warning.

	* misc/hsearch_r.c (hcreate_r): We need at least three elements in
	the hash table.
	* misc/Makefile (tests): Add bug-hsearch1.
	* misc/bug-hsearch1.c: New file.
2009-01-23 20:41:36 +00:00
Ulrich Drepper 8073a49484 (hcreate_r): We need at least three elements in the hash table. 2009-01-23 20:34:21 +00:00
Ulrich Drepper 64647f9aa8 [BZ #6966]
2008-11-01  Ulrich Drepper  <drepper@redhat.com>
	[BZ #6966]
	* misc/hsearch_r.c (hsearch_r): Fix secondary hash function.
2008-11-01 15:39:48 +00:00
Ulrich Drepper 208bc83670 * misc/syslog.c (openlog_internal): Fix __have_sock_cloexec
initialization.
2008-10-22 21:45:13 +00:00
Ulrich Drepper 340f76a284 (openlog_internal): Fix compile problem. 2008-07-30 15:55:18 +00:00
Ulrich Drepper c0216dfc62 * misc/syslog.c (openlog_internal): Use SOCK_CLOEXEC if possible. 2008-07-26 22:55:08 +00:00
Jakub Jelinek eef8a803a6 * misc/regexp.h (compile): Use __REPB_PREFIX macro.
Avoid segfault if first GETC returns eof/'\0'/'\n'.
2008-06-05  Jakub Jelinek  <jakub@redhat.com>

	* misc/regexp.h (compile): Use __REPB_PREFIX macro.
	Avoid segfault if first GETC returns eof/'\0'/'\n'.
2008-06-06 19:23:39 +00:00
Ulrich Drepper 62605cbfcb Remove useless more "if" tests before "free".
* include/inline-hashtab.h (htab_delete): Likewise.
	* libio/freopen.c (freopen): Likewise.
	* libio/freopen64.c (freopen64): Likewise.
	* locale/programs/ld-collate.c (collate_read): Likewise.
	* misc/fstab.c (libc_freeres_fn): Likewise.
	* posix/glob.c (globfree): Likewise.
2008-05-27 06:04:07 +00:00
Ulrich Drepper b29899ae10 * misc/truncate64.c (truncate64): Use __truncate not truncate. 2008-05-10 23:38:33 +00:00
Ulrich Drepper a4bb445a63 [BZ #5779]
* misc/sys/queue.h: Add STAILQ_CONCAT and TAILQ_CONCAT definitions.
	Patch by Roy Marples <roy@marples.name>.
2008-03-05 05:50:39 +00:00
Jakub Jelinek 29d49a1a66 * misc/Makefile (headers): Add bits/error.h.
2007-10-12  Jakub Jelinek  <jakub@redhat.com>

	* misc/Makefile (headers): Add bits/error.h.
2007-10-12 21:18:18 +00:00
Ulrich Drepper a1a363d20c * misc/error.h: Use __const instead of const.
* misc/bits/error.h: Likewise.

2007-10-07  Andreas Jaeger  <aj@suse.de>

	* include/bits/error.h: New file.

	* misc/bits/error.h (error_at_line): Fix prototype.
2007-10-07 17:29:37 +00:00
Ulrich Drepper b80bfc8b53 * misc/error.h: Remove support for use outside of libc. We have to
include <features.h> now.  Include <bits/error.h> if possible.
	* misc/bits/error.h: New file.
2007-10-04 18:07:28 +00:00
Ulrich Drepper fae56ce808 Specializations of error functions. 2007-10-04 17:49:25 +00:00
Ulrich Drepper ac97dec17a * misc/sys/cdefs.h (__REDIRECT_LDBL, __REDIRECT_NTH_LDBL): New macros.
* wcsmbs/bits/wchar2.h (__swprintf_alias, __vswprintf_alias): Use
	__REDIRECT_NTH_LDBL macro rather than __REDIRECT_NTH.
2007-10-03 18:27:30 +00:00
Ulrich Drepper ee868c89ae 2007-10-03 Jakub Jelinek
* misc/sys/cdefs.h (__extern_always_inline): For GCC 4.3+
	add __artificial__ attribute.
2007-10-03 18:13:55 +00:00
Ulrich Drepper d6cd6bf4de * misc/sys/cdefs.h (__warndecl, __errordecl): For GCC 4.3+ define
with __warning__/__error__ attributes.
	(__warnattr): Define.
	* stdlib/bits/stdlib.h (__realpath_chk_warn, __ptsname_r_chk_warn,
	__mbstowcs_chk_warn, __wcstombs_chk_warn): New aliases with
	__warnattr.
	(realpath, ptsname_r, mbstowcs, wcstombs): Call __*_chk_warn instead
	of __*_chk if compile time detectable overflow is found.
	* libio/bits/stdio2.h (__fgets_chk_warn, __fread_chk_warn,
	__fgets_unlocked_chk_warn, __fread_unlocked_chk_warn): New aliases
	with __warnattr.
	(fgets, fread, fgets_unlocked, fread_unlocked): Call __*_chk_warn
	instead of __*_chk if compile time detectable overflow is found.
	(__gets_alias): Rename to...
	(__gets_warn): ... this.  Add __warnattr.
	(gets): Call __gets_warn instead of __gets_alias.
	* socket/bits/socket2.h (__recv_chk_warn, __recvfrom_chk_warn): New
	aliases with __warnattr.
	(recv, recvfrom): Call __*_chk_warn instead of __*_chk if compile
	time detectable overflow is found.
	* posix/bits/unistd.h (__read_chk_warn, __pread_chk_warn,
	__pread64_chk_warn, __readlink_chk_warn, __readlinkat_chk_warn,
	__getcwd_chk_warn, __confstr_chk_warn, __getgroups_chk_warn,
	__ttyname_r_chk_warn, __getlogin_r_chk_warn, __gethostname_chk_warn,
	__getdomainname_chk_warn): New aliases with __warnattr.
	(read, pread, pread64, readlink, readlinkat, getcwd, confstr,
	getgroups, ttyname_r, getlogin_r, gethostname, getdomainname): Call
	__*_chk_warn instead of __*_chk if compile time detectable overflow
	is found.
	(__getgroups_chk): Rename argument to __listlen from listlen.
	(__getwd_alias): Rename to...
	(__getwd_warn): ... this.  Add __warnattr.
	(getwd): Call __getwd_warn instead of __getwd_alias.
	* wcsmbs/bits/wchar2.h (__wmemcpy_chk_warn, __wmemmove_chk_warn,
	__wmempcpy_chk_warn, __wmemset_chk_warn, __wcsncpy_chk_warn,
	__wcpncpy_chk_warn, __fgetws_chk_warn, __fgetws_unlocked_chk_warn,
	__mbsrtowcs_chk_warn, __wcsrtombs_chk_warn, __mbsnrtowcs_chk_warn,
	__wcsnrtombs_chk_warn): New aliases with __warnattr.
	(wmemcpy, wmemmove, wmempcpy, wmemset, mbsrtowcs, wcsrtombs,
	mbsnrtowcs, wcsnrtombs): Call __*_chk_warn instead of __*_chk if
	compile time detectable overflow is found.
	(wcsncpy, wcpncpy): Likewise.  For constant __n fix check whether
	to use __*_chk or not.
	(fgetws, fgetws_unlocked): Divide __bos by sizeof (wchar_t), both
	in comparisons which function should be called and in __*_chk*
	arguments.  Call __*_chk_warn instead of __*_chk if compile time
	detectable overflow is found.
	(swprintf, vswprintf): Divide __bos by sizeof (wchar_t) in
	__*_chk argument.
	* debug/tst-chk1.c (do_test): Add a few more tests.
2007-09-26 20:45:18 +00:00
Jakub Jelinek ddf51ecb5f * misc/bits/syslog.h (syslog): Remove extraneous argument from
the inline, pass __USE_FORTIFY_LEVEL - 1 as second argument to 
__syslog_chk.
2007-09-19  Jakub Jelinek  <jakub@redhat.com>

	* misc/bits/syslog.h (syslog): Remove extraneous argument from
	the inline, pass __USE_FORTIFY_LEVEL - 1 as second argument to
	__syslog_chk.
2007-09-18 23:38:23 +00:00
Jakub Jelinek 3dd79d6309 Undo second occurrence of RH GCC hack. 2007-09-16 05:10:26 +00:00
Ulrich Drepper 267c54dcef * stdio-common/vfscanf.c (_IO_vfwscanf): Add support for 'm'
modifier.  Patch by Jakub Jelinek.
2007-09-15 22:49:46 +00:00
Ulrich Drepper 3a50811c2f * rt/Versions (librt): Export __mq_open_2@@GLIBC_2.7.
* rt/Makefile (headers): Add bits/mqueue2.h.
	* rt/mqueue.h: Include bits/mqueue2.h if -D_FORTIFY_SOURCE=2,
	optimizing with GCC and __va_arg_pack_len is defined.
	* rt/bits/mqueue2.h: New file.
	* rt/mq_open.c (__mq_open): Renamed from mq_open.
	(mq_open): New strong_alias.
	(__mq_open_2): New function.
	* sysdeps/unix/sysv/linux/mq_open.c (__mq_open): Renamed from mq_open.
	(mq_open): New strong_alias.
	(__mq_open_2): New function.
	* debug/Versions (libc): Export __fortify_fail@@GLIBC_PRIVATE.
	* Versions.def (librt): Add GLIBC_2.7 version.
	* debug/fortify_fail.c (__fortify_fail): Add libc_hidden_def.
	* include/stdio.h (__fortify_fail): Add libc_hidden_proto.

	* misc/sys/cdefs.h (__errordecl, __va_arg_pack_len): Define.
	* io/fcntl.h: Include bits/fcntl2.h when __va_arg_pack_len
	is defined rather than when not C++.
	* io/bits/fcntl2.h (__open_alias, __open64_alias, __openat_alias,
	__openat64_alias): New redirects.
	(__open_too_many_args, __open_missing_mode, __open64_too_many_args,
	__open64_missing_mode, __openat_too_many_args, __openat_missing_mode,
	__openat64_too_many_args, __openat64_missing_mode): New __errordecls.
	(open, open64, openat, openat64): Rewrite as __extern_always_inline
	functions instead of function-like macros.
2007-09-15 22:35:27 +00:00
Ulrich Drepper de1c3ebb59 * misc/sys/cdefs.h (__va_arg_pack): Define for GCC 4.3+.
* misc/bits/syslog.h (syslog): When __va_arg_pack is defined,
	implement as __extern_always_inline function.
	(vsyslog): Define as __extern_always_inline function unconditionally.
	* libio/bits/stdio2.h (sprintf, snprintf, printf, fprintf):
	When __va_arg_pack is defined, implement as __extern_always_inline
	functions.
	(vsprintf, vsnprintf, vprintf, vfprintf): Define as
	__extern_always_inline functions unconditionally.
	* libio/bits/stdio.h (vprintf): Ifdef out the inline when
	bits/stdio2.h will be included.
	* wcsmbs/bits/wchar2.h (__swprintf_alias): New redirect.
	(swprintf, wprintf, fwprintf): When __va_arg_pack is defined,
	implement as __extern_always_inline functions.
	(vswprintf, vwprintf, vfwprintf): Define as
	__extern_always_inline functions unconditionally.
	* debug/tst-chk1.c (do_test): Enable remaining tests for C++.

2007-09-03  Jakub Jelinek  <jakub@redhat.com>

	* misc/sys/cdefs.h (__extern_inline, __extern_always_inline): Only
	define in C++ for GCC 4.3+, in C++ always use __gnu_inline__
	attribute.
	* include/features.h (__USE_EXTERN_INLINES): Define only when
	__extern_inline is defined.
	* stdlib/stdlib.h: Include bits/stdlib.h when __extern_always_inline
	is defined instead of when not __cplusplus.
	* misc/sys/syslog.h: Include bits/syslog.h when __extern_always_inline
	is defined instead of when not __cplusplus.
	* socket/sys/socket.h: Include bits/socket2.h when
	__extern_always_inline is defined instead of when not __cplusplus.
	* libio/stdio.h: Include bits/stdio2.h when __extern_always_inline
	is defined instead of when not __cplusplus.
	* posix/unistd.h: Include bits/unistd.h when __extern_always_inline
	is defined instead of when not __cplusplus.
	* string/string.h: Include bits/string3.h when __extern_always_inline
	is defined instead of when not __cplusplus.
	* wcsmbs/wchar.h: Include bits/wchar2.h when __extern_always_inline
	is defined instead of when not __cplusplus.
	(btowc, wctob): Don't guard the inlines with ifndef __cplusplus.
	* io/fcntl.h: Don't include bits/fcntl2.h if __extern_always_inline
	is not defined.
	* misc/bits/syslog-ldbl.h: Guard *_chk stuff with
	defined __extern_always_inline instead of !defined __cplusplus.
	* libio/bits/stdio-ldbl.h: Likewise.
	* wcsmbs/bits/wchar-ldbl.h: Likewise.
	* misc/bits/syslog.h (syslog): Don't define for C++.
	(vsyslog): Use __extern_always_inline function for C++ instead of
	a macro.
	* libio/bits/stdio.h (__STDIO_INLINE): Define to __extern_inline
	whenever that macro is defined.
	(vprintf): Don't provide the inline for C++.
	(fread_unlocked, fwrite_unlocked): Don't define the macros for C++.
	* libio/bits/stdio2.h (sprintf, snprintf, printf, fprintf): Don't
	define the macros for C++.
	(vsprintf, vsnprintf, vprintf, vfprintf): Define as
	__extern_always_inline functions for C++.
	* io/sys/stat.h (stat, lstat, fstat, fstatat, mknod, mknodat,
	stat64, lstat64, fstat64, fstatat64): Don't define if not
	__USE_EXTERN_INLINES.
	* wcsmbs/bits/wchar2.h: Fix #error message.
	(swprintf, wprintf, fwprintf): Don't define the macros for C++.
	(vswprintf, vwprintf, vfwprintf): Define using
	__extern_always_inline functions for C++.
	* string/bits/string3.h: Don't #undef macros if __cplusplus.
	(memcpy, memmove, mempcpy, memset, bcopy, bzero, strcpy, stpcpy,
	strncpy, strcat, strncat): Define as __extern_always_inline
	functions instead of macros for C++.
	* math/bits/cmathcalls.h: Guard __extern_inline routines with
	defined __extern_inline.
	* sysdeps/alpha/fpu/bits/mathinline.h (__MATH_INLINE): Define
	to __extern_inline whenever that macro is defined.
	* sysdeps/ia64/fpu/bits/mathinline.h (__MATH_INLINE): Likewise.
	* sysdeps/i386/fpu/bits/mathinline.h (__MATH_INLINE): Likewise.
	* sysdeps/i386/i486/bits/string.h (__STRING_INLINE): Likewise.
	* sysdeps/s390/bits/string.h (__STRING_INLINE): Likewise.
	* sysdeps/s390/fpu/bits/mathinline.h (__MATH_INLINE): Likewise.
	* sysdeps/powerpc/fpu/bits/mathinline.h (__MATH_INLINE): Likewise.
	* sysdeps/x86_64/fpu/bits/mathinline.h (__MATH_INLINE): Likewise.
	* sysdeps/sparc/fpu/bits/mathinline.h (__MATH_INLINE): Likewise.
	* sysdeps/unix/sysv/linux/sys/sysmacros.h (gnu_dev_major,
	gnu_dev_minor, gnu_dev_makedev): Remove __extern_inline from
	prototypes.  Only provide __extern_inline routines if
	__USE_EXTERN_INLINES.
	* debug/Makefile: Add rules to build and run tst-{,lfs}chk{4,5,6}
	tests.
	* debug/tst-chk1.c (do_prepare, do_test): Allow compilation as C++.
	For now avoid some *printf tests in C++.  Skip all testing
	if __USE_FORTIFY_LEVEL is defined, but __extern_always_inline macro
	is not.
	* debug/tst-chk4.cc: New file.
	* debug/tst-chk5.cc: New file.
	* debug/tst-chk6.cc: New file.
	* debug/tst-lfschk4.cc: New file.
	* debug/tst-lfschk5.cc: New file.
	* debug/tst-lfschk6.cc: New file.
	* include/wchar.h (__vfwprintf_chk, __vswprintf_chk): Avoid
	prototypes in C++.
	* include/stdio.h (__sprintf_chk, __snprintf_chk, __vsprintf_chk,
	__vsnprintf_chk, __printf_chk, __fprintf_chk, __vprintf_chk,
	__vfprintf_chk, __fgets_unlocked_chk, __fgets_chk): Likewise.
2007-09-15 02:38:04 +00:00
Ulrich Drepper d7e23b02a4 * nscd/connections.c: Use O_CLOEXEC is possible. Use mkostemp
instead of mkstemp.

	* misc/Makefile (routines): Add mkostemp and mkostemp64.
	* misc/Versions: Export mkostemp and mkostemp64 for GLIBC_2.7.
	* misc/mkostemp.c: New file.
	* misc/mkostemp64.c: New file.
	* stdlib/stdlib.h: Declare the new functions.
	* sysdeps/posix/tempname.c: Add new parameter which is added to
	the flags for open.  Remove __GT_BIGFILE handling.
	* stdio-common/tempname.c: Likewise.
	* include/stdio.h: Adjust __gen_tempname prototype.
	Renumber __GT_* constants.
	* libio/oldtmpfile.c: Adjust for __gen_tempname interface change.
	* misc/mkdtemp.c: Likewise.
	* misc/mkstemp.c: Likewise.
	* misc/mkstemp64.c: Likewise.
	* misc/mktemp.c: Likewise.
	* stdio-common/tempnam.c: Likewise.
	* stdio-common/tmpfile.c: Likewise.
	* stdio-common/tmpfile64.c: Likewise.
	* stdio-common/tmpnam.c: Likewise.
	* stdio-common/tmpnam_r.c: Likewise.
2007-08-11 02:48:28 +00:00
Ulrich Drepper d07d044e43 * misc/madvise.c: Add libc_hidden_def. 2007-04-19 17:42:47 +00:00