Scroll to navigation

strnlen(3) Library Functions Manual strnlen(3)

NOMBRE

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

BIBLIOTECA

Biblioteca Estándar C (libc, -lc)

SINOPSIS

#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

DESCRIPCIÓN

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].

VALOR DEVUELTO

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.

ATRIBUTOS

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

ESTÁNDARES

POSIX.1-2008.

HISTORIAL

POSIX.1-2008.

VÉASE TAMBIÉN

strlen(3)

TRADUCCIÓN

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.

20 ​​Julio 2023 Páginas de manual de Linux 6.05.01