The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > High Level Programming
.
google unix.com



High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
no of arguments to function in shell script KiranKumarKarre Shell Programming and Scripting 2 06-10-2009 09:45 AM
Passing arguments to Perl Function Raynon Shell Programming and Scripting 1 02-16-2009 04:50 AM
count no of arguments passed to a function satish@123 Shell Programming and Scripting 2 05-21-2008 05:16 AM
arguments too long error kburrows Shell Programming and Scripting 0 07-21-2006 11:35 AM
How to pass arguments to a function in a shell script? preetikate Shell Programming and Scripting 3 03-01-2004 04:55 AM

Reply
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 1 Week Ago
konvalo konvalo is offline
Registered User
  
 

Join Date: Jan 2002
Posts: 20
Error: too many arguments to function 'sigwait'

Code:
#include <pthread.h>
#include <signal.h>
...
sigset_t mask;
int err,signo;
err=sigwait(&mask,&signo);
switch(signo){
   case SIGINT:
   ...
}
when I compile above code under solaris 10,it raise following error:
error: too many arguments to function 'sigwait'

I look up signal function under solaris10
int sigwiat(sigset_t *set);

How to correct above code to run my code?

Thanks
  #2 (permalink)  
Old 1 Week Ago
thegeek thegeek is online now
Registered User
  
 

Join Date: Apr 2009
Location: /usr/bin/vim
Posts: 434
it is not the solution, but a single question to you ...

Code:
 I look up signal function under solaris10
int sigwiat(sigset_t *set);    -----> single argument


Code:
err=sigwait(&mask,&signo);  ------> two argument
So, that is the problem ..
  #3 (permalink)  
Old 1 Week Ago
konvalo konvalo is offline
Registered User
  
 

Join Date: Jan 2002
Posts: 20
I know there are two arguments in sigwait(&mask,&signo),and there is single argument int sigwait(sigset_t *set) function, sigwait(&mask,&signo) can run under unix system,but can't run under solaris system. I want to know if there is a another function to realize the same function of sigwait(&mask,&signo) under solaris?

Thanks
  #4 (permalink)  
Old 1 Week Ago
Corona688 Corona688 is offline
Registered User
  
 

Join Date: Aug 2005
Location: Saskatchewan
Posts: 1,928
From here:
Code:
RETURN VALUES

     Upon  successful  completion,  sigwait()  returns  a  signal
     number.   Otherwise, it returns a value of -1 and sets errno
     to indicate an error.  Upon successful completion, the POSIX
     version  of  sigwait()  returns zero and stores the received
     signal number at the location pointed to by sig.  Otherwise,
     it returns the error number.
So the version without the pointer actually returns signo( or -1 on error ).
  #5 (permalink)  
Old 1 Week Ago
shamrock shamrock is offline Forum Advisor  
Registered User
  
 

Join Date: Oct 2007
Location: USA
Posts: 750
Dont know about Solaris but from here it looks like you need to define _POSIX_PTHREAD_SEMANTICS and include the threads lib on the compile line.
Sponsored Links
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 03:29 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0