summaryrefslogblamecommitdiff
path: root/src/env/clearenv.c
blob: 2e275b43457c5c9516701b6b89d999ce186cccd7 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
                   
                   
                   
                 
 

                                          


              


                                                

                 
#define _GNU_SOURCE
#include <stdlib.h>
#include <unistd.h>
#include "libc.h"

static void dummy(char *old, char *new) {}
weak_alias(dummy, __env_rm_add);

int clearenv()
{
	char **e = __environ;
	__environ = 0;
	if (e) while (*e) __env_rm_add(*e++, 0);
	return 0;
}