From c749e4fca225cd00f5be15f6fe6e4538a6c29413 Mon Sep 17 00:00:00 2001 From: nobu Date: Tue, 14 Jul 2009 12:53:23 +0000 Subject: * ext/io/nonblock: moved from ext/io/wait/lib. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24106 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/io/wait/lib/nonblock.rb | 23 ----------------------- 1 file changed, 23 deletions(-) delete mode 100644 ext/io/wait/lib/nonblock.rb (limited to 'ext/io/wait/lib') diff --git a/ext/io/wait/lib/nonblock.rb b/ext/io/wait/lib/nonblock.rb deleted file mode 100644 index 2103fdf25b..0000000000 --- a/ext/io/wait/lib/nonblock.rb +++ /dev/null @@ -1,23 +0,0 @@ -require "fcntl" -class IO - def nonblock? - (fcntl(Fcntl::F_GETFL) & File::NONBLOCK) != 0 - end - - def nonblock=(nb) - f = fcntl(Fcntl::F_GETFL) - if nb - f |= File::NONBLOCK - else - f &= ~File::NONBLOCK - end - fcntl(Fcntl::F_SETFL, f) - end - - def nonblock(nb = true) - nb, self.nonblock = nonblock?, nb - yield - ensure - self.nonblock = nb - end -end if defined?(Fcntl::F_GETFL) -- cgit v1.2.3