1 .\" Copyright (c) 1995 Michael Chastain (mec@duracef.shout.net), 22 July 1995.
3 .\" %%%LICENSE_START(GPLv2+_DOC_FULL)
4 .\" This is free documentation; you can redistribute it and/or
5 .\" modify it under the terms of the GNU General Public License as
6 .\" published by the Free Software Foundation; either version 2 of
7 .\" the License, or (at your option) any later version.
9 .\" The GNU General Public License's references to "object code"
10 .\" and "executables" are to be interpreted as the output of any
11 .\" document formatting or typesetting system, including
12 .\" intermediate and printed output.
14 .\" This manual is distributed in the hope that it will be useful,
15 .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
16 .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 .\" GNU General Public License for more details.
19 .\" You should have received a copy of the GNU General Public
20 .\" License along with this manual; if not, see
21 .\" <http://www.gnu.org/licenses/>.
24 .TH MODIFY_LDT 2 2012-07-13 "Linux" "Linux Programmer's Manual"
26 modify_ldt \- get or set ldt
29 .B #include <sys/types.h>
31 .BI "int modify_ldt(int " "func" ", void *" "ptr" ", unsigned long " "bytecount" );
35 There is no glibc wrapper for this system call; see NOTES.
38 reads or writes the local descriptor table (ldt) for a process.
39 The ldt is a per-process memory management table used by the i386 processor.
40 For more information on this table, see an Intel 386 processor handbook.
46 reads the ldt into the memory pointed to by
48 The number of bytes read is the smaller of
50 and the actual size of the ldt.
56 modifies one ldt entry.
63 must equal the size of this structure.
65 .\" FIXME ? say something about func == 2 and func == 0x11?
66 .\" In Linux 2.4, func == 2 returned "the default ldt"
67 .\" In Linux 2.6, func == 2 is a nop, returning a zeroed out structure.
68 .\" Linux 2.4 and 2.6 implement an operation for func == 0x11
72 structure is defined in \fI<asm/ldt.h>\fP as:
77 unsigned int entry_number;
78 unsigned long base_addr;
80 unsigned int seg_32bit:1;
81 unsigned int contents:2;
82 unsigned int read_exec_only:1;
83 unsigned int limit_in_pages:1;
84 unsigned int seg_not_present:1;
85 unsigned int useable:1;
90 In Linux 2.4 and earlier, this structure was named
91 .IR modify_ldt_ldt_s .
93 .\" The ldt is specific for the calling process. Any attempts to change
94 .\" the ldt to include the address space of another process or the kernel
95 .\" will result in a segmentation violation when trying to access the memory
96 .\" outside of the process address space. The memory protection is enforced
97 .\" at the paging layer.
101 returns either the actual number of bytes read (for reading)
107 to indicate the error.
112 points outside the address space.
121 is not equal to the size of the structure
122 .IR modify_ldt_ldt_s ,
125 is 1 and the new ldt entry has invalid values.
131 This call is Linux-specific and should not be used in programs intended
134 Glibc does not provide a wrapper for this system call; call it using
139 This page is part of release 3.68 of the Linux
142 A description of the project,
143 information about reporting bugs,
144 and the latest version of this page,
146 \%http://www.kernel.org/doc/man\-pages/.