summaryrefslogtreecommitdiff
path: root/ext/socket/ancdata.c
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-12-23 23:52:42 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-12-23 23:52:42 +0000
commita0484364619d72426dff1c13d028aa87b1a82a60 (patch)
tree98d23522fc31c0a40d899932f8717d948c708848 /ext/socket/ancdata.c
parenta041f129af10c4e3f6cc7720db1b3fdeec1e9d80 (diff)
update doc.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30330 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/socket/ancdata.c')
-rw-r--r--ext/socket/ancdata.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/ext/socket/ancdata.c b/ext/socket/ancdata.c
index abaf19d..8139437 100644
--- a/ext/socket/ancdata.c
+++ b/ext/socket/ancdata.c
@@ -237,15 +237,16 @@ ancillary_s_unix_rights(int argc, VALUE *argv, VALUE klass)
* # recvmsg needs :scm_rights=>true for unix_rights
* s1, s2 = UNIXSocket.pair
* p s1 #=> #<UNIXSocket:fd 3>
- * s1.sendmsg "stdin and a socket", 0, nil, [:SOCKET, :RIGHTS, [0,s1.fileno].pack("ii")]
+ * s1.sendmsg "stdin and a socket", 0, nil, Socket::AncillaryData.unix_rights(STDIN, s1)
* _, _, _, ctl = s2.recvmsg(:scm_rights=>true)
+ * p ctl #=> #<Socket::AncillaryData: UNIX SOCKET RIGHTS 6 7>
* p ctl.unix_rights #=> [#<IO:fd 6>, #<Socket:fd 7>]
* p File.identical?(STDIN, ctl.unix_rights[0]) #=> true
* p File.identical?(s1, ctl.unix_rights[1]) #=> true
*
* # If :scm_rights=>true is not given, unix_rights returns nil
* s1, s2 = UNIXSocket.pair
- * s1.sendmsg "stdin and a socket", 0, nil, [:SOCKET, :RIGHTS, [0,s1.fileno].pack("ii")]
+ * s1.sendmsg "stdin and a socket", 0, nil, Socket::AncillaryData.unix_rights(STDIN, s1)
* _, _, _, ctl = s2.recvmsg
* p ctl #=> #<Socket::AncillaryData: UNIX SOCKET RIGHTS 6 7>
* p ctl.unix_rights #=> nil