2 * The UCW Library -- Resources for File Descriptors
4 * (c) 2008 Martin Mares <mj@ucw.cz>
6 * This software may be freely distributed and used according to the terms
7 * of the GNU Lesser General Public License.
11 #include <ucw/resource.h>
17 fd_res_free(struct resource *r)
19 close((int)(intptr_t) r->priv);
23 fd_res_dump(struct resource *r, uint indent UNUSED)
25 printf(" fd=%d\n", (int)(intptr_t) r->priv);
28 static const struct res_class fd_res_class = {
37 return res_new(&fd_res_class, (void*)(intptr_t) fd);
44 struct respool *rp = rp_new("test", NULL);