* Syscall.cs: The Statvfs structure should contain a MountFlags enumeration,
[mono.git] / mcs / class / Mono.Posix / Mono.Unix / ChangeLog
index c99b833f455ee7a42d59243e49a10c1948c1aaac..34ec5cb9f12fa8d7d9153e4b26cf01e0d3966e30 100644 (file)
@@ -1,3 +1,259 @@
+2005-05-12  Jonathan Pryor <jonpryor@vt.edu>
+
+       * Syscall.cs: The Statvfs structure should contain a MountFlags enumeration,
+         not a ulong (we can "safely" do this since POSIX defines some values for
+         f_flag, so we should be kind and expose them).
+       * UnixConvert.cs: Add MountFlags conversion functions.
+
+2005-05-02  Joe Shaw  <joeshaw@novell.com>
+
+       * UnixListener.cs (Init): Remove the call to Cleanup() and the
+       method itself, which was not supposed to be here.  We try to
+       connect to the socket if it exists instead of deleting it
+       undconditionally.
+
+2005-04-30  Ben Maurer  <bmaurer@ximian.com>
+
+       * Stdlib.cs: Comment out usage of `UnmanagedFunctionPointer'. It
+       isn't supported in the runtime -- it throws an assert -- so better
+       not to use it at all for now.
+
+2005-04-29  Jonathan Pryor <jonpryor@vt.edu>
+
+       * UnixConvert.cs: Fix time_t -> DateTime conversions.  time_t should be
+         assumed to be in the local time zone, so don't mess with UTC shifts.
+         This allows Mono.Unix to produce sane output (e.g. identical to ls(1) or
+         stat(1), instead of several hours different).
+
+2005-04-29  Jonathan Pryor <jonpryor@vt.edu>
+
+       * Stdlib.cs: Make FilePosition slightly more useful by providing a
+         ToString() override which dumps the fpos_t structure contents into a 
+         hex string.  Add Equals(), GetHashCode(), operator==, and operator!=
+         so FilePosition behaves like a value type.
+
+2005-04-21 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+       * UnixClient.cs:
+       * UnixListener.cs: TcpListener/TcpClient clones from Jow Shaw.
+
+2005-04-21 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+       * Mono.Posix.dll.sources: added UnixListener and UnixClient from Joe
+       Shaw.
+
+2005-04-21 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+       * UnixEndPoint.cs: fix from Mono.Posix.
+
+2005-04-20  Jonathan Pryor <jonpryor@vt.edu>
+
+       * Syscall.cs: Make all fork(2) and exec(2) functions `private`.  It
+         currently isn't safe to call these under *any* circumstances.  See also
+         68141, and this pertinent quote from Butenhof's 
+         "Programming with POSIX Threads", p197, s6.1:
+         
+             "When a threaded process calls fork to create a child process,
+             Pthreads specifies that only the thread calling fork exists in the
+             child. ... Pthreads does not 'terminate' the other threads in a forked
+             process...They simply cease to exist.  ... This is not a problem if
+             the child process is about to call exec to run a new program, but if
+             you use fork to clone a threaded program, beware that you may lose
+             access to memory, especially heap memory stored only as
+             thread-specific data values."
+         
+         Since P/Invoke currently requires using thread local storage, once you
+         fork(2) you won't be able to invoke exec(2) from managed code (since that
+         would require a P/Invoke transition to call exec(2), which would require
+         TLS, which doesn't exist in the new process).
+        
+         This can only be fixed by removing the TLS dependency on P/Invoke, which
+         isn't a priority (and may not be possible).
+        
+         The workaround is to create a C function which does your fork(2)/exec(2)
+         (and any other functions such as daemon(3)) on your behalf, and P/Invoke
+         to call this C function.
+
+2005-04-18  Jonathan Pryor <jonpryor@vt.edu>
+
+       * Syscall.cs: Update comment specifying which functions belong in Syscall.
+       * UnixConvert.cs: Add XattrFlags conversion functions.
+       * UnixMarshal.cs: Remove warning about self-assignment.
+
+2005-04-16  Daniel Drake <dsd@gentoo.org>
+
+       * Syscall.cs: Add bindings for extended attribute manipulation
+
+2005-04-05  Miguel de Icaza  <miguel@novell.com>
+
+       * Syscall.cs: Set entry point for sys_syslog to be syslog.
+       Include the syslog.h header in the generated map so that we
+       actually do the mapping.
+
+2005-03-28  Jonathan Pryor <jonpryor@vt.edu>
+
+       * UnixConvert.cs: Add ToFopenMode() methods, which convert FileMode/FileAccess
+         into an fopen(3) mode string.  ToOpenFlags() should throw
+         ArgumentOutOfRangeException for argument violations.
+       * StdioFileStream.cs: Add constructor overloads accepting filename and
+         FileMode/FileAccess overloads; Compatibility fixes with regression tests;
+         remove IDisposable implementation since System.IO.Stream already
+         implements it (which calls Close() for us).
+
+2005-03-17  Jonathan Pryor <jonpryor@vt.edu>
+
+       * Stdlib.cs: Move Errno-related functionality into Stdlib from Syscall,
+         since (1) errno is part of C89, and (2) StdioFileStream will need it, and
+         StdioFileStream shouldn't use Syscall.  Add [UnmanagedFunctionPointer]
+               attribute to SignalHandler for .NET 2.0 (since signal handlers use C
+               calling convention, not Stdcall).
+       * Syscall.cs: Move Errno-related functionality into Stdlib.
+       * UnixMarshal.cs: Use ERANGE not EPERM when figuring out appropriate
+         translator, since ERANGE is part of C99 and EPERM isn't.  Use Stdlib
+         instead of Syscall for Errno-related functionality.
+
+2005-02-02  Jonathan Pryor <jonpryor@vt.edu>
+
+       * UnixFile.cs: Cope with changes in UnixStream.
+       * UnixStream.cs: Change FileDescriptor property to Handle for consistency.
+       * StdioFileStream.cs: Change FileStream property to Handle for consistency.
+
+2005-02-02  Jonathan Pryor <jonpryor@vt.edu>
+
+       * Syscall.cs: Remove public sys_ methods.  Some were public by mistake, and
+         others so that users could manually marshal strings if desired.  Manually
+         marshaling strings shouldn't be necessary, though, so remove them too.
+
+2005-02-02  Jonathan Pryor <jonpryor@vt.edu>
+
+       * StdioFileStream.cs: Fix Length property to actually return the size of the
+         file, not the # of bytes from the current position to EOF.  Oops.
+
+2005-01-31  Jonathan Pryor <jonpryor@vt.edu>
+
+       * Stdlib.cs: Import "msvcrt", not "libc".  These members are part of the
+         ANSI C standard, and thus should be present on Windows via msvcrt.dll
+         (except snprintf, until they catch up to C99).  Change the calling
+         convention of all functions to Cdecl, as the .NET default is Stdcall.
+         Changing the calling convention isn't needed in Syscall, as it can only be
+         run on Unix platforms anyway, where the default is Cdecl.
+       * Syscall.cs: Add LIBC member that points to the real "libc"; we can't use
+         the imported definition from Stdlib as "msvcrt" doesn't exist on Unix.
+
+2005-01-29  Jonathan Pryor <jonpryor@vt.edu>
+
+       * Stdlib.cs: sys_* functions shouldn't be public.
+
+2005-01-13  Jonathan Pryor <jonpryor@vt.edu>
+
+       * make-map.cs: libMonoPosixHelper exports Mono_Posix prefixes, not Mono_Unix
+         prefixes, so change the type and namespace to generate compatible code.
+       * Syscall.cs: Change OpenFlags values so they match the Linux values.
+
+2005-01-13  Jonathan Pryor <jonpryor@vt.edu>
+
+       * Stdlib.cs: Use Stdlib.LIBC instead of "libc".
+       * StdioFileStream.cs: Add FilePosition property (not that I expect anyone to
+         use it) and Rewind() method.
+
+2005-01-05  Jonathan Pryor <jonpryor@vt.edu>
+
+       * StdioFileStream.cs: Added; System.IO.Stream wrapper for C FILE struct.
+       * Stdlib.cs: Correct visibility of ftell().
+
+2005-01-05  Jonathan Pryor <jonpryor@vt.edu>
+
+       * Stdlib.cs: Re-order declarations to match the order used in the 
+         C99 Standard Annex B; Complete <stdio.h> exports (except for those not
+         worth supporting); Add non-"unsafe" versions of fread(3), fwrite(3) and
+         add some rudimentary buffer-overflow checking; Add <stdlib.h> exports such
+         as getenv(3), exit(3), rand(3), EXIT_SUCCESS, RAND_MAX, etc.
+
+2005-01-03  Jonathan Pryor <jonpryor@vt.edu>
+
+       * Syscall.cs: Update endfsent() and setfsent() declarations, as these must
+         now be implemented in MonoPosixHelper.
+
+2005-01-01  Jonathan Pryor <jonpryor@vt.edu>
+
+       * Stdlib.cs, Syscall.cs: Minimize duplicate declarations of
+         "MonoPosixHelper" for use in DllImport statements.
+
+2005-01-01  Jonathan Pryor <jonpryor@vt.edu>
+
+       * Stdlib.cs: Don't use C# v2 features; fixes build under CSC.EXE.
+
+2004-12-30  Jonathan Pryor <jonpryor@vt.edu>
+
+       * Stdlib.cs: On miguel's suggestion, rename Sighandler_t to SignalHandler.
+
+2004-12-30  Jonathan Pryor <jonpryor@vt.edu>
+
+       * Stdlib.cs: Implement all C89 <stdio.h> functions except for the scanf(3)
+         family.  These are too dangerous to expose.
+
+2004-12-30  Jonathan Pryor <jonpryor@vt.edu>
+
+       * CdeclFunctions.cs: Remove warning about unused variable.
+       * Stdlib.cs: Make signal(2) sane and (hopefully) complete.
+       * Syscall.cs: Fix cuserid Obsolete message to reference correct class name.
+       * UnixProcess.cs: Remove warning about unused variable.
+       * UnixMarshal.cs: Remove warnings about unused variables.
+
+2004-12-29  Jonathan Pryor <jonpryor@vt.edu>
+
+       * UnixPath.cs: Add ReadSymbolicLink(), which takes an intelligent approach
+         to reading symlinks (since their contents may be any size, we grow the
+         buffer dynamically to fit them all, instead of assuming a maximum size).
+       * UnixSymbolicLinkInfo.cs: Remove MaxContentsSize.
+
+2004-12-29  Jonathan Pryor <jonpryor@vt.edu>
+
+       * UnixPath.cs: Add check for when symlink points to a full path name.
+
+2004-12-29  Jonathan Pryor <jonpryor@vt.edu>
+
+       * Syscall.cs: Fix Object.Equals implementations.
+       * UnixPath.cs: New & improved, with Testing!  GetRealPath() is changed so
+         that it doesn't walk the entire path looking for symlinks, it just reads 
+         the leaf.  GetCompletRealPath() walks the entire path resolving symlinks.
+         GetCanonicalPath() added, which "cleans up" a path (removing extraneous
+         "." and ".." entries).
+       * UnixSymbolicLinkInfo.cs: Rename ContentsLength -> MaxContentsSize.
+
+2004-12-28  Jonathan Pryor <jonpryor@vt.edu>
+
+       * UnixFileSystemInfo.cs: Add a link(2) wrapper, CreateLink().  Strictly
+         speaking it's only "safe" to do this on files, but an exception will be 
+         returned if the user tries to hard link directories (because of EPERM), 
+         unless the user is root, in which case it should be allowed anyway...
+
+2004-12-28  Jonathan Pryor <jonpryor@vt.edu>
+
+       * CdeclFunctions.cs: Correct the comments for AMD64
+       * UnixDirectoryInfo.cs: override Name; add Parent & Root properties; 
+         Correct Path usage (s/Path/FullPath/g).
+       * UnixDriveInfo.cs: Added.  Based on .NET 2.0 System.IO.DriveInfo docs,
+         provides statvfs(2) and getfsfile(3) information about a mounted volume.
+         GetDrives() wraps getfsent(3), thus parsing /etc/fstab.
+       * UnixFile.cs: Use UnixConver.ToOpenFlags, deleting the local version.
+       * UnixFileInfo.cs: Use UnixConver.ToOpenFlags, deleting the local version;
+         override Name; add DirectoryName and Directory properties; 
+       * UnixFileSystemInfo.cs: Make more .NET-like, using FullPath and
+         OriginalPath protected members, abstract Name property; Add
+         CreateSymbolicLink; Remove ReadLink (it's now 
+         UnixSymbolicLinkInfo.Contents); Use lstat(2) for Create(string), so we
+         properly detect Symbolic Links.
+       * UnixPath.cs: Added; Path manipulation utility functions.
+       * UnixSymbolicLinkInfo.cs: 
+         - Seal the class; 
+         - override new abstract member Name; 
+         - rename ReadLink to ContentsPath (and Contents) properties 
+           (why "Contents"?  Because readlink(2) says "readlink places the 
+           contents of the symbolic link in the buffer...")
+         - Add CreateSymbolicLinkTo(), which creates a symlink to the specified
+           "normal" file
+
 2004-12-28  Jonathan Pryor <jonpryor@vt.edu>
 
        * Stdlib.cs: Add syslog(3) to XPrintfFunctions; Add additional printf(3)