repo stringlengths 1 152 ⌀ | file stringlengths 14 221 | code stringlengths 501 25k | file_length int64 501 25k | avg_line_length float64 20 99.5 | max_line_length int64 21 134 | extension_type stringclasses 2
values |
|---|---|---|---|---|---|---|
psutil | psutil-master/psutil/_psutil_bsd.c | /*
* Copyright (c) 2009, Jay Loden, Giampaolo Rodola', Landry Breuil
* (OpenBSD implementation), Ryo Onodera (NetBSD implementation).
* All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*
* Platform-specific module methods for FreeBSD and O... | 7,772 | 35.492958 | 105 | c |
psutil | psutil-master/psutil/_psutil_common.c | /*
* Copyright (c) 2009, Giampaolo Rodola'. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*
* Routines common to all platforms.
*/
#include <Python.h>
#include "_psutil_common.h"
// =====================================================... | 12,644 | 27.608597 | 80 | c |
psutil | psutil-master/psutil/_psutil_common.h | /*
* Copyright (c) 2009, Giampaolo Rodola'. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include <Python.h>
// ====================================================================
// --- Global vars / constants
// ==================... | 6,118 | 33.570621 | 77 | h |
psutil | psutil-master/psutil/_psutil_linux.c | /*
* Copyright (c) 2009, Giampaolo Rodola'. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*
* Linux-specific functions.
*/
#ifndef _GNU_SOURCE
#define _GNU_SOURCE 1
#endif
#include <Python.h>
#include <errno.h>
#include <stdlib.h>
#... | 15,257 | 25.721541 | 80 | c |
psutil | psutil-master/psutil/_psutil_osx.c | /*
* Copyright (c) 2009, Jay Loden, Giampaolo Rodola'. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*
* macOS platform-specific module methods.
*/
#include <Python.h>
#include <sys/proc.h>
#include <netinet/tcp_fsm.h>
#include "_psuti... | 4,821 | 32.72028 | 80 | c |
psutil | psutil-master/psutil/_psutil_windows.c | /*
* Copyright (c) 2009, Jay Loden, Giampaolo Rodola'. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*
* Windows platform-specific module methods for _psutil_windows.
*
* List of undocumented Windows NT APIs which are used in here and i... | 10,563 | 35.937063 | 85 | c |
psutil | psutil-master/psutil/arch/aix/common.c | /*
* Copyright (c) 2017, Arnon Yaari
* All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include <Python.h>
#include <sys/core.h>
#include <stdlib.h>
#include "common.h"
/* psutil_kread() - read from kernel memory */
int
psutil_kread(
... | 2,285 | 27.575 | 78 | c |
psutil | psutil-master/psutil/arch/aix/common.h | /*
* Copyright (c) 2017, Arnon Yaari
* All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef __PSUTIL_AIX_COMMON_H__
#define __PSUTIL_AIX_COMMON_H__
#include <sys/core.h>
#define PROCINFO_INCR (256)
#define PROCSIZE (sizeof... | 894 | 26.96875 | 73 | h |
psutil | psutil-master/psutil/arch/aix/ifaddrs.c | /*
* Copyright (c) 2017, Arnon Yaari
* All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
/*! Based on code from
https://lists.samba.org/archive/samba-technical/2009-February/063079.html
!*/
#include <string.h>
#include <stdlib.h>
#in... | 3,840 | 24.606667 | 77 | c |
psutil | psutil-master/psutil/arch/aix/ifaddrs.h | /*
* Copyright (c) 2017, Arnon Yaari
* All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
/*! Based on code from
https://lists.samba.org/archive/samba-technical/2009-February/063079.html
!*/
#ifndef GENERIC_AIX_IFADDRS_H
#define GENE... | 767 | 20.942857 | 77 | h |
psutil | psutil-master/psutil/arch/aix/net_connections.c | /*
* Copyright (c) 2017, Arnon Yaari
* All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
/* Baded on code from lsof:
* http://www.ibm.com/developerworks/aix/library/au-lsof.html
* - dialects/aix/dproc.c:gather_proc_info
* - lib/prfp.c:... | 8,134 | 27.246528 | 78 | c |
psutil | psutil-master/psutil/arch/aix/net_kernel_structs.h | /*
* Copyright (c) 2017, Arnon Yaari
* All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
/* The kernel is always 64 bit but Python is usually compiled as a 32 bit
* process. We're reading the kernel memory to get the network connections,... | 4,060 | 35.258929 | 77 | h |
psutil | psutil-master/psutil/arch/bsd/cpu.c | /*
* Copyright (c) 2009, Jay Loden, Giampaolo Rodola'. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include <Python.h>
#include <sys/sysctl.h>
#include <sys/resource.h>
#include <sys/sched.h>
PyObject *
psutil_cpu_count_logical(PyO... | 1,552 | 26.732143 | 73 | c |
psutil | psutil-master/psutil/arch/bsd/disk.c | /*
* Copyright (c) 2009, Jay Loden, Giampaolo Rodola'. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include <Python.h>
#include <sys/mount.h>
#if PSUTIL_NETBSD
// getvfsstat()
#include <sys/types.h>
#include <sys/statvfs.... | 5,271 | 27.652174 | 73 | c |
psutil | psutil-master/psutil/arch/bsd/net.c | /*
* Copyright (c) 2009, Jay Loden, Giampaolo Rodola'. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include <Python.h>
#include <sys/sysctl.h>
#include <string.h>
#include <net/if.h>
#include <net/if_dl.h>
#include <net/route.h>
Py... | 3,121 | 28.45283 | 73 | c |
psutil | psutil-master/psutil/arch/bsd/proc.c | /*
* Copyright (c) 2009, Jay Loden, Giampaolo Rodola'. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include <Python.h>
#include <kvm.h>
#include <sys/proc.h>
#include <sys/sysctl.h>
#include <sys/types.h>
#include <sys/file.h>
#inclu... | 15,817 | 30.955556 | 107 | c |
psutil | psutil-master/psutil/arch/bsd/proc.h | /*
* Copyright (c) 2009, Jay Loden, Giampaolo Rodola'. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include <Python.h>
PyObject *psutil_pids(PyObject *self, PyObject *args);
PyObject *psutil_proc_environ(PyObject *self, PyObject *ar... | 519 | 36.142857 | 73 | h |
psutil | psutil-master/psutil/arch/bsd/sys.c | /*
* Copyright (c) 2009, Jay Loden, Giampaolo Rodola'. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include <Python.h>
#include <sys/sysctl.h>
#include <stdio.h>
#include <sys/param.h> // OS version
#ifdef PSUTIL_FREEBSD
#if __F... | 4,387 | 26.08642 | 89 | c |
psutil | psutil-master/psutil/arch/freebsd/cpu.c | /*
* Copyright (c) 2009, Jay Loden, Giampaolo Rodola'. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
/*
System-wide CPU related functions.
Original code was refactored and moved from psutil/arch/freebsd/specific.c
in 2020 (and was move... | 5,555 | 27.492308 | 79 | c |
psutil | psutil-master/psutil/arch/freebsd/disk.c | /*
* Copyright (c) 2009, Jay Loden, Giampaolo Rodola'. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include <Python.h>
#include <sys/sysctl.h>
#include <devstat.h>
#include "../../_psutil_common.h"
#include "../../_psutil_posix.h"
... | 2,599 | 28.885057 | 83 | c |
psutil | psutil-master/psutil/arch/freebsd/mem.c | /*
* Copyright (c) 2009, Jay Loden, Giampaolo Rodola'. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include <Python.h>
#include <sys/param.h>
#include <sys/sysctl.h>
#include <sys/vmmeter.h>
#include <vm/vm_param.h>
#include <devsta... | 4,652 | 32.47482 | 81 | c |
psutil | psutil-master/psutil/arch/freebsd/proc.c | /*
* Copyright (c) 2009, Jay Loden, Giampaolo Rodola'. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include <Python.h>
#include <assert.h>
#include <errno.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <sys/ty... | 19,437 | 25.848066 | 79 | c |
psutil | psutil-master/psutil/arch/freebsd/proc.h | /*
* Copyright (c) 2009, Jay Loden, Giampaolo Rodola'. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include <Python.h>
typedef struct kinfo_proc kinfo_proc;
int psutil_get_proc_list(struct kinfo_proc **procList, size_t *procCount);... | 1,102 | 43.12 | 74 | h |
psutil | psutil-master/psutil/arch/freebsd/proc_socks.c | /*
* Copyright (c) 2009, Giampaolo Rodola'.
* All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*
* Retrieves per-process open socket connections.
*/
#include <Python.h>
#include <sys/param.h>
#include <sys/user.h>
#include <sys/socketvar.... | 11,001 | 28.495979 | 85 | c |
psutil | psutil-master/psutil/arch/freebsd/sensors.c | /*
* Copyright (c) 2009, Jay Loden, Giampaolo Rodola'. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
/*
Original code was refactored and moved from psutil/arch/freebsd/specific.c
For reference, here's the git history with original(ish)... | 2,329 | 27.072289 | 77 | c |
psutil | psutil-master/psutil/arch/freebsd/sys_socks.c | /*
* Copyright (c) 2009, Giampaolo Rodola'.
* All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*
* Retrieves system-wide open socket connections. This is based off of
* sockstat utility source code:
* https://github.com/freebsd/freebsd/bl... | 10,147 | 26.576087 | 78 | c |
psutil | psutil-master/psutil/arch/netbsd/cpu.c | /*
* Copyright (c) 2009, Giampaolo Rodola', Landry Breuil.
* All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include <Python.h>
#include <sys/sched.h>
#include <sys/sysctl.h>
#include <uvm/uvm_extern.h>
/*
CPU related functions. Orig... | 2,775 | 25.692308 | 77 | c |
psutil | psutil-master/psutil/arch/netbsd/disk.c | /*
* Copyright (c) 2009, Giampaolo Rodola', Landry Breuil.
* All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
/*
Disk related functions. Original code was refactored and moved from
psutil/arch/netbsd/specific.c in 2023 (and was moved in ... | 1,939 | 24.526316 | 74 | c |
psutil | psutil-master/psutil/arch/netbsd/mem.c | /*
* Copyright (c) 2009, Giampaolo Rodola', Landry Breuil.
* All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
/*
Memory related functions. Original code was refactored and moved from
psutil/arch/netbsd/specific.c in 2023 (and was moved i... | 3,428 | 29.078947 | 93 | c |
psutil | psutil-master/psutil/arch/netbsd/proc.c | /*
* Copyright (c) 2009, Giampaolo Rodola', Landry Breuil.
* All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*
* Platform-specific module methods for NetBSD.
*/
#include <Python.h>
#include <sys/sysctl.h>
#include <kvm.h>
#include "../.... | 10,328 | 23.889157 | 79 | c |
psutil | psutil-master/psutil/arch/netbsd/proc.h | /*
* Copyright (c) 2009, Giampaolo Rodola', Landry Breuil.
* All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include <Python.h>
typedef struct kinfo_proc2 kinfo_proc;
int psutil_kinfo_proc(pid_t pid, kinfo_proc *proc);
struct kinfo_f... | 927 | 37.666667 | 73 | h |
End of preview. Expand in Data Studio
README.md exists but content is empty.
- Downloads last month
- 301