Provided by: manpages-pt-dev_20040726-4_all bug

NOME

       confstr - ler variáveis string dependentes da configuração

SINOPSE

       #define _POSIX_C_SOURCE 2
       ou
       #define _XOPEN_SOURCE
       #include <unistd.h>

       size_t confstr(int name, char *buf, size_t len);

DESCRIÇÃO

       confstr() lê os valores de variáveis string dependentes da configuração.

       O argumento name indica a variável do sistema a ser retornada.  As seguintes variáveis são
       suportadas:

       _CS_PATH
              Valor da variável PATH , que indica  onde  podem  ser  encontrados  os  utilitários
              padrão POSIX.2

       Se  buf  não  for  NULL, e len for diferente de zero, confstr() copia os valores da string
       para buf , truncando para len - 1 caracteres se necessário  e  acrescentando  um  null  ao
       final.  Isto pode ser verificado comparando o valor retornado por confstr() e len.

       Se len for zero e buf for NULL, confstr() retornará o valor definido abaixo.

VALOR RETORNADO

       Se name não corresponder a uma variável de configuração válida, confstr() retorna 0.

EXEMPLOS

       O código abaixo localiza o caminho onde estão os utilitários POSIX.2.

          char *pathbuf; size_t n;

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

ERROS

       Se o valor de name for inválido, errno será EINVAL.

DE ACORDO COM

       proposta POSIX.2

BUGS

       POSIX.2 ainda não é uma norma aprovada. A informação nesta manpage pode mudar.

VER TAMBÉM

       sh(1), exec(3), system(3)

TRADUZIDO POR LDP-BR em 21/08/2000.

       Paulo     César     Mendes    <drpc@ism.com.br>    (tradução)    xxxxxxxxxxxxxxxxxxxxxxxxx
       <xxx@xxxxxx.xxx.xx> (revisão)