{"id":17911426,"url":"https://github.com/tklauser/go-sysconf","last_synced_at":"2025-05-14T15:07:15.198Z","repository":{"id":34647928,"uuid":"150275510","full_name":"tklauser/go-sysconf","owner":"tklauser","description":"sysconf for Go, without using cgo","archived":false,"fork":false,"pushed_at":"2025-05-09T07:33:23.000Z","size":323,"stargazers_count":144,"open_issues_count":1,"forks_count":28,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-05-13T22:54:58.047Z","etag":null,"topics":["bsd","cgo","getconf","go","golang","linux","posix","sysconf","sysconfig","system-programming","unix"],"latest_commit_sha":null,"homepage":"https://pkg.go.dev/github.com/tklauser/go-sysconf","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tklauser.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2018-09-25T14:07:03.000Z","updated_at":"2025-05-09T07:33:25.000Z","dependencies_parsed_at":"2024-02-08T00:22:05.351Z","dependency_job_id":"cdb70538-2849-4f89-876e-67f6af363287","html_url":"https://github.com/tklauser/go-sysconf","commit_stats":{"total_commits":290,"total_committers":4,"mean_commits":72.5,"dds":"0.21724137931034482","last_synced_commit":"34dfbc549dd7fbb6ad8d274a9b1bf2c6db1f53dd"},"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tklauser%2Fgo-sysconf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tklauser%2Fgo-sysconf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tklauser%2Fgo-sysconf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tklauser%2Fgo-sysconf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tklauser","download_url":"https://codeload.github.com/tklauser/go-sysconf/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254169583,"owners_count":22026213,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bsd","cgo","getconf","go","golang","linux","posix","sysconf","sysconfig","system-programming","unix"],"created_at":"2024-10-28T19:38:14.090Z","updated_at":"2025-05-14T15:07:15.167Z","avatar_url":"https://github.com/tklauser.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"# go-sysconf\n\n[![Go Reference](https://pkg.go.dev/badge/github.com/tklauser/go-sysconf.svg)](https://pkg.go.dev/github.com/tklauser/go-sysconf)\n[![GitHub Action Status](https://github.com/tklauser/go-sysconf/workflows/Tests/badge.svg)](https://github.com/tklauser/go-sysconf/actions?query=workflow%3ATests)\n\n`sysconf` for Go, without using cgo or external binaries (e.g. getconf).\n\nSupported operating systems: Linux, macOS, DragonflyBSD, FreeBSD, NetBSD, OpenBSD, Solaris/Illumos.\n\nAll POSIX.1 and POSIX.2 variables are supported, see [References](#references) for a complete list.\n\nAdditionally, the following non-standard variables are supported on some operating systems:\n\n| Variable | Supported on |\n|---|---|\n| `SC_PHYS_PAGES`       | Linux, macOS, FreeBSD, NetBSD, OpenBSD, Solaris/Illumos |\n| `SC_AVPHYS_PAGES`     | Linux, OpenBSD, Solaris/Illumos |\n| `SC_NPROCESSORS_CONF` | Linux, macOS, FreeBSD, NetBSD, OpenBSD, Solaris/Illumos |\n| `SC_NPROCESSORS_ONLN` | Linux, macOS, FreeBSD, NetBSD, OpenBSD, Solaris/Illumos |\n| `SC_UIO_MAXIOV`       | Linux |\n\n## Usage\n\n```Go\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/tklauser/go-sysconf\"\n)\n\nfunc main() {\n\t// get clock ticks, this will return the same as C.sysconf(C._SC_CLK_TCK)\n\tclktck, err := sysconf.Sysconf(sysconf.SC_CLK_TCK)\n\tif err == nil {\n\t\tfmt.Printf(\"SC_CLK_TCK: %v\\n\", clktck)\n\t}\n}\n```\n\n## References\n\n* [POSIX documenation for `sysconf`](http://pubs.opengroup.org/onlinepubs/9699919799/functions/sysconf.html)\n* [Linux manpage for `sysconf(3)`](http://man7.org/linux/man-pages/man3/sysconf.3.html)\n* [glibc constants for `sysconf` parameters](https://www.gnu.org/software/libc/manual/html_node/Constants-for-Sysconf.html)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftklauser%2Fgo-sysconf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftklauser%2Fgo-sysconf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftklauser%2Fgo-sysconf/lists"}