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 #include <linux/unistd.h>
11 #include <errno.h>
12
13 _syscall3(int, modify_ldt, int, func, void *, ptr,
14 unsigned long, bytecount)
15 /* Using syscall(2) may be preferable; see intro(2) */
16
17 int modify_ldt(int func, void *ptr, unsigned long bytecount);
18
20 modify_ldt() reads or writes the local descriptor table (ldt) for a
21 process. The ldt is a per-process memory management table used by the
22 i386 processor. For more information on this table, see an Intel 386
23 processor handbook.
24
25 When func is 0, modify_ldt() reads the ldt into the memory pointed to
26 by ptr. The number of bytes read is the smaller of bytecount and the
27 actual size of the ldt.
28
29 When func is 1, modify_ldt() modifies one ldt entry. ptr points to a
30 modify_ldt_ldt_s structure and bytecount must equal the size of this
31 structure.
32
34 On success, modify_ldt() returns either the actual number of bytes read
35 (for reading) or 0 (for writing). On failure, modify_ldt() returns -1
36 and sets errno.
37
39 EFAULT ptr points outside the address space.
40
41 EINVAL ptr is 0, or func is 1 and bytecount is not equal to the size of
42 the structure modify_ldt_ldt_s, or func is 1 and the new ldt
43 entry has invalid values.
44
45 ENOSYS func is neither 0 nor 1.
46
48 This call is Linux specific and should not be used in programs intended
49 to be portable.
50
52 vm86(2)
53
54
55
56Linux 1.3.6 1995-07-22 MODIFY_LDT(2)