procopenfiles

procopenfiles

Functions

Types and Values

Includes

#include <glibtop/procopenfiles.h>

Description

Functions

glibtop_get_proc_open_files ()

glibtop_open_files_entry *
glibtop_get_proc_open_files (glibtop_proc_open_files *buf,
                             pid_t pid);

Returns

.

[transfer full][array zero-terminated=1]


glibtop_get_proc_open_files_l ()

glibtop_open_files_entry *
glibtop_get_proc_open_files_l (glibtop *server,
                               glibtop_proc_open_files *buf,
                               pid_t pid);

Parameters

buf

.

[out]

Returns

.

[transfer full][array zero-terminated=1]


glibtop_get_proc_open_files_p ()

glibtop_open_files_entry *
glibtop_get_proc_open_files_p (glibtop *server,
                               glibtop_proc_open_files *buf,
                               pid_t pid);

Parameters

buf

.

[out]

Returns

.

[transfer full][array zero-terminated=1]


glibtop_get_proc_open_files_s ()

glibtop_open_files_entry *
glibtop_get_proc_open_files_s (glibtop *server,
                               glibtop_proc_open_files *buf,
                               pid_t pid);

Types and Values

GLIBTOP_PROC_OPEN_FILES_NUMBER

#define GLIBTOP_PROC_OPEN_FILES_NUMBER		0

GLIBTOP_PROC_OPEN_FILES_TOTAL

#define GLIBTOP_PROC_OPEN_FILES_TOTAL		1

GLIBTOP_PROC_OPEN_FILES_SIZE

#define GLIBTOP_PROC_OPEN_FILES_SIZE		2

GLIBTOP_MAX_PROC_OPEN_FILES

#define GLIBTOP_MAX_PROC_OPEN_FILES		3

GLIBTOP_FILE_ENTRY_FD

#define GLIBTOP_FILE_ENTRY_FD				0

GLIBTOP_FILE_ENTRY_NAME

#define GLIBTOP_FILE_ENTRY_NAME				1

GLIBTOP_FILE_ENTRY_TYPE

#define GLIBTOP_FILE_ENTRY_TYPE				2

GLIBTOP_FILE_ENTRY_INETSOCKET_DST_HOST

#define GLIBTOP_FILE_ENTRY_INETSOCKET_DST_HOST		3

GLIBTOP_FILE_ENTRY_INETSOCKET_DST_PORT

#define GLIBTOP_FILE_ENTRY_INETSOCKET_DST_PORT		4

GLIBTOP_MAX_OPEN_FILE_ENTRY

#define GLIBTOP_MAX_OPEN_FILE_ENTRY		5

GLIBTOP_OPEN_FILENAME_LEN

#define GLIBTOP_OPEN_FILENAME_LEN 215

GLIBTOP_OPEN_DEST_HOST_LEN

#define GLIBTOP_OPEN_DEST_HOST_LEN 46

struct glibtop_open_files_entry

struct glibtop_open_files_entry {
	int fd;
	guint16 type; /* An "enum glibtop_file_type" value. */
	union {
		/* When type == GLIBTOP_FILE_TYPE_INETSOCKET or
		 * when type == GLIBTOP_FILE_TYPE_INET6SOCKET */
		struct {
			char dest_host[GLIBTOP_OPEN_DEST_HOST_LEN+1];
			int dest_port;
		} sock;

		/* When type == GLIBTOP_FILE_TYPE_FILE */
		struct {
			char name[GLIBTOP_OPEN_FILENAME_LEN+1];
		} file;

		/* When type == GLIBTOP_FILE_TYPE_LOCALSOCKET */
		struct {
			char name[GLIBTOP_OPEN_FILENAME_LEN+1];
		} localsock;

	} info;
};

struct glibtop_proc_open_files

struct glibtop_proc_open_files {
	guint64 flags;
	guint64 number;			/* GLIBTOP_PROC_OPEN_FILES_NUMBER */
	guint64 total;			/* GLIBTOP_PROC_OPEN_FILES_TOTAL  */
	guint64 size;			/* GLIBTOP_PROC_OPEN_FILES_SIZE   */
};

glibtop_get_proc_open_files_r

#define glibtop_get_proc_open_files_r		glibtop_get_proc_open_files_p