Re: getservbyname function gives me problems
From: Fletcher Glenn (fletcher_at_removethisfoglight.com)
Date: 06/27/05
- Previous message: William Ahern: "Re: poll() returns POLLIN but no data ?"
- In reply to: Rajan: "getservbyname function gives me problems"
- Next in thread: Rajan: "Re: getservbyname function gives me problems"
- Reply: Rajan: "Re: getservbyname function gives me problems"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Mon, 27 Jun 2005 20:16:13 GMT
Rajan wrote:
> Hi,
> On SunOS 5.6 my program looked like this:-
>
> #include <stdio.h>
> #include <netdb.h>
>
> int main()
> {
> struct servent *serv;
> serv = getservbyname("ftp","tcp");
> printf("%d\n",serv->s_port);
> return 0;
> }
>
> When I compiled this using gcc port.c -lxnet I got the following
> warnings and errors, can you figure out what it is?
>
> In file included from /usr/include/sys/turnstile.h:12,
> from /usr/include/sys/t_lock.h:20,
> from /usr/include/sys/vnode.h:37,
> from /usr/include/sys/stream.h:21,
> from /usr/include/netinet/in.h:38,
> from /usr/include/netdb.h:96,
> from port.c:2:
> /opt/gnu/lib/gcc-lib/sparc-sun-solaris2.5/2.7.2.1/include/sys/param.h:187:
> warning: `NBBY' redefined
> /usr/include/sys/select.h:45: warning: this is the location of the
> previous definition
> In file included from /usr/include/sys/stream.h:26,
> from /usr/include/netinet/in.h:38,
> from /usr/include/netdb.h:96,
> from port.c:2:
> /usr/include/sys/model.h:32: #error "No DATAMODEL_NATIVE specified"
>
Works fine for me on SunOS5.6 using a native compiler. From the output
above, it looks like you have some gnu compiler header issues.
-- Fletcher Glenn
- Previous message: William Ahern: "Re: poll() returns POLLIN but no data ?"
- In reply to: Rajan: "getservbyname function gives me problems"
- Next in thread: Rajan: "Re: getservbyname function gives me problems"
- Reply: Rajan: "Re: getservbyname function gives me problems"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|