5 * asmlinkage int sys_modify_ldt(int func, void __user *ptr, unsigned long bytecount)
14 #define ALLOCSIZE LDT_ENTRIES * LDT_ENTRY_SIZE
16 static void sanitise_modify_ldt(int childno
)
19 //struct user_desc *desc;
21 shm
->scratch
[childno
] = 0;
22 switch (shm
->syscall
[childno
].a1
) {
24 /* read the ldt into the memory pointed to by ptr.
25 The number of bytes read is the smaller of bytecount and the actual size of the ldt. */
26 ldt
= malloc(ALLOCSIZE
);
27 shm
->scratch
[childno
] = (unsigned long) ldt
;
30 shm
->syscall
[childno
].a3
= ALLOCSIZE
;
34 /* modify one ldt entry.
35 * ptr points to a user_desc structure
36 * bytecount must equal the size of this structure. */
39 unsigned int entry_number;
40 unsigned long base_addr;
42 unsigned int seg_32bit:1;
43 unsigned int contents:2;
44 unsigned int read_exec_only:1;
45 unsigned int limit_in_pages:1;
46 unsigned int seg_not_present:1;
47 unsigned int useable:1;
55 static void post_modify_ldt(int childno
)
59 ptr
= (void *) shm
->scratch
[childno
];
64 shm
->scratch
[childno
] = 0;
67 struct syscallentry syscall_modify_ldt
= {
77 .arg3name
= "bytecount",
78 .sanitise
= sanitise_modify_ldt
,
79 .post
= post_modify_ldt
,