On Tue, Apr 12, 2016 at 02:57:47PM +0800, Fei Jie wrote: [...] > --- /dev/null > +++ b/tests/semop.c > @@ -0,0 +1,45 @@ > +#include "tests.h" > +#include <sys/types.h> > +#include <sys/ipc.h> > +#include <sys/sem.h> > +#include <stdio.h> > +#include <unistd.h> > + > +union semun > +{ > + int val; > + struct semid_ds *buf; > + unsigned short *array; > + struct seminfo *__buf; > +}; > + > +int > +main(void) > +{ > + int sem_id = semget(IPC_PRIVATE, 1, 0600); > + if (sem_id <0) > + perror_msg_and_fail("semget");
There are kernels built without CONFIG_SYSVIPC enabled, so this error shouldn't be treated as fatal. > + union semun sem_union; > + sem_union.val = 0; > + if (semctl(sem_id, 0, SETVAL, sem_union) == -1) > + perror_msg_and_fail("semctl"); All resources allocated by semget must be explicitly released, see e.g. tests/ipc_sem.c -- ldv
pgpgRwnwPIuLF.pgp
Description: PGP signature
------------------------------------------------------------------------------ Find and fix application performance issues faster with Applications Manager Applications Manager provides deep performance insights into multiple tiers of your business applications. It resolves application problems quickly and reduces your MTTR. Get your free trial! https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________ Strace-devel mailing list Strace-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/strace-devel