|
Packit Bot |
8ec8cb |
/* Monitoring file descriptor usage.
|
|
Packit Bot |
8ec8cb |
Copyright (C) 2018 Free Software Foundation, Inc.
|
|
Packit Bot |
8ec8cb |
This file is part of the GNU C Library.
|
|
Packit Bot |
8ec8cb |
|
|
Packit Bot |
8ec8cb |
The GNU C Library is free software; you can redistribute it and/or
|
|
Packit Bot |
8ec8cb |
modify it under the terms of the GNU Lesser General Public
|
|
Packit Bot |
8ec8cb |
License as published by the Free Software Foundation; either
|
|
Packit Bot |
8ec8cb |
version 2.1 of the License, or (at your option) any later version.
|
|
Packit Bot |
8ec8cb |
|
|
Packit Bot |
8ec8cb |
The GNU C Library is distributed in the hope that it will be useful,
|
|
Packit Bot |
8ec8cb |
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit Bot |
8ec8cb |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Packit Bot |
8ec8cb |
Lesser General Public License for more details.
|
|
Packit Bot |
8ec8cb |
|
|
Packit Bot |
8ec8cb |
You should have received a copy of the GNU Lesser General Public
|
|
Packit Bot |
8ec8cb |
License along with the GNU C Library; if not, see
|
|
Packit Bot |
8ec8cb |
<http://www.gnu.org/licenses/>. */
|
|
Packit Bot |
8ec8cb |
|
|
Packit Bot |
8ec8cb |
#ifndef SUPPORT_DESCRIPTORS_H
|
|
Packit Bot |
8ec8cb |
#define SUPPORT_DESCRIPTORS_H
|
|
Packit Bot |
8ec8cb |
|
|
Packit Bot |
8ec8cb |
#include <stdio.h>
|
|
Packit Bot |
8ec8cb |
|
|
Packit Bot |
8ec8cb |
/* Opaque pointer, for capturing file descriptor lists. */
|
|
Packit Bot |
8ec8cb |
struct support_descriptors;
|
|
Packit Bot |
8ec8cb |
|
|
Packit Bot |
8ec8cb |
/* Record the currently open file descriptors and store them in the
|
|
Packit Bot |
8ec8cb |
returned list. Terminate the process if the listing operation
|
|
Packit Bot |
8ec8cb |
fails. */
|
|
Packit Bot |
8ec8cb |
struct support_descriptors *support_descriptors_list (void);
|
|
Packit Bot |
8ec8cb |
|
|
Packit Bot |
8ec8cb |
/* Deallocate the list of descriptors. */
|
|
Packit Bot |
8ec8cb |
void support_descriptors_free (struct support_descriptors *);
|
|
Packit Bot |
8ec8cb |
|
|
Packit Bot |
8ec8cb |
/* Write the list of descriptors to STREAM, adding PREFIX to each
|
|
Packit Bot |
8ec8cb |
line. */
|
|
Packit Bot |
8ec8cb |
void support_descriptors_dump (struct support_descriptors *,
|
|
Packit Bot |
8ec8cb |
const char *prefix, FILE *stream);
|
|
Packit Bot |
8ec8cb |
|
|
Packit Bot |
8ec8cb |
/* Check for file descriptor leaks and other file descriptor changes:
|
|
Packit Bot |
8ec8cb |
Compare the current list of descriptors with the passed list.
|
|
Packit Bot |
8ec8cb |
Record a test failure if there are additional open descriptors,
|
|
Packit Bot |
8ec8cb |
descriptors have been closed, or if a change in file descriptor can
|
|
Packit Bot |
8ec8cb |
be detected. */
|
|
Packit Bot |
8ec8cb |
void support_descriptors_check (struct support_descriptors *);
|
|
Packit Bot |
8ec8cb |
|
|
Packit Bot |
8ec8cb |
#endif /* SUPPORT_DESCRIPTORS_H */
|