Re: making a global structure

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Krushnaal,

On Mon, Sep 14, 2009 at 5:54 PM, krushnaal pai <krisonearth@xxxxxxxxx> wrote:
> hello
> i am a newbie, i know about exporting variables between modules,
> but what i am trying right now is to export a structure( i want to make a
> global structure)
> i wrote this in one module.....
> Code:
>
> struct abc{
> int y;
> int a[10];
>
> int *z[10];
> };
> struct abc *x;
> EXPORT_SYMBOL(x);
>

Once you declare X as exported it will be accessed by any other module.
The symbol X is reserved now and any other module cannot use X.

> then i tried to use it in another module like this
>
> Code:
>

Try this:

struct abc *y;
y=x;

Since, x is globally exported. This should work.
>
> but it didnt work,derefrencing errors ....
>
> are the above codes correct?
>
> can sumone plz correct me. any help appreciated. ty



-- 
Regards,
Sandeep.





 	
“To learn is to change. Education is a process that changes the learner.”

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux