OSDN Git Service

(split) LDP: Update the version to 3.53 in PO files
[linuxjm/LDP_man-pages.git] / release / man3 / memmem.3
1 .\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk)
2 .\"
3 .\" %%%LICENSE_START(VERBATIM)
4 .\" Permission is granted to make and distribute verbatim copies of this
5 .\" manual provided the copyright notice and this permission notice are
6 .\" preserved on all copies.
7 .\"
8 .\" Permission is granted to copy and distribute modified versions of this
9 .\" manual under the conditions for verbatim copying, provided that the
10 .\" entire resulting derived work is distributed under the terms of a
11 .\" permission notice identical to this one.
12 .\"
13 .\" Since the Linux kernel and libraries are constantly changing, this
14 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
15 .\" responsibility for errors or omissions, or for damages resulting from
16 .\" the use of the information contained herein.  The author(s) may not
17 .\" have taken the same level of care in the production of this manual,
18 .\" which is licensed free of charge, as they might when working
19 .\" professionally.
20 .\"
21 .\" Formatted or processed versions of this manual, if unaccompanied by
22 .\" the source, must acknowledge the copyright and authors of this work.
23 .\" %%%LICENSE_END
24 .\"
25 .\" References consulted:
26 .\"     Linux libc source code
27 .\"     386BSD man pages
28 .\" Modified Sat Jul 24 18:50:48 1993 by Rik Faith (faith@cs.unc.edu)
29 .\" Interchanged 'needle' and 'haystack'; added history, aeb, 980113.
30 .\"*******************************************************************
31 .\"
32 .\" This file was generated with po4a. Translate the source file.
33 .\"
34 .\"*******************************************************************
35 .TH MEMMEM 3 2008\-12\-05 GNU "Linux Programmer's Manual"
36 .SH 名前
37 memmem \- 部分文字列の位置を示す
38 .SH 書式
39 .nf
40 \fB#define _GNU_SOURCE\fP         /* feature_test_macros(7) 参照 */
41 \fB#include <string.h>\fP
42 .sp
43 \fBvoid *memmem(const void *\fP\fIhaystack\fP\fB, size_t \fP\fIhaystacklen\fP\fB,\fP
44 \fB             const void *\fP\fIneedle\fP\fB, size_t \fP\fIneedlelen\fP\fB);\fP
45 .fi
46 .SH 説明
47 \fBmemmem\fP()  関数は、 \fIhaystacklen\fP の大きさを持つメモリ領域 \fIhaystack\fP の中で \fIneedlelen\fP
48 の大きさを持つ部分文字列 \fIneedle\fP が 最初に現れる位置を見つける。
49 .SH 返り値
50 \fBmemmem\fP()  関数は、部分文字列の開始を指すポインタを返し、もし部分文字列が 見つからない場合は NULL を返す。
51 .SH 準拠
52 この関数は GNU による拡張である。
53 .SH バグ
54 Linux のライブラリに関していうと、 libc 5.0.9 と それ以前のすべてのバージョンで、この関数は壊れている。 それらのライブラリでは
55 \fIneedle\fP と \fIhaystack\fP 引数が 入れ替わっており、 \fIneedle\fP が最初に出現する部分の最後を
56 示すポインタが返されていたのである。
57
58 新旧両方の libc ライブラリが、 \fIneedle\fP が空の場合 (\fIhaystack\fP のかわりに) \fIhaystack\-1\fP\ が
59 返されるというバグを持っている。 そして、glibc 2.0 ではさらに悪くなっており、 \fIhaystack\fP の最後のバイトへのポインタを返す。
60 これは glibc 2.1 で修正された。
61 .SH 関連項目
62 \fBstrstr\fP(3)
63 .SH この文書について
64 この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.53 の一部
65 である。プロジェクトの説明とバグ報告に関する情報は
66 http://www.kernel.org/doc/man\-pages/ に書かれている。