Tell me more ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I already posted this question on Stack overflow, but no luck there: http://stackoverflow.com/questions/14784525/dereferencing-pointer-to-incomplete-type-in-compiling-freebsd-custom-system-caF

I am getting compilation error when I compile this code:

#include <sys/param.h> 
#include <sys/system.h>

struct syshello_args 
{
   char *buf;
};

int sys_myhello(p, uap)
struct proc* p; struct syshello_args* uap;
{
   sprintf(uap->buf, "Hello");
   p->p_retval[0]=0;
   return 0;
}

I am getting many errors:

I am not familiar with C language at all. I found this example in a couple of tutorials but it doesn't work for me. Can anyone help me fixing the error.

Thank you

share|improve this question
This is a plain C question, it does belong on Stack Overflow, not here. But as you were already told over there, find another tutorial. That's ancient C style. – Mat Feb 9 at 15:09
It looks like struct proc isn't defined. You are probably missing an #include line (or, as @Mat hints, you are following an ancient tutorial on a new system, where things are done differently). – vonbrand Feb 9 at 15:37

closed as off topic by Mat, rahmu, Renan, jasonwryan, Shadur Feb 9 at 20:59

Questions on Unix & Linux Stack Exchange are expected to relate to Unix or Linux within the scope defined in the FAQ. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about closed questions here.

Browse other questions tagged or ask your own question.