Sha256: f7c7c184e6a70bb7afb82573beb44595426385c694adee4b4bd1a3e435c2ae5c

Contents?: true

Size: 672 Bytes

Versions: 20

Compression:

Stored size: 672 Bytes

Contents

#include "ruby.h"
#ifdef HAVE_CONST_PR_SET_CHILD_SUBREAPER
#include <sys/prctl.h>

static VALUE enable_child_subreaper(VALUE module) {
  if (prctl(PR_SET_CHILD_SUBREAPER, 1) < 0) {
    rb_sys_fail("prctl(2) PR_SET_CHILD_SUBREAPER");
  }
  return Qtrue;
}
#else
static VALUE enable_child_subreaper(VALUE module) {
  return Qfalse;
}
#endif

void init_child_subreaper(VALUE mPitchfork)
{
#ifdef HAVE_CONST_PR_SET_CHILD_SUBREAPER
  rb_define_const(mPitchfork, "CHILD_SUBREAPER_AVAILABLE", Qtrue);
#else
  rb_define_const(mPitchfork, "CHILD_SUBREAPER_AVAILABLE", Qfalse);
#endif
  rb_define_singleton_method(mPitchfork, "enable_child_subreaper", enable_child_subreaper, 0);
}

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
pitchfork-0.16.0 ext/pitchfork_http/child_subreaper.h
pitchfork-0.15.0 ext/pitchfork_http/child_subreaper.h
pitchfork-0.14.0 ext/pitchfork_http/child_subreaper.h
pitchfork-0.13.0 ext/pitchfork_http/child_subreaper.h
pitchfork-0.12.0 ext/pitchfork_http/child_subreaper.h
pitchfork-0.11.1 ext/pitchfork_http/child_subreaper.h
pitchfork-0.11.0 ext/pitchfork_http/child_subreaper.h
pitchfork-0.10.0 ext/pitchfork_http/child_subreaper.h
pitchfork-0.9.0 ext/pitchfork_http/child_subreaper.h
pitchfork-0.8.0 ext/pitchfork_http/child_subreaper.h
pitchfork-0.7.0 ext/pitchfork_http/child_subreaper.h
pitchfork-0.6.0 ext/pitchfork_http/child_subreaper.h
pitchfork-0.5.0 ext/pitchfork_http/child_subreaper.h
pitchfork-0.4.1 ext/pitchfork_http/child_subreaper.h
pitchfork-0.4.0 ext/pitchfork_http/child_subreaper.h
pitchfork-0.3.0 ext/pitchfork_http/child_subreaper.h
pitchfork-0.2.0 ext/pitchfork_http/child_subreaper.h
pitchfork-0.1.2 ext/pitchfork_http/child_subreaper.h
pitchfork-0.1.1 ext/pitchfork_http/child_subreaper.h
pitchfork-0.1.0 ext/pitchfork_http/child_subreaper.h