DECL_TEMPLATE(darwin, shmdt); // 264
DECL_TEMPLATE(darwin, shmget); // 265
DECL_TEMPLATE(darwin, shm_open); // 266
-// NYI shm_unlink 267
+DECL_TEMPLATE(darwin, shm_unlink); // 267
DECL_TEMPLATE(darwin, sem_open); // 268
DECL_TEMPLATE(darwin, sem_close); // 269
DECL_TEMPLATE(darwin, sem_unlink); // 270
}
}
+PRE(shm_unlink)
+{
+ *flags |= SfMayBlock;
+ PRINT("shm_unlink ( %#lx(%s) )", ARG1,(char*)ARG1);
+ PRE_REG_READ1(long, "shm_unlink", const char *, pathname);
+ PRE_MEM_RASCIIZ( "shm_unlink(pathname)", ARG1 );
+}
+POST(shm_unlink)
+{
+ /* My reading of the man page suggests that a call may cause memory
+ mappings to change: "if no references exist at the time of the
+ call to shm_unlink(), the resources are reclaimed immediately".
+ So we need to resync here, sigh. */
+ ML_(sync_mappings)("after", "shm_unlink", 0);
+}
PRE(stat_extended)
{
MACXY(__NR_shmdt, shmdt),
MACX_(__NR_shmget, shmget),
MACXY(__NR_shm_open, shm_open),
-// _____(__NR_shm_unlink),
+ MACXY(__NR_shm_unlink, shm_unlink),
MACX_(__NR_sem_open, sem_open),
MACX_(__NR_sem_close, sem_close),
MACX_(__NR_sem_unlink, sem_unlink),