long int offset;
errno = 0;
- offset = strtol(p, &last_char, 0);
+ offset = strtol(p, &last_char, 0);
if (0 == errno && '\0' == *last_char &&
offset >= 0 && offset <= 0xFFFFFF) {
macaddr[3] = (offset & 0xFF0000) >> 16;
p++;
}
}
- return 0;
+ return 0;
}
return -1;
if (setrlimit(RLIMIT_MEMLOCK, &rl) != 0)
perror("setrlimit(RLIMIT_MEMLOCK)");
#endif
-
+
LIST_INIT (&vm_change_state_head);
#ifndef _WIN32
{
{
/* Could easily be extended to 64 devices if needed */
const char *p;
-
+
boot_devices_bitmap = 0;
for (p = boot_devices; *p != '\0'; p++) {
/* Allowed boot devices are:
close(fd);
}
-
+
if (dom0_input)
dom0_driver_init(dom0_input);
#endif
return 0;
}
+
+char *get_time(void)
+{
+ char buff[128];
+ char *str;
+ struct timeval tv;
+
+ gettimeofday(&tv, NULL);
+ str = malloc(256);
+ strftime(buff, 128, "%T", localtime(&tv.tv_sec));
+ sprintf(str, "%s:%06d", buff, tv.tv_usec);
+ return str;
+}