I am trying to employ the function os_zalloc()
, but can't seem to find which header file to include. According to a stackoverflow question: What is zalloc in embedded programming?, the definition should be given in mem.h
. including mem.h
without specifying a particular path gives the error:
test.c:1:17: fatal error: mem.h: No such file or directory
#include <mem.h>
I have a couple of files that claim they are mem.h
. The two first files contain no data. While the next two files don't have os_zalloc()
defined.
root@main:/# find / -name "mem.h"
usr/src/linux-headers-3.13.0-32-generic/include/config/infiniband/user/mem.h
/usr/src/linux-headers-3.13.0-32-generic/include/config/fix/earlycon/mem.h
/usr/src/linux-headers-3.13.0-32/arch/um/include/shared/mem.h
/usr/src/linux-headers-3.13.0-32/arch/mips/include/asm/mach-loongson/mem.h
Therefore, including any of these files in the program and compiling them with the specified path results in the error:
test.c:328: undefined reference to `os_zalloc'
collect2: error: ld returned 1 exit status
I have also tried to include memory.h
. This works fine. But the function os_zalloc
don't seem to be specified here either:
#include <memory.h>
The short question is that I would like to employ the function os_zalloc()
but I can't seem to know what to include it (or if it even exist on my system). Does anybody have any suggestion?