[ruby-cvs:65411] nobu:r58240 (trunk): Add IO#pread and IO#pwrite methods

nobu at ruby-lang.org nobu at ruby-lang.org
Mon Apr 3 09:10:50 JST 2017


nobu	2017-04-03 09:10:50 +0900 (Mon, 03 Apr 2017)

  New Revision: 58240

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=58240

  Log:
    Add IO#pread and IO#pwrite methods
    
    These methods are useful for safe/concurrent file I/O in
    multi-thread/process environments and also fairly standard
    nowadays especially in systems supporting pthreads.
    
    Based on patches by Avseyev <sergey.avseyev at gmail.com> at
    [ruby-core:79290].  [Feature #4532]
    
    * configure.in: check for pwrite(2).  pread() is already used
      internally for IO.copy_stream.
    
    * io.c: implement wrappers for pread(2) and pwrite(2) and expose
      them in IO.

  Modified files:
    trunk/NEWS
    trunk/configure.in
    trunk/doc/contributors.rdoc
    trunk/io.c
    trunk/test/ruby/test_io.rb


More information about the ruby-cvs mailing list