G_GNUC_UNUSED fun and other compiler warnings ...
This commit is contained in:
@@ -33,7 +33,7 @@
|
|||||||
|
|
||||||
glibtop_inodedb *
|
glibtop_inodedb *
|
||||||
glibtop_inodedb_open_s (glibtop *server, unsigned databases,
|
glibtop_inodedb_open_s (glibtop *server, unsigned databases,
|
||||||
unsigned long cachesize)
|
unsigned long G_GNUC_UNUSED cachesize)
|
||||||
{
|
{
|
||||||
glibtop_inodedb *inodedb;
|
glibtop_inodedb *inodedb;
|
||||||
char filename [BUFSIZ];
|
char filename [BUFSIZ];
|
||||||
@@ -76,7 +76,8 @@ glibtop_inodedb_open_s (glibtop *server, unsigned databases,
|
|||||||
}
|
}
|
||||||
|
|
||||||
const char *
|
const char *
|
||||||
glibtop_inodedb_lookup_s (glibtop *server, glibtop_inodedb *inodedb,
|
glibtop_inodedb_lookup_s (glibtop G_GNUC_UNUSED *server,
|
||||||
|
glibtop_inodedb *inodedb,
|
||||||
u_int64_t device, u_int64_t inode)
|
u_int64_t device, u_int64_t inode)
|
||||||
{
|
{
|
||||||
glibtop_inodedb_key key;
|
glibtop_inodedb_key key;
|
||||||
|
@@ -488,7 +488,7 @@ handle_signal (int sig)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
main (int argc, char *argv [])
|
main (int G_GNUC_UNUSED argc, char G_GNUC_UNUSED *argv [])
|
||||||
{
|
{
|
||||||
glibtop *server = glibtop_global_server;
|
glibtop *server = glibtop_global_server;
|
||||||
|
|
||||||
|
@@ -51,10 +51,8 @@ GLIBTOP_SUID_PROC_MAP;
|
|||||||
#include <locale.h>
|
#include <locale.h>
|
||||||
|
|
||||||
int
|
int
|
||||||
main(int argc, char *argv[])
|
main(int G_GNUC_UNUSED argc, char G_GNUC_UNUSED *argv[])
|
||||||
{
|
{
|
||||||
int fd, max_fd;
|
|
||||||
|
|
||||||
/* !!! WE ARE ROOT HERE - CHANGE WITH CAUTION !!! */
|
/* !!! WE ARE ROOT HERE - CHANGE WITH CAUTION !!! */
|
||||||
|
|
||||||
int uid, euid, gid, egid;
|
int uid, euid, gid, egid;
|
||||||
|
@@ -54,8 +54,10 @@ main (int argc, const char *argv [])
|
|||||||
if (!inodedb) exit (1);
|
if (!inodedb) exit (1);
|
||||||
|
|
||||||
filename = glibtop_inodedb_lookup (inodedb, device, inode);
|
filename = glibtop_inodedb_lookup (inodedb, device, inode);
|
||||||
if (!filename) exit (0);
|
if (!filename) exit (2);
|
||||||
|
|
||||||
fprintf (stderr, "FILENAME: %lu - %lu - '%s'\n",
|
fprintf (stderr, "FILENAME: %d - %d - '%s'\n",
|
||||||
device, inode, filename);
|
(int) device, (int) inode, filename);
|
||||||
|
|
||||||
|
exit (0);
|
||||||
}
|
}
|
||||||
|
@@ -29,7 +29,7 @@
|
|||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
|
||||||
int
|
int
|
||||||
main (int argc, const char *argv [])
|
main (int argc, char *argv [])
|
||||||
{
|
{
|
||||||
GDBM_FILE dbf;
|
GDBM_FILE dbf;
|
||||||
char dirname [BUFSIZ];
|
char dirname [BUFSIZ];
|
||||||
@@ -92,7 +92,7 @@ main (int argc, const char *argv [])
|
|||||||
directory = opendir (dirname);
|
directory = opendir (dirname);
|
||||||
if (!directory) continue;
|
if (!directory) continue;
|
||||||
|
|
||||||
while (entry = readdir (directory)) {
|
while ((entry = readdir (directory))) {
|
||||||
glibtop_inodedb_key key;
|
glibtop_inodedb_key key;
|
||||||
char filename [BUFSIZ];
|
char filename [BUFSIZ];
|
||||||
datum d_key, d_content;
|
datum d_key, d_content;
|
||||||
@@ -128,4 +128,6 @@ main (int argc, const char *argv [])
|
|||||||
gdbm_close (dbf);
|
gdbm_close (dbf);
|
||||||
|
|
||||||
fclose (f);
|
fclose (f);
|
||||||
|
|
||||||
|
exit (0);
|
||||||
}
|
}
|
||||||
|
@@ -103,7 +103,7 @@ adjust_blocks (blocks, fromsize, tosize)
|
|||||||
static int
|
static int
|
||||||
get_fs_usage (path, disk, fsp)
|
get_fs_usage (path, disk, fsp)
|
||||||
const char *path;
|
const char *path;
|
||||||
const char *disk;
|
const char G_GNUC_UNUSED *disk;
|
||||||
struct fs_usage *fsp;
|
struct fs_usage *fsp;
|
||||||
{
|
{
|
||||||
#ifdef STAT_STATFS3_OSF1
|
#ifdef STAT_STATFS3_OSF1
|
||||||
|
@@ -33,7 +33,7 @@
|
|||||||
|
|
||||||
glibtop_inodedb *
|
glibtop_inodedb *
|
||||||
glibtop_inodedb_open_s (glibtop *server, unsigned databases,
|
glibtop_inodedb_open_s (glibtop *server, unsigned databases,
|
||||||
unsigned long cachesize)
|
unsigned long G_GNUC_UNUSED cachesize)
|
||||||
{
|
{
|
||||||
glibtop_inodedb *inodedb;
|
glibtop_inodedb *inodedb;
|
||||||
char filename [BUFSIZ];
|
char filename [BUFSIZ];
|
||||||
@@ -76,7 +76,8 @@ glibtop_inodedb_open_s (glibtop *server, unsigned databases,
|
|||||||
}
|
}
|
||||||
|
|
||||||
const char *
|
const char *
|
||||||
glibtop_inodedb_lookup_s (glibtop *server, glibtop_inodedb *inodedb,
|
glibtop_inodedb_lookup_s (glibtop G_GNUC_UNUSED *server,
|
||||||
|
glibtop_inodedb *inodedb,
|
||||||
u_int64_t device, u_int64_t inode)
|
u_int64_t device, u_int64_t inode)
|
||||||
{
|
{
|
||||||
glibtop_inodedb_key key;
|
glibtop_inodedb_key key;
|
||||||
|
@@ -260,7 +260,7 @@ fstype_to_string (t)
|
|||||||
|
|
||||||
static struct mount_entry *
|
static struct mount_entry *
|
||||||
read_filesystem_list (need_fs_type, all_fs)
|
read_filesystem_list (need_fs_type, all_fs)
|
||||||
int need_fs_type, all_fs;
|
int G_GNUC_UNUSED need_fs_type, G_GNUC_UNUSED all_fs;
|
||||||
{
|
{
|
||||||
struct mount_entry *mount_list;
|
struct mount_entry *mount_list;
|
||||||
struct mount_entry *me;
|
struct mount_entry *me;
|
||||||
|
@@ -64,7 +64,7 @@ glibtop_strdup_r (glibtop *server, const char *string)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
glibtop_free_r (glibtop *server, const void *ptr)
|
glibtop_free_r (glibtop G_GNUC_UNUSED *server, const void *ptr)
|
||||||
{
|
{
|
||||||
if (ptr) free ((void *) ptr);
|
if (ptr) free ((void *) ptr);
|
||||||
}
|
}
|
||||||
|
@@ -19,10 +19,11 @@
|
|||||||
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||||
Boston, MA 02111-1307, USA. */
|
Boston, MA 02111-1307, USA. */
|
||||||
|
|
||||||
|
#include <glibtop.h>
|
||||||
#include <glibtop/close.h>
|
#include <glibtop/close.h>
|
||||||
|
|
||||||
/* Closes pipe to gtop server. */
|
/* Closes pipe to gtop server. */
|
||||||
|
|
||||||
void
|
void
|
||||||
glibtop_close_l (glibtop *server)
|
glibtop_close_p (glibtop G_GNUC_UNUSED *server)
|
||||||
{ }
|
{ }
|
||||||
|
@@ -53,7 +53,7 @@ static struct nlist nlst [] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/* MIB array for sysctl */
|
/* MIB array for sysctl */
|
||||||
static int mib_length=2;
|
/* static int mib_length=2; */
|
||||||
static int mib [] = { CTL_VM, VM_METER };
|
static int mib [] = { CTL_VM, VM_METER };
|
||||||
|
|
||||||
/* Init function. */
|
/* Init function. */
|
||||||
|
@@ -21,12 +21,15 @@
|
|||||||
|
|
||||||
#include <glibtop.h>
|
#include <glibtop.h>
|
||||||
#include <glibtop/open.h>
|
#include <glibtop/open.h>
|
||||||
|
#include <glibtop/close.h>
|
||||||
|
|
||||||
void
|
void
|
||||||
glibtop_open_s (glibtop *server, const char *program_name,
|
glibtop_open_s (glibtop G_GNUC_UNUSED *server,
|
||||||
const unsigned long features, const unsigned flags)
|
const char G_GNUC_UNUSED *program_name,
|
||||||
|
const unsigned long G_GNUC_UNUSED features,
|
||||||
|
const unsigned G_GNUC_UNUSED flags)
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
void
|
void
|
||||||
glibtop_close_s (glibtop *server)
|
glibtop_close_s (glibtop G_GNUC_UNUSED *server)
|
||||||
{ }
|
{ }
|
||||||
|
@@ -48,7 +48,8 @@ glibtop_init_p (glibtop *server, const unsigned long features,
|
|||||||
|
|
||||||
void
|
void
|
||||||
glibtop_open_p (glibtop *server, const char *program_name,
|
glibtop_open_p (glibtop *server, const char *program_name,
|
||||||
const unsigned long features, const unsigned flags)
|
const unsigned long G_GNUC_UNUSED features,
|
||||||
|
const unsigned G_GNUC_UNUSED flags)
|
||||||
{
|
{
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
fprintf (stderr, "DEBUG (%d): glibtop_open_p ()\n", getpid ());
|
fprintf (stderr, "DEBUG (%d): glibtop_open_p ()\n", getpid ());
|
||||||
|
@@ -69,7 +69,7 @@ glibtop_get_proc_kernel_p (glibtop *server,
|
|||||||
struct user *u_addr = (struct user *)USRSTACK;
|
struct user *u_addr = (struct user *)USRSTACK;
|
||||||
struct pstats pstats;
|
struct pstats pstats;
|
||||||
struct pcb pcb;
|
struct pcb pcb;
|
||||||
int f, count;
|
int count;
|
||||||
|
|
||||||
glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_PROC_KERNEL), 0);
|
glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_PROC_KERNEL), 0);
|
||||||
|
|
||||||
|
@@ -58,8 +58,6 @@ static const unsigned long _glibtop_sysdeps_map_entry =
|
|||||||
void
|
void
|
||||||
glibtop_init_proc_map_p (glibtop *server)
|
glibtop_init_proc_map_p (glibtop *server)
|
||||||
{
|
{
|
||||||
register int pagesize;
|
|
||||||
|
|
||||||
server->sysdeps.proc_map = _glibtop_sysdeps_proc_map;
|
server->sysdeps.proc_map = _glibtop_sysdeps_proc_map;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -71,7 +69,7 @@ glibtop_get_proc_map_p (glibtop *server, glibtop_proc_map *buf,
|
|||||||
{
|
{
|
||||||
struct kinfo_proc *pinfo;
|
struct kinfo_proc *pinfo;
|
||||||
struct vm_map_entry entry, *first;
|
struct vm_map_entry entry, *first;
|
||||||
struct vmspace *vms, vmspace;
|
struct vmspace vmspace;
|
||||||
struct vm_object object;
|
struct vm_object object;
|
||||||
glibtop_map_entry *maps;
|
glibtop_map_entry *maps;
|
||||||
struct vnode vnode;
|
struct vnode vnode;
|
||||||
|
@@ -88,13 +88,10 @@ glibtop_get_proc_mem_p (glibtop *server, glibtop_proc_mem *buf,
|
|||||||
pid_t pid)
|
pid_t pid)
|
||||||
{
|
{
|
||||||
struct kinfo_proc *pinfo;
|
struct kinfo_proc *pinfo;
|
||||||
struct user *u_addr = (struct user *)USRSTACK;
|
|
||||||
struct vm_map_entry entry, *first;
|
struct vm_map_entry entry, *first;
|
||||||
struct vmspace *vms, vmspace;
|
struct vmspace *vms, vmspace;
|
||||||
struct vm_object object;
|
struct vm_object object;
|
||||||
struct plimit plimit;
|
struct plimit plimit;
|
||||||
struct vnode vnode;
|
|
||||||
struct inode inode;
|
|
||||||
int count;
|
int count;
|
||||||
|
|
||||||
glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_PROC_MEM), 0);
|
glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_PROC_MEM), 0);
|
||||||
|
@@ -44,11 +44,8 @@ glibtop_init_proc_segment_p (glibtop *server)
|
|||||||
void
|
void
|
||||||
glibtop_get_proc_segment_p (glibtop *server,
|
glibtop_get_proc_segment_p (glibtop *server,
|
||||||
glibtop_proc_segment *buf,
|
glibtop_proc_segment *buf,
|
||||||
pid_t pid)
|
pid_t G_GNUC_UNUSED pid)
|
||||||
{
|
{
|
||||||
struct kinfo_proc *pinfo;
|
|
||||||
int *count;
|
|
||||||
|
|
||||||
glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_PROC_SEGMENT), 0);
|
glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_PROC_SEGMENT), 0);
|
||||||
|
|
||||||
memset (buf, 0, sizeof (glibtop_proc_segment));
|
memset (buf, 0, sizeof (glibtop_proc_segment));
|
||||||
|
@@ -60,7 +60,6 @@ calcru(p, up, sp, ip)
|
|||||||
quad_t totusec;
|
quad_t totusec;
|
||||||
u_quad_t u, st, ut, it, tot;
|
u_quad_t u, st, ut, it, tot;
|
||||||
long sec, usec;
|
long sec, usec;
|
||||||
struct timeval tv;
|
|
||||||
|
|
||||||
st = p->p_sticks;
|
st = p->p_sticks;
|
||||||
ut = p->p_uticks;
|
ut = p->p_uticks;
|
||||||
@@ -105,9 +104,7 @@ glibtop_get_proc_time_p (glibtop *server, glibtop_proc_time *buf,
|
|||||||
struct kinfo_proc *pinfo;
|
struct kinfo_proc *pinfo;
|
||||||
struct user *u_addr = (struct user *)USRSTACK;
|
struct user *u_addr = (struct user *)USRSTACK;
|
||||||
struct pstats pstats;
|
struct pstats pstats;
|
||||||
struct pcb pcb;
|
int count;
|
||||||
int f, count;
|
|
||||||
quad_t totusec;
|
|
||||||
|
|
||||||
glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_PROC_TIME), 0);
|
glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_PROC_TIME), 0);
|
||||||
|
|
||||||
|
@@ -144,7 +144,7 @@ glibtop_get_swap_p (glibtop *server, glibtop_swap *buf)
|
|||||||
sw_size = nswdev * sizeof (*sw);
|
sw_size = nswdev * sizeof (*sw);
|
||||||
sw = glibtop_malloc_r (server, sw_size);
|
sw = glibtop_malloc_r (server, sw_size);
|
||||||
|
|
||||||
if (kvm_read (server->machine.kd, ptr, sw, sw_size) != sw_size)
|
if (kvm_read (server->machine.kd, ptr, sw, sw_size) != (ssize_t) sw_size)
|
||||||
glibtop_error_io_r (server, "kvm_read (*swdevt)");
|
glibtop_error_io_r (server, "kvm_read (*swdevt)");
|
||||||
|
|
||||||
perdev = glibtop_malloc (nswdev * sizeof (*perdev));
|
perdev = glibtop_malloc (nswdev * sizeof (*perdev));
|
||||||
|
Reference in New Issue
Block a user