* sysdeps/unix/sysv/linux/ulimit.c (__ulimit): Handle overflow in
	UL_SETFSIZE computations better.

	* string/Versions: Export __strsep for GLIBC_2.2.5.
	* string/bits/string2.h: Define all __STRING_INLINE functions if
	_FORCE_INLINES is defined.
	Use int instead of char of parameter types.
	(__strsep): Don't use __strsep_g.  Don't define it.
	(__strsep_1c, __strsep_2c, __strsep_3c): Optimize.
	* sysdeps/i386/i486/string.h (__strcpy_a_small): Renamed from
	__strcpy_small.
	(__stpcpy_a_small): Renamed from __stpcpy_small.
	(__strcspn_c1): Don't define if _FORCE_INLINES.
	(__strspn_c1): Likewise.

2001-09-22  Ben Collins  <bcollins@debian.org>

	* sysdeps/sparc/bits/sigaction.h: Define SA_RESTART and friends when
	_UNIX98_SOURCE is defined too.  Matches generic/bits/sigaction.h.
	* sysdeps/ia64/bits/sigaction.h: Likewise.
	* sysdeps/s390/s390-64/bits/sigaction.h: Likewise.

2001-09-24  Andrew Haley  <aph@cambridge.redhat.com>

	* sysdeps/unix/sysv/linux/sh/Makefile (sysdep_headers): Add sys/io.h.

2001-09-24  Jakub Jelinek  <jakub@redhat.com>

	* elf/dl-open.c (dl_open_worker): Update l_scope_max.

2001-09-24  Ulrich Drepper  <drepper@redhat.com>
This commit is contained in:
Ulrich Drepper 2001-09-25 03:04:41 +00:00
parent 8db6604d86
commit 61423e13e5
10 changed files with 167 additions and 108 deletions

View File

@ -1,3 +1,35 @@
2001-09-24 Ulrich Drepper <drepper@redhat.com>
* sysdeps/unix/sysv/linux/ulimit.c (__ulimit): Handle overflow in
UL_SETFSIZE computations better.
* string/Versions: Export __strsep for GLIBC_2.2.5.
* string/bits/string2.h: Define all __STRING_INLINE functions if
_FORCE_INLINES is defined.
Use int instead of char of parameter types.
(__strsep): Don't use __strsep_g. Don't define it.
(__strsep_1c, __strsep_2c, __strsep_3c): Optimize.
* sysdeps/i386/i486/string.h (__strcpy_a_small): Renamed from
__strcpy_small.
(__stpcpy_a_small): Renamed from __stpcpy_small.
(__strcspn_c1): Don't define if _FORCE_INLINES.
(__strspn_c1): Likewise.
2001-09-22 Ben Collins <bcollins@debian.org>
* sysdeps/sparc/bits/sigaction.h: Define SA_RESTART and friends when
_UNIX98_SOURCE is defined too. Matches generic/bits/sigaction.h.
* sysdeps/ia64/bits/sigaction.h: Likewise.
* sysdeps/s390/s390-64/bits/sigaction.h: Likewise.
2001-09-24 Andrew Haley <aph@cambridge.redhat.com>
* sysdeps/unix/sysv/linux/sh/Makefile (sysdep_headers): Add sys/io.h.
2001-09-24 Jakub Jelinek <jakub@redhat.com>
* elf/dl-open.c (dl_open_worker): Update l_scope_max.
2001-09-24 Ulrich Drepper <drepper@redhat.com> 2001-09-24 Ulrich Drepper <drepper@redhat.com>
* wcsmbs/wchar.h: Add __attribute_pure__ to mbsinit prototype. * wcsmbs/wchar.h: Add __attribute_pure__ to mbsinit prototype.

View File

@ -343,6 +343,8 @@ dl_open_worker (void *a)
N_("cannot create scope list")); N_("cannot create scope list"));
imap->l_scope = newp; imap->l_scope = newp;
} }
imap->l_scope_max = new_size;
} }
imap->l_scope[cnt++] = &new->l_searchlist; imap->l_scope[cnt++] = &new->l_searchlist;

View File

@ -73,4 +73,7 @@ libc {
# m* # m*
memrchr; memrchr;
} }
GLIBC_2.2.5 {
__strsep;
}
} }

View File

