passenger 3.0.0.pre2 → 3.0.0.pre3

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of passenger might be problematic. Click here for more details.

Files changed (182) hide show
  1. data/bin/passenger-status +1 -1
  2. data/build/packaging.rb +4 -7
  3. data/build/ruby_extension.rb +5 -5
  4. data/ext/common/Constants.h +1 -1
  5. data/ext/common/LoggingAgent/RemoteSender.h +3 -1
  6. data/ext/nginx/ngx_http_passenger_module.c +1 -1
  7. data/ext/{phusion_passenger → ruby}/extconf.rb +1 -1
  8. data/ext/{phusion_passenger/native_support.c → ruby/passenger_native_support.c} +1 -1
  9. data/lib/phusion_passenger.rb +5 -6
  10. data/lib/phusion_passenger/dependencies.rb +23 -0
  11. data/lib/phusion_passenger/native_support.rb +123 -65
  12. data/lib/phusion_passenger/packaging.rb +1 -1
  13. data/lib/phusion_passenger/platform_info/apache.rb +1 -1
  14. data/lib/phusion_passenger/platform_info/compiler.rb +25 -1
  15. data/lib/phusion_passenger/platform_info/ruby.rb +36 -5
  16. data/lib/phusion_passenger/standalone/runtime_installer.rb +5 -4
  17. data/lib/phusion_passenger/utils.rb +62 -1
  18. data/test/ruby/utils_spec.rb +62 -0
  19. data/test/support/test_helper.rb +2 -0
  20. metadata +6 -168
  21. data/doc/rdoc/classes/ConditionVariable.html +0 -215
  22. data/doc/rdoc/classes/Exception.html +0 -120
  23. data/doc/rdoc/classes/GC.html +0 -113
  24. data/doc/rdoc/classes/IO.html +0 -221
  25. data/doc/rdoc/classes/PhusionPassenger.html +0 -368
  26. data/doc/rdoc/classes/PhusionPassenger/AbstractInstaller.html +0 -180
  27. data/doc/rdoc/classes/PhusionPassenger/AbstractRequestHandler.html +0 -647
  28. data/doc/rdoc/classes/PhusionPassenger/AbstractServer.html +0 -654
  29. data/doc/rdoc/classes/PhusionPassenger/AbstractServer/InvalidPassword.html +0 -92
  30. data/doc/rdoc/classes/PhusionPassenger/AbstractServer/ServerAlreadyStarted.html +0 -97
  31. data/doc/rdoc/classes/PhusionPassenger/AbstractServer/ServerError.html +0 -96
  32. data/doc/rdoc/classes/PhusionPassenger/AbstractServer/ServerNotStarted.html +0 -97
  33. data/doc/rdoc/classes/PhusionPassenger/AbstractServer/UnknownMessage.html +0 -96
  34. data/doc/rdoc/classes/PhusionPassenger/AbstractServerCollection.html +0 -619
  35. data/doc/rdoc/classes/PhusionPassenger/AdminTools.html +0 -142
  36. data/doc/rdoc/classes/PhusionPassenger/AdminTools/MemoryStats.html +0 -368
  37. data/doc/rdoc/classes/PhusionPassenger/AdminTools/MemoryStats/Process.html +0 -231
  38. data/doc/rdoc/classes/PhusionPassenger/AdminTools/ServerInstance.html +0 -588
  39. data/doc/rdoc/classes/PhusionPassenger/AdminTools/ServerInstance/CorruptedDirectoryError.html +0 -92
  40. data/doc/rdoc/classes/PhusionPassenger/AdminTools/ServerInstance/GenerationsAbsentError.html +0 -92
  41. data/doc/rdoc/classes/PhusionPassenger/AdminTools/ServerInstance/Group.html +0 -147
  42. data/doc/rdoc/classes/PhusionPassenger/AdminTools/ServerInstance/Process.html +0 -279
  43. data/doc/rdoc/classes/PhusionPassenger/AdminTools/ServerInstance/RoleDeniedError.html +0 -92
  44. data/doc/rdoc/classes/PhusionPassenger/AdminTools/ServerInstance/StaleDirectoryError.html +0 -92
  45. data/doc/rdoc/classes/PhusionPassenger/AdminTools/ServerInstance/Stats.html +0 -123
  46. data/doc/rdoc/classes/PhusionPassenger/AdminTools/ServerInstance/UnsupportedGenerationStructureVersionError.html +0 -92
  47. data/doc/rdoc/classes/PhusionPassenger/AnalyticsLogger.html +0 -341
  48. data/doc/rdoc/classes/PhusionPassenger/AnalyticsLogger/Log.html +0 -294
  49. data/doc/rdoc/classes/PhusionPassenger/AnalyticsLogger/SharedData.html +0 -199
  50. data/doc/rdoc/classes/PhusionPassenger/AppInitError.html +0 -155
  51. data/doc/rdoc/classes/PhusionPassenger/AppProcess.html +0 -367
  52. data/doc/rdoc/classes/PhusionPassenger/ClassicRails.html +0 -95
  53. data/doc/rdoc/classes/PhusionPassenger/ClassicRails/ApplicationSpawner.html +0 -351
  54. data/doc/rdoc/classes/PhusionPassenger/ClassicRails/ApplicationSpawner/Error.html +0 -98
  55. data/doc/rdoc/classes/PhusionPassenger/ClassicRails/CGIFixed.html +0 -200
  56. data/doc/rdoc/classes/PhusionPassenger/ClassicRails/FrameworkSpawner.html +0 -410
  57. data/doc/rdoc/classes/PhusionPassenger/ClassicRails/FrameworkSpawner/Error.html +0 -98
  58. data/doc/rdoc/classes/PhusionPassenger/ClassicRails/RequestHandler.html +0 -156
  59. data/doc/rdoc/classes/PhusionPassenger/ClassicRailsExtensions.html +0 -115
  60. data/doc/rdoc/classes/PhusionPassenger/ClassicRailsExtensions/AnalyticsLogging.html +0 -202
  61. data/doc/rdoc/classes/PhusionPassenger/ConsoleTextTemplate.html +0 -172
  62. data/doc/rdoc/classes/PhusionPassenger/DebugLogging.html +0 -273
  63. data/doc/rdoc/classes/PhusionPassenger/FrameworkInitError.html +0 -145
  64. data/doc/rdoc/classes/PhusionPassenger/HTMLTemplate.html +0 -162
  65. data/doc/rdoc/classes/PhusionPassenger/InitializationError.html +0 -141
  66. data/doc/rdoc/classes/PhusionPassenger/InvalidPath.html +0 -92
  67. data/doc/rdoc/classes/PhusionPassenger/MessageChannel.html +0 -673
  68. data/doc/rdoc/classes/PhusionPassenger/MessageChannel/InvalidHashError.html +0 -92
  69. data/doc/rdoc/classes/PhusionPassenger/MessageClient.html +0 -415
  70. data/doc/rdoc/classes/PhusionPassenger/NativeSupport.html +0 -494
  71. data/doc/rdoc/classes/PhusionPassenger/NativeSupport/FileSystemWatcher.html +0 -96
  72. data/doc/rdoc/classes/PhusionPassenger/Packaging.html +0 -129
  73. data/doc/rdoc/classes/PhusionPassenger/PlatformInfo.html +0 -1758
  74. data/doc/rdoc/classes/PhusionPassenger/Plugin.html +0 -237
  75. data/doc/rdoc/classes/PhusionPassenger/Rack.html +0 -91
  76. data/doc/rdoc/classes/PhusionPassenger/Rack/ApplicationSpawner.html +0 -312
  77. data/doc/rdoc/classes/PhusionPassenger/Rack/ApplicationSpawner/Error.html +0 -98
  78. data/doc/rdoc/classes/PhusionPassenger/Rack/RequestHandler.html +0 -218
  79. data/doc/rdoc/classes/PhusionPassenger/Rails3Extensions.html +0 -114
  80. data/doc/rdoc/classes/PhusionPassenger/Rails3Extensions/AnalyticsLogging.html +0 -256
  81. data/doc/rdoc/classes/PhusionPassenger/Rails3Extensions/AnalyticsLogging/ACExtension.html +0 -139
  82. data/doc/rdoc/classes/PhusionPassenger/Rails3Extensions/AnalyticsLogging/ASBenchmarkableExtension.html +0 -118
  83. data/doc/rdoc/classes/PhusionPassenger/Rails3Extensions/AnalyticsLogging/ExceptionLogger.html +0 -135
  84. data/doc/rdoc/classes/PhusionPassenger/SpawnManager.html +0 -378
  85. data/doc/rdoc/classes/PhusionPassenger/Standalone.html +0 -111
  86. data/doc/rdoc/classes/PhusionPassenger/Standalone/AppFinder.html +0 -252
  87. data/doc/rdoc/classes/PhusionPassenger/Standalone/Command.html +0 -161
  88. data/doc/rdoc/classes/PhusionPassenger/Standalone/ConfigFile.html +0 -368
  89. data/doc/rdoc/classes/PhusionPassenger/Standalone/ConfigFile/DisallowedContextError.html +0 -132
  90. data/doc/rdoc/classes/PhusionPassenger/Standalone/HelpCommand.html +0 -151
  91. data/doc/rdoc/classes/PhusionPassenger/Standalone/Main.html +0 -189
  92. data/doc/rdoc/classes/PhusionPassenger/Standalone/PackageRuntimeCommand.html +0 -177
  93. data/doc/rdoc/classes/PhusionPassenger/Standalone/RuntimeInstaller.html +0 -341
  94. data/doc/rdoc/classes/PhusionPassenger/Standalone/StartCommand.html +0 -203
  95. data/doc/rdoc/classes/PhusionPassenger/Standalone/StatusCommand.html +0 -156
  96. data/doc/rdoc/classes/PhusionPassenger/Standalone/StopCommand.html +0 -168
  97. data/doc/rdoc/classes/PhusionPassenger/Standalone/Utils.html +0 -86
  98. data/doc/rdoc/classes/PhusionPassenger/Standalone/VersionCommand.html +0 -135
  99. data/doc/rdoc/classes/PhusionPassenger/UnknownError.html +0 -125
  100. data/doc/rdoc/classes/PhusionPassenger/Utils.html +0 -1468
  101. data/doc/rdoc/classes/PhusionPassenger/Utils/FileSystemWatcher.html +0 -204
  102. data/doc/rdoc/classes/PhusionPassenger/Utils/FileSystemWatcher/DirInfo.html +0 -171
  103. data/doc/rdoc/classes/PhusionPassenger/Utils/FileSystemWatcher/FileInfo.html +0 -140
  104. data/doc/rdoc/classes/PhusionPassenger/Utils/HostsFileParser.html +0 -260
  105. data/doc/rdoc/classes/PhusionPassenger/Utils/PseudoIO.html +0 -169
  106. data/doc/rdoc/classes/PhusionPassenger/Utils/RewindableInput.html +0 -265
  107. data/doc/rdoc/classes/PhusionPassenger/Utils/RewindableInput/Tempfile.html +0 -120
  108. data/doc/rdoc/classes/PhusionPassenger/Utils/UnseekableSocket.html +0 -561
  109. data/doc/rdoc/classes/PhusionPassenger/VersionNotFound.html +0 -140
  110. data/doc/rdoc/classes/PhusionPassenger/WSGI.html +0 -89
  111. data/doc/rdoc/classes/PhusionPassenger/WSGI/ApplicationSpawner.html +0 -182
  112. data/doc/rdoc/classes/Process.html +0 -115
  113. data/doc/rdoc/classes/Signal.html +0 -139
  114. data/doc/rdoc/created.rid +0 -1
  115. data/doc/rdoc/files/DEVELOPERS_TXT.html +0 -276
  116. data/doc/rdoc/files/README.html +0 -157
  117. data/doc/rdoc/files/ext/phusion_passenger/native_support_c.html +0 -92
  118. data/doc/rdoc/files/lib/phusion_passenger/abstract_installer_rb.html +0 -130
  119. data/doc/rdoc/files/lib/phusion_passenger/abstract_request_handler_rb.html +0 -135
  120. data/doc/rdoc/files/lib/phusion_passenger/abstract_server_collection_rb.html +0 -126
  121. data/doc/rdoc/files/lib/phusion_passenger/abstract_server_rb.html +0 -128
  122. data/doc/rdoc/files/lib/phusion_passenger/admin_tools/memory_stats_rb.html +0 -126
  123. data/doc/rdoc/files/lib/phusion_passenger/admin_tools/server_instance_rb.html +0 -132
  124. data/doc/rdoc/files/lib/phusion_passenger/admin_tools_rb.html +0 -122
  125. data/doc/rdoc/files/lib/phusion_passenger/analytics_logger_rb.html +0 -129
  126. data/doc/rdoc/files/lib/phusion_passenger/app_process_rb.html +0 -127
  127. data/doc/rdoc/files/lib/phusion_passenger/classic_rails/application_spawner_rb.html +0 -141
  128. data/doc/rdoc/files/lib/phusion_passenger/classic_rails/cgi_fixed_rb.html +0 -126
  129. data/doc/rdoc/files/lib/phusion_passenger/classic_rails/framework_spawner_rb.html +0 -146
  130. data/doc/rdoc/files/lib/phusion_passenger/classic_rails/request_handler_rb.html +0 -125
  131. data/doc/rdoc/files/lib/phusion_passenger/classic_rails_extensions/init_rb.html +0 -132
  132. data/doc/rdoc/files/lib/phusion_passenger/console_text_template_rb.html +0 -126
  133. data/doc/rdoc/files/lib/phusion_passenger/constants_rb.html +0 -122
  134. data/doc/rdoc/files/lib/phusion_passenger/debug_logging_rb.html +0 -122
  135. data/doc/rdoc/files/lib/phusion_passenger/dependencies_rb.html +0 -147
  136. data/doc/rdoc/files/lib/phusion_passenger/exceptions_rb.html +0 -122
  137. data/doc/rdoc/files/lib/phusion_passenger/html_template_rb.html +0 -127
  138. data/doc/rdoc/files/lib/phusion_passenger/message_channel_rb.html +0 -120
  139. data/doc/rdoc/files/lib/phusion_passenger/message_client_rb.html +0 -127
  140. data/doc/rdoc/files/lib/phusion_passenger/native_support_rb.html +0 -131
  141. data/doc/rdoc/files/lib/phusion_passenger/packaging_rb.html +0 -122
  142. data/doc/rdoc/files/lib/phusion_passenger/platform_info/apache_rb.html +0 -127
  143. data/doc/rdoc/files/lib/phusion_passenger/platform_info/binary_compatibility_rb.html +0 -129
  144. data/doc/rdoc/files/lib/phusion_passenger/platform_info/compiler_rb.html +0 -126
  145. data/doc/rdoc/files/lib/phusion_passenger/platform_info/curl_rb.html +0 -126
  146. data/doc/rdoc/files/lib/phusion_passenger/platform_info/documentation_tools_rb.html +0 -126
  147. data/doc/rdoc/files/lib/phusion_passenger/platform_info/linux_rb.html +0 -126
  148. data/doc/rdoc/files/lib/phusion_passenger/platform_info/operating_system_rb.html +0 -127
  149. data/doc/rdoc/files/lib/phusion_passenger/platform_info/ruby_rb.html +0 -128
  150. data/doc/rdoc/files/lib/phusion_passenger/platform_info/zlib_rb.html +0 -126
  151. data/doc/rdoc/files/lib/phusion_passenger/platform_info_rb.html +0 -122
  152. data/doc/rdoc/files/lib/phusion_passenger/plugin_rb.html +0 -127
  153. data/doc/rdoc/files/lib/phusion_passenger/public_api_rb.html +0 -127
  154. data/doc/rdoc/files/lib/phusion_passenger/rack/application_spawner_rb.html +0 -137
  155. data/doc/rdoc/files/lib/phusion_passenger/rack/request_handler_rb.html +0 -125
  156. data/doc/rdoc/files/lib/phusion_passenger/rails3_extensions/init_rb.html +0 -127
  157. data/doc/rdoc/files/lib/phusion_passenger/simple_benchmarking_rb.html +0 -122
  158. data/doc/rdoc/files/lib/phusion_passenger/spawn_manager_rb.html +0 -160
  159. data/doc/rdoc/files/lib/phusion_passenger/standalone/app_finder_rb.html +0 -127
  160. data/doc/rdoc/files/lib/phusion_passenger/standalone/command_rb.html +0 -135
  161. data/doc/rdoc/files/lib/phusion_passenger/standalone/config_file_rb.html +0 -126
  162. data/doc/rdoc/files/lib/phusion_passenger/standalone/help_command_rb.html +0 -126
  163. data/doc/rdoc/files/lib/phusion_passenger/standalone/main_rb.html +0 -126
  164. data/doc/rdoc/files/lib/phusion_passenger/standalone/package_runtime_command_rb.html +0 -127
  165. data/doc/rdoc/files/lib/phusion_passenger/standalone/runtime_installer_rb.html +0 -132
  166. data/doc/rdoc/files/lib/phusion_passenger/standalone/start_command_rb.html +0 -136
  167. data/doc/rdoc/files/lib/phusion_passenger/standalone/status_command_rb.html +0 -126
  168. data/doc/rdoc/files/lib/phusion_passenger/standalone/stop_command_rb.html +0 -126
  169. data/doc/rdoc/files/lib/phusion_passenger/standalone/utils_rb.html +0 -126
  170. data/doc/rdoc/files/lib/phusion_passenger/standalone/version_command_rb.html +0 -127
  171. data/doc/rdoc/files/lib/phusion_passenger/utils/file_system_watcher_rb.html +0 -126
  172. data/doc/rdoc/files/lib/phusion_passenger/utils/hosts_file_parser_rb.html +0 -120
  173. data/doc/rdoc/files/lib/phusion_passenger/utils/rewindable_input_rb.html +0 -100
  174. data/doc/rdoc/files/lib/phusion_passenger/utils/tmpdir_rb.html +0 -122
  175. data/doc/rdoc/files/lib/phusion_passenger/utils/unseekable_socket_rb.html +0 -126
  176. data/doc/rdoc/files/lib/phusion_passenger/utils_rb.html +0 -179
  177. data/doc/rdoc/files/lib/phusion_passenger/wsgi/application_spawner_rb.html +0 -132
  178. data/doc/rdoc/fr_class_index.html +0 -139
  179. data/doc/rdoc/fr_file_index.html +0 -109
  180. data/doc/rdoc/fr_method_index.html +0 -435
  181. data/doc/rdoc/index.html +0 -26
  182. data/doc/rdoc/rdoc-style.css +0 -187
