2 * Copyright (c) 2000-2001 Silicon Graphics, Inc.
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License as
7 * published by the Free Software Foundation.
9 * This program is distributed in the hope that it would 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 this program; if not, write the Free Software Foundation,
16 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 /* Given an object's handle, print the filesystem handle. */
25 /*---------------------------------------------------------------------------
27 Test program used to test dm_handle_to_fshandle(). The command line is:
29 handle_to_fshandle handle
31 where handle is an object's handle.
33 ----------------------------------------------------------------------------*/
42 fprintf(stderr, "usage:\t%s handle\n", Progname);
59 Progname = strrchr(argv[0], '/');
70 (void)dm_init_service(&name);
72 if ((error = atohan(han_str, &hanp, &hlen)) != 0) {
73 fprintf(stderr, "atohan() failed, %s\n", strerror(error));
77 if (dm_handle_to_fshandle(hanp, hlen, &fshanp, &fshlen) != 0) {
78 fprintf(stderr, "dm_handle_to_fshandle failed, %s\n",
82 hantoa(fshanp, fshlen, buffer);
83 fprintf(stdout, "%s\n", buffer);
85 dm_handle_free(hanp, hlen);
86 dm_handle_free(fshanp, fshlen);