about summary refs log tree commit diff
path: root/posix
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2005-07-21 08:25:57 +0000
committerJakub Jelinek <jakub@redhat.com>2005-07-21 08:25:57 +0000
commit736e2ab430e006ba09a2fe34d7887d3812ac808f (patch)
treef2d5948776e91112fcfd9199a757cd58e1be867a /posix
parent366c71f353afc163b8d31c9db6e90919b5c2e1c0 (diff)
downloadglibc-736e2ab430e006ba09a2fe34d7887d3812ac808f.tar.gz
glibc-736e2ab430e006ba09a2fe34d7887d3812ac808f.tar.xz
glibc-736e2ab430e006ba09a2fe34d7887d3812ac808f.zip
Updated to fedora-glibc-20050721T0814
Diffstat (limited to 'posix')
-rw-r--r--posix/bits/unistd.h98
-rw-r--r--posix/getopt.c50
-rw-r--r--posix/regcomp.c4
3 files changed, 110 insertions, 42 deletions
diff --git a/posix/bits/unistd.h b/posix/bits/unistd.h
index cb82818ade..b6c756a9de 100644
--- a/posix/bits/unistd.h
+++ b/posix/bits/unistd.h
@@ -128,3 +128,101 @@ __NTH (getwd (char *__buf))
   return __getwd_alias (__buf);
 }
 #endif
