MCPcopy Create free account
hub / github.com/F-Stack/f-stack / freebsd32_shmsys

Function freebsd32_shmsys

freebsd/kern/sysv_shm.c:1374–1419  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1372#ifdef COMPAT_FREEBSD32
1373
1374int
1375freebsd32_shmsys(struct thread *td, struct freebsd32_shmsys_args *uap)
1376{
1377
1378#if defined(COMPAT_FREEBSD4) || defined(COMPAT_FREEBSD5) || \
1379 defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD7)
1380 AUDIT_ARG_SVIPC_WHICH(uap->which);
1381 switch (uap->which) {
1382 case 0: { /* shmat */
1383 struct shmat_args ap;
1384
1385 ap.shmid = uap->a2;
1386 ap.shmaddr = PTRIN(uap->a3);
1387 ap.shmflg = uap->a4;
1388 return (sysent[SYS_shmat].sy_call(td, &ap));
1389 }
1390 case 2: { /* shmdt */
1391 struct shmdt_args ap;
1392
1393 ap.shmaddr = PTRIN(uap->a2);
1394 return (sysent[SYS_shmdt].sy_call(td, &ap));
1395 }
1396 case 3: { /* shmget */
1397 struct shmget_args ap;
1398
1399 ap.key = uap->a2;
1400 ap.size = uap->a3;
1401 ap.shmflg = uap->a4;
1402 return (sysent[SYS_shmget].sy_call(td, &ap));
1403 }
1404 case 4: { /* shmctl */
1405 struct freebsd7_freebsd32_shmctl_args ap;
1406
1407 ap.shmid = uap->a2;
1408 ap.cmd = uap->a3;
1409 ap.buf = PTRIN(uap->a4);
1410 return (freebsd7_freebsd32_shmctl(td, &ap));
1411 }
1412 case 1: /* oshmctl */
1413 default:
1414 return (EINVAL);
1415 }
1416#else
1417 return (nosys(td, NULL));
1418#endif
1419}
1420
1421#if defined(COMPAT_FREEBSD4) || defined(COMPAT_FREEBSD5) || \
1422 defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD7)

Callers

nothing calls this directly

Calls 2

nosysFunction · 0.85

Tested by

no test coverage detected