I had a big problem and I do not know how to solve it.
I wrote at the beginning of the file:
Code:
#define __USE_GNU
#include <unistd.h>
In the file unistd.h I have here this line:
Code:
#ifdef __USE_GNU
/* Return a malloc'd string containing the current directory name.
If the environment variable `PWD' is set, and its value is correct,
that value is used. */
extern char *get_current_dir_name (void) __THROW;
#endif
In the file I have this code:
Code:
char *DName;
DName = get_current_dir_name();
But at compilation I see here such warning:
Code:
ls.c: In function ‘printLine’:
ls.c:268:18: warning: implicit declaration of function ‘get_current_dir_name’ [-Wimplicit-function-declaration]
DName = get_current_dir_name();
^
ls.c:268:24: warning: assignment makes pointer from integer without a cast
DName = get_current_dir_name();
^