You need to define specific macros. Take a look at man 3 putenv :
NAME putenv - change or add an environment variable SYNOPSIS
Try defining either _SVID_SOURCE or _XOPEN_SOURCE before including stdlib.h , for example:
#define _XOPEN_SOURCE #include <stdlib.h>
Or when compiling (with -D ), for example:
gcc -o output file.c -D_XOPEN_SOURCE
source share