.\" Copyright (c) Bruno Haible .\" .\" %%%LICENSE_START(GPLv2+_DOC_ONEPARA) .\" This is free documentation; you can redistribute it and/or .\" modify it under the terms of the GNU General Public License as .\" published by the Free Software Foundation; either version 2 of .\" the License, or (at your option) any later version. .\" %%%LICENSE_END .\" .\" References consulted: .\" GNU glibc-2 source code and manual .\" .\"******************************************************************* .\" .\" This file was generated with po4a. Translate the source file. .\" .\"******************************************************************* .\" .\" Japanese Version Copyright (c) 1999 HANATAKA Shinya .\" all rights reserved. .\" Translated Tue Jan 11 00:55:48 JST 2000 .\" by HANATAKA Shinya .\" .TH STRNLEN 3 2020\-12\-21 GNU "Linux Programmer's Manual" .SH 名前 strnlen \- 固定長の文字列の長さを調べる .SH 書式 .nf \fB#include \fP .PP \fBsize_t strnlen(const char *\fP\fIs\fP\fB, size_t \fP\fImaxlen\fP\fB);\fP .fi .PP .RS -4 glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .RE .PP \fBstrnlen\fP(): .PD 0 .ad l .RS 4 .TP 4 glibc 2.10 以降: _POSIX_C_SOURCE\ >=\ 200809L .TP glibc 2.10 より前: _GNU_SOURCE .RE .ad .PD .SH 説明 The \fBstrnlen\fP() function returns the number of bytes in the string pointed to by \fIs\fP, excluding the terminating null byte (\(aq\e0\(aq), but at most \fImaxlen\fP. In doing this, \fBstrnlen\fP() looks only at the first \fImaxlen\fP characters in the string pointed to by \fIs\fP and never beyond \fIs[maxlen\-1]\fP. .SH 返り値 The \fBstrnlen\fP() function returns \fIstrlen(s)\fP, if that is less than \fImaxlen\fP, or \fImaxlen\fP if there is no null terminating (\(aq\e0\(aq) among the first \fImaxlen\fP characters pointed to by \fIs\fP. .SH 属性 この節で使用されている用語の説明については、 \fBattributes\fP(7) を参照。 .TS allbox; lb lb lb l l l. インターフェース 属性 値 T{ \fBstrnlen\fP() T} Thread safety MT\-Safe .TE .SH 準拠 POSIX.1\-2008. .SH 関連項目 \fBstrlen\fP(3) .SH この文書について この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 5.10 の一部である。プロジェクトの説明とバグ報告に関する情報は \%https://www.kernel.org/doc/man\-pages/ に書かれている。