Scroll to navigation

CONFSTR(3) Manual del Programador de Linux CONFSTR(3)

NOMBRE

confstr - obtiene variables cadena dependientes de la configuración

SINOPSIS

#include <unistd.h>
size_t confstr(int name, char *buf, size_t len);

Requisitos de Macros de Prueba de Características para glibc (véase feature_test_macros(7)):

confstr(): _POSIX_C_SOURCE >= 2 || _XOPEN_SOURCE

DESCRIPCIÓN

confstr() obtiene el valor de una variable cadena dependiente de la configuración.

El argumento name es la variable del sistema a ser examinada. Se admiten las siguientes variables:

_CS_GNU_LIBC_VERSION (GNU C library only; since glibc 2.3.2)
A string which identifies the GNU C library version on this system (e.g., "glibc 2.3.4").
_CS_GNU_LIBPTHREAD_VERSION (GNU C library only; since glibc 2.3.2)
A string which identifies the POSIX implementation supplied by this C library (e.g., "NPTL 2.3.4" or "linuxthreads-0.10").
_CS_PATH
Un valor para la variable PATH que indica dónde pueden ser encontradas todas las utilidades POSIX.2 estándar.

If buf is not NULL and len is not zero, confstr() copies the value of the string to buf truncated to len - 1 bytes if necessary, with a null byte ('\0') as terminator. This can be detected by comparing the return value of confstr() against len.

Si len es cero y buf es NULL, confstr() sólo devuelve el valor como se define más abajo.

VALOR DEVUELTO

If name is a valid configuration variable, confstr() returns the number of bytes (including the terminating null byte) that would be required to hold the entire value of that variable. This value may be greater than len, which means that the value in buf is truncated.

If name is a valid configuration variable, but that variable does not have a value, then confstr() returns 0. If name does not correspond to a valid configuration variable, confstr() returns 0, and errno is set to EINVAL.

ERRORES

The value of name is invalid.

ATRIBUTOS

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

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

CONFORME A

POSIX.1-2001, POSIX.1-2008.

EJEMPLOS

El siguiente fragmento de código determina el camino donde se encuentran las utilidades de sistema POSIX.2:


char *pathbuf;
size_t n;
n = confstr(_CS_PATH, NULL, (size_t) 0);
pathbuf = malloc(n);
if (pathbuf == NULL)

abort(); confstr(_CS_PATH, pathbuf, n);

VÉASE TAMBIÉN

getconf(1), sh(1), exec(3), fpathconf(3), pathconf(3), sysconf(3), system(3)

COLOFÓN

Esta página es parte de la versión 5.10 del proyecto Linux man-pages. Puede encontrar una descripción del proyecto, información sobre cómo informar errores y la última versión de esta página en https://www.kernel.org/doc/man-pages/.

TRADUCCIÓN

La traducción al español de esta página del manual fue creada por Sebastian Desimone <chipy@argenet.com.ar> y Gerardo Aburruzaga García <gerardo.aburruzaga@uca.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>..

9 Junio 2020 GNU