plucky (3) strnlen.3.gz

Provided by: manpages-ja-dev_0.5.0.0.20221215+dfsg-1_all bug

名前

       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/ に書かれている。