There are two Linux kernel functions: get_ds() and get_fs()According to this article, I know ds is short for data segment.However, I cannot guess what fs is short for.Any explanations?
What is fs short for in kernel function get_fs()?
linux;kernel;linux kernel;conventions;api
The FS comes from the additional segment register named FS on the 386 architecture (end of second paragraph).My guess is that after DS for Data Segment and  ES for Extra Segment Intel just went for the next characters in the alphabet (FS, GS). You can see the 386 register on the wiki page, on the graphic on the right side.From the linux kernel source on my Linux Mint system (arch/x86/include/asm/uaccess.h):/* * The fs value determines whether argument validity checking should be * performed or not.  If get_fs() == USER_DS, checking is performed, with * get_fs() == KERNEL_DS, checking is bypassed. * * For historical reasons, these macros are grossly misnamed. */#define MAKE_MM_SEG(s)  ((mm_segment_t) { (s) })#define KERNEL_DS       MAKE_MM_SEG(-1UL)#define USER_DS         MAKE_MM_SEG(TASK_SIZE_MAX)#define get_ds()        (KERNEL_DS)#define get_fs()        (current_thread_info()->addr_limit)#define set_fs(x)       (current_thread_info()->addr_limit = (x))