2010-05-11 Rodrigo Kumpera <rkumpera@novell.com>
[mono.git] / mono / io-layer / ChangeLog
blob6cf064212bc73996aace611d551004efc61b1241
1 2010-04-29  Geoff Norton  <gnorton@novell.com>
3         * mono-spinlock.h: Remove
4         * wthreads.c: Don't spinlock here, use a mutex instead
6 2010-04-26  Geoff Norton  <gnorton@novell.com>
8         * processes.c: Fix this for 64-bit darwin.
10 2010-04-20  Jonathan Pryor  <jpryor@novell.com>
12         * collection.c: Cleanup platform checks around
13           pthread_attr_setstacksize(), and instead always use
14           MAX(65536, PTHREAD_STACK_MIN) as the stack size.
15         * mono-mutex.c: Remove near duplicate pthread_mutex_timedlock()
16           declarations, and merge via a CONST_NEEDED intermediate #define.
18 2010-04-19  Jonathan Pryor  <jpryor@novell.com>
20         * collection.c, mono-mutex.c: Add Android support.
22 2010-04-14  Zoltan Varga  <vargaz@gmail.com>
24         * collection.c (_wapi_collection_init): Set stack size on openbsd similarly to
25         the other BSDs.
27 2010-04-10  Andreas Färber  <andreas.faerber@web.de>
29         * processes.c (EnumProcesses, load_modules): Add implementations
30         for Haiku. Fixes build on Haiku.
31         (OpenProcess, EnumProcessModules, get_process_name_from_proc):
32         Tweak implementations for Haiku.
33         * process-private.h: Fix _WAPI_PROCESS_UNHANDLED_PID_MASK for
34         32-bit pids (Haiku).
35         * ChangeLog: Fix UTF-8 encoding
37         Code is contributed under MIT/X11 license.
39 2010-04-09  Zoltan Varga  <vargaz@gmail.com>
41         * processes.c: Applied more openbsd changes from Robert Nagy <robert@openbsd.org>.
43 2009-04-06 Rodrigo Kumpera  <rkumpera@novell.com>
45         * wthreads.c (TlsSetValue): Don't take locks here. We trust pthread_setspecific
46         return value to tell if we tried to store to an invalid slot.
48 2010-04-04  Zoltan Varga  <vargaz@gmail.com>
50         * processes.c: Applied more openbsd changes from Robert Nagy <robert@openbsd.org>.
52 2010-04-03  Zoltan Varga  <vargaz@gmail.com>
54         * processes.c: Applied more openbsd changes from Robert Nagy <robert@openbsd.org>.
56 2010-04-03  Zoltan Varga  <vargaz@gmail.com>
58         * processes.c: Applied some openbsd changes from Robert Nagy <robert@openbsd.org>.
60 2010-03-26  Zoltan Varga  <vargaz@gmail.com>
62         * sockets.c: Apply some openbsd changes from openbsd ports.
64 2010-03-26  Zoltan Varga  <vargaz@gmail.com>
66         * shared.c: Disable shared supported by default, it can be enabled by setting
67         the MONO_ENABLE_SHM env variable.
69 2009-03-22 Rodrigo Kumpera  <rkumpera@novell.com>
71         * threads.h: Add wapi_self_interrupt.
73         * wthreads.c: Add wapi_self_interrupt which puts the current
74         thread in interrupted state.
76         * wthreads.c (wapi_thread_clear_wait_handle): Previous handle
77         can possibly be NULL if an async interrupt cleared it.
79         This is safe because it is only async cleared if running inside a
80         handler block.
82 2010-03-06 Gonzalo Paniagua Javier <gonzalo@novell.com>
84         * processes.c: made ShellExecuteEx actually work when the file name to
85         execute is quoted. Display a message intead of blindly ignoring the
86         result of g_shell_parse_argv(). Fixes bug #385497.
88 2010-03-05  Zoltan Varga  <vargaz@gmail.com>
90         * shared.c (shm_semaphores_init): Applied patch from Cal Page
91         (age.cal@gmail.com). Fix support for USE_SHM.
93 2010-02-25  Geoff Norton  <gnorton@novell.com>
95         * wait.c: If any of our handles are shared, we need to do
96         a polling wait so we're notified of the signal change.
98 Wed Feb 24 16:01:37 CET 2010 Paolo Molaro <lupus@ximian.com>
100         * Makefile.am: don't install the headers anymore, they are private.
102 2010-02-20  Zoltan Varga  <vargaz@gmail.com>
104         * versioninfo.c (VerLanguageName): Remove code duplication a bit.
106 2009-12-02  Miguel de Icaza  <miguel@novell.com>
108         * processes.c (EnumProcesses): Add support for OSX, patch from Tom
109         Philpot <tom.philpot@logos.com>
111 2009-11-30  Carlos Alberto Cortez <calberto.cortez@gmail.com>
113         * io.cs: In CopyFile check if the destination already exists before
114         trying to open it, and if it is the same as the source, report an error,
115         just as .net does. We do the check here to take advantage of the IOMAP
116         capability.
117         Fixes #510230.
119 2009-11-13 Jonathan Chambers <joncham@gmail.com>
121         * mono-mutex.h: Implementation for Windows platform.
122         
123         Code contributed under MIT/X11 license.
125 2009-11-13  Zoltan Varga  <vargaz@gmail.com>
127         * processes.c: Include mono-path.h.
129 2009-11-12  Geoff Norton  <gnorton@novell.com>
131         * processes.c: match_procname_to_modulename should resolve
132         symlinks when checking if two process modules match.
134 2009-11-04 Jonathan Chambers <joncham@gmail.com>
136         * mono-mutex.h: Add skeleton implementation for Windows platform.
137         
138         Code contributed under MIT/X11 license.
140 2009-10-21 Gonzalo Paniagua Javier <gonzalo@novell.com>
142         * sockets.[ch]: fix function definition.
144 2009-10-21 Gonzalo Paniagua Javier <gonzalo@novell.com>
146         * sockets.[ch]: added TransmitFile implementation.
148 2009-10-04  Zoltan Varga  <vargaz@gmail.com>
150         * processes.c: Implement get_process_name_from_proc () on solaris.
152 2009-09-24  Zoltan Varga  <vargaz@gmail.com>
154         * processes.c (load_modules): Applied patch from Thomas Philpot
155         (tom.philpot@logos.com). Fixes #533893.
157 2009-09-15  Jeffrey Stedfast  <fejj@novell.com>
159         * io.c (CreateFile): In the directory fallback case, use
160         _wapi_open() again so that IOMAP magic happens.
161         (CopyFile): Need to consistently use _wapi_open() here too.
162         (ReplaceFile): Use _wapi_open() here too and get rid of the
163         fallback code that tried re-opening the file w/o O_TRUNC since
164         there's no reason to do that.
166 2009-09-05  Zoltan Varga  <vargaz@gmail.com>
168         * handles.c (_wapi_handle_real_new): Call _wapi_process_reap () when running
169         out of shared handes. Fixes #536776.
171         * processes.c (CreateProcess): Return false and set the error to
172         ERROR_OUTOFMEMORY when a process handle cannot be created.
173         (ShellExecuteEx): Propagate an ERROR_OUTOFMEMORY error code. Fixes part of
174         #536776.
176 2009-09-01  Zoltan Varga  <vargaz@gmail.com>
178         * processes.c (EnumProcessModules): Applied patch from Romain Tartière
179         (romain@blogreen.org). Fix this on freebsd/OSX. Fixes #533893.
181 2009-08-18  Christian Hergert  <chris@dronelabs.com>
183         * wthreads.c: Roll back change for thread-id as it "embraces
184         and extends" the api by passing word-size for thread id on
185         s390 and amd64.
187 2009-08-18  Christian Hergert  <chris@dronelabs.com>
189         * security.c:
190         * processes.c:
191         * wthreads.c: Be explicit when we are changing word sizes.
193 2009-08-18  Christian Hergert  <chris@dronelabs.com>
195         * processes.c: Fix method declaration warnings.
196         * sockets.c: getsockopt() wants socklen_t for size.
198 2009-08-04  Miguel de Icaza  <miguel@novell.com>
200         * posix.c (_wapi_stdhandle_create): Split this into a new file to
201         more easily support non-Posix platforms.
203 2009-07-20  Geoff Norton  <gnorton@novell.com>
205         * thread-private.h: Use the new mono-semaphore.h.
207 2009-06-25 Gonzalo Paniagua Javier <gonzalo@novell.com>
209         * sockets.c: add the error number to the message so we can figure out
210         when this happens.
212 2009-06-25 Gonzalo Paniagua Javier <gonzalo@novell.com>
214         * wait.c: add missing 'break'.
216 2009-06-20  Zoltan Varga  <vargaz@gmail.com>
218         * atomic.h: Fix ilp32 support on ppc.
220 2009-05-28  Mark Probst  <mark.probst@gmail.com>
222         * collection.c (_wapi_collection_init): If pthread_create() fails,
223         try again with larger and then with no stack size set.  Fixes
224         #470336.
226 2009-05-26  Zoltan Varga  <vargaz@gmail.com>
228         * shared.c (_wapi_shm_file): Avoid creating a .wapi directory here, create
229         it in _wapi_shm_file_open (), since platforms using posix shm don't need it.
231 2009-05-22  Miguel de Icaza  <miguel@novell.com>
233         * wapi_glob.c: Do not need sys/param.h anymore, we now use the
234         POSIX PATH_MAX instead of BSD's MAXPATHLEN
236         * handles.c: Do not pull a reference to sockets if they are
237         disabled.
239         * sockets.c: Allow for ports to define their own ioctlsocket. 
241         * wthreads.c: Remove obsolete code that I recently introudced (the
242         hook for mono_register_thread_attr.
244 2009-05-22  Miguel de Icaza  <miguel@novell.com>
246         * versioninfo.c: One missing signature, fixed.
248 2009-05-21  Miguel de Icaza  <miguel@novell.com>
250         * daemon.c: Remove more DEBUG ifdef mess.
252         * shared.c (_wapi_shm_attach): Implemention for DISABLE_SHARED_HANDLES 
254 2009-05-20  Miguel de Icaza  <miguel@novell.com>
256         * sockets.c (ioctlsocket): Move support for MacOS semantics to the
257         ioctlsocket from the ifdef that was previously on metadata/
259         * wapi_glob.c (_wapi_glob): Use PATH_MAX from limits.h instead of
260         the BSD name from sys/param.h (MAXPATHLEN)
262         Do not include pwd.h as it is not used.
264         * thread-private.h: Use indent ifdef style for clarity
266         * sockets-wrappers.h: sys/socket.h conditional
268         * daemon-messages.h: sys/uio.h conditional.
270         * sockets.c: sys/ioctl.h conditional
272         * wthreads.c: work around for platforms with no thread fetching
273         information. 
275         * versioninfo.c: Use the portable mono_map_ interface instead of
276         using mmap directly and change the style to the Mono style.
278         Remove more DEBUG/ifdefs combos
280         * shared.c: Split the code to make DISABLE_SHARED remove all the
281         code that does not use the shared handles.   Before it merely
282         removed some of it, with this we avoid hacks on platforms that can
283         not implement it.
285         Split the code to reduce the amount of ifdefs.
287         Remove #ifdef DEBUG from the source and use a macro instead.
289 2009-05-20  Miguel de Icaza  <miguel@novell.com>
291         * locking.c: Split locking code into a separate file.
293 2009-05-18  Miguel de Icaza  <miguel@novell.com>
295         * daemon.c: Move the compile check of MONO_SIZEOF_SUNPATH to the
296         file that uses it.
298         * Rename `threads.c' to `wthreads.c' as broken build systems are
299         not able to cope with two files with the same name across multiple
300         directories. 
302 2009-05-15  Geoff Norton  <gnorton@novell.com>
304         * handles.c: Don't start the collection thread if we've disabled
305         shared handles.
307 2009-05-12  Zoltan Varga  <vargaz@gmail.com>
309         * collection.c (collection_thread): Get rid of all the ifdefs and
310         gcc attributes, simply return NULL.
312 2009-05-11  Zoltan Varga  <vargaz@gmail.com>
314         * shared.c: Applied patch from Koushik K. Dutta (koush@koushikdutta.com).
315         Fix the build on android.
317 2009-05-09  Miguel de Icaza  <miguel@novell.com>
319         * messages.c: Split the scan into common and uncommon messages to
320         allow the messages that are not produced by Mono to be removed on
321         embedded scenarios.
322         
323         * messages.c (message_string): instead of having a gigantic switch
324         table, use a sorted structure in memory and do a binary search on
325         it.
327         This reduces the runtime size by 49k and the debugging symbols by
328         400k.
330 2009-04-29 Gonzalo Paniagua Javier <gonzalo@novell.com>
332         * sockets.c: don't display a warning when connect() fails because the
333         socket was closed in another thread.
335 2009-04-23 Rodrigo Kumpera  <rkumpera@novell.com>
337         * shared.c: Fix a bunch of memleaks.
339 2009-03-27  Zoltan Varga  <vargaz@gmail.com>
341         * threads.h: Add a comment to CreateThread.
343 2009-03-20  Zoltan Varga  <vargaz@gmail.com>
345         * threads.c handles.c wait.c: Change location of gc_wrapper.h.
347 2009-02-22  Robert Jordan  <robertj@gmx.net>
349         * sockets.c: implement WSASend/WSARecv using sendmsg/recvmsg.
350         Fixes #470021.
352         Code is contributed under MIT/X11 license.
354 2009-02-20 Gonzalo Paniagua Javier <gonzalo@novell.com>
356         * events.c: fix event_signal and namedevent_signal to actually signal
357         the handle.
359 2009-02-12 Gonzalo Paniagua Javier <gonzalo@novell.com>
361         * io.c: EXDEV when moving directories fails now without creating a
362         file in the destination.
363         Fixes bug #326983.
365 2009-02-09  Zoltan Varga  <vargaz@gmail.com>
367         * wait.c (WaitForMultipleObjectsEx): Initialize poll variable.
369 2009-02-05  Miguel De Icaza  <miguel@novell.com>
371         * sockets.c (_wapi_setsockopt): SO_REUSEPORT is needed also on
372         MacOS X.  Fixes bug #471292
374 2009-01-29  Zoltan Varga  <vargaz@gmail.com>
376         * shared.c: Fall back to file based shared storage if shm_open () fails
377         because /dev/shm is not mounted.
378         
379         * shared.c: Add an alternative implementation using shared memory instead of
380         files. This fixes problems where the mono process would spin up the disk
381         every x secs on laptops. Fixes #434566, #415373 and #321949.
383 2009-01-16  Miguel de Icaza  <miguel@novell.com>
385         * sockets.c (WSASend): Fix memory leak, and optimize for the case
386         with 1 segment. 
388         This should really use writev or sendmsg to use the kernel
389         scatter/gather facility instead of emulating it by copying buffers.
391 2009-01-26  Rodrigo Kumpera  <rkumpera@novell.com>
393         * critical-sections.h (Enter/LeaveCriticalSection): Show
394         helpfull warning messages before crashing.
396 2009-01-26  Rodrigo Kumpera  <rkumpera@novell.com>
398         * handles-private.h (_wapi_handle_set_signal_state): Show
399         helpfull warning messages before crashing.
401 2009-01-26  Jeffrey Stedfast  <fejj@novell.com>
403         * mono-mutex.[c,h]: Removed GPLv2 copyright notice which should
404         not have been there.
406 2009-01-20  Rodrigo Kumpera  <rkumpera@novell.com>
408         * threads.c: Add wapi_current_thread_desc that produces
409         a string representation of the current thread state.
411         * threads.h: Export wapi_current_thread_desc.
413 2009-01-18  Zoltan Varga  <vargaz@gmail.com>
415         * io.c (GetDiskFreeSpaceEx): Applied patch from Koushik Dutta
416         (koush@koushikdutta.com). Disable this on android.
418 2009-01-16  Rodrigo Kumpera  <rkumpera@novell.com>
420         * handles.c (_wapi_handle_timedwait_signal_handle): Don't use the
421         set_wait_handle/clear_wait_handle machinery for alertable waits in
422         case of non-alertable waits.
424         Non-alertable waits must continue and wait on the cond as this will
425         release the lock. Otherwise this will cause a deadlock as anyone trying
426         to pulse the cond will block trying to acquire the said lock because
427         the thread in non-alertable wait will be busy looping in WaitForSingleObjectEx
428         or similar function, never releasing the lock.
430         Thou this fixes quite a few of the hangs introduced by non-pooling alertable
431         waits, the long term plan is to verify if all non-alertable waits really need
432         to be as such.
434 2009-01-14  Zoltan Varga  <vargaz@gmail.com>
436         * handles-private.h (_wapi_handle_set_signal_state): Set the signalled state
437         of the handle while locking the global signal cond mutex.
439         * wait.c (WaitForMultipleObjectsEx): Check the signalled state of handles
440         inside the critical section before waiting, otherwise we could go to waiting
441         even when the handles are already signalled.
443 2009-01-13  Zoltan Varga  <vargaz@gmail.com>
445         Reapply r122913, this time handling processes by falling back to polling.
446         
447         * handles.c: Rework the way the global signal stuff is handled: instead of
448         allocating a separate mutex/condvar pair for it, allocate a normal handle.
449         This way, it can reuse the alertable waiting code, allowing 
450         WaitForMultipleObject to work without polling.
452 2009-01-09  Miguel de Icaza  <miguel@novell.com>
454         Incorporate a few patches from Paolo, slightly modified:        
456         * handles.c (_wapi_handle_check_share): On non-Linux systems, do
457         not even compile in the code that scans for /proc/fd, and go
458         directly to the fallback function.
460 2009-01-09  Paolo Molaro (lupus@ximian.com)
462         * handles.c: Do not include some header files in platforms that
463         lack it.
465 2009-01-09  Miguel de Icaza  <miguel@novell.com>
467         * messages.c: Eliminate a warning.
468         
469 2009-01-09  Paolo Molaro (lupus@ximian.com)
471         * error.c: On some platforms that do not define these variables,
472         do not use them.
474         * security.c, io-private.h: Only include some headers if they
475         exist on the system
477         * sockets.c, sockets.h: do not import on this header files that
478         are only consumed internally in sockets.c.
480 2009-01-09  Zoltan Varga  <vargaz@gmail.com>
482         * threads.c (_wapi_thread_apc_pending): Check for thread->wait_handle ==
483         INTERRUPTION_REQUESTED_HANDLE too.
484         (wapi_interrupt_thread): Rework the comments, the thread is no longer
485         required to call QueueUserAPC to make the wait functions return.
487         * threads.c handles.c threads-internal.h: Implement alertable waits without
488         polling.
490 2009-01-08  Geoff Norton  <gnorton@novell.com>
492         * processes.c: Fix the osx version check to properly detect 10.5 v 10.4
494 2009-01-08  Christian Prochnow  <cproch@seculogix.de>
496         * types.h: added WapiULargeInteger.
498         * uglify.h: added ULARGE_INTEGER, PULARGE_INTEGER.
500         * io.h: added WapiDriveType, added method declarations
501         for GetDiskFreeSpaceEx and GetDriveType
503         * io.c: added GetDiskFreeSpaceEx() to query disk size
504         and free space via statvfs or statfs system call.
505         added GetDriveType to query drive type via /etc/mtab or /etc/mnttab.
507 2009-01-07  Geoff Norton  <gnorton@novell.com>
509         * processes.c: Properly implement support for Process.Modules on OSX.
510         Fixes OSX on nunit 2.4
512 2009-01-07 Rodrigo Kumpera  <rkumpera@novell.com>
514         * io.c (GetCurrentDirectory): Avoid calling g_get_current_dir straight
515         away as it doesn't handle ENAMETOOLONG correctly. As a bonus we avoid
516         allocating memory in the common path.
518 2009-01-07  Geoff Norton  <gnorton@novell.com>
520         * processes.c: Only use open -W on OSX 10.5+.  Patch from
521         Miguel
523 2008-12-19  Bill Holmes  <billholmes54@gmail.com>
525         * processes.c (get_module_name) : adjust size for unicode characters.
527         Code is contributed under MIT/X11 license.
529 2008-11-21  Zoltan Varga  <vargaz@gmail.com>
531         * atomic.h: Applied patch from Mihai Chelaru <kefren@ngnetworks.ro>. Add
532         netbsd support.
534 2008-11-18  Mark Probst  <mark.probst@gmail.com>
536         * atomic.h: InterlockedExchangePointer and
537         InterlockedCompareExchangePointer for PPC64.
539         Code submitted by andreas.faerber@web.de at
540         https://bugzilla.novell.com/show_bug.cgi?id=324134 under the
541         X11/MIT license.
543 2008-11-13  Bill Holmes  <billholmes54@gmail.com>
545         * wait.h : Adding method declaration for WaitForInputIdle.
547         * wait.c : Adding implementation for WaitForInputIdle.
549         Code is contributed under MIT/X11 license.
551 Fri Oct 17 15:23:00 CEST 2008 Paolo Molaro <lupus@ximian.com>
553         * processes.c: patch from Geoff Norton (gnorton@novell.com) to
554         strdup the open program on OSX (bug #431811).
556 2008-10-10 Gonzalo Paniagua Javier <gonzalo@novell.com>
558         * versioninfo.c: remove the use of g_strdown.
560 2008-09-25  Dick Porter  <dick@ximian.com>
562         * wait.c: Make sure we keep references to handles we're waiting
563         for.  Fixes bug 424851.
565 2008-07-29  Dick Porter  <dick@ximian.com>
567         * processes.c (get_module_name): Make a last-ditch effort to
568         figure out the process name.  Fixes bug 413723, patch by Casey
569         Marshall <casey.s.marshall@gmail.com>
571 2008-07-28  Dick Porter  <dick@ximian.com>
573         * handles.c (_wapi_handle_count_signalled_handles): Remove an
574         unmatched _wapi_handle_ref().  Fixes bug 410743.
576 2008-07-15  Rodrigo Kumpera  <rkumpera@novell.com>
578         * versioninfo.c (map_pe_file): Fix memory leak.
580 2008-07-01  Zoltan Varga  <vargaz@gmail.com>
582         * process-private.h (_WAPI_PROCESS_UNHANDLED_PID_MASK): Fix the amd64 build.
584 2008-06-27  Dick Porter  <dick@ximian.com>
586         * processes.c: Implement a form of process pseudo-handle to allow
587         non-mono processes to be manipulated.  Fixes bug 313231.
589         * wait.c: Check for process pseudo-handles and fail if an attempt
590         is made to wait on one.
592 2008-06-19  Dick Porter  <dick@ximian.com>
594         * sockets.c: Implement WSASend() and WSAReceive().
596 2008-06-02  Dick Porter  <dick@ximian.com>
598         * wapi.h: 
599         * Makefile.am: 
600         * messages.h: 
601         * messages.c: Implement FormatMessage, fixes bug 321827.
603 2008-05-29  Dick Porter  <dick@ximian.com>
605         * sockets.c (socket_close): Clear any saved errors
606         (_wapi_connect): Don't save EWOULDBLOCK errors here, as that
607         breaks async connects.  (Bug 377589 test case broken by the
608         previous fix to bug 356552)
610 2008-05-25  Zoltan Varga  <vargaz@gmail.com>
612         * thread-private.h (struct _WapiHandle_thread): Remove 'owner_pid' field. Reorder
613         fields so this struct (which is the biggest of the handle structs) takes less
614         space.
616         * threads.c (QueueUserAPC): Make this function signal safe by adding some
617         restrictions on its usage.
619 2008-05-14  Zoltan Varga  <vargaz@gmail.com>
621         * mono-mutex.h: Get rid of the #ifdef __cplusplus defines, use G_BEGIN_DECLS
622         /G_END_DECLS.
624 2008-05-07  Dick Porter  <dick@ximian.com>
626         * io.c (FindNextFile): Handle symlinks correctly.  Fixes bug
627         385765.
629 2008-04-25  Zoltan Varga  <vargaz@gmail.com>
631         * handles.c (_wapi_handle_check_share): Fix a crash introduced by the lazy
632         creation of wapi handle slots.
634 2008-04-24  Zoltan Varga  <vargaz@gmail.com>
636         * handles.c (shared_init): Align _wapi_fd_reserve to a multiple of 
637         _WAPI_HANDLE_INITIAL_COUNT to avoid a problem when allocating handles.
639 2008-04-23  Zoltan Varga  <vargaz@gmail.com>
641         * handles.c: Initialize the handle array entries on demand to save memory.
643         * wapi-private.h (_WAPI_HANDLE_INITIAL_COUNT): Decrease this to 256 to save
644         memory.
646         * handles-private.h (_WAPI_PRIVATE_MAX_SLOTS): Increase this to 1024*16 to
647         compensate for the decrease in _WAPI_HANDLE_INITIAL_COUNT.
648         
649         * threads.c: Use #ifdef instead of #if for checking for valgrind/memcheck.h.
651 2008-04-22  Dick Porter  <dick@ximian.com>
653         * wapi_glob.c (globextend): Comment out the code using ARG_MAX, as
654         that is broken on the latest opensuse.
656 2008-04-21  Dick Porter  <dick@ximian.com>
658         * io.c (DeleteFile): Disable for now the bug fix for 323389, it's
659         breaking too much other stuff.
661 2008-04-20  Geoff Norton  <gnorton@novell.com>
663         * processes.c: Fix the _NSGetEnviron define to prevent an impropoer
664         pointer dereference.
666 2008-04-18  Miguel de Icaza  <miguel@novell.com>
668         * Applied patch from Dick Porter from bug #380649
670 2008-04-17  Dick Porter  <dick@ximian.com>
672         * io.c (DeleteFile): Check file shares before deleting a file.
673         Fixes bug 323389.
675 2008-04-17  Dick Porter  <dick@ximian.com>
677         * io.c (DeleteFile): Return ERROR_ACCESS_DENIED if the file is
678         readonly.  Fixes bug 378229.
680 2008-04-11  Geoff Norton  <gnorton@novell.com>
682         * processes.c: The global extern environ doesn't exist on Mac.  We
683         need to call NSGetEnviron instead.
685 2008-04-08  Dick Porter  <dick@ximian.com>
687         * processes.c (CreateProcess): Improve the managed binary support,
688         so it works when the executable is passed in as the appname.
689         Fixes bug 377815.
691 2008-04-04  Dick Porter  <dick@ximian.com>
693         * io.c (MoveFile): Check file shares before moving a file.  Fixes
694         bug 377049.
696 2008-04-04  Dick Porter  <dick@ximian.com>
698         * error.c (errno_to_WSA): handle ENODEV.  Fixes the reopened part
699         of bug 324035.
701 2008-04-04  Dick Porter  <dick@ximian.com>
703         * processes.c (GetModuleInformation): 
704         * versioninfo.h: 
705         * versioninfo.c: 64bit fixes
707 2008-04-03  Dick Porter  <dick@ximian.com>
709         * io-portability.c (_wapi_basename, _wapi_dirname): Only turn \
710         into / when MONO_IOMAP is in effect.  Fixes bug 346123.
712 2008-04-03  Dick Porter  <dick@ximian.com>
714         * timefuncs.c (GetTickCount): Use mono_msec_ticks(), see bug
715         347476.
717 2008-04-01  Dick Porter  <dick@ximian.com>
719         * versioninfo.c (get_string_block): Refine the fix for bug 354856
720         (r93661) so that it also fixes the new part of bug 374600.
722 2008-03-28  Dick Porter  <dick@ximian.com>
724         * processes.c (GetExitCodeProcess): Check if a process has exited
725         and recorded it's exit code, before seeing if the process is
726         signalled.  Fixes bug 325463.
728 2008-03-27  Dick Porter  <dick@ximian.com>
730         * processes.c (match_procname_to_modulename): Check the whole
731         process name first, in case it is recorded as an absolute path.
732         Fixes bug 360348.
734 2008-03-27  Dick Porter  <dick@ximian.com>
736         * processes.c (ShellExecuteEx): Grotty kludge to work around
737         unpleasant feature in g_shell_parse_argv() where it treats '#'
738         embedded in a filename as a comment marker, and throws away the
739         rest of the line.  When we're directly opening URLs quote the
740         filename, to avoid this.  Fixes bug 371567.
742 2008-03-25  Dick Porter  <dick@ximian.com>
744         * wapi-private.h (_WAPI_HANDLE_VERSION): Increment file layout
745         version
747         * threads.c: Make thread handles private to the process that owns
748         them.
750 2008-03-22  Kornél Pál  <kornelpal@gmail.com>
752         * io-layer.h: Windows: Rename GetProcessId to __GetProcessId for targets not
753         supporting it. This fixes MSVC build with new Windows SDKs that declare
754         GetProcessId unconditionally.
756 2008-03-20  Kornél Pál  <kornelpal@gmail.com>
758         * io-layer.h: Removed Windows version macros.
760 Thu Mar 13 16:24:53 CET 2008 Paolo Molaro <lupus@ximian.com>
762         * processes.c: properly check for executable files (fixes bug #368829).
764 2008-02-05  Dick Porter  <dick@ximian.com>
766         * versioninfo.c (VerLanguageName): Implement VerLanguageName.
768 2008-01-31  Bill Holmes  <billholmes54@gmail.com>
769         * processes.c (match_procname_to_modulename) : Added to check if the last 
770           part of module name is equal to the process name.
772         * processes.c (EnumProcessModules) : Changed the first entry in the returned 
773           modules array (the process module) to be populated from the entry found
774           in /proc/<PID>/maps.
776         * processes.c (get_module_name & GetModuleInformation) : In the case where 
777           the module passed in is NULL, search the /proc/<PID>/maps for a name that
778           matches the process name to populate the return information.
780         Fixes #357062
782 2008-01-29  Zoltan Varga  <vargaz@gmail.com>
784         * security.c (RevertToSelf): Make this return TRUE if impersonating is not
785         supported.
787         * sockets.c (_wapi_connect): Add a workaround to a solaris x86 problem where
788         getsockopt (SO_ERROR) doesn't return an error code after connect () fails. Fixes
789         #356552.
791 2008-01-23  Dick Porter  <dick@ximian.com>
793         * versioninfo.c (get_string_block): When stepping over the
794         StringTable block, do not read an extra block at the end.  Fixes
795         the new part of bug 354856.
797 2008-01-19  Dick Porter  <dick@ximian.com>
799         * versioninfo.c (get_stringtable_block): Cope when the StringTable
800         block is first in the resources data, and we just need to step
801         over it.  Fixes bug 354856.
803 2008-01-16  Dick Porter  <dick@ximian.com>
805         * threads.c (_wapi_thread_set_termination_details): Move the
806         thread abandonment to outside the shared handle lock.  Fixes bug
807         349680.
809 2008-01-16  Dick Porter  <dick@ximian.com>
811         * versioninfo.c (VerQueryValue): Include trailing null in returned
812         string length, for MS compatibility.
814 2008-01-09  Dick Porter  <dick@ximian.com>
816         * versioninfo.c (get_ptr_from_rva, scan_resource_dir): Make it
817         work on big-endian systems.
818         (scan_resource_dir): Copy the resource directory entry and
819         byteswap if necessary so it works big-endian.  This fixes bug
820         345972 for real this time.
821         (VerQueryValue): String values set the length to the number of
822         unicode chars, but the data length reported was already correct so
823         don't halve it again.  Fixes the previous fix for bug 345972.
824         (GetFileVersionInfo): On big-endian systems, scan the resource
825         data and turn all unicode strings into UTF-16BE.  FileVersionInfo
826         now works big-endian.
828 2008-01-04  Dick Porter  <dick@ximian.com>
830         * versioninfo.c (VerQueryValue): Returned buffer length counts
831         chars not bytes for string data.  Fixes bug 345972 again.
832         (get_enclosing_section_header): Make sure values read are treated
833         as LE.  Fixes crash on ppc reported in bug 345972.
835 2007-12-17  Mark Probst  <mark.probst@gmail.com>
837         * threads.c: Guard against a race condition involving
838         thread_hash_key that can occur during shutdown.
840 2007-12-08  Zoltan Varga  <vargaz@gmail.com>
842         * processes.c: Include sys/mkdev.h if exists. Fixes solaris x86 build.
844 2007-12-06  Dick Porter  <dick@ximian.com>
846         * versioninfo.c: Resource language values must be compared in a
847         'case'-insensitive manner.  Fixes bug 345972.
849 2007-12-05  Dick Porter  <dick@ximian.com>
851         * io.c (CreateFile): Create files with mode 0666 (&~umask) by
852         default.  Fixes bugs 325299 and 337040.
854 2007-11-22  Dick Porter  <dick@ximian.com>
856         * critical-sections.h (EnterCriticalSection): Reinstate the
857         asserts in the devel branch, so any problems aren't obscured.
859 2007-11-22  Dick Porter  <dick@ximian.com>
861         * versioninfo.c (find_pe_file_resources): Make it work on 64bit
862         systems.  Fixes bug 343353.
864 2007-11-21  Dick Porter  <dick@ximian.com>
866         * processes.c (load_modules): Rewrite based on the libgc
867         /proc/<pid>/maps parsing to avoid using glib functions only
868         available since 2004.
869         (load_modules): Check for duplicates before adding a module to the
870         list.
872 2007-11-15  Dick Porter  <dick@ximian.com>
874         * processes.c (load_modules): Don't bother if we don't have
875         g_strsplit_set() and g_strv_length().  Allows building against old
876         glib versions.
877         (EnumProcessModules): Don't miss the first module returned by
878         load_modules().
880 2007-11-15  Dick Porter  <dick@ximian.com>
882         * processes.c: Implement process module support by reading from
883         /proc if it's available.
885         * versioninfo.h: 
886         * versioninfo.c: New functions to implement PE file version info
887         support.
889 2007-11-08  Dick Porter  <dick@ximian.com>
891         * critical-sections.h (EnterCriticalSection): Disable the critical
892         section asserts for the release branch
894 2007-11-05  Kornél Pál  <kornelpal@gmail.com>
896         * io-layer.h: Added includes for run-time GetProcessId API detection for
897         Windows.
899 2007-10-26  Dick Porter  <dick@ximian.com>
901         * shared.c (_wapi_shm_file_open): Set the umask when opening
902         shared files, so restrictive defaults don't prevent subsequent
903         processes re-opening them.
905 2007-10-18  Zoltan Varga  <vargaz@gmail.com>
907         * atomic.h (InterlockedCompareExchange): Fix the ia64 version so it works for
908         negative values too. Hopefully fixes #332700.
910 2007-09-26  Dick Porter  <dick@ximian.com>
912         * io-portability.c (_wapi_io_scandir): Only update the error
913         status of glob() when performing a secondary glob() if the first
914         returned an error.  Fixes bug 325107.
916 2007-09-12  Marek Habersack  <mhabersack@novell.com>
918         * io-portability.c: options_init moved to
919         utils/mono-io-portability.c
920         Do not initialize portability helpers here, it's done in
921         mono_runtime_init.
922         find_file and find_in_dir moved to utils/mono-io-portability.c
924 2007-09-09  Robert Jordan  <robertj@gmx.net>
926         * sockets.c (_wapi_setsockopt): Add support for FreeBSD multicast
927         sockets. Fixes #81891.
928         Code is contributed under MIT/X11 license.
930 2007-09-03  Atsushi Enomoto  <atsushi@ximian.com>
932         * processes.h, processes.c : ok, they are simple string.
934 2007-09-03  Atsushi Enomoto  <atsushi@ximian.com>
936         * processes.h : sigh, I really hate fixing them on windows :(
938 2007-09-03  Atsushi Enomoto  <atsushi@ximian.com>
940         * processes.c : fix build again.
942 2007-09-03  Atsushi Enomoto  <atsushi@ximian.com>
944         * processes.h : removed extra parameters from CreateProcessWithLogonW.
946 2007-09-03  Atsushi Enomoto  <atsushi@ximian.com>
948         * processes.c, processes.h: added CreateProcessWithLogonW(). For now
949           it just calls CreateProcess().
950         * io-layer.h : CreateProcessWithLogonW() requires WINVER 0x0500
951           on Windows.
953 2007-08-23  Robert Jordan  <robertj@gmx.net>
955         * processes.[c|h]: Implement Get|SetPriorityClass ().
956         Code is contributed under MIT/X11 license.
958 Tue Aug 21 20:08:09 CEST 2007 Paolo Molaro <lupus@ximian.com>
960         * io.c: made convert_arg_to_utf8() and write_file() static.
961         Worked around gcc's incorrect warning.
963 2007-08-20  William Holmes  <billholmes54@gmail.com>
965         *io.c: Added implementation for ReplaceFile.
966         *io.h: Added deceleration for ReplaceFile method.
968         Code is contributed under MIT/X11 license.
970 2007-08-20  Wade Berrier  <wberrier@novell.com>
972         * processes.c: include sys/resource.h for rusage to fix 
973         mac 10.3 build
975 Mon Aug 20 12:36:42 CEST 2007 Paolo Molaro <lupus@ximian.com>
977         * processes.c: implemented query for user/system times using
978         getrusage ().
980 2007-08-10  Dick Porter  <dick@ximian.com>
982         * sockets.c (_wapi_getsockopt, _wapi_setsockopt): Check the option
983         level as well as the name when mangling some of the values.  Fixes
984         bug 82000.
986 2007-08-02  Dick Porter  <dick@ximian.com>
988         * sockets.c: Changes in error handling, and move the SO_REUSEADDR
989         setting from metadata/socket-io.c.
991 2007-08-01  Dick Porter  <dick@ximian.com>
993         * io-portability.c (_wapi_io_scandir): Special-case patterns
994         ending in '.*' so that files with no extension are also matched.
995         Fixes bug 82212.
997         * wapi_glob.h: 
998         * wapi_glob.c: Reinstate WAPI_GLOB_APPEND, and add
999         WAPI_GLOB_UNIQUE to avoid matching the same entry twice when
1000         appending.
1002 2007-07-26  Dick Porter  <dick@ximian.com>
1004         * handles-private.h: 
1005         * thread-private.h: 
1006         * handles.h: 
1007         * critical-sections.c: 
1008         * handles.c: 
1009         * critical-section-private.h:
1010         * error.h: 
1011         * threads.c: 
1012         * error.c: Clean up TLS and pthreads structures.  Finishes off bug
1013         78739.
1015         * collection.c (collection_thread): Exit the collection thread if
1016         the io-layer has been cleaned up.
1018         * mono-mutex.h (mono_mutexattr_destroy): Add this define too
1020 Mon Jul 23 10:40:35 CEST 2007 Paolo Molaro <lupus@ximian.com>
1022         * timefuncs.c: make TickCount measure from boot time if it's
1023         available.
1025 2007-07-19  Juraj Skripsky  <js@hotfeet.ch>
1027         * io.c (MoveFile): Fix a leak. 
1029 Fri Jul 13 12:46:15 CEST 2007 Paolo Molaro <lupus@ximian.com>
1031         * handles-private.h, handles.c, thread-private.h, threads.c,
1032         uglify.h, wait.c: temporarily revert the alertable wait changes
1033         (r79386) until the deadlock issues are fixed.
1035 2007-06-22  Dick Porter  <dick@ximian.com>
1037         * shared.c: The non-shared mutexes weren't being initialised properly
1038         on macos.  Fixes bug 81929.
1040 2007-06-13  Randolph Chung  <tausq@debian.org>
1042         * atomic.h: Enable for all hppa targets.
1043         * Makefile.am: rename hppa_atomic.s to hppa_atomic.S so the preprocessor
1044         can handle the file.
1045         * hppa_atomic.s: Renamed to ...
1046         * hppa_atomic.S: ... and updated to work on both HPUX and Linux.
1048 2007-06-13  Dick Porter  <dick@ximian.com>
1050         * handles.c (timedwait_signal_wait_cond): Alertable waits on
1051         private handles are now interrupted by signalling the same
1052         condition that would end the wait if the handle became signalled,
1053         rather than polling.  (Shared handles still have to poll.)
1055         * threads.c (_wapi_thread_queue_apc): Interrupt the thread if it's
1056         waiting on a handle
1058         * handles-private.h (_wapi_handle_current_thread_set_waiting_on):
1059         Helper functions to inform the APC queuing functions when threads
1060         are waiting for handles, and to interrupt the wait.
1062         * wait.c (WaitForMultipleObjectsEx): Need to tell the handle
1063         waiting functions if any of the handles in question are shared
1065 2007-06-06  Miguel de Icaza  <miguel@novell.com>
1067         * processes.c (is_managed_binary): Fix for OSX.
1069 2007-06-06  Wade Berrier  <wberrier@novell.com>
1071         * atomic.h (InterlockedExchangePointer): cast to pointer to to silence
1072         compiler warnings (autobuild fails the build on this type of warning)
1074 2007-05-21  Dick Porter  <dick@ximian.com>
1076         * io-portability.c (_wapi_g_dir_open): Don't propagate any errors
1077         from the second call to g_dir_open, preserve the original error if
1078         the second call still fails but clear the error if it succeeds.
1080 2007-05-10  Dick Porter  <dick@ximian.com>
1082         * sockets.c (_wapi_recvfrom): Refine the fix to bug 75705 so EINTR
1083         isn't returned if the remote end shuts down cleanly.  Fixes zmd
1084         and the second example in bug 75705.
1086 2007-04-26  Dick Porter  <dick@ximian.com>
1088         * shared.c (_wapi_shm_semaphores_init): Need to check
1089         MONO_DISABLE_SHM in this entry point, as it's called before
1090         _wapi_shm_attach().  Fixes bug 81436.
1092 2007-04-24  Dick Porter  <dick@ximian.com>
1094         * sockets.c (_wapi_recvfrom, socket_close): Force recvfrom() to
1095         error if the socket is closed while the receive is blocking.
1096         Fixes bug 75705.
1098 2007-04-13  Dick Porter  <dick@ximian.com>
1100         * shared.h:
1101         * shared.c: Complete the reimplementation of disabling of shared
1102         memory, by not allocating sysv semaphores when shm disabling has
1103         been requested (either at compile time or run time.)
1105         * processes.c (CreateProcess): Don't synchronize locking across
1106         processes when forking, when shared memory has been disabled.
1108 2007-04-06  Andreas Faerber  <andreas.faerber@web.de>
1110         * wapi_glob.h:
1111         * wapi_glob.c: remove reference to sys/cdefs.h, use glib instead.
1112         Fixes: 81326
1114 2007-04-05  Dick Porter  <dick@ximian.com>
1116         * io.c:
1117         * io-portability.c (_wapi_io_scandir): Moved from io.c, and
1118         changed to use a cut-down version of glob(3) that has been
1119         extended to match with case-insensitivity if needed.
1121         * wapi_glob.h:
1122         * wapi_glob.c: Cut down implementation of glob(3), based on
1123         OpenBSD.
1125 2007-03-22  Dick Porter  <dick@ximian.com>
1127         * sockets.c (_wapi_connect): Do additional checks when connect(2)
1128         fails, because some systems don't let it be restarted.  Patch
1129         based on one submitted by Robert S Wojciechowski <robertw@ssgx.com>,
1130         fixes bug 81010.
1132 2007-03-09  Jonathan Chambers  <joncham@gmail.com>
1134         * io-layer.h:  Remove UNICODE and _UNICODE defines as 
1135         these are done by configure.in now.
1136         
1137         Code is contributed under MIT/X11 license.
1138         
1139 Thu Mar 8 19:42:17 CET 2007 Paolo Molaro <lupus@ximian.com>
1141         * shared.c: partial support for MONO_DISABLE_SHM env var.
1143 2007-03-05  Wade Berrier  <wberrier@novell.com>
1145         * atomic.h: atomic fixes from Michael Matz for for s390 
1146         and s390x ( bnc #237611 and bxc #80892 )
1148 2007-03-05  Miguel de Icaza  <miguel@novell.com>
1150         * io.c (CreateFile): Use FILE_ATTRIBUTE_TEMPORARY to mean 0600
1151         permissions.  For 80688
1153         (MoveFile): Use errno_copy here, just to avoid a potential
1154         errno-changing code in the future from g_free. 
1155         
1156         Also, ignore EXDEV errors as they are handled immediately after
1157         (avoid printing out an error). 
1159         Fixes: 80655
1161 Mon Feb 12 15:50:24 CET 2007 Paolo Molaro <lupus@ximian.com>
1163         * shared.c: exit if semaphores can't be created (bug #80616).
1165 2007-02-01  Geoff Norton  <gnorton@customerdna.com>
1167         * collection.c: NetBSD doesn't define PTHREAD_STACK_MIN.
1169 2007-01-26  Dick Porter  <dick@ximian.com>
1171         * socket-private.h: 
1172         * sockets.c (_wapi_getsockopt): Windows seems to not reset
1173         SO_ERROR values when they're read, contrary to the documentation.
1174         Fixes the new issues raised in bug 79878 (example in C showing
1175         winsock behaviour attached to that bug.)
1177 2007-01-15 Mark Mason <mason@broadcom.com
1179         * atomic.h: add locking primitives for MIPS.
1180         
1181 2007-01-11  Dick Porter  <dick@ximian.com>
1183         * sockets.c (_wapi_connect): Don't do the SO_BROADCAST setting
1184         here, do it in managed code instead.
1185         (_wapi_getsockopt): SO_RCVTIMEO and SO_SNDTIMEO use struct
1186         timeval, which has a microsecond field, not milliseconds.
1187         (_wapi_setsockopt): ditto.
1188         (_wapi_setsockopt): Halve the SO_SNDBUF and SO_RCVBUF values on
1189         Linux, as the kernel doubles whatever we set.
1190         (_wapi_socket): Save socket domain, type and protocol so it can be
1191         duplicated later.
1192         (socket_disconnect): Implement socket disconnect (closing the
1193         socket, but keeping the file descriptor.)
1194         (wapi_disconnectex): A basic implementation of DisconnectEx().
1195         (wapi_transmitfile): A very basic implementation of
1196         TransmitFile().
1197         (WSAIoctl): Implement the SIO_GET_EXTENSION_FUNCTION_POINTER
1198         ioctl.
1200         * socket-private.h (struct _WapiHandle_socket): Record socket
1201         domain, type and protocol info so it can be duplicated later.
1203         * sockets.h (WSAID_DISCONNECTEX,WSAID_TRANSMITFILE): Structures
1204         and defines needed to look up the DisconnectEx() and
1205         TransmitFile() functions by GUID.
1207         * error.c (errno_to_WSA): Change ETIMEDOUT mapping to
1208         WSAETIMEDOUT; add EDESTADDRREQ.
1210         * io-layer.h: Need mswsock.h on windows now.
1212 2007-01-04  Miguel de Icaza  <miguel@novell.com>
1214         * io-portability.c (find_file): Fix a coverity warning (scanning
1215         being unassigned).   
1217 2006-12-31  Miguel de Icaza  <miguel@novell.com>
1219         * io-portability.c (find_file): Do not abort if an empty filename
1220         has been passed.  This fixes the case where MONO_IOMAP=all would
1221         assert if Directory.Exists ("") was called.
1223 Mon Dec 18 14:54:37 CET 2006 Paolo Molaro <lupus@ximian.com>
1225         * processes.c: moved a free on the error path.
1227 Thu Dec 14 21:42:39 CET 2006 Paolo Molaro <lupus@ximian.com>
1229         * processes.c: fixed a few memory leaks when executing
1230         processes.
1232 Mon Nov 27 13:12:17 GMT 2006 Paolo Molaro <lupus@ximian.com>
1234         * atomic.h: fix arm compare and exchange (bug #78500).
1236 2006-11-23  Dick Porter  <dick@ximian.com>
1238         * process-private.h (struct _WapiHandle_process): Add 'waited'
1239         parameter
1241         * processes.c (process_wait): Check the 'waited' parameter not the
1242         signalled state when testing if a process has already been waited
1243         for, as the child process itself may set signalled when exiting.
1244         Fixes bug 79885.
1246         * wapi-private.h (_WAPI_HANDLE_VERSION): Bump shared data version
1248         * shared.c: Now the shared data version has been incremented we
1249         can set the counter semaphore initial value correctly
1251 2006-11-22  Dick Porter  <dick@ximian.com>
1253         * processes.c (process_wait): Cope when the background process
1254         reaper gets the process we were waiting for.  Special case for
1255         waiting for our own process to exit.  Fixes bug 77736.
1257 2006-11-17  Dick Porter  <dick@ximian.com>
1259         * processes.c: Fix const correctness and typos that caused memory
1260         corruption. 
1261         
1262 2006-11-17  Miguel de Icaza  <miguel@novell.com>
1264         * processes.c (ShellExecuteEx): Check error after CreateProcess,
1265         thanks to Dick for pointing this out. 
1267 2006-11-16  Miguel de Icaza  <miguel@novell.com>
1269         * processes.c (ShellExecuteEx): If we fail to create a process in
1270         ShellExecute, then try to use the xdg-open command, and if that
1271         fails, try to use the gnome-open command, 
1273         Refactor the code so that we do not have to duplicate all this
1274         code, but instead use a ucs2-aware version of the code to do
1275         concatenations.
1277 2006-11-13  Dick Porter  <dick@ximian.com>
1279         * io.c (_wapi_stat_to_file_attributes): If the file is a symlink
1280         add the FILE_ATTRIBUTE_REPARSE_POINT flag.  This is an attempt to
1281         follow the specs for the windows symlink support, but will
1282         probably have to be reworked when I have test data from a vista
1283         machine.  Fixes bug 79887.
1285 2006-11-11  Miguel de Icaza  <miguel@novell.com>
1287         * handles.c (CloseHandle): Cope here with the new value
1288         INVALID_HANDLE_VALUE set on handles.  
1290         * processes.c (CreateProcess): Initialize the value of hThread to
1291         be INVALID_HANDLE_VALUE on failure, not to be NULL.  Improvement
1292         for #75733
1294 2006-11-09  Dick Porter  <dick@ximian.com>
1296         * sockets.c (_wapi_select): Do some sanity checking on the
1297         fd_sets, to avoid file descriptors > FD_SETSIZE.
1298         (_wapi_FD_CLR, _wapi_FD_ISSET, _wapi_FD_SET): Avoid file
1299         descriptors > FD_SETSIZE.
1301 2006-10-27  Dick Porter  <dick@ximian.com>
1303         * io.c (GetFileAttributes): Force symlinks to directories to be
1304         returned as a regular file.  Fixes bug 79733.
1306 2006-10-18  Miguel de Icaza  <miguel@novell.com>
1308         * io-portability.c (find_in_dir): First string dup, then closedir.
1310 2006-10-12  Dick Porter  <dick@ximian.com>
1312         * processes.c (_wapi_process_reap): Unref a process handle if we
1313         reaped it, found by Zoltan.  Fixes bug 79286.
1314         (process_wait): Don't wait again if we've already waited for a
1315         process.
1317 2006-10-11  Sergey Tikhonov <tsv@solvo.ru>
1319         * atomic.h: Fix atomic decrement.
1321         * mini/cpu-alpha.md: Use native long shift insts
1323         * mono/mono/mini/tramp-alpha.c: Implemented
1324         mono_arch_patch_delegate_trampoline method
1326         * Started work on using global registers
1327         
1328         * Use byte/word memory load/store insts if cpu supports it
1329         
1330         * Code clean up
1332         
1333 2006-10-09  Zoltan Varga  <vargaz@gmail.com>
1335         * handles.c (timedwait_signal_poll_cond): Add an alertable parameter, and if it
1336         is FALSE, avoid busy waiting.
1338         * wait.c: Add an alertable parameter to the wait routines.
1340 2006-10-06  Miguel de Icaza  <miguel@novell.com>
1342         * io-portability.c (find_file): Rename from
1343         MONO_IO_PORTABILITY_HELP to MONO_IOMAP.
1345 2006-10-03  Dick Porter  <dick@ximian.com>
1347         * io-portability.h: 
1348         * io-portability.c: Optional portability helpers and wrapped
1349         system calls to try to cope with windows filenames in
1350         applications.
1352         * io.c: Use the wrapped system calls
1354 2006-09-01  Zoltan Varga  <vargaz@gmail.com>
1356         * critical-sections.h critical-sections.c: Make Enter/LeaveCriticalSection a macro
1357         since they are perf critical.
1359         * atomic.h: Applied patch from Jakub Boqusz <qboosh@pld-linux.org>.
1360         Add atomic ops implementation for alpha.
1362 2006-08-11  Dick Porter  <dick@ximian.com>
1364         * processes.c (_wapi_process_reap): Avoid a deadlock by setting
1365         process termination details in an outer loop, not the
1366         _wapi_search_handle() one.
1368 2006-08-10  Dick Porter  <dick@ximian.com>
1370         * threads.c (_wapi_thread_queue_apc)
1371         (_wapi_thread_dispatch_apc_queue): Use a process-local mutex here
1372         instead of the cross process semaphore.  We already check that
1373         access to the APC queue is within the owning process so there's no
1374         need to protect from other processes.  Avoids a global deadlock
1375         when a thread is aborted while it holds the handle semaphore
1376         locked.
1377         (_wapi_thread_apc_pending): Hide an annoying message which can
1378         happen if a thread handle has been blown away at process shutdown
1379         while it is in an alertable wait.
1381         Both problems seen while shutting down monodevelop.
1383 2006-07-25  Dick Porter  <dick@ximian.com>
1385         * shared.c (_wapi_shm_file): Remove '/' characters from the uname
1386         results.  Fixes bug 78917.
1388 2006-07-20  Dick Porter  <dick@ximian.com>
1390         * threads.c (_wapi_thread_set_termination_details): Improve the
1391         test for already-disposed thread handles, and hold the lock around
1392         the mutex abandoning.
1394 2006-07-17  Dick Porter  <dick@ximian.com>
1396         * processes.c (CreateProcess): Don't change directory unless a new
1397         one has been specified.  Fixes bug 78751.
1399 2006-07-06  Dick Porter  <dick@ximian.com>
1401         * io.c (_wapi_stat_to_file_attributes): Do a better job at
1402         figuring out the file attributes
1403         (_wapi_set_last_path_error_from_errno): New helper function to
1404         turn errno into w32 error codes that handles the differences
1405         between file and directory errors
1406         (file_setendoffile): Try turning off the extra write used to
1407         extend files, because we probably don't need it on any modern
1408         platform.  If it is needed though, we also need to lseek the file
1409         position back again
1410         (CreateFile): Treat character-special devices as a console handle,
1411         because they can't be seeked
1412         (CopyFile): If fail_if_exists is set, then the destination needs
1413         to be opened with O_EXCL
1414         (CopyFile): If fail_if_exists is not set and the destination
1415         already exists, then we should set the ERROR_ALREADY_EXISTS error
1416         even though we return success
1417         (stdhandle_create): STD_INPUT_HANDLES cannot be written to
1418         (GetStdHandle): Rework without using mono_once, so console handles
1419         can be properly closed and reopened.
1420         (mono_io_scandir): Only override errno with EACCES when the
1421         directory actually exists
1422         (FindFirstFile): Set ERROR_FILE_NOT_FOUND when no files are
1423         returned
1424         (FindClose): Cope with NULL handles
1425         (CreateDirectory): When the target already exists, just return an
1426         error.  It's the caller's job to figure out what to do.
1427         (SetCurrentDirectory): Cope with a NULL path
1428         (RemoveDirectory, GetFileAttributes, GetFileAttributesEx,
1429         SetFileAttributes, FindFirstFile, DeleteFile, MoveFile, CopyFile,
1430         CreateFile): Set path error correctly
1432         * handles.c (CloseHandle): Kludge to try and cope with passing a
1433         NULL handle
1435         * error.h: Add NO_ERROR as an alternative to ERROR_SUCCESS
1437         * uglify.h: Added some more typedefs
1439 2006-07-05  Dick Porter  <dick@ximian.com>
1441         * io.c (GetFileAttributes, GetFileAttributesEx): Cope with
1442         dangling symlinks.  Fixes bug 78664.
1444 2006-06-23  Dick Porter  <dick@ximian.com>
1446         * handles.c (handle_cleanup): 
1447         * threads.c: Clean up threads properly when we're forcibly
1448         removing the handle entries from the shared file in
1449         handle_cleanup().  Fixes bug 78241, for real this time.
1451 2006-06-15 Neale Ferguson <neale@sinenomine.net>
1453         * atomic.h: More tinkering with InterlockedExchange/InterlockedCompareExchange
1454         for s390/s390x.
1456 2006-06-14 Neale Ferguson <neale@sinenomine.net>
1458         * atomic.h: Fix atomic exchange pointer operations for s390x - these
1459         were broken as they used 32-bit instructions rather than their 64-bit
1460         versions.
1462 2006-06-14  Dick Porter  <dick@ximian.com>
1464         * processes.c: Don't run the atexit handlers when bailing out
1465         of a fork/exec.
1467 2006-06-14  Dick Porter  <dick@ximian.com>
1469         * wait.c: Fix stupid typo shown up by gcc 4.1.1, = not ==
1471         * handles-private.h: 
1472         * shared.c: 
1473         * io.c: 
1474         * processes.c: 
1475         * mono-spinlock.h: 
1476         * handles.c: 
1477         * collection.c: Fix a bunch of signed/unsigned warnings from gcc
1478         4.1.1
1480 2006-06-09 Neale Ferguson <neale@sinenomine.net>
1482         * atomic.h: Fix atomic operations for s390x (not really broken 
1483         but changed to use full 64-bit opcodes).
1485 2006-05-24  Dick Porter  <dick@ximian.com>
1487         * processes.c (process_set_current): Don't take an extra reference
1488         if we have to create our own process handle.  Fixes bug 78241
1489         again.
1491         * threads.c (_wapi_thread_signal_self): Renamed from
1492         _wapi_thread_abandon_mutexes, also sets the thread state to
1493         signalled and drops a reference.  Called by the runtime when the
1494         main thread cleans itself up.
1496         * handles.c (handle_cleanup): As a last resort, unref every shared
1497         handle as the process is now exiting.
1499 2006-05-16  Dick Porter  <dick@ximian.com>
1501         * processes.c (process_set_termination_details): Unref the handle
1502         when we've stored the exit details.  Fixes the rest of 78241.
1504 2006-05-12  Dick Porter  <dick@ximian.com>
1506         * threads.c: Implement pseudo handles, making GetCurrentThread()
1507         match MS behaviour.  Notice when attached threads exit, and unref
1508         the handle.  Fix usage of GetCurrentThread() in other places.
1510         * handles.c (DuplicateHandle): Implement a basic form of
1511         DuplicateHandle().
1513         * wait.c: Fix usage of GetCurrentThread() throughout, and cope
1514         with pseudo handles.
1516 2006-04-26  Miguel de Icaza  <miguel@novell.com>
1518         * io.c (file_close): Oops, do not use DeleteFile which expects
1519         unicode, instead use unlink directly
1521         Add support for the new FileOptions bits on .NET 2.0.
1523         It might be good if Dick reviews these changes.
1524         
1525         * io.c (file_close): If DeleteOnClose is set, then delete the file
1526         before freeing it.
1527         (CreateFile): Do not support encryption per user. 
1528         
1529         If posix_fadvise exists, pass hints on sequential scan and random
1530         access.   Did not figure out what WRITE_THROUGH maps to.
1532 2006-04-26  Dick Porter  <dick@ximian.com>
1534         * sockets.c (WSAIoctl): Check the output buffer is valid before
1535         writing to it.
1537         * handles.c (_wapi_search_handle): Set shared pointer if we find a
1538         shared handle that has been already opened.
1540 2006-04-21  Dick Porter  <dick@ximian.com>
1542         * threads.c (GetCurrentThread): Reference the handle if we return
1543         an already-known thread.
1545 2006-04-07  Dick Porter  <dick@ximian.com>
1547         * processes.c: Fix build for older glib.
1549 2006-04-06  Dick Porter  <dick@ximian.com>
1550         
1551         * processes.c (CreateProcess): Add a reference to the child
1552         process' handle, so it won't be destroyed if this process closes
1553         its copy of the handle.  Fixes bug 77393.
1554         
1555         * processes.c (process_set_current): Fall through to creating a
1556         new one if the handle lookup fails.
1558         * processes.c (_wapi_process_signal_self):
1559         * handles.c (handle_cleanup): The process is exiting, so set the
1560         handle state for this process to signalled.  This should let other
1561         non-related processes wait for this handle.
1562         
1563         * handles.c (_wapi_search_handle): Don't search shared handles in
1564         all cases.
1566         * collection.c (collection_thread): No need to do a collection
1567         scan straight away, do the waiting first.
1569 2006-04-06  Dick Porter  <dick@ximian.com>
1571         * shared.c: Fix parameters in semctl () call.
1573 2006-03-28  Zoltan Varga  <vargaz@gmail.com>
1575         * atomic.h atomic.c: Applied patch from David S. Miller 
1576         <davem@davemloft.net>: Reimplement Interlocked* primitives on sparc 
1577         using CAS/CASx when __GNUC__, else we will fall back to the generic 
1578         pthread version.
1580 2006-03-27  Dick Porter  <dick@ximian.com>
1582         * shared.c (_wapi_shm_file_open): Break out of a loop if the
1583         shared file is smaller than expected.  (We loop a few times in
1584         case another process is in the middle of creating the file.)
1586 2006-03-22  Dick Porter  <dick@ximian.com>
1588         * handles.c:
1589         * wapi-private.h:
1590         * shared.h:
1591         * shared.c: Delete the semaphores and shared files when the last
1592         process has finished with them
1594 2006-03-15  Dick Porter  <dick@ximian.com>
1596         * events.c: 
1597         * io.c: 
1598         * mutexes.c: 
1599         * processes.c: 
1600         * semaphores.c: 
1601         * sockets.c: 
1602         * threads.c: Explicitly initialise the handle ops struct
1604 2006-03-14  Dick Porter  <dick@ximian.com>
1606         * handles-private.h: 
1607         * wapi-private.h: 
1608         * wait.c: 
1609         * handles.c: Add a 'prewait' stage to the handle waiting, to give
1610         waiting threads a chance to check for bogus states before
1611         blocking.
1613         * mutexes.c (namedmutex_prewait): Use the prewait stage to check
1614         for named mutexes that have been abandoned in a locked state (eg
1615         if a process exited abnormally while owning the mutex) and
1616         override it if needed.
1618 2006-03-08 Gonzalo Paniagua Javier <gonzalo@ximian.com>
1620         * wait.c: speed up WaitFor* when the timeout is 0.
1622 2006-03-03  Dick Porter  <dick@ximian.com>
1624         * processes.c (ShellExecuteEx): Cope when some of the parameters
1625         are NULL.
1627 2006-02-27  Dick Porter  <dick@ximian.com>
1629         * mutexes.c: 
1630         * mono-mutex.c: 
1631         * threads.c: Comparing pthread_t with == is not portable, so use
1632         pthread_equal().
1634 Thu Feb 23 18:47:20 GMT 2006 Paolo Molaro <lupus@ximian.com>
1636         * *.h, *.h: patch from Dick to make Linuxthreads systems work again.
1638 2006-02-22  Dick Porter  <dick@ximian.com>
1640         * thread-private.h: 
1641         * threads.c: There's no need to use the timed-thread support code
1642         any more, as we aren't using the timed join.  This greatly
1643         simplifies thread setup, and fixes a memory leak (bug 77521).
1645         Don't bother to store thread IDs in a hash table, use TLS instead.
1646         The one case that needs to look up the handle of a different
1647         thread (OpenThread()) can do the extra work itself.  Fixes bug
1648         77536.
1650         * handles.c (_wapi_search_handle): Add a reference when returning
1651         a private handle (shared handles are already reffed.)
1652         
1653 2006-02-17  Dick Porter  <dick@ximian.com>
1655         * handles-private.h: 
1656         * handles.c: Check handle values passed to array lookups.  Fixes
1657         bug 77572.
1659 2006-02-09  Dick Porter  <dick@ximian.com>
1661         * threads.c: Cope with the problems caused by attaching already
1662         existing threads - they don't get the infrastructure to clean up
1663         after themselves, especially the ID to handle hash.  This fixes
1664         bug 77468.
1666 2006-02-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
1668         * shared.c: use MONO_SHARED_HOSTNAME as a substitute for gethostname()
1669         when creating the shared files in the .wapi directory. Fixes bug #77371.
1671 2006-02-02  Martin Baulig  <martin@ximian.com>
1673         * threads.c: Removed the `WITH_INCLUDED_LIBGC' section; it has
1674         never been used so far. 
1676         * timed-thread.h (TimedThread): Removed the `stack_ptr' field; it
1677         has only been used by the removed code.
1679 2006-01-03  Neale Ferguson <neale@sinenomine.net>
1681         * atomic.h: Correct s390x definitions and eliminate compiler warnings.
1683 2006-01-03  Sebastien Pouliot  <sebastien@ximian.com>
1685         * io.c: Patch _wapi_stat_to_file_attributes against bug #76966, where
1686         sockets could be considered as directory.
1688 2005-12-23  Dick Porter  <dick@ximian.com>
1691         * semaphores.h: 
1692         * semaphores.c: Implement OpenSemaphore
1694         * mutexes.c: 
1695         * mutexes.h: Implement OpenMutex
1697         * wapi-private.h: 
1698         * handles.c: 
1699         * events.c: 
1700         * events.h: 
1701         * event-private.h: Implement named events.  Implement OpenEvent.
1703 2005-12-15  Dick Porter  <dick@ximian.com>
1705         * processes.c (CreateProcess): The pipe-based cross-process
1706         exclusion technique was trying to write NULL buffers when appname
1707         was NULL (eg when coming from ShellExecuteEx,) which usually
1708         succeeded even though EFAULT was returned - but sometimes it
1709         failed.  This meant that the child process could block forever on
1710         the pipe read.  Replace it with the simpler shared handle
1711         semaphore protection used everywhere else.  This showed up with
1712         the test case in bug 76684.
1714 Tue Dec 13 11:41:49 GMT 2005 Paolo Molaro <lupus@ximian.com>
1716         * shared.c: fallback to private mmap when shared mmap doesn't work
1717         (like on jffs).
1719 2005-12-06  Dick Porter  <dick@ximian.com>
1721         * wapi-private.h: 
1722         * handles.c: 
1723         * semaphore-private.h: 
1724         * semaphores.c: Implement named semaphores
1726 2005-11-24  Dick Porter  <dick@ximian.com>
1728         * processes.c (GetProcessId): Implement GetProcessId()
1730 2005-11-17  Dick Porter  <dick@ximian.com>
1732         * processes.h: 
1733         * processes.c: Implement ShellExecuteEx as a wrapper around
1734         CreateProcess.
1736 2005-11-11  Dick Porter  <dick@ximian.com>
1738         * threads.c: Give mutex abandoning its own exported function, so
1739         it can be called when the runtime is cleaning up.
1741         * handles.c (_wapi_search_handle_namespace): Do a handle
1742         collection befre starting to check namespace strings, so that any
1743         stale cruft gets removed.
1745 2005-11-11  Dick Porter  <dick@ximian.com>
1747         * threads.c: Move thread handles back into the shared space.
1749         * handles.c (_wapi_handle_unref): Add support for shared handles
1750         with close() handlers
1752 2005-11-04  Dick Porter  <dick@ximian.com>
1754         * sockets.c (ioctlsocket): Use select instead of if to avoid a
1755         type promotion problem on 64bit freebsd.  Based on patch by Lou
1756         Kamenov <kamenovl@gmail.com>, fixes bug 76447.
1758 2005-11-04  Dick Porter  <dick@ximian.com>
1760         * io.c (file_write): Only do the file locking if
1761         MONO_STRICT_IO_EMULATION is set.
1763 2005-10-21  Dick Porter  <dick@ximian.com>
1765         * processes.c: 
1766         * handles.c (_wapi_lookup_handle): Cope when the shared part of a
1767         handle has been deleted.
1768         (_wapi_handle_unref): And when the deleted shared part is pointed
1769         to as a handle is deleted
1771 2005-10-20  Dick Porter  <dick@ximian.com>
1773         * processes.c (process_set_current): If the expected process
1774         handle slot doesn't contain the correct pid, create a new handle.
1776         * handles.c (_wapi_search_handle): When the search doesn't find
1777         anything, return failure instead of the last handle we looked at.
1778         (_wapi_handle_ref, _wapi_handle_unref): Don't try to ref or unref
1779         unused handles (makes tracking refcounting bugs easier.)
1781 2005-10-19  Dick Porter  <dick@ximian.com>
1783         * handles.c:
1784         * handles-private.h:
1785         * wapi-private.h: 
1786         * processes.c: 
1787         * mutexes.c:
1788         * collection.c (_wapi_handle_collect): Remove the shared handle
1789         indirection layer, and use locking instead.  Delete other
1790         complexity that is no longer needed.  Refcount shared handles and
1791         delete them when needed, but keep the timestamps so that orphaned
1792         handles will be cleaned up eventually.
1794         * shared.c (_wapi_shm_file): Add processor, OS and struct size
1795         info to the shared file names, to cope with dual-boot and 32/64bit
1796         size issues.  Fixes bug 75839.
1798         * wait.c (WaitForMultipleObjectsEx): No need to distinguish
1799         between shared handles and private, as the wait functions cope
1800         with both together now.
1802 2005-10-11 Gonzalo Paniagua Javier <gonzalo@ximian.com>
1804         * io.c: removed NO_SIGPIPE macro.
1805         * sockets.c: no need for MSG_NOSIGNAL or ignoring SIGPIPE.
1807 2005-10-11  Dick Porter  <dick@ximian.com>
1809         * sockets.c (_wapi_getsockopt): Translate SO_ERROR results into
1810         w32 error codes.
1812         * error.c (errno_to_WSA): Don't return a bogus error if someone
1813         asks to translate errno 0.
1815 2005-10-11  Dick Porter  <dick@ximian.com>
1817         * handles.c: Fix several race conditions
1819 2005-10-11 Miguel de Icaza <miguel@novell.com>
1821         * io.c: no need to block SIGPIPE anymore, as it is ignored.
1823 2005-10-05  Dick Porter  <dick@ximian.com>
1825         * threads.c (_wapi_thread_own_mutex, _wapi_thread_disown_mutex):
1826         Keep a reference to mutexes owned by threads, so they won't be
1827         destroyed prematurely.  Fixes dotmsnclient crash.
1829 2005-09-26  Sebastien Pouliot  <sebastien@ximian.com>
1831         * io.c: Apply patch from #76192 (Can't write files past 2gb on AMD64 
1832         (x86_64)) for Brion on IRC (Dick approved it).
1834 2005-09-23  Dick Porter  <dick@ximian.com>
1836         * processes.c: Don't wait for processes that have already been
1837         signalled; also fix typo.
1839         * handles.c: Improve locking inside new handle and handle
1840         searching functions.
1842 2005-09-20  Dick Porter  <dick@ximian.com>
1844         * collection.c: 
1845         * processes.c: Periodically waitpid for known process IDs.  Fixes
1846         bug 74870.
1848 2005-09-15 Gonzalo Paniagua Javier <gonzalo@ximian.com>
1850         * io.c:
1851         (CreateFile): if the file is a named pipe, treat the handle as a pipe,
1852         not as a file. Fixes bug #76075.
1854 2005-08-27  Zoltan Varga  <vargaz@gmail.com>
1856         * atomic.h: Add support for intel icc.
1858 2005-08-25  Zoltan Varga  <vargaz@gmail.com>
1860         * io-layer.h: Include winbase.h not WinBase.h.
1862 2005-08-19  Dick Porter  <dick@ximian.com>
1864         * threads.c, threads.h, thread-private.h: Use a gsize to store the
1865         thread ID, so it can hold a 64 bit value if needed.
1867 2005-07-26 Gonzalo Paniagua Javier <gonzalo@ximian.com>
1869         * error.c: map ENOENT to WSAECONNREFUSED. It might happen when
1870         connecting to unix sockets. Closes bug #75632.
1872 2005-07-05  Dick Porter  <dick@ximian.com>
1874         * io.c: Make sure SIGPIPE is ignored when calling write(2).
1875         Prevents the runtime exiting when writing to a closed pipe,
1876         fixing bug 75468.
1878 2005-06-30  Dick Porter  <dick@ximian.com>
1880         * shared.c (_wapi_shm_semaphores_init): Add some helpful error
1881         messages when semget () fails due to lack of resources.
1883 2005-06-21  Dick Porter  <dick@ximian.com>
1885         * mutex-private.h:
1886         * thread-private.h:
1887         * mutexes.c: 
1888         * threads.c: Keep a list of owned mutexes in each thread handle,
1889         so that it is easier to abandon them when the thread exits.
1890         Removes a bottleneck when multiple threads are finishing in
1891         parallel.
1893 2005-06-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
1895         * io.c: (GetLogicalDrives) when a bogus line is read, don't leak memory.
1896         When the buffer has not enough space, close the file before returning.
1898 2005-06-09  Duncan Mak  <duncan@novell.com>
1900         * *.h: Added G_BEGIN_DECLS and G_END_DECLS where appropriate to
1901         all public headers. Fixes #74919.
1903 2005-05-30  Zoltan Varga  <vargaz@freemail.hu>
1905         * atomic.h: Add IA64 atomic ops.
1907 2005-05-26 Gonzalo Paniagua Javier <gonzalo@ximian.com>
1909         * processes.c: make ExitCode be valid even if the user didn't call
1910         WaitForExit() and is just polling on HasExited.
1912 2005-05-17  Dick Porter  <dick@ximian.com>
1914         * io.c (file_getfilesize): Clear the error value, so that files
1915         with sizes with the low bits 0xFFFFFFFF can be distinguished from
1916         a genuine error.
1918 2005-05-11 Gonzalo Paniagua Javier <gonzalo@ximian.com>
1920         * shared.c: forgot to ignore a warning.
1922 2005-05-10 Gonzalo Paniagua Javier <gonzalo@ximian.com>
1924         * shared.c: don't display warnings after reboots.
1926 2005-05-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
1928         * sockets.c: on windows, getsockopt/setsockopt for send/receive timeout
1929         use an integer in milliseconds. We were using a struct timeval.
1931 2005-05-06  Dick Porter  <dick@ximian.com>
1933         * handles-private.h: 
1934         * mutexes.c: 
1935         * wapi-private.h: 
1936         * shared.h:
1937         * shared.c: 
1938         * wait.c: 
1939         * handles.c: 
1940         * collection.h: Use SysV semaphores for managing access to the
1941         shared memory - in return for the ludicrous api we get
1942         synchronisation primitives that can be cleaned up by the kernel
1943         even when a process quits unexpectedly.  This removes the
1944         timestamp issues.
1946 2005-05-05  Lluis Sanchez Gual  <lluis@novell.com>
1948         * handles.c: Always use polling in the waits, since
1949         mono_cond_timedwait can't be interruped by the thread abort signal.
1951 2005-04-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
1953         * events.c: calling Set on AutoResetEvent several times has the same
1954         effect as calling it only once if no thread is waiting for it.
1956 2005-04-29  Dick Porter  <dick@ximian.com>
1958         * processes.c (EnumProcesses): Use a GArray instead of a GPtrArray
1959         now it's storing pids not handles, also fixes memory leak caused
1960         by unclear glib documentation.
1962         * sockets.c (WSACleanup): Remove unused variable
1964 2005-04-29  Dick Porter  <dick@ximian.com>
1966         * handles.c (_wapi_handle_check_share_by_pid): For systems that
1967         don't have file descriptor info in /proc check that the original
1968         opener of a file is still there, if a share violation would
1969         otherwise happen.
1971 2005-04-28 Gonzalo Paniagua Javier <gonzalo@ximian.com>
1973         * handles.c:
1974         * handles-private.h: added _wapi_handle_forecch that loops through all
1975         the handles and call a callback function when a handle of the given
1976         type is found.
1978         * sockets.c: no need to keep open sockets in an array, as we have them 
1979         in the handles structure.
1981         Fixes bug #74755.
1983 2005-04-28  Dick Porter  <dick@ximian.com>
1985         * processes.c: Cope with handles that are only around for as long
1986         as the search is running.  If we're searching for process handles,
1987         check to see if the process is still running and signal it if not.
1989         * handles.c (_wapi_search_handle): Search in the shared space as
1990         well.  Fixed bug 74752.
1992         * mutexes.c:
1993         * handles.c (_wapi_handle_new_from_offset):
1994         _wapi_handle_new_for_existing_ns () was doing exactly the same as
1995         this, so deleted it.
1997 2005-04-26  Dick Porter  <dick@ximian.com>
1999         * handles.c: Fix stupid thinko where if a new shared handle is
2000         created but a collection was needed to free some space, it
2001         returned an error anyway.  Should fix the messages shown in bug
2002         74659.
2004 2005-04-25  Dick Porter  <dick@ximian.com>
2006         * handles.c (_wapi_handle_check_share): Only consider mono
2007         processes when looking to see if a file is still being held open,
2008         while checking share permissions.
2010 2005-04-25  Dick Porter  <dick@ximian.com>
2012         * sockets.c: 
2013         * io.c: 
2014         * wapi-private.h (struct _WapiHandleOps): 
2015         * handles.c (_wapi_handle_unref): When destroying handles, save
2016         the handle data and call the close function only after the array
2017         slot has been cleared.  This prevents race conditions with file
2018         descriptors, fixing bug 74713.
2020         * mutexes.c: Delete the handle close functions, they didn't do
2021         anything anyway
2023         * error.c (_wapi_get_win32_file_error): Add a mapping for EINTR so
2024         the "Unknown error" g_warning doesn't get displayed.
2026 2005-04-25  Dick Porter  <dick@ximian.com>
2028         * wapi-private.h: 
2029         * threads.c: Make thread handles process-private for now to take
2030         some of the space pressure off the shared memory, while I work on
2031         a real fix.
2033 2005-04-21  Dick Porter  <dick@ximian.com>
2035         * handles.c (_wapi_handle_check_share): Make sure there is a "fd"
2036         dir in /proc before blowing away handle info.  Fixes bug 74649.
2038 2005-04-21  Dick Porter  <dick@ximian.com>
2040         * wait.c (WaitForMultipleObjectsEx): Implement special waits
2042         * handles.c (_wapi_handle_wait_signal_poll_share): Don't return a
2043         timeout, just wait briefly for the private signals and let the
2044         waiting thread test again.  This prevents us missing shared
2045         signals.
2047 2005-04-21  Dick Porter  <dick@ximian.com>
2049         * collection.h (_WAPI_HANDLE_COLLECTION_EXPIRED_INTERVAL): Reduce
2050         the time before a slot is considered too old and deleted.  This is
2051         a workaround while I come up with a proper fix.
2053 2005-04-21  Dick Porter  <dick@ximian.com>
2055         * mutexes.c: 
2056         * processes.c: 
2057         * threads.c: 
2058         * handles.c (_wapi_handle_new): Turn assertions into errors.
2060         * collection.c (_wapi_handle_collect): Use symbols not magic
2061         numbers for timeout values
2063 2005-04-19  Dick Porter  <dick@ximian.com>
2065         * mutexes.c: 
2066         * wait.c: 
2067         * handles.c (_wapi_handle_count_signalled_handles)
2068         * handles-private.h (_wapi_handle_shared_lock_handle): Use new
2069         shared handle locks in critical sections.
2071         * handles.c (_wapi_handle_new_for_existing_ns): Reuse old handles
2072         if there is already one there.
2073         
2074         * handles.c (_wapi_handle_ref): It was possible for a process to
2075         exit before getting around to updating shared handle timestamps,
2076         so do it here too.
2078 Tue Apr 19 16:25:47 CEST 2005 Paolo Molaro <lupus@ximian.com>
2080         * threads.c: fix lookup of the thread id in the has table:
2081         always use the id value, not the pointer to the id.
2083 2005-04-18 Gonzalo Paniagua Javier <gonzalo@ximian.com>
2085         * handles.c: fix handle returned in _wapi_handle_search_handle. Dick
2086         pointed it out.
2088 2005-04-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
2090         * io-layer/sockets.c: FIONBIO with a TRUE argument means we want
2091         non-blocking IO, not the other way around.
2093 2005-04-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
2095         * handles.c:
2096         * io.c:
2097         * handles-private.h: GetFileType wasn't checking if we have memory
2098         allocated for the handle before dereferencing it. Fixes a FileStream
2099         nunit test.
2101 2005-04-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
2103         * handles.c:
2104         * processes.c:
2105         * handles-private.h: we were calling g_renew to expand the handle array,
2106         but that might move the memory and we might have pthread conditions or
2107         mutexes in the original memory area that are being used. Now instead of
2108         expanding an existing array, we just create new ones and keep a list of
2109         them. Access to _wapi_private_handles had to be modified accordingly.
2111 2005-04-15  Dick Porter  <dick@ximian.com>
2113         * collection.c: FreeBSD needs more than PTHREAD_STACK_MIN
2115 2005-04-14  Raja R Harinath  <rharinath@novell.com>
2117         * wapi-private.h: Remove reference to 'daemon-private.h'.
2119 Wed Apr 13 13:12:33 EDT 2005 Paolo Molaro <lupus@ximian.com>
2121         * atomic.h: applied patch from mass@akuma.org (David Waite)
2122         to fix InterlockedExchangeAdd.
2123         Fixed a few other functions, including InterlockedCompareExchange()
2124         which was miscompiled by gcc with optimizations enabled.
2126 2005-04-13  Dick Porter  <dick@ximian.com>
2128         * io.c (share_check): 
2129         * handles.c (_wapi_handle_check_share): Refine the file check so
2130         that sharing violations within the same process don't cause
2131         assertion failures.
2133 2005-04-13  Dick Porter  <dick@ximian.com>
2135         * io.c (FindFirstFile): Fix bugs introduced with the merge (bug
2136         74586)
2138 2005-04-12  Dick Porter  <dick@ximian.com>
2139         
2140         The daemon-less io-layer.  Extensive lowlevel changes in
2141         handles.c, requiring some corresponding changes in other files
2142         calling these functions.  Private_foo structures have been
2143         eliminated.
2145         File descriptor handling differences account for most of the
2146         changes in io.c and sockets.c.
2148         Other highlights:
2149         
2150         * mutexes.c: Named mutexes are now a distinct type.
2151         * atomic.h: Fix a PPC uninitialised variable warning.
2152         * wait.c: Check conditions before waiting on a condition variable.
2153         * processes.c: Handle process fork and wait without a daemon
2154         (though this has the limitation of only being able to wait for
2155         child processes.)
2157 2005-04-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
2159         * io-private.h:
2160         * threads.c:
2161         * threads.h:
2162         * io.c:
2163         * sockets.c:
2164         * sockets.h: removed dead code that deals with async IO.
2166 2005-03-30  Zoltan Varga  <vargaz@freemail.hu>
2168         * atomic.c (InterlockedIncrement): Fix fallback implementation of
2169         InterlockedIncrement and InterlockedDecrement. Fixes #74228.
2171 2005-03-29  Sebastien Pouliot  <sebastien@ximian.com>
2173         * io-layer.h: Add required header files for compiling with VS.NET.
2175 2005-03-17 Miguel de Icaza <miguel@novell.com>
2177         * io.c: don't fail on NFS when there are no more locks available.
2179 2005-03-09  Dick Porter  <dick@ximian.com>
2181         * error.c (_wapi_get_win32_file_error): ENFILE and EMFILE should
2182         map to ERROR_TOO_MANY_OPEN_FILES, not ERROR_NO_MORE_FILES.  Fixes
2183         bug 72671.
2185 2005-03-09  Dick Porter  <dick@ximian.com>
2187         * daemon.c (process_process_fork): Initialise the handle data
2188         before using it in the error case.  This is probably the error
2189         we're working around in the previous change.  Spotted by Taru Jain
2190         <tjain@novell.com> and Hemanth Yamijala <YHemanth@novell.com>.
2192 2005-03-07  Dick Porter  <dick@ximian.com>
2194         * daemon.c: It looks like g_shell_parse_argv() can return
2195         argv[0]=NULL somehow, yet still not give an error.  Make sure we
2196         don't pass NULL to strrchr(), working around a segfault that
2197         showed up on ZLM testing.
2199 2005-03-01 Gonzalo Paniagua Javier <gonzalo@ximian.com>
2201         * sockets.c: translate EINPROGRESS to EWOULDBLOCK in connect. This is
2202         the expected error code showed by the test case in bug #73053.
2204 2005-02-18 Gonzalo Paniagua Javier <gonzalo@ximian.com>
2206         * io.c: another leftover.
2208 Fri Feb 18 17:37:29 CET 2005 Paolo Molaro <lupus@ximian.com>
2210         * io.c: fixed logic in checking errno in rev 40815.
2212 Fri Feb 18 16:00:29 CET 2005 Paolo Molaro <lupus@ximian.com>
2214         * threads.c: we don't depend on the GC checking tls
2215         slots anymore.
2216         * processes.c: remove unused ref to GC headers.
2218 Thu Feb 17 19:57:11 CET 2005 Paolo Molaro <lupus@ximian.com>
2220         * io.c: remove _wapi_thread_cur_apc_pending () checks
2221         when the siscall should return immediatly and handle
2222         the case when a syscall is interrupted without
2223         erroring out, but returning a 0 read/write if possible.
2224         Still the cases of read from file need to be handled.
2226 Tue Feb 8 18:28:11 CET 2005 Paolo Molaro <lupus@ximian.com>
2228         * threads.c: make people test with 1 MB stack per thread.
2230 2005-01-17  Dick Porter  <dick@ximian.com>
2232         * timefuncs.h: Make WapiFileTime endian-aware, as it's often
2233         cast to and from 64bit ints.  Fixes bug 71213.
2235 2005-01-11  Dick Porter  <dick@ximian.com>
2237         * error.c (errno_to_WSA): Add EADDRNOTAVAIL error code
2238         translation.
2240 Mon Jan 10 16:15:19 EST 2005 Neale Ferguson <nealeferguson@earthlink.net>
2242         * atomic.h: Fix functions on s390.
2244 Mon Jan 10 20:30:19 CET 2005 Paolo Molaro <lupus@ximian.com>
2246         * atomic.h: fix some functions on ppc (tests/interlocked.cs).
2248 2005-01-10  Dick Porter  <dick@ximian.com>
2250         * misc.c (_wapi_calc_timeout): Guard against overflow when
2251         calculating timeouts.  This makes waiting with a large
2252         (Int32.MaxValue) timeout not return immediately.
2254 2004-12-23  Ben Maurer  <bmaurer@ximian.com>
2256         * io.c (io_ops): make this `const' so it is shareable (well, only
2257         really shareable if it is statically linked...)
2259 Mon Dec 20 11:58:33 CET 2004 Paolo Molaro <lupus@ximian.com>
2261         * threads.c, threads.h: add accessor to get the pthread_key_t for
2262         a tls id.
2264 2004-12-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
2266         * io.c: check for the existence of 'dest' and set ERROR_ALREADY_EXISTS
2267         if it exists and is not the same as 'src'.
2269 2004-12-01 Neale Ferguson <Neale.Ferguson@SoftwareAG-usa.com>
2271         * atomic.h : Fix InterlockedCompareExchange for s390/s390x.
2273 2004-12-01 Gonzalo Paniagua Javier <gonzalo@ximian.com>
2275         * processes.c: unquote the cmd path, allow for ' or " when quoting and
2276         pass the quoted program name to the daemon, otherwise the call to
2277         g_shell_unquote in the daemon will break things up.
2279 2004-10-14  Dick Porter  <dick@ximian.com>
2281         * sockets.c (_wapi_accept): Revert the previous change.  We now
2282         set the accepted socket to have the same blocking status as the
2283         listening socket in managed code.  This follows MS behaviour.
2284         
2285 2004-10-14  Dick Porter  <dick@ximian.com>
2287         * sockets.c (_wapi_accept): On Darwin, make sure a newly
2288         accept()ed socket is blocking.  Fixes bug 67355, patch by
2289         grompf@sublimeintervention.com.
2291 2004-10-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
2293         * system.c: check the number of online processors instead of the
2294         existing ones. Sanitize return value if it's an error.
2296 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
2298         * system.c: Add support for getting the # of cpus.
2300 2004-09-28  Dick Porter  <dick@ximian.com>
2302         * io.c (pipe_close_private): Fix one small typo in the last change
2303         that totally hosed process creation with redirected pipes.
2305 2004-09-24  Dick Porter  <dick@ximian.com>
2307         * wapi-private.h: 
2308         * sockets.c: 
2309         * socket-private.h: 
2310         * io.c: 
2311         * io-private.h: 
2312         * handles-private.h: Cope when a file descriptor is reused while
2313         the handle that thought it owned it is still referenced, instead
2314         of asserting.  Probably fixes bug 66479, though we've been unable
2315         to reproduce it.
2317 2004-09-09  Dick Porter  <dick@ximian.com>
2319         * error.c:
2320         * io.c: Set error codes everywhere.
2322 2004-09-06  Dick Porter  <dick@ximian.com>
2324         * handles.c (_wapi_handle_unref): Reset the private record's type
2325         (CloseHandle): Check for a fd mapping failure, and return FALSE.
2326         (_wapi_handle_process_fork): Fix long-standing bug in checking
2327         handle return values.  Also do the required bookkeeping with the
2328         new process's handles.
2330         * daemon.c: When creating a new process's handles, check whether
2331         the shared space needs to be increased
2333 2004-09-05  Zoltan Varga  <vargaz@freemail.hu>
2335         * shared.c (_wapi_shm_file): Fix leaking of filename.
2337 2004-08-19  Dick Porter  <dick@ximian.com>
2339         * handles.c (_wapi_handle_count_signalled_handles): Fix thinko
2340         introduced with the fd offset stuff: unlock handles properly when
2341         backing off.  Fixes the monologue hang at exit.
2343 2004-08-18  Dick Porter  <dick@ximian.com>
2345         * sockets.c: 
2346         * io.c: Check that new fds fit in the table, return error if not
2348         * daemon.c (_wapi_daemon_main): 
2349         * handles.c (shared_init): Have all processes agree on a size for
2350         the fd table.
2352 2004-08-17  Dick Porter  <dick@ximian.com>
2354         * daemon.c (process_new): 
2355         * handles.c (_wapi_handle_new_internal): Cope when the space
2356         reserved for file descriptors is larger than the shared segment
2357         size.  Fixes the crash reported when running mono under gdb on
2358         macosx.
2360 2004-08-16  Dick Porter  <dick@ximian.com>
2362         * sockets.c:
2363         * io.c:
2364         * handles-private.h (_wapi_handle_fd_offset_to_handle): Improve
2365         error checking with passed-in file descriptors.
2367 2004-08-11  Dick Porter  <dick@ximian.com>
2369         * sockets.c: 
2370         * io.c: Returned handle values are the file descriptor the handle
2371         encapsulates
2373         * handles.c: 
2374         * handles-private.h: 
2375         * daemon.c: Reserve the range of handles that can have the same
2376         values as file descriptors.  These won't be used, but the values
2377         will be used as file, console, pipe or socket handles.  The fd to
2378         handle mapping is done internally and is invisible to users.
2379         Fixes bug 61828.
2381         * wapi-private.h (_WAPI_HANDLE_VERSION): Increment, because we now
2382         reserve a chunk of handle space.
2384 2004-08-04  Neale Ferguson <Neale.Ferguson@SoftwareAG-usa.com>
2386         * atomic.h: add support for 64-bit S/390
2388 2004-07-22  Dick Porter  <dick@ximian.com>
2390         * timed-thread.c: 
2391         * threads.c: Move the destruction of the internal thread data to
2392         after the thread has been joined.  Fixes bug 61418.
2394 2004-07-14  Dick Porter  <dick@ximian.com>
2396         * wait.c (test_and_own): When not waiting for all handles to
2397         become signalled, only own and return the lowest.  All the
2398         documentation suggests that the old way was correct, but
2399         experimentation shows it actually works like this.  Patch by
2400         Sébastien Robitaille
2401         (sebastien.robitaille@croesus.com), fixes bug 61511.
2403 2004-07-09  Ben Maurer  <bmaurer@ximian.com>
2405         * threads.c: register roots for gc
2407 2004-07-08  Dick Porter  <dick@ximian.com>
2409         * io.c (file_seek): If there is a high 32bit offset part, make
2410         sure the low part isn't sign-extended.  Set error codes when
2411         returning failure.  Fixes bug 61131.
2413 2004-07-06  Dick Porter  <dick@ximian.com>
2415         * io.c (file_setfiletime): Check for underflow when converting to
2416         time_t values.  Set error codes when returning failure.  Fixes bug
2417         60970.
2419 2004-07-05  Dick Porter  <dick@ximian.com>
2421         * mutexes.c (mutex_ops_init): Make the named mutex mutex sharable.
2423         * daemon.c (unref_handle): Only destroy a handle if all processes
2424         have released it, not just the current one.  Fixes bug 60887.
2426 2004-06-30  Zoltan Varga  <vargaz@freemail.hu>
2428         * mono-mutex.h atomic.h: Add G_GNUC_UNUSED to static inline functions
2429         to prevent warnings.
2431 2004-06-24  Dick Porter  <dick@ximian.com>
2433         * mutexes.c: Indicate when a named mutex was reused
2435 2004-06-24  Dick Porter  <dick@ximian.com>
2437         * threads.c (SuspendThread): 
2438         * timed-thread.c (_wapi_timed_thread_suspend): Wrap sem_wait in a
2439         while loop.  See bug 58161.
2441 Wed Jun 23 23:29:04 CEST 2004 Paolo Molaro <lupus@ximian.com>
2443         * io.c: don't use sharemode for on-disk file permissions: it's used
2444         for shared access to the open file.
2446 2004-06-22  Dick Porter  <dick@ximian.com>
2448         * events.c (CreateEvent): When creating an auto-reset event that
2449         is initially owned, make sure the set count starts at 1.
2451 2004-06-18  Dick Porter  <dick@ximian.com>
2453         * event-private.h:
2454         * events.c: Auto-reset events need to release one thread for each
2455         time SetEvent() is called.  Fixes bug 41292.
2457         * threads.h:
2458         * mutex-private.h:
2459         * mutexes.c: Scan for mutexes that are still locked by a thread
2460         when it exits.  Fixes the MS demo app linked by bug 41292.
2462         * wait.c (test_and_own): Make sure a handle is signalled before it
2463         is owned.
2465 2004-06-16  Dick Porter  <dick@ximian.com>
2467         * timed-thread.c: Call the thread cleanup exit routine before taking
2468         the join mutex, because this could deadlock if another thread tries
2469         to join in the meantime.  This fixes the hang-at-exit problem seen
2470         on macos.
2472 2004-06-03  Lluis Sanchez Gual  <lluis@ximian.com>
2474         * threads.c: Implemented SleepEx.
2475         * threads.h: Fixed SleepEx signature.
2477 2004-06-03  Miguel de Icaza  <miguel@ximian.com>
2479         * threads.c: When running under valgrind, do not allocate too much
2480         stack, as Valgrind default is 1 meg.
2482 2004-05-27  Dick Porter  <dick@ximian.com>
2484         * io.h:
2485         * io.c: Implemented LockFile() and UnlockFile()
2487 2004-05-21  Dick Porter  <dick@ximian.com>
2489         * io.c (CreateFile): Check for existing share modes when opening
2490         a file.
2492         * handles.c: 
2493         * handles-private.h: 
2494         * daemon-messages.h: 
2495         * daemon.c: Maintain a hash of file share modes, keying on device
2496         and inode (to cope with symlinks.)
2498 2004-05-20  Lluis Sanchez Gual  <lluis@ximian.com>
2500         * daemon-messages.c: Retry if the communication with the daemon is
2501           interrupted by a signal.
2502         * io.c, sockets.c: Check for EINTR in every syscall that can be interrumped. 
2503           Only return an error in this case if there is something in the apc queue
2504           (which means that it is an interruption requested by the "user").
2505         * processes.c: Use WaitForSingleObjectEx. No need to pass "alertable" as
2506           true since the wait is small.
2507         * shared.c: Retry write calls when interrumped by a signal.
2508         * timed-thread.h, timed-thread.c: added _wapi_thread_apc_pending, which
2509           returns TRUE if there are pending asynchronous calls (APC) for the
2510           provided thread. Also added _wapi_thread_dispatch_apc_queue which calls
2511           the enqueued APCs. Defined a new struct ApcInfo that holds information
2512           about an enqueued APC.
2513         * thread-private.h, threads.c: Implemented QueueUserAPC (which does the same
2514           as in win32),_wapi_thread_apc_pending and _wapi_thread_dispatch_apc_queue. 
2515           These last two methods call the corresponding apc methods in 
2516           thread-private using the provided thread handle.
2517         * threads.h: Added QueueUserAPC.
2518         * uglify.h: Added WapiApcProc (needed by QueueUserAPC).
2519         * wait.c, wait.h: Changed WaitForSingleObject to WaitForSingleObjectEx, and
2520           WaitForMultipleObjects to WaitForMultipleObjectsEx. Implemented support
2521           for APCs in those two methods and also in SleepEx.
2523 2004-05-17  Dick Porter  <dick@ximian.com>
2525         * io.c (CopyFile): Speed up.  Fixes bug 57859.
2527 2004-05-13  Dick Porter  <dick@ximian.com>
2528         * mono-mutex.c (mono_mutex_unlock): Return EPERM when the current
2529         thread doesn't own the mutex, rather than assert()ing.
2531 2004-05-11  Dick Porter  <dick@ximian.com>
2533         * shared.c (_wapi_shm_attach): Cope when a previous daemon startup
2534         attempt failed, leaving shared files that look like a daemon is
2535         still starting.
2537 2004-05-10  Gonzalo Paniagua Javier <gonzalo@ximian.com>
2539         * io.c:
2540         (SetFileAttributes): don't the the exec bit if the corresponding read
2541         bit is not set.
2543 2004-05-10  Zoltan Varga  <vargaz@freemail.hu>
2545         * io.c (FindFirstFile): Fix invalid free.
2547 2004-05-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
2549         * io.c: translate from GFileError to errno codes and don't free
2550         variables right after calling mono_io_scandir, as we may overwrite
2551         errno value.
2553 2004-05-08  Gonzalo Paniagua Javier <gonzalo@ximian.com>
2555         * io.c: g_dir_open return ENOENT for directories on which we don't have
2556         read/execute permission, while returning EPERM for anything below those.
2557         So, change ENOENT by EPERM if the directory exists.
2559 2004-05-07  Dick Porter  <dick@ximian.com>
2561         * io.c (SetFileAttributes): Don't have failed chmod()s cause a
2562         "file not found" error.  Fixes bug 54032.
2563         
2564 2004-05-07  Dick Porter  <dick@ximian.com>
2566         * io.c (FindFirstFile): Comment out a windows-compatibility check
2567         that breaks when directories have metachars in their names.
2568         Workaround for bug 58116.
2570 2004-05-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
2572         * io.c: fixed for FindFirstFile for empty directories. Closes
2573         bug #58147.
2575 2004-05-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
2577         * processes.c: set the start time for the current process. Fixes bug
2578         #58109.
2580 2004-05-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
2582         * io-private.h: 'namelist' is now a gchar ** in _WapiHandlePrivate_find.
2583         * io.c: implemented scandir using glib functions.
2585 2004-05-04  Dick Porter  <dick@ximian.com>
2587         * daemon.c (read_message): Return FALSE on error so the GSource
2588         callback itself can return FALSE.  Cures the infinite loop poll()
2589         warning on MacosX.
2590         * shared.c: Fix some daemon startup race conditions.
2592 2004-04-29  Miguel de Icaza  <miguel@ximian.com>
2594         * io.c (CopyFile): Use 32k buffers to copy the file instead of 2k,
2595         use the stack, do not use dynamic memory.
2597 2004-04-29  Zoltan Varga  <vargaz@freemail.hu>
2599         * io.c: Add scandir implementation for platforms which do not have
2600         it, like solaris.
2602 2004-04-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
2604         * io.[ch]: implemented GetLogicalDriveStrings.
2606 2004-04-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
2608         * io.c:
2609         * sockets.c: use the field name from configure when accessing sigval
2610         pointer field. Makes this work on the Mac.
2612 2004-04-28  Bernie Solomon  <bernard@ugsolutions.com>
2614         * atomic.c: (InterlockedExchange) fix typo for
2615         mutex name
2617 2004-04-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
2619         * io.c:
2620         * sockets.c: added check for sys/aio.h.
2622 2004-04-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
2624         * error.[ch]: added _wapi_get_win32_file_error...
2625         * io.c: ... which was _wapi_get_win32_error here.
2626         * sockets.c: rename the function calls here too.
2628 2004-04-28  Dick Porter  <dick@ximian.com>
2630         * daemon-messages.c: Avoid a deadlock when a thread is killed while
2631         waiting for the daemon by using a recursive mutex.  Helps bug 56699.
2633 2004-04-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
2635         * io.c: fixed leak in async_notifier().
2637         * sockets.[ch]: added AIO support for sockets and fixed WSAIoctl
2638         declaration.
2640         * threads.c: removed old comment.
2642 2004-04-26  David Waite  <mass@akuma.org>
2644         * daemon-messages.h:
2645         * daemon-private.h
2646         * error.h:
2647         * io.h:
2648         * processes.h:
2649         * shared.h:
2650         * thread-private.h:
2651         * wapi-private.h: remove comma from end of enumeration declarations
2652         * status.h: cast unsigned int types to int for enum assignment
2654 2004-04-26 David Waite <mass@akuma.org>
2656         * io.c:
2657         * timefuncs.c: declare 64-bit constants as long long types (i.e.
2658         10ULL)
2660 2004-04-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
2662         * socket-wrappers.h: _wapi_socket == WSASocket now. Added
2663         WSA_FLAG_OVERLAPPED.
2665         * sockets.c: new unused parameters for _wapi_socket.
2667 2004-04-22  Miguel de Icaza  <miguel@ximian.com>
2669         * timed-thread.c: Replace sem_init with MONO_SEM_INIT to handle
2670         the fact that MacOS X is a piece of junk (sem_init is *defined* in
2671         the libc, but they return `not implemented'). 
2673 2004-04-22  Dick Porter  <dick@ximian.com>
2675         * handles.c: 
2676         * handles-private.h: Reference the handle when it is locked, so
2677         that another thread can't blow it away while we're waiting for it
2678         to become signalled.
2679         
2680         * wait.c: 
2681         * timed-thread.c: 
2682         * threads.c: 
2683         * sockets.c: 
2684         * semaphores.c: 
2685         * mutexes.c: 
2686         * mono-mutex.c: 
2687         * io.c: 
2688         * handles.c: 
2689         * handles-private.h: 
2690         * events.c: 
2691         * error.c: 
2692         * daemon-messages.c: 
2693         * critical-sections.c: 
2694         * atomic.c: Added pthreads cleanup handlers and error asserts
2696         * shared.c: 
2697         * handles.c: Fixed the gcc "variable might be used uninitialised"
2698         warnings.  They can't happen, but gcc doesn't know that
2699         g_assert()s don't return.
2701         Fixed the declaration of _wapi_handle_process_kill() so that it
2702         expects the correct type for the pid.
2703         
2704         * threads.c: Removed the TLS_PTHREAD_MUTEX style locking that
2705         hasn't been used in ages and just made the code more complex.
2707 2004-04-17  Zoltan Varga  <vargaz@freemail.hu>
2709         * processes.c: Include <signal.h> for SIGKILL and SIGILL + fix some
2710         warnings. Fixes #57168.
2712 2004-04-16  Dick Porter  <dick@ximian.com>
2714         * threads.c (Sleep): Using div(3) with a negative (when signed)
2715         numerator causes the quotient to be 0 and the remainder to be the
2716         numerator.  This feeds a small negative value to nanosleep(3),
2717         which will return immediately and cause a busy wait.  Fixes bug
2718         56351.
2720 2004-04-15  Dick Porter  <dick@ximian.com>
2722         * io-private.h:
2723         * io.c: Rewrite FindFirstFile and FindNextFile using scandir(3)
2724         and fnmatch(3) instead of glob(3).  glob() can't cope with being
2725         given filenames containing metachars.  This fixes bug 40557.
2727 2004-04-14  Bernie Solomon  <bernard@ugsolutions.com>
2729         * security.c: #warning is a GCC-ism
2731 2004-04-13  Sebastien Pouliot  <sebastien@ximian.com>
2733         * security.c: Removed GetUserName as glib g_get_user_name does a
2734         better (portability) job. Added ImpersonateLoggedOnUser and
2735         RevertToSelf.
2737 2004-04-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
2739         * mono-mutex.h: move pthread_mutex_timedlock declaration to...
2740         * mono-mutex.c: ...here. It was causing a warning that prevented
2741         libgdiplus compilation.
2743 2004-04-04  Miguel de Icaza  <miguel@ximian.com>
2745         * security.c (GetUserName): Make it work on MacOS X
2747 2004-04-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
2749         * security.c: use getpwuid_r if available. This one is thread-safe.
2751 2004-04-02  Sebastien Pouliot  <sebastien@ximian.com>
2753         * Makefile.am: Added security.c|h.
2754         * security.c: New file for security related functions. Added function
2755         GetUserName to fix #56144.
2756         * security.h: New. Header file for security.c
2757         * wapi.h: Added include for security.h
2759 2004-03-25  Gonzalo Paniagua Javier <gonzalo@ximian.com>
2761         * daemon-messages.h: added kill structs.
2763         * daemon.c: implemented process_process_kill.
2764         * handles-private.h:  define process_process_kill.
2765         * handles.c: implemented _wapi_handle_process_kill.
2766         * processes.[ch]: implemented TerminateProcess.
2768 2004-03-25  Bernie Solomon  <bernard@ugsolutions.com>
2770         * daemon.c (rem_fd): On solaris you seem to get an
2771         error even after removing the input source so don't
2772         try and rem_fd it twice.
2774 2004-03-25  Lluis Sanchez Gual  <lluis@ximian.com>
2776         * daemon.c: in process_post_mortem, If the child terminated due to the 
2777         receipt of a signal, the exit status must be based on WTERMSIG, since 
2778         WEXITSTATUS returns 0 in this case.
2780 2004-03-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
2782         * daemon.c: turned a warning into a DEBUG statement. Now we may hit it.
2784 2004-03-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
2786         * daemon.c: only call getdtablesize () once.
2787         * processes.c: wait 500 ms to check if execve failed and throw the same
2788         exception as MS on failure. Fixes bug #32809.
2790 2004-03-17  Bernie Solomon  <bernard@ugsolutions.com>
2792         * io.c (async_notifier): use "union sigval" rather
2793         than sigval_t as Solaris doesn't have sigval_t
2794         (which isn't in IEEE 1003.1 either).
2796 2004-03-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
2798         * io.c: added debug stuff and removed a few redundant lines in
2799         file_write.
2801 2004-03-15  Gonzalo Paniagua Javier <gonzalo@ximian.com>
2803         * io-private.h: added new fields for file structure. Declare
2804         _wapi_io_add_callback.
2806         * io.c: added _wapi_get_win32_error, support aio_read/write in
2807         file_read/write. Implemented _wapi_io_add_callback, which is where
2808         BindHandle ends up.
2809         
2810         * io.h: added new fields for WapiOverlapped and typedef for the
2811         callback.
2813         * processes.c: fixed off-by-one bug when handling environment variables 
2814         passed in.
2816         * threads.[ch]: implemented BindIoCompletionCallback.
2818         * uglify.h: added typedef for LPOVERLAPPED_COMPLETION_ROUTINE.
2820 2004-03-14  Zoltan Varga  <vargaz@freemail.hu>
2822         * socket-wrappers.h: Remove extra semicolon.
2824 2004-03-03  Dave Camp  <dave@ximian.com>
2826         * daemon.c: (add_fd), (fd_activity), (_wapi_daemon_main):
2827         Use a new main context.
2829 2004-03-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
2831         * io.c:
2832         (GetFileAttributes): set the error depending on errno instead of
2833         setting ERROR_FILE_NOT_FOUND always. See bug #55160.
2835 2004-03-01  Gonzalo Paniagua Javier <gonzalo@ximian.com>
2837         * io.c:
2838         (CopyFile): free the buffer on error.
2839         * sockets.c:
2840         (WSAIoctl): free the buffer on error.
2842 2004-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
2844         * error.c: fixed mapping for EPROTONOSUPPORT and ESOCKTNOSUPPORT.
2846         * sockets.[ch]: retry creating the socket for AF_INET, SOCK_RAW
2847         using IP protocol with IP over IP. Implemented WSAIoctl UNIX-style.
2849 2004-01-27  Bernie Solomon  <bernard@ugsolutions.com>
2851         * shared.c (_wapi_shm_file): add hostname
2852         to shared data file names to handle NFS mounted
2853         .wapi directories.
2855 Mon Jan 26 16:15:03 CET 2004 Paolo Molaro <lupus@ximian.com>
2857         * sockets.h: remove obsolete soklen_t typedef.
2859 Fri Jan 23 21:07:02 CET 2004 Paolo Molaro <lupus@ximian.com>
2861         * socket-wrappers.h, sockets.h, sockets.c, Makefile.am: move socket
2862         wrappers to its own non-installed header file.
2864 2004-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
2866         * io.c:
2867         (FindFirstFile): unlock the handle if FindNextFile fails.
2868         (FindNextFile): g_free a couple of pointers before retrying.
2870         * wait.c:
2871         (WaitForMultipleObjects): if only one handle provided, use
2872         WaitForSingleObject.
2874 2003-12-22  Bernie Solomon  <bernard@ugsolutions.com>
2876         * handles-private.h: (_wapi_handle_type) check
2877         for segment in range before using it
2879 2003-12-22  Bernie Solomon  <bernard@ugsolutions.com>
2881         * thread-private.h: _wapi_thread_ops is now const
2882         must match .c file.
2884 Mon Dec 22 18:29:03 CET 2003 Paolo Molaro <lupus@ximian.com>
2886         * threads.c, timed-thread.c, timed-thread.h: use mach
2887         semaphores on Darwin (MacOSX) since the posix ones
2888         are mostly broken there (threads are not created suspended
2889         and they can start executing before they are fully initialized
2890         like in tests/thread-static.cs).
2892 Mon Dec 22 17:18:45 CET 2003 Paolo Molaro <lupus@ximian.com>
2894         * atomic.h: ppc fixes.
2896 2003-12-19  Bernie Solomon  <bernard@ugsolutions.com>
2898         * handles.c: remove my bad use of MONO_ZERO_ARRAY_LENGTH
2899         in HDRSIZE 
2901 2003-12-15  Bernie Solomon  <bernard@ugsolutions.com>
2903         * shared.c: (_wapi_shm_open) make scratch file
2904         not have to immediately regrow to avoid remaps
2905         (HPUX can't cope with these).
2906         (_wapi_shm_attach) use actual size of file
2907         to set scratch data_len for the creating process.
2909         * handles.c: (_wapi_handle_new_internal) make
2910         sure mutex & cond var are initialized even for
2911         non process shared ones. 
2912         (_wapi_handle_unref) always call destroy 
2913         routines on mutex & cond var
2915 2003-12-15  Bernie Solomon  <bernard@ugsolutions.com>
2917         * daemon.c: change channel data structure so
2918         input sources are removed from glib event loop
2919         properly. xsp works better on Solaris and 
2920         fixes #51278
2922 2003-12-12  Bernie Solomon  <bernard@ugsolutions.com>
2924         * wapi-private.h: Replace G_GNUC_PRETTY_FUNCTION
2925         definition with file & line number for non-GCC
2926         compiles.
2928 2003-12-08  Bernie Solomon  <bernard@ugsolutions.com>
2930         * Makefile.am: make sure hppa_atomic.s is in distribution
2932 2003-12-01  Dick Porter  <dick@ximian.com>
2934         * wapi-private.h: 
2935         * mutexes.c (CreateMutex): 
2936         * mutex-private.h (struct _WapiHandle_mutex): 
2937         * handles.c: Look up certain handle types by name, in a shared
2938         namespace.  Currently only mutex handles have this implemented.
2939         Fixes bug 51089.
2941         * semaphores.c (CreateSemaphore): 
2942         * events.c (CreateEvent): Fix signature
2944 2003-11-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
2946         * io.c: don't call g_free before testing errno as it may modify it.
2947         If the path exists, return an error if it's not a directory. Fixes
2948         bug #50753.
2950 2003-11-20  Dick Porter  <dick@ximian.com>
2952         * io.c: Missed a little-endian UTF16 conversion.  Patch from
2953         Jeroen Zwartepoorte (Jeroen@xs4all.nl), fixes bug 51065.
2955 2003-10-29  Dick Porter  <dick@ximian.com>
2957         * io.c (MoveFile): If the move crosses filesystems, try and fall
2958         back to copy and delete.  Patch from Jörg Rosenkranz
2959         (JoergR@voelcker.com), fixes bug 50298.
2961 2003-10-28  Dick Porter  <dick@ximian.com>
2963         * io.c: Use the new encoding conversion to cope with non-utf8
2964         locales in filenames.
2966         * processes.c: Ditto for process arguments.
2968 Tue Oct 21 12:01:14 CEST 2003 Paolo Molaro <lupus@ximian.com>
2970         * atomic.h: some ppc inline asm fixes (incorrect use of labels, 
2971         incorrect register constraints, incorrect clobber lists).
2973 2003-10-13  Bernie Solomon  <bernard@ugsolutions.com>
2975         * Makefile.am hppa_atomic.s: add HP 64bit
2976         implementation of atomic ops
2978 2003-10-13  Zoltan Varga  <vargaz@freemail.hu>
2980         * threads.c (CreateThread): Wrap pthread_attr_setstacksize call in
2981         a conditional for platforms that don't have it.
2983 2003-10-09  Bernie Solomon  <bernard@ugsolutions.com>
2985         * threads.c: (CreateThread) use stacksize argument
2986         if non-zero - change default for 64 bits to 4Mb
2988 2003-09-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
2990         * sockets.c: set last error when socket creation fails. This shed some
2991         light on bug #49015.
2993 2003-09-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
2995         * processes.c: fixed bug #48973: we only change \ by / for the argument
2996         to be used as command.
2997         When getting the program name from the args, don't let the space between
2998         them in the args.
3000 2003-09-24  Bernie Solomon <bernard@ugsolutions.com>
3002         * atomic.h atomic.c: fix sparc so lock is
3003         global, increment does so and it compiles under Sun compiler.
3005 2003-09-22  Bernie Solomon <bernard@ugsolutions.com>
3007         * handles.c: include <string.h> directly as may
3008         not be nested in <sys/un.h> like Linux
3010 2003-09-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
3012         * io.c:
3013         (DeleteFile): call SetLastError on failure. Fix by
3014         richard.torkar@htu.se (Richard Torkar). Closes bug #48222.
3016 2003-09-15  Lluis Sanchez Gual  <lluis@ximian.com>
3018         * daemon.c: In compare_process(), discard handles already signalled.
3020 2003-09-02  Dick Porter  <dick@ximian.com>
3022         * io.c: Work around glib brain-dead assumptions about utf8-encoded
3023         filenames.  Fixes bug 30781.
3025 2003-08-28  Dick Porter  <dick@ximian.com>
3027         * critical-sections.c:  Patch from Bernie Solomon
3028         <bernard@ugsolutions.com> to emit a warning if locking a critical
3029         section fails.
3031 2003-07-23  Dick Porter  <dick@ximian.com>
3033         * shared.c:
3034         * daemon.c (maybe_exit): Avoid the race condition when the daemon is
3035         closing but another client comes along when the shared data is still
3036         visible.  Should fix bugs 33671 and 35213.
3038 2003-07-23  Dick Porter  <dick@ximian.com>
3040         * handles.c:  Initialise handle mutex and cond.  Fix by
3041         Bernie Solomon <bernard@ugsolutions.com>
3043 2003-07-15  Dick Porter  <dick@ximian.com>
3045         * timed-thread.c (timed_thread_start_routine): Fix virtual memory
3046         leak when threads quit.  Fixes bug 44067.
3048 Wed Jun 18 19:08:40 CEST 2003 Paolo Molaro <lupus@ximian.com>
3050         * io.c: never add write permission for group or others in
3051         SetFileAttributes ().
3053 2003-06-17  Dick Porter  <dick@ximian.com>
3055         * io.c (SetFileAttributes): Implement the ReadOnly attribute, and
3056         ignore the unsupported ones ("fixes" bug 44977).
3058 2003-06-17  Lluis Sanchez Gual  <lluis@ximian.com>
3060         * misc.c: fix bug in _wapi_calc_timeout. It gave wrong values for
3061           high ms values (there was an overflow).
3063 2003-06-17  Zoltan Varga  <vargaz@freemail.hu>
3065         * system.h (struct _WapiSystemInfo ): Fix warnings when using gcc-3.3.
3067 2003-06-11  Dick Porter  <dick@ximian.com>
3069         * shared.c: Fix shared directory creation.  Patch from
3070         Pablo Baena <pbaena@uol.com.ar>
3072 2003-06-10  Dick Porter  <dick@ximian.com>
3074         * atomic.c: Delete the useless compile warning
3076 2003-06-09  Dick Porter  <dick@ximian.com>
3078         * daemon.c: Lookup env as a string array.  Fixes bug 44289.  Also
3079         make setting the process handle value in the environment actually
3080         work.
3082         * processes.c: Pretty up the process name, if it happens to be
3083         "mono" such as when another mono process forks "mono foo.exe"
3085 2003-06-05  Dick Porter  <dick@ximian.com>
3087         * processes.c (process_set_current): Don't do an expensive handle
3088         search at application startup, check the environment to see if the
3089         process handle has already been created.
3091         * io.c: Don't do an expensive handle search when creating stdin,
3092         stdout and stderr handles, just create them all the first time one
3093         is requested.
3095         * wapi-private.h:
3096         * shared.c:
3097         * shared.h:
3098         * handles.c:
3099         * handles-private.h:
3100         * daemon-messages.h:
3101         * daemon-private.h:
3102         * daemon.c: Support for "unlimited" number of handles and scratch
3103         data.
3105         Speed up application startup by passing process handle in the
3106         environment, rather than let the app scan all handles (which gets
3107         really slow when there are more than a few thousand to check.)
3109         Initialise some structs passed to syscalls, noticed by valgrind.
3110         
3112 2003-05-20  Dick Porter  <dick@ximian.com>
3114         * io.c (FindFirstFile): Include . files in the glob.  Fixes bug
3115         43229.
3117 2003-05-19  Dick Porter  <dick@ximian.com>
3119         * threads.c: Set the new thread's stack size to 2M.  Fix needed
3120         for BSD, reported by Martin Dvorak <md@9ll.cz>
3122 2003-05-16  Dick Porter  <dick@ximian.com>
3124         * io.h:
3125         * io.c: Implement GetTempPath()
3127 2003-05-16  Dick Porter  <dick@ximian.com>
3129         * processes.c (CreateProcess): Set some error codes
3131 2003-05-12  Dick Porter  <dick@ximian.com>
3133         * misc.c (_wapi_calc_timeout): Cope with overflowing tv_nsec.
3134         Patch from Martin Dvorak <mdvorak@ninell.cz>.
3136 2003-05-10  Dick Porter  <dick@ximian.com>
3138         * io.c (CopyFile): Copy file mode as well as file data.  Based on
3139         suggestion by Giuseppe Greco <giuseppe.greco@agamura.com>, bug
3140         42706.
3142 2003-05-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
3144         * handles.c: don't call GC_gcollect when creating new handles.
3146 2003-05-05  Gonzalo Paniagua Javier <gonzalo@ximian.com>
3148         * handles.c: added some debugging code. Call GC_gcollect
3149         before creating a new handle. It makes Lupus' test run smoother and
3150         faster (from 62 to 83 request per second). Notice that calling
3151         GC_finalizer_notifier if needed (GC_should_invoke_finalizer ()) does
3152         not improve nor degrade the performance, so i don't do it.
3154 2003-05-02  Dick Porter  <dick@ximian.com>
3156         * sockets.c: Rearrange closesocket() and socket_close_private(),
3157         and remember to unref the handle, so we don't leak socket handles.
3158         Fix from Pelle Johnsen <pelle.johnsen@mail.dk>
3160 2003-04-11  Dick Porter  <dick@ximian.com>
3162         * atomic.h: ARM atomic operations by Malte Hildingson
3163         <tds00mahi@tellus.thn.htu.se>
3165 Tue Apr 8 11:37:29 CEST 2003 Paolo Molaro <lupus@ximian.com>
3167         * atomic.h: fix macosx build by "Urs C. Muff" <umuff@quark.com>.
3169 2003-04-03  Martin Baulig  <martin@ximian.com>
3171         The following change is conditional to `WITH_INCLUDED_LIBGC'
3172         which is not yet enabled by default.
3174         * threads.c (SuspendThread, ResumeThread): Fully implemented this.
3175         (gc_init): New static function; install a signal handler for
3176         SIGPWR which is used to suspend threads.  [FIXME: it SIGPWR
3177         doesn't exist on all Unix systems, we need to find another
3178         signal].
3179         (mono_wapi_push_thread_stack): New public function.  Tells the
3180         garbage collector about the current stack pointer of a suspended
3181         thread.
3183 2003-04-03  Martin Baulig  <martin@ximian.com>
3185         * timed-thread.h (TimedThread): Added `suspended_sem',
3186         `suspend_count' and `stack_ptr'.
3188 2003-03-28  Dick Porter  <dick@ximian.com>
3190         * atomic.h: PPC support gratiously donated to the public domain
3191         by John Duncan <jddst19@mac.com>
3193 2003-03-20  Dick Porter  <dick@ximian.com>
3195         * sockets.c (_wapi_connect): If connect() fails with EACCES, try
3196         setting SO_BROADCAST and connecting again.  Fixes bug 39178.
3198 2003-03-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
3200         * processes.c: included Jerome Laban's patch and call SetLastError when
3201         the executable is not found.
3203 2003-03-03  Dick Porter  <dick@ximian.com>
3205         * io.c (CreateFile): Try opening directories readonly, so that
3206         timestamps can be adjusted.  Patch by Elan Feingold
3207         <efeingold@mn.rr.com>.
3209 2003-02-25  Dick Porter  <dick@ximian.com>
3211         * shared.c (_wapi_shm_attach): Return a failure code on system
3212         call errors, rather than exiting.
3214 2003-02-21  Dick Porter  <dick@ximian.com>
3216         * processes.c (GetCurrentProcessId): Use the current process
3217         handle to return the process ID, as getpid() is unreliable
3218         (linuxthreads gives each thread a different pid).  Fixes bug
3219         37550.
3221 2003-02-21  Dick Porter  <dick@ximian.com>
3223         * io.c (FindNextFile): Skip over dangling symlinks.  Fixes bug
3224         34076.
3226 2003-02-11  Dick Porter  <dick@ximian.com>
3228         * timefuncs.h: 
3229         * timefuncs.c: Added GetTickCount()
3231 2003-02-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
3233         * error.c: added WSA_EHOSTUNREACH mapping.
3235 2003-01-26  Miguel de Icaza  <miguel@ximian.com>
3237         * io.c (SetFileAttributes): This routine is not currently
3238         implemented for the general case, but I added a special case to
3239         set the executable bit on Linux.
3241 Wed Jan 15 15:55:40 CET 2003 Paolo Molaro <lupus@ximian.com>
3243         * sockets.h, daemon.c, io.c: compilation fixes on MacOSX.
3245 2003-01-08  Dick Porter  <dick@ximian.com>
3247         * sockets.c: Fixed setting blocking mode to true (fixes bug 36388)
3249 2002-12-11  Juli Mallett  <jmallett@FreeBSD.org>
3251         * daemon.c, handles-private.h, handles.c, wapi-private.h:
3252         Check for an implementation which says it supports
3253         _POSIX_THREAD_PROCESS_SHARED, rather than just one that
3254         defines the symbol.  Defined but with a value of -1 still
3255         means that it is unsupported.
3257 2002-12-08  Martin Baulig  <martin@ximian.com>
3259         * handles.c (_wapi_handle_new): Create new non-shared handles with
3260         an initial refcount of 1, not 0.
3262 2002-11-22  Dietmar Maurer  <dietmar@ximian.com>
3264         * threads.c (TlsGetValue): removed unnecessary mutex
3266 2002-11-20  Dick Porter  <dick@ximian.com>
3268         * timed-thread.c (_wapi_timed_thread_attach): Attached threads
3269         need to store their data structure too.
3271         * threads.c: Make sure the threading data is initialised wherever
3272         it is needed
3274 2002-11-15  Dick Porter  <dick@ximian.com>
3276         * timed-thread.c: Removed unneeded parameters in
3277         _wapi_timed_thread_attach().
3279         * threads.c: Renamed AttachThread() to make it not look like
3280         external API.  Removed unneeded parameters.
3282 2002-11-11  Gonzalo Paniagua Javier <gonzalo@ximian.com>
3284         * error.[ch]: added errno_to_WSA (). It displays a warning and return
3285         WSASYSCALLFAILURE if there is no error mapping for the given errno,
3287         * sockets.c: use errno_to_WSA and fixed display of warning for h_errno.
3289 2002-10-31  Dick Porter  <dick@ximian.com>
3291         * io.h: 
3292         * io.c: Define and use INVALID_FILE_ATTRIBUTES
3294 2002-10-07  Dick Porter  <dick@ximian.com>
3296         * timefuncs.c:
3297         * daemon.c: Use a more accurate time source for process start and
3298         end times.
3300 2002-10-03  Dick Porter  <dick@ximian.com>
3302         * daemon.c:
3303         * handles.c:
3304         * threads.c:  Fixes for freebsd.  Make sure that mutex and condition
3305         creation and deletion happen in the process that owns them, when
3306         POSIX shared thread objects aren't supported.  This breaks on
3307         freebsd, as pthread_t is a pointer to data.
3309 2002-10-02  Dick Porter  <dick@ximian.com>
3311         * shared.c: Use mmap() instead of sysv shm for the shared data.
3313         * wapi-private.h (_WAPI_HANDLE_VERSION): Reset back to 0, for the
3314         new system
3316         * daemon-private.h: 
3317         * daemon.c: mmap()ed regions survive fork, so just pass the
3318         pointer to _wapi_daemon_main instead of mapping it again.
3320 2002-10-01  Dick Porter  <dick@ximian.com>
3322         * timed-thread.c: Kludge for CREATE_SUSPENDED thread creation.
3323         Unfortunately libgc uses the same thread suspend technique that I
3324         want to, and the two don't mix: libgc will deadlock when it tries
3325         to stop the world if a thread has already been suspended by
3326         someone else.  Just do the simple suspended create rather than the
3327         general purpose thread suspension for now.
3329         * threads.c: Pass create flags to the timed_thread create call, to
3330         implement suspended thread creation.  ResumeThread() partially
3331         implemented, to cope with the case where a newly created but
3332         suspended thread is launched.
3334 2002-09-30  Dick Porter  <dick@ximian.com>
3336         * sockets.c (ioctlsocket): Set non-blocking mode in a better way,
3337         with fcntl.
3339 2002-09-27  Dick Porter  <dick@ximian.com>
3341         * semaphores.c: Only include semaphore.h if it's present. Patch
3342         for BSD from jmmv@hispabsd.org (Julio Merino).
3344 2002-09-27  Dick Porter  <dick@ximian.com>
3346         * processes.c: Pass environment and working directory to the
3347         daemon when forking.  Don't let argv[0] be duplicated when looking
3348         for the program name.  Implement EnumProcessModules (simple
3349         version for now, lsof-style later if needed), GetModuleBaseName,
3350         {Get,Set}ProcessWorkingSetSize (just faked, because the vm hints
3351         aren't available on Linux).
3353         * process-private.h: Store the process name, and the working set
3354         min and max
3356         * handles.c:
3357         * handles-private.h: New functions to store and retrieve an array
3358         of strings in the scratch space
3360         * daemon.c: Don't miss deleting some handles when a client exits
3361         (we used to rely on the client doing the final cleanup, but
3362         obviously if the client is no longer there the daemon has to do
3363         it).
3365         Process forking now sets the environment and the working
3366         directory.
3368         * io.c: Don't confuse fd 0 with an unassigned handle struct
3370         * atomic.h: Add a google cache alternative to the msdn URL
3372 2002-09-25  Gonzalo Paniagua Javier <gonzalo@ximian.com>
3374         * sockets.c:
3375         (_wapi_recvfrom): added ECONNRESET to the switch.
3377 2002-09-24  Mark Crichton  <crichton@gimp.org>
3379         * atomic.h: Yea.  On linux, sparc isn't sparc, it's __sparc__.
3380         Added to ifdef.
3382 2002-09-19  Mark Crichton  <crichton@gimp.org>
3384         * daemon.c, shared.c: Added NEED_LINK_UNLINK for systems that
3385         dont have Linux's abstract filesystem for sockets.
3387 2002-09-19  Mark Crichton  <crichton@gimp.org>
3389         * atomic.h: Added SPARC atomic asm code.
3390         * daemon.c, handles-private.h, handles.c, wapi-private.h:
3391         undefined _POSIX_THREAD_PROCESS_SHARED.  This actually exists on
3392         Solaris 9, however, the code paths don't seem to work.  More testing
3393         on the shared case is *really* needed.
3395 2002-09-03  Dick Porter  <dick@ximian.com>
3397         * threads.h: 
3398         * threads.c: Removed PosixKillThread(), because it's not in the
3399         w32 api
3401 2002-08-20  Dick Porter  <dick@ximian.com>
3403         * handles.c (_wapi_handle_scratch_store): Made stored byte lengths
3404         multiples of 4 bytes, to keep header structures aligned.  Needed
3405         for sparc, at least. (Patch from crichton@gimp.org)
3407         * handles.c: Removed 'disable_shm' variable (we've defaulted to
3408         building with shm enabled for months now)
3410 2002-08-19  Dick Porter  <dick@ximian.com>
3412         * daemon.c: Rewrote the poll() loop to use GIOChannels instead,
3413         for legacy NeXT-based systems.
3415 2002-08-12  Dick Porter  <dick@ximian.com>
3417         * atomic.h: Rename some parameters to avoid c++ keywords (Patch
3418         from Joseph Wenninger <kde@jowenn.at>)
3420 2002-08-05  Dietmar Maurer  <dietmar@ximian.com>
3422         * threads.c: use fast spinlocks by default
3424 2002-08-02  Dick Porter  <dick@ximian.com>
3426         * io.c (GetStdHandle): Add a handle reference when returning a
3427         duplicate console handle.  This fixes the unref_handle errors in
3428         NUnit.
3430 2002-08-01  Dietmar Maurer  <dietmar@ximian.com>
3432         * threads.c (TLS_PTHREAD_MUTEX): define this because else some
3433         tests does not work
3435 2002-08-01  Dick Porter  <dick@ximian.com>
3437         * threads.c: Use atomic spinlocks in TLS functions
3439         * mono-spinlock.h:
3440         * Makefile.am: Added mono-spinlock.h
3442 2002-07-21  Jeffrey Stedfast  <fejj@ximian.com>
3444         * daemon-messages.c: #include <sys/types.h> and <sys/sockets.h> -
3445         these are needed for sendmsg() and also for struct msghdr (at
3446         least on Solaris). Solaris still won't build because struct msghdr
3447         doesn't have msg_flags, msg_control, or msg_controllen members.
3448         (CMSG_SPACE): Define for systems that don't have it.
3449         (CMSG_LEN): Same.
3451 2002-07-20  Dick Porter  <dick@ximian.com>
3453         * wapi-private.h:
3454         * io-private.h:
3455         * io.h:
3456         * io.c:
3457         * handles.c: Implemented pipe handles
3458         
3459         * handles.c:
3460         * daemon.c: Fixed bug in handle closing.
3462         * shared.c:
3463         * daemon.c: Forked processes now close all open file descriptors.
3465 Fri Jul 19 19:05:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
3467         * sockets.h, io-layer.h, critical-sections.h: don't include config.h
3468         in header files.
3470 2002-07-19  Martin Baulig  <martin@gnome.org>
3472         * threads.c (ExitThread): Call exit() if no threads has been
3473         created yet.
3475 2002-07-17  Dick Porter  <dick@ximian.com>
3477         * daemon-messages.c: Freebsd fixes from Andreas Kohn
3478         <andreas.kohn@gmx.net>
3480 2002-07-15  Dick Porter  <dick@ximian.com>
3482         * io.c: Removed bogus console_flush() method, that was just cut
3483         and pasted from file_flush when I separated the two handle types.
3485 2002-07-12  Dick Porter  <dick@ximian.com>
3487         * io.c (convert_from_flags): Fixed misunderstanding wrt fcntl
3488         flags.  Fixes bug 27633.
3490 2002-07-12  Dick Porter  <dick@ximian.com>
3492         * wapi-private.h:
3493         * handles.c:
3494         * daemon.c: Use size of sockaddr_un.sun_path from config.h
3496 2002-07-12  Dick Porter  <dick@ximian.com>
3498         * processes.c (CreateProcess): Send stdin, stdout and stderr
3499         handles if the startup info doesnt specify new ones
3501         * io.c (GetStdHandle): Return the same handle when the same
3502         standard handle is requested
3504         * handles.c: Pass file descriptors when forking
3506         * daemon.c: Use supplied file descriptors when forking a new
3507         process
3509         * daemon-messages.h: 
3510         * daemon-messages.c: Pass stdin, stdout and stderr file
3511         descriptors to the daemon (used when forking)
3513 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
3515         * daemon.c (_wapi_daemon_main): Use sizeof
3516         (main_socket_address.sun_path) instead of hardcoded 108 value.
3518         * handles.c (shared_init): Use sizeof
3519         (shared_socket_address.sun_path) instead of hardcoded 108 value.
3521 2002-07-10  Dennis Haney  <davh@davh.dk>
3523         * shared.c:
3524         * handles.c:
3525         * daemon.c: Lots of documentation, some added error checking, and
3526         code readability improvements.
3528         * daemon-messages.h: Add the Error request type to improve error
3529         checking.
3531         * daemon-messages.c: Do a bit more error checking on send() and
3532         recv(), and log errors with a higher severity level.
3534 2002-07-04  Dick Porter  <dick@ximian.com>
3536         * daemon.c (process_process_fork): Fix argument handling, due to
3537         buggy understanding of g_strsplit() behaviour.
3539 2002-07-03  Dick Porter  <dick@ximian.com>
3541         * threads.h:
3542         * threads.c: Implement OpenThread().  Define access-control values
3543         for thread handles.
3545         * wapi.h:
3546         * processes.h:
3547         * access.h:
3548         * Makefile.am: Added access.h, to hold shared access-control
3549         definitions
3551 2002-07-02  Dick Porter  <dick@ximian.com>
3553         * wapi-private.h (_WAPI_HANDLE_VERSION): New protocol version
3554         
3555 2002-07-02  Dick Porter  <dick@ximian.com>
3557         * handles.c (shared_init): Make a second attempt to contact the
3558         daemon if the shared memory attach succeeds, but the connect()
3559         fails. (This copes with the daemon crashing without cleaning up
3560         the shared memory.)
3562         * Makefile.am: 
3563         * daemon-private.h:
3564         * daemon.c:
3565         * shared.c (_wapi_shm_attach): Don't exec() anything when we fork
3566         the daemon, it's now built into the library.
3568 2002-06-25  Dick Porter  <dick@ximian.com>
3570         * handles.c:
3571         * handles-private.h:
3572         * daemon-messages.h:
3573         * daemon.c: Process forking and handle data management
3575         * processes.h:
3576         * process-private.h:
3577         * processes.c: Process forking and other support functions
3579 2002-06-25  Dick Porter  <dick@ximian.com>
3581         * versioninfo.h: PE resource decoding
3583         * unicode.c (_wapi_unicode_to_utf8): g_utf16_to_utf8 doesnt need
3584         to be told the string length
3586         * io.c: Removed the ACTUALLY_DO_UNICODE option.  Fixed some leaks.
3587         Moved _wapi_time_t_to_filetime and the WapiFileTime typedef to
3588         timefuncs.c
3590 2002-06-12  Dick Porter  <dick@ximian.com>
3592         * daemon.c: 
3593         * daemon-messages.c: Handle SIGPIPE in a non-stupid way in the
3594         daemon, if MSG_NOSIGNAL isn't available.  Thanks to Jaroslaw
3595         Kowalski <jarek@atm.com.pl> for pointing out the bogosity.
3597 2002-06-10  Jaroslaw Kowalski <jarek@atm.com.pl>
3599         * sockets.c, daemon-messages.c: Prevent SIGPIPE from being raised
3600         when writing to a closed socket.
3602 2002-06-08  Jeffrey Stedfast  <fejj@ximian.com>
3604         * mono-mutex.c (mono_once): New convenience function for my
3605         previous fix.
3607         * handles.c:
3608         * error.c: 
3609         * critical-sections.c: 
3610         * threads.c: 
3611         * sockets.c: 
3612         * semaphores.c: 
3613         * processes.c: 
3614         * mutexes.c: 
3615         * io.c: 
3616         * events.c: 
3617         * atomic.c: Use mono_once() rather than pthread_once().
3619 2002-06-06  Jeffrey Stedfast  <fejj@ximian.com>
3621         * handles.c (_wapi_handle_new): pthread_once() is not atomic, so
3622         if multiple threads all try to call _wapi_handle_new() before the
3623         shared data has been initialized, it is possible that we could get
3624         into a condition where shared_init() is being executed and later
3625         threads will pass by pthread_once() due to the fact that it has
3626         already been called and so therefor will attempt to use the shared
3627         data before it has been completely initialized. If we instead use
3628         a standard mutex locking mechanism around shared_init(), we can
3629         avoid the situation entirely. By wrapping the mutex locking in a
3630         check to see if we've already initialized the data, we can even
3631         avoid wasting resources by having to lock/unlock the mutex in any
3632         later calls (the only time we'd have to worry about
3633         locking/unlocking is the initial race to call shared_init() at
3634         startup).
3636 Sat Jun 1 13:27:11 CEST 2002 Paolo Molaro <lupus@ximian.com>
3638         * atomic.h: inline asm fixes from Dennis Haney (davh@davh.dk).
3640 Fri May 31 16:21:54 CEST 2002 Paolo Molaro <lupus@ximian.com>
3642         * daemon.c, handles.c: rename "sun" local var since it's apparently
3643         a #define on Solaris.
3645 Fri May 31 15:40:14 CEST 2002 Paolo Molaro <lupus@ximian.com>
3647         * daemon-messages.c: work-around MSG_NOSIGNAL missing on some
3648         platforms.
3650 2002-05-15  Dick Porter  <dick@ximian.com>
3652         * wait.c: Fix a deadlock in WaitForMultipleObjects
3654 2002-05-14  Dick Porter  <dick@ximian.com>
3656         * io.c: Fix a cut&paste error, found by
3657         Jaroslaw Kowalski <jarek@atm.com.pl>
3659 2002-05-10  Dan Lewis  <dihlewis@yahoo.co.uk>
3661         * io.c: Nasty typo.
3663 2002-05-09  Dick Porter  <dick@ximian.com>
3665         * threads.c: 
3666         * semaphores.c: 
3667         * processes.c: 
3668         * mutexes.c: 
3669         * handles-private.h: 
3670         * events.c: 
3671         * Makefile.am: Remove now-unused file wait-private.h
3673 2002-05-08  Dick Porter  <dick@ximian.com>
3675         * shared.c: Better error messages, and report when daemon
3676         connection fails rather than blocking forever.  Do some more
3677         shared memory sanity checking.
3679         * handles.c: Better error messages when connecting to shared
3680         memory and the handle daemon.  Fall back to non-shared handles if
3681         an error occurs.  Set the default back to 'shared handles'.  Fix a
3682         crashing bug in scratch space allocation that mangled the block
3683         headers.
3685 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
3687         * handles.c (shared_init): Disable SHM for now, people have too
3688         many problems with this, and the diagnostics are not helping.
3690 2002-05-06  Dan Lewis  <dihlewis@yahoo.co.uk>
3692         * io.c: CreateFile sets win32 last error.
3694 2002-05-05  Dick Porter  <dick@ximian.com>
3696         * wapi-private.h: 
3697         * handles-private.h:
3698         * io.c: 
3699         * io-private.h:
3700         * mutexes.c: 
3701         * mutex-private.h: 
3702         * processes.c: 
3703         * process-private.h: 
3704         * semaphores.c: 
3705         * semaphore-private.h: 
3706         * sockets.c: 
3707         * socket-private.h: 
3708         * events.c: 
3709         * event-private.h: Simplify the WapiHandleOps struct: take out all
3710         the file-specific entries, leaving just the items that operate on
3711         handles themselves.  Split the close operation into shared and
3712         private parts: shared close is called by the daemon.
3714         * handles.c: As above, but also pass handle allocation, ref and
3715         unref operations to the daemon.  Populate the handle_ops array at
3716         compile time, because the daemon needs to call ops on handles too.
3717         Don't bother to track open handle counts any more, the daemon does
3718         that.
3719         
3720         * threads.c: 
3721         * thread-private.h: As above, but also make the thread data
3722         handle-private.
3724         * shared.c: Fork a handle daemon if the calling process created
3725         the shared memory segment.
3727         * daemon.c:
3728         * daemon-messages.c:
3729         * daemon-messages.h:
3730         * Makefile.am: Build a daemon to manage handle allocation and
3731         destruction without needing to lock the shared memory
3733 2002-04-30  Jeffrey Stedfast  <fejj@ximian.com>
3735         * atomic.c: Changed to use a normal mutex rather than a spinlock
3736         since a lot of platforms seem to not have them :\
3738 2002-04-30  Dick Porter  <dick@ximian.com>
3740         * Completely rewrote the handle waiting code: removed the helper
3741         thread and its attendant complexity.  All handle waiting is now
3742         abstracted into the WaitForSingleObject() and
3743         WaitForMultipleObjects() functions.
3745         * Implemented inter-process sharing of handles using sysv shared
3746         memory.  This makes handles even more opaque, with a handle now
3747         just an index into an array.
3748         
3749 2002-04-25  Dan Lewis  <dihlewis@yahoo.co.uk>
3751         * io.c: unitialized pointer in GetCurrentDirectory.
3753 Sat Apr 20 13:37:39 CEST 2002 Paolo Molaro <lupus@ximian.com>
3755         * threads.c: destroy the mutex at thread destruction
3756         (if/when thread destruction code will be actually called).
3757         When protecting a tls data pointer from the gc, use also the 
3758         thread id in the key.
3759         
3760 Wed Apr 17 18:36:27 CEST 2002 Paolo Molaro <lupus@ximian.com>
3762         * timed-thread.c: avoid race condition when setting the thread to
3763         detached.
3765 2002-04-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
3767         * jit.h: to more #include lines to avoid breaking compilation
3768         under windows when upgrading mingw and w32api to version
3769         1.3 (thanks Dick!).
3771 2002-04-16  Dick Porter  <dick@ximian.com>
3773         * atomic.h: Explanatory comment about lack of 80386 support
3775 2002-04-15  Dick Porter  <dick@ximian.com>
3777         * atomic.h: use xaddl for InterlockedIncrement() and
3778         InterlockedDecrement().  Use cmpxchgl in a loop for
3779         InterlockedExchange() and InterlockedExchangePointer().
3781 Mon Apr 15 13:31:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
3783         * unicode.c: fix unicode_len() to not access uninitialized memory
3784         (and updated to conform to mono code style).
3786 Fri Mar 29 17:15:11 CET 2002 Paolo Molaro <lupus@ximian.com>
3788         * io.c: EEXISTS is ignored for directory creation.
3789         * mono-mutex.h: remove silly "pragma }" that emacs users insert
3790         because they use a broken editor:-)
3792 2002-03-28  Dick Porter  <dick@ximian.com>
3794         * sockets.h: 
3795         * sockets.c: 
3796         * io.c: 
3797         * handles.h: 
3798         * handles.c: Warning cleanups
3800 2002-03-27  Dan Lewis <dihlewis@yahoo.co.uk>
3802         * unicode.h, unicode.c: changed to gunichar2
3803         * io.h, io.c: changed strings to gunichar2*, added
3804         SetFileAttributes(), GetCurrentDirectory(), SetCurrentDirectory(),
3805         some fixes to FindFirstFile() and friends.
3807 2002-03-26  Dick Porter  <dick@ximian.com>
3809         * types.h: Implement the large integer struct
3811         * timefuncs.h:
3812         * timefuncs.c: Dummy functions that don't yet implement
3813         QueryPerformanceCounter() and QueryPerformanceFrequency()
3815         * threads.h:
3816         * threads.c: Implement SleepEx()
3818         * system.h:
3819         * system.c: Beginnings of GetSystemInfo()
3821         * mono-mutex.c (pthread_mutex_timedlock): Fix a ms/ns conversion
3822         thinko
3824         * context.h:
3825         * context.c: Dummy function that doesnt yet implement
3826         GetThreadContext()
3828         * atomic.h: 
3829         * atomic.c: Interlocked functions
3831 Mon Mar 25 13:01:40 CET 2002 Paolo Molaro <lupus@ximian.com>
3833         * threads.c: use a gc-safe hash table to store tls pointers.
3835 2002-03-22  Dick Porter  <dick@ximian.com>
3837         * threads.c: Fix a race condition where a thread can start and
3838         exit before the handle has been properly initialised (no reason
3839         why the handle couldn't be initialised beforehand, so do so)
3841         Fix a ms to ns conversion magnitude thinko.
3843 2002-03-21  Dick Porter  <dick@ximian.com>
3845         * semaphores.c: Fix a problem when waiting for one or more
3846         semaphores, and another semaphore is Released (all waiting
3847         semaphores assumed they were signalled)
3849 2002-03-29  Dan Lewis <dihlewis@yahoo.co.uk>
3851         * io.h, io.c, uglify.h: added MoveFile, CopyFile, CreateDirectory,
3852         RemoveDirectory, GetFileAttributes, GetFileAttributesEx
3854 2002-03-19  Dietmar Maurer  <dietmar@ximian.com>
3856         * threads.c (Sleep): bug fix: 1ms == 1000000ns
3858 2002-03-19  Dan Lewis <dihlewis@yahoo.co.uk>
3860         * io.h, io.c, events.c, mutexes.c, semaphores.c, sockets.c,
3861         threads.c, io.c: added flush method to handles.
3863         * io.c: FlushFileBuffers() and FindFirstFile() functions.
3865 Thu Mar 7 17:21:52 CET 2002 Paolo Molaro <lupus@ximian.com>
3867         * threads.c, timed-thread.c, wait.c: Boehm-GC anable.
3869 2002-02-20  Dick Porter  <dick@ximian.com>
3871         * io-layer.h: Always build without cygwin support on windows
3873 Mon Feb 18 15:50:59 CET 2002 Paolo Molaro <lupus@ximian.com>
3875         * sockets.c: #undef DEBUG.
3877 2002-02-14  Jeffrey Stedfast  <fejj@ximian.com>
3879         * io-layer.h: conditionally include sys/filio.h and sys/sockio.h
3880         for FIONBIO, FIONREAD, and SIOCATMARK.
3882 2002-02-14  Jeffrey Stedfast  <fejj@ximian.com>
3884         * sockets.c: conditionally include sys/filio.h and sys/sockio.h
3885         for FIONBIO, FIONREAD, and SIOCATMARK.
3887 2002-02-13  Dick Porter  <dick@ximian.com>
3889         * sockets.c: Implement shutdown and select
3891 2002-02-13  Jeffrey Stedfast  <fejj@ximian.com>
3893         * mono-mutex.[c,h]: New source files that thinly wrap all pthread
3894         functions that take pthread_mutex_t and/or pthread_mutexattr_t
3895         arguments for the sake of portability. Implements recursive
3896         mutexes and pthread_mutex_timedlock.
3898         * critical-sections.c:
3899         * events.c:
3900         * handles.c:
3901         * mutexes.c:
3902         * semaphores.c:
3903         * threads.c:
3904         * timed-thread.c:
3905         * wait.c: Use the mono-mutex wrapper portability functions/macros.
3907         * pthread-compat.[c,h]: Replaced by mono-mutex.[c,h]
3909 2002-01-23  Dick Porter  <dick@ximian.com>
3911         * sockets.c: Networking support, mostly wrapping BSD socket APIs
3912         with handle code, and translating errno into w32 error codes.
3914         * macros.h: Some w32 macros used with the socket support
3916         * error.c: Implemented GetLastError() and SetLastError()
3918         * Makefile.am: Added sockets, with kludge to override some symbols
3920 2001-12-17  Dietmar Maurer  <dietmar@ximian.com>
3922         * unicode.c (_wapi_unicode_to_utf8): byteswap UTF16 strings before
3923         passing them to iconv
3924         (_wapi_unicode_to_utf8): only swap bytes on LE systems, remove bug
3925         from previous commit.
3927 2001-12-11  Dick Porter  <dick@ximian.com>
3929         * io.c: Implement DeleteFile(), GetFileTime(), SetFileTime() and
3930         FileTimeToSystemTime().
3932         * unicode.c (unicode_len): Nasty way of finding length of unicode
3933         string with embedded NULLs (counts until two NULLs together).
3935         * mutexes.c (mutex_close): 
3936         * events.c (event_close): Release the internal pthreads resources
3938 2001-11-26  Dick Porter  <dick@ximian.com>
3940         * critical-sections.c:
3941         * events.c:
3942         * handles.c:
3943         * io.c:
3944         * mutexes.c:
3945         * semaphores.c:
3946         * threads.c:
3947         * timed-thread.c:
3948         * wait.c: turn off DEBUG messages
3950 2001-11-22  Dick Porter  <dick@ximian.com>
3952         * handles.c (SignalObjectAndWait): Implement
3954         * wait.c (WaitForSingleObject): Fix case where timeout == 0
3956         * threads.c:
3957         * semaphores.c:
3958         * mutexes.c:
3959         * io.c:
3960         * events.c: Support for SignalObjectAndWait
3961         
3962 2001-11-21  Dick Porter  <dick@ximian.com>
3964         * events.c:
3965         * handles.c:
3966         * mutexes.c:
3967         * semaphores.c:
3968         * threads.c:
3969         * wait.c: Reliable method of returning which handle was signalled
3970         on return from WaitForMultipleObjects().
3972 2001-11-21  Dick Porter  <dick@ximian.com>
3974         * events.c: Implement events
3976 2001-11-15  Dick Porter  <dick@ximian.com>
3978         * mutexes.c: Implement mutexes
3980         * threads.c: 
3981         * semaphores.c: 
3982         * misc.c: Factor out some common code
3984 2001-11-13  Dick Porter  <dick@ximian.com>
3986         * threads.c: Implement TLS.  Implement GetCurrentThreadId(), and
3987         GetCurrentThread() by maintaining a hash of thread handles.
3989         * threads.h: Define thread and process creation flags
3991 2001-11-12  Dick Porter  <dick@ximian.com>
3993         * critical-sections.c: Implement critical sections
3995 2001-11-12  Dick Porter  <dick@ximian.com>
3997         * semaphores.c: Implement semaphores
3999         * wait.c (wait_for_item): Maintain a wait count rather than count
4000         signalled booleans.
4002         * threads.c (thread_wait_multiple): Don't lock the wait item, that
4003         will block other wait threads
4005 2001-11-11  Dick Porter  <dick@ximian.com>
4007         * Makefile.am: Rename some automake variables
4008         (from Nick Drochak <ndrochak@gol.com>)
4010 2001-11-10  Dick Porter  <dick@ximian.com>
4012         * Makefile.am (libwapiincludedir): Fix include destination
4014         * .cvsignore: Ignore generated files
4016 2001-11-10  Dietmar Maurer  <dietmar@ximian.com>
4018         * pthread-compat.c: added some include files to make it compile on
4019         linux.
4021 2001-11-08  Dick Porter  <dick@ximian.com>
4023         * Initial checkin.
4025         This is a library emulating the win32 threading and IO API.