{"id":18616779,"url":"https://github.com/sile/safeexec","last_synced_at":"2025-04-11T01:32:12.471Z","repository":{"id":12672510,"uuid":"15344507","full_name":"sile/safeexec","owner":"sile","description":"A tiny C command and Erlang API which provide safer exit handling for external program ports.","archived":false,"fork":false,"pushed_at":"2018-10-02T15:45:01.000Z","size":1039,"stargazers_count":3,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-25T07:12:53.039Z","etag":null,"topics":["erlang"],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sile.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-12-20T17:42:44.000Z","updated_at":"2021-12-13T10:15:40.000Z","dependencies_parsed_at":"2022-09-01T05:21:12.274Z","dependency_job_id":null,"html_url":"https://github.com/sile/safeexec","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sile%2Fsafeexec","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sile%2Fsafeexec/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sile%2Fsafeexec/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sile%2Fsafeexec/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sile","download_url":"https://codeload.github.com/sile/safeexec/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248325281,"owners_count":21084901,"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":["erlang"],"created_at":"2024-11-07T03:37:51.871Z","updated_at":"2025-04-11T01:32:11.439Z","avatar_url":"https://github.com/sile.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"safeexec\n========\n\n[![Build Status](https://travis-ci.org/sile/safeexec.svg?branch=master)](https://travis-ci.org/sile/safeexec)\n[![Code Coverage](https://codecov.io/gh/sile/safeexec/branch/master/graph/badge.svg)](https://codecov.io/gh/sile/safeexec/branch/master)\n[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)\n\n`erlang:open_port/2`により起動した外部コマンドの終了処理を安全・確実に行えるようにするためのライブラリ。\nこのライブラリは、C言語で記述されたsafeexec コマンドとそれを利用するErlangインタフェースを提供する。\n\n対応OS\n------\n- Linux\n- Mac\n  - experimental\n  - safeexecコマンドがSIGKILLで落とされた場合に、子プロセスが残ってしまうことがある\n\nsafeexecコマンド\n---------------\n\n基本的にはただ引数で指定された外部コマンドを実行するだけのコマンド:\n\n    $ safeexec コマンド名 コマンド引数...\n\nsafeexe 経由で実行された外部コマンドは、以下の性質を備えるようになる:\n\n- ErlangVM(プロセス)終了時に、確実に終了する\n- `erlang:port_close/1`あるいは`リンクプロセスのダウン`により、外部コマンドに紐づくポートが終了した場合に、確実に終了する\n\nつまり、外部コマンドを safeexec 経由で呼び出すことにより、\n利用者は外部コマンドポートを、Erlangの通常のプロセスに近い終了モデル(リンクしているプロセスが終了した場合は自分も終了する)で扱えるようになる。\n\n\nErlangインタフェース\n--------------------\n\n`safeexec:open_port/2`関数が利用できる。\n以下の二点を除いて`erlang:open_port/2`と全く同じ動作をする:\n\n- 第一引数が`{spawn, Command}`の場合は`Command`の前にsafeexecコマンドのパスが付与される\n- 第一引数が`{spawn_executable, FileName}`の場合は`FileName`の値はsafeexecコマンドのパスに置換され、もともとの`FileName`の値は`args`オプションの先頭に挿入される\n- `{spawn_driver, Command}`および`{fd, In, Out}`は非サポート\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsile%2Fsafeexec","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsile%2Fsafeexec","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsile%2Fsafeexec/lists"}