clearenv(3) Library Functions Manual clearenv(3) NOMBRE clearenv - limpia el entorno BIBLIOTECA Biblioteca Estandar C (libc, -lc) SINOPSIS #include int clearenv(void); Requisitos de Macros de Prueba de Caracteristicas para glibc (vease feature_test_macros(7)): clearenv(): /* glibc >= 2.19: */ _DEFAULT_SOURCE || /* glibc <= 2.19: */ _SVID_SOURCE || _BSD_SOURCE DESCRIPCION The clearenv() function clears the environment of all name-value pairs and sets the value of the external variable environ to NULL. After this call, new variables can be added to the environment using putenv(3) and setenv(3). VALOR DEVUELTO La funcion clearenv() devuelve cero en caso de exito, y un valor distinto de cero en caso de fallo. ATRIBUTOS Para obtener una explicacion de los terminos usados en esta seccion, vease attributes(7). +---------------------------+--------------------+---------------------+ |Interfaz | Atributo | Valor | +---------------------------+--------------------+---------------------+ |clearenv() | Seguridad del hilo | MT-Unsafe const:env | +---------------------------+--------------------+---------------------+ ESTANDARES putenv() POSIX.1-2008. clearenv() None. HISTORIAL putenv() glibc 2.0. POSIX.1-2001. clearenv() glibc 2.0. Varias variantes UNIX (DG/UX, HP-UX, QNX, ...). POSIX.9 (enlaces para FORTRAN77). POSIX.1-1996 no aceptaba clearenv() ni putenv(3), pero mas tarde recapacito y planifico estas funciones para ser incluidas en una version posterior de su estandar (cf. B.4.6.1). Sin embargo, POSIX.1-2001 solo incorpora putenv(3), y rechaza clearenv(). NOTAS On systems where clearenv() is unavailable, the assignment environ = NULL; no esta disponible probablemente lo estara. The clearenv() function may be useful in security-conscious applications that want to precisely control the environment that is passed to programs executed using exec(3). The application would do this by first clearing the environment and then adding select environment variables. Note that the main effect of clearenv() is to adjust the value of the pointer environ(7); this function does not erase the contents of the buffers containing the environment definitions. En las paginas de manual de DG/UX y Tru64 se puede leer: Si environ ha sido modificado por cualquier otro medio que no sea las funciones putenv(3), getenv(3), o clearenv() entonces clearenv() devolvera un error y el entorno del proceso permanecera intacto. VEASE TAMBIEN getenv(3), putenv(3), setenv(3), unsetenv(3), environ(7) TRADUCCION La traduccion al espanol de esta pagina del manual fue creada por Miguel Perez Ibars 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 . Linux man-pages 6.18 8 Febrero 2026 clearenv(3)