https://github.com/x13a/libproc-swift
Swift wrapper for proc library
https://github.com/x13a/libproc-swift
macos osx swift
Last synced: about 1 year ago
JSON representation
Swift wrapper for proc library
- Host: GitHub
- URL: https://github.com/x13a/libproc-swift
- Owner: x13a
- License: mit
- Created: 2021-07-08T05:52:50.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2024-05-10T16:04:31.000Z (about 2 years ago)
- Last Synced: 2024-05-11T16:57:28.082Z (about 2 years ago)
- Topics: macos, osx, swift
- Language: Swift
- Homepage:
- Size: 16.6 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# libproc-swift
Swift wrapper for `proc` library.
## Example
```swift
import Darwin
import Proc
func main() throws {
// To get pid path:
let path = try Proc.pidPath(getpid()).get()
print(path)
// To list all pids:
let pids = try Proc.listAllPids().get()
print(pids)
// To get `proc_bsdinfo`:
let info = try Proc.pidInfo(proc_bsdinfo.self, getpid(), 0).get()
print(info)
}
main()
```