OSDN Git Service

(split) Convert release and draft pages to UTF-8.
[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 .\" Japanese Version Copyright (c) 1999 HANATAKA Shinya
12 .\"         all rights reserved.
13 .\" Translated Tue Jan 11 00:55:48 JST 2000
14 .\"         by HANATAKA Shinya <hanataka@abyss.rim.or.jp>
15 .\"
16 .TH STRNLEN 3  2011-09-28 "GNU" "Linux Programmer's Manual"
17 .SH 名前
18 strnlen \- 固定長の文字列の長さを調べる
19 .SH 書式
20 .nf
21 .B #include <string.h>
22 .sp
23 .BI "size_t strnlen(const char *" s ", size_t " maxlen );
24 .fi
25 .sp
26 .in -4n
27 glibc 向けの機能検査マクロの要件
28 .RB ( feature_test_macros (7)
29 参照):
30 .in
31 .sp
32 .BR strnlen ():
33 .PD 0
34 .ad l
35 .RS 4
36 .TP 4
37 glibc 2.10 以降:
38 _XOPEN_SOURCE\ >=\ 700 || _POSIX_C_SOURCE\ >=\ 200809L
39 .TP
40 glibc 2.10 より前:
41 _GNU_SOURCE
42 .RE
43 .ad
44 .PD
45 .SH 説明
46 .BR strnlen ()
47 関数は \fIs\fP が指す文字列の長さをバイト数で返す。
48 長さには終端の NULL バイト (\(aq\\0\(aq) は含まない。
49 また長さは最大で \fImaxlen\fP までであり、
50 .BR strnlen ()
51 は \fIs\fP の最初の \fImaxlen\fP バイトのみを検査し
52 \fIs+maxlen\fP より先を検査することはない。
53 .SH 返り値
54 .BR strnlen ()
55 関数は \fImaxlen\fP 以下ならば \fIstrlen(s)\fP と同じ
56 値を返す。\fIs\fP の指す文字列が最大 \fImaxlen\fP バイトまでに
57 NULL バイト (\(aq\\0\(aq) 文字を含まない場合には \fImaxlen\fP を返す。
58 .SH 準拠
59 POSIX.1-2008.
60 .SH 関連項目
61 .BR strlen (3)