confstr(3) Library Functions Manual confstr(3) NOMBRE confstr - obtiene variables cadena dependientes de la configuracion BIBLIOTECA Biblioteca Estandar C (libc, -lc) SINOPSIS #include size_t confstr(int name, char buf[.size], size_t size); Requisitos de Macros de Prueba de Caracteristicas para glibc (vease feature_test_macros(7)): confstr(): _POSIX_C_SOURCE >= 2 || _XOPEN_SOURCE DESCRIPCION confstr() obtiene el valor de una variable cadena dependiente de la configuracion. 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 donde pueden ser encontradas todas las utilidades POSIX.2 estandar. If buf is not NULL and size is not zero, confstr() copies the value of the string to buf truncated to size - 1 bytes if necessary, with a null byte ('\0') as terminator. This can be detected by comparing the return value of confstr() against size. Si size es cero y buf es NULL, confstr() solo devuelve el valor como se define mas 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 size, 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 EINVAL The value of name is invalid. ATRIBUTOS Para obtener una explicacion de los terminos usados en esta seccion, vease attributes(7). +-----------------------------+--------------------+-------------------+ |Interfaz | Atributo | Valor | +-----------------------------+--------------------+-------------------+ |confstr() | Seguridad del hilo | Multi-hilo seguro | +-----------------------------+--------------------+-------------------+ ESTANDARES POSIX.1-2008. HISTORIAL POSIX.1-2001. EJEMPLOS El siguiente fragmento de codigo 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); VEASE TAMBIEN getconf(1), sh(1), exec(3), fpathconf(3), pathconf(3), sysconf(3), system(3) TRADUCCION La traduccion al espanol de esta pagina del manual fue creada por Sebastian Desimone y Gerardo Aburruzaga Garcia Esta traduccion es documentacion libre; lea la GNU General Public License Version 3 o posterior con respecto a las condiciones de copyright. No existe NINGUNA RESPONSABILIDAD. Si encuentra algun error en la traduccion de esta pagina del manual, envie un correo electronico a . Paginas de manual de Linux 6.06 31 Octubre 2023 confstr(3)