1MODIFY_LDT(2)              Linux Programmer's Manual             MODIFY_LDT(2)
2
3
4

NAME

6       modify_ldt - get or set ldt
7

SYNOPSIS

9       #include <sys/types.h>
10
11       int modify_ldt(int func, void *ptr, unsigned long bytecount);
12
13       Note: There is no glibc wrapper for this system call; see NOTES.
14

DESCRIPTION

16       modify_ldt()  reads  or  writes  the local descriptor table (ldt) for a
17       process.  The ldt is a per-process memory management table used by  the
18       i386  processor.   For more information on this table, see an Intel 386
19       processor handbook.
20
21       When func is 0, modify_ldt() reads the ldt into the memory  pointed  to
22       by  ptr.   The number of bytes read is the smaller of bytecount and the
23       actual size of the ldt.
24
25       When func is 1, modify_ldt() modifies one ldt entry.  ptr points  to  a
26       user_desc  structure  and  bytecount must equal the size of this strucā€
27       ture.
28
29       The user_desc structure is defined in <asm/ldt.h> as:
30
31           struct user_desc {
32               unsigned int  entry_number;
33               unsigned long base_addr;
34               unsigned int  limit;
35               unsigned int  seg_32bit:1;
36               unsigned int  contents:2;
37               unsigned int  read_exec_only:1;
38               unsigned int  limit_in_pages:1;
39               unsigned int  seg_not_present:1;
40               unsigned int  useable:1;
41           };
42
43       In Linux 2.4 and earlier, this structure was named modify_ldt_ldt_s.
44

RETURN VALUE

46       On success, modify_ldt() returns either the actual number of bytes read
47       (for  reading) or 0 (for writing).  On failure, modify_ldt() returns -1
48       and sets errno to indicate the error.
49

ERRORS

51       EFAULT ptr points outside the address space.
52
53       EINVAL ptr is 0, or func is 1 and bytecount is not equal to the size of
54              the  structure  modify_ldt_ldt_s,  or  func is 1 and the new ldt
55              entry has invalid values.
56
57       ENOSYS func is neither 0 nor 1.
58

CONFORMING TO

60       This call is Linux-specific and should not be used in programs intended
61       to be portable.
62

NOTES

64       Glibc  does  not  provide a wrapper for this system call; call it using
65       syscall(2).
66

SEE ALSO

68       vm86(2)
69

COLOPHON

71       This page is part of release 3.53 of the Linux  man-pages  project.   A
72       description  of  the project, and information about reporting bugs, can
73       be found at http://www.kernel.org/doc/man-pages/.
74
75
76
77Linux                             2012-07-13                     MODIFY_LDT(2)
Impressum