@ -196,6 +196,7 @@ __STRING2_COPY_TYPE (8);
/* Copy N bytes from SRC to DEST, returning pointer to byte following the /* Copy N bytes from SRC to DEST, returning pointer to byte following the
last copied. */ last copied. */
#ifdef __USE_GNU #ifdef __USE_GNU
# if !defined _HAVE_STRING_ARCH_mempcpy || defined _FORCE_INLINES
# ifndef _HAVE_STRING_ARCH_mempcpy # ifndef _HAVE_STRING_ARCH_mempcpy
# define __mempcpy(dest, src, n) \ # define __mempcpy(dest, src, n) \
(__extension__ (__builtin_constant_p (src) && __builtin_constant_p (n) \ (__extension__ (__builtin_constant_p (src) && __builtin_constant_p (n) \
@ -205,8 +206,10 @@ __STRING2_COPY_TYPE (8);
/* In glibc we use this function frequently but for namespace reasons /* In glibc we use this function frequently but for namespace reasons
we have to use the name `__mempcpy'. */ we have to use the name `__mempcpy'. */
# define mempcpy(dest, src, n) __mempcpy (dest, src, n) # define mempcpy(dest, src, n) __mempcpy (dest, src, n)
# endif
# if _STRING_ARCH_unaligned # if _STRING_ARCH_unaligned
# ifndef _FORCE_INLINES
# define __mempcpy_args(src) \ # define __mempcpy_args(src) \
((__const char *) (src))[0], ((__const char *) (src))[2], \ ((__const char *) (src))[0], ((__const char *) (src))[2], \
((__const char *) (src))[4], ((__const char *) (src))[6], \ ((__const char *) (src))[4], ((__const char *) (src))[6], \
@ -214,6 +217,7 @@ __STRING2_COPY_TYPE (8);
__extension__ __STRING2_SMALL_GET16 (src, 4), \ __extension__ __STRING2_SMALL_GET16 (src, 4), \
__extension__ __STRING2_SMALL_GET32 (src, 0), \ __extension__ __STRING2_SMALL_GET32 (src, 0), \
__extension__ __STRING2_SMALL_GET32 (src, 4) __extension__ __STRING2_SMALL_GET32 (src, 4)
# endif
__STRING_INLINE void *__mempcpy_small (void *, char, char, char, char, __STRING_INLINE void *__mempcpy_small (void *, char, char, char, char,
__uint16_t, __uint16_t, __uint32_t, __uint16_t, __uint16_t, __uint32_t,
__uint32_t, size_t); __uint32_t, size_t);
@ -280,6 +284,7 @@ __mempcpy_small (void *__dest1,
return (void *) __u; return (void *) __u;
} }
# else # else
# ifndef _FORCE_INLINES
# define __mempcpy_args(src) \ # define __mempcpy_args(src) \
((__const char *) (src))[0], \ ((__const char *) (src))[0], \
__extension__ ((__STRING2_COPY_ARR2) \ __extension__ ((__STRING2_COPY_ARR2) \
@ -308,6 +313,7 @@ __mempcpy_small (void *__dest1,
((__const char *) (src))[2], ((__const char *) (src))[3], \ ((__const char *) (src))[2], ((__const char *) (src))[3], \
((__const char *) (src))[4], ((__const char *) (src))[5], \ ((__const char *) (src))[4], ((__const char *) (src))[5], \
((__const char *) (src))[6], ((__const char *) (src))[7] } }) ((__const char *) (src))[6], ((__const char *) (src))[7] } })
# endif
__STRING_INLINE void *__mempcpy_small (void *, char, __STRING2_COPY_ARR2, __STRING_INLINE void *__mempcpy_small (void *, char, __STRING2_COPY_ARR2,
__STRING2_COPY_ARR3, __STRING2_COPY_ARR3,
__STRING2_COPY_ARR4, __STRING2_COPY_ARR4,
@ -377,7 +383,8 @@ extern void *__rawmemchr (const void *__s, int __c);
/* Copy SRC to DEST. */ /* Copy SRC to DEST. */
#ifndef _HAVE_STRING_ARCH_strcpy #if !defined _HAVE_STRING_ARCH_strcpy || defined _FORCE_INLINES
# ifndef _HAVE_STRING_ARCH_strcpy
# define strcpy(dest, src) \ # define strcpy(dest, src) \
(__extension__ (__builtin_constant_p (src) \ (__extension__ (__builtin_constant_p (src) \
? (__string2_1bptr_p (src) && strlen (src) + 1 <= 8 \ ? (__string2_1bptr_p (src) && strlen (src) + 1 <= 8 \
@ -385,13 +392,16 @@ extern void *__rawmemchr (const void *__s, int __c);
strlen (src) + 1) \ strlen (src) + 1) \
: (char *) memcpy (dest, src, strlen (src) + 1)) \ : (char *) memcpy (dest, src, strlen (src) + 1)) \
: strcpy (dest, src))) : strcpy (dest, src)))
# endif
# if _STRING_ARCH_unaligned # if _STRING_ARCH_unaligned
# ifndef _FORCE_INLINES
# define __strcpy_args(src) \ # define __strcpy_args(src) \
__extension__ __STRING2_SMALL_GET16 (src, 0), \ __extension__ __STRING2_SMALL_GET16 (src, 0), \
__extension__ __STRING2_SMALL_GET16 (src, 4), \ __extension__ __STRING2_SMALL_GET16 (src, 4), \
__extension__ __STRING2_SMALL_GET32 (src, 0), \ __extension__ __STRING2_SMALL_GET32 (src, 0), \
__extension__ __STRING2_SMALL_GET32 (src, 4) __extension__ __STRING2_SMALL_GET32 (src, 4)
# endif
__STRING_INLINE char *__strcpy_small (char *, __uint16_t, __uint16_t, __STRING_INLINE char *__strcpy_small (char *, __uint16_t, __uint16_t,
__uint32_t, __uint32_t, size_t); __uint32_t, __uint32_t, size_t);
__STRING_INLINE char * __STRING_INLINE char *
@ -447,6 +457,7 @@ __strcpy_small (char *__dest,
return __dest; return __dest;
} }
# else # else
# ifndef _FORCE_INLINES
# define __strcpy_args(src) \ # define __strcpy_args(src) \
__extension__ ((__STRING2_COPY_ARR2) \ __extension__ ((__STRING2_COPY_ARR2) \
{ { ((__const char *) (src))[0], '\0' } }), \ { { ((__const char *) (src))[0], '\0' } }), \
@ -474,6 +485,7 @@ __strcpy_small (char *__dest,
((__const char *) (src))[2], ((__const char *) (src))[3], \ ((__const char *) (src))[2], ((__const char *) (src))[3], \
((__const char *) (src))[4], ((__const char *) (src))[5], \ ((__const char *) (src))[4], ((__const char *) (src))[5], \
((__const char *) (src))[6], '\0' } }) ((__const char *) (src))[6], '\0' } })
# endif
__STRING_INLINE char *__strcpy_small (char *, __STRING2_COPY_ARR2, __STRING_INLINE char *__strcpy_small (char *, __STRING2_COPY_ARR2,
__STRING2_COPY_ARR3, __STRING2_COPY_ARR3,
__STRING2_COPY_ARR4, __STRING2_COPY_ARR4,
@ -533,6 +545,7 @@ __strcpy_small (char *__dest,
/* Copy SRC to DEST, returning pointer to final NUL byte. */ /* Copy SRC to DEST, returning pointer to final NUL byte. */
#ifdef __USE_GNU #ifdef __USE_GNU
# if !defined _HAVE_STRING_ARCH_stpcpy || defined _FORCE_INLINES
# ifndef _HAVE_STRING_ARCH_stpcpy # ifndef _HAVE_STRING_ARCH_stpcpy
# define __stpcpy(dest, src) \ # define __stpcpy(dest, src) \
(__extension__ (__builtin_constant_p (src) \ (__extension__ (__builtin_constant_p (src) \
@ -544,13 +557,16 @@ __strcpy_small (char *__dest,
/* In glibc we use this function frequently but for namespace reasons /* In glibc we use this function frequently but for namespace reasons
we have to use the name `__stpcpy'. */ we have to use the name `__stpcpy'. */
# define stpcpy(dest, src) __stpcpy (dest, src) # define stpcpy(dest, src) __stpcpy (dest, src)
# endif
# if _STRING_ARCH_unaligned # if _STRING_ARCH_unaligned
# ifndef _FORCE_INLINES
# define __stpcpy_args(src) \ # define __stpcpy_args(src) \
__extension__ __STRING2_SMALL_GET16 (src, 0), \ __extension__ __STRING2_SMALL_GET16 (src, 0), \
__extension__ __STRING2_SMALL_GET16 (src, 4), \ __extension__ __STRING2_SMALL_GET16 (src, 4), \
__extension__ __STRING2_SMALL_GET32 (src, 0), \ __extension__ __STRING2_SMALL_GET32 (src, 0), \
__extension__ __STRING2_SMALL_GET32 (src, 4) __extension__ __STRING2_SMALL_GET32 (src, 4)
# endif
__STRING_INLINE char *__stpcpy_small (char *, __uint16_t, __uint16_t, __STRING_INLINE char *__stpcpy_small (char *, __uint16_t, __uint16_t,
__uint32_t, __uint32_t, size_t); __uint32_t, __uint32_t, size_t);
__STRING_INLINE char * __STRING_INLINE char *
@ -611,6 +627,7 @@ __stpcpy_small (char *__dest,
return &__u->__c; return &__u->__c;
} }
# else # else
# ifndef _FORCE_INLINES
# define __stpcpy_args(src) \ # define __stpcpy_args(src) \
__extension__ ((__STRING2_COPY_ARR2) \ __extension__ ((__STRING2_COPY_ARR2) \
{ { ((__const char *) (src))[0], '\0' } }), \ { { ((__const char *) (src))[0], '\0' } }), \
@ -638,6 +655,7 @@ __stpcpy_small (char *__dest,
((__const char *) (src))[2], ((__const char *) (src))[3], \ ((__const char *) (src))[2], ((__const char *) (src))[3], \
((__const char *) (src))[4], ((__const char *) (src))[5], \ ((__const char *) (src))[4], ((__const char *) (src))[5], \
((__const char *) (src))[6], '\0' } }) ((__const char *) (src))[6], '\0' } })
# endif
__STRING_INLINE char *__stpcpy_small (char *, __STRING2_COPY_ARR2, __STRING_INLINE char *__stpcpy_small (char *, __STRING2_COPY_ARR2,
__STRING2_COPY_ARR3, __STRING2_COPY_ARR3,
__STRING2_COPY_ARR4, __STRING2_COPY_ARR4,
@ -854,7 +872,8 @@ __stpcpy_small (char *__dest,
/* Return the length of the initial segment of S which /* Return the length of the initial segment of S which
consists entirely of characters not in REJECT. */ consists entirely of characters not in REJECT. */
#ifndef _HAVE_STRING_ARCH_strcspn #if !defined _HAVE_STRING_ARCH_strcspn || defined _FORCE_INLINES
# ifndef _HAVE_STRING_ARCH_strcspn
# define strcspn(s, reject) \ # define strcspn(s, reject) \
__extension__ \ __extension__ \
({ char __r0, __r1, __r2; \ ({ char __r0, __r1, __r2; \
@ -869,10 +888,11 @@ __stpcpy_small (char *__dest,
? __strcspn_c3 (s, __r0, __r1, __r2) \ ? __strcspn_c3 (s, __r0, __r1, __r2) \
: strcspn (s, reject))))) \ : strcspn (s, reject))))) \
: strcspn (s, reject)); }) : strcspn (s, reject)); })
# endif
__STRING_INLINE size_t __strcspn_c1 (__const char *__s, char __reject); __STRING_INLINE size_t __strcspn_c1 (__const char *__s, int __reject);
__STRING_INLINE size_t __STRING_INLINE size_t
__strcspn_c1 (__const char *__s, char __reject) __strcspn_c1 (__const char *__s, int __reject)
{ {
register size_t __result = 0; register size_t __result = 0;
while (__s[__result] != '\0' && __s[__result] != __reject) while (__s[__result] != '\0' && __s[__result] != __reject)
@ -880,10 +900,10 @@ __strcspn_c1 (__const char *__s, char __reject)
return __result; return __result;
} }
__STRING_INLINE size_t __strcspn_c2 (__const char *__s, char __reject1, __STRING_INLINE size_t __strcspn_c2 (__const char *__s, int __reject1,
char __reject2); int __reject2);
__STRING_INLINE size_t __STRING_INLINE size_t
__strcspn_c2 (__const char *__s, char __reject1, char __reject2) __strcspn_c2 (__const char *__s, int __reject1, int __reject2)
{ {
register size_t __result = 0; register size_t __result = 0;
while (__s[__result] != '\0' && __s[__result] != __reject1 while (__s[__result] != '\0' && __s[__result] != __reject1
@ -892,11 +912,11 @@ __strcspn_c2 (__const char *__s, char __reject1, char __reject2)
return __result; return __result;
} }
__STRING_INLINE size_t __strcspn_c3 (__const char *__s, char __reject1, __STRING_INLINE size_t __strcspn_c3 (__const char *__s, int __reject1,
char __reject2, char __reject3); int __reject2, int __reject3);
__STRING_INLINE size_t __STRING_INLINE size_t
__strcspn_c3 (__const char *__s, char __reject1, char __reject2, __strcspn_c3 (__const char *__s, int __reject1, int __reject2,
char __reject3) int __reject3)
{ {
register size_t __result = 0; register size_t __result = 0;
while (__s[__result] != '\0' && __s[__result] != __reject1 while (__s[__result] != '\0' && __s[__result] != __reject1
@ -909,7 +929,8 @@ __strcspn_c3 (__const char *__s, char __reject1, char __reject2,
/* Return the length of the initial segment of S which /* Return the length of the initial segment of S which
consists entirely of characters in ACCEPT. */ consists entirely of characters in ACCEPT. */
#ifndef _HAVE_STRING_ARCH_strspn #if !defined _HAVE_STRING_ARCH_strspn || defined _FORCE_INLINES
# ifndef _HAVE_STRING_ARCH_strspn
# define strspn(s, accept) \ # define strspn(s, accept) \
__extension__ \ __extension__ \
({ char __a0, __a1, __a2; \ ({ char __a0, __a1, __a2; \
@ -924,10 +945,11 @@ __strcspn_c3 (__const char *__s, char __reject1, char __reject2,
? __strspn_c3 (s, __a0, __a1, __a2) \ ? __strspn_c3 (s, __a0, __a1, __a2) \
: strspn (s, accept))))) \ : strspn (s, accept))))) \
: strspn (s, accept)); }) : strspn (s, accept)); })
# endif
__STRING_INLINE size_t __strspn_c1 (__const char *__s, char __accept); __STRING_INLINE size_t __strspn_c1 (__const char *__s, int __accept);
__STRING_INLINE size_t __STRING_INLINE size_t
__strspn_c1 (__const char *__s, char __accept) __strspn_c1 (__const char *__s, int __accept)
{ {
register size_t __result = 0; register size_t __result = 0;
/* Please note that __accept never can be '\0'. */ /* Please note that __accept never can be '\0'. */
@ -936,10 +958,10 @@ __strspn_c1 (__const char *__s, char __accept)
return __result; return __result;
} }
__STRING_INLINE size_t __strspn_c2 (__const char *__s, char __accept1, __STRING_INLINE size_t __strspn_c2 (__const char *__s, int __accept1,
char __accept2); int __accept2);
__STRING_INLINE size_t __STRING_INLINE size_t
__strspn_c2 (__const char *__s, char __accept1, char __accept2) __strspn_c2 (__const char *__s, int __accept1, int __accept2)
{ {
register size_t __result = 0; register size_t __result = 0;
/* Please note that __accept1 and __accept2 never can be '\0'. */ /* Please note that __accept1 and __accept2 never can be '\0'. */
@ -948,10 +970,10 @@ __strspn_c2 (__const char *__s, char __accept1, char __accept2)
return __result; return __result;
} }
__STRING_INLINE size_t __strspn_c3 (__const char *__s, char __accept1, __STRING_INLINE size_t __strspn_c3 (__const char *__s, int __accept1,
char __accept2, char __accept3); int __accept2, int __accept3);
__STRING_INLINE size_t __STRING_INLINE size_t
__strspn_c3 (__const char *__s, char __accept1, char __accept2, char __accept3) __strspn_c3 (__const char *__s, int __accept1, int __accept2, int __accept3)
{ {
register size_t __result = 0; register size_t __result = 0;
/* Please note that __accept1 to __accept3 never can be '\0'. */ /* Please note that __accept1 to __accept3 never can be '\0'. */
@ -964,7 +986,8 @@ __strspn_c3 (__const char *__s, char __accept1, char __accept2, char __accept3)
/* Find the first occurrence in S of any character in ACCEPT. */ /* Find the first occurrence in S of any character in ACCEPT. */
#ifndef _HAVE_STRING_ARCH_strpbrk #if !defined _HAVE_STRING_ARCH_strpbrk || defined _FORCE_INLINES
# ifndef _HAVE_STRING_ARCH_strpbrk
# define strpbrk(s, accept) \ # define strpbrk(s, accept) \
__extension__ \ __extension__ \
({ char __a0, __a1, __a2; \ ({ char __a0, __a1, __a2; \
@ -979,6 +1002,7 @@ __strspn_c3 (__const char *__s, char __accept1, char __accept2, char __accept3)
? __strpbrk_c3 (s, __a0, __a1, __a2) \ ? __strpbrk_c3 (s, __a0, __a1, __a2) \
: strpbrk (s, accept))))) \ : strpbrk (s, accept))))) \
: strpbrk (s, accept)); }) : strpbrk (s, accept)); })
# endif
__STRING_INLINE char *__strpbrk_c2 (__const char *__s, int __accept1, __STRING_INLINE char *__strpbrk_c2 (__const char *__s, int __accept1,
int __accept2); int __accept2);
@ -1021,7 +1045,8 @@ __strpbrk_c3 (__const char *__s, int __accept1, int __accept2,
#endif #endif
#ifndef _HAVE_STRING_ARCH_strtok_r #if !defined _HAVE_STRING_ARCH_strtok_r || defined _FORCE_INLINES
# ifndef _HAVE_STRING_ARCH_strtok_r
# define __strtok_r(s, sep, nextp) \ # define __strtok_r(s, sep, nextp) \
(__extension__ (__builtin_constant_p (sep) && __string2_1bptr_p (sep) \ (__extension__ (__builtin_constant_p (sep) && __string2_1bptr_p (sep) \
? (((__const char *) (sep))[0] != '\0' \ ? (((__const char *) (sep))[0] != '\0' \
@ -1029,6 +1054,7 @@ __strpbrk_c3 (__const char *__s, int __accept1, int __accept2,
? __strtok_r_1c (s, ((__const char *) (sep))[0], nextp) \ ? __strtok_r_1c (s, ((__const char *) (sep))[0], nextp) \
: __strtok_r (s, sep, nextp)) \ : __strtok_r (s, sep, nextp)) \
: __strtok_r (s, sep, nextp))) : __strtok_r (s, sep, nextp)))
# endif
__STRING_INLINE char *__strtok_r_1c (char *__s, char __sep, char **__nextp); __STRING_INLINE char *__strtok_r_1c (char *__s, char __sep, char **__nextp);
__STRING_INLINE char * __STRING_INLINE char *
@ -1039,11 +1065,10 @@ __strtok_r_1c (char *__s, char __sep, char **__nextp)
__s = *__nextp; __s = *__nextp;
while (*__s == __sep) while (*__s == __sep)
++__s; ++__s;
if (*__s == '\0')
__result = NULL; __result = NULL;
else if (*__s != '\0')
{ {
__result = __s; __result = __s++;
while (*__s != '\0') while (*__s != '\0')
if (*__s++ == __sep) if (*__s++ == __sep)
{ {
@ -1055,13 +1080,13 @@ __strtok_r_1c (char *__s, char __sep, char **__nextp)
return __result; return __result;
} }
# if defined __USE_POSIX || defined __USE_MISC # if defined __USE_POSIX || defined __USE_MISC
# define strtok_r(s, sep, nextp) __strtok_r ((s), (sep), (nextp)) # define strtok_r(s, sep, nextp) __strtok_r (s, sep, nextp)
# endif # endif
#endif #endif
#ifndef _HAVE_STRING_ARCH_strsep #if !defined _HAVE_STRING_ARCH_strsep || defined _FORCE_INLINES
# ifndef _HAVE_STRING_ARCH_strsep
# define __strsep(s, reject) \ # define __strsep(s, reject) \
__extension__ \ __extension__ \
({ char __r0, __r1, __r2; \ ({ char __r0, __r1, __r2; \
@ -1075,23 +1100,17 @@ __strtok_r_1c (char *__s, char __sep, char **__nextp)
? __strsep_2c (s, __r0, __r1) \ ? __strsep_2c (s, __r0, __r1) \
: (((__const char *) (reject))[3] == '\0' \ : (((__const char *) (reject))[3] == '\0' \
? __strsep_3c (s, __r0, __r1, __r2) \ ? __strsep_3c (s, __r0, __r1, __r2) \
: __strsep_g (s, reject)))) \ : __strsep (s, reject)))) \
: __strsep_g (s, reject)); }) : __strsep (s, reject)); })
# endif
__STRING_INLINE char *__strsep_1c (char **__s, char __reject); __STRING_INLINE char *__strsep_1c (char **__s, char __reject);
__STRING_INLINE char * __STRING_INLINE char *
__strsep_1c (char **__s, char __reject) __strsep_1c (char **__s, char __reject)
{ {
register char *__retval = *__s; register char *__retval = *__s;
if (__retval == NULL) if (__retval != NULL && (*__s = strchr (__retval, __reject)) != NULL)
return *__s = NULL;
if (*__retval == __reject)
*(*__s)++ = '\0'; *(*__s)++ = '\0';
else
if ((*__s = strchr (__retval, __reject)) != NULL)
*(*__s)++ = '\0';
else
*__s = NULL;
return __retval; return __retval;
} }
@ -1100,22 +1119,24 @@ __STRING_INLINE char *
__strsep_2c (char **__s, char __reject1, char __reject2) __strsep_2c (char **__s, char __reject1, char __reject2)
{ {
register char *__retval = *__s; register char *__retval = *__s;
if (__retval == NULL) if (__retval != NULL)
return *__s = NULL;
if (*__retval == __reject1 || *__retval == __reject2)
*(*__s)++ = '\0';
else
{ {
register char *__cp = __retval; register char *__cp = __retval;
while (*__cp != '\0' && *__cp != __reject1 && *__cp != __reject2) while (1)
++__cp;
if (*__cp != '\0')
{ {
*__s = __cp; if (*__cp == '\0')
*(*__s)++ = '\0'; {
__cp = NULL;
break;
} }
else if (*__cp == __reject1 || *__cp == __reject2)
*__s = NULL; {
*__cp++ = '\0';
break;
}
++__cp;
}
*__s = __cp;
} }
return __retval; return __retval;
} }
@ -1126,41 +1147,29 @@ __STRING_INLINE char *
__strsep_3c (char **__s, char __reject1, char __reject2, char __reject3) __strsep_3c (char **__s, char __reject1, char __reject2, char __reject3)
{ {
register char *__retval = *__s; register char *__retval = *__s;
if (__retval == NULL) if (__retval != NULL)
return *__s = NULL;
if (*__retval == __reject1 || *__retval == __reject2
|| *__retval == __reject3)
*(*__s)++ = '\0';
else
{ {
register char *__cp = __retval; register char *__cp = __retval;
while (*__cp != '\0' && *__cp != __reject1 && *__cp != __reject2 while (1)
&& *__cp != __reject3)
++__cp;
if (*__cp != '\0')
{ {
if (*__cp == '\0')
{
__cp = NULL;
break;
}
if (*__cp == __reject1 || *__cp == __reject2 || *__cp == __reject3)
{
*__cp++ = '\0';
break;
}
++__cp;
}
*__s = __cp; *__s = __cp;
*(*__s)++ = '\0';
} }
else
*__s = NULL;
}
return __retval;
}
__STRING_INLINE char *__strsep_g (char **__s, __const char *__reject);
__STRING_INLINE char *
__strsep_g (char **__s, __const char *__reject)
{
register char *__retval = *__s;
if (__retval == NULL)
return NULL;
if ((*__s = strpbrk (__retval, __reject)) != NULL)
*(*__s)++ = '\0';
return __retval; return __retval;
} }
# ifdef __USE_BSD # ifdef __USE_BSD
# define strsep(s, reject) __strsep ((s), (reject)) # define strsep(s, reject) __strsep (s, reject)
# endif # endif
#endif #endif
@ -1214,10 +1223,10 @@ extern char *__strndup (__const char *__string, size_t __n)
__len - 1); \ __len - 1); \
} \ } \
__retval; })) \ __retval; })) \
: __strndup ((s), (n)))) : __strndup (s, n)))
# ifdef __USE_GNU # ifdef __USE_GNU
# define strndup(s, n) __strndup ((s), (n)) # define strndup(s, n) __strndup (s, n)
# endif # endif
# endif # endif

