Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com X-Originating-IP: [62.1.141.152] From: "antreas z" To: cygwin AT cygwin DOT com Subject: semaphores Date: Sun, 22 Dec 2002 18:43:01 +0000 Mime-Version: 1.0 Content-Type: text/plain; format=flowed Message-ID: X-OriginalArrivalTime: 22 Dec 2002 18:43:02.0122 (UTC) FILETIME=[F4E99CA0:01C2A9E9] Note-from-DJ: This may be spam hi.I'm new to this project and i have much more to learn about it.But i have a very urgent question.When i try to compile the following code which is compiled succesfully on a Sun Unix maschine i get the following error synch.h no such file sys/ipc.h no such file sema_t undeclared. Can u tell me which libraries i have to work with so that i can use semaphores?? thanx. #include #include #include extern int errno; main() { /*sema_t spreal; */ sema_t sp; int retval; /* Initialize the semaphore. */ retval = sema_init(&sp,2, USYNC_PROCESS, (void*)0 ); if (retval != 0) { perror("Couldn't initialize."); exit(3); } retval = sema_trywait(&sp); printf("Did trywait. Returned %d >\n", retval); getchar(); retval = sema_trywait(&sp); printf("Did trywait. Returned %d >\n", retval); getchar(); retval = sema_trywait(&sp); printf("Did trywait. Returned %d >\n", retval); getchar(); sema_destroy(&sp); } _________________________________________________________________ MSN 8 with e-mail virus protection service: 3 months FREE*. http://join.msn.com/?page=features/virus&xAPID=42&PS=47575&PI=7324&DI=7474&SU= http://www.hotmail.msn.com/cgi-bin/getmsg&HL=1216hotmailtaglines_eliminateviruses_3mf -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/