[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problem with semaphores and such.




Yes it does - thanks!

Now all I have to do is deal with the rest of my bugs ;-)

Oded


On 2 May 2001, Oleg Goldshmidt wrote:

> From: Oleg Goldshmidt <ogoldshmidt@computer.org>
> Oded Arbel <odeda-linux-il@betalfa.org.il> writes:
>
> > public:
> > 	CCritical(char* pathname) {
> > 		union semun semopts;
>
> This is an incomplete declaration, as the compiler tells you.
> A union is a struct in which all members are allocated at the same
> address. The declaration syntax is similar to that of structs.
>
> Usually, doing sth like
>
> egrep -n semun $(find /usr/include -name \*.h) /dev/null
>
> helps. In this case, you'll find the following in bits/sem.h
> (which is included by sys/sem.h):
>
> /* The user should define a union like the following to use it for arguments
>    for `semctl'.
>
>    union semun
>    {
>      int val;				<= value for SETVAL
>      struct semid_ds *buf;		<= buffer for IPC_STAT & IPC_SET
>      unsigned short int *array;		<= array for GETALL & SETALL
>      struct seminfo *__buf;		<= buffer for IPC_INFO
>    };
>
>    Previous versions of this file used to define this union but this is
>    incorrect.  One can test the macro _SEM_SEMUN_UNDEFINED to see whether
>    one must define the union or not.  */
>
> Hope it helps.
>
>


=================================================================
To unsubscribe, send mail to linux-il-request@linux.org.il with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail linux-il-request@linux.org.il