+
+extern size_t __confstr_chk (int __name, char *__buf, size_t __len,
+			     size_t __buflen) __THROW;
+extern size_t __REDIRECT_NTH (__confstr_alias, (int __name, char *__buf,
+						size_t __len), confstr);
+
+extern __always_inline size_t
+confstr (int __name, char *__buf, size_t __len)
+{
+  if (__bos (__buf) != (size_t) -1
+      && (!__builtin_constant_p (__len) || __bos (__buf) < __len))
+    return __confstr_chk (__name, __buf, __len, __bos (__buf));
+  return __confstr_alias (__name, __buf, __len);
+}
+
+
+extern int __getgroups_chk (int __size, __gid_t __list[], size_t listlen)
+     __THROW __wur;
+extern int __REDIRECT_NTH (__getgroups_alias, (int __size, __gid_t __list[]),
+			   getgroups) __wur;
+
+extern __always_inline int
+getgroups (int __size, __gid_t __list[])
+{
+  if (__bos (__list) != (size_t) -1
+      && (!__builtin_constant_p (__size)
+	  || __size * sizeof (__gid_t) > __bos (__list)))
+    return __getgroups_chk (__size, __list, __bos (__list));
+  return __getgroups_alias (__size, __list);
+}
+
+
+extern int __ttyname_r_chk (int __fd, char *__buf, size_t __buflen,
+			    size_t __nreal) __THROW __nonnull ((2));
+extern int __REDIRECT_NTH (__ttyname_r_alias, (int __fd, char *__buf,
+					       size_t __buflen), ttyname_r)
+     __nonnull ((2));
+
+extern __always_inline int
+ttyname_r (int __fd, char *__buf, size_t __buflen)
+{
+  if (__bos (__buf) != (size_t) -1
+      && (!__builtin_constant_p (__buflen) || __buflen > __bos (__buf)))
+    return __ttyname_r_chk (__fd, __buf, __buflen, __bos (__buf));
+  return __ttyname_r_alias (__fd, __buf, __buflen);
+}
+
+
+#if defined __USE_REENTRANT || defined __USE_UNIX98
+extern int __getlogin_r_chk (char *__buf, size_t __buflen, size_t __nreal)
+     __nonnull ((1));
+extern int __REDIRECT (__getlogin_r_alias, (char *__buf, size_t __buflen),
+		       getlogin_r) __nonnull ((1));
+
+extern __always_inline int
+getlogin_r (char *__buf, size_t __buflen)
+{
+  if (__bos (__buf) != (size_t) -1
+      && (!__builtin_constant_p (__buflen) || __buflen > __bos (__buf)))
+    return __getlogin_r_chk (__buf, __buflen, __bos (__buf));
+  return __getlogin_r_alias (__buf, __buflen);
+}
+#endif
+
+
+#if defined __USE_BSD || defined __USE_UNIX98
+extern int __gethostname_chk (char *__buf, size_t __buflen, size_t __nreal)
+     __THROW __nonnull ((1));
+extern int __REDIRECT_NTH (__gethostname_alias, (char *__buf, size_t __buflen),
+			   gethostname) __nonnull ((1));
+
+extern __always_inline int
+gethostname (char *__buf, size_t __buflen)
+{
+  if (__bos (__buf) != (size_t) -1
+      && (!__builtin_constant_p (__buflen) || __buflen > __bos (__buf)))
+    return __gethostname_chk (__buf, __buflen, __bos (__buf));
+  return __gethostname_alias (__buf, __buflen);
+}
+#endif
+
+
+#if defined __USE_BSD || (defined __USE_XOPEN && !defined __USE_UNIX98)
+extern int __getdomainname_chk (char *__buf, size_t __buflen, size_t __nreal)
+     __THROW __nonnull ((1)) __wur;
+extern int __REDIRECT_NTH (__getdomainname_alias, (char *__buf,
+						   size_t __buflen),
+			   getdomainname) __nonnull ((1)) __wur;
+
+extern __always_inline int
+getdomainname (char *__buf, size_t __buflen)
+{
+  if (__bos (__buf) != (size_t) -1
+      && (!__builtin_constant_p (__buflen) || __buflen > __bos (__buf)))
+    return __getdomainname_chk (__buf, __buflen, __bos (__buf));
+  return __getdomainname_alias (__buf, __buflen);
+}
+#endif
diff --git a/posix/getopt.c b/posix/getopt.c
index 9ad13a4a92..b1cecd31aa 100644
--- a/posix/getopt.c
+++ b/posix/getopt.c
@@ -576,10 +576,7 @@ _getopt_internal_r (int argc, char *const *argv, const char *optstring,
 		  int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
 		  ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL;
 
-		  if (_IO_fwide (stderr, 0) > 0)
-		    __fwprintf (stderr, L"%s", buf);
-		  else
-		    fputs (buf, stderr);
+		  __fxprintf (NULL, "%s", buf);
 
 		  ((_IO_FILE *) stderr)->_flags2 = old_flags2;
 		  _IO_funlockfile (stderr);
@@ -654,10 +651,7 @@ _getopt_internal_r (int argc, char *const *argv, const char *optstring,
 			  ((_IO_FILE *) stderr)->_flags2
 			    |= _IO_FLAGS2_NOTCANCEL;
 
-			  if (_IO_fwide (stderr, 0) > 0)
-			    __fwprintf (stderr, L"%s", buf);
-			  else
-			    fputs (buf, stderr);
+			  __fxprintf (NULL, "%s", buf);
 
 			  ((_IO_FILE *) stderr)->_flags2 = old_flags2;
 			  _IO_funlockfile (stderr);
@@ -694,10 +688,7 @@ _getopt_internal_r (int argc, char *const *argv, const char *optstring,
 			  ((_IO_FILE *) stderr)->_flags2
 			    |= _IO_FLAGS2_NOTCANCEL;
 
-			  if (_IO_fwide (stderr, 0) > 0)
-			    __fwprintf (stderr, L"%s", buf);
-			  else
-			    fputs (buf, stderr);
+			  __fxprintf (NULL, "%s", buf);
 
 			  ((_IO_FILE *) stderr)->_flags2 = old_flags2;
 			  _IO_funlockfile (stderr);
@@ -771,10 +762,7 @@ _getopt_internal_r (int argc, char *const *argv, const char *optstring,
 		  int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
 		  ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL;
 
-		  if (_IO_fwide (stderr, 0) > 0)
-		    __fwprintf (stderr, L"%s", buf);
-		  else
-		    fputs (buf, stderr);
+		  __fxprintf (NULL, "%s", buf);
 
 		  ((_IO_FILE *) stderr)->_flags2 = old_flags2;
 		  _IO_funlockfile (stderr);
@@ -837,10 +825,7 @@ _getopt_internal_r (int argc, char *const *argv, const char *optstring,
 		int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
 		((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL;
 
-		if (_IO_fwide (stderr, 0) > 0)
-		  __fwprintf (stderr, L"%s", buf);
-		else
-		  fputs (buf, stderr);
+		__fxprintf (NULL, "%s", buf);
 
 		((_IO_FILE *) stderr)->_flags2 = old_flags2;
 		_IO_funlockfile (stderr);
@@ -888,10 +873,7 @@ _getopt_internal_r (int argc, char *const *argv, const char *optstring,
 		    int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
 		    ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL;
 
-		    if (_IO_fwide (stderr, 0) > 0)
-		      __fwprintf (stderr, L"%s", buf);
-		    else
-		      fputs (buf, stderr);
+		    __fxprintf (NULL, "%s", buf);
 
 		    ((_IO_FILE *) stderr)->_flags2 = old_flags2;
 		    _IO_funlockfile (stderr);
@@ -960,10 +942,7 @@ _getopt_internal_r (int argc, char *const *argv, const char *optstring,
 		    int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
 		    ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL;
 
-		    if (_IO_fwide (stderr, 0) > 0)
-		      __fwprintf (stderr, L"%s", buf);
-		    else
-		      fputs (buf, stderr);
+		    __fxprintf (NULL, "%s", buf);
 
 		    ((_IO_FILE *) stderr)->_flags2 = old_flags2;
 		    _IO_funlockfile (stderr);
@@ -1005,10 +984,7 @@ _getopt_internal_r (int argc, char *const *argv, const char *optstring,
 			    ((_IO_FILE *) stderr)->_flags2
 			      |= _IO_FLAGS2_NOTCANCEL;
 
-			    if (_IO_fwide (stderr, 0) > 0)
-			      __fwprintf (stderr, L"%s", buf);
-			    else
-			      fputs (buf, stderr);
+			    __fxprintf (NULL, "%s", buf);
 
 			    ((_IO_FILE *) stderr)->_flags2 = old_flags2;
 			    _IO_funlockfile (stderr);
@@ -1047,10 +1023,7 @@ _getopt_internal_r (int argc, char *const *argv, const char *optstring,
 			    ((_IO_FILE *) stderr)->_flags2
 			      |= _IO_FLAGS2_NOTCANCEL;
 
-			    if (_IO_fwide (stderr, 0) > 0)
-			      __fwprintf (stderr, L"%s", buf);
-			    else
-			      fputs (buf, stderr);
+			    __fxprintf (NULL, "%s", buf);
 
 			    ((_IO_FILE *) stderr)->_flags2 = old_flags2;
 			    _IO_funlockfile (stderr);
@@ -1121,10 +1094,7 @@ _getopt_internal_r (int argc, char *const *argv, const char *optstring,
 			int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
 			((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL;
 
-			if (_IO_fwide (stderr, 0) > 0)
-			  __fwprintf (stderr, L"%s", buf);
-			else
-			  fputs (buf, stderr);
+			__fxprintf (NULL, "%s", buf);
 
 			((_IO_FILE *) stderr)->_flags2 = old_flags2;
 			_IO_funlockfile (stderr);
diff --git a/posix/regcomp.c b/posix/regcomp.c
index 2053b024dc..37e06797ac 100644
--- a/posix/regcomp.c
+++ b/posix/regcomp.c
@@ -774,8 +774,6 @@ re_compile_internal (preg, pattern, length, syntax)
     }
   preg->used = sizeof (re_dfa_t);
 
-  __libc_lock_init (dfa->lock);
-
   err = init_dfa (dfa, length);
   if (BE (err != REG_NOERROR, 0))
     {
@@ -789,6 +787,8 @@ re_compile_internal (preg, pattern, length, syntax)
   strncpy (dfa->re_str, pattern, length + 1);
 #endif
 
+  __libc_lock_init (dfa->lock);
+
   err = re_string_construct (&regexp, pattern, length, preg->translate,
 			     syntax & RE_ICASE, dfa);
   if (BE (err != REG_NOERROR, 0))