1 .\" Copyright (c) Bruno Haible <haible@clisp.cons.org>
3 .\" %%%LICENSE_START(GPLv2+_DOC_ONEPARA)
4 .\" This is free documentation; you can redistribute it and/or
5 .\" modify it under the terms of the GNU General Public License as
6 .\" published by the Free Software Foundation; either version 2 of
7 .\" the License, or (at your option) any later version.
10 .\" References consulted:
11 .\" GNU glibc-2 source code and manual
13 .\"*******************************************************************
15 .\" This file was generated with po4a. Translate the source file.
17 .\"*******************************************************************
19 .\" Japanese Version Copyright (c) 1999 HANATAKA Shinya
20 .\" all rights reserved.
21 .\" Translated Tue Jan 11 00:55:48 JST 2000
22 .\" by HANATAKA Shinya <hanataka@abyss.rim.or.jp>
24 .TH STRNLEN 3 2014\-02\-25 GNU "Linux Programmer's Manual"
26 strnlen \- 固定長の文字列の長さを調べる
29 \fB#include <string.h>\fP
31 \fBsize_t strnlen(const char *\fP\fIs\fP\fB, size_t \fP\fImaxlen\fP\fB);\fP
35 glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照):
44 _XOPEN_SOURCE\ >=\ 700 || _POSIX_C_SOURCE\ >=\ 200809L
52 \fBstrnlen\fP() 関数は \fIs\fP が指す文字列の長さをバイト数で返す。 長さには
53 終端のヌルバイト (\(aq\e0\(aq) は含まない。 また長さは最大で
54 \fImaxlen\fP までであり、 \fBstrnlen\fP() は \fIs\fP の最初の \fImaxlen\fP バイト
55 のみを検査し \fIs+maxlen\fP より先を検査することはない。
57 \fBstrnlen\fP() 関数は \fImaxlen\fP 以下ならば \fIstrlen(s)\fP と同じ値を返す。
58 \fIs\fP の指す文字列が最大 \fImaxlen\fP バイトまでにヌルバイト
59 (\(aq\e0\(aq) 文字を含まない場合には \fImaxlen\fP を返す。
61 .SS "マルチスレッディング (pthreads(7) 参照)"
62 \fBstrnlen\fP() 関数はスレッドセーフである。
68 この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.78 の一部
69 である。プロジェクトの説明とバグ報告に関する情報は
70 http://www.kernel.org/doc/man\-pages/ に書かれている。