modify_ldt(2) System Calls Manual modify_ldt(2) modify_ldt - LDT (libc -lc) #include /* Definition of struct user_desc */ #include /* Definition of SYS_* constants */ #include int syscall(unsigned long bytecount; SYS_modify_ldt, int func, void ptr[bytecount], unsigned long bytecount); : glibc modify_ldt() syscall(2). modify_ldt() (LDT) . LDT . LDT ( mm). LDT AMD. func 0 modify_ldt() LDT ptr. bytecount LDT LDT . modify_ldt() . func 1 0x11 modify_ldt() LDT ptr->entry_number. ptr user_desc bytecount . user_desc : struct user_desc { unsigned int entry_number; unsigned int base_addr; unsigned int limit; unsigned int seg_32bit:1; unsigned int contents:2; unsigned int read_exec_only:1; unsigned int limit_in_pages:1; unsigned int seg_not_present:1; unsigned int useable:1; }; 2.4 modify_ldt_ldt_s. contents ( ). modify_ldt() "accessed" . user_desc "" read_exec_only seg_not_present 1 0. LDT user_desc "" func 1 base limit 0. ( contents==3) func 1 seg_not_present 0. func 2 modify_ldt() . 2.4. modify_ldt() () 0 (). modify_ldt() -1 errno . EFAULT ptr . EINVAL ptr 0 func 1 bytecount user_desc func 1 0x11 LDT . ENOSYS func 0 1 2 0x11. . modify_ldt() . set_thread_area(2) arch_prctl(2) . modify_ldt() 16 32 . 16 . 64 modify_ldt() ( 64 ). "lm" user_desc . 64 3.19 "lm" user_desc . "lm" 32 32 . arch_prctl(2), set_thread_area(2), vm86(2) 3 . . : . 6.18 8 2026 modify_ldt(2)