{"id":15140947,"url":"https://github.com/posix-utilities/timeout","last_synced_at":"2026-01-04T12:37:41.007Z","repository":{"id":256728395,"uuid":"856137067","full_name":"posix-utilities/timeout","owner":"posix-utilities","description":"POSIX.1-2024 timeout","archived":false,"fork":false,"pushed_at":"2024-09-12T11:10:51.000Z","size":17,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-01-30T20:05:46.352Z","etag":null,"topics":["posix","posix-2024","timeout","zig"],"latest_commit_sha":null,"homepage":"https://pubs.opengroup.org/onlinepubs/9799919799/utilities/timeout.html","language":"Zig","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/posix-utilities.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}},"created_at":"2024-09-12T03:53:12.000Z","updated_at":"2024-09-12T19:08:26.000Z","dependencies_parsed_at":null,"dependency_job_id":"9ad24868-7fd4-46c6-bdaa-d6f7a3983d43","html_url":"https://github.com/posix-utilities/timeout","commit_stats":null,"previous_names":["posix-utilities/timeout"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/posix-utilities%2Ftimeout","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/posix-utilities%2Ftimeout/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/posix-utilities%2Ftimeout/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/posix-utilities%2Ftimeout/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/posix-utilities","download_url":"https://codeload.github.com/posix-utilities/timeout/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":237869122,"owners_count":19379269,"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":["posix","posix-2024","timeout","zig"],"created_at":"2024-09-26T08:42:37.001Z","updated_at":"2025-10-23T18:30:17.947Z","avatar_url":"https://github.com/posix-utilities.png","language":"Zig","funding_links":[],"categories":[],"sub_categories":[],"readme":"# [`timeout`](https://github.com/posix-utilities/timeout)\n\nPOSIX.1-2024 timeout\n\n```sh\ntimeout [options] \u003cduration\u003e \u003ccommand\u003e [arguments...]\n```\n\n```text\n-f             send timeout signal to the proccess only, not the process group\n               (when the group is sent the signal, 'timeout' briefly ignores it)\n-k \u003cduration\u003e  kill the process with SIGKILL after duration (respects -f)\n-p             preserve original exit status, regardless if timeout occured\n-s \u003csignal\u003e    TERM by default, or the chosen signal\n\n   \u003cduration\u003e  such as 10, 10s, 2.5m, 24h, or 1.5d\n```\n\n## Exit Status\n\n```text\n0              no error (or no error from \u003ccommand\u003e with -p)\n\u003cn\u003e            the return status of \u003ccommand\u003e (with -p)\n124            if killed by timeout (if -p is NOT specified)\n125            all other errors (if -p is NOT specified)\n126            command not executable\n127            command not found\n```\n\n# Build\n\n## Zig\n\n```sh\ncurl https://weib.sh/zig@v0.14 | sh\nsource ~/.config/envman/PATH.env\n\nzig targets | jq -r \".libc[]\" | sort -r\n```\n\n```sh\nzig build-exe ./timeout.zig -O ReleaseSmall\nmv ./timeout ~/bin/\n```\n\n```sh\nzig build-exe ./timeout.zig -O ReleaseSmall -target aarch64-macos-none -femit-bin=timeout-darwin-apple-aarch64\nzig build-exe ./timeout.zig -O ReleaseSmall -target x86_64-macos-none -femit-bin=timeout-darwin-apple-x86_64\n\n# works on musl too (no gnu/libc dependency)\nzig build-exe ./timeout.zig -O ReleaseSmall -target x86_64-linux-gnu -femit-bin=timeout-linux-unknown-x86_64\nzig build-exe ./timeout.zig -O ReleaseSmall -target aarch64-linux-gnu -femit-bin=timeout-linux-unknown-aarch64\nzig build-exe ./timeout.zig -O ReleaseSmall -target arm-linux-gnueabihf -femit-bin=timeout-linux-unknown-armv7l\nzig build-exe ./timeout.zig -O ReleaseSmall -target arm-linux-gnueabi -femit-bin=timeout-linux-unknown-armv6l\n\n# not supported yet (will require windows allocator and win signal mapping)\n#zig build-exe ./timeout.zig -O ReleaseSmall -target x86_64-windows-gnu -femit-bin=timeout-windows-pc-x86_64\n#zig build-exe ./timeout.zig -O ReleaseSmall -target aarch64-windows-gnu -femit-bin=timeout-windows-pc-aarch64\n```\n\n## Go\n\n```sh\ncurl https://weib.sh/go | sh\nsource ~/.config/envman/PATH.env\n\ngo tool dist list\n```\n\n```sh\ngo build -o ./timeout ./timeout.go\nmv ./timeout ~/bin/\n```\n\n```sh\nGOOS=darwin GOARCH=amd64 GOAMD64=v2 go build -o ./timeout-darwin-apple-x86_64 ./timeout.go\nGOOS=darwin GOARCH=arm64 go build -o ./timeout-darwin-apple-aarch64 ./timeout.go\nGOOS=linux GOARCH=amd64 GOAMD64=v2 go build -o ./timeout-linux-uknown-x86_64 ./timeout.go\nGOOS=linux GOARCH=arm64 go build -o ./timeout-linux-uknown-aarch64 ./timeout.go\nGOOS=linux GOARCH=arm GOARM=v7 go build -o ./timeout-linux-uknown-armv7l ./timeout.go\nGOOS=linux GOARCH=arm GOARM=v6 go build -o ./timeout-linux-uknown-armv6l ./timeout.go\n\n# not supported yet (will require build tags and windows syscalls)\n#GOOS=windows GOARCH=amd64 GOAMD64=v2 go build -o ./timeout-windows-pc-x86_64 ./timeout.go\n#GOOS=windows GOARCH=arm64 go build -o ./timeout-windows-pc-aarch64 ./timeout.go\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fposix-utilities%2Ftimeout","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fposix-utilities%2Ftimeout","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fposix-utilities%2Ftimeout/lists"}