|
Lines 41-44
Link Here
|
| 41 |
#include <compat/linux/linux_util.h> |
41 |
#include <compat/linux/linux_util.h> |
| 42 |
|
42 |
|
|
|
43 |
struct linux_seminfo { |
| 44 |
int semmap; |
| 45 |
int semmni; |
| 46 |
int semmns; |
| 47 |
int semmnu; |
| 48 |
int semmsl; |
| 49 |
int semopm; |
| 50 |
int semume; |
| 51 |
int semusz; |
| 52 |
int semvmx; |
| 53 |
int semaem; |
| 54 |
}; |
| 55 |
|
| 56 |
struct linux_shminfo { |
| 57 |
int shmmax; |
| 58 |
int shmmin; |
| 59 |
int shmmni; |
| 60 |
int shmseg; |
| 61 |
int shmall; |
| 62 |
}; |
| 63 |
|
| 64 |
struct linux_shm_info { |
| 65 |
int used_ids; |
| 66 |
unsigned long shm_tot; /* total allocated shm */ |
| 67 |
unsigned long shm_rss; /* total resident shm */ |
| 68 |
unsigned long shm_swp; /* total swapped shm */ |
| 69 |
unsigned long swap_attempts; |
| 70 |
unsigned long swap_successes; |
| 71 |
}; |
| 72 |
|
| 43 |
struct linux_ipc_perm { |
73 |
struct linux_ipc_perm { |
| 44 |
linux_key_t key; |
74 |
linux_key_t key; |
|
Lines 183-186
Link Here
|
| 183 |
{ |
213 |
{ |
| 184 |
struct linux_semid_ds linux_semid; |
214 |
struct linux_semid_ds linux_semid; |
|
|
215 |
struct linux_seminfo linux_seminfo; |
| 185 |
struct semid_ds bsd_semid; |
216 |
struct semid_ds bsd_semid; |
| 186 |
struct __semctl_args /* { |
217 |
struct __semctl_args /* { |
|
Lines 238-242
Link Here
|
| 238 |
return __semctl(p, &bsd_args); |
269 |
return __semctl(p, &bsd_args); |
| 239 |
case LINUX_IPC_STAT: |
270 |
case LINUX_IPC_STAT: |
| 240 |
bsd_args.cmd = IPC_STAT; |
271 |
case LINUX_SEM_STAT: |
|
|
272 |
if( args->arg3 == IPC_STAT ) |
| 273 |
bsd_args.cmd = IPC_STAT; |
| 274 |
else |
| 275 |
bsd_args.cmd = SEM_STAT; |
| 241 |
unptr = stackgap_alloc(&sg, sizeof(union semun *)); |
276 |
unptr = stackgap_alloc(&sg, sizeof(union semun *)); |
| 242 |
dsp = stackgap_alloc(&sg, sizeof(struct semid_ds)); |
277 |
dsp = stackgap_alloc(&sg, sizeof(struct semid_ds)); |
|
Lines 255-259
Link Here
|
| 255 |
if (error) |
290 |
if (error) |
| 256 |
return error; |
291 |
return error; |
|
|
292 |
p->p_retval[0] = IXSEQ_TO_IPCID(bsd_args.semid, bsd_semid.sem_perm); |
| 257 |
return copyout((caddr_t)&linux_semid, ldsp, sizeof(linux_semid)); |
293 |
return copyout((caddr_t)&linux_semid, ldsp, sizeof(linux_semid)); |
|
|
294 |
case LINUX_IPC_INFO: |
| 295 |
case LINUX_SEM_INFO: |
| 296 |
error = copyin(args->ptr, &ldsp, sizeof(ldsp)); |
| 297 |
if (error) |
| 298 |
return error; |
| 299 |
bcopy(&seminfo, &linux_seminfo, sizeof(linux_seminfo) ); |
| 300 |
/* XXX |
| 301 |
#define used_semids 10 |
| 302 |
#define used_sems 10 |
| 303 |
linux_seminfo.semusz = used_semids; |
| 304 |
linux_seminfo.semaem = used_sems; |
| 305 |
} */ |
| 306 |
error = copyout((caddr_t)&linux_seminfo, ldsp, |
| 307 |
sizeof(linux_seminfo) ); |
| 308 |
if (error) |
| 309 |
return error; |
| 310 |
p->p_retval[0] = seminfo.semmni; |
| 311 |
return(0); |
| 258 |
case LINUX_GETALL: |
312 |
case LINUX_GETALL: |
| 259 |
/* FALLTHROUGH */ |
313 |
/* FALLTHROUGH */ |