blob: fd14d10fa53e00d37be5c7a296da6662364f27eb [file] [log] [blame]
Tim Rikercf932742002-12-14 01:58:59 +00001/*
2 Copyright (C) 2002 Tim Riker <Tim@Rikers.org>
3 everyone seems to claim it someplace. ;-)
4*/
5
6#include <errno.h>
7
8#include "libbb.h"
9
10int query_module(const char *name, int which, void *buf, size_t bufsize, size_t *ret);
11
12int my_query_module(const char *name, int which, void **buf,
13 size_t *bufsize, size_t *ret)
14{
15 int my_ret;
16
17 my_ret = query_module(name, which, *buf, *bufsize, ret);
18
19 if (my_ret == -1 && errno == ENOSPC) {
20 *buf = xrealloc(*buf, *ret);
21 *bufsize = *ret;
22
23 my_ret = query_module(name, which, *buf, *bufsize, ret);
24 }
25
26 return my_ret;
27}
28
29