.\" (c) 1993 by Thomas Koenig (ig25@rz.uni-karlsruhe.de) .\" .\" Permission is granted to make and distribute verbatim copies of this .\" manual provided the copyright notice and this permission notice are .\" preserved on all copies. .\" .\" Permission is granted to copy and distribute modified versions of this .\" manual under the conditions for verbatim copying, provided that the .\" entire resulting derived work is distributed under the terms of a .\" permission notice identical to this one .\" .\" Since the Linux kernel and libraries are constantly changing, this .\" manual page may be incorrect or out-of-date. The author(s) assume no .\" responsibility for errors or omissions, or for damages resulting from .\" the use of the information contained herein. The author(s) may not .\" have taken the same level of care in the production of this manual, .\" which is licensed free of charge, as they might when working .\" professionally. .\" .\" Formatted or processed versions of this manual, if unaccompanied by .\" the source, must acknowledge the copyright and authors of this work. .\" License. .\" Modified Sat Jul 24 19:53:02 1993 by Rik Faith (faith@cs.unc.edu) .\" .\" Traducido al castellano (con permiso) por: .\" Sebastian Desimone (chipy@argenet.com.ar) (desimone@fasta.edu.ar) .\" Translation fixed on Thu Apr 23 10:55:49 CEST 1998 by Gerardo .\" Aburruzaga García .\" .TH CONFSTR 3 "25 Diciembre 1995" "GNU" "Manual del Programador de Linux" .SH NOMBRE confstr \- obtiene variables cadena dependientes de la configuración .SH SINOPSIS .nf .B #define __POSIX_C_SOURCE 2 o .B #define _XOPEN_SOURCE .nl .B #include .sp .BI "size_t confstr(int " "name" ", char *" buf ", size_t " len ");" .fi .SH DESCRIPCIÓN .B confstr() obtiene el valor de una variable cadena dependiente de la configuración. .PP El argumento .I name es la variable del sistema a ser examinada. Se admiten las siguientes variables: .TP .B _CS_PATH Un valor para la variable .B PATH que indica dónde pueden ser encontradas todas las utilidades POSIX.2 estándar. .PP Si .I buf no es .BR NULL , y .I len no es cero, .B confstr() copia el valor de la cadena a .I buf truncado a .I len \- 1 caracteres si es necesario, con un caracter NUL como terminación. Esto puede ser detectado al comparar el valor devuelto por .B confstr() con .IR len . .PP Si .I len es cero y .I buf es .BR NULL , .B confstr() sólo devuelve el valor como se define más abajo. .SH "VALOR DEVUELTO" Si .I name no corresponde a una variable de configuración válida, .B confstr() devuelve 0. .SH EJEMPLOS El siguiente fragmento de código determina el camino donde se encuentran las utilidades de sistema POSIX.2: .br .nf .in 10 char *pathbuf; size_t n; n = confstr(_CS_PATH,NULL,(size_t)0); if ((pathbuf = malloc(n)) == NULL) abort(); confstr(_CS_PATH, pathbuf, n); .SH ERRORES Si el valor de .I name es inválido, .I errno toma el valor .BR EINVAL . .SH "CONFORME A" el propuesto POSIX.2 .SH "FALLOS" POSIX.2 no es aún un estándar aprobado; la información de esta página de manual está sujeta a cambio. .SH "VÉASE TAMBIÉN" .BR sh "(1), " exec "(2), " system (3)