1 /* Copyright (c) 1998 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.
3 Contributed by Thorsten Kukuk <kukuk@vt.uni-paderborn.de>, 1998.
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public License as
7 published by the Free Software Foundation; either version 2 of the
8 License, or (at your option) any later version.
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details.
15 You should have received a copy of the GNU Library General Public
16 License along with the GNU C Library; see the file COPYING.LIB. If not,
17 write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. */
23 #include <sys/types.h>
29 int sock
= __nscd_open_socket ();
31 stat_response_header resp
;
36 fputs (_("nscd not running!\n"), stdout
);
40 req
.version
= NSCD_VERSION
;
43 nbytes
= write (sock
, &req
, sizeof (request_header
));
44 if (nbytes
!= sizeof (request_header
))
46 perror (_("write incomplete"));
51 nbytes
= read (sock
, &resp
, sizeof (stat_response_header
));
52 if (nbytes
!= sizeof (stat_response_header
))
54 perror (_("read incomplete"));
61 printf (_("nscd configuration:\n\n"));
62 printf (_("%12d server debug level\n\n"), resp
.debug_level
);
64 printf (_("passwd cache:\n\n"));
65 printf (_("%12s cache is enabled\n"), resp
.pw_enabled
? _("Yes") : _("No"));
66 printf (_("%12ld cache hits on positive entries\n"), resp
.pw_poshit
);
67 printf (_("%12ld cache hits on negative entries\n"), resp
.pw_neghit
);
68 printf (_("%12ld cache misses on positive entries\n"), resp
.pw_posmiss
);
69 printf (_("%12ld cache misses on negative entries\n"), resp
.pw_negmiss
);
70 printf (_("%12ld suggested size\n"), resp
.pw_size
);
71 printf (_("%12ld seconds time to live for positive entries\n"),
73 printf (_("%12ld seconds time to live for negative entries\n\n"),
76 printf (_("group cache:\n\n"));
77 printf (_("%12s cache is enabled\n"), resp
.gr_enabled
? _("Yes") : _("No"));
78 printf (_("%12ld cache hits on positive entries\n"), resp
.gr_poshit
);
79 printf (_("%12ld cache hits on negative entries\n"), resp
.gr_neghit
);
80 printf (_("%12ld cache misses on positive entries\n"), resp
.gr_posmiss
);
81 printf (_("%12ld cache misses on negative entries\n"), resp
.gr_negmiss
);
82 printf (_("%12ld suggested size\n"), resp
.gr_size
);
83 printf (_("%12ld seconds time to live for positive entries\n"),
85 printf (_("%12ld seconds time to live for negative entries\n"),