updating to the latest module.
[mono.git] / mcs / class / Mono.Posix / Mono.Unix / ChangeLog
1 2005-04-21 Gonzalo Paniagua Javier <gonzalo@ximian.com>
2
3         * UnixClient.cs:
4         * UnixListener.cs: TcpListener/TcpClient clones from Jow Shaw.
5
6 2005-04-21 Gonzalo Paniagua Javier <gonzalo@ximian.com>
7
8         * Mono.Posix.dll.sources: added UnixListener and UnixClient from Joe
9         Shaw.
10
11 2005-04-21 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12
13         * UnixEndPoint.cs: fix from Mono.Posix.
14
15 2005-04-20  Jonathan Pryor <jonpryor@vt.edu>
16
17         * Syscall.cs: Make all fork(2) and exec(2) functions `private`.  It
18           currently isn't safe to call these under *any* circumstances.  See also
19           68141, and this pertinent quote from Butenhof's 
20           "Programming with POSIX Threads", p197, s6.1:
21           
22               "When a threaded process calls fork to create a child process,
23               Pthreads specifies that only the thread calling fork exists in the
24               child. ... Pthreads does not 'terminate' the other threads in a forked
25               process...They simply cease to exist.  ... This is not a problem if
26               the child process is about to call exec to run a new program, but if
27               you use fork to clone a threaded program, beware that you may lose
28               access to memory, especially heap memory stored only as
29               thread-specific data values."
30           
31           Since P/Invoke currently requires using thread local storage, once you
32           fork(2) you won't be able to invoke exec(2) from managed code (since that
33           would require a P/Invoke transition to call exec(2), which would require
34           TLS, which doesn't exist in the new process).
35          
36           This can only be fixed by removing the TLS dependency on P/Invoke, which
37           isn't a priority (and may not be possible).
38          
39           The workaround is to create a C function which does your fork(2)/exec(2)
40           (and any other functions such as daemon(3)) on your behalf, and P/Invoke
41           to call this C function.
42
43 2005-04-18  Jonathan Pryor <jonpryor@vt.edu>
44
45         * Syscall.cs: Update comment specifying which functions belong in Syscall.
46         * UnixConvert.cs: Add XattrFlags conversion functions.
47         * UnixMarshal.cs: Remove warning about self-assignment.
48
49 2005-04-16  Daniel Drake <dsd@gentoo.org>
50
51         * Syscall.cs: Add bindings for extended attribute manipulation
52
53 2005-04-05  Miguel de Icaza  <miguel@novell.com>
54
55         * Syscall.cs: Set entry point for sys_syslog to be syslog.
56         Include the syslog.h header in the generated map so that we
57         actually do the mapping.
58
59 2005-03-28  Jonathan Pryor <jonpryor@vt.edu>
60
61         * UnixConvert.cs: Add ToFopenMode() methods, which convert FileMode/FileAccess
62           into an fopen(3) mode string.  ToOpenFlags() should throw
63           ArgumentOutOfRangeException for argument violations.
64         * StdioFileStream.cs: Add constructor overloads accepting filename and
65           FileMode/FileAccess overloads; Compatibility fixes with regression tests;
66           remove IDisposable implementation since System.IO.Stream already
67           implements it (which calls Close() for us).
68
69 2005-03-17  Jonathan Pryor <jonpryor@vt.edu>
70
71         * Stdlib.cs: Move Errno-related functionality into Stdlib from Syscall,
72           since (1) errno is part of C89, and (2) StdioFileStream will need it, and
73           StdioFileStream shouldn't use Syscall.  Add [UnmanagedFunctionPointer]
74                 attribute to SignalHandler for .NET 2.0 (since signal handlers use C
75                 calling convention, not Stdcall).
76         * Syscall.cs: Move Errno-related functionality into Stdlib.
77         * UnixMarshal.cs: Use ERANGE not EPERM when figuring out appropriate
78           translator, since ERANGE is part of C99 and EPERM isn't.  Use Stdlib
79           instead of Syscall for Errno-related functionality.
80
81 2005-02-02  Jonathan Pryor <jonpryor@vt.edu>
82
83         * UnixFile.cs: Cope with changes in UnixStream.
84         * UnixStream.cs: Change FileDescriptor property to Handle for consistency.
85         * StdioFileStream.cs: Change FileStream property to Handle for consistency.
86
87 2005-02-02  Jonathan Pryor <jonpryor@vt.edu>
88
89         * Syscall.cs: Remove public sys_ methods.  Some were public by mistake, and
90           others so that users could manually marshal strings if desired.  Manually
91           marshaling strings shouldn't be necessary, though, so remove them too.
92
93 2005-02-02  Jonathan Pryor <jonpryor@vt.edu>
94
95         * StdioFileStream.cs: Fix Length property to actually return the size of the
96           file, not the # of bytes from the current position to EOF.  Oops.
97
98 2005-01-31  Jonathan Pryor <jonpryor@vt.edu>
99
100         * Stdlib.cs: Import "msvcrt", not "libc".  These members are part of the
101           ANSI C standard, and thus should be present on Windows via msvcrt.dll
102           (except snprintf, until they catch up to C99).  Change the calling
103           convention of all functions to Cdecl, as the .NET default is Stdcall.
104           Changing the calling convention isn't needed in Syscall, as it can only be
105           run on Unix platforms anyway, where the default is Cdecl.
106         * Syscall.cs: Add LIBC member that points to the real "libc"; we can't use
107           the imported definition from Stdlib as "msvcrt" doesn't exist on Unix.
108
109 2005-01-29  Jonathan Pryor <jonpryor@vt.edu>
110
111         * Stdlib.cs: sys_* functions shouldn't be public.
112
113 2005-01-13  Jonathan Pryor <jonpryor@vt.edu>
114
115         * make-map.cs: libMonoPosixHelper exports Mono_Posix prefixes, not Mono_Unix
116           prefixes, so change the type and namespace to generate compatible code.
117         * Syscall.cs: Change OpenFlags values so they match the Linux values.
118
119 2005-01-13  Jonathan Pryor <jonpryor@vt.edu>
120
121         * Stdlib.cs: Use Stdlib.LIBC instead of "libc".
122         * StdioFileStream.cs: Add FilePosition property (not that I expect anyone to
123           use it) and Rewind() method.
124
125 2005-01-05  Jonathan Pryor <jonpryor@vt.edu>
126
127         * StdioFileStream.cs: Added; System.IO.Stream wrapper for C FILE struct.
128         * Stdlib.cs: Correct visibility of ftell().
129
130 2005-01-05  Jonathan Pryor <jonpryor@vt.edu>
131
132         * Stdlib.cs: Re-order declarations to match the order used in the 
133           C99 Standard Annex B; Complete <stdio.h> exports (except for those not
134           worth supporting); Add non-"unsafe" versions of fread(3), fwrite(3) and
135           add some rudimentary buffer-overflow checking; Add <stdlib.h> exports such
136           as getenv(3), exit(3), rand(3), EXIT_SUCCESS, RAND_MAX, etc.
137
138 2005-01-03  Jonathan Pryor <jonpryor@vt.edu>
139
140         * Syscall.cs: Update endfsent() and setfsent() declarations, as these must
141           now be implemented in MonoPosixHelper.
142
143 2005-01-01  Jonathan Pryor <jonpryor@vt.edu>
144
145         * Stdlib.cs, Syscall.cs: Minimize duplicate declarations of
146           "MonoPosixHelper" for use in DllImport statements.
147
148 2005-01-01  Jonathan Pryor <jonpryor@vt.edu>
149
150         * Stdlib.cs: Don't use C# v2 features; fixes build under CSC.EXE.
151
152 2004-12-30  Jonathan Pryor <jonpryor@vt.edu>
153
154         * Stdlib.cs: On miguel's suggestion, rename Sighandler_t to SignalHandler.
155
156 2004-12-30  Jonathan Pryor <jonpryor@vt.edu>
157
158         * Stdlib.cs: Implement all C89 <stdio.h> functions except for the scanf(3)
159           family.  These are too dangerous to expose.
160
161 2004-12-30  Jonathan Pryor <jonpryor@vt.edu>
162
163         * CdeclFunctions.cs: Remove warning about unused variable.
164         * Stdlib.cs: Make signal(2) sane and (hopefully) complete.
165         * Syscall.cs: Fix cuserid Obsolete message to reference correct class name.
166         * UnixProcess.cs: Remove warning about unused variable.
167         * UnixMarshal.cs: Remove warnings about unused variables.
168
169 2004-12-29  Jonathan Pryor <jonpryor@vt.edu>
170
171         * UnixPath.cs: Add ReadSymbolicLink(), which takes an intelligent approach
172           to reading symlinks (since their contents may be any size, we grow the
173           buffer dynamically to fit them all, instead of assuming a maximum size).
174         * UnixSymbolicLinkInfo.cs: Remove MaxContentsSize.
175
176 2004-12-29  Jonathan Pryor <jonpryor@vt.edu>
177
178         * UnixPath.cs: Add check for when symlink points to a full path name.
179
180 2004-12-29  Jonathan Pryor <jonpryor@vt.edu>
181
182         * Syscall.cs: Fix Object.Equals implementations.
183         * UnixPath.cs: New & improved, with Testing!  GetRealPath() is changed so
184           that it doesn't walk the entire path looking for symlinks, it just reads 
185           the leaf.  GetCompletRealPath() walks the entire path resolving symlinks.
186           GetCanonicalPath() added, which "cleans up" a path (removing extraneous
187           "." and ".." entries).
188         * UnixSymbolicLinkInfo.cs: Rename ContentsLength -> MaxContentsSize.
189
190 2004-12-28  Jonathan Pryor <jonpryor@vt.edu>
191
192         * UnixFileSystemInfo.cs: Add a link(2) wrapper, CreateLink().  Strictly
193           speaking it's only "safe" to do this on files, but an exception will be 
194           returned if the user tries to hard link directories (because of EPERM), 
195           unless the user is root, in which case it should be allowed anyway...
196
197 2004-12-28  Jonathan Pryor <jonpryor@vt.edu>
198
199         * CdeclFunctions.cs: Correct the comments for AMD64
200         * UnixDirectoryInfo.cs: override Name; add Parent & Root properties; 
201           Correct Path usage (s/Path/FullPath/g).
202         * UnixDriveInfo.cs: Added.  Based on .NET 2.0 System.IO.DriveInfo docs,
203           provides statvfs(2) and getfsfile(3) information about a mounted volume.
204           GetDrives() wraps getfsent(3), thus parsing /etc/fstab.
205         * UnixFile.cs: Use UnixConver.ToOpenFlags, deleting the local version.
206         * UnixFileInfo.cs: Use UnixConver.ToOpenFlags, deleting the local version;
207           override Name; add DirectoryName and Directory properties; 
208         * UnixFileSystemInfo.cs: Make more .NET-like, using FullPath and
209           OriginalPath protected members, abstract Name property; Add
210           CreateSymbolicLink; Remove ReadLink (it's now 
211           UnixSymbolicLinkInfo.Contents); Use lstat(2) for Create(string), so we
212           properly detect Symbolic Links.
213         * UnixPath.cs: Added; Path manipulation utility functions.
214         * UnixSymbolicLinkInfo.cs: 
215           - Seal the class; 
216           - override new abstract member Name; 
217           - rename ReadLink to ContentsPath (and Contents) properties 
218             (why "Contents"?  Because readlink(2) says "readlink places the 
219             contents of the symbolic link in the buffer...")
220           - Add CreateSymbolicLinkTo(), which creates a symlink to the specified
221             "normal" file
222
223 2004-12-28  Jonathan Pryor <jonpryor@vt.edu>
224
225         * Stdlib.cs: Add syslog(3) to XPrintfFunctions; Add additional printf(3) 
226           and fprintf(3) overload which properly escape the format string 
227           (by using "%s" as the format for the user-supplied message).
228         * Syscall.cs: Add #regions for enummerations, structures, classes; Wrap
229           syslog(3) and related enumerations; fix operator!= on Dirent, Group; 
230           wrap {f}statvfs(2); wrap <fstab.h> entries (getfsent(3), etc.).
231         * UnixConvert.cs: Add Syslog-releated enumeration translation functions;
232           Move ToOpenFlags here from UnixFile and UnixFileInfo.
233         * UnixMarshal.cs: Missing P/Invoke methods throw
234           EntryPointNotFoundException, not MissingMethodException; add
235           EscapeFormatString, which escapes printf-style format strings so that they
236           can be safely handed off to native code (avoiding stack overflow, etc);
237           make CreateExceptionForError internal.
238
239 2004-12-15  Jonathan Pryor <jonpryor@vt.edu>
240
241         * Stdlib.cs: Add more <stdio.h> wrappers, such as fread(3) and fwrite(3).
242           These will be useful in implementing System.IO.Stream subclass for
243           reading/writing to a FILE*.  Fix a typo in the realloc(3) DllImport.
244         * Syscall.cs: Fix the sys_kill and sys_crypt declarations.
245         * CdeclFunction.cs: Document calling convention problems on AMD64.
246
247 2004-11-18  Jonathan Pryor <jonpryor@vt.edu>
248
249         * CdeclFunction.cs: Added.
250         * Stdlib.cs: Re-add printf(3) and fprintf(3).  They may not be portable (the
251           jury is still out on that; the AMD64 SysV ABI looks like it should be
252           portable to AMD64 to my eyes), but they will work on *some* platforms, so
253           we should permit it.  The new implementation takes a page out of
254           cocoa-sharp: use System.Reflection.Emit to generate a P/Invoke method at
255           runtime to invoke printf(3) or fprintf(3).  This way, we can export a
256           params signature to C# code, permitting natural usage such as:
257               Stdlib.printf ("Hello, %s world! (%i)\n", "silly", 42);
258         * Syscall.cs: Mark which headers are complete, which functions still need
259           wrapping (for headers which have anything done to them), add #region
260           blocks for each header;
261           export mkfifo(3), fexecve(), getppid(2), setlogin(); fix sleep(3) export.
262         * UnixEnvironment.cs: Export a friendly getppid(2) wrapper.
263           GetParentProcessId isn't in UnixProcess as there's no way (that I know of)
264           to get the Parent's Parent, so it can't be a class member, and exposing it
265           as a static member of UnixProcess doesn't make sense to me, as it isn't
266           general.  Added GetUserShells().
267         * UnixProcess.cs: Change constructor to internal, so it can be used from
268           UnixEnvironment.
269
270 2004-11-16  Jonathan Pryor <jonpryor@vt.edu>
271
272         * Stdlib.cs: Remove printf(3) and fprintf(3).  These are vararg/CDECL 
273           functions, and it's not portable to call them in this manner.
274           (It's not portable because some architectures, such as AMD64, use a
275           "cookie" as part of the vararg calling sequence to help reduce buffer
276           overflow exploits.  Trying to call vararg functions as if they were an
277           overloaded function will not properly set this hardware cookie, resulting
278           in a hardware exception.  Talk to lupus for more information.)
279
280 2004-11-16  Jonathan Pryor <jonpryor@vt.edu>
281
282         * Syscall.cs, UnixConvert.cs: Remove mount- and umount-related
283           functionality.  Mount/umount is inherently non-portable (see the C code
284           for mount/umount), and trying to provide a consistent interface is
285           impossible.  If you need mount/umount support, use the command-line
286           programs mount(1) and umount(1).
287
288 2004-11-16  Jonathan Pryor <jonpryor@vt.edu>
289
290         + Lots o' Renames, as the namespace changed.
291         * PosixConvert.cs: Moved to UnixConvert.cs:
292         * PosixDirectory.cs: Moved to UnixDirectory.cs:
293         * PosixEnvironment.cs: Moved to UnixEnvironment.cs:
294         * PosixDirectoryInfo.cs: Moved to UnixDirectoryInfo.cs:
295         * PosixFile.cs: Moved to UnixFile.cs:
296         * PosixFileInfo.cs: Moved to UnixFileInfo.cs:
297         * PosixFileSystemInfo.cs: Moved to UnixFileSystemInfo.cs:
298         * PosixGroup.cs: Moved to UnixGroup.cs:
299         * PosixGroupInfo.cs: Moved to UnixGroupInfo.cs:
300         * PosixIOException.cs: Moved to UnixIOException.cs:
301         * PosixMarshal.cs: Moved to UnixMarshal.cs:
302         * PosixProcess.cs: Moved to UnixProcess.cs:
303         * PosixStream.cs: Moved to UnixStream.cs:
304         * PosixSymbolicLinkInfo.cs: Moved to UnixSymbolicLinkInfo.cs:
305         * PosixUser.cs: Moved to UnixUser.cs:
306         * PosixUserInfo.cs: Moved to UnixUserInfo.cs:
307         * Catalog.cs, IncludeAttribute.cs, MapAttribute.cs, PeerCred.cs, Stdlib.cs,
308           Syscall.cs, UnixConvert.cs, UnixDirectory.cs, UnixDirectoryInfo.cs,
309           UnixEndPoint.cs, UnixEnvironment.cs, UnixFile.cs, UnixFileInfo.cs,
310           UnixFileSystemInfo.cs, UnixGroup.cs, UnixGroupInfo.cs, UnixIOException.cs,
311           UnixMarshal.cs, UnixProcess.cs, UnixStream.cs, UnixSymbolicLinkInfo.cs,
312           UnixUser.cs, UnixUserInfo.cs: Deal with renamed classes/members.
313
314 2004-11-15  Jonathan Pryor <jonpryor@vt.edu>
315
316         * PosixUserInfo.cs: Make the PosixUserInfo(Passwd) constructor public;
317           override Object.GetHashCode and Object.Equals.
318         * PosixGroupInfo.cs: Make the PosixGroupInfo(Group) constructor public;
319           override Object.GetHashCode and Object.Equals.
320         * PosixIOException.cs: Use PosixMarshal.GetErrorDescription instead of
321           calling Syscall.strerror_r directly
322         * PosixMarshal.cs: Add GetErrorDescription.  Strerror_r() isn't portable, so
323           GetErrorDescription() first tries strerror_r(), and if it fails falls back
324           to strerror(3).
325         * Syscall.cs: 
326           - Seal the Dirent class.  It has no virtual members, so there's no point 
327       in it being non-sealed.  Override Object.GetHashCode and Object.Equals.
328           - Seal the Group class.  It has no virtual members, so there's no point 
329       in it being non-sealed.  Override Object.GetHashCode and Object.Equals.
330             Provide operator== and operator!=.
331           - Seal the Passwd class.  It has no virtual members, so there's no point 
332       in it being non-sealed.  Override Object.GetHashCode and Object.Equals.
333             Provide operator== and operator!=.
334           - Remove strerror_r() convenience overload.  This is now
335             PosixMarshal.GetErrorDescription().
336
337 2004-11-12  Jonathan Pryor <jonpryor@vt.edu>
338
339         * Syscall.cs: Export time-related functions (gettimeofday, settimeofday,
340           utime, utimes), mknod.
341
342 2004-11-07  Atsushi Enomoto  <atsushi@ximian.com>
343
344         * PosixEnvironment.cs : csc build fix. see bug #69195.
345         * PosixStream.cs : csc build fix. see bug #69196.
346
347 2004-11-05  Jonathan Pryor  <jonpryor@vt.edu>
348
349         * PosixConvert.cs: New file; conversion functions for Mono.Posix types.
350         * PosixDirectory.cs: New file; Friendly wrapper over directory information.
351         * PosixDirectoryInfo.cs: New file; Friendly wrapper over directory information.
352         * PosixEnvironment.cs: New file; Friendly wrapper over environment information.
353         * PosixFile.cs: New file; Friendly wrapper over file information.
354         * PosixFileInfo.cs: New file; Friendly wrapper over file information.
355         * PosixFileSystemInfo.cs: New file; Friendly wrapper over `stat'.
356         * PosixGroup.cs: New file; User Group-related functionality
357         * PosixGroupInfo.cs: New file; User Group-related functionality
358         * PosixIOException.cs: New file; Exception for POSIX-generated exceptions.
359         * PosixMarshal.cs: New file; utility functions for marshaling, etc.
360         * PosixProcess.cs: New file; Friendly wrapper over process information.
361         * PosixStream.cs: New file; Friendly wrapper over file descriptors.
362         * PosixSymbolicLinkInfo.cs: New file; Friendly wrapper over symbolic links.
363         * PosixUser.cs: New file; Friendly wrapper over user information.
364         * PosixUserInfo.cs: New file; Friendly wrapper over user information.
365         * Stdlib.cs: New file; C standard library exports.
366         * Syscall.cs: Effective re-write.  
367           - Organize exports by header file
368           - add additional enumerations (Error for the E* error values, etc.)
369           - always explicitly specify enumeration underlying type
370           - Use a new wrapping infrastructure so that ABI-stable types are exported
371                 - For example, size_t is exported as ulong, not IntPtr.
372           - Wrap more functions, and wrap them better (such as getpwnam).
373           - This release is NOT backward compatible.  Many names are the same, and
374             hopefully they're still compatible, but no effort was made to maintain
375             compatibility.  For example, FileMode was removed and replaced with
376             FilePermissions, to avoid a name conflict with System.IO.FileMode.
377                 - Change umount() to use MonoPosixHelper: portability fix for Mac OS X.
378         * make-map.cs: Another effective re-write, to clean up the code, produce
379           better output, and produce more output.  For example, most of
380           PosixConvert can be auto-generated, so it is (modulo version delays and
381           bootstrap issues).  `map.c' is now conditional on all macros, and has
382           error checking for invalid/unsupported values.
383
384 2004-09-18  Jackson Harper  <jackson@ximian.com>
385
386         * Syscall.cs: Add support for poll ().
387
388 2004-09-18  Jackson Harper  <jackson@ximian.com>
389
390         * make-map.cs: Use field value not name for #defines.
391                 
392 2004-09-14  Loren Bandiera <lorenb@mmgsecurity.com>
393
394         * Syscall.cs: Added method for getpwnam which uses Passwd
395         struct.
396         * macros.c: Helper function for getpwnam
397         (In committing, Josh Tauberer also added getpwuid.)
398
399 2004-07-09  Dick Porter  <dick@ximian.com>
400
401         * PeerCred.cs: Get the unix socket peer credentials.
402
403 2004-05-26  Miguel de Icaza  <miguel@ximian.com>
404
405         * Syscall.cs: Do not let the runtime handle strings, as we do not
406         own those strings, we must transform the char * into a string
407         ourselves. 
408
409 2004-05-03  Miguel de Icaza  <miguel@ximian.com>
410
411         * Syscall.cs: Add symlink
412
413 2004-04-19  Miguel de Icaza  <miguel@ximian.com>
414
415         * Syscall.cs: Use hex values for FileMode, since C# does not have
416         an octal integer mode.
417
418 2004-03-30  Joshua Tauberer <tauberer@for.net>
419
420         * Added readlink, strerror, opendir, readdir, closedir
421         * Added Mono.Posix.Stat.UnixToDateTime(long unixtime) --> DateTime
422
423 2004-03-11  Joshua Tauberer <tauberer@for.net>
424
425         * Syscall.cs: Removed argument to getgid that shouldn't be there.
426                 Added getusername, getgroupname which wrap getpwuid, getgrgid
427                 without dealing with pointers to structures.
428                 Removed duplicate FileMode enum nested in Syscall class.
429                 Added stat and lstat, which use StatMode enumeration
430                 (like FileMode but nicer and complete) and Stat struct.
431         * macros.c: Helper functions for getpwuid, getgrgid, stat, lstat.
432
433 2004-01-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
434
435         * Syscall.cs: moved the assembly attribute to a proper place
436         and added 'signal.h'
437         * make-map.cs: use reflection to invoke the properties, as it
438         fails under MS runtime.
439         
440
441 2004-01-05  Gonzalo Paniagua Javier <gonzalo@ximian.com>
442
443         * Syscall.cs: moved assembly attribute and added unsafe block to fix
444         the build on windows.
445
446 2003-11-11  Wojciech Polak <polak@gnu.org
447
448         * Syscall.cs: Applied patch from Wojciech Polak <polak@gnu.org> to
449         support IsAtty.
450
451 2003-05-16  Dick Porter  <dick@ximian.com>
452
453         * UnixEndPoint.cs: New property to get and set the filename, like
454         the IPEndPoint has for the IP address.  Also implement ToString().
455
456 Tue Apr 29 16:53:56 CEST 2003 Paolo Molaro <lupus@ximian.com>
457
458         * Syscall.cs: remove the unsafe mess.
459
460 2003-02-05  Gonzalo Paniagua Javier <gonzalo@ximian.com>
461
462         * Check in.
463         * UnixEndPoint.cs: first file.
464