1
0
mirror of https://github.com/shirou/gopsutil.git synced 2025-04-26 13:48:59 +08:00

252 Commits

Author SHA1 Message Date
Jonathan Matthew
27ffa28a0d add support for OpenBSD/riscv64 2024-02-11 16:20:56 +10:00
Bryce Kahle
b0d976c49b
ensure host platform are files and have contents
In a containerized deployment, it is common to mount several files from /etc. Within the container, those files will be created regardless if they exist on the host or not. In those instances, the existing code would erroneously return empty platform information.
2024-01-18 10:21:42 -08:00
shirou
b10acd4894 [host]: add EnableBootTimeCache function 2024-01-11 00:49:11 +09:00
Ville Skyttä
362fa4b9c4 Avoid repeated regexp compilations 2023-12-21 09:51:14 +02:00
Xie Weineng
0de2d14a7c add deepin and uos distro 2023-12-13 09:54:52 +08:00
shirou
4b46f2b70c [host][darwin]: fix Users 2023-10-10 23:05:52 +09:00
Justin Yang
7ffb24dbe3
Merge branch 'shirou:master' into feature/netbsd-arm64-port 2023-09-23 16:02:34 +08:00
Justin Yang
4a46201e00 cpu && host: fix compile time errors 2023-09-16 17:44:58 +08:00
Matthieu MOREL
c806740b34
ci(lint): ensure io/ioutil replacement (#1525)
* ci(lint): enure ioutil replacement

Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>

* Update host_solaris.go
* Update process_linux_test.go
* Update net_linux_test.go
* Update net_linux_test.go
* Update process_test.go
* Update process_linux_test.go
* Update process_linux_test.go

---------

Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2023-09-12 21:14:04 +09:00
Justin Yang
e82d2e4ca8 host: enable uptime for NetBSD 2023-09-09 21:25:51 +08:00
shirou
0665cafa1b chore: replace deprecated ioutil package to os and io 2023-09-08 17:05:14 +00:00
shirou
febdeab871 chore: change CIRCLECI environment variable to CI. 2023-08-30 14:07:47 +00:00
shirou
3748c19402 [host][linux]: remove double quote from lsb release info
fix: #1502
2023-08-13 12:01:01 +00:00
Antoine Toulme
b712e59295 fix more linting reports 2023-06-03 14:17:16 -07:00
Antoine Toulme
38b94668ea allow to pass context values to override environment variables 2023-06-02 01:31:05 -07:00
Matthieu MOREL
1fb1e3e3e6 ci(lint): correct gci linter
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2023-04-04 18:07:22 +00:00
Josh Powers
e7c6b6991d
fix: moves common.Warnings to common OS files
This allows all OS types to unwrap the Warnings from errors, and not
just linux in host or windows in disk.

fixes: #1429
2023-03-15 06:39:08 -06:00
Jacob Young
02660eaf7c
Update host/host_linux.go
Use a raw string instead of escaped quotes.

Co-authored-by: shirou <shirou.faw@gmail.com>
2023-03-10 09:41:18 -05:00
Jacob Young
43566581f0 Recognize Cumulus Linux distro
Add Cumulus Linux and Kylin to debian family
2023-02-24 13:59:01 -05:00
shirou
6a5e40a517
Merge pull request #1228 from abner-chenc/master
host: add support for linux/loong64
2023-02-12 16:48:27 +09:00
shirou
e563e6394e
Merge pull request #1356 from N1neSun/patch-1
fix some kylin linux bug
2023-02-12 16:46:43 +09:00
shirou
0494d7f0b9
Merge pull request #1403 from Agilicus/add-ppc64be
[host] linux/ppc: ppc64 definition from ppc64le
2023-02-01 07:55:42 +09:00
Guoqi Chen
b793d83f72 host: add support for linux/loong64
Updates #1338.

Signed-off-by: Guoqi Chen <chenguoqi@loongson.cn>
Co-authored-by: Jiantao Shan <shanjiantao@loongson.cn>
2023-01-14 07:09:59 +08:00
Jeff Erbrecht
a5ecb9bca5 [host] windows: use millisecond precision for BootTime()
Previously, system uptime is truncated to seconds, and then the
subtraction from `time.Now()` is performed. Because uptime does not roll
over to the next second at the same instant as `time.Now()`, then
`BootTime()` ends up not being precise, and often varies by 1 second.

This commit does the subtraction before truncating to seconds, which
results in a significantly lower chance of variance in `BootTime()`.
2023-01-04 10:42:00 -05:00
Don Bowman
d7f1f76519
[host] linux/ppc: ppc64 definition from ppc64le
Same as commit fc04d2d, but for ppc64 from ppc64le definition.
2023-01-03 20:56:48 -05:00
Tobias Klauser
f9a5834e0e
host: use unix.ByteSliceToString
Use ByteSliceToString provided in golang.org/x/sys/unix to convert
\0-terminated byte slices to strings.
2022-12-07 13:14:45 +01:00
shirou
5473fd114d [disk][host]: change to use type alias. 2022-11-30 23:23:31 +00:00
shirou
4ac7e99c6a [disk][host]: move back Warnings from internal to disk and host.
fix #1377
2022-11-19 11:37:38 +00:00
shirou
68452e2602 feat(host, windows): add UBR (Update Build Revision) to kernel version 2022-11-05 20:59:15 +09:00
Antoine Toulme
dbc0f20fe3 code review 2022-10-03 13:55:14 -07:00
N1neSun
add9158d4e fix some kylin linux bug 2022-09-23 16:23:47 +08:00
shirou
ed37dc27a2
Merge pull request #1335 from tklauser/drop-darwin-386
host, process: delete darwin/386 code
2022-07-30 11:24:12 +09:00
Stuart Caie
e0400cc94f Use 0 as default mach port 2022-07-30 00:44:15 +00:00
Tobias Klauser
c76712b8da
host, process: delete darwin/386 code
The darwin/386 port was dropped in Go 1.15 and the imported version of
golang.org/x/sys also no longer supports the port. This module requires
at least Go 1.15 per go.mod, so it no longer builds on darwin/386
anyway.
2022-07-28 13:01:59 +02:00
Stuart Caie
55411f1178 Replace IOMainPort/IOMasterPort() and kIOMainPortDefault/kIOMasterPortDefault with NULL 2022-07-25 12:19:31 +00:00
shirou
5610fbc5d5 fix(host,linux): Check if path exists and is nonempty before reading host files 2022-07-15 12:25:44 +00:00
yueyt
15354cbdee add neokylin host info on linux 2022-07-05 17:19:18 +08:00
Martin Reindl
1d89235f34 host: add support for OpenBSD/armv7 2022-04-15 21:11:36 +02:00
Ville Skyttä
f7e1f36418 refactor: remove unnecessary exec.LookPath calls
Executing the command does the lookup if needed and returns the same
error when not found, no need to do it separately.
2022-03-04 18:56:33 +02:00
Ville Skyttä
7a8feb155b [host][solaris] implement SensorsTemperaturesWithContext 2022-02-05 23:20:11 +02:00
Lammert Hellinga
001699bed7 Let almalinux be part of the rhel family 2022-01-19 22:37:51 +01:00
Matthieu MOREL
4671e649aa
enable revive linter 2021-12-22 23:49:50 +01:00
mmorel-35
1e6b445a8a gofumpt 2021-12-22 21:54:41 +00:00
mmorel-35
eb5f6203d8 gofmt 2021-12-22 21:46:33 +00:00
shirou
b1186a68ed
Merge pull request #1191 from shirou/feature/update_mac_cgo
[disk][host][mac] fix deprecated code in macOS Monterey
2021-12-22 21:54:48 +09:00
Matthieu MOREL
b673968d5d
enable errorlint linter 2021-12-04 22:29:38 +01:00
shirou
4c3edcfe56 [mac] fix deprecated code in macOS Monterey 2021-12-04 03:37:03 +00:00
shirou
d2e27c1712 fix dependabot v2 deletion. 2021-12-01 00:12:55 +00:00
shirou
0969c9436b delete v2 directory, move v3 to top #1078 2021-11-30 23:47:59 +00:00
shirou
0fdf65fa3e Change to use yusufpapurcu/wmi from StackExchange/wmi. 2021-11-20 11:36:30 +00:00