mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
The logging APIs need to be able to generate formatted timestamps
using only async signal safe functions. This rules out using
gmtime/localtime/malloc/gettimeday(!) and much more.
Introduce a new internal API which is async signal safe.
virTimeMillisNowRaw replacement for gettimeofday. Uses clock_gettime
where available, otherwise falls back to the unsafe
gettimeofday
virTimeFieldsNowRaw replacements for gmtime(), convert a timestamp
virTimeFieldsThenRaw into a broken out set of fields. No localtime()
replacement is provided, because converting to
local time is not practical with only async signal
safe APIs.
virTimeStringNowRaw replacements for strftime() which print a timestamp
virTimeStringThenRaw into a string, using a pre-determined format, with
a fixed size buffer (VIR_TIME_STRING_BUFLEN)
For each of these there is also a version without the Raw postfix
which raises a full libvirt error. These versions are not async
signal safe
* src/Makefile.am, src/util/virtime.c, src/util/virtime.h: New files
* src/libvirt_private.syms: New APis
* configure.ac: Check for clock_gettime in -lrt
* tests/virtimetest.c, tests/Makefile.am: Test new APIs
45 lines
614 B
Plaintext
45 lines
614 B
Plaintext
*.exe
|
|
.deps
|
|
.libs
|
|
ssh
|
|
commandhelper
|
|
commandhelper.log
|
|
commandhelper.pid
|
|
commandtest
|
|
conftest
|
|
esxutilstest
|
|
eventtest
|
|
interfacexml2xmltest
|
|
networkxml2xmltest
|
|
nodedevxml2xmltest
|
|
nodeinfotest
|
|
object-locking
|
|
object-locking-files.txt
|
|
object-locking.cmi
|
|
object-locking.cmx
|
|
qemuargv2xmltest
|
|
qemuhelptest
|
|
qemuxml2argvtest
|
|
qemuxml2xmltest
|
|
qparamtest
|
|
reconnect
|
|
secaatest
|
|
seclabeltest
|
|
sexpr2xmltest
|
|
sockettest
|
|
statstest
|
|
storagepoolxml2xmltest
|
|
storagevolxml2xmltest
|
|
utiltest
|
|
virbuftest
|
|
virnetmessagetest
|
|
virnetsockettest
|
|
virnettlscontexttest
|
|
virshtest
|
|
virtimetest
|
|
vmx2xmltest
|
|
xencapstest
|
|
xmconfigtest
|
|
xml2sexprtest
|
|
xml2vmxtest
|