OSDN Git Service

LDP: Update original to LDP v3.79
[linuxjm/LDP_man-pages.git] / original / man3 / strstr.3
index 56ddc90..7bb5a6a 100644 (file)
@@ -1,5 +1,6 @@
 .\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk)
 .\"
+.\" %%%LICENSE_START(VERBATIM)
 .\" Permission is granted to make and distribute verbatim copies of this
 .\" manual provided the copyright notice and this permission notice are
 .\" preserved on all copies.
@@ -19,6 +20,7 @@
 .\"
 .\" Formatted or processed versions of this manual, if unaccompanied by
 .\" the source, must acknowledge the copyright and authors of this work.
+.\" %%%LICENSE_END
 .\"
 .\" References consulted:
 .\"     Linux libc source code
@@ -28,7 +30,7 @@
 .\" Added history, aeb, 980113.
 .\" 2005-05-05 mtk: added strcasestr()
 .\"
-.TH STRSTR 3  2010-09-20 "GNU" "Linux Programmer's Manual"
+.TH STRSTR 3  2015-01-10 "GNU" "Linux Programmer's Manual"
 .SH NAME
 strstr, strcasestr \- locate a substring
 .SH SYNOPSIS
@@ -47,33 +49,54 @@ strstr, strcasestr \- locate a substring
 The
 .BR strstr ()
 function finds the first occurrence of the substring
-\fIneedle\fP in the string \fIhaystack\fP.
-The terminating \(aq\\0\(aq characters are not compared.
+.I needle
+in the string
+.IR haystack .
+The terminating null bytes (\(aq\\0\(aq) are not compared.
 
 The
 .BR strcasestr ()
 function is like
 .BR strstr (),
 but ignores the case of both arguments.
-.SH "RETURN VALUE"
+.SH RETURN VALUE
 These functions return a pointer to the beginning of the
-substring, or NULL if the substring is not found.
-.SH "CONFORMING TO"
+located substring, or NULL if the substring is not found.
+.SH ATTRIBUTES
+.SS Multithreading (see pthreads(7))
+The
+.BR strstr ()
+function is thread-safe.
+.LP
+The
+.BR strcasestr ()
+function is thread-safe with exceptions.
+It can be safely used in multithreaded applications, as long as
+.BR setlocale (3)
+is not called to change the locale during its execution.
+.SH CONFORMING TO
 The
 .BR strstr ()
 function conforms to C89 and C99.
 The
 .BR strcasestr ()
 function is a nonstandard extension.
-.SH BUGS
-Early versions of Linux libc (like 4.5.26) would not allow
-an empty \fIneedle\fP argument for
-.BR strstr ().
-Later versions (like 4.6.27) work correctly,
-and return \fIhaystack\fP when \fIneedle\fP is empty.
-.SH "SEE ALSO"
+.\" .SH BUGS
+.\" Early versions of Linux libc (like 4.5.26) would not allow
+.\" an empty
+.\" .I needle
+.\" argument for
+.\" .BR strstr ().
+.\" Later versions (like 4.6.27) work correctly,
+.\" and return
+.\" .IR haystack
+.\" when
+.\" .I needle
+.\" is empty.
+.SH SEE ALSO
 .BR index (3),
 .BR memchr (3),
+.BR memmem (3),
 .BR rindex (3),
 .BR strcasecmp (3),
 .BR strchr (3),
@@ -83,3 +106,12 @@ and return \fIhaystack\fP when \fIneedle\fP is empty.
 .BR strspn (3),
 .BR strtok (3),
 .BR wcsstr (3)
+.SH COLOPHON
+This page is part of release 3.79 of the Linux
+.I man-pages
+project.
+A description of the project,
+information about reporting bugs,
+and the latest version of this page,
+can be found at
+\%http://www.kernel.org/doc/man\-pages/.