.\" (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) .TH CONFSTR 3 "April 17, 1993" "GNU" "Linux Programmer's Manual" .SH NOME confstr \- ler variáveis string dependentes da configuração .SH SINOPSE .nf .B #define _POSIX_C_SOURCE 2 ou .B #define _XOPEN_SOURCE .nl .B #include .sp .BI "size_t confstr(int " "name" ", char *" buf ", size_t " len ");" .fi .SH DESCRIÇÃO .B confstr() lê os valores de variáveis string dependentes da configuração. .PP O argumento .I name indica a variável do sistema a ser retornada. As seguintes variáveis são suportadas: .TP .B _CS_PATH Valor da variável .B PATH , que indica onde podem ser encontrados os utilitários padrão POSIX.2 .PP Se .I buf não for .BR NULL , e .I len for diferente de zero, .B confstr() copia os valores da string para .I buf , truncando para .I len \- 1 caracteres se necessário e acrescentando um null ao final. Isto pode ser verificado comparando o valor retornado por .B confstr() e .IR len . .PP Se .I len for zero e .I buf for .BR NULL , .B confstr() retornará o valor definido abaixo. .SH "VALOR RETORNADO" Se .I name não corresponder a uma variável de configuração válida, .B confstr() retorna 0. .SH EXEMPLOS O código abaixo localiza o caminho onde estão os utilitários 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 ERROS Se o valor de .I name for inválido, .I errno será .BR EINVAL . .SH "DE ACORDO COM" proposta POSIX.2 .SH "BUGS" POSIX.2 ainda não é uma norma aprovada. A informação nesta manpage pode mudar. .SH "VER TAMBÉM" .BR sh (1), .BR exec (3), .BR system (3) .SH TRADUZIDO POR LDP-BR em 21/08/2000. \&\fR\&\f(CWPaulo César Mendes (tradução)\fR \&\fR\&\f(CWxxxxxxxxxxxxxxxxxxxxxxxxx (revisão)\fR