Warning: main(/www/www/htdocs/style/globals.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/c/clearenv.html on line 1
Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/globals.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/c/clearenv.html on line 1
Warning: main(/www/www/htdocs/style/header.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/c/clearenv.html on line 8
Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/header.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/c/clearenv.html on line 8
Clear the environment
#include <stdlib.h>
int clearenv( void );
libc
Use the -l c option to
qcc
to link against this library.
This library is usually included automatically.
The clearenv() function clears the environment area;
no environment variables are defined immediately after the
clearenv() call.
Note that clearenv() clears the following environment variables,
which may then affect the operation of other library functions such as
spawnp():
- PATH
- SHELL
- TERM
- TERMINFO
- LINES
- COLUMNS
- TZ
- 0
- Success.
- -1
- An error occurred
(errno
is set).
- ENOMEM
- Not enough memory to allocate a control structure.
Clear the entire environment and set up a
new TZ environment variable:
#include <stdio.h>
#include <stdlib.h>
int main( void )
{
if( clearenv() != 0 ) {
puts( "Unable to clear the environment" );
return EXIT_FAILURE;
}
setenv( "TZ", "EST5EDT", 0 );
return EXIT_SUCCESS;
}
QNX 4
Safety: | |
Cancellation point |
No |
Interrupt handler |
No |
Signal handler |
No |
Thread |
Yes |
The clearenv() function
manipulates the environment pointed to by the global
environ variable.
environ,
errno,
execl(),
execle(),
execlp(),
execlpe(),
execv(),
execve(),
execvp(),
execvpe(),
getenv(),
putenv(),
searchenv(),
setenv(),
spawn(),
spawnl(),
spawnle(),
spawnlp(),
spawnlpe(),
spawnp(),
spawnv(),
spawnve(),
spawnvp(),
spawnvpe(),
system(),
unsetenv()
Warning: main(/www/www/htdocs/style/footer.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/c/clearenv.html on line 214
Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/footer.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/c/clearenv.html on line 214