xref: /freebsd/lib/libprocstat/core.h (revision b3e76948)
17153ad2bSMikolaj Golub /*-
24d846d26SWarner Losh  * SPDX-License-Identifier: BSD-2-Clause
35e53a4f9SPedro F. Giffuni  *
47153ad2bSMikolaj Golub  * Copyright (c) 2013 Mikolaj Golub <trociny@FreeBSD.org>
586be94fcSTycho Nightingale  * Copyright (c) 2017 Dell EMC
67153ad2bSMikolaj Golub  * All rights reserved.
77153ad2bSMikolaj Golub  *
87153ad2bSMikolaj Golub  * Redistribution and use in source and binary forms, with or without
97153ad2bSMikolaj Golub  * modification, are permitted provided that the following conditions
107153ad2bSMikolaj Golub  * are met:
117153ad2bSMikolaj Golub  * 1. Redistributions of source code must retain the above copyright
127153ad2bSMikolaj Golub  *    notice, this list of conditions and the following disclaimer.
137153ad2bSMikolaj Golub  * 2. Redistributions in binary form must reproduce the above copyright
147153ad2bSMikolaj Golub  *    notice, this list of conditions and the following disclaimer in the
157153ad2bSMikolaj Golub  *    documentation and/or other materials provided with the distribution.
167153ad2bSMikolaj Golub  *
177153ad2bSMikolaj Golub  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
187153ad2bSMikolaj Golub  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
197153ad2bSMikolaj Golub  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
207153ad2bSMikolaj Golub  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
217153ad2bSMikolaj Golub  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
227153ad2bSMikolaj Golub  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
237153ad2bSMikolaj Golub  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
247153ad2bSMikolaj Golub  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
257153ad2bSMikolaj Golub  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
267153ad2bSMikolaj Golub  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
277153ad2bSMikolaj Golub  * SUCH DAMAGE.
287153ad2bSMikolaj Golub  */
297153ad2bSMikolaj Golub 
307153ad2bSMikolaj Golub #ifndef _CORE_H
317153ad2bSMikolaj Golub #define _CORE_H
327153ad2bSMikolaj Golub 
337153ad2bSMikolaj Golub enum psc_type {
347153ad2bSMikolaj Golub 	PSC_TYPE_PROC,
357153ad2bSMikolaj Golub 	PSC_TYPE_FILES,
367153ad2bSMikolaj Golub 	PSC_TYPE_VMMAP,
377f1d14e6SMikolaj Golub 	PSC_TYPE_GROUPS,
385b9bcba9SMikolaj Golub 	PSC_TYPE_UMASK,
397cc0ebfdSMikolaj Golub 	PSC_TYPE_RLIMIT,
40eec6cb1cSMikolaj Golub 	PSC_TYPE_OSREL,
414482b5e3SMikolaj Golub 	PSC_TYPE_PSSTRINGS,
424482b5e3SMikolaj Golub 	PSC_TYPE_ARGV,
434482b5e3SMikolaj Golub 	PSC_TYPE_ENVV,
442ff020d3SMikolaj Golub 	PSC_TYPE_AUXV,
4586be94fcSTycho Nightingale 	PSC_TYPE_PTLWPINFO,
4686be94fcSTycho Nightingale 	PSC_TYPE_MAX
477153ad2bSMikolaj Golub };
487153ad2bSMikolaj Golub 
497153ad2bSMikolaj Golub struct procstat_core;
507153ad2bSMikolaj Golub 
517153ad2bSMikolaj Golub void procstat_core_close(struct procstat_core *core);
527153ad2bSMikolaj Golub void *procstat_core_get(struct procstat_core *core, enum psc_type type,
537153ad2bSMikolaj Golub     void * buf, size_t *lenp);
5486be94fcSTycho Nightingale int procstat_core_note_count(struct procstat_core *core, enum psc_type type);
557153ad2bSMikolaj Golub struct procstat_core *procstat_core_open(const char *filename);
567153ad2bSMikolaj Golub 
577153ad2bSMikolaj Golub #endif 	/* !_CORE_H_ */
58