Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

tv_sec in sys/time.h (Developers)

posted by bocke, 21.07.2013, 18:12

> struct fd_set rfds;
> memset(&rfds,0,sizeof(fd_set));
> FD_ZERO(&rfds);
> FD_SET(0, &rfds);
> struct timeval tv;
> tv.tv_sec=0;
> tv.tv_usec=0;
> int i=select(1,&rfds,NULL,NULL,&tv);
>
> Hello, Can I ask You about part of code? I have #include <sys/time.h> and
> compiler writes err
> storage size tv isn`t know, How I can right declare tv ? Thank You for any
> idea,
>
> David

Just a quick guess, but you might try allocating the memory for the tv before its usage:

struct timeval tv;
tv = malloc (sizeof(struct timeval));
tv.tv_sec=0;
tv.tv_usec=0;

 

Complete thread:

Back to the forum
Board view  Mix view
22762 Postings in 2122 Threads, 402 registered users (0 online)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum