1 /* This file is part of GDBM test suite.
2 Copyright (C) 2011 Free Software Foundation, Inc.
4 GDBM is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2, or (at your option)
9 GDBM is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with GDBM. If not, see <http://www.gnu.org/licenses/>.
25 ntos (int n, char *buf, size_t size)
44 main (int argc, char *argv[])
51 fprintf (stderr, "usage: %s PATH-TO-FDOP\n", argv[0]);
56 d = gdbm_open ("file.db", 0, GDBM_NEWDB|GDBM_CLOEXEC, 0600, NULL);
59 fprintf (stderr, "gdbm_open: %s\n", gdbm_strerror (gdbm_errno));
62 if (gdbm_reorganize (d))
64 fprintf (stderr, "gdbm_reorganize: %s\n",
65 gdbm_strerror (gdbm_errno));
68 execl (argv[1], "fdop",
69 ntos (gdbm_fdesc (d), fdbuf, sizeof (fdbuf)), NULL);