FreeBSD Bugzilla – Attachment 33167 Details for
Bug 54451
[patch] i386_get_ldt(2): i386_{get|set}_ldt manual page is confusing
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 2.12 KB, created by
Andreas Fuchs
on 2003-07-13 19:30:16 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
Andreas Fuchs
Created:
2003-07-13 19:30:16 UTC
Size:
2.12 KB
patch
obsolete
>--- /usr/src/lib/libc/i386/sys/i386_get_ldt.2 Sun Jun 22 14:18:31 2003 >+++ i386_get_ldt.2 Sun Jul 13 18:20:17 2003 >@@ -52,46 +52,60 @@ > The > .Fn i386_get_ldt > system call >-will return the list of i386 descriptors that the process has in its >-LDT. >+will copy the list of i386 descriptors that the process has in its >+LDT. It does so starting from the LDT entry index >+.Fa start_sel >+into an arrary pointed to by >+.Fa descs , >+which must be >+.Fa num_sel >+elements wide. >+.Pp > The > .Fn i386_set_ldt > system call > will set a list of i386 descriptors for the current process in its >-LDT. >-Both routines accept a starting selector number >-.Fa start_sel , >-an array of memory that >-will contain the descriptors to be set or returned >-.Fa descs , >-and the number of entries to set or return >-.Fa num_sels . >+LDT, starting from the LDT entry index >+.Fa start_sel . >+It copies >+.Fa num_descs >+descriptors in the array pointed to by >+.Fa descs >+into the LDT. > .Pp > The argument > .Fa descs > can be either segment_descriptor or gate_descriptor and are defined in > .Aq Pa i386/segments.h . > These structures are defined by the architecture >-as disjoint bit-fields, so care must be taken in constructing them. >+as disjoint bit-fields, so you must take care in constructing them. > .Sh RETURN VALUES >-Upon successful completion, >+If successful, > .Fn i386_get_ldt > returns the number of descriptors currently in the LDT. >-The > .Fn i386_set_ldt >-system call >-returns the first selector set. >-Otherwise, a value of -1 is returned and the global >+returns the index first selector that it set on success. If an error >+occurred, the procedures return a value of -1 and set the global > variable > .Va errno >-is set to indicate the error. >+to indicate the error. >+.Sh EXAMPLES >+To set the >+.Va "my_ldt_index" >+th slot of the process's LDT to the value of >+.Va my_ldt_entry , >+use something like this: >+.Bd -literal -offset indent >+if (i386_set_ldt(my_ldt_index, &my_ldt_entry, 1) < 0) { >+ perror("i386_set_ldt"); >+} > .Sh ERRORS > The > .Fn i386_get_ldt > and > .Fn i386_set_ldt > system calls >-will fail if: >+will fail with: > .Bl -tag -width Er > .It Bq Er EINVAL > An inappropriate value was used for
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 54451
: 33167