Hi Ahmed,
See the comments inline
#ifndef _LINUX_LIST_H // If not defined _LINUX_LIST_H macro
#define _LINUX_LIST_H // then define this macro
#include "linuxlist.h" // and include linuxlist.h header file
#endif // end of #ifndef
Now say in a
This is to avoid multiple declarations.In header file you declare the
variables and function names and these have to be declared just once
otherwise you will get multiple declaration error.
#ifndef avoids this error .By placing it at the top all the declaration is
visited just once =>How?Since supp
On Mon, Jul 20, 2015 at 12:03:07PM +0200, Ahmed Soliman wrote:
> currently I started reading through the linux kernel and I started
> reading liunx/include/linux/list.h> I understood some of the functions
> but still I dont know what does these lines of code do
> #ifndef _LINUX_LIST_H
> #define _LI
Hi Rik,
Thanks very much for your comments!
Best Regards
Nan Xiao
On Tue, Jul 21, 2015 at 5:04 AM, Rik van Riel wrote:
> On 07/19/2015 11:43 PM, Nan Xiao wrote:
> > Hi all,
> >
> > Per my understanding, the "processor" in "SMP" and "UP" should be a
> > "logic CPU", not a "physical CPU".
> > I
On 07/19/2015 11:43 PM, Nan Xiao wrote:
> Hi all,
>
> Per my understanding, the "processor" in "SMP" and "UP" should be a
> "logic CPU", not a "physical CPU".
> If the "physical CPU" contains 2 "cores", and every "core" contains 2
> "hardware threads", then the "processor"
> should stands for "ha
On Mon, Jul 20, 2015 at 3:03 AM, Ahmed Soliman
wrote:
> currently I started reading through the linux kernel and I started
> reading liunx/include/linux/list.h> I understood some of the functions
> but still I dont know what does these lines of code do
> #ifndef _LINUX_LIST_H
> #define _LINUX_LIS
Ahmed,
That's basic C syntax for 30 years both in and out of the kernel.
If you include the same header file multiple times you can get errors
about defining the same structures, constants, globals multiple times.
So the first time it is included you want the header file to actually
be included.
The keyword is 'include guard'
~frukto
Am 20.07.2015 um 17:55 schrieb leo kirotawa:
> it means you don't want to redefine a .h file
>
> On Mon, Jul 20, 2015 at 7:03 AM, Ahmed Soliman
> wrote:
>> currently I started reading through the linux kernel and I started
>> reading liunx/include/linux/l
it means you don't want to redefine a .h file
On Mon, Jul 20, 2015 at 7:03 AM, Ahmed Soliman
wrote:
> currently I started reading through the linux kernel and I started
> reading liunx/include/linux/list.h> I understood some of the functions
> but still I dont know what does these lines of code d
currently I started reading through the linux kernel and I started
reading liunx/include/linux/list.h> I understood some of the functions
but still I dont know what does these lines of code do
#ifndef _LINUX_LIST_H
#define _LINUX_LIST_H
which exist at the very beginning of the file
I also noticed t
10 matches
Mail list logo