diff options
Diffstat (limited to 'qemu/scripts/coverity-model.c')
-rw-r--r-- | qemu/scripts/coverity-model.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/qemu/scripts/coverity-model.c b/qemu/scripts/coverity-model.c index 617f67d71..ee5bf9d07 100644 --- a/qemu/scripts/coverity-model.c +++ b/qemu/scripts/coverity-model.c @@ -236,6 +236,23 @@ void *g_try_realloc(void *ptr, size_t size) return g_try_realloc_n(ptr, 1, size); } +/* Other memory allocation functions */ + +void *g_memdup(const void *ptr, unsigned size) +{ + unsigned char *dup; + unsigned i; + + if (!ptr) { + return NULL; + } + + dup = g_malloc(size); + for (i = 0; i < size; i++) + dup[i] = ((unsigned char *)ptr)[i]; + return dup; +} + /* * GLib string allocation functions */ @@ -325,6 +342,15 @@ char *g_strconcat(const char *s, ...) /* Other glib functions */ +typedef struct pollfd GPollFD; + +int poll(); + +int g_poll (GPollFD *fds, unsigned nfds, int timeout) +{ + return poll(fds, nfds, timeout); +} + typedef struct _GIOChannel GIOChannel; GIOChannel *g_io_channel_unix_new(int fd) { |