1MODIFY_LDT(2) Linux Programmer's Manual MODIFY_LDT(2)
2
3
4
6 modify_ldt - get or set ldt
7
9 #include <sys/types.h>
10
11 int modify_ldt(int func, void *ptr, unsigned long bytecount);
12
14 modify_ldt() reads or writes the local descriptor table (ldt) for a
15 process. The ldt is a per-process memory management table used by the
16 i386 processor. For more information on this table, see an Intel 386
17 processor handbook.
18
19 When func is 0, modify_ldt() reads the ldt into the memory pointed to
20 by ptr. The number of bytes read is the smaller of bytecount and the
21 actual size of the ldt.
22
23 When func is 1, modify_ldt() modifies one ldt entry. ptr points to a
24 user_desc structure and bytecount must equal the size of this strucā
25 ture.
26
27 The user_desc structure is defined in <asm/ldt.h> as:
28
29 struct user_desc {
30 unsigned int entry_number;
31 unsigned long base_addr;
32 unsigned int limit;
33 unsigned int seg_32bit:1;
34 unsigned int contents:2;
35 unsigned int read_exec_only:1;
36 unsigned int limit_in_pages:1;
37 unsigned int seg_not_present:1;
38 unsigned int useable:1;
39 };
40
41 In Linux 2.4 and earlier, this structure was named modify_ldt_ldt_s.
42
44 On success, modify_ldt() returns either the actual number of bytes read
45 (for reading) or 0 (for writing). On failure, modify_ldt() returns -1
46 and sets errno to indicate the error.
47
49 EFAULT ptr points outside the address space.
50
51 EINVAL ptr is 0, or func is 1 and bytecount is not equal to the size of
52 the structure modify_ldt_ldt_s, or func is 1 and the new ldt
53 entry has invalid values.
54
55 ENOSYS func is neither 0 nor 1.
56
58 This call is Linux-specific and should not be used in programs intended
59 to be portable.
60
62 Glibc does not provide a wrapper for this system call; call it using
63 syscall(2).
64
66 vm86(2)
67
69 This page is part of release 3.25 of the Linux man-pages project. A
70 description of the project, and information about reporting bugs, can
71 be found at http://www.kernel.org/doc/man-pages/.
72
73
74
75Linux 2007-06-01 MODIFY_LDT(2)