The Linux Kernel - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


The Linux Kernel

jbowers9jbowers9 Posts: 8Member
Recently I picked up a publication called "The Linux Programming Guide: White Pages" from Coriolis press. There are various authors contributing. It's extremely intriguing but in certain areas very nearly incomprehensible - at least to me. I’ve studied C programming and am familiar w/linked lists and data structures but there are some references made in the source code that mystify me. For instance:

In the 'task_struct' data structure what does "volatile long;"

In the data declaration "int dumpable:1:" what does the ':1' do?

In the 'sock' data structure what does "atomic_t wmem_alloc;" mean?
Same for "_32 write_seq;". Are they casting operators?

Finally, can someone point me in the right direction as far as finding information either online or hardcopy so that I can learn more about this area? Thank you.


  • GsibberyGsibbery Posts: 11Member
    The volatile keyword acts as a "data type qualifier". The qualifier alters the default why in which the compiler handles the variable and does not attempt to optimize the storage referenced by it. Volatile basically means the storage is likely to change at anytime and be changed but something outside the control of the user program. This means that if you reference the variable, the program should always check the physical address (ie a mapped input fifo), and not use it in a cashed way.
Sign In or Register to comment.