strnlen(3) Library Functions Manual strnlen(3)

strnlen - determina la longitud de una cadena de tamaño fijo

Biblioteca Estándar C (libc, -lc)

#include <string.h>
size_t strnlen(const char s[.maxlen], size_t maxlen);
Requisitos de Macros de Prueba de Características para glibc (véase feature_test_macros(7)):

strnlen():

    Desde glibc 2.10:
        _POSIX_C_SOURCE >= 200809L
    Antes de 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.

Para obtener una explicación de los términos usados en esta sección, véase attributes(7).

Interfaz Atributo Valor
strnlen() Seguridad del hilo Multi-hilo seguro

POSIX.1-2008.

POSIX.1-2008.

strlen(3)

La traducción al español de esta página del manual fue creada por Juan Piernas <piernas@ditec.um.es>

Esta traducción es documentación libre; lea la GNU General Public License Version 3 o posterior con respecto a las condiciones de copyright. No existe NINGUNA RESPONSABILIDAD.

Si encuentra algún error en la traducción de esta página del manual, envíe un correo electrónico a debian-l10n-spanish@lists.debian.org.

31 Octubre 2023 Páginas de manual de Linux 6.06