RE: On Digital Unix V4.0F

[email protected]
Newsgroups gmane.network.netsaint.user
Message-ID <[email protected]>
Dear,
Thank you first for your help.
Let me be a little more specific.

The error I have got from the make is following:
-----------------------------------------------
netsaint.c: In function `main':
netsaint.c:289: elements of array `long_options' have incomplete type
netsaint.c:291: warning: excess elements in struct initializer
netsaint.c:291: warning: (near initialization for `long_options[0]')
netsaint.c:291: `no_argument' undeclared (first use in this function)
-----------------------------------------------

What we have at the netsaint.c:289 is followings:
-----------------------------------------------
#ifdef HAVE_GETOPT_H
        int option_index=0;
        static struct option long_options[]=
        {
                {"help",no_argument,0,'h'},
-----------------------------------------------

Since it's so famous that, with GNU getopt, we can use long option names,
I could imagine what's going wrong.
In the GNU's(or POSIX's, if you'd like) getopt.h, you have:
-----------------------------------------------
struct option
{
#if defined (__STDC__) && __STDC__
  const char *name;
#else
  char *name;
#endif
  /* has_arg can't be an enum because some compilers complain about
     type mismatches in all the code that assumes it is an int.  */
  int has_arg;
  int *flag;
  int val;
};

/* Names for the values of the `has_arg' field of `struct option'.  */

#define no_argument             0
-----------------------------------------------
This has come with GNU glibc.

As everybody knows, with getopt which comes with conventional UNIX,
no "struct option", and "no_argument" and other constants are defined.

> Wherever getop_long is called out in the nagios/netsaint code, it is
> ifdef'd so it should only be compiled if getopt_long exists. 
> But it does require a POSIX getopt. Is there no getopt at all in Digital
Unix?

Yeah, it's ifdef'd but looks like enabled checking only if getopt.h ever
exists.
The getopt.h does exists but different one. Doesn't define things like
"struct option".

> You may be able to install getopt (download from GNU; 
> ./configure; make etc)

Can I? But so far I haven't find a way to install only that separately from
the library. Please show me if you know where I can get more information on
this.

Thank you very much in advance.

> -----Original Message-----
> From: Karl DeBisschop [mailto:[email protected]]
> Sent: jeudi, 7. novembre 2002 13:56
> To: Stanley Hopcroft
> Cc: [email protected]; [email protected]
> Subject: Re: [netsaint] On Digital Unix V4.0F
> 
> 
> On Thu, 2002-11-07 at 01:11, Stanley Hopcroft wrote:
> > Dear Sir,
> > 
> > I am writing to thank you for your letter and say,
> > 
> > On Tue, Oct 29, 2002 at 04:52:57PM +0100, 
> [email protected] wrote:
> > > 
> > > Hi all,
> > > 
> > > I tried to install netsaint-0.0.7 on Digital Unix V4.0F 
> and failed.
> > > I saw in this list, a couple of you had the same problem 
> and asked for help
> > > but
> > > nobody have ever posted an answer.
> > > 
> > 
> > Unfortunately, Digital Unix is not as common as an Intel Unix or
> > Solaris; those that do have it may no longer be reading this list.
> > 
> > > On the netsaint web, it says it works on Digital Unix.
> > > http://www.netsaint.org/ports.php
> > > 
> > > But to compile it, we need GNU version of "getopt", which 
> is part of glibc.
> > > As far as I know, there is no version of glibc ever runs 
> on Digital Unix.
> > 
> > You may be mistaken about getopt being 'part of glibc'.
> 
> getopt is part of POSIX
> 
> > This FreeBSD host (4.7-RELEASE) has no glibc, but has a getopt
> 
> GNU getopt has a getopt_long_only function that we use in the 
> plugins to
> distinguish from the POSIX getopt. (The plugins also provide the code
> for GNU getopt where getopt_long does not exist).
> 
> Wherever getop_long is called out in the nagios/netsaint code, it is
> ifdef'd so it should only be compiled if getopt_long exists. 
> But it does
> require a POSIX getopt. Is there no getopt at all in Digital Unix?
> 
> If necessary, the getopt code used in the plugins could also 
> be carried
> over to nagios, i suppose.
> 
> --
> Karl
> 


-------------------------------------------------------
This sf.net email is sponsored by: See the NEW Palm 
Tungsten T handheld. Power & Color in a compact size!
http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0001en
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.