Problem
If I use semctl(2) in a program compiled using the C compiler
included with the UnixWare/OpenServer Development Kit (UDK) 7.0.0,
it will dump core. For example:#include <stdio.h>
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/sem.h>main (){
int id, key, nbEntry, ret;
struct semid_ds ds;union semun { int val; struct semid_ds *buf; ushort *array; } arg ;
key = 4000; nbEntry = 6 ; arg.buf = &ds ;
id = semget(key, nbEntry, IPC_CREAT | 0666);ret = semctl(id, 0, IPC_STAT, arg.buf) ;
printf("semctl returns (%d)\n", ret);
}If the above code is compiled with /udk/usr/ccs/bin/cc, and then run, it should print:
semctl returns (0)Instead, it fails with:Memory fault(coredump) Solution
This problem has been in fixed in OSS495b.
This is availble for download from:https://ftp.scoexpert.com/SLS See also
TA109827 "What problems are addressed by OSS495B, the OSRcompat Patch,and how is it installed?".
The manual pages for semctl(2) and semget(2).