STRNLEN

Section: Linux Programmer's Manual (3)
Updated: 2020-12-21
Index JM Home Page
 

名前

strnlen - 固定長の文字列の長さを調べる  

書式

#include <string.h>

size_t strnlen(const char *s, size_t maxlen);

glibc 向けの機能検査マクロの要件 (feature_test_macros(7) 参照):

strnlen():

glibc 2.10 以降:
_POSIX_C_SOURCE >= 200809L
glibc 2.10 より前:
_GNU_SOURCE
 

説明

The strnlen() function returns the number of bytes in the string pointed to by s, excluding the terminating null byte ('\0'), but at most maxlen. In doing this, strnlen() looks only at the first maxlen characters in the string pointed to by s and never beyond s[maxlen-1].  

返り値

The strnlen() function returns strlen(s), if that is less than maxlen, or maxlen if there is no null terminating ('\0') among the first maxlen characters pointed to by s.  

属性

この節で使用されている用語の説明については、 attributes(7) を参照。
インターフェース 属性
strnlen() Thread safety MT-Safe
 

準拠

POSIX.1-2008.  

関連項目

strlen(3)  

この文書について

この man ページは Linux man-pages プロジェクトのリリース 5.10 の一部である。プロジェクトの説明とバグ報告に関する情報は https://www.kernel.org/doc/man-pages/ に書かれている。

関連キーワード

strnlen, maxlen, STRNLEN, 属性, pointed, string, pages, strlen, characters, 準拠

Linux マニュアル 一覧

[man1] [man2] [man3] [man4] [man5] [man6] [man7] [man8]
[a] [b] [c] [d] [e] [f] [g] [h] [i] [j] [k] [l] [m] [n] [o] [p] [q] [r] [s] [t] [u] [v] [w] [x] [y] [z]

 

Index

名前
書式
説明
返り値
属性
準拠
関連項目
この文書について

This document was created by man2html, using the manual pages.
Time: 12:08:38 GMT, June 11, 2022