Transaction now has limited support for PromotableSinglePhaseEnlistment
[mono.git] / mcs / class / Mono.Posix / Documentation / en / Mono.Unix / UnixMarshal.xml
1 <Type Name="UnixMarshal" FullName="Mono.Unix.UnixMarshal">
2   <TypeSignature Language="C#" Value="public sealed class UnixMarshal" />
3   <AssemblyInfo>
4     <AssemblyName>Mono.Posix</AssemblyName>
5     <AssemblyVersion>1.0.5000.0</AssemblyVersion>
6     <AssemblyVersion>2.0.0.0</AssemblyVersion>
7   </AssemblyInfo>
8   <ThreadingSafetyStatement>This type is safe for multithreaded operations.</ThreadingSafetyStatement>
9   <Base>
10     <BaseTypeName>System.Object</BaseTypeName>
11   </Base>
12   <Interfaces />
13   <Docs>
14     <summary>
15       Provides a collection of miscellaneous methods for marshaling strings,
16       allocating memory, and interoperating with the operating system.
17     </summary>
18     <remarks>
19       <para>
20         The <b>UnixMarshal</b> class consists of many members to facilitate
21         the <see cref="T:System.Runtime.InteropServices.Marshal" /> class,
22         specifically for use with Unix.
23       </para>
24       <para>
25         The following table assigns each method to a category that describes
26         its usage:
27       </para>
28       <list type="table">
29         <listheader>
30           <term>Category</term>
31           <description>Members</description>
32         </listheader>
33         <item>
34           <term>Data Transformation</term>
35           <description>
36             <para>
37               Managed to unmanaged:
38               <see cref="M:Mono.Unix.UnixMarshal.StringToHeap" />,
39             </para>
40             <para>
41               Unmanaged to managed:
42               <see cref="M:Mono.Unix.UnixMarshal.PtrToString" />,
43               <see cref="M:Mono.Unix.UnixMarshal.PtrToStringArray" />,
44               <see cref="M:Mono.Unix.UnixMarshal.PtrToStringUnix" /></para>
45           </description>
46         </item>
47         <item>
48           <term>Error Handling</term>
49           <description>
50             <see cref="M:Mono.Unix.UnixMarshal.GetErrorDescription" />,
51             <see cref="M:Mono.Unix.UnixMarshal.ShouldRetrySyscall" />,
52             <see cref="M:Mono.Unix.UnixMarshal.ThrowExceptionForError" />,
53             <see cref="M:Mono.Unix.UnixMarshal.ThrowExceptionForErrorIf" />,
54             <see cref="M:Mono.Unix.UnixMarshal.ThrowExceptionForLastError" />,
55             <see cref="M:Mono.Unix.UnixMarshal.ThrowExceptionForLastErrorIf" /></description>
56         </item>
57         <item>
58           <term>Memory Management</term>
59           <description>
60             <see cref="M:Mono.Unix.UnixMarshal.AllocHeap" />,
61             <see cref="M:Mono.Unix.UnixMarshal.ReAllocHeap" />,
62             <see cref="M:Mono.Unix.UnixMarshal.FreeHeap" /></description>
63         </item>
64       </list>
65     </remarks>
66   </Docs>
67   <Members>
68     <Member MemberName="AllocHeap">
69       <MemberSignature Language="C#" Value="public static IntPtr AllocHeap (long size);" />
70       <MemberType>Method</MemberType>
71       <ReturnValue>
72         <ReturnType>System.IntPtr</ReturnType>
73       </ReturnValue>
74       <Parameters>
75         <Parameter Name="size" Type="System.Int64" />
76       </Parameters>
77       <Docs>
78         <param name="size">
79           A <see cref="T:System.Int64" /> containing the number of bytes to
80           allocate on the system heap.
81         </param>
82         <summary>Allocates <paramref name="size" /> bytes from the system heap.</summary>
83         <returns>
84           A <see cref="T:System.IntPtr" /> containing the address of 
85           <paramref name="size" /> bytes on the system heap, or
86           <see cref="F:System.IntPtr.Zero" /> if the memory could not be
87           allocated.
88         </returns>
89         <remarks>
90           <para>
91             The "system heap" is where dynamic memory is allocated by the
92             runtime C library, <c>MSVCRT.DLL</c> on Win32 and <c>libc</c> on
93             Unix platforms.
94           </para>
95           <para>
96             The memory allocated by this function must be freed via
97             <see cref="M:Mono.Unix.UnixMarshal.FreeHeap" /> to avoid a memory
98             leak.
99           </para>
100         </remarks>
101         <exception cref="T:System.ArgumentOutOfRangeException">
102           <paramref name="size" /> is a negative value.
103         </exception>
104         <altmember cref="M:Mono.Unix.UnixMarshal.FreeHeap" />
105         <altmember cref="M:Mono.Unix.Native.Stdlib.malloc" />
106       </Docs>
107       <AssemblyInfo>
108         <AssemblyVersion>1.0.5000.0</AssemblyVersion>
109         <AssemblyVersion>2.0.0.0</AssemblyVersion>
110       </AssemblyInfo>
111     </Member>
112     <Member MemberName="FreeHeap">
113       <MemberSignature Language="C#" Value="public static void FreeHeap (IntPtr ptr);" />
114       <MemberType>Method</MemberType>
115       <ReturnValue>
116         <ReturnType>System.Void</ReturnType>
117       </ReturnValue>
118       <Parameters>
119         <Parameter Name="ptr" Type="System.IntPtr" />
120       </Parameters>
121       <Docs>
122         <param name="ptr">
123           A <see cref="T:System.IntPtr" /> containing the address of a block
124           of memory previously returned by 
125           <see cref="M:Mono.Unix.UnixMarshal.AllocHeap" /> or
126           <see cref="M:Mono.Unix.UnixMarshal.ReAllocHeap" />.
127         </param>
128         <summary>Frees the memory referenced by <paramref name="ptr" />.</summary>
129         <remarks>
130           <para>
131             If <paramref name="ptr" /> is <see cref="F:System.IntPtr.Zero" />,
132             no action occurs.
133           </para>
134           <para>
135             The "system heap" is where dynamic memory is allocated by the
136             runtime C library, <c>MSVCRT.DLL</c> on Win32 and <c>libc</c> on
137             Unix platforms.
138           </para>
139         </remarks>
140         <altmember cref="M:Mono.Unix.UnixMarshal.AllocHeap" />
141         <altmember cref="M:Mono.Unix.UnixMarshal.ReAllocHeap" />
142         <altmember cref="M:Mono.Unix.Native.Stdlib.free" />
143       </Docs>
144       <AssemblyInfo>
145         <AssemblyVersion>1.0.5000.0</AssemblyVersion>
146         <AssemblyVersion>2.0.0.0</AssemblyVersion>
147       </AssemblyInfo>
148     </Member>
149     <Member MemberName="GetErrorDescription">
150       <MemberSignature Language="C#" Value="public static string GetErrorDescription (Mono.Unix.Native.Errno errno);" />
151       <MemberType>Method</MemberType>
152       <ReturnValue>
153         <ReturnType>System.String</ReturnType>
154       </ReturnValue>
155       <Parameters>
156         <Parameter Name="errno" Type="Mono.Unix.Native.Errno" />
157       </Parameters>
158       <Docs>
159         <param name="errno">
160           A <see cref="T:Mono.Unix.Native.Errno" /> containing the error code
161           to get the description for.
162         </param>
163         <summary>Gets a description for the error code <paramref name="errno" />.</summary>
164         <returns>
165           A <see cref="T:System.String" /> containing a description of the
166           specified error code <paramref name="errno" />.
167         </returns>
168         <remarks>
169           <para>
170             If <paramref name="errno" /> isn't a valid error number or isn't
171             supported by the operating system, then the string 
172             "<c>** Unknown error code: <paramref name="errno" />**</c>" is
173             returned.
174           </para>
175         </remarks>
176         <altmember cref="M:Mono.Unix.Native.Stdlib.strerror" />
177         <altmember cref="M:Mono.Unix.Native.Syscall.strerror_r" />
178       </Docs>
179       <AssemblyInfo>
180         <AssemblyVersion>1.0.5000.0</AssemblyVersion>
181         <AssemblyVersion>2.0.0.0</AssemblyVersion>
182       </AssemblyInfo>
183       <Attributes>
184         <Attribute>
185           <AttributeName>System.CLSCompliant(false)</AttributeName>
186         </Attribute>
187       </Attributes>
188     </Member>
189     <Member MemberName="PtrToString">
190       <MemberSignature Language="C#" Value="public static string PtrToString (IntPtr p);" />
191       <MemberType>Method</MemberType>
192       <ReturnValue>
193         <ReturnType>System.String</ReturnType>
194       </ReturnValue>
195       <Parameters>
196         <Parameter Name="p" Type="System.IntPtr" />
197       </Parameters>
198       <Docs>
199         <param name="p">
200           A <see cref="T:System.IntPtr" /> containing the address of an
201           unmanaged string in the <see cref="T:Mono.Unix.UnixEncoding" />
202           encoding.
203         </param>
204         <summary>
205           Allocates a managed <see cref="T:System.String" /> and marshals the
206           unmanaged string into the managed string.
207         </summary>
208         <returns>
209           A <see cref="T:System.String" /> containing a copy of the unmanaged
210           string <paramref name="p" />, or <see langword="null" /> if 
211           <paramref name="p" /> is <see cref="F:System.IntPtr.Zero" />.
212         </returns>
213         <remarks>
214           <para>
215             The input string <paramref name="p" /> must have a terminating
216             null <c>0x00</c> byte.
217           </para>
218           <para>
219             This method is identical to
220             <see cref="M:Mono.Unix.UnixMarshal.PtrToString" />(<paramref name="p" />, 
221             <see cref="F:Mono.Unix.UnixEncoding.Instance" />).
222           </para>
223         </remarks>
224         <altmember cref="M:Mono.Unix.UnixMarshal.PtrToStringUnix" />
225       </Docs>
226       <AssemblyInfo>
227         <AssemblyVersion>1.0.5000.0</AssemblyVersion>
228         <AssemblyVersion>2.0.0.0</AssemblyVersion>
229       </AssemblyInfo>
230     </Member>
231     <Member MemberName="PtrToString">
232       <MemberSignature Language="C#" Value="public static string PtrToString (IntPtr p, System.Text.Encoding encoding);" />
233       <MemberType>Method</MemberType>
234       <ReturnValue>
235         <ReturnType>System.String</ReturnType>
236       </ReturnValue>
237       <Parameters>
238         <Parameter Name="p" Type="System.IntPtr" />
239         <Parameter Name="encoding" Type="System.Text.Encoding" />
240       </Parameters>
241       <Docs>
242         <param name="p">
243           A <see cref="T:System.IntPtr" /> containing the address of an
244           unmanaged string in the <paramref name="encoding" />
245           encoding.
246         </param>
247         <param name="encoding">
248           A <see cref="T:System.Text.Encoding" /> specifying which encoding
249           <paramref name="p" /> is in.
250         </param>
251         <summary>
252           Allocates a managed <see cref="T:System.String" /> and marshals the
253           unmanaged string into the managed string using the specified
254           encoding.
255         </summary>
256         <returns>
257           A <see cref="T:System.String" /> containing a copy of the unmanaged
258           string <paramref name="p" />, or <see langword="null" /> if 
259           <paramref name="p" /> is <see cref="F:System.IntPtr.Zero" />.
260         </returns>
261         <remarks>
262           <para>
263             The input string <paramref name="p" /> must have a terminating
264             null.  The definition of "terminating null" is fluid in this
265             context, since the size of a terminating null depends upon the
266             encoding specified.
267           </para>
268           <para>
269             A terminating null is a single byte containing the value
270             <c>0x00</c> if <paramref name="encoding" /> is one of the
271             following encodings:
272             <see cref="T:System.Text.ASCIIEncoding" />,
273             <see cref="T:System.Text.UTF8Encoding" />,
274             <see cref="T:System.Text.UTF7Encoding" />, or
275             <see cref="T:Mono.Unix.UnixEncoding" />.
276           </para>
277           <para>
278             A terminating null is the <see cref="T:System.Int16" /> value
279             <c>0x0000</c> if <paramref name="encoding" /> is 
280             <see cref="T:System.Text.UnicodeEncoding" />.
281           </para>
282           <para>
283             Otherwise, the terminating null must consist of a sequence of 
284             <see cref="M:System.Text.Encoding.GetMaxByteCount" />(1) bytes
285             having the value <c>0x00</c>.
286             <block subset="none" type="note">
287               This potentially plays havoc with multi-byte encodings, as many
288               multi-byte encodings would only use a single byte for the
289               terminating null, and not the maximum possible number of bytes
290               used for encoding any character to be used for the terminating
291               null.
292             </block></para>
293           <para>
294             Any buffer returned by 
295             <see cref="M:Mono.Unix.UnixMarshal.StringToHeap" /> will satisfy
296             this requirement.
297           </para>
298         </remarks>
299         <exception cref="T:System.ArgumentNullException">
300           <paramref name="encoding" /> is <see langword="null" />.
301         </exception>
302       </Docs>
303       <AssemblyInfo>
304         <AssemblyVersion>1.0.5000.0</AssemblyVersion>
305         <AssemblyVersion>2.0.0.0</AssemblyVersion>
306       </AssemblyInfo>
307     </Member>
308     <Member MemberName="PtrToStringArray">
309       <MemberSignature Language="C#" Value="public static string[] PtrToStringArray (IntPtr stringArray);" />
310       <MemberType>Method</MemberType>
311       <ReturnValue>
312         <ReturnType>System.String[]</ReturnType>
313       </ReturnValue>
314       <Parameters>
315         <Parameter Name="stringArray" Type="System.IntPtr" />
316       </Parameters>
317       <Docs>
318         <param name="stringArray">
319           A <see cref="T:System.IntPtr" /> containing a 
320           <c><see cref="T:System.Byte" />**</c> array
321           which follows the ANSI C rules for the <c>argv</c> argument passed
322           to <c>main</c>.
323         </param>
324         <summary>
325           Allocates a <see cref="T:System.String" /> array and unmarshals the
326           unmanaged string array into a managed string array.
327         </summary>
328         <returns>
329           A <see cref="T:System.String" /> array containing all the strings in
330           the unmanaged string array.  If <paramref name="stringArray" /> is
331           <see cref="F:System.IntPtr.Zero" />, a string array containing zero
332           elements is returned.
333         </returns>
334         <remarks>
335           <para>
336             This is identical to calling
337             <see cref="M:Mono.Unix.UnixMarshal.PtrToStringArray" />(<paramref name="stringArray" />, 
338             <see cref="F:Mono.Unix.UnixEncoding.Instance" />).
339           </para>
340         </remarks>
341       </Docs>
342       <AssemblyInfo>
343         <AssemblyVersion>1.0.5000.0</AssemblyVersion>
344         <AssemblyVersion>2.0.0.0</AssemblyVersion>
345       </AssemblyInfo>
346     </Member>
347     <Member MemberName="PtrToStringArray">
348       <MemberSignature Language="C#" Value="public static string[] PtrToStringArray (int count, IntPtr stringArray);" />
349       <MemberType>Method</MemberType>
350       <ReturnValue>
351         <ReturnType>System.String[]</ReturnType>
352       </ReturnValue>
353       <Parameters>
354         <Parameter Name="count" Type="System.Int32" />
355         <Parameter Name="stringArray" Type="System.IntPtr" />
356       </Parameters>
357       <Docs>
358         <param name="count">
359           A <see cref="T:System.Int32" /> containing the number of strings in
360           <paramref name="stringArray" />.
361         </param>
362         <param name="stringArray">
363           A <see cref="T:System.IntPtr" /> containing a 
364           <c><see cref="T:System.Byte" />**</c> array.
365         </param>
366         <summary>
367           Allocates a <see cref="T:System.String" /> array and unmarshals the
368           unmanaged string array into a managed string array.
369         </summary>
370         <returns>
371           A <see cref="T:System.String" /> array containing 
372           <paramref name="count" /> strings from the 
373           unmanaged string array <paramref name="stringArray" />.  
374           If <paramref name="stringArray" /> is
375           <see cref="F:System.IntPtr.Zero" />, a string array containing zero
376           elements is returned.
377         </returns>
378         <remarks>
379           <para>
380             This method is identical to
381             <see cref="M:Mono.Unix.UnixMarshal.PtrToStringArray" /> (<paramref name="count" />, <paramref name="stringArray" />,
382             <see cref="F:Mono.Unix.UnixEncoding.Instance" />).
383           </para>
384         </remarks>
385       </Docs>
386       <AssemblyInfo>
387         <AssemblyVersion>1.0.5000.0</AssemblyVersion>
388         <AssemblyVersion>2.0.0.0</AssemblyVersion>
389       </AssemblyInfo>
390     </Member>
391     <Member MemberName="PtrToStringArray">
392       <MemberSignature Language="C#" Value="public static string[] PtrToStringArray (IntPtr stringArray, System.Text.Encoding encoding);" />
393       <MemberType>Method</MemberType>
394       <ReturnValue>
395         <ReturnType>System.String[]</ReturnType>
396       </ReturnValue>
397       <Parameters>
398         <Parameter Name="stringArray" Type="System.IntPtr" />
399         <Parameter Name="encoding" Type="System.Text.Encoding" />
400       </Parameters>
401       <Docs>
402         <param name="stringArray">
403           A <see cref="T:System.IntPtr" /> containing a 
404           <c><see cref="T:System.Byte" />**</c> array
405           which follows the ANSI C rules for the <c>argv</c> argument passed
406           to <c>main</c>.
407         </param>
408         <param name="encoding">
409           A <see cref="System.Text.Encoding" /> specifying the encoding of the 
410           unmanaged strings within <paramref name="stringArray" />.
411         </param>
412         <summary>
413           Allocates a <see cref="T:System.String" /> array and unmarshals the
414           unmanaged string array into a managed string array using the
415           specified encoding.
416         </summary>
417         <returns>
418           A <see cref="T:System.String" /> array containing all the strings in
419           the unmanaged string array.  If <paramref name="stringArray" /> is
420           <see cref="F:System.IntPtr.Zero" />, a string array containing zero
421           elements is returned.
422         </returns>
423         <remarks>
424           <para>
425             <paramref name="stringArray" /> is assumed to be a <c>C</c><c>char**</c> pointer containing a terminating 
426             <see cref="F:System.IntPtr.Zero" /> pointer to designate the end
427             of the array.  This follows the requirements for <c>argv</c> in
428             the ANSI C <c>main</c> function declaration.
429           </para>
430           <code lang="C">static const char* 
431 stringArray[] = {
432     "string 1",
433     "string 2",
434     NULL
435 };
436           </code>
437           <para>
438             The final null string will not be returned from this method; the
439             above <b>stringArray</b> declaration would create an array
440             containing two elements if passed through this method.
441           </para>
442         </remarks>
443         <exception cref="T:System.ArgumentNullException">
444           <paramref name="encoding" /> is <see langword="null" />.
445         </exception>
446       </Docs>
447       <AssemblyInfo>
448         <AssemblyVersion>1.0.5000.0</AssemblyVersion>
449         <AssemblyVersion>2.0.0.0</AssemblyVersion>
450       </AssemblyInfo>
451     </Member>
452     <Member MemberName="PtrToStringArray">
453       <MemberSignature Language="C#" Value="public static string[] PtrToStringArray (int count, IntPtr stringArray, System.Text.Encoding encoding);" />
454       <MemberType>Method</MemberType>
455       <ReturnValue>
456         <ReturnType>System.String[]</ReturnType>
457       </ReturnValue>
458       <Parameters>
459         <Parameter Name="count" Type="System.Int32" />
460         <Parameter Name="stringArray" Type="System.IntPtr" />
461         <Parameter Name="encoding" Type="System.Text.Encoding" />
462       </Parameters>
463       <Docs>
464         <param name="count">
465           A <see cref="T:System.Int32" /> containing the number of strings in
466           <paramref name="stringArray" />.
467         </param>
468         <param name="stringArray">
469           A <see cref="T:System.IntPtr" /> containing a 
470           <c><see cref="T:System.Byte" />**</c> array.
471         </param>
472         <param name="encoding">
473           A <see cref="System.Text.Encoding" /> specifying the encoding of the 
474           unmanaged strings within <paramref name="stringArray" />.
475         </param>
476         <summary>
477           Allocates a <see cref="T:System.String" /> array and unmarshals the
478           unmanaged string array into a managed string array using the
479           specified encoding.
480         </summary>
481         <returns>
482           A <see cref="T:System.String" /> array containing 
483           <paramref name="count" /> strings from the 
484           unmanaged string array <paramref name="stringArray" />.  
485           If <paramref name="stringArray" /> is
486           <see cref="F:System.IntPtr.Zero" />, a string array containing zero
487           elements is returned.
488         </returns>
489         <remarks>
490           <para>
491             No validation is done to ensure that the pointers for embedded
492             strings are valid.  This could result in an access violation or
493             corrupted strings if you're not careful.  Embedded null pointers 
494             will become <see langword="null" /> strings within the returned 
495             array.
496           </para>
497           <para>
498             The difference between this method and 
499             <see cref="M:Mono.Unix.UnixMarshal.PtrToStringArray(System.IntPtr,System.Text.Encoding)" />
500             is that this method doesn't require a terminating null pointer.
501           </para>
502         </remarks>
503         <exception cref="T:System.ArgumentNullException">
504           <paramref name="encoding" /> is <see langword="null" />.
505         </exception>
506       </Docs>
507       <AssemblyInfo>
508         <AssemblyVersion>1.0.5000.0</AssemblyVersion>
509         <AssemblyVersion>2.0.0.0</AssemblyVersion>
510       </AssemblyInfo>
511     </Member>
512     <Member MemberName="PtrToStringUnix">
513       <MemberSignature Language="C#" Value="public static string PtrToStringUnix (IntPtr p);" />
514       <MemberType>Method</MemberType>
515       <ReturnValue>
516         <ReturnType>System.String</ReturnType>
517       </ReturnValue>
518       <Parameters>
519         <Parameter Name="p" Type="System.IntPtr" />
520       </Parameters>
521       <Docs>
522         <param name="p">
523           A <see cref="T:System.IntPtr" /> containing the address of an
524           unmanaged string in the <see cref="T:Mono.Unix.UnixEncoding" />
525           encoding.
526         </param>
527         <summary>
528           Allocates a managed <see cref="T:System.String" /> and marshals the
529           unmanaged string into the managed string using the 
530           <see cref="T:Mono.Unix.UnixEncoding" /> encoding.
531         </summary>
532         <returns>
533           A <see cref="T:System.String" /> containing a copy of the unmanaged
534           string <paramref name="p" />, or <see langword="null" /> if 
535           <paramref name="p" /> is <see cref="F:System.IntPtr.Zero" />.
536         </returns>
537         <remarks>
538           <para>
539             The input string <paramref name="p" /> must have a terminating
540             null <c>0x00</c> byte.
541           </para>
542           <para>
543             This is an optimized version of 
544             <see cref="M:Mono.Unix.UnixMarshal.PtrToString(System.IntPtr)" />
545             for the <see cref="T:Mono.Unix.UnixEncoding" /> encoding.
546           </para>
547         </remarks>
548       </Docs>
549       <AssemblyInfo>
550         <AssemblyVersion>1.0.5000.0</AssemblyVersion>
551         <AssemblyVersion>2.0.0.0</AssemblyVersion>
552       </AssemblyInfo>
553     </Member>
554     <Member MemberName="ReAllocHeap">
555       <MemberSignature Language="C#" Value="public static IntPtr ReAllocHeap (IntPtr ptr, long size);" />
556       <MemberType>Method</MemberType>
557       <ReturnValue>
558         <ReturnType>System.IntPtr</ReturnType>
559       </ReturnValue>
560       <Parameters>
561         <Parameter Name="ptr" Type="System.IntPtr" />
562         <Parameter Name="size" Type="System.Int64" />
563       </Parameters>
564       <Docs>
565         <param name="ptr">
566           A <see cref="T:System.IntPtr" /> containing the address of the
567           memory block to resize.  This value must either be 
568           <see cref="F:System.IntPtr.Zero" /> or a value previously returned
569           by <see cref="M:Mono.Unix.UnixMarshal.AllocHeap" /> or 
570           <see cref="M:Mono.Unix.UnixMarshal.ReAllocHeap" />.
571         </param>
572         <param name="size">
573           A <see cref="T:System.Int64" /> containing the number of bytes to
574           allocate on the system heap.
575         </param>
576         <summary>
577           Changes the size of the memory block <paramref name="ptr" /> to
578           refer to <paramref name="size" /> bytes of memory on the system
579           heap.
580         </summary>
581         <returns>
582           <para>
583             A <see cref="T:System.IntPtr" /> containing the address of 
584             <paramref name="size" /> bytes on the system heap, or
585             <see cref="F:System.IntPtr.Zero" /> if the memory could not be
586             allocated.
587           </para>
588           <block subset="none" type="note">
589             If <see cref="F:System.IntPtr.Zero" /> is returned, 
590             <paramref name="ptr" /> is still a valid memory address, and must
591             still be freed.
592           </block>
593         </returns>
594         <remarks>
595           <para>
596             This function changes the size of the previously allocated memory
597             referenced by <paramref name="ptr" /> to <paramref name="size" />
598             bytes.  <paramref name="ptr" /> 
599             must have been previously allocated via 
600             <see cref="M:Mono.Unix.UnixMarshal.AllocHeap" /> or
601             <see cref="M:Mono.Unix.UnixMarshal.ReAllocHeap" />, or 
602             <paramref name="ptr" /> must be the
603             value <see cref="F:System.IntPtr.Zero" /> (in which case this 
604             method is identical to 
605             <see cref="M:Mono.Unix.UnixMarshal.AllocHeap" />). 
606             The contents of the memory are unchanged up to the lesser 
607             of the new and old sizes.  If the new size is larger, the value of 
608             the newly allocated portion of the memory is undefined.
609           </para>
610           <para>
611             The memory allocated by this function must be freed via
612             <see cref="M:Mono.Unix.UnixMarshal.FreeHeap" /> to avoid a memory
613             leak.
614           </para>
615           <block subset="none" type="note">
616             <para>
617               If the requested memory cannot be allocated, 
618               <see cref="F:System.IntPtr.Zero" /> is returned and
619               the memory referenced by <paramref name="ptr" /> is valid and 
620               unchanged.
621             </para>
622             <para>
623               If memory can be allocated, the memory referenced by 
624               <paramref name="ptr" /> is freed and a pointer to the
625               newly allocated memory is returned.  Note that this may be 
626               different from the value passed as <paramref name="ptr" />.
627             </para>
628           </block>
629           <para>
630             The "system heap" is where dynamic memory is allocated by the
631             runtime C library, <c>MSVCRT.DLL</c> on Win32 and <c>libc</c> on
632             Unix platforms.
633           </para>
634         </remarks>
635         <exception cref="T:System.ArgumentOutOfRangeException">
636           <paramref name="size" /> is a negative value.
637         </exception>
638         <altmember cref="M:Mono.Unix.UnixMarshal.FreeHeap" />
639         <altmember cref="M:Mono.Unix.Native.Stdlib.realloc" />
640       </Docs>
641       <AssemblyInfo>
642         <AssemblyVersion>1.0.5000.0</AssemblyVersion>
643         <AssemblyVersion>2.0.0.0</AssemblyVersion>
644       </AssemblyInfo>
645     </Member>
646     <Member MemberName="ShouldRetrySyscall">
647       <MemberSignature Language="C#" Value="public static bool ShouldRetrySyscall (int r);" />
648       <MemberType>Method</MemberType>
649       <ReturnValue>
650         <ReturnType>System.Boolean</ReturnType>
651       </ReturnValue>
652       <Parameters>
653         <Parameter Name="r" Type="System.Int32" />
654       </Parameters>
655       <Docs>
656         <param name="r">
657           A <see cref="T:System.Int32" /> containing the return value of a
658           method from <see cref="T:Mono.Unix.Native.Syscall" />.
659         </param>
660         <summary>
661           Returns a <see cref="T:System.Boolean" /> indicating whether a
662           system call should be retried.
663         </summary>
664         <returns>
665           Returns <see langword="true" /> if <paramref name="r" /> is
666           <c>-1</c> and <see cref="M:Mono.Unix.Native.Stdlib.GetLastError" />
667           returns <see cref="F:Mono.Unix.Native.Errno.EINTR" />.
668           Otherwise, <see langword="false" /> is returned.
669         </returns>
670         <remarks>
671           <para>
672             System calls may need to be restarted for a variety of reasons,
673             generally explained within the system call documentation.  The
674             most typical reason is that the system call was interrupted, and
675             the caller is expected to re-invoke the system call to complete
676             the operation.
677           </para>
678         </remarks>
679       </Docs>
680       <AssemblyInfo>
681         <AssemblyVersion>1.0.5000.0</AssemblyVersion>
682         <AssemblyVersion>2.0.0.0</AssemblyVersion>
683       </AssemblyInfo>
684     </Member>
685     <Member MemberName="ShouldRetrySyscall">
686       <MemberSignature Language="C#" Value="public static bool ShouldRetrySyscall (int r, out Mono.Unix.Native.Errno errno);" />
687       <MemberType>Method</MemberType>
688       <ReturnValue>
689         <ReturnType>System.Boolean</ReturnType>
690       </ReturnValue>
691       <Parameters>
692         <Parameter Name="r" Type="System.Int32" />
693         <Parameter Name="errno" Type="Mono.Unix.Native.Errno&amp;" RefType="out" />
694       </Parameters>
695       <Docs>
696         <param name="r">
697           A <see cref="T:System.Int32" /> containing the return value of a
698           method from <see cref="T:Mono.Unix.Native.Syscall" />.
699         </param>
700         <param name="errno">
701           A reference to a <see cref="T:Mono.Unix.Native.Errno" /> variable
702           which will capture the last error value.
703         </param>
704         <summary>
705           Returns a <see cref="T:System.Boolean" /> indicating whether a
706           system call should be retried, saving the last error value for later
707           processing.
708         </summary>
709         <returns>
710           Returns <see langword="true" /> if <paramref name="r" /> is
711           <c>-1</c> and <see cref="M:Mono.Unix.Native.Stdlib.GetLastError" />
712           returns <see cref="F:Mono.Unix.Native.Errno.EINTR" />, in which case
713           <paramref name="errno" /> will have the value 
714           <see cref="F:Mono.Unix.Native.Errno.EINTR" />.
715           Otherwise, <see langword="false" /> is returned, and 
716           <paramref name="errno" /> will store the value from the call to 
717           <see cref="M:Mono.Unix.Native.Stdlib.GetLastError" />.
718         </returns>
719         <remarks>
720           <para>
721             System calls may need to be restarted for a variety of reasons,
722             generally explained within the system call documentation.  The
723             most typical reason is that the system call was interrupted, and
724             the caller is expected to re-invoke the system call to complete
725             the operation.
726           </para>
727           <para>
728             This method saves the last error value returned from 
729             <see cref="M:Mono.Unix.Native.Stdlib.GetLastError" /> into the
730             <paramref name="errno" /> parameter.
731           </para>
732         </remarks>
733       </Docs>
734       <AssemblyInfo>
735         <AssemblyVersion>1.0.5000.0</AssemblyVersion>
736         <AssemblyVersion>2.0.0.0</AssemblyVersion>
737       </AssemblyInfo>
738       <Attributes>
739         <Attribute>
740           <AttributeName>System.CLSCompliant(false)</AttributeName>
741         </Attribute>
742       </Attributes>
743     </Member>
744     <Member MemberName="StringToHeap">
745       <MemberSignature Language="C#" Value="public static IntPtr StringToHeap (string s);" />
746       <MemberType>Method</MemberType>
747       <ReturnValue>
748         <ReturnType>System.IntPtr</ReturnType>
749       </ReturnValue>
750       <Parameters>
751         <Parameter Name="s" Type="System.String" />
752       </Parameters>
753       <Docs>
754         <param name="s">
755           A <see cref="T:System.String" /> to copy into the system heap.
756         </param>
757         <summary>
758           Allocates a copy of <paramref name="s" /> on the system heap in the 
759           <see cref="T:Mono.Unix.UnixEncoding" /> encoding.
760         </summary>
761         <returns>
762           A <see cref="T:System.IntPtr" /> containing a pointer on the system
763           heap containing the marshaled string.  If <paramref name="s" /> is
764           <see langword="null" />, then <see cref="F:System.IntPtr.Zero" /> is
765           returned.
766         </returns>
767         <remarks>
768           <para>
769             The pointer returned should be freed with 
770             <see cref="M:Mono.Unix.UnixMarshal.FreeHeap" /> to avoid a memory
771             leak.
772           </para>
773           <para>
774             This is identical to 
775             <see cref="M:Mono.Unix.UnixMarshal.StringToHeap" />(<paramref name="s" />, 
776             <see cref="F:Mono.Unix.UnixMarshal.Instance" />).
777           </para>
778         </remarks>
779         <exception cref="T:System.NotSupportedException">
780           There was an error marshaling <paramref name="s" /> into the
781           <see cref="T:Mono.Unix.UnixEncoding" /> encoding.
782         </exception>
783         <exception cref="T:Mono.Unix.UnixIOException">
784           Unable to allocate enough memory for the marshaled string.
785           [<see cref="F:Mono.Unix.Native.Errno.ENOMEM" />]
786         </exception>
787         <altmember cref="M:Mono.Unix.UnixMarshal.FreeHeap" />
788       </Docs>
789       <AssemblyInfo>
790         <AssemblyVersion>1.0.5000.0</AssemblyVersion>
791         <AssemblyVersion>2.0.0.0</AssemblyVersion>
792       </AssemblyInfo>
793     </Member>
794     <Member MemberName="StringToHeap">
795       <MemberSignature Language="C#" Value="public static IntPtr StringToHeap (string s, System.Text.Encoding encoding);" />
796       <MemberType>Method</MemberType>
797       <ReturnValue>
798         <ReturnType>System.IntPtr</ReturnType>
799       </ReturnValue>
800       <Parameters>
801         <Parameter Name="s" Type="System.String" />
802         <Parameter Name="encoding" Type="System.Text.Encoding" />
803       </Parameters>
804       <Docs>
805         <param name="s">
806           A <see cref="T:System.String" /> to copy into the system heap.
807         </param>
808         <param name="encoding">
809           A <see cref="T:System.Text.Encoding" /> specifying which encoding to
810           marshal the string into.
811         </param>
812         <summary>
813           Allocates a copy of <paramref name="s" /> on the system heap in the 
814           <paramref name="encoding" /> encoding.
815         </summary>
816         <returns>
817           A <see cref="T:System.IntPtr" /> containing a pointer on the system
818           heap containing the marshaled string.  If <paramref name="s" /> is
819           <see langword="null" />, then <see cref="F:System.IntPtr.Zero" /> is
820           returned.
821         </returns>
822         <remarks>
823           <para>
824             The pointer returned should be freed with 
825             <see cref="M:Mono.Unix.UnixMarshal.FreeHeap" /> to avoid a memory
826             leak.
827           </para>
828           <para>
829             This is identical to 
830             <see cref="M:Mono.Unix.UnixMarshal.StringToHeap" />(<paramref name="s" />, 0, <i>s.Length</i>,
831             <see cref="F:Mono.Unix.UnixMarshal.Instance" />).
832           </para>
833         </remarks>
834         <exception cref="T:System.ArgumentNullException">
835           <paramref name="encoding" /> is <see langword="null" />.
836         </exception>
837         <exception cref="T:System.NotSupportedException">
838           There was an error marshaling <paramref name="s" /> into the
839           specified encoding <paramref name="encoding" />.
840         </exception>
841         <exception cref="T:Mono.Unix.UnixIOException">
842           Unable to allocate enough memory for the marshaled string.
843           [<see cref="F:Mono.Unix.Native.Errno.ENOMEM" />]
844         </exception>
845         <altmember cref="M:Mono.Unix.UnixMarshal.FreeHeap" />
846       </Docs>
847       <AssemblyInfo>
848         <AssemblyVersion>1.0.5000.0</AssemblyVersion>
849         <AssemblyVersion>2.0.0.0</AssemblyVersion>
850       </AssemblyInfo>
851     </Member>
852     <Member MemberName="StringToHeap">
853       <MemberSignature Language="C#" Value="public static IntPtr StringToHeap (string s, int index, int count);" />
854       <MemberType>Method</MemberType>
855       <ReturnValue>
856         <ReturnType>System.IntPtr</ReturnType>
857       </ReturnValue>
858       <Parameters>
859         <Parameter Name="s" Type="System.String" />
860         <Parameter Name="index" Type="System.Int32" />
861         <Parameter Name="count" Type="System.Int32" />
862       </Parameters>
863       <Docs>
864         <param name="s">
865           A <see cref="T:System.String" /> to copy into the system heap.
866         </param>
867         <param name="index">
868           A <see cref="T:System.Int32" /> containing the start index into
869           <paramref name="s" /> to start marshaling.
870         </param>
871         <param name="count">
872           A <see cref="T:System.Int32" /> containing the number of characters
873           to marshal from <paramref name="s" /> starting at index 
874           <paramref name="index" />.
875         </param>
876         <summary>
877           Allocates a copy of <paramref name="s" /> on the system heap in the 
878           <see cref="T:Mono.Unix.UnixEncoding" /> encoding.
879         </summary>
880         <returns>
881           A <see cref="T:System.IntPtr" /> containing a pointer on the system
882           heap containing the marshaled string.  If <paramref name="s" /> is
883           <see langword="null" />, then <see cref="F:System.IntPtr.Zero" /> is
884           returned.
885         </returns>
886         <remarks>
887           <para>
888             The pointer returned should be freed with 
889             <see cref="M:Mono.Unix.UnixMarshal.FreeHeap" /> to avoid a memory
890             leak.
891           </para>
892           <para>
893             This is identical to 
894             <see cref="M:Mono.Unix.UnixMarshal.StringToHeap" />(<paramref name="s" />, <paramref name="count" />,
895             <paramref name="index" />,
896             <see cref="F:Mono.Unix.UnixMarshal.Instance" />).
897           </para>
898         </remarks>
899         <exception cref="T:System.ArgumentOutOfRangeException">
900           <para>
901             <paramref name="count" /> or <paramref name="index" /> is less
902             than zero.
903           </para>
904           <para>-or-</para>
905           <para>
906             <paramref name="index" /> plus <paramref name="count" /> is
907             greater than the length of <paramref name="s" />.
908           </para>
909         </exception>
910         <exception cref="T:System.NotSupportedException">
911           There was an error marshaling <paramref name="s" /> into the
912           <see cref="T:Mono.Unix.UnixEncoding" /> encoding.
913         </exception>
914         <exception cref="T:Mono.Unix.UnixIOException">
915           Unable to allocate enough memory for the marshaled string.
916           [<see cref="F:Mono.Unix.Native.Errno.ENOMEM" />]
917         </exception>
918         <altmember cref="M:Mono.Unix.UnixMarshal.FreeHeap" />
919       </Docs>
920       <AssemblyInfo>
921         <AssemblyVersion>1.0.5000.0</AssemblyVersion>
922         <AssemblyVersion>2.0.0.0</AssemblyVersion>
923       </AssemblyInfo>
924     </Member>
925     <Member MemberName="StringToHeap">
926       <MemberSignature Language="C#" Value="public static IntPtr StringToHeap (string s, int index, int count, System.Text.Encoding encoding);" />
927       <MemberType>Method</MemberType>
928       <ReturnValue>
929         <ReturnType>System.IntPtr</ReturnType>
930       </ReturnValue>
931       <Parameters>
932         <Parameter Name="s" Type="System.String" />
933         <Parameter Name="index" Type="System.Int32" />
934         <Parameter Name="count" Type="System.Int32" />
935         <Parameter Name="encoding" Type="System.Text.Encoding" />
936       </Parameters>
937       <Docs>
938         <param name="s">
939           A <see cref="T:System.String" /> to copy into the system heap.
940         </param>
941         <param name="index">
942           A <see cref="T:System.Int32" /> containing the start index into
943           <paramref name="s" /> to start marshaling.
944         </param>
945         <param name="count">
946           A <see cref="T:System.Int32" /> containing the number of characters
947           to marshal from <paramref name="s" /> starting at index 
948           <paramref name="index" />.
949         </param>
950         <param name="encoding">
951           A <see cref="T:System.Text.Encoding" /> specifying which encoding to
952           marshal the string into.
953         </param>
954         <summary>
955           Allocates a copy of <paramref name="s" /> on the system heap in the 
956           <paramref name="encoding" /> encoding.
957         </summary>
958         <returns>
959           A <see cref="T:System.IntPtr" /> containing a pointer on the system
960           heap containing the marshaled string.  If <paramref name="s" /> is
961           <see langword="null" />, then <see cref="F:System.IntPtr.Zero" /> is
962           returned.
963         </returns>
964         <remarks>
965           <para>
966             The pointer returned should be freed with 
967             <see cref="M:Mono.Unix.UnixMarshal.FreeHeap" /> to avoid a memory
968             leak.
969           </para>
970         </remarks>
971         <exception cref="T:System.ArgumentNullException">
972           <paramref name="encoding" /> is <see langword="null" />.
973         </exception>
974         <exception cref="T:System.ArgumentOutOfRangeException">
975           <para>
976             <paramref name="count" /> or <paramref name="index" /> is less
977             than zero.
978           </para>
979           <para>-or-</para>
980           <para>
981             <paramref name="index" /> plus <paramref name="count" /> is
982             greater than the length of <paramref name="s" />.
983           </para>
984         </exception>
985         <exception cref="T:System.NotSupportedException">
986           There was an error marshaling <paramref name="s" /> into the
987           specified encoding <paramref name="encoding" />.
988         </exception>
989         <exception cref="T:Mono.Unix.UnixIOException">
990           Unable to allocate enough memory for the marshaled string.
991           [<see cref="F:Mono.Unix.Native.Errno.ENOMEM" />]
992         </exception>
993         <altmember cref="M:Mono.Unix.UnixMarshal.FreeHeap" />
994       </Docs>
995       <AssemblyInfo>
996         <AssemblyVersion>1.0.5000.0</AssemblyVersion>
997         <AssemblyVersion>2.0.0.0</AssemblyVersion>
998       </AssemblyInfo>
999     </Member>
1000     <Member MemberName="ThrowExceptionForError">
1001       <MemberSignature Language="C#" Value="public static void ThrowExceptionForError (Mono.Unix.Native.Errno errno);" />
1002       <MemberType>Method</MemberType>
1003       <ReturnValue>
1004         <ReturnType>System.Void</ReturnType>
1005       </ReturnValue>
1006       <Parameters>
1007         <Parameter Name="errno" Type="Mono.Unix.Native.Errno" />
1008       </Parameters>
1009       <Docs>
1010         <param name="errno">
1011           A <see cref="T:Mono.Unix.Native.Errno" /> specifying the exception
1012           to throw.
1013         </param>
1014         <summary>
1015           Throws an exception that best matches <paramref name="errno" />.
1016         </summary>
1017         <remarks>
1018           <para>
1019             This method translates <paramref name="errno" /> into its closest
1020             matching exception type, and throws the exception.
1021           </para>
1022           <para>
1023             If the exception thrown is not a 
1024             <see cref="T:Mono.Unix.UnixIOException" />, then the exception's
1025             <see cref="P:System.Exception.InnerException" /> property will
1026             be set to a <see cref="T:Mono.Unix.UnixIOException" /> instance
1027             wrapping <paramref name="errno" />, if possible.
1028             <block subset="none" type="note"><see cref="T:System.ArgumentOutOfRangeException" /> does not
1029               have its 
1030               <see cref="P:System.Exception.InnerException" /> property set, as 
1031               <see cref="T:System.ArgumentOutOfRangeException" /> does not
1032               provide a constructor that sets this property.
1033             </block></para>
1034         </remarks>
1035         <exception cref="T:System.ArgumentException">
1036           <paramref name="errno" />
1037           is 
1038           <see cref="F:Mono.Unix.Native.Errno.EBADF" /> or
1039           <see cref="F:Mono.Unix.Native.Errno.EINVAL" />.
1040         </exception>
1041         <exception cref="T:System.ArgumentOutOfRangeException">
1042           <paramref name="errno" />
1043           is 
1044           <see cref="F:Mono.Unix.Native.Errno.ERANGE" />.
1045         </exception>
1046         <exception cref="T:System.InvalidOperationException">
1047           <paramref name="errno" />
1048           is 
1049           <see cref="F:Mono.Unix.Native.Errno.EOPNOTSUPP" /> or
1050           <see cref="F:Mono.Unix.Native.Errno.EPERM" />.
1051         </exception>
1052         <exception cref="T:System.InvalidProgramException">
1053           <paramref name="errno" />
1054           is 
1055           <see cref="F:Mono.Unix.Native.Errno.ENOEXEC" />.
1056         </exception>
1057         <exception cref="T:System.NullReferenceException">
1058           <paramref name="errno" />
1059           is 
1060           <see cref="F:Mono.Unix.Native.Errno.EFAULT" />.
1061         </exception>
1062         <exception cref="T:System.OverflowException">
1063           <paramref name="errno" />
1064           is 
1065           <see cref="F:Mono.Unix.Native.Errno.EOVERFLOW" />.
1066         </exception>
1067         <exception cref="T:System.UnauthorizedAccessException">
1068           <paramref name="errno" />
1069           is 
1070           <see cref="F:Mono.Unix.Native.Errno.EACCES" /> or
1071           <see cref="F:Mono.Unix.Native.Errno.EISDIR" />.
1072         </exception>
1073         <exception cref="T:System.IO.DirectoryNotFoundException">
1074           <paramref name="errno" />
1075           is 
1076           <see cref="F:Mono.Unix.Native.Errno.ENOTDIR" />.
1077         </exception>
1078         <exception cref="T:System.IO.FileNotFoundException">
1079           <paramref name="errno" />
1080           is 
1081           <see cref="F:Mono.Unix.Native.Errno.ENOENT" />.
1082         </exception>
1083         <exception cref="T:System.IO.IOException">
1084           <paramref name="errno" />
1085           is one of:
1086           <see cref="F:Mono.Unix.Native.Errno.EIO" />,
1087           <see cref="F:Mono.Unix.Native.Errno.ENOSPC" />,
1088           <see cref="F:Mono.Unix.Native.Errno.ENOTEMPTY" />,
1089           <see cref="F:Mono.Unix.Native.Errno.ENXIO" />,
1090           <see cref="F:Mono.Unix.Native.Errno.EROFS" />,
1091           <see cref="F:Mono.Unix.Native.Errno.ESPIPE" />.
1092         </exception>
1093         <exception cref="T:System.IO.PathTooLongException">
1094           <paramref name="errno" />
1095           is 
1096           <see cref="F:Mono.Unix.Native.Errno.ENAMETOOLONG" />.
1097         </exception>
1098         <exception cref="T:Mono.Unix.UnixIOException">
1099           <paramref name="errno" /> is not any of the above error values.
1100         </exception>
1101       </Docs>
1102       <AssemblyInfo>
1103         <AssemblyVersion>1.0.5000.0</AssemblyVersion>
1104         <AssemblyVersion>2.0.0.0</AssemblyVersion>
1105       </AssemblyInfo>
1106       <Attributes>
1107         <Attribute>
1108           <AttributeName>System.CLSCompliant(false)</AttributeName>
1109         </Attribute>
1110       </Attributes>
1111     </Member>
1112     <Member MemberName="ThrowExceptionForErrorIf">
1113       <MemberSignature Language="C#" Value="public static void ThrowExceptionForErrorIf (int retval, Mono.Unix.Native.Errno errno);" />
1114       <MemberType>Method</MemberType>
1115       <ReturnValue>
1116         <ReturnType>System.Void</ReturnType>
1117       </ReturnValue>
1118       <Parameters>
1119         <Parameter Name="retval" Type="System.Int32" />
1120         <Parameter Name="errno" Type="Mono.Unix.Native.Errno" />
1121       </Parameters>
1122       <Docs>
1123         <param name="retval">
1124           A <see cref="T:System.Int32" /> containing the return value of a
1125           method from <see cref="T:Mono.Unix.Native.Syscall" />.
1126         </param>
1127         <param name="errno">
1128           A <see cref="T:Mono.Unix.Native.Errno" /> specifying the exception
1129           to throw.
1130         </param>
1131         <summary>
1132           Throws an exception that best matches <paramref name="errno" />
1133           if <paramref name="retval" /> is <c>-1</c>.
1134         </summary>
1135         <remarks>
1136           <para>
1137             If <paramref name="retval" /> is <c>-1</c>, then this method is
1138             equivalent to calling 
1139             <see cref="M:Mono.Unix.UnixMarshal.ThrowExceptionForError" /> (<paramref name="errno" />).
1140             Otherwise, nothing is done.
1141           </para>
1142           <para>
1143             If the exception thrown is not a 
1144             <see cref="T:Mono.Unix.UnixIOException" />, then the exception's
1145             <see cref="P:System.Exception.InnerException" /> property will
1146             be set to a <see cref="T:Mono.Unix.UnixIOException" /> instance
1147             wrapping <paramref name="errno" />, if possible.
1148             <block subset="none" type="note"><see cref="T:System.ArgumentOutOfRangeException" /> does not
1149               have its 
1150               <see cref="P:System.Exception.InnerException" /> property set, as 
1151               <see cref="T:System.ArgumentOutOfRangeException" /> does not
1152               provide a constructor that sets this property.
1153             </block></para>
1154         </remarks>
1155         <exception cref="T:System.ArgumentException">
1156           <paramref name="errno" />
1157           is 
1158           <see cref="F:Mono.Unix.Native.Errno.EBADF" /> or
1159           <see cref="F:Mono.Unix.Native.Errno.EINVAL" />.
1160         </exception>
1161         <exception cref="T:System.ArgumentOutOfRangeException">
1162           <paramref name="errno" />
1163           is 
1164           <see cref="F:Mono.Unix.Native.Errno.ERANGE" />.
1165         </exception>
1166         <exception cref="T:System.InvalidOperationException">
1167           <paramref name="errno" />
1168           is 
1169           <see cref="F:Mono.Unix.Native.Errno.EOPNOTSUPP" /> or
1170           <see cref="F:Mono.Unix.Native.Errno.EPERM" />.
1171         </exception>
1172         <exception cref="T:System.InvalidProgramException">
1173           <paramref name="errno" />
1174           is 
1175           <see cref="F:Mono.Unix.Native.Errno.ENOEXEC" />.
1176         </exception>
1177         <exception cref="T:System.NullReferenceException">
1178           <paramref name="errno" />
1179           is 
1180           <see cref="F:Mono.Unix.Native.Errno.EFAULT" />.
1181         </exception>
1182         <exception cref="T:System.OverflowException">
1183           <paramref name="errno" />
1184           is 
1185           <see cref="F:Mono.Unix.Native.Errno.EOVERFLOW" />.
1186         </exception>
1187         <exception cref="T:System.UnauthorizedAccessException">
1188           <paramref name="errno" />
1189           is 
1190           <see cref="F:Mono.Unix.Native.Errno.EACCES" /> or
1191           <see cref="F:Mono.Unix.Native.Errno.EISDIR" />.
1192         </exception>
1193         <exception cref="T:System.IO.DirectoryNotFoundException">
1194           <paramref name="errno" />
1195           is 
1196           <see cref="F:Mono.Unix.Native.Errno.ENOTDIR" />.
1197         </exception>
1198         <exception cref="T:System.IO.FileNotFoundException">
1199           <paramref name="errno" />
1200           is 
1201           <see cref="F:Mono.Unix.Native.Errno.ENOENT" />.
1202         </exception>
1203         <exception cref="T:System.IO.IOException">
1204           <paramref name="errno" />
1205           is one of:
1206           <see cref="F:Mono.Unix.Native.Errno.EIO" />,
1207           <see cref="F:Mono.Unix.Native.Errno.ENOSPC" />,
1208           <see cref="F:Mono.Unix.Native.Errno.ENOTEMPTY" />,
1209           <see cref="F:Mono.Unix.Native.Errno.ENXIO" />,
1210           <see cref="F:Mono.Unix.Native.Errno.EROFS" />,
1211           <see cref="F:Mono.Unix.Native.Errno.ESPIPE" />.
1212         </exception>
1213         <exception cref="T:System.IO.PathTooLongException">
1214           <paramref name="errno" />
1215           is 
1216           <see cref="F:Mono.Unix.Native.Errno.ENAMETOOLONG" />.
1217         </exception>
1218         <exception cref="T:Mono.Unix.UnixIOException">
1219           <paramref name="errno" /> is not any of the above error values.
1220         </exception>
1221       </Docs>
1222       <AssemblyInfo>
1223         <AssemblyVersion>1.0.5000.0</AssemblyVersion>
1224         <AssemblyVersion>2.0.0.0</AssemblyVersion>
1225       </AssemblyInfo>
1226       <Attributes>
1227         <Attribute>
1228           <AttributeName>System.CLSCompliant(false)</AttributeName>
1229         </Attribute>
1230       </Attributes>
1231     </Member>
1232     <Member MemberName="ThrowExceptionForLastError">
1233       <MemberSignature Language="C#" Value="public static void ThrowExceptionForLastError ();" />
1234       <MemberType>Method</MemberType>
1235       <ReturnValue>
1236         <ReturnType>System.Void</ReturnType>
1237       </ReturnValue>
1238       <Parameters />
1239       <Docs>
1240         <summary>
1241           Throws an exception that best matches the last error returned
1242           from <see cref="M:Mono.Unix.Native.Stdlib.GetLastError" />.
1243         </summary>
1244         <remarks>
1245           <para>
1246             This is equivalent to calling
1247             <see cref="M:Mono.Unix.UnixMarshal.ThrowExceptionForError" /> (<see cref="M:Mono.Unix.Native.Stdlib.GetLastError" /> ()).
1248           </para>
1249           <para>
1250             If the exception thrown is not a 
1251             <see cref="T:Mono.Unix.UnixIOException" />, then the exception's
1252             <see cref="P:System.Exception.InnerException" /> property will
1253             be set to a <see cref="T:Mono.Unix.UnixIOException" /> instance
1254             wrapping <paramref name="errno" />, if possible.
1255             <block subset="none" type="note"><see cref="T:System.ArgumentOutOfRangeException" /> does not
1256               have its 
1257               <see cref="P:System.Exception.InnerException" /> property set, as 
1258               <see cref="T:System.ArgumentOutOfRangeException" /> does not
1259               provide a constructor that sets this property.
1260             </block></para>
1261         </remarks>
1262         <exception cref="T:System.ArgumentException">
1263           <see cref="M:Mono.Unix.Native.Stdlib.GetLastError" />
1264           is 
1265           <see cref="F:Mono.Unix.Native.Errno.EBADF" /> or
1266           <see cref="F:Mono.Unix.Native.Errno.EINVAL" />.
1267         </exception>
1268         <exception cref="T:System.ArgumentOutOfRangeException">
1269           <see cref="M:Mono.Unix.Native.Stdlib.GetLastError" />
1270           is 
1271           <see cref="F:Mono.Unix.Native.Errno.ERANGE" />.
1272         </exception>
1273         <exception cref="T:System.InvalidOperationException">
1274           <see cref="M:Mono.Unix.Native.Stdlib.GetLastError" />
1275           is 
1276           <see cref="F:Mono.Unix.Native.Errno.EOPNOTSUPP" /> or
1277           <see cref="F:Mono.Unix.Native.Errno.EPERM" />.
1278         </exception>
1279         <exception cref="T:System.InvalidProgramException">
1280           <see cref="M:Mono.Unix.Native.Stdlib.GetLastError" />
1281           is 
1282           <see cref="F:Mono.Unix.Native.Errno.ENOEXEC" />.
1283         </exception>
1284         <exception cref="T:System.NullReferenceException">
1285           <see cref="M:Mono.Unix.Native.Stdlib.GetLastError" />
1286           is 
1287           <see cref="F:Mono.Unix.Native.Errno.EFAULT" />.
1288         </exception>
1289         <exception cref="T:System.OverflowException">
1290           <see cref="M:Mono.Unix.Native.Stdlib.GetLastError" />
1291           is 
1292           <see cref="F:Mono.Unix.Native.Errno.EOVERFLOW" />.
1293         </exception>
1294         <exception cref="T:System.UnauthorizedAccessException">
1295           <see cref="M:Mono.Unix.Native.Stdlib.GetLastError" />
1296           is 
1297           <see cref="F:Mono.Unix.Native.Errno.EACCES" /> or
1298           <see cref="F:Mono.Unix.Native.Errno.EISDIR" />.
1299         </exception>
1300         <exception cref="T:System.IO.DirectoryNotFoundException">
1301           <see cref="M:Mono.Unix.Native.Stdlib.GetLastError" />
1302           is 
1303           <see cref="F:Mono.Unix.Native.Errno.ENOTDIR" />.
1304         </exception>
1305         <exception cref="T:System.IO.FileNotFoundException">
1306           <see cref="M:Mono.Unix.Native.Stdlib.GetLastError" />
1307           is 
1308           <see cref="F:Mono.Unix.Native.Errno.ENOENT" />.
1309         </exception>
1310         <exception cref="T:System.IO.IOException">
1311           <see cref="M:Mono.Unix.Native.Stdlib.GetLastError" />
1312           is one of:
1313           <see cref="F:Mono.Unix.Native.Errno.EIO" />,
1314           <see cref="F:Mono.Unix.Native.Errno.ENOSPC" />,
1315           <see cref="F:Mono.Unix.Native.Errno.ENOTEMPTY" />,
1316           <see cref="F:Mono.Unix.Native.Errno.ENXIO" />,
1317           <see cref="F:Mono.Unix.Native.Errno.EROFS" />,
1318           <see cref="F:Mono.Unix.Native.Errno.ESPIPE" />.
1319         </exception>
1320         <exception cref="T:System.IO.PathTooLongException">
1321           <see cref="M:Mono.Unix.Native.Stdlib.GetLastError" />
1322           is 
1323           <see cref="F:Mono.Unix.Native.Errno.ENAMETOOLONG" />.
1324         </exception>
1325         <exception cref="T:Mono.Unix.UnixIOException">
1326           <see cref="M:Mono.Unix.Native.Stdlib.GetLastError" />
1327           is not any of the above error values.
1328         </exception>
1329       </Docs>
1330       <AssemblyInfo>
1331         <AssemblyVersion>1.0.5000.0</AssemblyVersion>
1332         <AssemblyVersion>2.0.0.0</AssemblyVersion>
1333       </AssemblyInfo>
1334     </Member>
1335     <Member MemberName="ThrowExceptionForLastErrorIf">
1336       <MemberSignature Language="C#" Value="public static void ThrowExceptionForLastErrorIf (int retval);" />
1337       <MemberType>Method</MemberType>
1338       <ReturnValue>
1339         <ReturnType>System.Void</ReturnType>
1340       </ReturnValue>
1341       <Parameters>
1342         <Parameter Name="retval" Type="System.Int32" />
1343       </Parameters>
1344       <Docs>
1345         <param name="retval">
1346           A <see cref="T:System.Int32" /> containing the return value of a
1347           method from <see cref="T:Mono.Unix.Native.Syscall" />.
1348         </param>
1349         <summary>
1350           Throws an exception that best matches the last error returned
1351           from <see cref="M:Mono.Unix.Native.Stdlib.GetLastError" /> if
1352           <paramref name="retval" /> is <c>-1</c>.
1353         </summary>
1354         <remarks>
1355           <para>
1356             If <paramref name="retval" /> is <c>-1</c>, then this method is
1357             equivalent to calling 
1358             <see cref="M:Mono.Unix.UnixMarshal.ThrowExceptionForError" /> (<see cref="M:Mono.Unix.Native.Stdlib.GetLastError" /> ()).
1359             Otherwise, nothing is done.
1360           </para>
1361           <para>
1362             If the exception thrown is not a 
1363             <see cref="T:Mono.Unix.UnixIOException" />, then the exception's
1364             <see cref="P:System.Exception.InnerException" /> property will
1365             be set to a <see cref="T:Mono.Unix.UnixIOException" /> instance
1366             wrapping <paramref name="errno" />, if possible.
1367             <block subset="none" type="note"><see cref="T:System.ArgumentOutOfRangeException" /> does not
1368               have its 
1369               <see cref="P:System.Exception.InnerException" /> property set, as 
1370               <see cref="T:System.ArgumentOutOfRangeException" /> does not
1371               provide a constructor that sets this property.
1372             </block></para>
1373         </remarks>
1374         <exception cref="T:System.ArgumentException">
1375           <see cref="M:Mono.Unix.Native.Stdlib.GetLastError" />
1376           is 
1377           <see cref="F:Mono.Unix.Native.Errno.EBADF" /> or
1378           <see cref="F:Mono.Unix.Native.Errno.EINVAL" />.
1379         </exception>
1380         <exception cref="T:System.ArgumentOutOfRangeException">
1381           <see cref="M:Mono.Unix.Native.Stdlib.GetLastError" />
1382           is 
1383           <see cref="F:Mono.Unix.Native.Errno.ERANGE" />.
1384         </exception>
1385         <exception cref="T:System.InvalidOperationException">
1386           <see cref="M:Mono.Unix.Native.Stdlib.GetLastError" />
1387           is 
1388           <see cref="F:Mono.Unix.Native.Errno.EOPNOTSUPP" /> or
1389           <see cref="F:Mono.Unix.Native.Errno.EPERM" />.
1390         </exception>
1391         <exception cref="T:System.InvalidProgramException">
1392           <see cref="M:Mono.Unix.Native.Stdlib.GetLastError" />
1393           is 
1394           <see cref="F:Mono.Unix.Native.Errno.ENOEXEC" />.
1395         </exception>
1396         <exception cref="T:System.NullReferenceException">
1397           <see cref="M:Mono.Unix.Native.Stdlib.GetLastError" />
1398           is 
1399           <see cref="F:Mono.Unix.Native.Errno.EFAULT" />.
1400         </exception>
1401         <exception cref="T:System.OverflowException">
1402           <see cref="M:Mono.Unix.Native.Stdlib.GetLastError" />
1403           is 
1404           <see cref="F:Mono.Unix.Native.Errno.EOVERFLOW" />.
1405         </exception>
1406         <exception cref="T:System.UnauthorizedAccessException">
1407           <see cref="M:Mono.Unix.Native.Stdlib.GetLastError" />
1408           is 
1409           <see cref="F:Mono.Unix.Native.Errno.EACCES" /> or
1410           <see cref="F:Mono.Unix.Native.Errno.EISDIR" />.
1411         </exception>
1412         <exception cref="T:System.IO.DirectoryNotFoundException">
1413           <see cref="M:Mono.Unix.Native.Stdlib.GetLastError" />
1414           is 
1415           <see cref="F:Mono.Unix.Native.Errno.ENOTDIR" />.
1416         </exception>
1417         <exception cref="T:System.IO.FileNotFoundException">
1418           <see cref="M:Mono.Unix.Native.Stdlib.GetLastError" />
1419           is 
1420           <see cref="F:Mono.Unix.Native.Errno.ENOENT" />.
1421         </exception>
1422         <exception cref="T:System.IO.IOException">
1423           <see cref="M:Mono.Unix.Native.Stdlib.GetLastError" />
1424           is one of:
1425           <see cref="F:Mono.Unix.Native.Errno.EIO" />,
1426           <see cref="F:Mono.Unix.Native.Errno.ENOSPC" />,
1427           <see cref="F:Mono.Unix.Native.Errno.ENOTEMPTY" />,
1428           <see cref="F:Mono.Unix.Native.Errno.ENXIO" />,
1429           <see cref="F:Mono.Unix.Native.Errno.EROFS" />,
1430           <see cref="F:Mono.Unix.Native.Errno.ESPIPE" />.
1431         </exception>
1432         <exception cref="T:System.IO.PathTooLongException">
1433           <see cref="M:Mono.Unix.Native.Stdlib.GetLastError" />
1434           is 
1435           <see cref="F:Mono.Unix.Native.Errno.ENAMETOOLONG" />.
1436         </exception>
1437         <exception cref="T:Mono.Unix.UnixIOException">
1438           <see cref="M:Mono.Unix.Native.Stdlib.GetLastError" />
1439           is not any of the above error values.
1440         </exception>
1441       </Docs>
1442       <AssemblyInfo>
1443         <AssemblyVersion>1.0.5000.0</AssemblyVersion>
1444         <AssemblyVersion>2.0.0.0</AssemblyVersion>
1445       </AssemblyInfo>
1446     </Member>
1447   </Members>
1448 </Type>