View File

@ -545,13 +545,13 @@ __strlen_g (__const char *__str)
#define strcpy(dest, src) \ #define strcpy(dest, src) \
(__extension__ (__builtin_constant_p (src) \ (__extension__ (__builtin_constant_p (src) \
? (sizeof ((src)[0]) == 1 && strlen (src) + 1 <= 8 \ ? (sizeof ((src)[0]) == 1 && strlen (src) + 1 <= 8 \
? __strcpy_small (dest, src, strlen (src) + 1) \ ? __strcpy_a_small (dest, src, strlen (src) + 1) \
: (char *) memcpy ((char *) dest, \ : (char *) memcpy ((char *) dest, \
(__const char *) src, \ (__const char *) src, \
strlen (src) + 1)) \ strlen (src) + 1)) \
: __strcpy_g (dest, src))) : __strcpy_g (dest, src)))
#define __strcpy_small(dest, src, srclen) \ #define __strcpy_a_small(dest, src, srclen) \
(__extension__ ({ char *__dest = (dest); \ (__extension__ ({ char *__dest = (dest); \
union { \ union { \
unsigned int __ui; \ unsigned int __ui; \
@ -629,7 +629,7 @@ __strcpy_g (char *__dest, __const char *__src)
# define __stpcpy(dest, src) \ # define __stpcpy(dest, src) \
(__extension__ (__builtin_constant_p (src) \ (__extension__ (__builtin_constant_p (src) \
? (strlen (src) + 1 <= 8 \ ? (strlen (src) + 1 <= 8 \
? __stpcpy_small (dest, src, strlen (src) + 1) \ ? __stpcpy_a_small (dest, src, strlen (src) + 1) \
: __stpcpy_c (dest, src, strlen (src) + 1)) \ : __stpcpy_c (dest, src, strlen (src) + 1)) \
: __stpcpy_g (dest, src))) : __stpcpy_g (dest, src)))
# define __stpcpy_c(dest, src, srclen) \ # define __stpcpy_c(dest, src, srclen) \
@ -642,7 +642,7 @@ __strcpy_g (char *__dest, __const char *__src)
/* In glibc itself we use this symbol for namespace reasons. */ /* In glibc itself we use this symbol for namespace reasons. */
# define stpcpy(dest, src) __stpcpy (dest, src) # define stpcpy(dest, src) __stpcpy (dest, src)
# define __stpcpy_small(dest, src, srclen) \ # define __stpcpy_a_small(dest, src, srclen) \
(__extension__ ({ union { \ (__extension__ ({ union { \
unsigned int __ui; \ unsigned int __ui; \
unsigned short int __usi; \ unsigned short int __usi; \
@ -1441,6 +1441,7 @@ __strrchr_g (__const char *__s, int __c)
__STRING_INLINE size_t __strcspn_c1 (__const char *__s, int __reject); __STRING_INLINE size_t __strcspn_c1 (__const char *__s, int __reject);
#ifndef _FORCE_INLINES
__STRING_INLINE size_t __STRING_INLINE size_t
__strcspn_c1 (__const char *__s, int __reject) __strcspn_c1 (__const char *__s, int __reject)
{ {
@ -1460,6 +1461,7 @@ __strcspn_c1 (__const char *__s, int __reject)
: "cc"); : "cc");
return (__res - 1) - __s; return (__res - 1) - __s;
} }
#endif
__STRING_INLINE size_t __strcspn_cg (__const char *__s, __const char __reject[], __STRING_INLINE size_t __strcspn_cg (__const char *__s, __const char __reject[],
size_t __reject_len); size_t __reject_len);
@ -1556,6 +1558,7 @@ __strcspn_g (__const char *__s, __const char *__reject)
: __strspn_cg (s, accept, strlen (accept)))) \ : __strspn_cg (s, accept, strlen (accept)))) \
: __strspn_g (s, accept))) : __strspn_g (s, accept)))
#ifndef _FORCE_INLINES
__STRING_INLINE size_t __strspn_c1 (__const char *__s, int __accept); __STRING_INLINE size_t __strspn_c1 (__const char *__s, int __accept);
__STRING_INLINE size_t __STRING_INLINE size_t
@ -1575,6 +1578,7 @@ __strspn_c1 (__const char *__s, int __accept)
: "cc"); : "cc");
return (__res - 1) - __s; return (__res - 1) - __s;
} }
#endif
__STRING_INLINE size_t __strspn_cg (__const char *__s, __const char __accept[], __STRING_INLINE size_t __strspn_cg (__const char *__s, __const char __accept[],
size_t __accept_len); size_t __accept_len);

View File

@ -50,7 +50,7 @@ struct sigaction
/* Bits in `sa_flags'. */ /* Bits in `sa_flags'. */
#define SA_NOCLDSTOP 0x00000001 /* Don't send SIGCHLD when children stop. */ #define SA_NOCLDSTOP 0x00000001 /* Don't send SIGCHLD when children stop. */
#define SA_SIGINFO 0x00000004 #define SA_SIGINFO 0x00000004
#ifdef __USE_MISC #if defined __USE_UNIX98 || defined __USE_MISC
# define SA_ONSTACK 0x08000000 /* Use signal stack by using `sa_restorer'. */ # define SA_ONSTACK 0x08000000 /* Use signal stack by using `sa_restorer'. */
# define SA_RESTART 0x10000000 /* Restart syscall on signal return. */ # define SA_RESTART 0x10000000 /* Restart syscall on signal return. */
# define SA_NODEFER 0x40000000 /* Don't automatically block the signal # define SA_NODEFER 0x40000000 /* Don't automatically block the signal

View File

@ -53,7 +53,7 @@ struct sigaction
/* Bits in `sa_flags'. */ /* Bits in `sa_flags'. */
#define SA_NOCLDSTOP 0x00000001 /* Don't send SIGCHLD when children stop. */ #define SA_NOCLDSTOP 0x00000001 /* Don't send SIGCHLD when children stop. */
#define SA_SIGINFO 0x00000004 #define SA_SIGINFO 0x00000004
#ifdef __USE_MISC #if defined __USE_UNIX98 || defined __USE_MISC
# define SA_ONSTACK 0x08000000 /* Use signal stack by using `sa_restorer'. */ # define SA_ONSTACK 0x08000000 /* Use signal stack by using `sa_restorer'. */
# define SA_RESTART 0x10000000 /* Restart syscall on signal return. */ # define SA_RESTART 0x10000000 /* Restart syscall on signal return. */
# define SA_NODEFER 0x40000000 /* Don't automatically block the signal # define SA_NODEFER 0x40000000 /* Don't automatically block the signal

View File

@ -4,6 +4,7 @@ endif
ifeq ($(subdir),misc) ifeq ($(subdir),misc)
sysdep_routines += setfsgid setfsuid setresgid setresuid sysdep_routines += setfsgid setfsuid setresgid setresuid
sysdep_headers += sys/io.h
endif endif
ifeq ($(subdir),signal) ifeq ($(subdir),signal)

View File

@ -56,7 +56,7 @@ struct sigaction
#define SA_NOCLDWAIT 0x00000100 /* Don't create zombie on child death. */ #define SA_NOCLDWAIT 0x00000100 /* Don't create zombie on child death. */
#define SA_SIGINFO 0x00000200 /* Invoke signal-catching function with #define SA_SIGINFO 0x00000200 /* Invoke signal-catching function with
three arguments instead of one. */ three arguments instead of one. */
#ifdef __USE_MISC #if defined __USE_UNIX98 || defined __USE_MISC
# define SA_ONSTACK 0x00000001 /* Use signal stack by using `sa_restorer'. */ # define SA_ONSTACK 0x00000001 /* Use signal stack by using `sa_restorer'. */
# define SA_RESTART 0x00000002 /* Restart syscall on signal return. */ # define SA_RESTART 0x00000002 /* Restart syscall on signal return. */
# define SA_INTERRUPT 0x00000010 /* Historical no-op. */ # define SA_INTERRUPT 0x00000010 /* Historical no-op. */

View File

@ -1,4 +1,4 @@
/* Copyright (C) 1991,92,94,95,96,97,98,2000 Free Software Foundation, Inc. /* Copyright (C) 1991,92,1994-1998,2000,2001 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 The GNU C Library is free software; you can redistribute it and/or
@ -55,8 +55,16 @@ __ulimit (int cmd, ...)
{ {
long int newlimit = va_arg (va, long int); long int newlimit = va_arg (va, long int);
if ((rlim_t) newlimit > RLIM_INFINITY / 512)
{
limit.rlim_cur = RLIM_INFINITY;
limit.rlim_max = RLIM_INFINITY;
}
else
{
limit.rlim_cur = newlimit * 512; limit.rlim_cur = newlimit * 512;
limit.rlim_max = newlimit * 512; limit.rlim_max = newlimit * 512;
}
result = __setrlimit (RLIMIT_FSIZE, &limit); result = __setrlimit (RLIMIT_FSIZE, &limit);
} }