Re: Process Information

>>Laurent: It is not important, since we >compile in 32bits mode, long and int are >compatible.>>It is better to be correct in all modes.yes, I agree for a long program, but what I mean is that it doesn't change the result

>>if you want to avoid them just replace>>The correct typedef is time_t, not int nor >long. See time(2).

>>time(&t);

>A faster version that doesn't make the >kernel sweat is:>t = time(NULL);

Indeed you avoid the copyout of a longwhich for a repetitive program run could have side effect

>>char buf[255];>>strftime(buf, 256, "%y/%m/%d %H:%M:%S", >localtime(&t));>>Instead of getting the sizes wrong, you >should use sizeof, provided buf isn't a>parm:>strftime(buf, sizeof(buf), "%y/%m/%d >%H:%M:%S", localtime(&t));Yes; indeed it is much better and due to quick and dirty copy/past. ( at least a 256 would have been better even if in that case,it will have no side effect since the format output is much smaller than the 256 bytes)

>>#include >Note: The correct ANSI C header is .yes, it is old habits, like the old style main declaration,main(c,v)int c;char **v;

the new way is main(int c,char *v[])you could also tell that #include is missing so printf will not be prototyped.