[LIP] Query regarding timeval and gcc error message.

Shehjar Tikoo <shehjar_tikoo-/[email protected]>
Newsgroups gmane.user-groups.linux.india.programmers
Message-ID <[email protected]>
Hi everyone,

I want to create a domain socket but I am facing
 some  problem in the coding.I'd be grateful if 
someone could help.

1.
Heres the code:
-----------------CODE--------------
struct sockaddr_un uds_channel;
socklen_t len;
.....
.....
.....
len=SUN_LEN(&uds_channel);	/* NOTE: LINE 333 */
if((tmpfd=accept(listenfd, (struct sockaddr
*)uds_channel, &len)<0)) {
....
....
....
---------------CODE----------------

I am getting the error message below, when I compile
using gcc 3.2

------------GCC ERROR MESSAGE----------------------
delay_loop.c:334: error: cannot convert to a pointer
type.

And that, it says with reference to the len argument
to accept.

2.
I am getting this very silly error regarding the 
timeval structure which I want to use with select.

Heres the error I get while compiling:
------------GCC ERROR MESSAGE-----------------
delay_loop.c: In function `dl_run':
delay_loop.c:316: error: `timeval' undeclared (first
use in this function)
delay_loop.c:316: error: (Each undeclared identifier
is reported only once
delay_loop.c:316: error: for each function it appears
in.)
-----------GCC ERROR MESSAGE------------------

Even though I am including all the headers required:
sys/time.h
sys/types.h
sys/select.h
unistd.h

Please help and thanks in advance.

Shehjar


__________________________________
Do you Yahoo!?
Yahoo! Mail SpamGuard - Read only the mail you want.
http://antispam.yahoo.com/tools


-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
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.