New test.
[mono.git] / mcs / class / Mono.Posix / Mono.Unix / ChangeLog
1 2006-08-21  Jonathan Pryor  <jonpryor@vt.edu>
2
3         * UnixStream.cs: .Close() shouldn't close(2) the fd unless owner==true;
4           .Flush() should be a no-op (as System.IO.Stream.Flush doesn't gaurantee
5           that .Flush() actually flush to disk, and .Flush() slows things down a
6           lot); see: http://joeshaw.org/2006/08/21/415.
7
8 2006-08-16  Alp Toker  <alp@atoker.com>
9
10         * UnixEndPoint.cs:
11         * AbstractUnixEndPoint.cs: Second half of the fix for #79084.
12                 Add support for the abstract namespace, and update existing file-based
13                 UnixEndPoint (de)serialization to reflect changes in the runtime.
14
15 2006-07-02  Jonathan Pryor  <jonpryor@vt.edu>
16
17         * UnixSymbolicLinkInfo.cs: Oops.  CreateSymbolicLinkTo() should create
18           FullPath, not OriginalName.  This was fixed in one overload in January,
19           but I missed an overload. :-/
20
21 2006-07-02  Jonathan Pryor  <jonpryor@vt.edu>
22
23         * UnixPath.cs: Follow .NET's System.IO.Path.Combine() behavior, and "reset"
24           the generated path if any argument beings with a path root --
25           UnixPath.Combine("/a", "/b") should return "/b", not "/a/b".  Fixes #78580.
26
27 2006-04-21  Jonathan Pryor  <jonpryor@vt.edu>
28
29         * UnixFileSystemInfo.cs: rename Create() to GetFileSystemEntry(), and make
30           it public (so that other's don't need to worry about the
31           Syscall.lstat()-and-switch to create a UnixFileSystemInfo instance).
32         * UnixDirectoryInfo.cs, UnixSymbolicLinkInfo.cs:
33           s/Create/GetFileSystemEntry/g (to cope with above change).
34
35 2006-03-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
36
37         * UnixEndPoint.cs: added GetHashCode/Equals.
38
39 2006-03-06  Jonathan Pryor  <jonpryor@vt.edu>
40
41         * UnixDriveInfo.cs: Remove requirement that mountPoints be avaible via
42           getfsfile(3).  This isn't always the case -- in particular drives mounted
43           via HAL and other mechanisms won't be listed in /etc/fstab, and thus won't
44           be returned via getfsfile(3).  If getfsfile(3) fails, then we "guess" on
45           the drive format and volume label.
46         * UnixStream.cs: RefreshStat() should assert that the instance hasn't been
47           disposed.
48         * UnixEnvironment.cs (GetConfigurationValue, GetConfigurationString): Fix
49           error checking.
50
51 2006-02-23  Jonathan Pryor  <jonpryor@vt.edu>
52
53         * UnixFileSystemInfo.cs: Create() should return a UnixFileInfo if the file
54           doesn't exist.  This allows callers to use UnixFileInfo.Exists to see if
55           the file exists, and behaves more rationally e.g. if the directory
56           contents changes while calling UnixDirectoryInfo.GetFileSystemEntries(),
57           we'll get a UnixFileInfo entry that doesn't exist instead of an exception
58           terminating the entire array creation.
59         * UnixSymbolicLinkInfo.cs: [Obsolete] the Contents property -- this property
60           *always* creates a new object if HasContents=true, and since a
61           UnixFileSystemInfo instance is (104+2*(sizeof(void*))+1) bytes (~113 bytes
62           on 32-bit platforms), we don't want to create these frequently.  Add a
63           GetContents() method as the replacement, to make it (slightly) more
64           explicit that information won't be cached (and thus should be cached by
65           the caller, if appropriate).  GetContents() throws an exception if
66           HasContents=false instead of returning null; this change brings the
67           implementation in line with the documentation.
68
69 2006-02-18  Alp Toker  <alp@atoker.com>
70
71         * UnixEndPoint.cs: Avoid truncation of last two bytes of SocketAddress
72         string
73
74 2006-01-26  Jonathan Pryor  <jonpryor@vt.edu>
75
76         * UnixMarshal.cs: Check for null arguments in PtrToString() and
77           PtrToStringArray().
78
79 2006-01-24  Jonathan Pryor  <jonpryor@vt.edu>
80
81         * UnixMarshal.cs (StringToHeap): Return IntPtr.Zero if `s' is null.
82
83 2006-01-24  Jonathan Pryor  <jonpryor@vt.edu>
84
85         * UnixMarshal.cs (StringToHeap): Check for null arguments.
86
87 2006-01-20  Jonathan Pryor  <jonpryor@vt.edu>
88
89         * UnixDriveInfo.cs: Properties should generate an InvalidOperationException,
90           not an IOException.  Users can use IsReady to avoid exception generation.
91         * UnixIOException.cs: Create a custom message that embeds the error name 
92           within the text, e.g. "Permission denied [EACCES]."
93         * UnixSymbolicLinkInfo.cs: This really should create the file FullPath, not
94           OriginalPath.  Created files shouldn't ever be relative to the current
95           working directory, as this can change at any time.
96
97 2006-01-15  Jonathan Pryor  <jonpryor@vt.edu>
98
99         * UnixUserInfo.cs: The UnixUserInfo(Native.Passwd) constructor and 
100           ToPasswd() should clone the underlying Native.Passwd, so
101           that it doesn't get changed from underneath it.
102         * UnixGroupInfo.cs: The UnixGroupInfo(Native.Group) constructor should also
103           clone the provided Native.Group instance.
104
105 2006-01-14  Jonathan Pryor  <jonpryor@vt.edu>
106
107         * UnixGroupInfo.cs: ToGroup() should clone the underlying Native.Group, so
108           that it doesn't get changed from underneath it.
109
110 2006-01-13  Jonathan Pryor  <jonpryor@vt.edu>
111
112         * Catalog.cs, UnixMarshal.cs: Throw `UnixIOException(Native.Errno.ENOMEM)`
113           instead of System.OutOfMemoryException.  OOME should be reserved for use 
114           by the CLR (according to FxDG).
115
116 2006-01-12  Jonathan Pryor  <jonpryor@vt.edu>
117
118         * UnixPath.cs: Add ReadLink() and TryReadLink() methods.
119
120 2006-01-12  Miguel de Icaza  <miguel@novell.com>
121
122         * PeerCred.cs: Do not define PeerCredData as this is a structure
123         known to the runtime.  Instead use the Mono.Posix.PeerCredData
124         internal class. 
125
126 2006-01-10  Jonathan Pryor <jonpryor@vt.edu>
127
128         * Catalog.cs: Don't use
129           System.Runtime.InteropServices.Marshal.StringToHGlobalAuto(), use
130           UnixMarshal.StringToHeap().  We require that the converted string be in
131           UTF-8 format, but .NET's Marshal.StringToHGlobalAuto converts to the local
132           code page, *not* UTF-8 (Mono's does UTF-8).  UnixMarshal.StringToHeap
133           *always* does UTF-8, so use that instead.
134
135 2006-01-09  Jonathan Pryor <jonpryor@vt.edu>
136
137         * FileTypes.cs: Remove [Flags] attribute -- these aren't bitfield values.
138         * UnixFileSystemInfo.cs: Fix Is<<Type>> properties -- before it would
139           erroneously say that a symlink was a character device.  (This is because
140           device values are *not* [Flags] values, but code was assuming they were.)
141         * UnixGroupInfo.cs: Clone the string[] returned from GetMemberNames().  We
142           don't want callers to change the underlying list.
143
144 2006-01-07  Jonathan Pryor <jonpryor@vt.edu>
145
146         * UnixMarshal.cs: *Actually* put things in alphabetical order (like the
147           comment says).  I can speak english, really I can.
148
149 2006-01-06  Jonathan Pryor <jonpryor@vt.edu>
150
151         * Catalog.cs: s/libintl/intl/g, since intl.dll is used by GTK+ on Windows,
152           not libintl.dll (according to
153           http://www.gimp.org/~tml/gimp/win32/downloads.html).
154
155 2006-01-03  Jonathan Pryor <jonpryor@vt.edu>
156
157         * UnixMarshal.cs (CreateExceptionForError): Don't map ENOMEM to
158           System.OutOfMemoryException.  OOME should be reserved for use by the CLR.
159           Return a UnixIOException instead (default behavior).
160
161 2006-01-02  Jonathan Pryor <jonpryor@vt.edu>
162
163         * StdioFileStream.cs: Shut up FxCop - add a GC.KeepAlive to 
164           AssertNotDisposed().
165         * UnixClient.cs, UnixListener.cs: Use System.MarshalByRefObject as the base
166           class.  These types implement IDisposable and have a finalizer, so if an
167           instance of these types were sent to another AppDomain they'd previously 
168           marshal by copy, which could lead to a double release of an unmanaged
169           resource -- potential badness.  Using MarshalByRefObject fixes this.
170
171 2006-01-02  Jonathan Pryor <jonpryor@vt.edu>
172
173         * UnixMarshal.cs: s/EACCESS/EACCES/g.  I can't read.
174
175 2006-01-02  Jonathan Pryor <jonpryor@vt.edu>
176
177         * StdioFileStream.cs, UnixDirectoryInfo.cs, UnixEnvironment.cs, 
178           UnixFileInfo.cs, UnixFileSystemInfo.cs, UnixGroupInfo.cs,
179           UnixIOException.cs, UnixMarshal.cs, UnixProcess.cs, UnixStream.cs,
180           UnixSymbolicLinkInfo.cs, UnixUserInfo.cs: Remove Obsolete API.
181         * CdeclFunction.cs, IncludeAttribute.cs, Stdlib.cs, Syscall.cs,
182           UnixConvert.cs, UnixDirectory.cs, UnixFile.cs, UnixGroup.cs, 
183           UnixUser.cs: Delete.
184         * UnixPath.cs: Remove InvalidPathChars; use GetInvalidPathChars() instead.
185         * FileTypes.cs: Remove Obsolete API
186
187 2006-01-02  Jonathan Pryor <jonpryor@vt.edu>
188
189         * FileAccessPermissions.cs: Remove UserMask, GroupMask, OtherMask values.
190         * FileSpecialAttributes.cs: Remove AllAttributes member; it shouldn't be
191           public.  Use UnixFileSystemInfo.AllSpecialAttributes instead.
192         * StdioFileStream.cs: Open files in binary mode, not text;
193           Fix exception message for StdioFileStream(path, mode) mode param check.
194         * UnixDirectoryInfo.cs: Add Create(FileAccessPermissions) overload; change
195           GetFileSystemEntries() to include the directory name that the files came
196           from (otherwise they're in the current working direcetory, which they
197           probably aren't).
198         * UnixFileInfo.cs: Add Create(FileAccessPermissions) overload; Add better
199           argument checking to several Open() overloads.
200         * UnixFileSystemInfo.cs: Add AllSpecialAttributes, AllFileTypes members;
201           FullPath member should invalidate instance if path changes; Change return
202           type of GetFileStatus for maintenance/better documentation; ToStat()
203           should ensure that the instance is valid first.
204         * UnixMarshal.cs: Add additional Errno values to CreateExceptionForError();
205           reformat CreateExceptionForError for maintenance.
206         * UnixPath.cs: Obsolete InvalidPathChars -- FxCop never liked it, and now I
207           know why it didn't like it (thank you Framework Design Guidelines!).
208         * UnixStream.cs: Use UnixFileSystemInfo.AllSpecialAttributes, not 
209           FileSpecialAttributes.AllAttributes (which was removed).
210         * UnixSymbolicLinkInfo.cs: Change return type of GetFileStatus().
211
212 2005-12-28  Jonathan Pryor <jonpryor@vt.edu>
213
214         * FileHandleOperations.cs: Check for null references.
215
216 2005-12-28  Jonathan Pryor <jonpryor@vt.edu>
217
218         * UnixMarshal.cs: Errno.EBADF should also trigger a ArgumentException.
219
220 2005-12-27  Jonathan Pryor <jonpryor@vt.edu>
221
222         * FileHandleOperations.cs, FileTypes.cs, Stdlib.cs, Syscall.cs, 
223           UnixConvert.cs, UnixDirectory.cs, UnixDirectoryInfo.cs, UnixDriveInfo.cs, 
224           UnixEnvironment.cs, UnixFile.cs, UnixFileInfo.cs, UnixFileSystemInfo.cs,
225           UnixGroup.cs, UnixGroupInfo.cs, UnixIOException.cs, UnixMarshal.cs, 
226           UnixPath.cs, UnixPipes.cs, UnixProcess.cs, UnixStream.cs, 
227           UnixSymbolicLinkInfo.cs, UnixUser.cs, UnixUserInfo.cs: Mark to-be-removed
228           API with [Obsolete(IsError=true)] (permits compiler assistance for finding
229           obsolete code); Migrate to the Mono.Unix.Native API.
230         * StdioFileStream.cs: Add non-Obsolete overloads for SaveFilePosition &
231           RestoreFilePosition (oops).  Migrate to Mono.Unix.Native API.
232
233 2005-12-07  Jonathan Pryor <jonpryor@vt.edu>
234
235         * UnixMarshal.cs: Add PtrToStringUnix() -- specialized PtrToString method
236           which is significantly faster than PtrToString(p, UnixEncoding.Instance). 
237           Use System.String..ctor(sbyte*, int, int, Encoding) to avoid the byte[]
238           intermediate copy -- much faster.  Fix PtrToString() so that it will
239           accept an IntPtr containing 0 characters, and don't duplicate strings
240           unless necessary.
241
242 2005-11-18  Jonathan Pryor <jonpryor@vt.edu>
243
244         * Catalog.cs, UnixDirectory.cs, UnixDirectoryInfo.cs, UnixDriveInfo.cs,
245           UnixEnvironment.cs, UnixFile.cs, UnixFileInfo.cs, UnixFileSystemInfo.cs,
246           UnixGroup.cs, UnixGroupInfo.cs, UnixProcess.cs, UnixSymbolicLinkInfo.cs,
247           UnixUser.cs, UnixUserInfo.cs: Change types of [Obsolete] members for
248           consistency and CLS compliance; Mono.Unix.Native type migration.
249         * FileTypes.cs: s/Special/Device/g (CharacterSpecial ==> CharacterDevice).
250           The *Special was a BSD convention, while UnixFileSystemInfo uses *Device
251           in property names, and these should be consistent.  Changing the enum is
252           simpler than changing the UnixFileSystemInfo properties.
253         * UnixIOException.cs: s/error/errno/g (FxCop suggestion); change type of
254           ErrorCode property.
255         * UnixMarshal.cs: s/error/errno/g (FxCop suggestion); Mono.Unix.Native
256           type migration.
257
258 2005-11-08  Jonathan Pryor <jonpryor@vt.edu>
259
260         * Catalog.cs: Exception safety improvements (don't let memory leak!); check
261           for errors with bindtextdomain(3) et. al.
262
263 2005-11-08  Jonathan Pryor <jonpryor@vt.edu>
264
265         * UnixPipes.cs: Provide Equals, GetHashCode, and operator==/operator!= to
266           conform with FxCop guidelines for structures.
267
268 2005-11-03  Jonathan Pryor <jonpryor@vt.edu>
269
270         * FileTypes.cs, UnixFileSystemInfo.cs: s/FIFO/Fifo/ to follow .NET
271           naming conventions (as reported by FxCop).
272
273 2005-11-01  Jonathan Pryor <jonpryor@vt.edu>
274
275         * UnixDirectoryInfo.cs, UnixDriveInfo.cs, UnixEnvironment.cs, 
276           UnixFileSystemInfo.cs, UnixGroupInfo.cs, UnixProcess.cs, UnixUserInfoc.cs:
277           Obsolete statements now specify in what way the return type will change.
278         * IncludeAttribute.cs: Obsoleted.  It's an error to use it now.
279
280 2005-11-01  Jonathan Pryor <jonpryor@vt.edu>
281
282         * FileAccessPattern.cs: Change enumeration names to match Robert Love's more
283           sensible names from his FileAdvise class used in Beagle
284           (UseSoon --> PreLoad, WillNotUse --> FlushCache).
285         * FileHandleOperations.cs: Added; contains AdviseFileAccessPattern()
286           (moved from UnixFile.cs).
287         * UnixDirectory.cs: Obsolete the class; use UnixDirectoryInfo instead.
288         * UnixDirectoryInfo.cs: Add GetCurrentDirectory(), SetCurrentDirectory().
289         * UnixFile.cs: Obsolete the class; use UnixFileInfo, FileHandleOperations,
290           or UnixPipes instead.
291         * UnixFileSystemInfo.cs: Add ToStat() method.
292         * UnixGroup.cs: Obsolete the class; use UnixGroupInfo instead.
293         * UnixGroupInfo.cs: Obsolete & Replace constructor, add GetMemberNames(),
294           GetLocalGroups().
295         * UnixPipes.cs: Added (type moved from UnixFile.cs).
296         * UnixStream.cs: AdviseFileAccessPattern() uses FileHandleOperations now.
297         * UnixSymbolicLinkInfo.cs: Implement TryReadLink() to avoid constant buffer
298           re-sizing.  Stevens states that the file size of the symlink is the number
299           of bytes needed to hold the symlink, so this should be faster.
300         * UnixUser.cs: Obsolete the class; use UnixUserInfo instead.
301         * UnixUserInfo.cs: Obsolete & Replace constructor; add useful static members
302           from UnixUser such as GetLoginName(), GetLocalUsers(), etc.
303
304 2005-10-27  Jonathan Pryor <jonpryor@vt.edu>
305
306         * UnixEnvironment.cs: Add RealUser, RealGroup, EffectiveUser, EffectiveGroup
307           properties; [Obsolete] necessary methods and provide replacements.
308         * UnixStream.cs: Add OwnerUser(Id), OwnerGroup(Id) properties; 
309           improve Stat handling.
310
311 2005-10-26  Jonathan Pryor <jonpryor@vt.edu>
312
313         * UnixEncoding.cs: Change EscapeByte to 0x0000, as suggested by Michal
314           Moskal.
315         * UnixPath.cs: Remove '\0' from InvalidPathChars, since U+0000 is now used
316           as the path escape character for marshaling purposes.
317
318 2005-10-26  Jonathan Pryor <jonpryor@vt.edu>
319
320         * UnixMarshal.cs: Obsolete heap-related methods to have a Heap suffix
321           (AllocHeap, FreeHeap, etc.), and change StringToAlloc() to be
322           StringToHeap().  This creates a stronger name association between related
323           methods.
324
325 2005-10-26  Jonathan Pryor <jonpryor@vt.edu>
326
327         * UnixIOException.cs: Add (string) and (string, Exception) constructors to
328           silence FxCop; re-work logic so we lookup the error string at construction
329           time and use this as the message for the base class.
330
331 2005-10-25  Jonathan Pryor <jonpryor@vt.edu>
332
333         * Stdlib.cs, Syscall.cs: Filenames need to be marshaled through the 
334           FileNameMarshaler, which will encode/decode filenames with UnixEncoding.
335         * UnixEncoding.cs: Added (copied from
336           ../../corlib/System.Text/UTF8Encoding.cs); a hack to permit handling of 
337           arbitrarily encoded filenames.  It attempts to decode a byte[] array as 
338           UTF-8, and if the decode fails it prefixes each byte with 
339           UnixEncoding.EscapeByte (\uFFFF).
340         * UnixMarshal.cs: Use UnixEncoding as the default encoding, and special-case
341           UnixEncoding to use Stdlib.strlen() for native string lengths.
342
343 2005-10-21  Jonathan Pryor <jonpryor@vt.edu>
344
345         * FileAccessPattern.cs: Added
346         * UnixFile.cs, UnixStream.cs: Deprecate all the Advise* methods (lots!)
347           and replace with 6 methods which take a FileAccessPattern enum.
348
349 2005-10-19  Jonathan Pryor <jonpryor@vt.edu>
350
351         * FileAccessPermissions.cs, FileSpecialAttributes.cs, FileTypes.cs: Added.
352         * UnixFileSystemInfo.cs, UnixStream.cs: Replace the old Permission property
353           with 4 new properties: Protection (for the Native.FilePermissions value),
354           FileAccessPermissions (for rwxrwxrwx info), FileSpecialAttributes (for
355           set-user-id, set-group-id, sticky), and FileTypes (directory, socket...).
356           The new enumeration types have nicer CLS-compliant names.
357
358 2005-10-17  Jonathan Pryor <jonpryor@vt.edu>
359
360         * UnixMarshal.cs: Fix GetIntXxBufferLength to require fewer
361           Marshal.ReadIntXx() calls; Fix PtrToString so that
362           ``"foo" == PtrToString (StringToAlloc("foo",enc),enc)'' is true for
363           "random" encodings.
364
365 2005-10-17  Jonathan Pryor <jonpryor@vt.edu>
366
367         * UnixFileSystemInfo.cs: Add OwnerUserId and OwnerGroupId properties.
368
369 2005-10-17  Jonathan Pryor <jonpryor@vt.edu>
370
371         * UnixDriveInfo.cs, UnixEnvironment.cs, UnixFile.cs, UnixFileSystemInfo.cs, 
372           UnixGroup.cs, UnixStream.cs, UnixUser.cs: Don't use SetLastError(), since
373           it's use is (1) incorrect, and (2) will be going away with the move to
374           Mono.Unix.Native.Syscall.  Instead use the Native.Syscall.* APIs which 
375           set errno sanely.
376
377 2005-10-17  Jonathan Pryor <jonpryor@vt.edu>
378
379         * UnixGroup.cs, UnixGroupInfo.cs, UnixFile.cs, UnixFileSystemInfo.cs,
380           UnixStream.cs, UnixSymbolicLinkInfo.cs, UnixUser.cs, UnixUserInfo.cs:
381           Start migrating uid/gid to long (from uint) for CLS compliance.
382           (Full migration must wait 'til after the next release as this would
383           require changes to existing members.)
384         * UnixEnvironment.cs: Above, and add RealUserId/RealGroupId and
385           EffectiveUserId/EffectiveGroupId.
386
387 2005-10-14  Jonathan Pryor <jonpryor@vt.edu>
388
389         * Catalog.cs: Create a constructor and mark it [Obsolete].  It will be made
390           private after the next release.
391         * UnixFile.cs, UnixStream.cs: Deal with Mono.Unix.Native type name changes.
392         * UnixFileSystemInfo.cs: [Obsolete] more members; Deal with Mono.Unix.Native 
393           type name changes.
394         * Syscall.cs: Create maps for PathConf, SysConf, ConfStr again; fpathconf(),
395           pathconf(), and sysconf() should call Native.Syscall since the
396           MonoPosixHelper.so helpers have changed.
397
398 2005-10-13  Jonathan Pryor <jonpryor@vt.edu>
399
400         * UnixMarshal.cs: More/better StringToAlloc/PtrToString which take a
401           System.Text.Encoding instance for proper string marshaling.  
402           - PtrToString(string,Encoding) is particularly tricky due to variable
403             length encodings.
404           - Fix StringToAlloc so that it works properly with UTF-16 encodings 
405             (we need a terminating null 16-bit word, not a null byte).
406           - StringToAlloc overload for doing substrings.
407
408 2005-10-12  Jonathan Pryor <jonpryor@vt.edu>
409
410         * UnixStream.cs: Check for EROFS and EINVAL in Flush().  Snorp was getting
411           an exception when he created a UnixStream around a socket, because
412           sockets can't be flushed.  It should be acceptable to create a UnixStream
413           around a socket, so don't throw an exception in this scenario.
414
415 2005-10-06  Jonathan Pryor <jonpryor@vt.edu>
416
417         * UnixDirectory.cs, UnixDirectoryInfo.cs UnixFile.cs, UnixFileSystemInfo.cs, 
418           UnixGroupInfo.cs, UnixIOException.cs, UnixStream.cs, UnixUserInfo.cs:
419           API Review: Obsolete appropriate members and add appropriate overloads for
420           pending move to Mono.Unix.Native types.
421         * UnixMarshal.cs: API Review; add StringToAlloc().
422
423 2005-09-26  Jonathan Pryor <jonpryor@vt.edu>
424
425         * UnixFileSystemInfo.cs: Exists shouldn't use access(2), as (1) Exists isn't
426           virtual, and (2) access(2) errors if you try to access(2) a symlink which
427           points nowhere.  Use (l)stat(2) instead, via GetFileStatus(), as this lets
428           UnixSymbolicLinkInfo behave properly.
429         * UnixSymbolicLinkInfo.cs: The Contents property should return null if the
430           symlink target doesn't exist.
431
432 2005-09-20  Jonathan Pryor <jonpryor@vt.edu>
433
434         * Syscall.cs: Add [Map] to AccessMode and MmapProt, as the Mono.Unix.Native
435           replacements go by different names (AccessModes, MmapProts), but we need
436           to continue generating the mapping code for these types (backward compat).
437
438 2005-09-20  Jonathan Pryor <jonpryor@vt.edu>
439
440         * CdeclFunction.cs: [Obsolete]d by Mono.Unix.Native.CdeclFunction.
441         * make-map.cs: Remove.
442         * Stdlib.cs: [Obsolete] the types; use the Mono.Unix.Native.* types instead.
443         * StdioFileStream.cs: Add GC.KeepAlive statements to prevent premature GC's
444           (FxCop suggestion).
445         * Syscall.cs: Remove [Map] attribute from all types; [CLSCompliant(false)]
446           work; [Obsolete] all types and suggest using the Mono.Unix.Native.*
447           replacements; remove [IncludeAttribute] -- superseded by
448                 Mono.Unix.Native/Syscall.cs's [HeaderAttribte] for CLS compliance.
449         * UnixConvert.cs: [Obsolete]d by Mono.Unix.Native.NativeConvert.
450         * UnixDirectory.cs, UnixDriveInfo.cs, UnixEnvironment.cs, 
451           UnixGroup.cs, UnixGroupInfo.cs, 
452           UnixSymbolicLinkInfo.cs, UnixUser.cs, UnixUserInfo.cs:
453           Add [CLSCompliant(false)] as necessary.
454         * UnixFile.cs, UnixDirectory.cs, UnixFileInfo.cs, UnixFileSystemInfo.cs: 
455           [CLSCompliant(false)], addition of method overloads for [Obsolete]d types, 
456           warn about changing return types.
457         * UnixProcess.cs, UnixStream.cs: Add [CLSCompliant(false)] as necessary, 
458           and warn about changing property types.
459
460 2005-09-02  Jonathan Pryor <jonpryor@vt.edu>
461
462         * Stdlib.cs: Cache delegates passed to Stdlib.signal() so that they survive
463           garbage collections.  Delegates can be removed by calling Stdlib.signal()
464           again with one of the Stdlib.SIG_* values (or the original return value of
465           Stdlib.signal()).
466         * UnixUser.cs, UnixGroup.cs, UnixEnvironment.cs: Clarify "Id" (int) vs. 
467           "Name" (string) differences by always using a Id or Name suffix.
468
469 2005-07-01  Daniel Drake  <dsd@gentoo.org>
470
471         * Syscall.cs: The entire extended attribute API now goes through MPH, to
472           be shared between both Linux's and FreeBSD's similar EA implementations.
473
474 2005-06-29  Miguel de Icaza  <miguel@ximian.com>
475
476         * StdioFileStream.cs: Only flush if we do not own the handle, as
477         fclose does a flush internally.
478
479 2005-06-29  Jonathan Pryor <jonpryor@vt.edu>
480
481         * UnixEnvironment: Add User, Login properties.
482         * Syscall.cs: Add locking around cuserid, crypt, encrypt, getlogin.
483
484 2005-06-29  Jonathan Pryor <jonpryor@vt.edu>
485
486         * Syscall.cs: SyslogFacility shouldn't be [Flags] either.  Sigh.
487           Thanks to Vorobiev Maksim for pointing this out.
488         * make-map.cs: Don't generate conversion code for [Obsolete] enum members.
489           This assumes that (1) the enum member's value is invalid, or (2) a
490           corrected member with the same value exists.  This fix allows us to
491           obsolete invalid members (instead of removing them) without screwing up
492           the generated code -- consider LOG_USRE, the mis-spelling of LOG_USER.
493           Since SyslogFacility was (incorrectly) a [Flags] enum, since both LOG_USER
494           and LOG_USRE had the same value, we'd get a EINVAL error trying to convert
495           a valid value, since LOG_USRE would exist, would be checked for, and the
496           check would succeed (since it had the same value as LOG_USER).
497           This change allows us to be slightly more permissive with versioning.
498
499 2005-06-28  Jonathan Pryor <jonpryor@vt.edu>
500
501         * Syscall.cs: correct value of LOG_CRON (it shouldn't be identical to
502           LOG_UUCP).  SyslogLevel shouldn't have [Flags].  Move LOG_USER to be
503           before LOG_USRE so that the generated map code doesn't return EINVAL when
504           LOG_USER is specified.
505
506 2005-06-15  Jonathan Pryor <jonpryor@vt.edu>
507
508         * Syscall.cs: s/LOG_USRE/LOG_USER/.  Fixes #75274.  
509           Thanks to Martin Honermeyer.
510
511 2005-06-09  Jonathan Pryor <jonpryor@vt.edu>
512
513         * make-map.cs: Look for [Obsolete] members, and mark the UnixConvert
514           conversion functions with the same [Obsolete] message.  This should permit
515           more graceful deprecation of enumerations in the future (rather than just
516           API breaks).
517
518 2005-06-08  Jonathan Pryor <jonpryor@vt.edu>
519
520         * Syscall.cs: Add execvp(2).  (This should have been added with the other
521           exec(2) additions...).
522
523 2005-06-08  Jonathan Pryor <jonpryor@vt.edu>
524
525         * Syscall.cs: Update comment with correct exception type.
526         * UnixConvert.cs: Rename ToFilePermissions(string) to
527           FromOctalPermissionString; Add ToOctalPermissionString,
528           FromUnixPermissionString, ToUnixPermissionString.
529         * UnixMarshal.cs: Remove ErrorMarshal.HaveStrerror_r and
530           UnixMarshal.IsErrorDescriptionThreadSafe.  strerror(3) is now thread-safe
531           (from managed code, at least).  Update comment.
532
533 2005-06-07  Jonathan Pryor <jonpryor@vt.edu>
534
535         * UnixFileSystemInfo.cs: Don't use lstat(2), use stat(2).  This fits with
536           expectations better -- if you create a UnixFileInfo() on a symlink, you
537           want to get the target's information, not the symlink's info.  Add
538           GetFileStatus so UnixSymbolicLinkInfo can override this behavior.
539         * UnixSymbolicLinkInfo.cs: Implement GetFileStatus() (which calls lstat(2)).
540
541 2005-06-07  Jonathan Pryor <jonpryor@vt.edu>
542
543         * Syscall.cs: Document naming conventions.
544
545 2005-06-05  Jonathan Pryor <jonpryor@vt.edu>
546
547         * make-map.cs: Change automatic "ifdef HAVE_<header>" support prefix to
548           "ah:" from ">".  I hadn't known about ">", and "ah:" is (somewhat) more
549           obvious.
550         * Syscall.cs: Change IncludeAttribute to put all headers/defines one/line.
551           It's easier to read this way.  Add "ah:sys/xattr.h" to the headers.
552
553 2005-06-03  Jonathan Pryor <jonpryor@vt.edu>
554
555         * Stdlib.cs: Add sanity checking to snprintf(3) to avoid buffer overflows.
556
557 2005-06-02  Jonathan Pryor <jonpryor@vt.edu>
558
559         * StdioFileStream.cs: Remove FilePosition property & replace with
560           SaveFilePosition/RestoreFilePosition methods.  Since FilePosition has a
561           finalizer, it's not right to have implicitly created instances.
562         * Stdlib.cs: 
563           - FilePosition: GC.SuppressFinalize() should be last in Dispose() 
564             (following .NET guidelines).
565           - Syscall: Add locking around functions most likely to be thread unsafe.
566             This should provide some level of thread-safety to managed code.
567         * Syscall.cs: Add locking around functions most likely to be thread unsafe;
568           add mkstemp(3) export.
569         * UnixEnvironment.cs: GetUserShells should be atomic (from managed code).
570         * UnixGroup.cs: GetLocalGroups should be atomic (from managed code).
571         * UnixGroupInfo.cs: Add ToGroup() method to retrieve underlying Group info.
572         * UnixUser.cs: GetLocalUsers should be atomic (from managed code).
573         * UnixUserInfo.cs: Add ToPasswd () method to retrieve underlying Passwd info.
574         * UnixDriveInfo.cs: GetDrives should be atomic (from managed code).
575
576 2005-05-31  Jonathan Pryor <jonpryor@vt.edu>
577
578         * Stdlib.cs: Add comment for atexit(3) so I don't try to add it.
579         * Syscall.cs: Add fcntl(2) overload which takes DirectoryNotifyFlags (so
580           that *something* accepts a DirectoryNotifyFlags); Fix IncludeAttribute
581                 header files (">sys/poll.h" doesn't exist); 
582           Add additional <sys/mman.h> functions mmap, munmap, msync, mlock, munlock,
583           mlockall, munlockall, mremap, mincore, remap_file_pages.
584         * UnixConvert.cs: Add conversion functions for MmapFlags, MmapProt, MsyncFlags,
585           MlockallFlags, MremapFlags.
586
587 2005-05-31  Jonathan Pryor <jonpryor@vt.edu>
588
589         * Syscall.cs, UnixConvert.cs: Rename LockFlags to LockfCommand.  This is a more 
590           consistent naming, and it's more correct (they weren't flags in the first place).
591
592 2005-05-18  Jonathan Pryor <jonpryor@vt.edu>
593
594         * Stdlib.cs: Correct Mono_Posix_Stdlib_InvokeSignalHandler export.
595
596 2005-05-18  Jonathan Pryor <jonpryor@vt.edu>
597
598         * make-map.cs: Process the Mono.Posix namespace as well as Mono.Unix; add
599           mapping for Boolean => int for native type conversion.
600
601 2005-05-18  Jonathan Pryor <jonpryor@vt.edu>
602
603         * make-map.cs: Add a MphPrototypeFileGenerator, which looks for DllImport
604           methods across all types and generates a C header file declaration for
605           those methods.  This allows us to ensure consistency between
606           Mono.Posix.dll and MonoPosixHelper.so.  Rename WrapperFileGenerator to
607                 ConvertFileGenerator (it generates UnixConvert).
608         * MapAttribute.cs, IncludeAttribute.cs: Make these internal -- there's no
609           reason for external users to even know these exist.
610         * StdioFileStream.cs: Move GC.SuppressFinalize call to be last Dispose()
611           call.  This follows current design guidelines, and allows an exception to
612           be thrown from Dispose() without un-registering the finalizer.
613         * Syscall.cs: Change method declarations to match MonoPosixHelper, etc.
614            - posix_fallocate(P) takes a size_t
615            - mis-spelled settimeofday(2), sethostname(2)
616            - exec(2) can be public; it's safe to call
617            - change lseek(2) so int's are passed to MonoPosixHelper.so, not shorts
618            - We can't allow two incompatible prototypes to exist (since C allows
619              only one prototype, and we're cross-checking prototypes now).  Change
620              utime(2) so only one prototype is needed.
621         * UnixMarshal.cs: ErrorMarshal.ErrorTranslator and ErrorMarshal.Translate
622           shouldn't be public; make them internal.
623         * UnixStream.cs: Remove `unsafe` code block when a "safe" alternative works;
624           Close() should also call GC.SuppressFinalize.
625
626 2005-05-12  Jonathan Pryor <jonpryor@vt.edu>
627
628         * Syscall.cs: The Statvfs structure should contain a MountFlags enumeration,
629           not a ulong (we can "safely" do this since POSIX defines some values for
630           f_flag, so we should be kind and expose them).
631         * UnixConvert.cs: Add MountFlags conversion functions.
632
633 2005-05-02  Joe Shaw  <joeshaw@novell.com>
634
635         * UnixListener.cs (Init): Remove the call to Cleanup() and the
636         method itself, which was not supposed to be here.  We try to
637         connect to the socket if it exists instead of deleting it
638         undconditionally.
639
640 2005-04-30  Ben Maurer  <bmaurer@ximian.com>
641
642         * Stdlib.cs: Comment out usage of `UnmanagedFunctionPointer'. It
643         isn't supported in the runtime -- it throws an assert -- so better
644         not to use it at all for now.
645
646 2005-04-29  Jonathan Pryor <jonpryor@vt.edu>
647
648         * UnixConvert.cs: Fix time_t -> DateTime conversions.  time_t should be
649           assumed to be in the local time zone, so don't mess with UTC shifts.
650           This allows Mono.Unix to produce sane output (e.g. identical to ls(1) or
651           stat(1), instead of several hours different).
652
653 2005-04-29  Jonathan Pryor <jonpryor@vt.edu>
654
655         * Stdlib.cs: Make FilePosition slightly more useful by providing a
656           ToString() override which dumps the fpos_t structure contents into a 
657           hex string.  Add Equals(), GetHashCode(), operator==, and operator!=
658           so FilePosition behaves like a value type.
659
660 2005-04-21 Gonzalo Paniagua Javier <gonzalo@ximian.com>
661
662         * UnixClient.cs:
663         * UnixListener.cs: TcpListener/TcpClient clones from Jow Shaw.
664
665 2005-04-21 Gonzalo Paniagua Javier <gonzalo@ximian.com>
666
667         * Mono.Posix.dll.sources: added UnixListener and UnixClient from Joe
668         Shaw.
669
670 2005-04-21 Gonzalo Paniagua Javier <gonzalo@ximian.com>
671
672         * UnixEndPoint.cs: fix from Mono.Posix.
673
674 2005-04-20  Jonathan Pryor <jonpryor@vt.edu>
675
676         * Syscall.cs: Make all fork(2) and exec(2) functions `private`.  It
677           currently isn't safe to call these under *any* circumstances.  See also
678           68141, and this pertinent quote from Butenhof's 
679           "Programming with POSIX Threads", p197, s6.1:
680           
681               "When a threaded process calls fork to create a child process,
682               Pthreads specifies that only the thread calling fork exists in the
683               child. ... Pthreads does not 'terminate' the other threads in a forked
684               process...They simply cease to exist.  ... This is not a problem if
685               the child process is about to call exec to run a new program, but if
686               you use fork to clone a threaded program, beware that you may lose
687               access to memory, especially heap memory stored only as
688               thread-specific data values."
689           
690           Since P/Invoke currently requires using thread local storage, once you
691           fork(2) you won't be able to invoke exec(2) from managed code (since that
692           would require a P/Invoke transition to call exec(2), which would require
693           TLS, which doesn't exist in the new process).
694          
695           This can only be fixed by removing the TLS dependency on P/Invoke, which
696           isn't a priority (and may not be possible).
697          
698           The workaround is to create a C function which does your fork(2)/exec(2)
699           (and any other functions such as daemon(3)) on your behalf, and P/Invoke
700           to call this C function.
701
702 2005-04-18  Jonathan Pryor <jonpryor@vt.edu>
703
704         * Syscall.cs: Update comment specifying which functions belong in Syscall.
705         * UnixConvert.cs: Add XattrFlags conversion functions.
706         * UnixMarshal.cs: Remove warning about self-assignment.
707
708 2005-04-16  Daniel Drake <dsd@gentoo.org>
709
710         * Syscall.cs: Add bindings for extended attribute manipulation
711
712 2005-04-05  Miguel de Icaza  <miguel@novell.com>
713
714         * Syscall.cs: Set entry point for sys_syslog to be syslog.
715         Include the syslog.h header in the generated map so that we
716         actually do the mapping.
717
718 2005-03-28  Jonathan Pryor <jonpryor@vt.edu>
719
720         * UnixConvert.cs: Add ToFopenMode() methods, which convert FileMode/FileAccess
721           into an fopen(3) mode string.  ToOpenFlags() should throw
722           ArgumentOutOfRangeException for argument violations.
723         * StdioFileStream.cs: Add constructor overloads accepting filename and
724           FileMode/FileAccess overloads; Compatibility fixes with regression tests;
725           remove IDisposable implementation since System.IO.Stream already
726           implements it (which calls Close() for us).
727
728 2005-03-17  Jonathan Pryor <jonpryor@vt.edu>
729
730         * Stdlib.cs: Move Errno-related functionality into Stdlib from Syscall,
731           since (1) errno is part of C89, and (2) StdioFileStream will need it, and
732           StdioFileStream shouldn't use Syscall.  Add [UnmanagedFunctionPointer]
733                 attribute to SignalHandler for .NET 2.0 (since signal handlers use C
734                 calling convention, not Stdcall).
735         * Syscall.cs: Move Errno-related functionality into Stdlib.
736         * UnixMarshal.cs: Use ERANGE not EPERM when figuring out appropriate
737           translator, since ERANGE is part of C99 and EPERM isn't.  Use Stdlib
738           instead of Syscall for Errno-related functionality.
739
740 2005-02-02  Jonathan Pryor <jonpryor@vt.edu>
741
742         * UnixFile.cs: Cope with changes in UnixStream.
743         * UnixStream.cs: Change FileDescriptor property to Handle for consistency.
744         * StdioFileStream.cs: Change FileStream property to Handle for consistency.
745
746 2005-02-02  Jonathan Pryor <jonpryor@vt.edu>
747
748         * Syscall.cs: Remove public sys_ methods.  Some were public by mistake, and
749           others so that users could manually marshal strings if desired.  Manually
750           marshaling strings shouldn't be necessary, though, so remove them too.
751
752 2005-02-02  Jonathan Pryor <jonpryor@vt.edu>
753
754         * StdioFileStream.cs: Fix Length property to actually return the size of the
755           file, not the # of bytes from the current position to EOF.  Oops.
756
757 2005-01-31  Jonathan Pryor <jonpryor@vt.edu>
758
759         * Stdlib.cs: Import "msvcrt", not "libc".  These members are part of the
760           ANSI C standard, and thus should be present on Windows via msvcrt.dll
761           (except snprintf, until they catch up to C99).  Change the calling
762           convention of all functions to Cdecl, as the .NET default is Stdcall.
763           Changing the calling convention isn't needed in Syscall, as it can only be
764           run on Unix platforms anyway, where the default is Cdecl.
765         * Syscall.cs: Add LIBC member that points to the real "libc"; we can't use
766           the imported definition from Stdlib as "msvcrt" doesn't exist on Unix.
767
768 2005-01-29  Jonathan Pryor <jonpryor@vt.edu>
769
770         * Stdlib.cs: sys_* functions shouldn't be public.
771
772 2005-01-13  Jonathan Pryor <jonpryor@vt.edu>
773
774         * make-map.cs: libMonoPosixHelper exports Mono_Posix prefixes, not Mono_Unix
775           prefixes, so change the type and namespace to generate compatible code.
776         * Syscall.cs: Change OpenFlags values so they match the Linux values.
777
778 2005-01-13  Jonathan Pryor <jonpryor@vt.edu>
779
780         * Stdlib.cs: Use Stdlib.LIBC instead of "libc".
781         * StdioFileStream.cs: Add FilePosition property (not that I expect anyone to
782           use it) and Rewind() method.
783
784 2005-01-05  Jonathan Pryor <jonpryor@vt.edu>
785
786         * StdioFileStream.cs: Added; System.IO.Stream wrapper for C FILE struct.
787         * Stdlib.cs: Correct visibility of ftell().
788
789 2005-01-05  Jonathan Pryor <jonpryor@vt.edu>
790
791         * Stdlib.cs: Re-order declarations to match the order used in the 
792           C99 Standard Annex B; Complete <stdio.h> exports (except for those not
793           worth supporting); Add non-"unsafe" versions of fread(3), fwrite(3) and
794           add some rudimentary buffer-overflow checking; Add <stdlib.h> exports such
795           as getenv(3), exit(3), rand(3), EXIT_SUCCESS, RAND_MAX, etc.
796
797 2005-01-03  Jonathan Pryor <jonpryor@vt.edu>
798
799         * Syscall.cs: Update endfsent() and setfsent() declarations, as these must
800           now be implemented in MonoPosixHelper.
801
802 2005-01-01  Jonathan Pryor <jonpryor@vt.edu>
803
804         * Stdlib.cs, Syscall.cs: Minimize duplicate declarations of
805           "MonoPosixHelper" for use in DllImport statements.
806
807 2005-01-01  Jonathan Pryor <jonpryor@vt.edu>
808
809         * Stdlib.cs: Don't use C# v2 features; fixes build under CSC.EXE.
810
811 2004-12-30  Jonathan Pryor <jonpryor@vt.edu>
812
813         * Stdlib.cs: On miguel's suggestion, rename Sighandler_t to SignalHandler.
814
815 2004-12-30  Jonathan Pryor <jonpryor@vt.edu>
816
817         * Stdlib.cs: Implement all C89 <stdio.h> functions except for the scanf(3)
818           family.  These are too dangerous to expose.
819
820 2004-12-30  Jonathan Pryor <jonpryor@vt.edu>
821
822         * CdeclFunctions.cs: Remove warning about unused variable.
823         * Stdlib.cs: Make signal(2) sane and (hopefully) complete.
824         * Syscall.cs: Fix cuserid Obsolete message to reference correct class name.
825         * UnixProcess.cs: Remove warning about unused variable.
826         * UnixMarshal.cs: Remove warnings about unused variables.
827
828 2004-12-29  Jonathan Pryor <jonpryor@vt.edu>
829
830         * UnixPath.cs: Add ReadSymbolicLink(), which takes an intelligent approach
831           to reading symlinks (since their contents may be any size, we grow the
832           buffer dynamically to fit them all, instead of assuming a maximum size).
833         * UnixSymbolicLinkInfo.cs: Remove MaxContentsSize.
834
835 2004-12-29  Jonathan Pryor <jonpryor@vt.edu>
836
837         * UnixPath.cs: Add check for when symlink points to a full path name.
838
839 2004-12-29  Jonathan Pryor <jonpryor@vt.edu>
840
841         * Syscall.cs: Fix Object.Equals implementations.
842         * UnixPath.cs: New & improved, with Testing!  GetRealPath() is changed so
843           that it doesn't walk the entire path looking for symlinks, it just reads 
844           the leaf.  GetCompletRealPath() walks the entire path resolving symlinks.
845           GetCanonicalPath() added, which "cleans up" a path (removing extraneous
846           "." and ".." entries).
847         * UnixSymbolicLinkInfo.cs: Rename ContentsLength -> MaxContentsSize.
848
849 2004-12-28  Jonathan Pryor <jonpryor@vt.edu>
850
851         * UnixFileSystemInfo.cs: Add a link(2) wrapper, CreateLink().  Strictly
852           speaking it's only "safe" to do this on files, but an exception will be 
853           returned if the user tries to hard link directories (because of EPERM), 
854           unless the user is root, in which case it should be allowed anyway...
855
856 2004-12-28  Jonathan Pryor <jonpryor@vt.edu>
857
858         * CdeclFunctions.cs: Correct the comments for AMD64
859         * UnixDirectoryInfo.cs: override Name; add Parent & Root properties; 
860           Correct Path usage (s/Path/FullPath/g).
861         * UnixDriveInfo.cs: Added.  Based on .NET 2.0 System.IO.DriveInfo docs,
862           provides statvfs(2) and getfsfile(3) information about a mounted volume.
863           GetDrives() wraps getfsent(3), thus parsing /etc/fstab.
864         * UnixFile.cs: Use UnixConver.ToOpenFlags, deleting the local version.
865         * UnixFileInfo.cs: Use UnixConver.ToOpenFlags, deleting the local version;
866           override Name; add DirectoryName and Directory properties; 
867         * UnixFileSystemInfo.cs: Make more .NET-like, using FullPath and
868           OriginalPath protected members, abstract Name property; Add
869           CreateSymbolicLink; Remove ReadLink (it's now 
870           UnixSymbolicLinkInfo.Contents); Use lstat(2) for Create(string), so we
871           properly detect Symbolic Links.
872         * UnixPath.cs: Added; Path manipulation utility functions.
873         * UnixSymbolicLinkInfo.cs: 
874           - Seal the class; 
875           - override new abstract member Name; 
876           - rename ReadLink to ContentsPath (and Contents) properties 
877             (why "Contents"?  Because readlink(2) says "readlink places the 
878             contents of the symbolic link in the buffer...")
879           - Add CreateSymbolicLinkTo(), which creates a symlink to the specified
880             "normal" file
881
882 2004-12-28  Jonathan Pryor <jonpryor@vt.edu>
883
884         * Stdlib.cs: Add syslog(3) to XPrintfFunctions; Add additional printf(3) 
885           and fprintf(3) overload which properly escape the format string 
886           (by using "%s" as the format for the user-supplied message).
887         * Syscall.cs: Add #regions for enummerations, structures, classes; Wrap
888           syslog(3) and related enumerations; fix operator!= on Dirent, Group; 
889           wrap {f}statvfs(2); wrap <fstab.h> entries (getfsent(3), etc.).
890         * UnixConvert.cs: Add Syslog-releated enumeration translation functions;
891           Move ToOpenFlags here from UnixFile and UnixFileInfo.
892         * UnixMarshal.cs: Missing P/Invoke methods throw
893           EntryPointNotFoundException, not MissingMethodException; add
894           EscapeFormatString, which escapes printf-style format strings so that they
895           can be safely handed off to native code (avoiding stack overflow, etc);
896           make CreateExceptionForError internal.
897
898 2004-12-15  Jonathan Pryor <jonpryor@vt.edu>
899
900         * Stdlib.cs: Add more <stdio.h> wrappers, such as fread(3) and fwrite(3).
901           These will be useful in implementing System.IO.Stream subclass for
902           reading/writing to a FILE*.  Fix a typo in the realloc(3) DllImport.
903         * Syscall.cs: Fix the sys_kill and sys_crypt declarations.
904         * CdeclFunction.cs: Document calling convention problems on AMD64.
905
906 2004-11-18  Jonathan Pryor <jonpryor@vt.edu>
907
908         * CdeclFunction.cs: Added.
909         * Stdlib.cs: Re-add printf(3) and fprintf(3).  They may not be portable (the
910           jury is still out on that; the AMD64 SysV ABI looks like it should be
911           portable to AMD64 to my eyes), but they will work on *some* platforms, so
912           we should permit it.  The new implementation takes a page out of
913           cocoa-sharp: use System.Reflection.Emit to generate a P/Invoke method at
914           runtime to invoke printf(3) or fprintf(3).  This way, we can export a
915           params signature to C# code, permitting natural usage such as:
916               Stdlib.printf ("Hello, %s world! (%i)\n", "silly", 42);
917         * Syscall.cs: Mark which headers are complete, which functions still need
918           wrapping (for headers which have anything done to them), add #region
919           blocks for each header;
920           export mkfifo(3), fexecve(), getppid(2), setlogin(); fix sleep(3) export.
921         * UnixEnvironment.cs: Export a friendly getppid(2) wrapper.
922           GetParentProcessId isn't in UnixProcess as there's no way (that I know of)
923           to get the Parent's Parent, so it can't be a class member, and exposing it
924           as a static member of UnixProcess doesn't make sense to me, as it isn't
925           general.  Added GetUserShells().
926         * UnixProcess.cs: Change constructor to internal, so it can be used from
927           UnixEnvironment.
928
929 2004-11-16  Jonathan Pryor <jonpryor@vt.edu>
930
931         * Stdlib.cs: Remove printf(3) and fprintf(3).  These are vararg/CDECL 
932           functions, and it's not portable to call them in this manner.
933           (It's not portable because some architectures, such as AMD64, use a
934           "cookie" as part of the vararg calling sequence to help reduce buffer
935           overflow exploits.  Trying to call vararg functions as if they were an
936           overloaded function will not properly set this hardware cookie, resulting
937           in a hardware exception.  Talk to lupus for more information.)
938
939 2004-11-16  Jonathan Pryor <jonpryor@vt.edu>
940
941         * Syscall.cs, UnixConvert.cs: Remove mount- and umount-related
942           functionality.  Mount/umount is inherently non-portable (see the C code
943           for mount/umount), and trying to provide a consistent interface is
944           impossible.  If you need mount/umount support, use the command-line
945           programs mount(1) and umount(1).
946
947 2004-11-16  Jonathan Pryor <jonpryor@vt.edu>
948
949         + Lots o' Renames, as the namespace changed.
950         * PosixConvert.cs: Moved to UnixConvert.cs:
951         * PosixDirectory.cs: Moved to UnixDirectory.cs:
952         * PosixEnvironment.cs: Moved to UnixEnvironment.cs:
953         * PosixDirectoryInfo.cs: Moved to UnixDirectoryInfo.cs:
954         * PosixFile.cs: Moved to UnixFile.cs:
955         * PosixFileInfo.cs: Moved to UnixFileInfo.cs:
956         * PosixFileSystemInfo.cs: Moved to UnixFileSystemInfo.cs:
957         * PosixGroup.cs: Moved to UnixGroup.cs:
958         * PosixGroupInfo.cs: Moved to UnixGroupInfo.cs:
959         * PosixIOException.cs: Moved to UnixIOException.cs:
960         * PosixMarshal.cs: Moved to UnixMarshal.cs:
961         * PosixProcess.cs: Moved to UnixProcess.cs:
962         * PosixStream.cs: Moved to UnixStream.cs:
963         * PosixSymbolicLinkInfo.cs: Moved to UnixSymbolicLinkInfo.cs:
964         * PosixUser.cs: Moved to UnixUser.cs:
965         * PosixUserInfo.cs: Moved to UnixUserInfo.cs:
966         * Catalog.cs, IncludeAttribute.cs, MapAttribute.cs, PeerCred.cs, Stdlib.cs,
967           Syscall.cs, UnixConvert.cs, UnixDirectory.cs, UnixDirectoryInfo.cs,
968           UnixEndPoint.cs, UnixEnvironment.cs, UnixFile.cs, UnixFileInfo.cs,
969           UnixFileSystemInfo.cs, UnixGroup.cs, UnixGroupInfo.cs, UnixIOException.cs,
970           UnixMarshal.cs, UnixProcess.cs, UnixStream.cs, UnixSymbolicLinkInfo.cs,
971           UnixUser.cs, UnixUserInfo.cs: Deal with renamed classes/members.
972
973 2004-11-15  Jonathan Pryor <jonpryor@vt.edu>
974
975         * PosixUserInfo.cs: Make the PosixUserInfo(Passwd) constructor public;
976           override Object.GetHashCode and Object.Equals.
977         * PosixGroupInfo.cs: Make the PosixGroupInfo(Group) constructor public;
978           override Object.GetHashCode and Object.Equals.
979         * PosixIOException.cs: Use PosixMarshal.GetErrorDescription instead of
980           calling Syscall.strerror_r directly
981         * PosixMarshal.cs: Add GetErrorDescription.  Strerror_r() isn't portable, so
982           GetErrorDescription() first tries strerror_r(), and if it fails falls back
983           to strerror(3).
984         * Syscall.cs: 
985           - Seal the Dirent class.  It has no virtual members, so there's no point 
986       in it being non-sealed.  Override Object.GetHashCode and Object.Equals.
987           - Seal the Group class.  It has no virtual members, so there's no point 
988       in it being non-sealed.  Override Object.GetHashCode and Object.Equals.
989             Provide operator== and operator!=.
990           - Seal the Passwd class.  It has no virtual members, so there's no point 
991       in it being non-sealed.  Override Object.GetHashCode and Object.Equals.
992             Provide operator== and operator!=.
993           - Remove strerror_r() convenience overload.  This is now
994             PosixMarshal.GetErrorDescription().
995
996 2004-11-12  Jonathan Pryor <jonpryor@vt.edu>
997
998         * Syscall.cs: Export time-related functions (gettimeofday, settimeofday,
999           utime, utimes), mknod.
1000
1001 2004-11-07  Atsushi Enomoto  <atsushi@ximian.com>
1002
1003         * PosixEnvironment.cs : csc build fix. see bug #69195.
1004         * PosixStream.cs : csc build fix. see bug #69196.
1005
1006 2004-11-05  Jonathan Pryor  <jonpryor@vt.edu>
1007
1008         * PosixConvert.cs: New file; conversion functions for Mono.Posix types.
1009         * PosixDirectory.cs: New file; Friendly wrapper over directory information.
1010         * PosixDirectoryInfo.cs: New file; Friendly wrapper over directory information.
1011         * PosixEnvironment.cs: New file; Friendly wrapper over environment information.
1012         * PosixFile.cs: New file; Friendly wrapper over file information.
1013         * PosixFileInfo.cs: New file; Friendly wrapper over file information.
1014         * PosixFileSystemInfo.cs: New file; Friendly wrapper over `stat'.
1015         * PosixGroup.cs: New file; User Group-related functionality
1016         * PosixGroupInfo.cs: New file; User Group-related functionality
1017         * PosixIOException.cs: New file; Exception for POSIX-generated exceptions.
1018         * PosixMarshal.cs: New file; utility functions for marshaling, etc.
1019         * PosixProcess.cs: New file; Friendly wrapper over process information.
1020         * PosixStream.cs: New file; Friendly wrapper over file descriptors.
1021         * PosixSymbolicLinkInfo.cs: New file; Friendly wrapper over symbolic links.
1022         * PosixUser.cs: New file; Friendly wrapper over user information.
1023         * PosixUserInfo.cs: New file; Friendly wrapper over user information.
1024         * Stdlib.cs: New file; C standard library exports.
1025         * Syscall.cs: Effective re-write.  
1026           - Organize exports by header file
1027           - add additional enumerations (Error for the E* error values, etc.)
1028           - always explicitly specify enumeration underlying type
1029           - Use a new wrapping infrastructure so that ABI-stable types are exported
1030                 - For example, size_t is exported as ulong, not IntPtr.
1031           - Wrap more functions, and wrap them better (such as getpwnam).
1032           - This release is NOT backward compatible.  Many names are the same, and
1033             hopefully they're still compatible, but no effort was made to maintain
1034             compatibility.  For example, FileMode was removed and replaced with
1035             FilePermissions, to avoid a name conflict with System.IO.FileMode.
1036                 - Change umount() to use MonoPosixHelper: portability fix for Mac OS X.
1037         * make-map.cs: Another effective re-write, to clean up the code, produce
1038           better output, and produce more output.  For example, most of
1039           PosixConvert can be auto-generated, so it is (modulo version delays and
1040           bootstrap issues).  `map.c' is now conditional on all macros, and has
1041           error checking for invalid/unsupported values.
1042
1043 2004-09-18  Jackson Harper  <jackson@ximian.com>
1044
1045         * Syscall.cs: Add support for poll ().
1046
1047 2004-09-18  Jackson Harper  <jackson@ximian.com>
1048
1049         * make-map.cs: Use field value not name for #defines.
1050                 
1051 2004-09-14  Loren Bandiera <lorenb@mmgsecurity.com>
1052
1053         * Syscall.cs: Added method for getpwnam which uses Passwd
1054         struct.
1055         * macros.c: Helper function for getpwnam
1056         (In committing, Josh Tauberer also added getpwuid.)
1057
1058 2004-07-09  Dick Porter  <dick@ximian.com>
1059
1060         * PeerCred.cs: Get the unix socket peer credentials.
1061
1062 2004-05-26  Miguel de Icaza  <miguel@ximian.com>
1063
1064         * Syscall.cs: Do not let the runtime handle strings, as we do not
1065         own those strings, we must transform the char * into a string
1066         ourselves. 
1067
1068 2004-05-03  Miguel de Icaza  <miguel@ximian.com>
1069
1070         * Syscall.cs: Add symlink
1071
1072 2004-04-19  Miguel de Icaza  <miguel@ximian.com>
1073
1074         * Syscall.cs: Use hex values for FileMode, since C# does not have
1075         an octal integer mode.
1076
1077 2004-03-30  Joshua Tauberer <tauberer@for.net>
1078
1079         * Added readlink, strerror, opendir, readdir, closedir
1080         * Added Mono.Posix.Stat.UnixToDateTime(long unixtime) --> DateTime
1081
1082 2004-03-11  Joshua Tauberer <tauberer@for.net>
1083
1084         * Syscall.cs: Removed argument to getgid that shouldn't be there.
1085                 Added getusername, getgroupname which wrap getpwuid, getgrgid
1086                 without dealing with pointers to structures.
1087                 Removed duplicate FileMode enum nested in Syscall class.
1088                 Added stat and lstat, which use StatMode enumeration
1089                 (like FileMode but nicer and complete) and Stat struct.
1090         * macros.c: Helper functions for getpwuid, getgrgid, stat, lstat.
1091
1092 2004-01-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
1093
1094         * Syscall.cs: moved the assembly attribute to a proper place
1095         and added 'signal.h'
1096         * make-map.cs: use reflection to invoke the properties, as it
1097         fails under MS runtime.
1098         
1099
1100 2004-01-05  Gonzalo Paniagua Javier <gonzalo@ximian.com>
1101
1102         * Syscall.cs: moved assembly attribute and added unsafe block to fix
1103         the build on windows.
1104
1105 2003-11-11  Wojciech Polak <polak@gnu.org
1106
1107         * Syscall.cs: Applied patch from Wojciech Polak <polak@gnu.org> to
1108         support IsAtty.
1109
1110 2003-05-16  Dick Porter  <dick@ximian.com>
1111
1112         * UnixEndPoint.cs: New property to get and set the filename, like
1113         the IPEndPoint has for the IP address.  Also implement ToString().
1114
1115 Tue Apr 29 16:53:56 CEST 2003 Paolo Molaro <lupus@ximian.com>
1116
1117         * Syscall.cs: remove the unsafe mess.
1118
1119 2003-02-05  Gonzalo Paniagua Javier <gonzalo@ximian.com>
1120
1121         * Check in.
1122         * UnixEndPoint.cs: first file.
1123