2005-04-12 Dick Porter <dick@ximian.com>
[mono.git] / mono / io-layer / ChangeLog
index 100f96b370e048850bc95da563c7ae81a74f943c..e2efd70f9266e38db7898b4de34a5962b2ebc13c 100644 (file)
@@ -1,3 +1,412 @@
+2005-04-12  Dick Porter  <dick@ximian.com>
+       
+       The daemon-less io-layer.  Extensive lowlevel changes in
+       handles.c, requiring some corresponding changes in other files
+       calling these functions.  Private_foo structures have been
+       eliminated.
+
+       File descriptor handling differences account for most of the
+       changes in io.c and sockets.c.
+
+       Other highlights:
+       
+       * mutexes.c: Named mutexes are now a distinct type.
+       * atomic.h: Fix a PPC uninitialised variable warning.
+       * wait.c: Check conditions before waiting on a condition variable.
+       * processes.c: Handle process fork and wait without a daemon
+       (though this has the limitation of only being able to wait for
+       child processes.)
+
+2005-04-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+       * io-private.h:
+       * threads.c:
+       * threads.h:
+       * io.c:
+       * sockets.c:
+       * sockets.h: removed dead code that deals with async IO.
+
+2005-03-30  Zoltan Varga  <vargaz@freemail.hu>
+
+       * atomic.c (InterlockedIncrement): Fix fallback implementation of
+       InterlockedIncrement and InterlockedDecrement. Fixes #74228.
+
+2005-03-29  Sebastien Pouliot  <sebastien@ximian.com>
+
+       * io-layer.h: Add required header files for compiling with VS.NET.
+
+2005-03-17 Miguel de Icaza <miguel@novell.com>
+
+       * io.c: don't fail on NFS when there are no more locks available.
+
+2005-03-09  Dick Porter  <dick@ximian.com>
+
+       * error.c (_wapi_get_win32_file_error): ENFILE and EMFILE should
+       map to ERROR_TOO_MANY_OPEN_FILES, not ERROR_NO_MORE_FILES.  Fixes
+       bug 72671.
+
+2005-03-09  Dick Porter  <dick@ximian.com>
+
+       * daemon.c (process_process_fork): Initialise the handle data
+       before using it in the error case.  This is probably the error
+       we're working around in the previous change.  Spotted by Taru Jain
+       <tjain@novell.com> and Hemanth Yamijala <YHemanth@novell.com>.
+
+2005-03-07  Dick Porter  <dick@ximian.com>
+
+       * daemon.c: It looks like g_shell_parse_argv() can return
+       argv[0]=NULL somehow, yet still not give an error.  Make sure we
+       don't pass NULL to strrchr(), working around a segfault that
+       showed up on ZLM testing.
+
+2005-03-01 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+       * sockets.c: translate EINPROGRESS to EWOULDBLOCK in connect. This is
+       the expected error code showed by the test case in bug #73053.
+
+2005-02-18 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+       * io.c: another leftover.
+
+Fri Feb 18 17:37:29 CET 2005 Paolo Molaro <lupus@ximian.com>
+
+       * io.c: fixed logic in checking errno in rev 40815.
+
+Fri Feb 18 16:00:29 CET 2005 Paolo Molaro <lupus@ximian.com>
+
+       * threads.c: we don't depend on the GC checking tls
+       slots anymore.
+       * processes.c: remove unused ref to GC headers.
+
+Thu Feb 17 19:57:11 CET 2005 Paolo Molaro <lupus@ximian.com>
+
+       * io.c: remove _wapi_thread_cur_apc_pending () checks
+       when the siscall should return immediatly and handle
+       the case when a syscall is interrupted without
+       erroring out, but returning a 0 read/write if possible.
+       Still the cases of read from file need to be handled.
+
+Tue Feb 8 18:28:11 CET 2005 Paolo Molaro <lupus@ximian.com>
+
+       * threads.c: make people test with 1 MB stack per thread.
+
+2005-01-17  Dick Porter  <dick@ximian.com>
+
+       * timefuncs.h: Make WapiFileTime endian-aware, as it's often
+       cast to and from 64bit ints.  Fixes bug 71213.
+
+2005-01-11  Dick Porter  <dick@ximian.com>
+
+       * error.c (errno_to_WSA): Add EADDRNOTAVAIL error code
+       translation.
+
+Mon Jan 10 16:15:19 EST 2005 Neale Ferguson <nealeferguson@earthlink.net>
+
+       * atomic.h: Fix functions on s390.
+
+Mon Jan 10 20:30:19 CET 2005 Paolo Molaro <lupus@ximian.com>
+
+       * atomic.h: fix some functions on ppc (tests/interlocked.cs).
+
+2005-01-10  Dick Porter  <dick@ximian.com>
+
+       * misc.c (_wapi_calc_timeout): Guard against overflow when
+       calculating timeouts.  This makes waiting with a large
+       (Int32.MaxValue) timeout not return immediately.
+
+2004-12-23  Ben Maurer  <bmaurer@ximian.com>
+
+       * io.c (io_ops): make this `const' so it is shareable (well, only
+       really shareable if it is statically linked...)
+
+Mon Dec 20 11:58:33 CET 2004 Paolo Molaro <lupus@ximian.com>
+
+       * threads.c, threads.h: add accessor to get the pthread_key_t for
+       a tls id.
+
+2004-12-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+       * io.c: check for the existence of 'dest' and set ERROR_ALREADY_EXISTS
+       if it exists and is not the same as 'src'.
+
+2004-12-01 Neale Ferguson <Neale.Ferguson@SoftwareAG-usa.com>
+
+       * atomic.h : Fix InterlockedCompareExchange for s390/s390x.
+
+2004-12-01 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+       * processes.c: unquote the cmd path, allow for ' or " when quoting and
+       pass the quoted program name to the daemon, otherwise the call to
+       g_shell_unquote in the daemon will break things up.
+
+2004-10-14  Dick Porter  <dick@ximian.com>
+
+       * sockets.c (_wapi_accept): Revert the previous change.  We now
+       set the accepted socket to have the same blocking status as the
+       listening socket in managed code.  This follows MS behaviour.
+       
+2004-10-14  Dick Porter  <dick@ximian.com>
+
+       * sockets.c (_wapi_accept): On Darwin, make sure a newly
+       accept()ed socket is blocking.  Fixes bug 67355, patch by
+       grompf@sublimeintervention.com.
+
+2004-10-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+       * system.c: check the number of online processors instead of the
+       existing ones. Sanitize return value if it's an error.
+
+2004-10-03 Ben Maurer  <bmaurer@ximian.com>
+
+       * system.c: Add support for getting the # of cpus.
+
+2004-09-28  Dick Porter  <dick@ximian.com>
+
+       * io.c (pipe_close_private): Fix one small typo in the last change
+       that totally hosed process creation with redirected pipes.
+
+2004-09-24  Dick Porter  <dick@ximian.com>
+
+       * wapi-private.h: 
+       * sockets.c: 
+       * socket-private.h: 
+       * io.c: 
+       * io-private.h: 
+       * handles-private.h: Cope when a file descriptor is reused while
+       the handle that thought it owned it is still referenced, instead
+       of asserting.  Probably fixes bug 66479, though we've been unable
+       to reproduce it.
+
+2004-09-09  Dick Porter  <dick@ximian.com>
+
+       * error.c:
+       * io.c: Set error codes everywhere.
+
+2004-09-06  Dick Porter  <dick@ximian.com>
+
+       * handles.c (_wapi_handle_unref): Reset the private record's type
+       (CloseHandle): Check for a fd mapping failure, and return FALSE.
+       (_wapi_handle_process_fork): Fix long-standing bug in checking
+       handle return values.  Also do the required bookkeeping with the
+       new process's handles.
+
+       * daemon.c: When creating a new process's handles, check whether
+       the shared space needs to be increased
+
+2004-09-05  Zoltan Varga  <vargaz@freemail.hu>
+
+       * shared.c (_wapi_shm_file): Fix leaking of filename.
+
+2004-08-19  Dick Porter  <dick@ximian.com>
+
+       * handles.c (_wapi_handle_count_signalled_handles): Fix thinko
+       introduced with the fd offset stuff: unlock handles properly when
+       backing off.  Fixes the monologue hang at exit.
+
+2004-08-18  Dick Porter  <dick@ximian.com>
+
+       * sockets.c: 
+       * io.c: Check that new fds fit in the table, return error if not
+
+       * daemon.c (_wapi_daemon_main): 
+       * handles.c (shared_init): Have all processes agree on a size for
+       the fd table.
+
+2004-08-17  Dick Porter  <dick@ximian.com>
+
+       * daemon.c (process_new): 
+       * handles.c (_wapi_handle_new_internal): Cope when the space
+       reserved for file descriptors is larger than the shared segment
+       size.  Fixes the crash reported when running mono under gdb on
+       macosx.
+
+2004-08-16  Dick Porter  <dick@ximian.com>
+
+       * sockets.c:
+       * io.c:
+       * handles-private.h (_wapi_handle_fd_offset_to_handle): Improve
+       error checking with passed-in file descriptors.
+
+2004-08-11  Dick Porter  <dick@ximian.com>
+
+       * sockets.c: 
+       * io.c: Returned handle values are the file descriptor the handle
+       encapsulates
+
+       * handles.c: 
+       * handles-private.h: 
+       * daemon.c: Reserve the range of handles that can have the same
+       values as file descriptors.  These won't be used, but the values
+       will be used as file, console, pipe or socket handles.  The fd to
+       handle mapping is done internally and is invisible to users.
+       Fixes bug 61828.
+
+       * wapi-private.h (_WAPI_HANDLE_VERSION): Increment, because we now
+       reserve a chunk of handle space.
+
+2004-08-04  Neale Ferguson <Neale.Ferguson@SoftwareAG-usa.com>
+
+       * atomic.h: add support for 64-bit S/390
+
+2004-07-22  Dick Porter  <dick@ximian.com>
+
+       * timed-thread.c: 
+       * threads.c: Move the destruction of the internal thread data to
+       after the thread has been joined.  Fixes bug 61418.
+
+2004-07-14  Dick Porter  <dick@ximian.com>
+
+       * wait.c (test_and_own): When not waiting for all handles to
+       become signalled, only own and return the lowest.  All the
+       documentation suggests that the old way was correct, but
+       experimentation shows it actually works like this.  Patch by
+       Sébastien Robitaille
+       (sebastien.robitaille@croesus.com), fixes bug 61511.
+
+2004-07-09  Ben Maurer  <bmaurer@ximian.com>
+
+       * threads.c: register roots for gc
+
+2004-07-08  Dick Porter  <dick@ximian.com>
+
+       * io.c (file_seek): If there is a high 32bit offset part, make
+       sure the low part isn't sign-extended.  Set error codes when
+       returning failure.  Fixes bug 61131.
+
+2004-07-06  Dick Porter  <dick@ximian.com>
+
+       * io.c (file_setfiletime): Check for underflow when converting to
+       time_t values.  Set error codes when returning failure.  Fixes bug
+       60970.
+
+2004-07-05  Dick Porter  <dick@ximian.com>
+
+       * mutexes.c (mutex_ops_init): Make the named mutex mutex sharable.
+
+       * daemon.c (unref_handle): Only destroy a handle if all processes
+       have released it, not just the current one.  Fixes bug 60887.
+
+2004-06-30  Zoltan Varga  <vargaz@freemail.hu>
+
+       * mono-mutex.h atomic.h: Add G_GNUC_UNUSED to static inline functions
+       to prevent warnings.
+
+2004-06-24  Dick Porter  <dick@ximian.com>
+
+       * mutexes.c: Indicate when a named mutex was reused
+
+2004-06-24  Dick Porter  <dick@ximian.com>
+
+       * threads.c (SuspendThread): 
+       * timed-thread.c (_wapi_timed_thread_suspend): Wrap sem_wait in a
+       while loop.  See bug 58161.
+
+Wed Jun 23 23:29:04 CEST 2004 Paolo Molaro <lupus@ximian.com>
+
+       * io.c: don't use sharemode for on-disk file permissions: it's used
+       for shared access to the open file.
+
+2004-06-22  Dick Porter  <dick@ximian.com>
+
+       * events.c (CreateEvent): When creating an auto-reset event that
+       is initially owned, make sure the set count starts at 1.
+
+2004-06-18  Dick Porter  <dick@ximian.com>
+
+       * event-private.h:
+       * events.c: Auto-reset events need to release one thread for each
+       time SetEvent() is called.  Fixes bug 41292.
+
+       * threads.h:
+       * mutex-private.h:
+       * mutexes.c: Scan for mutexes that are still locked by a thread
+       when it exits.  Fixes the MS demo app linked by bug 41292.
+
+       * wait.c (test_and_own): Make sure a handle is signalled before it
+       is owned.
+
+2004-06-16  Dick Porter  <dick@ximian.com>
+
+       * timed-thread.c: Call the thread cleanup exit routine before taking
+       the join mutex, because this could deadlock if another thread tries
+       to join in the meantime.  This fixes the hang-at-exit problem seen
+       on macos.
+
+2004-06-03  Lluis Sanchez Gual  <lluis@ximian.com>
+
+       * threads.c: Implemented SleepEx.
+       * threads.h: Fixed SleepEx signature.
+
+2004-06-03  Miguel de Icaza  <miguel@ximian.com>
+
+       * threads.c: When running under valgrind, do not allocate too much
+       stack, as Valgrind default is 1 meg.
+
+2004-05-27  Dick Porter  <dick@ximian.com>
+
+       * io.h:
+       * io.c: Implemented LockFile() and UnlockFile()
+
+2004-05-21  Dick Porter  <dick@ximian.com>
+
+       * io.c (CreateFile): Check for existing share modes when opening
+       a file.
+
+       * handles.c: 
+       * handles-private.h: 
+       * daemon-messages.h: 
+       * daemon.c: Maintain a hash of file share modes, keying on device
+       and inode (to cope with symlinks.)
+
+2004-05-20  Lluis Sanchez Gual  <lluis@ximian.com>
+
+       * daemon-messages.c: Retry if the communication with the daemon is
+         interrupted by a signal.
+       * io.c, sockets.c: Check for EINTR in every syscall that can be interrumped. 
+         Only return an error in this case if there is something in the apc queue
+         (which means that it is an interruption requested by the "user").
+       * processes.c: Use WaitForSingleObjectEx. No need to pass "alertable" as
+         true since the wait is small.
+       * shared.c: Retry write calls when interrumped by a signal.
+       * timed-thread.h, timed-thread.c: added _wapi_thread_apc_pending, which
+         returns TRUE if there are pending asynchronous calls (APC) for the
+         provided thread. Also added _wapi_thread_dispatch_apc_queue which calls
+         the enqueued APCs. Defined a new struct ApcInfo that holds information
+         about an enqueued APC.
+       * thread-private.h, threads.c: Implemented QueueUserAPC (which does the same
+         as in win32),_wapi_thread_apc_pending and _wapi_thread_dispatch_apc_queue. 
+         These last two methods call the corresponding apc methods in 
+         thread-private using the provided thread handle.
+       * threads.h: Added QueueUserAPC.
+       * uglify.h: Added WapiApcProc (needed by QueueUserAPC).
+       * wait.c, wait.h: Changed WaitForSingleObject to WaitForSingleObjectEx, and
+         WaitForMultipleObjects to WaitForMultipleObjectsEx. Implemented support
+         for APCs in those two methods and also in SleepEx.
+
+2004-05-17  Dick Porter  <dick@ximian.com>
+
+       * io.c (CopyFile): Speed up.  Fixes bug 57859.
+
+2004-05-13  Dick Porter  <dick@ximian.com>
+       * mono-mutex.c (mono_mutex_unlock): Return EPERM when the current
+       thread doesn't own the mutex, rather than assert()ing.
+
+2004-05-11  Dick Porter  <dick@ximian.com>
+
+       * shared.c (_wapi_shm_attach): Cope when a previous daemon startup
+       attempt failed, leaving shared files that look like a daemon is
+       still starting.
+
+2004-05-10  Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+       * io.c:
+       (SetFileAttributes): don't the the exec bit if the corresponding read
+       bit is not set.
+
+2004-05-10  Zoltan Varga  <vargaz@freemail.hu>
+
+       * io.c (FindFirstFile): Fix invalid free.
+
 2004-05-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
 
        * io.c: translate from GFileError to errno codes and don't free