<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -2,11 +2,16 @@ require 'ffi'
 
 module PTY
   private
-  module LibC
+  module LibUtil
     extend JRuby::FFI::Library
+    # forkpty(3) is in libutil on linux, libc on MacOS/BSD
+    if JRuby::FFI::Platform::IS_LINUX
+      ffi_lib 'libutil'
+    end
     attach_function :forkpty, [ :buffer_out, :buffer_out, :buffer_in, :buffer_in ], :pid_t
-    attach_function :openpty, [ :buffer_out, :buffer_out, :buffer_out, :buffer_in, :buffer_in ], :int
-    attach_function :login_tty, [ :int ], :int
+  end
+  module LibC
+    extend JRuby::FFI::Library
     attach_function :close, [ :int ], :int
     attach_function :strerror, [ :int ], :string
     attach_function :execv, [ :string, :buffer_in ], :int
@@ -37,7 +42,7 @@ module PTY
     # execv in the child after fork is really flakey
     #
     exec_cmd, exec_args = build_args(args)
-    pid = LibC.forkpty(mfdp, name, nil, nil)
+    pid = LibUtil.forkpty(mfdp, name, nil, nil)
     raise &quot;forkpty failed: #{LibC.strerror(FFI.errno)}&quot; if pid &lt; 0    
     if pid == 0
       LibC.execvp(exec_cmd, exec_args)</diff>
      <filename>lib/ruby/site_ruby/1.8/pty.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>e393b4b6de1c887ab2a7fdbb7f0cf499a2a6d8df</id>
    </parent>
  </parents>
  <author>
    <name>wmeissner</name>
    <email>wmeissner@961051c9-f516-0410-bf72-c9f7e237a7b7</email>
  </author>
  <url>http://github.com/vvs/jruby/commit/acfa0b5f5fbfbd608c4aefe65d4a895d89730b36</url>
  <id>acfa0b5f5fbfbd608c4aefe65d4a895d89730b36</id>
  <committed-date>2008-08-31T01:28:27-07:00</committed-date>
  <authored-date>2008-08-31T01:28:27-07:00</authored-date>
  <message>Linux seems to have forkpty(3) in libutil

git-svn-id: https://svn.codehaus.org/jruby/trunk/jruby@7607 961051c9-f516-0410-bf72-c9f7e237a7b7</message>
  <tree>e73f59ce01554ad0fb6ff5e1b07c21d7fb5bfcb5</tree>
  <committer>
    <name>wmeissner</name>
    <email>wmeissner@961051c9-f516-0410-bf72-c9f7e237a7b7</email>
  </committer>
</commit>
