File: hello_ractor.rb

package info (click to toggle)
ruby-ffi 1.17.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,988 kB
  • sloc: ruby: 9,446; ansic: 7,713; xml: 151; sh: 51; makefile: 14
file content (11 lines) | stat: -rw-r--r-- 231 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
require 'ffi'

module Foo
  extend FFI::Library
  ffi_lib FFI::Library::LIBC
  attach_function("cputs", "puts", [ :string ], :int)
  freeze
end
Ractor.new do
  Foo.cputs("Hello, World via libc puts using FFI in a Ractor")
end.take