My c code uses \'memset\' and \'close\'. And I have added:
#include
#include
#include
But I sti
Old question but I had similar issue and I solved it by adding
extern void* memset(void*, int, size_t);
or just
extern void* memset();
at the top of translation unit ( *.c file ).
Try to add next define at start of your .c file:
#define _GNU_SOURCE
It helped me with pipe2 function.
A good way to findout what header file you are missing:
man <section> <function call>
To find out the section use:
apropos <function call>
Example:
man 3 memset
man 2 send
Edit in response to James Morris:
Source: Wikipedia Man Page
You need:
#include <string.h> /* memset */
#include <unistd.h> /* close */
in your code.
References: POSIX for close, the C standard for memset
.
memset
requires you to import the header string.h
file. So just add the following header
#include <string.h>
...