[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Problem with semaphores and such.
- To: Oded Arbel <odeda-linux-il(at-nospam)betalfa.org.il>
- Subject: Re: Problem with semaphores and such.
- From: Oleg Goldshmidt <ogoldshmidt(at-nospam)computer.org>
- Date: 02 May 2001 17:15:50 +0300
- Cc: Linux-IL Mailing list <linux-il(at-nospam)cs.huji.ac.il>
- In-Reply-To: Oded Arbel's message of "Wed, 2 May 2001 15:45:32 +0000 (/etc/localtime)"
- Organization: Speaking for myself only.
- Original-Sender: ogoldshmidt@computer.org
- References: <Pine.LNX.4.30.0105021540060.13536-100000@europa.betalfa.org.il>
- Reply-To: ogoldshmidt(at-nospam)computer.org
- Sender: ogoldshmidt(at-nospam)comgates.co.il
- Sender: linux-il-bounce(at-nospam)cs.huji.ac.il
- User-Agent: Gnus/5.0807 (Gnus v5.8.7) XEmacs/21.1 (Cuyahoga Valley)
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.
--
Oleg Goldshmidt | ogoldshmidt@NOSPAM.computer.org
"I'd rather write programs to write programs than write programs."
=================================================================
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