Where should I declare the global variable

Submitted by ahm_irf
on May 3, 2007 - 12:18am

Hi,

I have added a new system call that is used to initialize a global variable through userspace program. After initialization, I need to use that global variable in ~/net/ipv6/tcp_ipv6.c file. let say printing the value of that global variable.
So where should I declare that global variable.

Right now I have declare it in system call but the following error occured
_______________________________________________________
CC [M] net/ipv6/tcp_ipv6.o
net/ipv6/tcp_ipv6.c: In function ‘tcp_v6_rcv’:
net/ipv6/tcp_ipv6.c:1313: error: ‘global_fd’ undeclared (first use in this function)
net/ipv6/tcp_ipv6.c:1313: error: (Each undeclared identifier is reported only once
net/ipv6/tcp_ipv6.c:1313: error: for each function it appears in.)
make[2]: *** [net/ipv6/tcp_ipv6.o] Error 1
make[1]: *** [net/ipv6] Error 2
make: *** [net] Error 2

__________________________________

Regards,

Irfan