OSDN Git Service

(split) LDP: Release pages for LDP v3.39.
[linuxjm/LDP_man-pages.git] / release / man3 / strnlen.3
1 .\" Copyright (c) Bruno Haible <haible@clisp.cons.org>
2 .\"
3 .\" This is free documentation; you can redistribute it and/or
4 .\" modify it under the terms of the GNU General Public License as
5 .\" published by the Free Software Foundation; either version 2 of
6 .\" the License, or (at your option) any later version.
7 .\"
8 .\" References consulted:
9 .\"   GNU glibc-2 source code and manual
10 .\"
11 .\"*******************************************************************
12 .\"
13 .\" This file was generated with po4a. Translate the source file.
14 .\"
15 .\"*******************************************************************
16 .TH STRNLEN 3 2011\-09\-28 GNU "Linux Programmer's Manual"
17 .SH 名前
18 strnlen \- 固定長の文字列の長さを調べる
19 .SH 書式
20 .nf
21 \fB#include <string.h>\fP
22 .sp
23 \fBsize_t strnlen(const char *\fP\fIs\fP\fB, size_t \fP\fImaxlen\fP\fB);\fP
24 .fi
25 .sp
26 .in -4n
27 glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7)  参照):
28 .in
29 .sp
30 \fBstrnlen\fP():
31 .PD 0
32 .ad l
33 .RS 4
34 .TP  4
35 glibc 2.10 以降:
36 _XOPEN_SOURCE\ >=\ 700 || _POSIX_C_SOURCE\ >=\ 200809L
37 .TP 
38 glibc 2.10 より前:
39 _GNU_SOURCE
40 .RE
41 .ad
42 .PD
43 .SH 説明
44 \fBstrnlen\fP()  関数は \fIs\fP が指す文字列の長さをバイト数で返す。 長さには終端の NULL バイト (\(aq\e0\(aq)
45 は含まない。 また長さは最大で \fImaxlen\fP までであり、 \fBstrnlen\fP()  は \fIs\fP の最初の \fImaxlen\fP
46 バイトのみを検査し \fIs+maxlen\fP より先を検査することはない。
47 .SH 返り値
48 \fBstrnlen\fP()  関数は \fImaxlen\fP 以下ならば \fIstrlen(s)\fP と同じ 値を返す。\fIs\fP の指す文字列が最大
49 \fImaxlen\fP バイトまでに NULL バイト (\(aq\e0\(aq) 文字を含まない場合には \fImaxlen\fP を返す。
50 .SH 準拠
51 POSIX.1\-2008.
52 .SH 関連項目
53 \fBstrlen\fP(3)