I am trying to compile some code using GCC. In my code I call process_vm_readv() and process_vm_writev() (These are non-standard Linux extensions, see man-page here: http://linux.die.net/man/2/process_vm_writev).

Adhering to the man, I include in my .c file, but GCC spits out:

warning: implicit declaration of function ‘process_vm_writev’

I'm not sure how to fix this... Standard libc functions like printf and strlen compile fine.

有帮助吗?

解决方案

Those functions are only available when GNU extensions are enabled. That is the #define _GNU_SOURCE is in effect, (a fact that probably should have been documented in he man page)

So you'll need to do

#define _GNU_SOURCE
#include <sys/uio.h>
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top