]> xenbits.xensource.com Git - libvirt.git/commit
virmock.h: Introduce VIR_MOCK_CALL_STAT
authorMichal Privoznik <mprivozn@redhat.com>
Fri, 13 May 2016 11:42:13 +0000 (13:42 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Sat, 14 May 2016 07:25:56 +0000 (09:25 +0200)
commit86d1705a8ace349b078616569418e6b7e2eca1aa
tree80826cc9b85a57a1764f6194ace5a6164d535e00
parenta1ffedc682de6a37fac19a2c9ae108acdab8deb0
virmock.h: Introduce VIR_MOCK_CALL_STAT

There is some magic going on when it comes to stat() or lstat().
Basically, stat() can either be a regular function, an inline
function that calls __xstat(_STAT_VER, ...) or a macro that does
the same as the inline func. Don't ask why is that, just read the
documentation in sys/stat.h and make sure you have a bucket next
to you. Anyway, currently there will not be both stat and __xstat
symbols at the same time, as one of them gets overwritten to the
other one during compilation. But this is not true anymore once
we start chaining our mocking libraries. Therefore we need a
wrapper that calls desired function from glibc.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
tests/vircgroupmock.c
tests/virmock.h
tests/virpcimock.c