Provided by: manpages-es-dev_4.13-4_all bug

NOMBRE

       putenv - cambia o añade una variable de ambiente

SINOPSIS

       #include <stdlib.h>

       int putenv(char *cadena);

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

       putenv(): _XOPEN_SOURCE
           || /* Glibc since 2.19: */ _DEFAULT_SOURCE
           || /* Glibc versions <= 2.19: */ _SVID_SOURCE

DESCRIPCIÓN

       La  función  putenv()  añade  o  cambia  el  valor  de variables de entorno o ambiente. El
       argumento cadena es de la forma nombre=valor.  Si nombre no  existe  ya  en  el  ambiente,
       entonces  cadena  se añade al entorno. Si nombre sí existe, entonces el valor de nombre en
       el ambiente se cambia a valor.  La cadena apuntada por cadena se convierte  en  parte  del
       entorno, por lo que cambiar la cadena modifica el entorno.

VALOR DEVUELTO

       The  putenv()   function  returns  zero on success, or nonzero if an error occurs.  In the
       event of an error, errno is set to indicate the cause.

ERRORES

       ENOMEM Espacio insuficiente para alojar el nuevo ambiente.

ATRIBUTOS

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

       ┌─────────┬────────────────────┬─────────────────────┐
       │InterfazAtributoValor               │
       ├─────────┼────────────────────┼─────────────────────┤
       │putenv() │ Seguridad del hilo │ MT-Unsafe const:env │
       └─────────┴────────────────────┴─────────────────────┘

CONFORME A

       POSIX.1-2001, POSIX.1-2008, SVr4, 4.3BSD.

NOTAS

       The putenv()  function is not required to be reentrant, and the one in glibc 2.0  is  not,
       but the glibc 2.1 version is.

       Since  version 2.1.2, the glibc implementation conforms to SUSv2: the pointer string given
       to putenv()  is used.  In  particular,  this  string  becomes  part  of  the  environment;
       changing  it  later  will  change the environment.  (Thus, it is an error to call putenv()
       with an automatic variable as the argument, then return from the  calling  function  while
       string  is still part of the environment.)  However, glibc versions 2.0 to 2.1.1 differ: a
       copy of the string is used.  On the one hand this causes a memory leak, and on  the  other
       hand it violates SUSv2.

       La versión de 4.4BSD, como la de glibc 2.0, usa una copia.

       SUSv2 elimina const del prototipo, y así lo hace glibc 2.1.3.

       The  GNU  C  library  implementation provides a nonstandard extension.  If string does not
       include an equal sign:

           putenv("NAME");

       then the named variable is removed from the caller's environment.

VÉASE TAMBIÉN

       clearenv(3), getenv(3), setenv(3), unsetenv(3), environ(7)

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  Gerardo  Aburruzaga
       García <gerardo.aburruzaga@uca.es> y Juan Piernas <piernas@ditec.um.es>

       Esta  traducción  es  documentación  libre;  lea  la  GNU General Public License Version 3
       ⟨https://www.gnu.org/licenses/gpl-3.0.html⟩ 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 ⟨⟩.