2007-11-15 Dick Porter <dick@ximian.com>
[mono.git] / mono / io-layer / ChangeLog
1 2007-11-15  Dick Porter  <dick@ximian.com>
2
3         * processes.c: Implement process module support by reading from
4         /proc if it's available.
5
6         * versioninfo.h: 
7         * versioninfo.c: New functions to implement PE file version info
8         support.
9
10 2007-11-08  Dick Porter  <dick@ximian.com>
11
12         * critical-sections.h (EnterCriticalSection): Disable the critical
13         section asserts for the release branch
14
15 2007-11-05  Kornél Pál  <kornelpal@gmail.com>
16
17         * io-layer.h: Added includes for run-time GetProcessId API detection for
18         Windows.
19
20 2007-10-26  Dick Porter  <dick@ximian.com>
21
22         * shared.c (_wapi_shm_file_open): Set the umask when opening
23         shared files, so restrictive defaults don't prevent subsequent
24         processes re-opening them.
25
26 2007-10-18  Zoltan Varga  <vargaz@gmail.com>
27
28         * atomic.h (InterlockedCompareExchange): Fix the ia64 version so it works for
29         negative values too. Hopefully fixes #332700.
30
31 2007-09-26  Dick Porter  <dick@ximian.com>
32
33         * io-portability.c (_wapi_io_scandir): Only update the error
34         status of glob() when performing a secondary glob() if the first
35         returned an error.  Fixes bug 325107.
36
37 2007-09-12  Marek Habersack  <mhabersack@novell.com>
38
39         * io-portability.c: options_init moved to
40         utils/mono-io-portability.c
41         Do not initialize portability helpers here, it's done in
42         mono_runtime_init.
43         find_file and find_in_dir moved to utils/mono-io-portability.c
44
45 2007-09-09  Robert Jordan  <robertj@gmx.net>
46
47         * sockets.c (_wapi_setsockopt): Add support for FreeBSD multicast
48         sockets. Fixes #81891.
49         Code is contributed under MIT/X11 license.
50
51 2007-09-03  Atsushi Enomoto  <atsushi@ximian.com>
52
53         * processes.h, processes.c : ok, they are simple string.
54
55 2007-09-03  Atsushi Enomoto  <atsushi@ximian.com>
56
57         * processes.h : sigh, I really hate fixing them on windows :(
58
59 2007-09-03  Atsushi Enomoto  <atsushi@ximian.com>
60
61         * processes.c : fix build again.
62
63 2007-09-03  Atsushi Enomoto  <atsushi@ximian.com>
64
65         * processes.h : removed extra parameters from CreateProcessWithLogonW.
66
67 2007-09-03  Atsushi Enomoto  <atsushi@ximian.com>
68
69         * processes.c, processes.h: added CreateProcessWithLogonW(). For now
70           it just calls CreateProcess().
71         * io-layer.h : CreateProcessWithLogonW() requires WINVER 0x0500
72           on Windows.
73
74 2007-08-23  Robert Jordan  <robertj@gmx.net>
75
76         * processes.[c|h]: Implement Get|SetPriorityClass ().
77         Code is contributed under MIT/X11 license.
78
79 Tue Aug 21 20:08:09 CEST 2007 Paolo Molaro <lupus@ximian.com>
80
81         * io.c: made convert_arg_to_utf8() and write_file() static.
82         Worked around gcc's incorrect warning.
83
84 2007-08-20  William Holmes  <billholmes54@gmail.com>
85
86         *io.c: Added implementation for ReplaceFile.
87         *io.h: Added deceleration for ReplaceFile method.
88
89         Code is contributed under MIT/X11 license.
90
91 2007-08-20  Wade Berrier  <wberrier@novell.com>
92
93         * processes.c: include sys/resource.h for rusage to fix 
94         mac 10.3 build
95
96 Mon Aug 20 12:36:42 CEST 2007 Paolo Molaro <lupus@ximian.com>
97
98         * processes.c: implemented query for user/system times using
99         getrusage ().
100
101 2007-08-10  Dick Porter  <dick@ximian.com>
102
103         * sockets.c (_wapi_getsockopt, _wapi_setsockopt): Check the option
104         level as well as the name when mangling some of the values.  Fixes
105         bug 82000.
106
107 2007-08-02  Dick Porter  <dick@ximian.com>
108
109         * sockets.c: Changes in error handling, and move the SO_REUSEADDR
110         setting from metadata/socket-io.c.
111
112 2007-08-01  Dick Porter  <dick@ximian.com>
113
114         * io-portability.c (_wapi_io_scandir): Special-case patterns
115         ending in '.*' so that files with no extension are also matched.
116         Fixes bug 82212.
117
118         * wapi_glob.h: 
119         * wapi_glob.c: Reinstate WAPI_GLOB_APPEND, and add
120         WAPI_GLOB_UNIQUE to avoid matching the same entry twice when
121         appending.
122
123 2007-07-26  Dick Porter  <dick@ximian.com>
124
125         * handles-private.h: 
126         * thread-private.h: 
127         * handles.h: 
128         * critical-sections.c: 
129         * handles.c: 
130         * critical-section-private.h:
131         * error.h: 
132         * threads.c: 
133         * error.c: Clean up TLS and pthreads structures.  Finishes off bug
134         78739.
135
136         * collection.c (collection_thread): Exit the collection thread if
137         the io-layer has been cleaned up.
138
139         * mono-mutex.h (mono_mutexattr_destroy): Add this define too
140
141 Mon Jul 23 10:40:35 CEST 2007 Paolo Molaro <lupus@ximian.com>
142
143         * timefuncs.c: make TickCount measure from boot time if it's
144         available.
145
146 2007-07-19  Juraj Skripsky  <js@hotfeet.ch>
147
148         * io.c (MoveFile): Fix a leak. 
149
150 Fri Jul 13 12:46:15 CEST 2007 Paolo Molaro <lupus@ximian.com>
151
152         * handles-private.h, handles.c, thread-private.h, threads.c,
153         uglify.h, wait.c: temporarily revert the alertable wait changes
154         (r79386) until the deadlock issues are fixed.
155
156 2007-06-22  Dick Porter  <dick@ximian.com>
157
158         * shared.c: The non-shared mutexes weren't being initialised properly
159         on macos.  Fixes bug 81929.
160
161 2007-06-13  Randolph Chung  <tausq@debian.org>
162
163         * atomic.h: Enable for all hppa targets.
164         * Makefile.am: rename hppa_atomic.s to hppa_atomic.S so the preprocessor
165         can handle the file.
166         * hppa_atomic.s: Renamed to ...
167         * hppa_atomic.S: ... and updated to work on both HPUX and Linux.
168
169 2007-06-13  Dick Porter  <dick@ximian.com>
170
171         * handles.c (timedwait_signal_wait_cond): Alertable waits on
172         private handles are now interrupted by signalling the same
173         condition that would end the wait if the handle became signalled,
174         rather than polling.  (Shared handles still have to poll.)
175
176         * threads.c (_wapi_thread_queue_apc): Interrupt the thread if it's
177         waiting on a handle
178
179         * handles-private.h (_wapi_handle_current_thread_set_waiting_on):
180         Helper functions to inform the APC queuing functions when threads
181         are waiting for handles, and to interrupt the wait.
182
183         * wait.c (WaitForMultipleObjectsEx): Need to tell the handle
184         waiting functions if any of the handles in question are shared
185
186 2007-06-06  Miguel de Icaza  <miguel@novell.com>
187
188         * processes.c (is_managed_binary): Fix for OSX.
189
190 2007-06-06  Wade Berrier  <wberrier@novell.com>
191
192         * atomic.h (InterlockedExchangePointer): cast to pointer to to silence
193         compiler warnings (autobuild fails the build on this type of warning)
194
195 2007-05-21  Dick Porter  <dick@ximian.com>
196
197         * io-portability.c (_wapi_g_dir_open): Don't propagate any errors
198         from the second call to g_dir_open, preserve the original error if
199         the second call still fails but clear the error if it succeeds.
200
201 2007-05-10  Dick Porter  <dick@ximian.com>
202
203         * sockets.c (_wapi_recvfrom): Refine the fix to bug 75705 so EINTR
204         isn't returned if the remote end shuts down cleanly.  Fixes zmd
205         and the second example in bug 75705.
206
207 2007-04-26  Dick Porter  <dick@ximian.com>
208
209         * shared.c (_wapi_shm_semaphores_init): Need to check
210         MONO_DISABLE_SHM in this entry point, as it's called before
211         _wapi_shm_attach().  Fixes bug 81436.
212
213 2007-04-24  Dick Porter  <dick@ximian.com>
214
215         * sockets.c (_wapi_recvfrom, socket_close): Force recvfrom() to
216         error if the socket is closed while the receive is blocking.
217         Fixes bug 75705.
218
219 2007-04-13  Dick Porter  <dick@ximian.com>
220
221         * shared.h:
222         * shared.c: Complete the reimplementation of disabling of shared
223         memory, by not allocating sysv semaphores when shm disabling has
224         been requested (either at compile time or run time.)
225
226         * processes.c (CreateProcess): Don't synchronize locking across
227         processes when forking, when shared memory has been disabled.
228
229 2007-04-06  Andreas Faerber  <andreas.faerber@web.de>
230
231         * wapi_glob.h:
232         * wapi_glob.c: remove reference to sys/cdefs.h, use glib instead.
233         Fixes: 81326
234
235 2007-04-05  Dick Porter  <dick@ximian.com>
236
237         * io.c:
238         * io-portability.c (_wapi_io_scandir): Moved from io.c, and
239         changed to use a cut-down version of glob(3) that has been
240         extended to match with case-insensitivity if needed.
241
242         * wapi_glob.h:
243         * wapi_glob.c: Cut down implementation of glob(3), based on
244         OpenBSD.
245
246 2007-03-22  Dick Porter  <dick@ximian.com>
247
248         * sockets.c (_wapi_connect): Do additional checks when connect(2)
249         fails, because some systems don't let it be restarted.  Patch
250         based on one submitted by Robert S Wojciechowski <robertw@ssgx.com>,
251         fixes bug 81010.
252
253 2007-03-09  Jonathan Chambers  <joncham@gmail.com>
254
255         * io-layer.h:  Remove UNICODE and _UNICODE defines as 
256         these are done by configure.in now.
257         
258         Code is contributed under MIT/X11 license.
259         
260 Thu Mar 8 19:42:17 CET 2007 Paolo Molaro <lupus@ximian.com>
261
262         * shared.c: partial support for MONO_DISABLE_SHM env var.
263
264 2007-03-05  Wade Berrier  <wberrier@novell.com>
265
266         * atomic.h: atomic fixes from Michael Matz for for s390 
267         and s390x ( bnc #237611 and bxc #80892 )
268
269 2007-03-05  Miguel de Icaza  <miguel@novell.com>
270
271         * io.c (CreateFile): Use FILE_ATTRIBUTE_TEMPORARY to mean 0600
272         permissions.  For 80688
273
274         (MoveFile): Use errno_copy here, just to avoid a potential
275         errno-changing code in the future from g_free. 
276         
277         Also, ignore EXDEV errors as they are handled immediately after
278         (avoid printing out an error). 
279
280         Fixes: 80655
281
282 Mon Feb 12 15:50:24 CET 2007 Paolo Molaro <lupus@ximian.com>
283
284         * shared.c: exit if semaphores can't be created (bug #80616).
285
286 2007-02-01  Geoff Norton  <gnorton@customerdna.com>
287
288         * collection.c: NetBSD doesn't define PTHREAD_STACK_MIN.
289
290 2007-01-26  Dick Porter  <dick@ximian.com>
291
292         * socket-private.h: 
293         * sockets.c (_wapi_getsockopt): Windows seems to not reset
294         SO_ERROR values when they're read, contrary to the documentation.
295         Fixes the new issues raised in bug 79878 (example in C showing
296         winsock behaviour attached to that bug.)
297
298 2007-01-15 Mark Mason <mason@broadcom.com
299
300         * atomic.h: add locking primitives for MIPS.
301         
302 2007-01-11  Dick Porter  <dick@ximian.com>
303
304         * sockets.c (_wapi_connect): Don't do the SO_BROADCAST setting
305         here, do it in managed code instead.
306         (_wapi_getsockopt): SO_RCVTIMEO and SO_SNDTIMEO use struct
307         timeval, which has a microsecond field, not milliseconds.
308         (_wapi_setsockopt): ditto.
309         (_wapi_setsockopt): Halve the SO_SNDBUF and SO_RCVBUF values on
310         Linux, as the kernel doubles whatever we set.
311         (_wapi_socket): Save socket domain, type and protocol so it can be
312         duplicated later.
313         (socket_disconnect): Implement socket disconnect (closing the
314         socket, but keeping the file descriptor.)
315         (wapi_disconnectex): A basic implementation of DisconnectEx().
316         (wapi_transmitfile): A very basic implementation of
317         TransmitFile().
318         (WSAIoctl): Implement the SIO_GET_EXTENSION_FUNCTION_POINTER
319         ioctl.
320
321         * socket-private.h (struct _WapiHandle_socket): Record socket
322         domain, type and protocol info so it can be duplicated later.
323
324         * sockets.h (WSAID_DISCONNECTEX,WSAID_TRANSMITFILE): Structures
325         and defines needed to look up the DisconnectEx() and
326         TransmitFile() functions by GUID.
327
328         * error.c (errno_to_WSA): Change ETIMEDOUT mapping to
329         WSAETIMEDOUT; add EDESTADDRREQ.
330
331         * io-layer.h: Need mswsock.h on windows now.
332
333 2007-01-04  Miguel de Icaza  <miguel@novell.com>
334
335         * io-portability.c (find_file): Fix a coverity warning (scanning
336         being unassigned).   
337
338 2006-12-31  Miguel de Icaza  <miguel@novell.com>
339
340         * io-portability.c (find_file): Do not abort if an empty filename
341         has been passed.  This fixes the case where MONO_IOMAP=all would
342         assert if Directory.Exists ("") was called.
343
344 Mon Dec 18 14:54:37 CET 2006 Paolo Molaro <lupus@ximian.com>
345
346         * processes.c: moved a free on the error path.
347
348 Thu Dec 14 21:42:39 CET 2006 Paolo Molaro <lupus@ximian.com>
349
350         * processes.c: fixed a few memory leaks when executing
351         processes.
352
353 Mon Nov 27 13:12:17 GMT 2006 Paolo Molaro <lupus@ximian.com>
354
355         * atomic.h: fix arm compare and exchange (bug #78500).
356
357 2006-11-23  Dick Porter  <dick@ximian.com>
358
359         * process-private.h (struct _WapiHandle_process): Add 'waited'
360         parameter
361
362         * processes.c (process_wait): Check the 'waited' parameter not the
363         signalled state when testing if a process has already been waited
364         for, as the child process itself may set signalled when exiting.
365         Fixes bug 79885.
366
367         * wapi-private.h (_WAPI_HANDLE_VERSION): Bump shared data version
368
369         * shared.c: Now the shared data version has been incremented we
370         can set the counter semaphore initial value correctly
371
372 2006-11-22  Dick Porter  <dick@ximian.com>
373
374         * processes.c (process_wait): Cope when the background process
375         reaper gets the process we were waiting for.  Special case for
376         waiting for our own process to exit.  Fixes bug 77736.
377
378 2006-11-17  Dick Porter  <dick@ximian.com>
379
380         * processes.c: Fix const correctness and typos that caused memory
381         corruption. 
382         
383 2006-11-17  Miguel de Icaza  <miguel@novell.com>
384
385         * processes.c (ShellExecuteEx): Check error after CreateProcess,
386         thanks to Dick for pointing this out. 
387
388 2006-11-16  Miguel de Icaza  <miguel@novell.com>
389
390         * processes.c (ShellExecuteEx): If we fail to create a process in
391         ShellExecute, then try to use the xdg-open command, and if that
392         fails, try to use the gnome-open command, 
393
394         Refactor the code so that we do not have to duplicate all this
395         code, but instead use a ucs2-aware version of the code to do
396         concatenations.
397
398 2006-11-13  Dick Porter  <dick@ximian.com>
399
400         * io.c (_wapi_stat_to_file_attributes): If the file is a symlink
401         add the FILE_ATTRIBUTE_REPARSE_POINT flag.  This is an attempt to
402         follow the specs for the windows symlink support, but will
403         probably have to be reworked when I have test data from a vista
404         machine.  Fixes bug 79887.
405
406 2006-11-11  Miguel de Icaza  <miguel@novell.com>
407
408         * handles.c (CloseHandle): Cope here with the new value
409         INVALID_HANDLE_VALUE set on handles.  
410
411         * processes.c (CreateProcess): Initialize the value of hThread to
412         be INVALID_HANDLE_VALUE on failure, not to be NULL.  Improvement
413         for #75733
414
415 2006-11-09  Dick Porter  <dick@ximian.com>
416
417         * sockets.c (_wapi_select): Do some sanity checking on the
418         fd_sets, to avoid file descriptors > FD_SETSIZE.
419         (_wapi_FD_CLR, _wapi_FD_ISSET, _wapi_FD_SET): Avoid file
420         descriptors > FD_SETSIZE.
421
422 2006-10-27  Dick Porter  <dick@ximian.com>
423
424         * io.c (GetFileAttributes): Force symlinks to directories to be
425         returned as a regular file.  Fixes bug 79733.
426
427 2006-10-18  Miguel de Icaza  <miguel@novell.com>
428
429         * io-portability.c (find_in_dir): First string dup, then closedir.
430
431 2006-10-12  Dick Porter  <dick@ximian.com>
432
433         * processes.c (_wapi_process_reap): Unref a process handle if we
434         reaped it, found by Zoltan.  Fixes bug 79286.
435         (process_wait): Don't wait again if we've already waited for a
436         process.
437
438 2006-10-11  Sergey Tikhonov <tsv@solvo.ru>
439
440         * atomic.h: Fix atomic decrement.
441
442         * mini/cpu-alpha.md: Use native long shift insts
443
444         * mono/mono/mini/tramp-alpha.c: Implemented
445         mono_arch_patch_delegate_trampoline method
446
447         * Started work on using global registers
448         
449         * Use byte/word memory load/store insts if cpu supports it
450         
451         * Code clean up
452
453         
454 2006-10-09  Zoltan Varga  <vargaz@gmail.com>
455
456         * handles.c (timedwait_signal_poll_cond): Add an alertable parameter, and if it
457         is FALSE, avoid busy waiting.
458
459         * wait.c: Add an alertable parameter to the wait routines.
460
461 2006-10-06  Miguel de Icaza  <miguel@novell.com>
462
463         * io-portability.c (find_file): Rename from
464         MONO_IO_PORTABILITY_HELP to MONO_IOMAP.
465
466 2006-10-03  Dick Porter  <dick@ximian.com>
467
468         * io-portability.h: 
469         * io-portability.c: Optional portability helpers and wrapped
470         system calls to try to cope with windows filenames in
471         applications.
472
473         * io.c: Use the wrapped system calls
474
475 2006-09-01  Zoltan Varga  <vargaz@gmail.com>
476
477         * critical-sections.h critical-sections.c: Make Enter/LeaveCriticalSection a macro
478         since they are perf critical.
479
480         * atomic.h: Applied patch from Jakub Boqusz <qboosh@pld-linux.org>.
481         Add atomic ops implementation for alpha.
482
483 2006-08-11  Dick Porter  <dick@ximian.com>
484
485         * processes.c (_wapi_process_reap): Avoid a deadlock by setting
486         process termination details in an outer loop, not the
487         _wapi_search_handle() one.
488
489 2006-08-10  Dick Porter  <dick@ximian.com>
490
491         * threads.c (_wapi_thread_queue_apc)
492         (_wapi_thread_dispatch_apc_queue): Use a process-local mutex here
493         instead of the cross process semaphore.  We already check that
494         access to the APC queue is within the owning process so there's no
495         need to protect from other processes.  Avoids a global deadlock
496         when a thread is aborted while it holds the handle semaphore
497         locked.
498         (_wapi_thread_apc_pending): Hide an annoying message which can
499         happen if a thread handle has been blown away at process shutdown
500         while it is in an alertable wait.
501
502         Both problems seen while shutting down monodevelop.
503
504 2006-07-25  Dick Porter  <dick@ximian.com>
505
506         * shared.c (_wapi_shm_file): Remove '/' characters from the uname
507         results.  Fixes bug 78917.
508
509 2006-07-20  Dick Porter  <dick@ximian.com>
510
511         * threads.c (_wapi_thread_set_termination_details): Improve the
512         test for already-disposed thread handles, and hold the lock around
513         the mutex abandoning.
514
515 2006-07-17  Dick Porter  <dick@ximian.com>
516
517         * processes.c (CreateProcess): Don't change directory unless a new
518         one has been specified.  Fixes bug 78751.
519
520 2006-07-06  Dick Porter  <dick@ximian.com>
521
522         * io.c (_wapi_stat_to_file_attributes): Do a better job at
523         figuring out the file attributes
524         (_wapi_set_last_path_error_from_errno): New helper function to
525         turn errno into w32 error codes that handles the differences
526         between file and directory errors
527         (file_setendoffile): Try turning off the extra write used to
528         extend files, because we probably don't need it on any modern
529         platform.  If it is needed though, we also need to lseek the file
530         position back again
531         (CreateFile): Treat character-special devices as a console handle,
532         because they can't be seeked
533         (CopyFile): If fail_if_exists is set, then the destination needs
534         to be opened with O_EXCL
535         (CopyFile): If fail_if_exists is not set and the destination
536         already exists, then we should set the ERROR_ALREADY_EXISTS error
537         even though we return success
538         (stdhandle_create): STD_INPUT_HANDLES cannot be written to
539         (GetStdHandle): Rework without using mono_once, so console handles
540         can be properly closed and reopened.
541         (mono_io_scandir): Only override errno with EACCES when the
542         directory actually exists
543         (FindFirstFile): Set ERROR_FILE_NOT_FOUND when no files are
544         returned
545         (FindClose): Cope with NULL handles
546         (CreateDirectory): When the target already exists, just return an
547         error.  It's the caller's job to figure out what to do.
548         (SetCurrentDirectory): Cope with a NULL path
549         (RemoveDirectory, GetFileAttributes, GetFileAttributesEx,
550         SetFileAttributes, FindFirstFile, DeleteFile, MoveFile, CopyFile,
551         CreateFile): Set path error correctly
552
553         * handles.c (CloseHandle): Kludge to try and cope with passing a
554         NULL handle
555
556         * error.h: Add NO_ERROR as an alternative to ERROR_SUCCESS
557
558         * uglify.h: Added some more typedefs
559
560 2006-07-05  Dick Porter  <dick@ximian.com>
561
562         * io.c (GetFileAttributes, GetFileAttributesEx): Cope with
563         dangling symlinks.  Fixes bug 78664.
564
565 2006-06-23  Dick Porter  <dick@ximian.com>
566
567         * handles.c (handle_cleanup): 
568         * threads.c: Clean up threads properly when we're forcibly
569         removing the handle entries from the shared file in
570         handle_cleanup().  Fixes bug 78241, for real this time.
571
572 2006-06-15 Neale Ferguson <neale@sinenomine.net>
573
574         * atomic.h: More tinkering with InterlockedExchange/InterlockedCompareExchange
575         for s390/s390x.
576
577 2006-06-14 Neale Ferguson <neale@sinenomine.net>
578
579         * atomic.h: Fix atomic exchange pointer operations for s390x - these
580         were broken as they used 32-bit instructions rather than their 64-bit
581         versions.
582
583 2006-06-14  Dick Porter  <dick@ximian.com>
584
585         * processes.c: Don't run the atexit handlers when bailing out
586         of a fork/exec.
587
588 2006-06-14  Dick Porter  <dick@ximian.com>
589
590         * wait.c: Fix stupid typo shown up by gcc 4.1.1, = not ==
591
592         * handles-private.h: 
593         * shared.c: 
594         * io.c: 
595         * processes.c: 
596         * mono-spinlock.h: 
597         * handles.c: 
598         * collection.c: Fix a bunch of signed/unsigned warnings from gcc
599         4.1.1
600
601 2006-06-09 Neale Ferguson <neale@sinenomine.net>
602
603         * atomic.h: Fix atomic operations for s390x (not really broken 
604         but changed to use full 64-bit opcodes).
605
606 2006-05-24  Dick Porter  <dick@ximian.com>
607
608         * processes.c (process_set_current): Don't take an extra reference
609         if we have to create our own process handle.  Fixes bug 78241
610         again.
611
612         * threads.c (_wapi_thread_signal_self): Renamed from
613         _wapi_thread_abandon_mutexes, also sets the thread state to
614         signalled and drops a reference.  Called by the runtime when the
615         main thread cleans itself up.
616
617         * handles.c (handle_cleanup): As a last resort, unref every shared
618         handle as the process is now exiting.
619
620 2006-05-16  Dick Porter  <dick@ximian.com>
621
622         * processes.c (process_set_termination_details): Unref the handle
623         when we've stored the exit details.  Fixes the rest of 78241.
624
625 2006-05-12  Dick Porter  <dick@ximian.com>
626
627         * threads.c: Implement pseudo handles, making GetCurrentThread()
628         match MS behaviour.  Notice when attached threads exit, and unref
629         the handle.  Fix usage of GetCurrentThread() in other places.
630
631         * handles.c (DuplicateHandle): Implement a basic form of
632         DuplicateHandle().
633
634         * wait.c: Fix usage of GetCurrentThread() throughout, and cope
635         with pseudo handles.
636
637 2006-04-26  Miguel de Icaza  <miguel@novell.com>
638
639         * io.c (file_close): Oops, do not use DeleteFile which expects
640         unicode, instead use unlink directly
641
642         Add support for the new FileOptions bits on .NET 2.0.
643
644         It might be good if Dick reviews these changes.
645         
646         * io.c (file_close): If DeleteOnClose is set, then delete the file
647         before freeing it.
648         (CreateFile): Do not support encryption per user. 
649         
650         If posix_fadvise exists, pass hints on sequential scan and random
651         access.   Did not figure out what WRITE_THROUGH maps to.
652
653 2006-04-26  Dick Porter  <dick@ximian.com>
654
655         * sockets.c (WSAIoctl): Check the output buffer is valid before
656         writing to it.
657
658         * handles.c (_wapi_search_handle): Set shared pointer if we find a
659         shared handle that has been already opened.
660
661 2006-04-21  Dick Porter  <dick@ximian.com>
662
663         * threads.c (GetCurrentThread): Reference the handle if we return
664         an already-known thread.
665
666 2006-04-07  Dick Porter  <dick@ximian.com>
667
668         * processes.c: Fix build for older glib.
669
670 2006-04-06  Dick Porter  <dick@ximian.com>
671         
672         * processes.c (CreateProcess): Add a reference to the child
673         process' handle, so it won't be destroyed if this process closes
674         its copy of the handle.  Fixes bug 77393.
675         
676         * processes.c (process_set_current): Fall through to creating a
677         new one if the handle lookup fails.
678
679         * processes.c (_wapi_process_signal_self):
680         * handles.c (handle_cleanup): The process is exiting, so set the
681         handle state for this process to signalled.  This should let other
682         non-related processes wait for this handle.
683         
684         * handles.c (_wapi_search_handle): Don't search shared handles in
685         all cases.
686
687         * collection.c (collection_thread): No need to do a collection
688         scan straight away, do the waiting first.
689
690 2006-04-06  Dick Porter  <dick@ximian.com>
691
692         * shared.c: Fix parameters in semctl () call.
693
694 2006-03-28  Zoltan Varga  <vargaz@gmail.com>
695
696         * atomic.h atomic.c: Applied patch from David S. Miller 
697         <davem@davemloft.net>: Reimplement Interlocked* primitives on sparc 
698         using CAS/CASx when __GNUC__, else we will fall back to the generic 
699         pthread version.
700
701 2006-03-27  Dick Porter  <dick@ximian.com>
702
703         * shared.c (_wapi_shm_file_open): Break out of a loop if the
704         shared file is smaller than expected.  (We loop a few times in
705         case another process is in the middle of creating the file.)
706
707 2006-03-22  Dick Porter  <dick@ximian.com>
708
709         * handles.c:
710         * wapi-private.h:
711         * shared.h:
712         * shared.c: Delete the semaphores and shared files when the last
713         process has finished with them
714
715 2006-03-15  Dick Porter  <dick@ximian.com>
716
717         * events.c: 
718         * io.c: 
719         * mutexes.c: 
720         * processes.c: 
721         * semaphores.c: 
722         * sockets.c: 
723         * threads.c: Explicitly initialise the handle ops struct
724
725 2006-03-14  Dick Porter  <dick@ximian.com>
726
727         * handles-private.h: 
728         * wapi-private.h: 
729         * wait.c: 
730         * handles.c: Add a 'prewait' stage to the handle waiting, to give
731         waiting threads a chance to check for bogus states before
732         blocking.
733
734         * mutexes.c (namedmutex_prewait): Use the prewait stage to check
735         for named mutexes that have been abandoned in a locked state (eg
736         if a process exited abnormally while owning the mutex) and
737         override it if needed.
738
739 2006-03-08 Gonzalo Paniagua Javier <gonzalo@ximian.com>
740
741         * wait.c: speed up WaitFor* when the timeout is 0.
742
743 2006-03-03  Dick Porter  <dick@ximian.com>
744
745         * processes.c (ShellExecuteEx): Cope when some of the parameters
746         are NULL.
747
748 2006-02-27  Dick Porter  <dick@ximian.com>
749
750         * mutexes.c: 
751         * mono-mutex.c: 
752         * threads.c: Comparing pthread_t with == is not portable, so use
753         pthread_equal().
754
755 Thu Feb 23 18:47:20 GMT 2006 Paolo Molaro <lupus@ximian.com>
756
757         * *.h, *.h: patch from Dick to make Linuxthreads systems work again.
758
759 2006-02-22  Dick Porter  <dick@ximian.com>
760
761         * thread-private.h: 
762         * threads.c: There's no need to use the timed-thread support code
763         any more, as we aren't using the timed join.  This greatly
764         simplifies thread setup, and fixes a memory leak (bug 77521).
765
766         Don't bother to store thread IDs in a hash table, use TLS instead.
767         The one case that needs to look up the handle of a different
768         thread (OpenThread()) can do the extra work itself.  Fixes bug
769         77536.
770
771         * handles.c (_wapi_search_handle): Add a reference when returning
772         a private handle (shared handles are already reffed.)
773         
774 2006-02-17  Dick Porter  <dick@ximian.com>
775
776         * handles-private.h: 
777         * handles.c: Check handle values passed to array lookups.  Fixes
778         bug 77572.
779
780 2006-02-09  Dick Porter  <dick@ximian.com>
781
782         * threads.c: Cope with the problems caused by attaching already
783         existing threads - they don't get the infrastructure to clean up
784         after themselves, especially the ID to handle hash.  This fixes
785         bug 77468.
786
787 2006-02-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
788
789         * shared.c: use MONO_SHARED_HOSTNAME as a substitute for gethostname()
790         when creating the shared files in the .wapi directory. Fixes bug #77371.
791
792 2006-02-02  Martin Baulig  <martin@ximian.com>
793
794         * threads.c: Removed the `WITH_INCLUDED_LIBGC' section; it has
795         never been used so far. 
796
797         * timed-thread.h (TimedThread): Removed the `stack_ptr' field; it
798         has only been used by the removed code.
799
800 2006-01-03  Neale Ferguson <neale@sinenomine.net>
801
802         * atomic.h: Correct s390x definitions and eliminate compiler warnings.
803
804 2006-01-03  Sebastien Pouliot  <sebastien@ximian.com>
805
806         * io.c: Patch _wapi_stat_to_file_attributes against bug #76966, where
807         sockets could be considered as directory.
808
809 2005-12-23  Dick Porter  <dick@ximian.com>
810
811
812         * semaphores.h: 
813         * semaphores.c: Implement OpenSemaphore
814
815         * mutexes.c: 
816         * mutexes.h: Implement OpenMutex
817
818         * wapi-private.h: 
819         * handles.c: 
820         * events.c: 
821         * events.h: 
822         * event-private.h: Implement named events.  Implement OpenEvent.
823
824 2005-12-15  Dick Porter  <dick@ximian.com>
825
826         * processes.c (CreateProcess): The pipe-based cross-process
827         exclusion technique was trying to write NULL buffers when appname
828         was NULL (eg when coming from ShellExecuteEx,) which usually
829         succeeded even though EFAULT was returned - but sometimes it
830         failed.  This meant that the child process could block forever on
831         the pipe read.  Replace it with the simpler shared handle
832         semaphore protection used everywhere else.  This showed up with
833         the test case in bug 76684.
834
835 Tue Dec 13 11:41:49 GMT 2005 Paolo Molaro <lupus@ximian.com>
836
837         * shared.c: fallback to private mmap when shared mmap doesn't work
838         (like on jffs).
839
840 2005-12-06  Dick Porter  <dick@ximian.com>
841
842         * wapi-private.h: 
843         * handles.c: 
844         * semaphore-private.h: 
845         * semaphores.c: Implement named semaphores
846
847 2005-11-24  Dick Porter  <dick@ximian.com>
848
849         * processes.c (GetProcessId): Implement GetProcessId()
850
851 2005-11-17  Dick Porter  <dick@ximian.com>
852
853         * processes.h: 
854         * processes.c: Implement ShellExecuteEx as a wrapper around
855         CreateProcess.
856
857 2005-11-11  Dick Porter  <dick@ximian.com>
858
859         * threads.c: Give mutex abandoning its own exported function, so
860         it can be called when the runtime is cleaning up.
861
862         * handles.c (_wapi_search_handle_namespace): Do a handle
863         collection befre starting to check namespace strings, so that any
864         stale cruft gets removed.
865
866 2005-11-11  Dick Porter  <dick@ximian.com>
867
868         * threads.c: Move thread handles back into the shared space.
869
870         * handles.c (_wapi_handle_unref): Add support for shared handles
871         with close() handlers
872
873 2005-11-04  Dick Porter  <dick@ximian.com>
874
875         * sockets.c (ioctlsocket): Use select instead of if to avoid a
876         type promotion problem on 64bit freebsd.  Based on patch by Lou
877         Kamenov <kamenovl@gmail.com>, fixes bug 76447.
878
879 2005-11-04  Dick Porter  <dick@ximian.com>
880
881         * io.c (file_write): Only do the file locking if
882         MONO_STRICT_IO_EMULATION is set.
883
884 2005-10-21  Dick Porter  <dick@ximian.com>
885
886         * processes.c: 
887         * handles.c (_wapi_lookup_handle): Cope when the shared part of a
888         handle has been deleted.
889         (_wapi_handle_unref): And when the deleted shared part is pointed
890         to as a handle is deleted
891
892 2005-10-20  Dick Porter  <dick@ximian.com>
893
894         * processes.c (process_set_current): If the expected process
895         handle slot doesn't contain the correct pid, create a new handle.
896
897         * handles.c (_wapi_search_handle): When the search doesn't find
898         anything, return failure instead of the last handle we looked at.
899         (_wapi_handle_ref, _wapi_handle_unref): Don't try to ref or unref
900         unused handles (makes tracking refcounting bugs easier.)
901
902 2005-10-19  Dick Porter  <dick@ximian.com>
903
904         * handles.c:
905         * handles-private.h:
906         * wapi-private.h: 
907         * processes.c: 
908         * mutexes.c:
909         * collection.c (_wapi_handle_collect): Remove the shared handle
910         indirection layer, and use locking instead.  Delete other
911         complexity that is no longer needed.  Refcount shared handles and
912         delete them when needed, but keep the timestamps so that orphaned
913         handles will be cleaned up eventually.
914
915         * shared.c (_wapi_shm_file): Add processor, OS and struct size
916         info to the shared file names, to cope with dual-boot and 32/64bit
917         size issues.  Fixes bug 75839.
918
919         * wait.c (WaitForMultipleObjectsEx): No need to distinguish
920         between shared handles and private, as the wait functions cope
921         with both together now.
922
923 2005-10-11 Gonzalo Paniagua Javier <gonzalo@ximian.com>
924
925         * io.c: removed NO_SIGPIPE macro.
926         * sockets.c: no need for MSG_NOSIGNAL or ignoring SIGPIPE.
927
928 2005-10-11  Dick Porter  <dick@ximian.com>
929
930         * sockets.c (_wapi_getsockopt): Translate SO_ERROR results into
931         w32 error codes.
932
933         * error.c (errno_to_WSA): Don't return a bogus error if someone
934         asks to translate errno 0.
935
936 2005-10-11  Dick Porter  <dick@ximian.com>
937
938         * handles.c: Fix several race conditions
939
940 2005-10-11 Miguel de Icaza <miguel@novell.com>
941
942         * io.c: no need to block SIGPIPE anymore, as it is ignored.
943
944 2005-10-05  Dick Porter  <dick@ximian.com>
945
946         * threads.c (_wapi_thread_own_mutex, _wapi_thread_disown_mutex):
947         Keep a reference to mutexes owned by threads, so they won't be
948         destroyed prematurely.  Fixes dotmsnclient crash.
949
950 2005-09-26  Sebastien Pouliot  <sebastien@ximian.com>
951
952         * io.c: Apply patch from #76192 (Can't write files past 2gb on AMD64 
953         (x86_64)) for Brion on IRC (Dick approved it).
954
955 2005-09-23  Dick Porter  <dick@ximian.com>
956
957         * processes.c: Don't wait for processes that have already been
958         signalled; also fix typo.
959
960         * handles.c: Improve locking inside new handle and handle
961         searching functions.
962
963 2005-09-20  Dick Porter  <dick@ximian.com>
964
965         * collection.c: 
966         * processes.c: Periodically waitpid for known process IDs.  Fixes
967         bug 74870.
968
969 2005-09-15 Gonzalo Paniagua Javier <gonzalo@ximian.com>
970
971         * io.c:
972         (CreateFile): if the file is a named pipe, treat the handle as a pipe,
973         not as a file. Fixes bug #76075.
974
975 2005-08-27  Zoltan Varga  <vargaz@gmail.com>
976
977         * atomic.h: Add support for intel icc.
978
979 2005-08-25  Zoltan Varga  <vargaz@gmail.com>
980
981         * io-layer.h: Include winbase.h not WinBase.h.
982
983 2005-08-19  Dick Porter  <dick@ximian.com>
984
985         * threads.c, threads.h, thread-private.h: Use a gsize to store the
986         thread ID, so it can hold a 64 bit value if needed.
987
988 2005-07-26 Gonzalo Paniagua Javier <gonzalo@ximian.com>
989
990         * error.c: map ENOENT to WSAECONNREFUSED. It might happen when
991         connecting to unix sockets. Closes bug #75632.
992
993 2005-07-05  Dick Porter  <dick@ximian.com>
994
995         * io.c: Make sure SIGPIPE is ignored when calling write(2).
996         Prevents the runtime exiting when writing to a closed pipe,
997         fixing bug 75468.
998
999 2005-06-30  Dick Porter  <dick@ximian.com>
1000
1001         * shared.c (_wapi_shm_semaphores_init): Add some helpful error
1002         messages when semget () fails due to lack of resources.
1003
1004 2005-06-21  Dick Porter  <dick@ximian.com>
1005
1006         * mutex-private.h:
1007         * thread-private.h:
1008         * mutexes.c: 
1009         * threads.c: Keep a list of owned mutexes in each thread handle,
1010         so that it is easier to abandon them when the thread exits.
1011         Removes a bottleneck when multiple threads are finishing in
1012         parallel.
1013
1014 2005-06-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
1015
1016         * io.c: (GetLogicalDrives) when a bogus line is read, don't leak memory.
1017         When the buffer has not enough space, close the file before returning.
1018
1019 2005-06-09  Duncan Mak  <duncan@novell.com>
1020
1021         * *.h: Added G_BEGIN_DECLS and G_END_DECLS where appropriate to
1022         all public headers. Fixes #74919.
1023
1024 2005-05-30  Zoltan Varga  <vargaz@freemail.hu>
1025
1026         * atomic.h: Add IA64 atomic ops.
1027
1028 2005-05-26 Gonzalo Paniagua Javier <gonzalo@ximian.com>
1029
1030         * processes.c: make ExitCode be valid even if the user didn't call
1031         WaitForExit() and is just polling on HasExited.
1032
1033 2005-05-17  Dick Porter  <dick@ximian.com>
1034
1035         * io.c (file_getfilesize): Clear the error value, so that files
1036         with sizes with the low bits 0xFFFFFFFF can be distinguished from
1037         a genuine error.
1038
1039 2005-05-11 Gonzalo Paniagua Javier <gonzalo@ximian.com>
1040
1041         * shared.c: forgot to ignore a warning.
1042
1043 2005-05-10 Gonzalo Paniagua Javier <gonzalo@ximian.com>
1044
1045         * shared.c: don't display warnings after reboots.
1046
1047 2005-05-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
1048
1049         * sockets.c: on windows, getsockopt/setsockopt for send/receive timeout
1050         use an integer in milliseconds. We were using a struct timeval.
1051
1052 2005-05-06  Dick Porter  <dick@ximian.com>
1053
1054         * handles-private.h: 
1055         * mutexes.c: 
1056         * wapi-private.h: 
1057         * shared.h:
1058         * shared.c: 
1059         * wait.c: 
1060         * handles.c: 
1061         * collection.h: Use SysV semaphores for managing access to the
1062         shared memory - in return for the ludicrous api we get
1063         synchronisation primitives that can be cleaned up by the kernel
1064         even when a process quits unexpectedly.  This removes the
1065         timestamp issues.
1066
1067 2005-05-05  Lluis Sanchez Gual  <lluis@novell.com>
1068
1069         * handles.c: Always use polling in the waits, since
1070         mono_cond_timedwait can't be interruped by the thread abort signal.
1071
1072 2005-04-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
1073
1074         * events.c: calling Set on AutoResetEvent several times has the same
1075         effect as calling it only once if no thread is waiting for it.
1076
1077 2005-04-29  Dick Porter  <dick@ximian.com>
1078
1079         * processes.c (EnumProcesses): Use a GArray instead of a GPtrArray
1080         now it's storing pids not handles, also fixes memory leak caused
1081         by unclear glib documentation.
1082
1083         * sockets.c (WSACleanup): Remove unused variable
1084
1085 2005-04-29  Dick Porter  <dick@ximian.com>
1086
1087         * handles.c (_wapi_handle_check_share_by_pid): For systems that
1088         don't have file descriptor info in /proc check that the original
1089         opener of a file is still there, if a share violation would
1090         otherwise happen.
1091
1092 2005-04-28 Gonzalo Paniagua Javier <gonzalo@ximian.com>
1093
1094         * handles.c:
1095         * handles-private.h: added _wapi_handle_forecch that loops through all
1096         the handles and call a callback function when a handle of the given
1097         type is found.
1098
1099         * sockets.c: no need to keep open sockets in an array, as we have them 
1100         in the handles structure.
1101
1102         Fixes bug #74755.
1103
1104 2005-04-28  Dick Porter  <dick@ximian.com>
1105
1106         * processes.c: Cope with handles that are only around for as long
1107         as the search is running.  If we're searching for process handles,
1108         check to see if the process is still running and signal it if not.
1109
1110         * handles.c (_wapi_search_handle): Search in the shared space as
1111         well.  Fixed bug 74752.
1112
1113         * mutexes.c:
1114         * handles.c (_wapi_handle_new_from_offset):
1115         _wapi_handle_new_for_existing_ns () was doing exactly the same as
1116         this, so deleted it.
1117
1118 2005-04-26  Dick Porter  <dick@ximian.com>
1119
1120         * handles.c: Fix stupid thinko where if a new shared handle is
1121         created but a collection was needed to free some space, it
1122         returned an error anyway.  Should fix the messages shown in bug
1123         74659.
1124
1125 2005-04-25  Dick Porter  <dick@ximian.com>
1126
1127         * handles.c (_wapi_handle_check_share): Only consider mono
1128         processes when looking to see if a file is still being held open,
1129         while checking share permissions.
1130
1131 2005-04-25  Dick Porter  <dick@ximian.com>
1132
1133         * sockets.c: 
1134         * io.c: 
1135         * wapi-private.h (struct _WapiHandleOps): 
1136         * handles.c (_wapi_handle_unref): When destroying handles, save
1137         the handle data and call the close function only after the array
1138         slot has been cleared.  This prevents race conditions with file
1139         descriptors, fixing bug 74713.
1140
1141         * mutexes.c: Delete the handle close functions, they didn't do
1142         anything anyway
1143
1144         * error.c (_wapi_get_win32_file_error): Add a mapping for EINTR so
1145         the "Unknown error" g_warning doesn't get displayed.
1146
1147 2005-04-25  Dick Porter  <dick@ximian.com>
1148
1149         * wapi-private.h: 
1150         * threads.c: Make thread handles process-private for now to take
1151         some of the space pressure off the shared memory, while I work on
1152         a real fix.
1153
1154 2005-04-21  Dick Porter  <dick@ximian.com>
1155
1156         * handles.c (_wapi_handle_check_share): Make sure there is a "fd"
1157         dir in /proc before blowing away handle info.  Fixes bug 74649.
1158
1159 2005-04-21  Dick Porter  <dick@ximian.com>
1160
1161         * wait.c (WaitForMultipleObjectsEx): Implement special waits
1162
1163         * handles.c (_wapi_handle_wait_signal_poll_share): Don't return a
1164         timeout, just wait briefly for the private signals and let the
1165         waiting thread test again.  This prevents us missing shared
1166         signals.
1167
1168 2005-04-21  Dick Porter  <dick@ximian.com>
1169
1170         * collection.h (_WAPI_HANDLE_COLLECTION_EXPIRED_INTERVAL): Reduce
1171         the time before a slot is considered too old and deleted.  This is
1172         a workaround while I come up with a proper fix.
1173
1174 2005-04-21  Dick Porter  <dick@ximian.com>
1175
1176         * mutexes.c: 
1177         * processes.c: 
1178         * threads.c: 
1179         * handles.c (_wapi_handle_new): Turn assertions into errors.
1180
1181         * collection.c (_wapi_handle_collect): Use symbols not magic
1182         numbers for timeout values
1183
1184 2005-04-19  Dick Porter  <dick@ximian.com>
1185
1186         * mutexes.c: 
1187         * wait.c: 
1188         * handles.c (_wapi_handle_count_signalled_handles)
1189         * handles-private.h (_wapi_handle_shared_lock_handle): Use new
1190         shared handle locks in critical sections.
1191
1192         * handles.c (_wapi_handle_new_for_existing_ns): Reuse old handles
1193         if there is already one there.
1194         
1195         * handles.c (_wapi_handle_ref): It was possible for a process to
1196         exit before getting around to updating shared handle timestamps,
1197         so do it here too.
1198
1199 Tue Apr 19 16:25:47 CEST 2005 Paolo Molaro <lupus@ximian.com>
1200
1201         * threads.c: fix lookup of the thread id in the has table:
1202         always use the id value, not the pointer to the id.
1203
1204 2005-04-18 Gonzalo Paniagua Javier <gonzalo@ximian.com>
1205
1206         * handles.c: fix handle returned in _wapi_handle_search_handle. Dick
1207         pointed it out.
1208
1209 2005-04-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
1210
1211         * io-layer/sockets.c: FIONBIO with a TRUE argument means we want
1212         non-blocking IO, not the other way around.
1213
1214 2005-04-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
1215
1216         * handles.c:
1217         * io.c:
1218         * handles-private.h: GetFileType wasn't checking if we have memory
1219         allocated for the handle before dereferencing it. Fixes a FileStream
1220         nunit test.
1221
1222 2005-04-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
1223
1224         * handles.c:
1225         * processes.c:
1226         * handles-private.h: we were calling g_renew to expand the handle array,
1227         but that might move the memory and we might have pthread conditions or
1228         mutexes in the original memory area that are being used. Now instead of
1229         expanding an existing array, we just create new ones and keep a list of
1230         them. Access to _wapi_private_handles had to be modified accordingly.
1231
1232 2005-04-15  Dick Porter  <dick@ximian.com>
1233
1234         * collection.c: FreeBSD needs more than PTHREAD_STACK_MIN
1235
1236 2005-04-14  Raja R Harinath  <rharinath@novell.com>
1237
1238         * wapi-private.h: Remove reference to 'daemon-private.h'.
1239
1240 Wed Apr 13 13:12:33 EDT 2005 Paolo Molaro <lupus@ximian.com>
1241
1242         * atomic.h: applied patch from mass@akuma.org (David Waite)
1243         to fix InterlockedExchangeAdd.
1244         Fixed a few other functions, including InterlockedCompareExchange()
1245         which was miscompiled by gcc with optimizations enabled.
1246
1247 2005-04-13  Dick Porter  <dick@ximian.com>
1248
1249         * io.c (share_check): 
1250         * handles.c (_wapi_handle_check_share): Refine the file check so
1251         that sharing violations within the same process don't cause
1252         assertion failures.
1253
1254 2005-04-13  Dick Porter  <dick@ximian.com>
1255
1256         * io.c (FindFirstFile): Fix bugs introduced with the merge (bug
1257         74586)
1258
1259 2005-04-12  Dick Porter  <dick@ximian.com>
1260         
1261         The daemon-less io-layer.  Extensive lowlevel changes in
1262         handles.c, requiring some corresponding changes in other files
1263         calling these functions.  Private_foo structures have been
1264         eliminated.
1265
1266         File descriptor handling differences account for most of the
1267         changes in io.c and sockets.c.
1268
1269         Other highlights:
1270         
1271         * mutexes.c: Named mutexes are now a distinct type.
1272         * atomic.h: Fix a PPC uninitialised variable warning.
1273         * wait.c: Check conditions before waiting on a condition variable.
1274         * processes.c: Handle process fork and wait without a daemon
1275         (though this has the limitation of only being able to wait for
1276         child processes.)
1277
1278 2005-04-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
1279
1280         * io-private.h:
1281         * threads.c:
1282         * threads.h:
1283         * io.c:
1284         * sockets.c:
1285         * sockets.h: removed dead code that deals with async IO.
1286
1287 2005-03-30  Zoltan Varga  <vargaz@freemail.hu>
1288
1289         * atomic.c (InterlockedIncrement): Fix fallback implementation of
1290         InterlockedIncrement and InterlockedDecrement. Fixes #74228.
1291
1292 2005-03-29  Sebastien Pouliot  <sebastien@ximian.com>
1293
1294         * io-layer.h: Add required header files for compiling with VS.NET.
1295
1296 2005-03-17 Miguel de Icaza <miguel@novell.com>
1297
1298         * io.c: don't fail on NFS when there are no more locks available.
1299
1300 2005-03-09  Dick Porter  <dick@ximian.com>
1301
1302         * error.c (_wapi_get_win32_file_error): ENFILE and EMFILE should
1303         map to ERROR_TOO_MANY_OPEN_FILES, not ERROR_NO_MORE_FILES.  Fixes
1304         bug 72671.
1305
1306 2005-03-09  Dick Porter  <dick@ximian.com>
1307
1308         * daemon.c (process_process_fork): Initialise the handle data
1309         before using it in the error case.  This is probably the error
1310         we're working around in the previous change.  Spotted by Taru Jain
1311         <tjain@novell.com> and Hemanth Yamijala <YHemanth@novell.com>.
1312
1313 2005-03-07  Dick Porter  <dick@ximian.com>
1314
1315         * daemon.c: It looks like g_shell_parse_argv() can return
1316         argv[0]=NULL somehow, yet still not give an error.  Make sure we
1317         don't pass NULL to strrchr(), working around a segfault that
1318         showed up on ZLM testing.
1319
1320 2005-03-01 Gonzalo Paniagua Javier <gonzalo@ximian.com>
1321
1322         * sockets.c: translate EINPROGRESS to EWOULDBLOCK in connect. This is
1323         the expected error code showed by the test case in bug #73053.
1324
1325 2005-02-18 Gonzalo Paniagua Javier <gonzalo@ximian.com>
1326
1327         * io.c: another leftover.
1328
1329 Fri Feb 18 17:37:29 CET 2005 Paolo Molaro <lupus@ximian.com>
1330
1331         * io.c: fixed logic in checking errno in rev 40815.
1332
1333 Fri Feb 18 16:00:29 CET 2005 Paolo Molaro <lupus@ximian.com>
1334
1335         * threads.c: we don't depend on the GC checking tls
1336         slots anymore.
1337         * processes.c: remove unused ref to GC headers.
1338
1339 Thu Feb 17 19:57:11 CET 2005 Paolo Molaro <lupus@ximian.com>
1340
1341         * io.c: remove _wapi_thread_cur_apc_pending () checks
1342         when the siscall should return immediatly and handle
1343         the case when a syscall is interrupted without
1344         erroring out, but returning a 0 read/write if possible.
1345         Still the cases of read from file need to be handled.
1346
1347 Tue Feb 8 18:28:11 CET 2005 Paolo Molaro <lupus@ximian.com>
1348
1349         * threads.c: make people test with 1 MB stack per thread.
1350
1351 2005-01-17  Dick Porter  <dick@ximian.com>
1352
1353         * timefuncs.h: Make WapiFileTime endian-aware, as it's often
1354         cast to and from 64bit ints.  Fixes bug 71213.
1355
1356 2005-01-11  Dick Porter  <dick@ximian.com>
1357
1358         * error.c (errno_to_WSA): Add EADDRNOTAVAIL error code
1359         translation.
1360
1361 Mon Jan 10 16:15:19 EST 2005 Neale Ferguson <nealeferguson@earthlink.net>
1362
1363         * atomic.h: Fix functions on s390.
1364
1365 Mon Jan 10 20:30:19 CET 2005 Paolo Molaro <lupus@ximian.com>
1366
1367         * atomic.h: fix some functions on ppc (tests/interlocked.cs).
1368
1369 2005-01-10  Dick Porter  <dick@ximian.com>
1370
1371         * misc.c (_wapi_calc_timeout): Guard against overflow when
1372         calculating timeouts.  This makes waiting with a large
1373         (Int32.MaxValue) timeout not return immediately.
1374
1375 2004-12-23  Ben Maurer  <bmaurer@ximian.com>
1376
1377         * io.c (io_ops): make this `const' so it is shareable (well, only
1378         really shareable if it is statically linked...)
1379
1380 Mon Dec 20 11:58:33 CET 2004 Paolo Molaro <lupus@ximian.com>
1381
1382         * threads.c, threads.h: add accessor to get the pthread_key_t for
1383         a tls id.
1384
1385 2004-12-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
1386
1387         * io.c: check for the existence of 'dest' and set ERROR_ALREADY_EXISTS
1388         if it exists and is not the same as 'src'.
1389
1390 2004-12-01 Neale Ferguson <Neale.Ferguson@SoftwareAG-usa.com>
1391
1392         * atomic.h : Fix InterlockedCompareExchange for s390/s390x.
1393
1394 2004-12-01 Gonzalo Paniagua Javier <gonzalo@ximian.com>
1395
1396         * processes.c: unquote the cmd path, allow for ' or " when quoting and
1397         pass the quoted program name to the daemon, otherwise the call to
1398         g_shell_unquote in the daemon will break things up.
1399
1400 2004-10-14  Dick Porter  <dick@ximian.com>
1401
1402         * sockets.c (_wapi_accept): Revert the previous change.  We now
1403         set the accepted socket to have the same blocking status as the
1404         listening socket in managed code.  This follows MS behaviour.
1405         
1406 2004-10-14  Dick Porter  <dick@ximian.com>
1407
1408         * sockets.c (_wapi_accept): On Darwin, make sure a newly
1409         accept()ed socket is blocking.  Fixes bug 67355, patch by
1410         grompf@sublimeintervention.com.
1411
1412 2004-10-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
1413
1414         * system.c: check the number of online processors instead of the
1415         existing ones. Sanitize return value if it's an error.
1416
1417 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
1418
1419         * system.c: Add support for getting the # of cpus.
1420
1421 2004-09-28  Dick Porter  <dick@ximian.com>
1422
1423         * io.c (pipe_close_private): Fix one small typo in the last change
1424         that totally hosed process creation with redirected pipes.
1425
1426 2004-09-24  Dick Porter  <dick@ximian.com>
1427
1428         * wapi-private.h: 
1429         * sockets.c: 
1430         * socket-private.h: 
1431         * io.c: 
1432         * io-private.h: 
1433         * handles-private.h: Cope when a file descriptor is reused while
1434         the handle that thought it owned it is still referenced, instead
1435         of asserting.  Probably fixes bug 66479, though we've been unable
1436         to reproduce it.
1437
1438 2004-09-09  Dick Porter  <dick@ximian.com>
1439
1440         * error.c:
1441         * io.c: Set error codes everywhere.
1442
1443 2004-09-06  Dick Porter  <dick@ximian.com>
1444
1445         * handles.c (_wapi_handle_unref): Reset the private record's type
1446         (CloseHandle): Check for a fd mapping failure, and return FALSE.
1447         (_wapi_handle_process_fork): Fix long-standing bug in checking
1448         handle return values.  Also do the required bookkeeping with the
1449         new process's handles.
1450
1451         * daemon.c: When creating a new process's handles, check whether
1452         the shared space needs to be increased
1453
1454 2004-09-05  Zoltan Varga  <vargaz@freemail.hu>
1455
1456         * shared.c (_wapi_shm_file): Fix leaking of filename.
1457
1458 2004-08-19  Dick Porter  <dick@ximian.com>
1459
1460         * handles.c (_wapi_handle_count_signalled_handles): Fix thinko
1461         introduced with the fd offset stuff: unlock handles properly when
1462         backing off.  Fixes the monologue hang at exit.
1463
1464 2004-08-18  Dick Porter  <dick@ximian.com>
1465
1466         * sockets.c: 
1467         * io.c: Check that new fds fit in the table, return error if not
1468
1469         * daemon.c (_wapi_daemon_main): 
1470         * handles.c (shared_init): Have all processes agree on a size for
1471         the fd table.
1472
1473 2004-08-17  Dick Porter  <dick@ximian.com>
1474
1475         * daemon.c (process_new): 
1476         * handles.c (_wapi_handle_new_internal): Cope when the space
1477         reserved for file descriptors is larger than the shared segment
1478         size.  Fixes the crash reported when running mono under gdb on
1479         macosx.
1480
1481 2004-08-16  Dick Porter  <dick@ximian.com>
1482
1483         * sockets.c:
1484         * io.c:
1485         * handles-private.h (_wapi_handle_fd_offset_to_handle): Improve
1486         error checking with passed-in file descriptors.
1487
1488 2004-08-11  Dick Porter  <dick@ximian.com>
1489
1490         * sockets.c: 
1491         * io.c: Returned handle values are the file descriptor the handle
1492         encapsulates
1493
1494         * handles.c: 
1495         * handles-private.h: 
1496         * daemon.c: Reserve the range of handles that can have the same
1497         values as file descriptors.  These won't be used, but the values
1498         will be used as file, console, pipe or socket handles.  The fd to
1499         handle mapping is done internally and is invisible to users.
1500         Fixes bug 61828.
1501
1502         * wapi-private.h (_WAPI_HANDLE_VERSION): Increment, because we now
1503         reserve a chunk of handle space.
1504
1505 2004-08-04  Neale Ferguson <Neale.Ferguson@SoftwareAG-usa.com>
1506
1507         * atomic.h: add support for 64-bit S/390
1508
1509 2004-07-22  Dick Porter  <dick@ximian.com>
1510
1511         * timed-thread.c: 
1512         * threads.c: Move the destruction of the internal thread data to
1513         after the thread has been joined.  Fixes bug 61418.
1514
1515 2004-07-14  Dick Porter  <dick@ximian.com>
1516
1517         * wait.c (test_and_own): When not waiting for all handles to
1518         become signalled, only own and return the lowest.  All the
1519         documentation suggests that the old way was correct, but
1520         experimentation shows it actually works like this.  Patch by
1521         Sébastien Robitaille
1522         (sebastien.robitaille@croesus.com), fixes bug 61511.
1523
1524 2004-07-09  Ben Maurer  <bmaurer@ximian.com>
1525
1526         * threads.c: register roots for gc
1527
1528 2004-07-08  Dick Porter  <dick@ximian.com>
1529
1530         * io.c (file_seek): If there is a high 32bit offset part, make
1531         sure the low part isn't sign-extended.  Set error codes when
1532         returning failure.  Fixes bug 61131.
1533
1534 2004-07-06  Dick Porter  <dick@ximian.com>
1535
1536         * io.c (file_setfiletime): Check for underflow when converting to
1537         time_t values.  Set error codes when returning failure.  Fixes bug
1538         60970.
1539
1540 2004-07-05  Dick Porter  <dick@ximian.com>
1541
1542         * mutexes.c (mutex_ops_init): Make the named mutex mutex sharable.
1543
1544         * daemon.c (unref_handle): Only destroy a handle if all processes
1545         have released it, not just the current one.  Fixes bug 60887.
1546
1547 2004-06-30  Zoltan Varga  <vargaz@freemail.hu>
1548
1549         * mono-mutex.h atomic.h: Add G_GNUC_UNUSED to static inline functions
1550         to prevent warnings.
1551
1552 2004-06-24  Dick Porter  <dick@ximian.com>
1553
1554         * mutexes.c: Indicate when a named mutex was reused
1555
1556 2004-06-24  Dick Porter  <dick@ximian.com>
1557
1558         * threads.c (SuspendThread): 
1559         * timed-thread.c (_wapi_timed_thread_suspend): Wrap sem_wait in a
1560         while loop.  See bug 58161.
1561
1562 Wed Jun 23 23:29:04 CEST 2004 Paolo Molaro <lupus@ximian.com>
1563
1564         * io.c: don't use sharemode for on-disk file permissions: it's used
1565         for shared access to the open file.
1566
1567 2004-06-22  Dick Porter  <dick@ximian.com>
1568
1569         * events.c (CreateEvent): When creating an auto-reset event that
1570         is initially owned, make sure the set count starts at 1.
1571
1572 2004-06-18  Dick Porter  <dick@ximian.com>
1573
1574         * event-private.h:
1575         * events.c: Auto-reset events need to release one thread for each
1576         time SetEvent() is called.  Fixes bug 41292.
1577
1578         * threads.h:
1579         * mutex-private.h:
1580         * mutexes.c: Scan for mutexes that are still locked by a thread
1581         when it exits.  Fixes the MS demo app linked by bug 41292.
1582
1583         * wait.c (test_and_own): Make sure a handle is signalled before it
1584         is owned.
1585
1586 2004-06-16  Dick Porter  <dick@ximian.com>
1587
1588         * timed-thread.c: Call the thread cleanup exit routine before taking
1589         the join mutex, because this could deadlock if another thread tries
1590         to join in the meantime.  This fixes the hang-at-exit problem seen
1591         on macos.
1592
1593 2004-06-03  Lluis Sanchez Gual  <lluis@ximian.com>
1594
1595         * threads.c: Implemented SleepEx.
1596         * threads.h: Fixed SleepEx signature.
1597
1598 2004-06-03  Miguel de Icaza  <miguel@ximian.com>
1599
1600         * threads.c: When running under valgrind, do not allocate too much
1601         stack, as Valgrind default is 1 meg.
1602
1603 2004-05-27  Dick Porter  <dick@ximian.com>
1604
1605         * io.h:
1606         * io.c: Implemented LockFile() and UnlockFile()
1607
1608 2004-05-21  Dick Porter  <dick@ximian.com>
1609
1610         * io.c (CreateFile): Check for existing share modes when opening
1611         a file.
1612
1613         * handles.c: 
1614         * handles-private.h: 
1615         * daemon-messages.h: 
1616         * daemon.c: Maintain a hash of file share modes, keying on device
1617         and inode (to cope with symlinks.)
1618
1619 2004-05-20  Lluis Sanchez Gual  <lluis@ximian.com>
1620
1621         * daemon-messages.c: Retry if the communication with the daemon is
1622           interrupted by a signal.
1623         * io.c, sockets.c: Check for EINTR in every syscall that can be interrumped. 
1624           Only return an error in this case if there is something in the apc queue
1625           (which means that it is an interruption requested by the "user").
1626         * processes.c: Use WaitForSingleObjectEx. No need to pass "alertable" as
1627           true since the wait is small.
1628         * shared.c: Retry write calls when interrumped by a signal.
1629         * timed-thread.h, timed-thread.c: added _wapi_thread_apc_pending, which
1630           returns TRUE if there are pending asynchronous calls (APC) for the
1631           provided thread. Also added _wapi_thread_dispatch_apc_queue which calls
1632           the enqueued APCs. Defined a new struct ApcInfo that holds information
1633           about an enqueued APC.
1634         * thread-private.h, threads.c: Implemented QueueUserAPC (which does the same
1635           as in win32),_wapi_thread_apc_pending and _wapi_thread_dispatch_apc_queue. 
1636           These last two methods call the corresponding apc methods in 
1637           thread-private using the provided thread handle.
1638         * threads.h: Added QueueUserAPC.
1639         * uglify.h: Added WapiApcProc (needed by QueueUserAPC).
1640         * wait.c, wait.h: Changed WaitForSingleObject to WaitForSingleObjectEx, and
1641           WaitForMultipleObjects to WaitForMultipleObjectsEx. Implemented support
1642           for APCs in those two methods and also in SleepEx.
1643
1644 2004-05-17  Dick Porter  <dick@ximian.com>
1645
1646         * io.c (CopyFile): Speed up.  Fixes bug 57859.
1647
1648 2004-05-13  Dick Porter  <dick@ximian.com>
1649         * mono-mutex.c (mono_mutex_unlock): Return EPERM when the current
1650         thread doesn't own the mutex, rather than assert()ing.
1651
1652 2004-05-11  Dick Porter  <dick@ximian.com>
1653
1654         * shared.c (_wapi_shm_attach): Cope when a previous daemon startup
1655         attempt failed, leaving shared files that look like a daemon is
1656         still starting.
1657
1658 2004-05-10  Gonzalo Paniagua Javier <gonzalo@ximian.com>
1659
1660         * io.c:
1661         (SetFileAttributes): don't the the exec bit if the corresponding read
1662         bit is not set.
1663
1664 2004-05-10  Zoltan Varga  <vargaz@freemail.hu>
1665
1666         * io.c (FindFirstFile): Fix invalid free.
1667
1668 2004-05-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
1669
1670         * io.c: translate from GFileError to errno codes and don't free
1671         variables right after calling mono_io_scandir, as we may overwrite
1672         errno value.
1673
1674 2004-05-08  Gonzalo Paniagua Javier <gonzalo@ximian.com>
1675
1676         * io.c: g_dir_open return ENOENT for directories on which we don't have
1677         read/execute permission, while returning EPERM for anything below those.
1678         So, change ENOENT by EPERM if the directory exists.
1679
1680 2004-05-07  Dick Porter  <dick@ximian.com>
1681
1682         * io.c (SetFileAttributes): Don't have failed chmod()s cause a
1683         "file not found" error.  Fixes bug 54032.
1684         
1685 2004-05-07  Dick Porter  <dick@ximian.com>
1686
1687         * io.c (FindFirstFile): Comment out a windows-compatibility check
1688         that breaks when directories have metachars in their names.
1689         Workaround for bug 58116.
1690
1691 2004-05-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
1692
1693         * io.c: fixed for FindFirstFile for empty directories. Closes
1694         bug #58147.
1695
1696 2004-05-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
1697
1698         * processes.c: set the start time for the current process. Fixes bug
1699         #58109.
1700
1701 2004-05-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
1702
1703         * io-private.h: 'namelist' is now a gchar ** in _WapiHandlePrivate_find.
1704         * io.c: implemented scandir using glib functions.
1705
1706 2004-05-04  Dick Porter  <dick@ximian.com>
1707
1708         * daemon.c (read_message): Return FALSE on error so the GSource
1709         callback itself can return FALSE.  Cures the infinite loop poll()
1710         warning on MacosX.
1711         * shared.c: Fix some daemon startup race conditions.
1712
1713 2004-04-29  Miguel de Icaza  <miguel@ximian.com>
1714
1715         * io.c (CopyFile): Use 32k buffers to copy the file instead of 2k,
1716         use the stack, do not use dynamic memory.
1717
1718 2004-04-29  Zoltan Varga  <vargaz@freemail.hu>
1719
1720         * io.c: Add scandir implementation for platforms which do not have
1721         it, like solaris.
1722
1723 2004-04-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
1724
1725         * io.[ch]: implemented GetLogicalDriveStrings.
1726
1727 2004-04-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
1728
1729         * io.c:
1730         * sockets.c: use the field name from configure when accessing sigval
1731         pointer field. Makes this work on the Mac.
1732
1733 2004-04-28  Bernie Solomon  <bernard@ugsolutions.com>
1734
1735         * atomic.c: (InterlockedExchange) fix typo for
1736         mutex name
1737
1738 2004-04-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
1739
1740         * io.c:
1741         * sockets.c: added check for sys/aio.h.
1742
1743 2004-04-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
1744
1745         * error.[ch]: added _wapi_get_win32_file_error...
1746         * io.c: ... which was _wapi_get_win32_error here.
1747         * sockets.c: rename the function calls here too.
1748
1749 2004-04-28  Dick Porter  <dick@ximian.com>
1750
1751         * daemon-messages.c: Avoid a deadlock when a thread is killed while
1752         waiting for the daemon by using a recursive mutex.  Helps bug 56699.
1753
1754 2004-04-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
1755
1756         * io.c: fixed leak in async_notifier().
1757
1758         * sockets.[ch]: added AIO support for sockets and fixed WSAIoctl
1759         declaration.
1760
1761         * threads.c: removed old comment.
1762
1763 2004-04-26  David Waite  <mass@akuma.org>
1764
1765         * daemon-messages.h:
1766         * daemon-private.h
1767         * error.h:
1768         * io.h:
1769         * processes.h:
1770         * shared.h:
1771         * thread-private.h:
1772         * wapi-private.h: remove comma from end of enumeration declarations
1773         * status.h: cast unsigned int types to int for enum assignment
1774
1775 2004-04-26 David Waite <mass@akuma.org>
1776
1777         * io.c:
1778         * timefuncs.c: declare 64-bit constants as long long types (i.e.
1779         10ULL)
1780
1781 2004-04-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
1782
1783         * socket-wrappers.h: _wapi_socket == WSASocket now. Added
1784         WSA_FLAG_OVERLAPPED.
1785
1786         * sockets.c: new unused parameters for _wapi_socket.
1787
1788 2004-04-22  Miguel de Icaza  <miguel@ximian.com>
1789
1790         * timed-thread.c: Replace sem_init with MONO_SEM_INIT to handle
1791         the fact that MacOS X is a piece of junk (sem_init is *defined* in
1792         the libc, but they return `not implemented'). 
1793
1794 2004-04-22  Dick Porter  <dick@ximian.com>
1795
1796         * handles.c: 
1797         * handles-private.h: Reference the handle when it is locked, so
1798         that another thread can't blow it away while we're waiting for it
1799         to become signalled.
1800         
1801         * wait.c: 
1802         * timed-thread.c: 
1803         * threads.c: 
1804         * sockets.c: 
1805         * semaphores.c: 
1806         * mutexes.c: 
1807         * mono-mutex.c: 
1808         * io.c: 
1809         * handles.c: 
1810         * handles-private.h: 
1811         * events.c: 
1812         * error.c: 
1813         * daemon-messages.c: 
1814         * critical-sections.c: 
1815         * atomic.c: Added pthreads cleanup handlers and error asserts
1816
1817         * shared.c: 
1818         * handles.c: Fixed the gcc "variable might be used uninitialised"
1819         warnings.  They can't happen, but gcc doesn't know that
1820         g_assert()s don't return.
1821
1822         Fixed the declaration of _wapi_handle_process_kill() so that it
1823         expects the correct type for the pid.
1824         
1825         * threads.c: Removed the TLS_PTHREAD_MUTEX style locking that
1826         hasn't been used in ages and just made the code more complex.
1827
1828 2004-04-17  Zoltan Varga  <vargaz@freemail.hu>
1829
1830         * processes.c: Include <signal.h> for SIGKILL and SIGILL + fix some
1831         warnings. Fixes #57168.
1832
1833 2004-04-16  Dick Porter  <dick@ximian.com>
1834
1835         * threads.c (Sleep): Using div(3) with a negative (when signed)
1836         numerator causes the quotient to be 0 and the remainder to be the
1837         numerator.  This feeds a small negative value to nanosleep(3),
1838         which will return immediately and cause a busy wait.  Fixes bug
1839         56351.
1840
1841 2004-04-15  Dick Porter  <dick@ximian.com>
1842
1843         * io-private.h:
1844         * io.c: Rewrite FindFirstFile and FindNextFile using scandir(3)
1845         and fnmatch(3) instead of glob(3).  glob() can't cope with being
1846         given filenames containing metachars.  This fixes bug 40557.
1847
1848 2004-04-14  Bernie Solomon  <bernard@ugsolutions.com>
1849
1850         * security.c: #warning is a GCC-ism
1851
1852 2004-04-13  Sebastien Pouliot  <sebastien@ximian.com>
1853
1854         * security.c: Removed GetUserName as glib g_get_user_name does a
1855         better (portability) job. Added ImpersonateLoggedOnUser and
1856         RevertToSelf.
1857
1858 2004-04-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
1859
1860         * mono-mutex.h: move pthread_mutex_timedlock declaration to...
1861         * mono-mutex.c: ...here. It was causing a warning that prevented
1862         libgdiplus compilation.
1863
1864 2004-04-04  Miguel de Icaza  <miguel@ximian.com>
1865
1866         * security.c (GetUserName): Make it work on MacOS X
1867
1868 2004-04-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
1869
1870         * security.c: use getpwuid_r if available. This one is thread-safe.
1871
1872 2004-04-02  Sebastien Pouliot  <sebastien@ximian.com>
1873
1874         * Makefile.am: Added security.c|h.
1875         * security.c: New file for security related functions. Added function
1876         GetUserName to fix #56144.
1877         * security.h: New. Header file for security.c
1878         * wapi.h: Added include for security.h
1879
1880 2004-03-25  Gonzalo Paniagua Javier <gonzalo@ximian.com>
1881
1882         * daemon-messages.h: added kill structs.
1883
1884         * daemon.c: implemented process_process_kill.
1885         * handles-private.h:  define process_process_kill.
1886         * handles.c: implemented _wapi_handle_process_kill.
1887         * processes.[ch]: implemented TerminateProcess.
1888
1889 2004-03-25  Bernie Solomon  <bernard@ugsolutions.com>
1890
1891         * daemon.c (rem_fd): On solaris you seem to get an
1892         error even after removing the input source so don't
1893         try and rem_fd it twice.
1894
1895 2004-03-25  Lluis Sanchez Gual  <lluis@ximian.com>
1896
1897         * daemon.c: in process_post_mortem, If the child terminated due to the 
1898         receipt of a signal, the exit status must be based on WTERMSIG, since 
1899         WEXITSTATUS returns 0 in this case.
1900
1901 2004-03-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
1902
1903         * daemon.c: turned a warning into a DEBUG statement. Now we may hit it.
1904
1905 2004-03-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
1906
1907         * daemon.c: only call getdtablesize () once.
1908         * processes.c: wait 500 ms to check if execve failed and throw the same
1909         exception as MS on failure. Fixes bug #32809.
1910
1911 2004-03-17  Bernie Solomon  <bernard@ugsolutions.com>
1912
1913         * io.c (async_notifier): use "union sigval" rather
1914         than sigval_t as Solaris doesn't have sigval_t
1915         (which isn't in IEEE 1003.1 either).
1916
1917 2004-03-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
1918
1919         * io.c: added debug stuff and removed a few redundant lines in
1920         file_write.
1921
1922 2004-03-15  Gonzalo Paniagua Javier <gonzalo@ximian.com>
1923
1924         * io-private.h: added new fields for file structure. Declare
1925         _wapi_io_add_callback.
1926
1927         * io.c: added _wapi_get_win32_error, support aio_read/write in
1928         file_read/write. Implemented _wapi_io_add_callback, which is where
1929         BindHandle ends up.
1930         
1931         * io.h: added new fields for WapiOverlapped and typedef for the
1932         callback.
1933
1934         * processes.c: fixed off-by-one bug when handling environment variables 
1935         passed in.
1936
1937         * threads.[ch]: implemented BindIoCompletionCallback.
1938
1939         * uglify.h: added typedef for LPOVERLAPPED_COMPLETION_ROUTINE.
1940
1941 2004-03-14  Zoltan Varga  <vargaz@freemail.hu>
1942
1943         * socket-wrappers.h: Remove extra semicolon.
1944
1945 2004-03-03  Dave Camp  <dave@ximian.com>
1946
1947         * daemon.c: (add_fd), (fd_activity), (_wapi_daemon_main):
1948         Use a new main context.
1949
1950 2004-03-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
1951
1952         * io.c:
1953         (GetFileAttributes): set the error depending on errno instead of
1954         setting ERROR_FILE_NOT_FOUND always. See bug #55160.
1955
1956 2004-03-01  Gonzalo Paniagua Javier <gonzalo@ximian.com>
1957
1958         * io.c:
1959         (CopyFile): free the buffer on error.
1960         * sockets.c:
1961         (WSAIoctl): free the buffer on error.
1962
1963 2004-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
1964
1965         * error.c: fixed mapping for EPROTONOSUPPORT and ESOCKTNOSUPPORT.
1966
1967         * sockets.[ch]: retry creating the socket for AF_INET, SOCK_RAW
1968         using IP protocol with IP over IP. Implemented WSAIoctl UNIX-style.
1969
1970 2004-01-27  Bernie Solomon  <bernard@ugsolutions.com>
1971
1972         * shared.c (_wapi_shm_file): add hostname
1973         to shared data file names to handle NFS mounted
1974         .wapi directories.
1975
1976 Mon Jan 26 16:15:03 CET 2004 Paolo Molaro <lupus@ximian.com>
1977
1978         * sockets.h: remove obsolete soklen_t typedef.
1979
1980 Fri Jan 23 21:07:02 CET 2004 Paolo Molaro <lupus@ximian.com>
1981
1982         * socket-wrappers.h, sockets.h, sockets.c, Makefile.am: move socket
1983         wrappers to its own non-installed header file.
1984
1985 2004-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
1986
1987         * io.c:
1988         (FindFirstFile): unlock the handle if FindNextFile fails.
1989         (FindNextFile): g_free a couple of pointers before retrying.
1990
1991         * wait.c:
1992         (WaitForMultipleObjects): if only one handle provided, use
1993         WaitForSingleObject.
1994
1995 2003-12-22  Bernie Solomon  <bernard@ugsolutions.com>
1996
1997         * handles-private.h: (_wapi_handle_type) check
1998         for segment in range before using it
1999
2000 2003-12-22  Bernie Solomon  <bernard@ugsolutions.com>
2001
2002         * thread-private.h: _wapi_thread_ops is now const
2003         must match .c file.
2004
2005 Mon Dec 22 18:29:03 CET 2003 Paolo Molaro <lupus@ximian.com>
2006
2007         * threads.c, timed-thread.c, timed-thread.h: use mach
2008         semaphores on Darwin (MacOSX) since the posix ones
2009         are mostly broken there (threads are not created suspended
2010         and they can start executing before they are fully initialized
2011         like in tests/thread-static.cs).
2012
2013 Mon Dec 22 17:18:45 CET 2003 Paolo Molaro <lupus@ximian.com>
2014
2015         * atomic.h: ppc fixes.
2016
2017 2003-12-19  Bernie Solomon  <bernard@ugsolutions.com>
2018
2019         * handles.c: remove my bad use of MONO_ZERO_ARRAY_LENGTH
2020         in HDRSIZE 
2021
2022 2003-12-15  Bernie Solomon  <bernard@ugsolutions.com>
2023
2024         * shared.c: (_wapi_shm_open) make scratch file
2025         not have to immediately regrow to avoid remaps
2026         (HPUX can't cope with these).
2027         (_wapi_shm_attach) use actual size of file
2028         to set scratch data_len for the creating process.
2029
2030         * handles.c: (_wapi_handle_new_internal) make
2031         sure mutex & cond var are initialized even for
2032         non process shared ones. 
2033         (_wapi_handle_unref) always call destroy 
2034         routines on mutex & cond var
2035
2036 2003-12-15  Bernie Solomon  <bernard@ugsolutions.com>
2037
2038         * daemon.c: change channel data structure so
2039         input sources are removed from glib event loop
2040         properly. xsp works better on Solaris and 
2041         fixes #51278
2042
2043 2003-12-12  Bernie Solomon  <bernard@ugsolutions.com>
2044
2045         * wapi-private.h: Replace G_GNUC_PRETTY_FUNCTION
2046         definition with file & line number for non-GCC
2047         compiles.
2048
2049 2003-12-08  Bernie Solomon  <bernard@ugsolutions.com>
2050
2051         * Makefile.am: make sure hppa_atomic.s is in distribution
2052
2053 2003-12-01  Dick Porter  <dick@ximian.com>
2054
2055         * wapi-private.h: 
2056         * mutexes.c (CreateMutex): 
2057         * mutex-private.h (struct _WapiHandle_mutex): 
2058         * handles.c: Look up certain handle types by name, in a shared
2059         namespace.  Currently only mutex handles have this implemented.
2060         Fixes bug 51089.
2061
2062         * semaphores.c (CreateSemaphore): 
2063         * events.c (CreateEvent): Fix signature
2064
2065 2003-11-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
2066
2067         * io.c: don't call g_free before testing errno as it may modify it.
2068         If the path exists, return an error if it's not a directory. Fixes
2069         bug #50753.
2070
2071 2003-11-20  Dick Porter  <dick@ximian.com>
2072
2073         * io.c: Missed a little-endian UTF16 conversion.  Patch from
2074         Jeroen Zwartepoorte (Jeroen@xs4all.nl), fixes bug 51065.
2075
2076 2003-10-29  Dick Porter  <dick@ximian.com>
2077
2078         * io.c (MoveFile): If the move crosses filesystems, try and fall
2079         back to copy and delete.  Patch from Jörg Rosenkranz
2080         (JoergR@voelcker.com), fixes bug 50298.
2081
2082 2003-10-28  Dick Porter  <dick@ximian.com>
2083
2084         * io.c: Use the new encoding conversion to cope with non-utf8
2085         locales in filenames.
2086
2087         * processes.c: Ditto for process arguments.
2088
2089 Tue Oct 21 12:01:14 CEST 2003 Paolo Molaro <lupus@ximian.com>
2090
2091         * atomic.h: some ppc inline asm fixes (incorrect use of labels, 
2092         incorrect register constraints, incorrect clobber lists).
2093
2094 2003-10-13  Bernie Solomon  <bernard@ugsolutions.com>
2095
2096         * Makefile.am hppa_atomic.s: add HP 64bit
2097         implementation of atomic ops
2098
2099 2003-10-13  Zoltan Varga  <vargaz@freemail.hu>
2100
2101         * threads.c (CreateThread): Wrap pthread_attr_setstacksize call in
2102         a conditional for platforms that don't have it.
2103
2104 2003-10-09  Bernie Solomon  <bernard@ugsolutions.com>
2105
2106         * threads.c: (CreateThread) use stacksize argument
2107         if non-zero - change default for 64 bits to 4Mb
2108
2109 2003-09-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
2110
2111         * sockets.c: set last error when socket creation fails. This shed some
2112         light on bug #49015.
2113
2114 2003-09-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
2115
2116         * processes.c: fixed bug #48973: we only change \ by / for the argument
2117         to be used as command.
2118         When getting the program name from the args, don't let the space between
2119         them in the args.
2120
2121 2003-09-24  Bernie Solomon <bernard@ugsolutions.com>
2122
2123         * atomic.h atomic.c: fix sparc so lock is
2124         global, increment does so and it compiles under Sun compiler.
2125
2126 2003-09-22  Bernie Solomon <bernard@ugsolutions.com>
2127
2128         * handles.c: include <string.h> directly as may
2129         not be nested in <sys/un.h> like Linux
2130
2131 2003-09-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
2132
2133         * io.c:
2134         (DeleteFile): call SetLastError on failure. Fix by
2135         richard.torkar@htu.se (Richard Torkar). Closes bug #48222.
2136
2137 2003-09-15  Lluis Sanchez Gual  <lluis@ximian.com>
2138
2139         * daemon.c: In compare_process(), discard handles already signalled.
2140
2141 2003-09-02  Dick Porter  <dick@ximian.com>
2142
2143         * io.c: Work around glib brain-dead assumptions about utf8-encoded
2144         filenames.  Fixes bug 30781.
2145
2146 2003-08-28  Dick Porter  <dick@ximian.com>
2147
2148         * critical-sections.c:  Patch from Bernie Solomon
2149         <bernard@ugsolutions.com> to emit a warning if locking a critical
2150         section fails.
2151
2152 2003-07-23  Dick Porter  <dick@ximian.com>
2153
2154         * shared.c:
2155         * daemon.c (maybe_exit): Avoid the race condition when the daemon is
2156         closing but another client comes along when the shared data is still
2157         visible.  Should fix bugs 33671 and 35213.
2158
2159 2003-07-23  Dick Porter  <dick@ximian.com>
2160
2161         * handles.c:  Initialise handle mutex and cond.  Fix by
2162         Bernie Solomon <bernard@ugsolutions.com>
2163
2164 2003-07-15  Dick Porter  <dick@ximian.com>
2165
2166         * timed-thread.c (timed_thread_start_routine): Fix virtual memory
2167         leak when threads quit.  Fixes bug 44067.
2168
2169 Wed Jun 18 19:08:40 CEST 2003 Paolo Molaro <lupus@ximian.com>
2170
2171         * io.c: never add write permission for group or others in
2172         SetFileAttributes ().
2173
2174 2003-06-17  Dick Porter  <dick@ximian.com>
2175
2176         * io.c (SetFileAttributes): Implement the ReadOnly attribute, and
2177         ignore the unsupported ones ("fixes" bug 44977).
2178
2179 2003-06-17  Lluis Sanchez Gual  <lluis@ximian.com>
2180
2181         * misc.c: fix bug in _wapi_calc_timeout. It gave wrong values for
2182           high ms values (there was an overflow).
2183
2184 2003-06-17  Zoltan Varga  <vargaz@freemail.hu>
2185
2186         * system.h (struct _WapiSystemInfo ): Fix warnings when using gcc-3.3.
2187
2188 2003-06-11  Dick Porter  <dick@ximian.com>
2189
2190         * shared.c: Fix shared directory creation.  Patch from
2191         Pablo Baena <pbaena@uol.com.ar>
2192
2193 2003-06-10  Dick Porter  <dick@ximian.com>
2194
2195         * atomic.c: Delete the useless compile warning
2196
2197 2003-06-09  Dick Porter  <dick@ximian.com>
2198
2199         * daemon.c: Lookup env as a string array.  Fixes bug 44289.  Also
2200         make setting the process handle value in the environment actually
2201         work.
2202
2203         * processes.c: Pretty up the process name, if it happens to be
2204         "mono" such as when another mono process forks "mono foo.exe"
2205
2206 2003-06-05  Dick Porter  <dick@ximian.com>
2207
2208         * processes.c (process_set_current): Don't do an expensive handle
2209         search at application startup, check the environment to see if the
2210         process handle has already been created.
2211
2212         * io.c: Don't do an expensive handle search when creating stdin,
2213         stdout and stderr handles, just create them all the first time one
2214         is requested.
2215
2216         * wapi-private.h:
2217         * shared.c:
2218         * shared.h:
2219         * handles.c:
2220         * handles-private.h:
2221         * daemon-messages.h:
2222         * daemon-private.h:
2223         * daemon.c: Support for "unlimited" number of handles and scratch
2224         data.
2225
2226         Speed up application startup by passing process handle in the
2227         environment, rather than let the app scan all handles (which gets
2228         really slow when there are more than a few thousand to check.)
2229
2230         Initialise some structs passed to syscalls, noticed by valgrind.
2231         
2232
2233 2003-05-20  Dick Porter  <dick@ximian.com>
2234
2235         * io.c (FindFirstFile): Include . files in the glob.  Fixes bug
2236         43229.
2237
2238 2003-05-19  Dick Porter  <dick@ximian.com>
2239
2240         * threads.c: Set the new thread's stack size to 2M.  Fix needed
2241         for BSD, reported by Martin Dvorak <md@9ll.cz>
2242
2243 2003-05-16  Dick Porter  <dick@ximian.com>
2244
2245         * io.h:
2246         * io.c: Implement GetTempPath()
2247
2248 2003-05-16  Dick Porter  <dick@ximian.com>
2249
2250         * processes.c (CreateProcess): Set some error codes
2251
2252 2003-05-12  Dick Porter  <dick@ximian.com>
2253
2254         * misc.c (_wapi_calc_timeout): Cope with overflowing tv_nsec.
2255         Patch from Martin Dvorak <mdvorak@ninell.cz>.
2256
2257 2003-05-10  Dick Porter  <dick@ximian.com>
2258
2259         * io.c (CopyFile): Copy file mode as well as file data.  Based on
2260         suggestion by Giuseppe Greco <giuseppe.greco@agamura.com>, bug
2261         42706.
2262
2263 2003-05-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
2264
2265         * handles.c: don't call GC_gcollect when creating new handles.
2266
2267 2003-05-05  Gonzalo Paniagua Javier <gonzalo@ximian.com>
2268
2269         * handles.c: added some debugging code. Call GC_gcollect
2270         before creating a new handle. It makes Lupus' test run smoother and
2271         faster (from 62 to 83 request per second). Notice that calling
2272         GC_finalizer_notifier if needed (GC_should_invoke_finalizer ()) does
2273         not improve nor degrade the performance, so i don't do it.
2274
2275 2003-05-02  Dick Porter  <dick@ximian.com>
2276
2277         * sockets.c: Rearrange closesocket() and socket_close_private(),
2278         and remember to unref the handle, so we don't leak socket handles.
2279         Fix from Pelle Johnsen <pelle.johnsen@mail.dk>
2280
2281 2003-04-11  Dick Porter  <dick@ximian.com>
2282
2283         * atomic.h: ARM atomic operations by Malte Hildingson
2284         <tds00mahi@tellus.thn.htu.se>
2285
2286 Tue Apr 8 11:37:29 CEST 2003 Paolo Molaro <lupus@ximian.com>
2287
2288         * atomic.h: fix macosx build by "Urs C. Muff" <umuff@quark.com>.
2289
2290 2003-04-03  Martin Baulig  <martin@ximian.com>
2291
2292         The following change is conditional to `WITH_INCLUDED_LIBGC'
2293         which is not yet enabled by default.
2294
2295         * threads.c (SuspendThread, ResumeThread): Fully implemented this.
2296         (gc_init): New static function; install a signal handler for
2297         SIGPWR which is used to suspend threads.  [FIXME: it SIGPWR
2298         doesn't exist on all Unix systems, we need to find another
2299         signal].
2300         (mono_wapi_push_thread_stack): New public function.  Tells the
2301         garbage collector about the current stack pointer of a suspended
2302         thread.
2303
2304 2003-04-03  Martin Baulig  <martin@ximian.com>
2305
2306         * timed-thread.h (TimedThread): Added `suspended_sem',
2307         `suspend_count' and `stack_ptr'.
2308
2309 2003-03-28  Dick Porter  <dick@ximian.com>
2310
2311         * atomic.h: PPC support gratiously donated to the public domain
2312         by John Duncan <jddst19@mac.com>
2313
2314 2003-03-20  Dick Porter  <dick@ximian.com>
2315
2316         * sockets.c (_wapi_connect): If connect() fails with EACCES, try
2317         setting SO_BROADCAST and connecting again.  Fixes bug 39178.
2318
2319 2003-03-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
2320
2321         * processes.c: included Jerome Laban's patch and call SetLastError when
2322         the executable is not found.
2323
2324 2003-03-03  Dick Porter  <dick@ximian.com>
2325
2326         * io.c (CreateFile): Try opening directories readonly, so that
2327         timestamps can be adjusted.  Patch by Elan Feingold
2328         <efeingold@mn.rr.com>.
2329
2330 2003-02-25  Dick Porter  <dick@ximian.com>
2331
2332         * shared.c (_wapi_shm_attach): Return a failure code on system
2333         call errors, rather than exiting.
2334
2335 2003-02-21  Dick Porter  <dick@ximian.com>
2336
2337         * processes.c (GetCurrentProcessId): Use the current process
2338         handle to return the process ID, as getpid() is unreliable
2339         (linuxthreads gives each thread a different pid).  Fixes bug
2340         37550.
2341
2342 2003-02-21  Dick Porter  <dick@ximian.com>
2343
2344         * io.c (FindNextFile): Skip over dangling symlinks.  Fixes bug
2345         34076.
2346
2347 2003-02-11  Dick Porter  <dick@ximian.com>
2348
2349         * timefuncs.h: 
2350         * timefuncs.c: Added GetTickCount()
2351
2352 2003-02-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
2353
2354         * error.c: added WSA_EHOSTUNREACH mapping.
2355
2356 2003-01-26  Miguel de Icaza  <miguel@ximian.com>
2357
2358         * io.c (SetFileAttributes): This routine is not currently
2359         implemented for the general case, but I added a special case to
2360         set the executable bit on Linux.
2361
2362 Wed Jan 15 15:55:40 CET 2003 Paolo Molaro <lupus@ximian.com>
2363
2364         * sockets.h, daemon.c, io.c: compilation fixes on MacOSX.
2365
2366 2003-01-08  Dick Porter  <dick@ximian.com>
2367
2368         * sockets.c: Fixed setting blocking mode to true (fixes bug 36388)
2369
2370 2002-12-11  Juli Mallett  <jmallett@FreeBSD.org>
2371
2372         * daemon.c, handles-private.h, handles.c, wapi-private.h:
2373         Check for an implementation which says it supports
2374         _POSIX_THREAD_PROCESS_SHARED, rather than just one that
2375         defines the symbol.  Defined but with a value of -1 still
2376         means that it is unsupported.
2377
2378 2002-12-08  Martin Baulig  <martin@ximian.com>
2379
2380         * handles.c (_wapi_handle_new): Create new non-shared handles with
2381         an initial refcount of 1, not 0.
2382
2383 2002-11-22  Dietmar Maurer  <dietmar@ximian.com>
2384
2385         * threads.c (TlsGetValue): removed unnecessary mutex
2386
2387 2002-11-20  Dick Porter  <dick@ximian.com>
2388
2389         * timed-thread.c (_wapi_timed_thread_attach): Attached threads
2390         need to store their data structure too.
2391
2392         * threads.c: Make sure the threading data is initialised wherever
2393         it is needed
2394
2395 2002-11-15  Dick Porter  <dick@ximian.com>
2396
2397         * timed-thread.c: Removed unneeded parameters in
2398         _wapi_timed_thread_attach().
2399
2400         * threads.c: Renamed AttachThread() to make it not look like
2401         external API.  Removed unneeded parameters.
2402
2403 2002-11-11  Gonzalo Paniagua Javier <gonzalo@ximian.com>
2404
2405         * error.[ch]: added errno_to_WSA (). It displays a warning and return
2406         WSASYSCALLFAILURE if there is no error mapping for the given errno,
2407
2408         * sockets.c: use errno_to_WSA and fixed display of warning for h_errno.
2409
2410 2002-10-31  Dick Porter  <dick@ximian.com>
2411
2412         * io.h: 
2413         * io.c: Define and use INVALID_FILE_ATTRIBUTES
2414
2415 2002-10-07  Dick Porter  <dick@ximian.com>
2416
2417         * timefuncs.c:
2418         * daemon.c: Use a more accurate time source for process start and
2419         end times.
2420
2421 2002-10-03  Dick Porter  <dick@ximian.com>
2422
2423         * daemon.c:
2424         * handles.c:
2425         * threads.c:  Fixes for freebsd.  Make sure that mutex and condition
2426         creation and deletion happen in the process that owns them, when
2427         POSIX shared thread objects aren't supported.  This breaks on
2428         freebsd, as pthread_t is a pointer to data.
2429
2430 2002-10-02  Dick Porter  <dick@ximian.com>
2431
2432         * shared.c: Use mmap() instead of sysv shm for the shared data.
2433
2434         * wapi-private.h (_WAPI_HANDLE_VERSION): Reset back to 0, for the
2435         new system
2436
2437         * daemon-private.h: 
2438         * daemon.c: mmap()ed regions survive fork, so just pass the
2439         pointer to _wapi_daemon_main instead of mapping it again.
2440
2441 2002-10-01  Dick Porter  <dick@ximian.com>
2442
2443         * timed-thread.c: Kludge for CREATE_SUSPENDED thread creation.
2444         Unfortunately libgc uses the same thread suspend technique that I
2445         want to, and the two don't mix: libgc will deadlock when it tries
2446         to stop the world if a thread has already been suspended by
2447         someone else.  Just do the simple suspended create rather than the
2448         general purpose thread suspension for now.
2449
2450         * threads.c: Pass create flags to the timed_thread create call, to
2451         implement suspended thread creation.  ResumeThread() partially
2452         implemented, to cope with the case where a newly created but
2453         suspended thread is launched.
2454
2455 2002-09-30  Dick Porter  <dick@ximian.com>
2456
2457         * sockets.c (ioctlsocket): Set non-blocking mode in a better way,
2458         with fcntl.
2459
2460 2002-09-27  Dick Porter  <dick@ximian.com>
2461
2462         * semaphores.c: Only include semaphore.h if it's present. Patch
2463         for BSD from jmmv@hispabsd.org (Julio Merino).
2464
2465 2002-09-27  Dick Porter  <dick@ximian.com>
2466
2467         * processes.c: Pass environment and working directory to the
2468         daemon when forking.  Don't let argv[0] be duplicated when looking
2469         for the program name.  Implement EnumProcessModules (simple
2470         version for now, lsof-style later if needed), GetModuleBaseName,
2471         {Get,Set}ProcessWorkingSetSize (just faked, because the vm hints
2472         aren't available on Linux).
2473
2474         * process-private.h: Store the process name, and the working set
2475         min and max
2476
2477         * handles.c:
2478         * handles-private.h: New functions to store and retrieve an array
2479         of strings in the scratch space
2480
2481         * daemon.c: Don't miss deleting some handles when a client exits
2482         (we used to rely on the client doing the final cleanup, but
2483         obviously if the client is no longer there the daemon has to do
2484         it).
2485
2486         Process forking now sets the environment and the working
2487         directory.
2488
2489         * io.c: Don't confuse fd 0 with an unassigned handle struct
2490
2491         * atomic.h: Add a google cache alternative to the msdn URL
2492
2493 2002-09-25  Gonzalo Paniagua Javier <gonzalo@ximian.com>
2494
2495         * sockets.c:
2496         (_wapi_recvfrom): added ECONNRESET to the switch.
2497
2498 2002-09-24  Mark Crichton  <crichton@gimp.org>
2499
2500         * atomic.h: Yea.  On linux, sparc isn't sparc, it's __sparc__.
2501         Added to ifdef.
2502
2503 2002-09-19  Mark Crichton  <crichton@gimp.org>
2504
2505         * daemon.c, shared.c: Added NEED_LINK_UNLINK for systems that
2506         dont have Linux's abstract filesystem for sockets.
2507
2508 2002-09-19  Mark Crichton  <crichton@gimp.org>
2509
2510         * atomic.h: Added SPARC atomic asm code.
2511         * daemon.c, handles-private.h, handles.c, wapi-private.h:
2512         undefined _POSIX_THREAD_PROCESS_SHARED.  This actually exists on
2513         Solaris 9, however, the code paths don't seem to work.  More testing
2514         on the shared case is *really* needed.
2515
2516 2002-09-03  Dick Porter  <dick@ximian.com>
2517
2518         * threads.h: 
2519         * threads.c: Removed PosixKillThread(), because it's not in the
2520         w32 api
2521
2522 2002-08-20  Dick Porter  <dick@ximian.com>
2523
2524         * handles.c (_wapi_handle_scratch_store): Made stored byte lengths
2525         multiples of 4 bytes, to keep header structures aligned.  Needed
2526         for sparc, at least. (Patch from crichton@gimp.org)
2527
2528         * handles.c: Removed 'disable_shm' variable (we've defaulted to
2529         building with shm enabled for months now)
2530
2531 2002-08-19  Dick Porter  <dick@ximian.com>
2532
2533         * daemon.c: Rewrote the poll() loop to use GIOChannels instead,
2534         for legacy NeXT-based systems.
2535
2536 2002-08-12  Dick Porter  <dick@ximian.com>
2537
2538         * atomic.h: Rename some parameters to avoid c++ keywords (Patch
2539         from Joseph Wenninger <kde@jowenn.at>)
2540
2541 2002-08-05  Dietmar Maurer  <dietmar@ximian.com>
2542
2543         * threads.c: use fast spinlocks by default
2544
2545 2002-08-02  Dick Porter  <dick@ximian.com>
2546
2547         * io.c (GetStdHandle): Add a handle reference when returning a
2548         duplicate console handle.  This fixes the unref_handle errors in
2549         NUnit.
2550
2551 2002-08-01  Dietmar Maurer  <dietmar@ximian.com>
2552
2553         * threads.c (TLS_PTHREAD_MUTEX): define this because else some
2554         tests does not work
2555
2556 2002-08-01  Dick Porter  <dick@ximian.com>
2557
2558         * threads.c: Use atomic spinlocks in TLS functions
2559
2560         * mono-spinlock.h:
2561         * Makefile.am: Added mono-spinlock.h
2562
2563 2002-07-21  Jeffrey Stedfast  <fejj@ximian.com>
2564
2565         * daemon-messages.c: #include <sys/types.h> and <sys/sockets.h> -
2566         these are needed for sendmsg() and also for struct msghdr (at
2567         least on Solaris). Solaris still won't build because struct msghdr
2568         doesn't have msg_flags, msg_control, or msg_controllen members.
2569         (CMSG_SPACE): Define for systems that don't have it.
2570         (CMSG_LEN): Same.
2571
2572 2002-07-20  Dick Porter  <dick@ximian.com>
2573
2574         * wapi-private.h:
2575         * io-private.h:
2576         * io.h:
2577         * io.c:
2578         * handles.c: Implemented pipe handles
2579         
2580         * handles.c:
2581         * daemon.c: Fixed bug in handle closing.
2582
2583         * shared.c:
2584         * daemon.c: Forked processes now close all open file descriptors.
2585
2586 Fri Jul 19 19:05:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
2587
2588         * sockets.h, io-layer.h, critical-sections.h: don't include config.h
2589         in header files.
2590
2591 2002-07-19  Martin Baulig  <martin@gnome.org>
2592
2593         * threads.c (ExitThread): Call exit() if no threads has been
2594         created yet.
2595
2596 2002-07-17  Dick Porter  <dick@ximian.com>
2597
2598         * daemon-messages.c: Freebsd fixes from Andreas Kohn
2599         <andreas.kohn@gmx.net>
2600
2601 2002-07-15  Dick Porter  <dick@ximian.com>
2602
2603         * io.c: Removed bogus console_flush() method, that was just cut
2604         and pasted from file_flush when I separated the two handle types.
2605
2606 2002-07-12  Dick Porter  <dick@ximian.com>
2607
2608         * io.c (convert_from_flags): Fixed misunderstanding wrt fcntl
2609         flags.  Fixes bug 27633.
2610
2611 2002-07-12  Dick Porter  <dick@ximian.com>
2612
2613         * wapi-private.h:
2614         * handles.c:
2615         * daemon.c: Use size of sockaddr_un.sun_path from config.h
2616
2617 2002-07-12  Dick Porter  <dick@ximian.com>
2618
2619         * processes.c (CreateProcess): Send stdin, stdout and stderr
2620         handles if the startup info doesnt specify new ones
2621
2622         * io.c (GetStdHandle): Return the same handle when the same
2623         standard handle is requested
2624
2625         * handles.c: Pass file descriptors when forking
2626
2627         * daemon.c: Use supplied file descriptors when forking a new
2628         process
2629
2630         * daemon-messages.h: 
2631         * daemon-messages.c: Pass stdin, stdout and stderr file
2632         descriptors to the daemon (used when forking)
2633
2634 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
2635
2636         * daemon.c (_wapi_daemon_main): Use sizeof
2637         (main_socket_address.sun_path) instead of hardcoded 108 value.
2638
2639         * handles.c (shared_init): Use sizeof
2640         (shared_socket_address.sun_path) instead of hardcoded 108 value.
2641
2642 2002-07-10  Dennis Haney  <davh@davh.dk>
2643
2644         * shared.c:
2645         * handles.c:
2646         * daemon.c: Lots of documentation, some added error checking, and
2647         code readability improvements.
2648
2649         * daemon-messages.h: Add the Error request type to improve error
2650         checking.
2651
2652         * daemon-messages.c: Do a bit more error checking on send() and
2653         recv(), and log errors with a higher severity level.
2654
2655 2002-07-04  Dick Porter  <dick@ximian.com>
2656
2657         * daemon.c (process_process_fork): Fix argument handling, due to
2658         buggy understanding of g_strsplit() behaviour.
2659
2660 2002-07-03  Dick Porter  <dick@ximian.com>
2661
2662         * threads.h:
2663         * threads.c: Implement OpenThread().  Define access-control values
2664         for thread handles.
2665
2666         * wapi.h:
2667         * processes.h:
2668         * access.h:
2669         * Makefile.am: Added access.h, to hold shared access-control
2670         definitions
2671
2672 2002-07-02  Dick Porter  <dick@ximian.com>
2673
2674         * wapi-private.h (_WAPI_HANDLE_VERSION): New protocol version
2675         
2676 2002-07-02  Dick Porter  <dick@ximian.com>
2677
2678         * handles.c (shared_init): Make a second attempt to contact the
2679         daemon if the shared memory attach succeeds, but the connect()
2680         fails. (This copes with the daemon crashing without cleaning up
2681         the shared memory.)
2682
2683         * Makefile.am: 
2684         * daemon-private.h:
2685         * daemon.c:
2686         * shared.c (_wapi_shm_attach): Don't exec() anything when we fork
2687         the daemon, it's now built into the library.
2688
2689 2002-06-25  Dick Porter  <dick@ximian.com>
2690
2691         * handles.c:
2692         * handles-private.h:
2693         * daemon-messages.h:
2694         * daemon.c: Process forking and handle data management
2695
2696         * processes.h:
2697         * process-private.h:
2698         * processes.c: Process forking and other support functions
2699
2700 2002-06-25  Dick Porter  <dick@ximian.com>
2701
2702         * versioninfo.h: PE resource decoding
2703
2704         * unicode.c (_wapi_unicode_to_utf8): g_utf16_to_utf8 doesnt need
2705         to be told the string length
2706
2707         * io.c: Removed the ACTUALLY_DO_UNICODE option.  Fixed some leaks.
2708         Moved _wapi_time_t_to_filetime and the WapiFileTime typedef to
2709         timefuncs.c
2710
2711 2002-06-12  Dick Porter  <dick@ximian.com>
2712
2713         * daemon.c: 
2714         * daemon-messages.c: Handle SIGPIPE in a non-stupid way in the
2715         daemon, if MSG_NOSIGNAL isn't available.  Thanks to Jaroslaw
2716         Kowalski <jarek@atm.com.pl> for pointing out the bogosity.
2717
2718 2002-06-10  Jaroslaw Kowalski <jarek@atm.com.pl>
2719
2720         * sockets.c, daemon-messages.c: Prevent SIGPIPE from being raised
2721         when writing to a closed socket.
2722
2723 2002-06-08  Jeffrey Stedfast  <fejj@ximian.com>
2724
2725         * mono-mutex.c (mono_once): New convenience function for my
2726         previous fix.
2727
2728         * handles.c:
2729         * error.c: 
2730         * critical-sections.c: 
2731         * threads.c: 
2732         * sockets.c: 
2733         * semaphores.c: 
2734         * processes.c: 
2735         * mutexes.c: 
2736         * io.c: 
2737         * events.c: 
2738         * atomic.c: Use mono_once() rather than pthread_once().
2739
2740 2002-06-06  Jeffrey Stedfast  <fejj@ximian.com>
2741
2742         * handles.c (_wapi_handle_new): pthread_once() is not atomic, so
2743         if multiple threads all try to call _wapi_handle_new() before the
2744         shared data has been initialized, it is possible that we could get
2745         into a condition where shared_init() is being executed and later
2746         threads will pass by pthread_once() due to the fact that it has
2747         already been called and so therefor will attempt to use the shared
2748         data before it has been completely initialized. If we instead use
2749         a standard mutex locking mechanism around shared_init(), we can
2750         avoid the situation entirely. By wrapping the mutex locking in a
2751         check to see if we've already initialized the data, we can even
2752         avoid wasting resources by having to lock/unlock the mutex in any
2753         later calls (the only time we'd have to worry about
2754         locking/unlocking is the initial race to call shared_init() at
2755         startup).
2756
2757 Sat Jun 1 13:27:11 CEST 2002 Paolo Molaro <lupus@ximian.com>
2758
2759         * atomic.h: inline asm fixes from Dennis Haney (davh@davh.dk).
2760
2761 Fri May 31 16:21:54 CEST 2002 Paolo Molaro <lupus@ximian.com>
2762
2763         * daemon.c, handles.c: rename "sun" local var since it's apparently
2764         a #define on Solaris.
2765
2766 Fri May 31 15:40:14 CEST 2002 Paolo Molaro <lupus@ximian.com>
2767
2768         * daemon-messages.c: work-around MSG_NOSIGNAL missing on some
2769         platforms.
2770
2771 2002-05-15  Dick Porter  <dick@ximian.com>
2772
2773         * wait.c: Fix a deadlock in WaitForMultipleObjects
2774
2775 2002-05-14  Dick Porter  <dick@ximian.com>
2776
2777         * io.c: Fix a cut&paste error, found by
2778         Jaroslaw Kowalski <jarek@atm.com.pl>
2779
2780 2002-05-10  Dan Lewis  <dihlewis@yahoo.co.uk>
2781
2782         * io.c: Nasty typo.
2783
2784 2002-05-09  Dick Porter  <dick@ximian.com>
2785
2786         * threads.c: 
2787         * semaphores.c: 
2788         * processes.c: 
2789         * mutexes.c: 
2790         * handles-private.h: 
2791         * events.c: 
2792         * Makefile.am: Remove now-unused file wait-private.h
2793
2794 2002-05-08  Dick Porter  <dick@ximian.com>
2795
2796         * shared.c: Better error messages, and report when daemon
2797         connection fails rather than blocking forever.  Do some more
2798         shared memory sanity checking.
2799
2800         * handles.c: Better error messages when connecting to shared
2801         memory and the handle daemon.  Fall back to non-shared handles if
2802         an error occurs.  Set the default back to 'shared handles'.  Fix a
2803         crashing bug in scratch space allocation that mangled the block
2804         headers.
2805
2806 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
2807
2808         * handles.c (shared_init): Disable SHM for now, people have too
2809         many problems with this, and the diagnostics are not helping.
2810
2811 2002-05-06  Dan Lewis  <dihlewis@yahoo.co.uk>
2812
2813         * io.c: CreateFile sets win32 last error.
2814
2815 2002-05-05  Dick Porter  <dick@ximian.com>
2816
2817         * wapi-private.h: 
2818         * handles-private.h:
2819         * io.c: 
2820         * io-private.h:
2821         * mutexes.c: 
2822         * mutex-private.h: 
2823         * processes.c: 
2824         * process-private.h: 
2825         * semaphores.c: 
2826         * semaphore-private.h: 
2827         * sockets.c: 
2828         * socket-private.h: 
2829         * events.c: 
2830         * event-private.h: Simplify the WapiHandleOps struct: take out all
2831         the file-specific entries, leaving just the items that operate on
2832         handles themselves.  Split the close operation into shared and
2833         private parts: shared close is called by the daemon.
2834
2835         * handles.c: As above, but also pass handle allocation, ref and
2836         unref operations to the daemon.  Populate the handle_ops array at
2837         compile time, because the daemon needs to call ops on handles too.
2838         Don't bother to track open handle counts any more, the daemon does
2839         that.
2840         
2841         * threads.c: 
2842         * thread-private.h: As above, but also make the thread data
2843         handle-private.
2844
2845         * shared.c: Fork a handle daemon if the calling process created
2846         the shared memory segment.
2847
2848         * daemon.c:
2849         * daemon-messages.c:
2850         * daemon-messages.h:
2851         * Makefile.am: Build a daemon to manage handle allocation and
2852         destruction without needing to lock the shared memory
2853
2854 2002-04-30  Jeffrey Stedfast  <fejj@ximian.com>
2855
2856         * atomic.c: Changed to use a normal mutex rather than a spinlock
2857         since a lot of platforms seem to not have them :\
2858
2859 2002-04-30  Dick Porter  <dick@ximian.com>
2860
2861         * Completely rewrote the handle waiting code: removed the helper
2862         thread and its attendant complexity.  All handle waiting is now
2863         abstracted into the WaitForSingleObject() and
2864         WaitForMultipleObjects() functions.
2865
2866         * Implemented inter-process sharing of handles using sysv shared
2867         memory.  This makes handles even more opaque, with a handle now
2868         just an index into an array.
2869         
2870 2002-04-25  Dan Lewis  <dihlewis@yahoo.co.uk>
2871
2872         * io.c: unitialized pointer in GetCurrentDirectory.
2873
2874 Sat Apr 20 13:37:39 CEST 2002 Paolo Molaro <lupus@ximian.com>
2875
2876         * threads.c: destroy the mutex at thread destruction
2877         (if/when thread destruction code will be actually called).
2878         When protecting a tls data pointer from the gc, use also the 
2879         thread id in the key.
2880         
2881 Wed Apr 17 18:36:27 CEST 2002 Paolo Molaro <lupus@ximian.com>
2882
2883         * timed-thread.c: avoid race condition when setting the thread to
2884         detached.
2885
2886 2002-04-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
2887
2888         * jit.h: to more #include lines to avoid breaking compilation
2889         under windows when upgrading mingw and w32api to version
2890         1.3 (thanks Dick!).
2891
2892 2002-04-16  Dick Porter  <dick@ximian.com>
2893
2894         * atomic.h: Explanatory comment about lack of 80386 support
2895
2896 2002-04-15  Dick Porter  <dick@ximian.com>
2897
2898         * atomic.h: use xaddl for InterlockedIncrement() and
2899         InterlockedDecrement().  Use cmpxchgl in a loop for
2900         InterlockedExchange() and InterlockedExchangePointer().
2901
2902 Mon Apr 15 13:31:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
2903
2904         * unicode.c: fix unicode_len() to not access uninitialized memory
2905         (and updated to conform to mono code style).
2906
2907 Fri Mar 29 17:15:11 CET 2002 Paolo Molaro <lupus@ximian.com>
2908
2909         * io.c: EEXISTS is ignored for directory creation.
2910         * mono-mutex.h: remove silly "pragma }" that emacs users insert
2911         because they use a broken editor:-)
2912
2913 2002-03-28  Dick Porter  <dick@ximian.com>
2914
2915         * sockets.h: 
2916         * sockets.c: 
2917         * io.c: 
2918         * handles.h: 
2919         * handles.c: Warning cleanups
2920
2921 2002-03-27  Dan Lewis <dihlewis@yahoo.co.uk>
2922
2923         * unicode.h, unicode.c: changed to gunichar2
2924         * io.h, io.c: changed strings to gunichar2*, added
2925         SetFileAttributes(), GetCurrentDirectory(), SetCurrentDirectory(),
2926         some fixes to FindFirstFile() and friends.
2927
2928 2002-03-26  Dick Porter  <dick@ximian.com>
2929
2930         * types.h: Implement the large integer struct
2931
2932         * timefuncs.h:
2933         * timefuncs.c: Dummy functions that don't yet implement
2934         QueryPerformanceCounter() and QueryPerformanceFrequency()
2935
2936         * threads.h:
2937         * threads.c: Implement SleepEx()
2938
2939         * system.h:
2940         * system.c: Beginnings of GetSystemInfo()
2941
2942         * mono-mutex.c (pthread_mutex_timedlock): Fix a ms/ns conversion
2943         thinko
2944
2945         * context.h:
2946         * context.c: Dummy function that doesnt yet implement
2947         GetThreadContext()
2948
2949         * atomic.h: 
2950         * atomic.c: Interlocked functions
2951
2952 Mon Mar 25 13:01:40 CET 2002 Paolo Molaro <lupus@ximian.com>
2953
2954         * threads.c: use a gc-safe hash table to store tls pointers.
2955
2956 2002-03-22  Dick Porter  <dick@ximian.com>
2957
2958         * threads.c: Fix a race condition where a thread can start and
2959         exit before the handle has been properly initialised (no reason
2960         why the handle couldn't be initialised beforehand, so do so)
2961
2962         Fix a ms to ns conversion magnitude thinko.
2963
2964 2002-03-21  Dick Porter  <dick@ximian.com>
2965
2966         * semaphores.c: Fix a problem when waiting for one or more
2967         semaphores, and another semaphore is Released (all waiting
2968         semaphores assumed they were signalled)
2969
2970 2002-03-29  Dan Lewis <dihlewis@yahoo.co.uk>
2971
2972         * io.h, io.c, uglify.h: added MoveFile, CopyFile, CreateDirectory,
2973         RemoveDirectory, GetFileAttributes, GetFileAttributesEx
2974
2975 2002-03-19  Dietmar Maurer  <dietmar@ximian.com>
2976
2977         * threads.c (Sleep): bug fix: 1ms == 1000000ns
2978
2979 2002-03-19  Dan Lewis <dihlewis@yahoo.co.uk>
2980
2981         * io.h, io.c, events.c, mutexes.c, semaphores.c, sockets.c,
2982         threads.c, io.c: added flush method to handles.
2983
2984         * io.c: FlushFileBuffers() and FindFirstFile() functions.
2985
2986 Thu Mar 7 17:21:52 CET 2002 Paolo Molaro <lupus@ximian.com>
2987
2988         * threads.c, timed-thread.c, wait.c: Boehm-GC anable.
2989
2990 2002-02-20  Dick Porter  <dick@ximian.com>
2991
2992         * io-layer.h: Always build without cygwin support on windows
2993
2994 Mon Feb 18 15:50:59 CET 2002 Paolo Molaro <lupus@ximian.com>
2995
2996         * sockets.c: #undef DEBUG.
2997
2998 2002-02-14  Jeffrey Stedfast  <fejj@ximian.com>
2999
3000         * io-layer.h: conditionally include sys/filio.h and sys/sockio.h
3001         for FIONBIO, FIONREAD, and SIOCATMARK.
3002
3003 2002-02-14  Jeffrey Stedfast  <fejj@ximian.com>
3004
3005         * sockets.c: conditionally include sys/filio.h and sys/sockio.h
3006         for FIONBIO, FIONREAD, and SIOCATMARK.
3007
3008 2002-02-13  Dick Porter  <dick@ximian.com>
3009
3010         * sockets.c: Implement shutdown and select
3011
3012 2002-02-13  Jeffrey Stedfast  <fejj@ximian.com>
3013
3014         * mono-mutex.[c,h]: New source files that thinly wrap all pthread
3015         functions that take pthread_mutex_t and/or pthread_mutexattr_t
3016         arguments for the sake of portability. Implements recursive
3017         mutexes and pthread_mutex_timedlock.
3018
3019         * critical-sections.c:
3020         * events.c:
3021         * handles.c:
3022         * mutexes.c:
3023         * semaphores.c:
3024         * threads.c:
3025         * timed-thread.c:
3026         * wait.c: Use the mono-mutex wrapper portability functions/macros.
3027
3028         * pthread-compat.[c,h]: Replaced by mono-mutex.[c,h]
3029
3030 2002-01-23  Dick Porter  <dick@ximian.com>
3031
3032         * sockets.c: Networking support, mostly wrapping BSD socket APIs
3033         with handle code, and translating errno into w32 error codes.
3034
3035         * macros.h: Some w32 macros used with the socket support
3036
3037         * error.c: Implemented GetLastError() and SetLastError()
3038
3039         * Makefile.am: Added sockets, with kludge to override some symbols
3040
3041 2001-12-17  Dietmar Maurer  <dietmar@ximian.com>
3042
3043         * unicode.c (_wapi_unicode_to_utf8): byteswap UTF16 strings before
3044         passing them to iconv
3045         (_wapi_unicode_to_utf8): only swap bytes on LE systems, remove bug
3046         from previous commit.
3047
3048 2001-12-11  Dick Porter  <dick@ximian.com>
3049
3050         * io.c: Implement DeleteFile(), GetFileTime(), SetFileTime() and
3051         FileTimeToSystemTime().
3052
3053         * unicode.c (unicode_len): Nasty way of finding length of unicode
3054         string with embedded NULLs (counts until two NULLs together).
3055
3056         * mutexes.c (mutex_close): 
3057         * events.c (event_close): Release the internal pthreads resources
3058
3059 2001-11-26  Dick Porter  <dick@ximian.com>
3060
3061         * critical-sections.c:
3062         * events.c:
3063         * handles.c:
3064         * io.c:
3065         * mutexes.c:
3066         * semaphores.c:
3067         * threads.c:
3068         * timed-thread.c:
3069         * wait.c: turn off DEBUG messages
3070
3071 2001-11-22  Dick Porter  <dick@ximian.com>
3072
3073         * handles.c (SignalObjectAndWait): Implement
3074
3075         * wait.c (WaitForSingleObject): Fix case where timeout == 0
3076
3077         * threads.c:
3078         * semaphores.c:
3079         * mutexes.c:
3080         * io.c:
3081         * events.c: Support for SignalObjectAndWait
3082         
3083 2001-11-21  Dick Porter  <dick@ximian.com>
3084
3085         * events.c:
3086         * handles.c:
3087         * mutexes.c:
3088         * semaphores.c:
3089         * threads.c:
3090         * wait.c: Reliable method of returning which handle was signalled
3091         on return from WaitForMultipleObjects().
3092
3093 2001-11-21  Dick Porter  <dick@ximian.com>
3094
3095         * events.c: Implement events
3096
3097 2001-11-15  Dick Porter  <dick@ximian.com>
3098
3099         * mutexes.c: Implement mutexes
3100
3101         * threads.c: 
3102         * semaphores.c: 
3103         * misc.c: Factor out some common code
3104
3105 2001-11-13  Dick Porter  <dick@ximian.com>
3106
3107         * threads.c: Implement TLS.  Implement GetCurrentThreadId(), and
3108         GetCurrentThread() by maintaining a hash of thread handles.
3109
3110         * threads.h: Define thread and process creation flags
3111
3112 2001-11-12  Dick Porter  <dick@ximian.com>
3113
3114         * critical-sections.c: Implement critical sections
3115
3116 2001-11-12  Dick Porter  <dick@ximian.com>
3117
3118         * semaphores.c: Implement semaphores
3119
3120         * wait.c (wait_for_item): Maintain a wait count rather than count
3121         signalled booleans.
3122
3123         * threads.c (thread_wait_multiple): Don't lock the wait item, that
3124         will block other wait threads
3125
3126 2001-11-11  Dick Porter  <dick@ximian.com>
3127
3128         * Makefile.am: Rename some automake variables
3129         (from Nick Drochak <ndrochak@gol.com>)
3130
3131 2001-11-10  Dick Porter  <dick@ximian.com>
3132
3133         * Makefile.am (libwapiincludedir): Fix include destination
3134
3135         * .cvsignore: Ignore generated files
3136
3137 2001-11-10  Dietmar Maurer  <dietmar@ximian.com>
3138
3139         * pthread-compat.c: added some include files to make it compile on
3140         linux.
3141
3142 2001-11-08  Dick Porter  <dick@ximian.com>
3143
3144         * Initial checkin.
3145
3146         This is a library emulating the win32 threading and IO API.