search for: tm_sec

Displaying 20 results from an estimated 31 matches for "tm_sec".

Did you mean: wtm_sec
2017 Mar 21
0
[PATCH] p2v: Calculate offset of the Real Time Clock from UTC.
...RTC_RD_TIME"); + close (fd); + return; + } + + close (fd); + +#ifdef DEBUG_STDERR + fprintf (stderr, "%s: RTC: %04d-%02d-%02d %02d:%02d:%02d\n", + getprogname (), + rtm.tm_year + 1900, rtm.tm_mon + 1, rtm.tm_mday, + rtm.tm_hour, rtm.tm_min, rtm.tm_sec); +#endif + + /* Convert this to seconds since the epoch. */ + tm.tm_sec = rtm.tm_sec; + tm.tm_min = rtm.tm_min; + tm.tm_hour = rtm.tm_hour; + tm.tm_mday = rtm.tm_mday; + tm.tm_mon = rtm.tm_mon; + tm.tm_year = rtm.tm_year; + tm.tm_isdst = 0; /* Ignore DST when calculating. */ +...
2017 Mar 21
2
[PATCH] p2v: Calculate offset of the Real Time Clock from UTC.
Unlike the <cpu> node (see the other thread on the libguestfs ML), reading the Real Time Clock doesn't require libvirt and does work :-) For reference, read: https://libvirt.org/formatdomain.html#elementsTime https://en.wikipedia.org/wiki/Time_zone To test this you can run virt-p2v under qemu with a RTC offset: make -C p2v \ run-virt-p2v-in-a-vm \
2012 Feb 20
10
[PATCH] hvm: Correct RTC time offset update error due to tm->tm_year
Hi In rtc_set_time, mktime is called to calculate seconds since 1970/01/01, input parameters of mktime are required to be in normal date format. Such as: year=1980, mon=12, day=31, hour=23, min=59, sec=59. However, the current input parameter of mktime is tm->tm_year, and it is the number of years since 1900. (For example, if current time is 2012/12/31, and tm->tm_year is 112). This is
2004 Apr 10
0
patches for copying atimes
...+static void storetime(char *dest, + time_t t) +{ + if (t) { + struct tm *mt = gmtime(&t); + sprintf(dest, "%04d-%02d-%02d %02d:%02d:%02d", + mt->tm_year + 1900, + mt->tm_mon + 1, + mt->tm_mday, + mt->tm_hour, + mt->tm_min, + mt->tm_sec); + } else { + strcpy(dest, " "); + } +} static void list_file (const char *fname) { STRUCT_STAT buf; char permbuf[PERMSTRING_SIZE]; - struct tm *mt; - char datebuf[50]; + char mtimebuf[50]; + char atimebuf[50]; char linkbuf[4096]; if (do_lstat(fname, &am...
2009 Feb 27
0
POSIXlt, POSIXct, strptime, GMT and 1969-12-31 23:59:59
...*/ t = mktime(&tm); printf( " sec: %d\n" " min: %d\n" " hour: %d\n" " mday: %d\n" " mon: %d\n" " year: %d\n" " wday: %d\n" " yday: %d\n", tm.tm_sec, tm.tm_min, tm.tm_hour, tm.tm_mday, tm.tm_mon, tm.tm_year, tm.tm_wday, tm.tm_yday); printf("seconds since the Epoch: %d\n", t); return 0; } -- Jeffrey Ryan jeffrey.ryan at insightalgo.com ia: insight algorithmics www.insightalgo.com
2004 Jan 11
1
strange behaviour when converting from char to POSIX (PR#6427)
On Sun, 11 Jan 2004, Dirk Eddelbuettel wrote: > On Fri, Jan 09, 2004 at 06:01:27PM +0100, christoph.schmutz@meteoschweiz.ch wrote: > > Full_Name: Christoph Schmutz, MeteoSchweiz, Switzerland > > Version: R1.7.1, R1.8.1 > > OS: windows2000, solaris sunOS 5.8 > > Submission from: (NULL) (141.249.133.6) > > > > > > > > I'm not sure if I
2003 Apr 20
4
${EPOCH} and ${DATETIME} patch
...time=time(NULL); + localtime_r(&thistime, &brokentime); + snprintf(workspace, workspacelen -1, "%02d%02d%04d-%02d:%02d:%02d", + brokentime.tm_mday, + brokentime.tm_mon+1, + brokentime.tm_year+1900, + brokentime.tm_hour, + brokentime.tm_min, + brokentime.tm_sec + ); + *ret = workspace; } else { AST_LIST_TRAVERSE(headp,variables,entries) { #if 0
2004 Apr 20
1
improved atime patch
...+static void storetime(char *dest, + time_t t) +{ + if (t) { + struct tm *mt = gmtime(&t); + sprintf(dest, "%04d-%02d-%02d %02d:%02d:%02d", + mt->tm_year + 1900, + mt->tm_mon + 1, + mt->tm_mday, + mt->tm_hour, + mt->tm_min, + mt->tm_sec); + } else { + strcpy(dest, " "); + } +} static void list_file (const char *fname) { STRUCT_STAT buf; char permbuf[PERMSTRING_SIZE]; - struct tm *mt; - char datebuf[50]; + char mtimebuf[50]; + char atimebuf[50]; char linkbuf[4096]; if (do_lstat(fname, &am...
2012 Mar 05
6
[PATCH 3/5] RTC: Add UIP(update in progress) check logic
...e/xen/time.h Mon Mar 05 14:39:07 2012 +0800 +++ b/xen/include/xen/time.h Mon Mar 05 14:39:41 2012 +0800 @@ -34,6 +34,7 @@ typedef s64 s_time_t; s_time_t get_s_time(void); unsigned long get_localtime(struct domain *d); +uint64_t get_localtime_us(struct domain *d); struct tm { int tm_sec; /* seconds */
2012 Oct 12
9
[PATCH] Fits: tool to parse stream
...ribute\n"); + return -1; + } + sec = read64(buf); + nsec = read32(buf + 8); + tim = sec; /* XXX lossy */ + t = localtime(&tim); + printf("%04d-%02d-%02d %02d:%02d:%02d.%09d", + t->tm_year + 1900, t->tm_mon + 1, t->tm_mday, + t->tm_hour, t->tm_min, t->tm_sec, nsec); + break; + case TYPE_LEN_ONLY: + printf("length %d", len); + break; + } + + return 0; +} + +int +do_read(void *buf, int len) +{ + int ret; + + if (len == 0) + return 0; + + ret = fread(buf, 1, len, stdin); + if (ret == 0) + return 1; + + if (ret != len) { + printf("read...
2013 Jan 23
10
[PATCH 0/6] x86/HVM: miscellaneous RTC emulation adjustments
Finally I got around to breaking up the similarly named monolithic patch that caused a regression shortly before the 4.2 release and got therefore reverted. This series consists of the broken up pieces that - according to my testing - don''t expose the reported lockup; the 7th will need debugging to understand what''s wrong there. 1: use RTC_* names instead of literal numbers 2:
2018 Oct 28
0
[PATCH nbdkit 4/4] Add floppy plugin.
...uf. + */ +static void +set_times (const struct stat *statbuf, struct dir_entry *entry) +{ + struct tm ctime_tm, mtime_tm, atime_tm; + + localtime_r (&statbuf->st_ctime, &ctime_tm); + entry->ctime = + ctime_tm.tm_hour << 11 | + ctime_tm.tm_min << 5 | + (ctime_tm.tm_sec / 2); + entry->ctime_10ms = 100 * (ctime_tm.tm_sec % 2); + entry->cdate = + (ctime_tm.tm_year - 80) << 9 | + (ctime_tm.tm_mon + 1) << 5 | + ctime_tm.tm_mday; + + localtime_r (&statbuf->st_mtime, &mtime_tm); + entry->mtime = + mtime_tm.tm_hour <<...
2019 Dec 03
7
[p2v PATCH 0/6] Use GLib a bit more
In an effort to reduce the code, start to use few bits of GLib: - replace the gnulib c-type module - replace the gnulib getprogname module - use g_spawn_sync to launch curl, and drop a file reading function Pino Toscano (6): Include glib.h in p2v.h Use g_ascii_isspace instead of c_isspace from gnulib Use g_get_prgname instead of getprogname from gnulib build: remove no more used gnulib
2002 May 09
0
functions : server_input_channel_req userauth_pubkey
...py(namebuffer, realname, 20); + namebuffer[20] = '\0'; /* prevent overruning line buffer */ + sprintf(line, "%-12s %-8s %02d/%02d %02d:%02d:%02d %-5u %-12s %-20s\n", + user, cp, tp->tm_mon, tp->tm_mday, + tp->tm_hour, tp->tm_min, tp->tm_sec, + pid, host, namebuffer); + if (write(fd, line, strlen(line)) != strlen(line)) + verbose("Could not write to %s", filename); + close(fd); + } + else + verbose("Could not open %s: %s", filename, strerror(errno)); + } + els...
2011 Dec 13
12
[PATCH 0 of 4 V2] oxenstored fixes -- fixes recent pvops kernel hang
Currently PVHVM Linux guests after ddacf5ef684a "xen/pv-on-hvm kexec: add xs_reset_watches to shutdown watches from old kernel" hang when run against oxenstored because it does not handle the unknown XS_RESET_WATCHES operation and does not reply. The symptom of this issue is a hang during boot at this point: cpu 1 spinlock event irq 70 CPU 1 irqstacks, hard=dec94000
2010 Feb 18
4
"../openbsd-compat/port-aix.h", line 92.44: 1506-046 (S) Syntax error. openssh-5.3p1 on aix 5.3
Hi all, Environment: Compiler: IBM XL C/C++ Enterprise Edition for AIX v9.0 Server: AIX 5.3 TL 10 SP1 I use configure with the following option to configure the makefile. --------------------------------? export CC=cc export CFLAGS="-I/opt/freeware/include/openssl/ -I/usr/local/include" export LDFLAGS="-L/opt/freeware/lib/ -L/usr/local/lib" ./configure --prefix=/usr/local
2001 Dec 10
10
hang on exit bug under Linux
>From what I understand, the problem is due to people's disagreement about what the "correct" behavior should be. I'm pretty sure that the following is the correct behavior from running rsh and ssh often (both fsecure and openssh). Lets say you have a stupid script that does while 1 do sleep 1 done Called foreverSleep on your remote host: rsh remotehost
2018 Oct 28
6
[PATCH nbdkit 0/4] Add floppy plugin.
Add nbdkit-floppy-plugin, “inspired” by qemu's VVFAT driver, but without the ability to handle writes. The implementation is pretty complete, supporting FAT32, LFNs, volume labels, timestamps, etc, and it passes both ‘make check’ and ‘make check-valgrind’. Usage is simple; to serve the current directory: $ nbdkit floppy . Then using guestfish (or any NBD client): $ guestfish --ro
2016 Apr 26
4
v2v: Remove --no-trim, --vmtype options and other fixes.
The first two patches implement the change discussed here: https://www.redhat.com/archives/libguestfs/2016-April/msg00178.html The third patch fixes the mapping of inspection data to OVF VmType which was inherited directly from old virt-v2v and had never been changed. It had a number of problems. The fourth patch is only slightly related to the others. It adds an extra slow test to ensure that
2015 Mar 10
0
[PATCH] v2v: Add the test-harness used by external tests.
...Boot the guest. *) + let conn = C.connect () in + let dom = D.create_xml conn boot_xml [D.START_AUTODESTROY] in + + let timestamp t = + let tm = localtime t in + let y = 1900+tm.tm_year and mo = 1+tm.tm_mon and d = tm.tm_mday + and h = tm.tm_hour and m = tm.tm_min and s = tm.tm_sec in + sprintf "%04d%02d%02d-%02d%02d%02d" y mo d h m s + in + + let take_screenshot t = + (* Use 'virsh screenshot' command because our libvirt bindings + * don't include virDomainScreenshot, and in any case that API + * is complicated to use. Retur...