@@ -1,494 +0,0 @@
1
- <?xml version="1.0" encoding="iso-8859-1"?>
2
- <!DOCTYPE html
3
- PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
- <html>
6
- <head>
7
- <title>Module: PhusionPassenger::NativeSupport</title>
8
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
9
- <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
10
-
11
- <script language="JavaScript" type="text/javascript">
12
- // <![CDATA[
13
-
14
- function toggleSource( id )
15
- {
16
- var elem
17
- var link
18
-
19
- if( document.getElementById )
20
- {
21
- elem = document.getElementById( id )
22
- link = document.getElementById( "l_" + id )
23
- }
24
- else if ( document.all )
25
- {
26
- elem = eval( "document.all." + id )
27
- link = eval( "document.all.l_" + id )
28
- }
29
- else
30
- return false;
31
-
32
- if( elem.style.display == "block" )
33
- {
34
- elem.style.display = "none"
35
- link.innerHTML = "show source"
36
- }
37
- else
38
- {
39
- elem.style.display = "block"
40
- link.innerHTML = "hide source"
41
- }
42
- }
43
-
44
- function openCode( url )
45
- {
46
- window.open( url, "SOURCE_CODE", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=480,width=750" ).focus();
47
- }
48
- // ]]>
49
- </script>
50
- </head>
51
-
52
- <body>
53
- <table width="100%" border='0' cellpadding='0' cellspacing='0' class='banner'><tr>
54
- <td class="file-title"><span class="file-title-prefix">Module</span><br />PhusionPassenger::NativeSupport</td>
55
- <td align="right">
56
- <table cellspacing="0" cellpadding="2">
57
- <tr valign="top">
58
- <td>In:</td>
59
- <td>
60
- <a href="../../files/ext/phusion_passenger/native_support_c.html">ext/phusion_passenger/native_support.c</a>
61
- </td>
62
- </tr>
63
- </table>
64
- </td>
65
- </tr>
66
- </table>
67
- <!-- banner header -->
68
-
69
- <div id="bodyContent">
70
- <div id="content">
71
-
72
- <div class="description"><p>
73
- Utility functions for accessing system functionality.
74
- </p>
75
- </div>
76
-
77
-
78
-
79
- <div class="sectiontitle">Methods</div>
80
- <ul>
81
- <li><a href="#M000031">close_all_file_descriptors</a></li>
82
- <li><a href="#M000030">create_unix_socket</a></li>
83
- <li><a href="#M000032">disable_stdio_buffering</a></li>
84
- <li><a href="#M000029">recv_fd</a></li>
85
- <li><a href="#M000028">send_fd</a></li>
86
- <li><a href="#M000033">split_by_null_into_hash</a></li>
87
- <li><a href="#M000037">switch_user</a></li>
88
- <li><a href="#M000034">writev</a></li>
89
- <li><a href="#M000035">writev2</a></li>
90
- <li><a href="#M000036">writev3</a></li>
91
- </ul>
92
-
93
-
94
-
95
- <div class="sectiontitle">Classes and Modules</div>
96
- Class <a href="NativeSupport/FileSystemWatcher.html" class="link">PhusionPassenger::NativeSupport::FileSystemWatcher</a><br />
97
-
98
-
99
- <div class="sectiontitle">Constants</div>
100
- <table border='0' cellpadding='5'>
101
- <tr valign='top'>
102
- <td class="attr-name">UNIX_PATH_MAX</td>
103
- <td>=</td>
104
- <td class="attr-value">INT2NUM(sizeof(addr.sun_path))</td>
105
- </tr>
106
- <tr valign='top'>
107
- <td>&nbsp;</td>
108
- <td colspan="2" class="attr-desc">
109
- The maximum length of a Unix socket path, including terminating null.
110
-
111
- </td>
112
- </tr>
113
- <tr valign='top'>
114
- <td class="attr-name">SSIZE_MAX</td>
115
- <td>=</td>
116
- <td class="attr-value">LL2NUM(SSIZE_MAX)</td>
117
- </tr>
118
- <tr valign='top'>
119
- <td>&nbsp;</td>
120
- <td colspan="2" class="attr-desc">
121
- The maximum size of the data that may be passed to <a
122
- href="NativeSupport.html#M000034">#writev</a>.
123
-
124
- </td>
125
- </tr>
126
- </table>
127
-
128
-
129
- <div class="sectiontitle">Public Class methods</div>
130
- <div class="method">
131
- <div class="title">
132
- <a name="M000031"></a><b> close_all_file_descriptors(exceptions)<br />
133
- </b>
134
- </div>
135
- <div class="description">
136
- <p>
137
- Close all file descriptors, except those given in the <tt>exceptions</tt>
138
- array. For example, the following would close all file descriptors except
139
- standard input (0) and standard output (1).
140
- </p>
141
- <pre>
142
- close_all_file_descriptors([0, 1])
143
- </pre>
144
- </div>
145
- <div class="sourcecode">
146
- <p class="source-link">[ <a href="javascript:toggleSource('M000031_source')" id="l_M000031_source">show source</a> ]</p>
147
- <div id="M000031_source" class="dyn-source">
148
- <pre>
149
- /*
150
- * call-seq: close_all_file_descriptors(exceptions)
151
- *
152
- * Close all file descriptors, except those given in the +exceptions+ array.
153
- * For example, the following would close all file descriptors except standard
154
- * input (0) and standard output (1).
155
- *
156
- * close_all_file_descriptors([0, 1])
157
- */
158
- static VALUE
159
- close_all_file_descriptors(VALUE self, VALUE exceptions) {
160
-
161
- </pre>
162
- </div>
163
- </div>
164
- </div>
165
- <div class="method">
166
- <div class="title">
167
- <a name="M000030"></a><b> create_unix_socket(filename, backlog)<br />
168
- </b>
169
- </div>
170
- <div class="description">
171
- <p>
172
- Create a SOCK_STREAM server Unix socket. Unlike Ruby&#8216;s UNIXServer
173
- class, this function is also able to create Unix sockets on the abstract
174
- namespace by prepending the filename with a null byte.
175
- </p>
176
- <ul>
177
- <li><tt>filename</tt> (string): The filename of the Unix socket to create.
178
-
179
- </li>
180
- <li><tt>backlog</tt> (integer): The backlog to use for listening on the socket.
181
-
182
- </li>
183
- <li>Returns: The file descriptor of the created Unix socket, as an integer.
184
-
185
- </li>
186
- <li>Raises <tt>SystemCallError</tt> if something went wrong.
187
-
188
- </li>
189
- </ul>
190
- </div>
191
- <div class="sourcecode">
192
- <p class="source-link">[ <a href="javascript:toggleSource('M000030_source')" id="l_M000030_source">show source</a> ]</p>
193
- <div id="M000030_source" class="dyn-source">
194
- <pre>
195
- /*
196
- * call-seq: create_unix_socket(filename, backlog)
197
- *
198
- * Create a SOCK_STREAM server Unix socket. Unlike Ruby's UNIXServer class,
199
- * this function is also able to create Unix sockets on the abstract namespace
200
- * by prepending the filename with a null byte.
201
- *
202
- * - +filename+ (string): The filename of the Unix socket to create.
203
- * - +backlog+ (integer): The backlog to use for listening on the socket.
204
- * - Returns: The file descriptor of the created Unix socket, as an integer.
205
- * - Raises +SystemCallError+ if something went wrong.
206
- */
207
- static VALUE
208
- create_unix_socket(VALUE self, VALUE filename, VALUE backlog) {
209
-
210
- </pre>
211
- </div>
212
- </div>
213
- </div>
214
- <div class="method">
215
- <div class="title">
216
- <a name="M000032"></a><b> disable_stdio_buffering<br />
217
- </b>
218
- </div>
219
- <div class="description">
220
- <p>
221
- Disables any kind of buffering on the C <tt>stdout</tt> and <tt>stderr</tt>
222
- variables, so that +fprintf()+ on <tt>stdout</tt> and <tt>stderr</tt> have
223
- immediate effect.
224
- </p>
225
- </div>
226
- <div class="sourcecode">
227
- <p class="source-link">[ <a href="javascript:toggleSource('M000032_source')" id="l_M000032_source">show source</a> ]</p>
228
- <div id="M000032_source" class="dyn-source">
229
- <pre>
230
- /*
231
- * call-seq: disable_stdio_buffering
232
- *
233
- * Disables any kind of buffering on the C +stdout+ and +stderr+ variables,
234
- * so that +fprintf()+ on +stdout+ and +stderr+ have immediate effect.
235
- */
236
- static VALUE
237
- disable_stdio_buffering(VALUE self) {
238
-
239
- </pre>
240
- </div>
241
- </div>
242
- </div>
243
- <div class="method">
244
- <div class="title">
245
- <a name="M000029"></a><b> recv_fd(socket_fd)<br />
246
- </b>
247
- </div>
248
- <div class="description">
249
- <p>
250
- Receive a file descriptor from the given Unix socket. Returns the received
251
- file descriptor as an integer. Raises <tt>SystemCallError</tt> if something
252
- went wrong.
253
- </p>
254
- <p>
255
- You do not have call this method directly. A convenience wrapper is
256
- provided by IO#recv_io.
257
- </p>
258
- </div>
259
- <div class="sourcecode">
260
- <p class="source-link">[ <a href="javascript:toggleSource('M000029_source')" id="l_M000029_source">show source</a> ]</p>
261
- <div id="M000029_source" class="dyn-source">
262
- <pre>
263
- /*
264
- * call-seq: recv_fd(socket_fd)
265
- *
266
- * Receive a file descriptor from the given Unix socket. Returns the received
267
- * file descriptor as an integer. Raises +SystemCallError+ if something went
268
- * wrong.
269
- *
270
- * You do not have call this method directly. A convenience wrapper is
271
- * provided by IO#recv_io.
272
- */
273
- static VALUE
274
- recv_fd(VALUE self, VALUE socket_fd) {
275
-
276
- </pre>
277
- </div>
278
- </div>
279
- </div>
280
- <div class="method">
281
- <div class="title">
282
- <a name="M000028"></a><b> send_fd(socket_fd, fd_to_send)<br />
283
- </b>
284
- </div>
285
- <div class="description">
286
- <p>
287
- Send a file descriptor over the given Unix socket. You do not have to call
288
- this function directly. A convenience wrapper is provided by IO#send_io.
289
- </p>
290
- <ul>
291
- <li><tt>socket_fd</tt> (integer): The file descriptor of the socket.
292
-
293
- </li>
294
- <li><tt>fd_to_send</tt> (integer): The file descriptor to send.
295
-
296
- </li>
297
- <li>Raises <tt>SystemCallError</tt> if something went wrong.
298
-
299
- </li>
300
- </ul>
301
- </div>
302
- <div class="sourcecode">
303
- <p class="source-link">[ <a href="javascript:toggleSource('M000028_source')" id="l_M000028_source">show source</a> ]</p>
304
- <div id="M000028_source" class="dyn-source">
305
- <pre>
306
- /*
307
- * call-seq: send_fd(socket_fd, fd_to_send)
308
- *
309
- * Send a file descriptor over the given Unix socket. You do not have to call
310
- * this function directly. A convenience wrapper is provided by IO#send_io.
311
- *
312
- * - +socket_fd+ (integer): The file descriptor of the socket.
313
- * - +fd_to_send+ (integer): The file descriptor to send.
314
- * - Raises +SystemCallError+ if something went wrong.
315
- */
316
- static VALUE
317
- send_fd(VALUE self, VALUE socket_fd, VALUE fd_to_send) {
318
-
319
- </pre>
320
- </div>
321
- </div>
322
- </div>
323
- <div class="method">
324
- <div class="title">
325
- <a name="M000033"></a><b>split_by_null_into_hash</b>(p1)
326
- </div>
327
- <div class="description">
328
- <p>
329
- Split the given string into an hash. Keys and values are obtained by
330
- splitting the string using the null character as the delimitor.
331
- </p>
332
- </div>
333
- <div class="sourcecode">
334
- <p class="source-link">[ <a href="javascript:toggleSource('M000033_source')" id="l_M000033_source">show source</a> ]</p>
335
- <div id="M000033_source" class="dyn-source">
336
- <pre>
337
- /**
338
- * Split the given string into an hash. Keys and values are obtained by splitting the
339
- * string using the null character as the delimitor.
340
- */
341
- static VALUE
342
- split_by_null_into_hash(VALUE self, VALUE data) {
343
-
344
- </pre>
345
- </div>
346
- </div>
347
- </div>
348
- <div class="method">
349
- <div class="title">
350
- <a name="M000037"></a><b>switch_user</b>(p1, p2, p3)
351
- </div>
352
- <div class="description">
353
- <p>
354
- Ruby&#8216;s implementations of initgroups, setgid and setuid are broken
355
- various ways, sigh&#8230; Ruby&#8216;s setgid and setuid can&#8216;t handle
356
- negative UIDs and initgroups is just broken. Work around it by using our
357
- own implementation.
358
- </p>
359
- </div>
360
- <div class="sourcecode">
361
- <p class="source-link">[ <a href="javascript:toggleSource('M000037_source')" id="l_M000037_source">show source</a> ]</p>
362
- <div id="M000037_source" class="dyn-source">
363
- <pre>
364
- /**
365
- * Ruby's implementations of initgroups, setgid and setuid are broken various ways,
366
- * sigh...
367
- * Ruby's setgid and setuid can't handle negative UIDs and initgroups is just broken.
368
- * Work around it by using our own implementation.
369
- */
370
- static VALUE
371
- switch_user(VALUE self, VALUE username, VALUE uid, VALUE gid) {
372
-
373
- </pre>
374
- </div>
375
- </div>
376
- </div>
377
- <div class="method">
378
- <div class="title">
379
- <a name="M000034"></a><b>writev</b>(p1, p2)
380
- </div>
381
- <div class="description">
382
- <p>
383
- Writes all of the strings in the <tt>components</tt> array into the given
384
- file descriptor using the +<a
385
- href="NativeSupport.html#M000034">writev</a>()+ system call. Unlike
386
- IO#write, this method does not require one to concatenate all those strings
387
- into a single buffer in order to send the data in a single system call.
388
- Thus, <a href="NativeSupport.html#M000034">#writev</a> is a great way to
389
- perform zero-copy I/O.
390
- </p>
391
- <p>
392
- Unlike the raw <a href="NativeSupport.html#M000034">writev</a>() system
393
- call, this method ensures that all given data is written before returning,
394
- by performing multiple <a href="NativeSupport.html#M000034">writev</a>()
395
- calls and whatever else is necessary.
396
- </p>
397
- <pre>
398
- writev(@socket.fileno, [&quot;hello &quot;, &quot;world&quot;, &quot;\n&quot;])
399
- </pre>
400
- </div>
401
- <div class="sourcecode">
402
- <p class="source-link">[ <a href="javascript:toggleSource('M000034_source')" id="l_M000034_source">show source</a> ]</p>
403
- <div id="M000034_source" class="dyn-source">
404
- <pre>
405
- /**
406
- * Writes all of the strings in the +components+ array into the given file
407
- * descriptor using the +writev()+ system call. Unlike IO#write, this method
408
- * does not require one to concatenate all those strings into a single buffer
409
- * in order to send the data in a single system call. Thus, #writev is a great
410
- * way to perform zero-copy I/O.
411
- *
412
- * Unlike the raw writev() system call, this method ensures that all given
413
- * data is written before returning, by performing multiple writev() calls
414
- * and whatever else is necessary.
415
- *
416
- * writev(@socket.fileno, [&quot;hello &quot;, &quot;world&quot;, &quot;\n&quot;])
417
- */
418
- static VALUE
419
- f_writev(VALUE self, VALUE fd, VALUE components) {
420
-
421
- </pre>
422
- </div>
423
- </div>
424
- </div>
425
- <div class="method">
426
- <div class="title">
427
- <a name="M000035"></a><b>writev2</b>(p1, p2, p3)
428
- </div>
429
- <div class="description">
430
- <p>
431
- Like <a href="NativeSupport.html#M000034">#writev</a>, but accepts two
432
- arrays. The data is written in the given order.
433
- </p>
434
- <pre>
435
- writev2(@socket.fileno, [&quot;hello &quot;, &quot;world&quot;, &quot;\n&quot;], [&quot;another &quot;, &quot;message\n&quot;])
436
- </pre>
437
- </div>
438
- <div class="sourcecode">
439
- <p class="source-link">[ <a href="javascript:toggleSource('M000035_source')" id="l_M000035_source">show source</a> ]</p>
440
- <div id="M000035_source" class="dyn-source">
441
- <pre>
442
- /**
443
- * Like #writev, but accepts two arrays. The data is written in the given order.
444
- *
445
- * writev2(@socket.fileno, [&quot;hello &quot;, &quot;world&quot;, &quot;\n&quot;], [&quot;another &quot;, &quot;message\n&quot;])
446
- */
447
- static VALUE
448
- f_writev2(VALUE self, VALUE fd, VALUE components1, VALUE components2) {
449
-
450
- </pre>
451
- </div>
452
- </div>
453
- </div>
454
- <div class="method">
455
- <div class="title">
456
- <a name="M000036"></a><b>writev3</b>(p1, p2, p3, p4)
457
- </div>
458
- <div class="description">
459
- <p>
460
- Like <a href="NativeSupport.html#M000034">#writev</a>, but accepts three
461
- arrays. The data is written in the given order.
462
- </p>
463
- <pre>
464
- writev3(@socket.fileno,
465
- [&quot;hello &quot;, &quot;world&quot;, &quot;\n&quot;],
466
- [&quot;another &quot;, &quot;message\n&quot;],
467
- [&quot;yet &quot;, &quot;another &quot;, &quot;one&quot;, &quot;\n&quot;])
468
- </pre>
469
- </div>
470
- <div class="sourcecode">
471
- <p class="source-link">[ <a href="javascript:toggleSource('M000036_source')" id="l_M000036_source">show source</a> ]</p>
472
- <div id="M000036_source" class="dyn-source">
473
- <pre>
474
- /**
475
- * Like #writev, but accepts three arrays. The data is written in the given order.
476
- *
477
- * writev3(@socket.fileno,
478
- * [&quot;hello &quot;, &quot;world&quot;, &quot;\n&quot;],
479
- * [&quot;another &quot;, &quot;message\n&quot;],
480
- * [&quot;yet &quot;, &quot;another &quot;, &quot;one&quot;, &quot;\n&quot;])
481
- */
482
- static VALUE
483
- f_writev3(VALUE self, VALUE fd, VALUE components1, VALUE components2, VALUE components3) {
484
-
485
- </pre>
486
- </div>
487
- </div>
488
- </div>
489
- </div>
490
-
491
- </div>
492
-
493
- </body>
494
- </html>