Revision 17e2377a cutils.c

b/cutils.c
95 95
    t += 3600 * tm->tm_hour + 60 * tm->tm_min + tm->tm_sec;
96 96
    return t;
97 97
}
98

  
99
void *get_mmap_addr(unsigned long size)
100
{
101
    return NULL;
102
}
103

  
104
void qemu_free(void *ptr)
105
{
106
    free(ptr);
107
}
108

  
109
void *qemu_malloc(size_t size)
110
{
111
    return malloc(size);
112
}
113

  
114
void *qemu_mallocz(size_t size)
115
{
116
    void *ptr;
117
    ptr = qemu_malloc(size);
118
    if (!ptr)
119
        return NULL;
120
    memset(ptr, 0, size);
121
    return ptr;
122
}
123

  
124
char *qemu_strdup(const char *str)
125
{
126
    char *ptr;
127
    ptr = qemu_malloc(strlen(str) + 1);
128
    if (!ptr)
129
        return NULL;
130
    strcpy(ptr, str);
131
    return ptr;
132
}

Also available in: Unified diff