Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!sdd.hp.com!spool.mu.edu!uunet!email!vmars!hp From: hp@vmars.tuwien.ac.at (Peter Holzer) Newsgroups: comp.os.minix Subject: Re: ok Message-ID: <1991Jun27.074248.1716@email.tuwien.ac.at> Date: 27 Jun 91 07:42:48 GMT References: <13990@mentor.cc.purdue.edu> Sender: news@email.tuwien.ac.at Organization: Technical University Vienna, Dept. for Realtime Systems, AUSTRIA Lines: 46 Nntp-Posting-Host: gipsy.vmars.tuwien.ac.at asg@sage.cc.purdue.edu (The Grand Master) writes: >HELP!! >Why are sigaddset, sigdelset, sigemptyset, and sigismember undefined!?!?!?? >If you wanna see where they are they are in /usr/include/signal.h >There are defined like: >_PROTOTYPE (sigdelset, (sigset_t *_set) ); /* or something like that */ >A friend of mine said that the a procedure defined with the _PROTOTYPE >call will be left unset if using a K&R compiler (That is what cc is right?) In C you have to distinguish between definitions and declarations. A definition defines an object, i.e. you tell the compiler what type and contents the object has. A declaration just tells the compiler that somewhere an object of the given type is defined. So if the compiler finds the declaration sigdelset (); /* This is what the _PROTOTYPE macro produces on a K&R compiler*/ it just knows that somewhere a function returning int taking an unknown number of unknown parameters exists. It cannot produce code from this, because you don't tell it what sigdelset should do. The definition of sigdelset is in some library file and looks like sigdelset (_set) sigset_t *_set; { /* code */ } From this the compiler can actually produce code. If the the file containing the definition of an object is not linked to the files where the object is used (because you don't have the file, or forgot to include it in the library, or whatever), the linker naturally complains (At least for functions, it can produce variables of known type by itself and initialize them to zero). Hope to have cleared up things a little bit. Peter. -- | _ | Peter J. Holzer | Think of it | | |_|_) | Technical University Vienna | as evolution | | | | | Dept. for Real-Time Systems | in action! | | __/ | hp@vmars.tuwien.ac.at | Tony Rand |