RE: get_fs( ) and set_fs( )

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

 



I have seen the following codes, but do not know what's the meaning of them:
mm_segment_t old_fs;
old_fs = get_fs();
set_fs (KERNEL_DS);
     ........
set_fs(old_fs);
What is the usage of these codes and in what condition they will be used?


 If you want to invoke a sys call from the kernel space, then you need to save the kernel data segment before the call and restore that after you are done.
The piece of code you mention does exactly that.
 
Thanks,
Saumendra

[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