Internal time service in inetd-0.16-7 is not working at all. This "external" server: ==cut here== #include <fcntl.h> #include <sys/time.h> #include <unistd.h> #include <arpa/inet.h> #include <syslog.h> /* functions machtime and machtime_stream are taken from inetd sources and slightly modified */ static unsigned long machtime(void) { struct timeval tv; if (gettimeofday(&tv, (struct timezone *)0) < 0) { syslog(LOG_ERR, "Unable to get time of day\n"); return (0L); } return (htonl((unsigned long)tv.tv_sec + 2208988800UL)); } void machtime_stream(int s) { unsigned long result; result = machtime(); write(s, (char *) &result, sizeof(result)); } int main (int argc, char **argv) { openlog ("mytimed", LOG_PID | LOG_ODELAY, LOG_DAEMON); machtime_stream(0); closelog(); return 0; } ==cut here== IS working on the same machine. What's wrong?
Now it is working. I don't know why. Probably there is something wrong between the keyboard and the chair ;-) Sorry.