2004-06-16 Dick Porter <dick@ximian.com>
[mono.git] / mono / io-layer / ChangeLog
1 2004-06-16  Dick Porter  <dick@ximian.com>
2
3         * timed-thread.c: Call the thread cleanup exit routine before taking
4         the join mutex, because this could deadlock if another thread tries
5         to join in the meantime.  This fixes the hang-at-exit problem seen
6         on macos.
7
8 2004-06-03  Lluis Sanchez Gual  <lluis@ximian.com>
9
10         * threads.c: Implemented SleepEx.
11         * threads.h: Fixed SleepEx signature.
12
13 2004-06-03  Miguel de Icaza  <miguel@ximian.com>
14
15         * threads.c: When running under valgrind, do not allocate too much
16         stack, as Valgrind default is 1 meg.
17
18 2004-05-27  Dick Porter  <dick@ximian.com>
19
20         * io.h:
21         * io.c: Implemented LockFile() and UnlockFile()
22
23 2004-05-21  Dick Porter  <dick@ximian.com>
24
25         * io.c (CreateFile): Check for existing share modes when opening
26         a file.
27
28         * handles.c: 
29         * handles-private.h: 
30         * daemon-messages.h: 
31         * daemon.c: Maintain a hash of file share modes, keying on device
32         and inode (to cope with symlinks.)
33
34 2004-05-20  Lluis Sanchez Gual  <lluis@ximian.com>
35
36         * daemon-messages.c: Retry if the communication with the daemon is
37           interrupted by a signal.
38         * io.c, sockets.c: Check for EINTR in every syscall that can be interrumped. 
39           Only return an error in this case if there is something in the apc queue
40           (which means that it is an interruption requested by the "user").
41         * processes.c: Use WaitForSingleObjectEx. No need to pass "alertable" as
42           true since the wait is small.
43         * shared.c: Retry write calls when interrumped by a signal.
44         * timed-thread.h, timed-thread.c: added _wapi_thread_apc_pending, which
45           returns TRUE if there are pending asynchronous calls (APC) for the
46           provided thread. Also added _wapi_thread_dispatch_apc_queue which calls
47           the enqueued APCs. Defined a new struct ApcInfo that holds information
48           about an enqueued APC.
49         * thread-private.h, threads.c: Implemented QueueUserAPC (which does the same
50           as in win32),_wapi_thread_apc_pending and _wapi_thread_dispatch_apc_queue. 
51           These last two methods call the corresponding apc methods in 
52           thread-private using the provided thread handle.
53         * threads.h: Added QueueUserAPC.
54         * uglify.h: Added WapiApcProc (needed by QueueUserAPC).
55         * wait.c, wait.h: Changed WaitForSingleObject to WaitForSingleObjectEx, and
56           WaitForMultipleObjects to WaitForMultipleObjectsEx. Implemented support
57           for APCs in those two methods and also in SleepEx.
58
59 2004-05-17  Dick Porter  <dick@ximian.com>
60
61         * io.c (CopyFile): Speed up.  Fixes bug 57859.
62
63 2004-05-13  Dick Porter  <dick@ximian.com>
64         * mono-mutex.c (mono_mutex_unlock): Return EPERM when the current
65         thread doesn't own the mutex, rather than assert()ing.
66
67 2004-05-11  Dick Porter  <dick@ximian.com>
68
69         * shared.c (_wapi_shm_attach): Cope when a previous daemon startup
70         attempt failed, leaving shared files that look like a daemon is
71         still starting.
72
73 2004-05-10  Gonzalo Paniagua Javier <gonzalo@ximian.com>
74
75         * io.c:
76         (SetFileAttributes): don't the the exec bit if the corresponding read
77         bit is not set.
78
79 2004-05-10  Zoltan Varga  <vargaz@freemail.hu>
80
81         * io.c (FindFirstFile): Fix invalid free.
82
83 2004-05-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
84
85         * io.c: translate from GFileError to errno codes and don't free
86         variables right after calling mono_io_scandir, as we may overwrite
87         errno value.
88
89 2004-05-08  Gonzalo Paniagua Javier <gonzalo@ximian.com>
90
91         * io.c: g_dir_open return ENOENT for directories on which we don't have
92         read/execute permission, while returning EPERM for anything below those.
93         So, change ENOENT by EPERM if the directory exists.
94
95 2004-05-07  Dick Porter  <dick@ximian.com>
96
97         * io.c (SetFileAttributes): Don't have failed chmod()s cause a
98         "file not found" error.  Fixes bug 54032.
99         
100 2004-05-07  Dick Porter  <dick@ximian.com>
101
102         * io.c (FindFirstFile): Comment out a windows-compatibility check
103         that breaks when directories have metachars in their names.
104         Workaround for bug 58116.
105
106 2004-05-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
107
108         * io.c: fixed for FindFirstFile for empty directories. Closes
109         bug #58147.
110
111 2004-05-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
112
113         * processes.c: set the start time for the current process. Fixes bug
114         #58109.
115
116 2004-05-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
117
118         * io-private.h: 'namelist' is now a gchar ** in _WapiHandlePrivate_find.
119         * io.c: implemented scandir using glib functions.
120
121 2004-05-04  Dick Porter  <dick@ximian.com>
122
123         * daemon.c (read_message): Return FALSE on error so the GSource
124         callback itself can return FALSE.  Cures the infinite loop poll()
125         warning on MacosX.
126         * shared.c: Fix some daemon startup race conditions.
127
128 2004-04-29  Miguel de Icaza  <miguel@ximian.com>
129
130         * io.c (CopyFile): Use 32k buffers to copy the file instead of 2k,
131         use the stack, do not use dynamic memory.
132
133 2004-04-29  Zoltan Varga  <vargaz@freemail.hu>
134
135         * io.c: Add scandir implementation for platforms which do not have
136         it, like solaris.
137
138 2004-04-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
139
140         * io.[ch]: implemented GetLogicalDriveStrings.
141
142 2004-04-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
143
144         * io.c:
145         * sockets.c: use the field name from configure when accessing sigval
146         pointer field. Makes this work on the Mac.
147
148 2004-04-28  Bernie Solomon  <bernard@ugsolutions.com>
149
150         * atomic.c: (InterlockedExchange) fix typo for
151         mutex name
152
153 2004-04-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
154
155         * io.c:
156         * sockets.c: added check for sys/aio.h.
157
158 2004-04-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
159
160         * error.[ch]: added _wapi_get_win32_file_error...
161         * io.c: ... which was _wapi_get_win32_error here.
162         * sockets.c: rename the function calls here too.
163
164 2004-04-28  Dick Porter  <dick@ximian.com>
165
166         * daemon-messages.c: Avoid a deadlock when a thread is killed while
167         waiting for the daemon by using a recursive mutex.  Helps bug 56699.
168
169 2004-04-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
170
171         * io.c: fixed leak in async_notifier().
172
173         * sockets.[ch]: added AIO support for sockets and fixed WSAIoctl
174         declaration.
175
176         * threads.c: removed old comment.
177
178 2004-04-26  David Waite  <mass@akuma.org>
179
180         * daemon-messages.h:
181         * daemon-private.h
182         * error.h:
183         * io.h:
184         * processes.h:
185         * shared.h:
186         * thread-private.h:
187         * wapi-private.h: remove comma from end of enumeration declarations
188         * status.h: cast unsigned int types to int for enum assignment
189
190 2004-04-26 David Waite <mass@akuma.org>
191
192         * io.c:
193         * timefuncs.c: declare 64-bit constants as long long types (i.e.
194         10ULL)
195
196 2004-04-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
197
198         * socket-wrappers.h: _wapi_socket == WSASocket now. Added
199         WSA_FLAG_OVERLAPPED.
200
201         * sockets.c: new unused parameters for _wapi_socket.
202
203 2004-04-22  Miguel de Icaza  <miguel@ximian.com>
204
205         * timed-thread.c: Replace sem_init with MONO_SEM_INIT to handle
206         the fact that MacOS X is a piece of junk (sem_init is *defined* in
207         the libc, but they return `not implemented'). 
208
209 2004-04-22  Dick Porter  <dick@ximian.com>
210
211         * handles.c: 
212         * handles-private.h: Reference the handle when it is locked, so
213         that another thread can't blow it away while we're waiting for it
214         to become signalled.
215         
216         * wait.c: 
217         * timed-thread.c: 
218         * threads.c: 
219         * sockets.c: 
220         * semaphores.c: 
221         * mutexes.c: 
222         * mono-mutex.c: 
223         * io.c: 
224         * handles.c: 
225         * handles-private.h: 
226         * events.c: 
227         * error.c: 
228         * daemon-messages.c: 
229         * critical-sections.c: 
230         * atomic.c: Added pthreads cleanup handlers and error asserts
231
232         * shared.c: 
233         * handles.c: Fixed the gcc "variable might be used uninitialised"
234         warnings.  They can't happen, but gcc doesn't know that
235         g_assert()s don't return.
236
237         Fixed the declaration of _wapi_handle_process_kill() so that it
238         expects the correct type for the pid.
239         
240         * threads.c: Removed the TLS_PTHREAD_MUTEX style locking that
241         hasn't been used in ages and just made the code more complex.
242
243 2004-04-17  Zoltan Varga  <vargaz@freemail.hu>
244
245         * processes.c: Include <signal.h> for SIGKILL and SIGILL + fix some
246         warnings. Fixes #57168.
247
248 2004-04-16  Dick Porter  <dick@ximian.com>
249
250         * threads.c (Sleep): Using div(3) with a negative (when signed)
251         numerator causes the quotient to be 0 and the remainder to be the
252         numerator.  This feeds a small negative value to nanosleep(3),
253         which will return immediately and cause a busy wait.  Fixes bug
254         56351.
255
256 2004-04-15  Dick Porter  <dick@ximian.com>
257
258         * io-private.h:
259         * io.c: Rewrite FindFirstFile and FindNextFile using scandir(3)
260         and fnmatch(3) instead of glob(3).  glob() can't cope with being
261         given filenames containing metachars.  This fixes bug 40557.
262
263 2004-04-14  Bernie Solomon  <bernard@ugsolutions.com>
264
265         * security.c: #warning is a GCC-ism
266
267 2004-04-13  Sebastien Pouliot  <sebastien@ximian.com>
268
269         * security.c: Removed GetUserName as glib g_get_user_name does a
270         better (portability) job. Added ImpersonateLoggedOnUser and
271         RevertToSelf.
272
273 2004-04-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
274
275         * mono-mutex.h: move pthread_mutex_timedlock declaration to...
276         * mono-mutex.c: ...here. It was causing a warning that prevented
277         libgdiplus compilation.
278
279 2004-04-04  Miguel de Icaza  <miguel@ximian.com>
280
281         * security.c (GetUserName): Make it work on MacOS X
282
283 2004-04-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
284
285         * security.c: use getpwuid_r if available. This one is thread-safe.
286
287 2004-04-02  Sebastien Pouliot  <sebastien@ximian.com>
288
289         * Makefile.am: Added security.c|h.
290         * security.c: New file for security related functions. Added function
291         GetUserName to fix #56144.
292         * security.h: New. Header file for security.c
293         * wapi.h: Added include for security.h
294
295 2004-03-25  Gonzalo Paniagua Javier <gonzalo@ximian.com>
296
297         * daemon-messages.h: added kill structs.
298
299         * daemon.c: implemented process_process_kill.
300         * handles-private.h:  define process_process_kill.
301         * handles.c: implemented _wapi_handle_process_kill.
302         * processes.[ch]: implemented TerminateProcess.
303
304 2004-03-25  Bernie Solomon  <bernard@ugsolutions.com>
305
306         * daemon.c (rem_fd): On solaris you seem to get an
307         error even after removing the input source so don't
308         try and rem_fd it twice.
309
310 2004-03-25  Lluis Sanchez Gual  <lluis@ximian.com>
311
312         * daemon.c: in process_post_mortem, If the child terminated due to the 
313         receipt of a signal, the exit status must be based on WTERMSIG, since 
314         WEXITSTATUS returns 0 in this case.
315
316 2004-03-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
317
318         * daemon.c: turned a warning into a DEBUG statement. Now we may hit it.
319
320 2004-03-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
321
322         * daemon.c: only call getdtablesize () once.
323         * processes.c: wait 500 ms to check if execve failed and throw the same
324         exception as MS on failure. Fixes bug #32809.
325
326 2004-03-17  Bernie Solomon  <bernard@ugsolutions.com>
327
328         * io.c (async_notifier): use "union sigval" rather
329         than sigval_t as Solaris doesn't have sigval_t
330         (which isn't in IEEE 1003.1 either).
331
332 2004-03-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
333
334         * io.c: added debug stuff and removed a few redundant lines in
335         file_write.
336
337 2004-03-15  Gonzalo Paniagua Javier <gonzalo@ximian.com>
338
339         * io-private.h: added new fields for file structure. Declare
340         _wapi_io_add_callback.
341
342         * io.c: added _wapi_get_win32_error, support aio_read/write in
343         file_read/write. Implemented _wapi_io_add_callback, which is where
344         BindHandle ends up.
345         
346         * io.h: added new fields for WapiOverlapped and typedef for the
347         callback.
348
349         * processes.c: fixed off-by-one bug when handling environment variables 
350         passed in.
351
352         * threads.[ch]: implemented BindIoCompletionCallback.
353
354         * uglify.h: added typedef for LPOVERLAPPED_COMPLETION_ROUTINE.
355
356 2004-03-14  Zoltan Varga  <vargaz@freemail.hu>
357
358         * socket-wrappers.h: Remove extra semicolon.
359
360 2004-03-03  Dave Camp  <dave@ximian.com>
361
362         * daemon.c: (add_fd), (fd_activity), (_wapi_daemon_main):
363         Use a new main context.
364
365 2004-03-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
366
367         * io.c:
368         (GetFileAttributes): set the error depending on errno instead of
369         setting ERROR_FILE_NOT_FOUND always. See bug #55160.
370
371 2004-03-01  Gonzalo Paniagua Javier <gonzalo@ximian.com>
372
373         * io.c:
374         (CopyFile): free the buffer on error.
375         * sockets.c:
376         (WSAIoctl): free the buffer on error.
377
378 2004-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
379
380         * error.c: fixed mapping for EPROTONOSUPPORT and ESOCKTNOSUPPORT.
381
382         * sockets.[ch]: retry creating the socket for AF_INET, SOCK_RAW
383         using IP protocol with IP over IP. Implemented WSAIoctl UNIX-style.
384
385 2004-01-27  Bernie Solomon  <bernard@ugsolutions.com>
386
387         * shared.c (_wapi_shm_file): add hostname
388         to shared data file names to handle NFS mounted
389         .wapi directories.
390
391 Mon Jan 26 16:15:03 CET 2004 Paolo Molaro <lupus@ximian.com>
392
393         * sockets.h: remove obsolete soklen_t typedef.
394
395 Fri Jan 23 21:07:02 CET 2004 Paolo Molaro <lupus@ximian.com>
396
397         * socket-wrappers.h, sockets.h, sockets.c, Makefile.am: move socket
398         wrappers to its own non-installed header file.
399
400 2004-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
401
402         * io.c:
403         (FindFirstFile): unlock the handle if FindNextFile fails.
404         (FindNextFile): g_free a couple of pointers before retrying.
405
406         * wait.c:
407         (WaitForMultipleObjects): if only one handle provided, use
408         WaitForSingleObject.
409
410 2003-12-22  Bernie Solomon  <bernard@ugsolutions.com>
411
412         * handles-private.h: (_wapi_handle_type) check
413         for segment in range before using it
414
415 2003-12-22  Bernie Solomon  <bernard@ugsolutions.com>
416
417         * thread-private.h: _wapi_thread_ops is now const
418         must match .c file.
419
420 Mon Dec 22 18:29:03 CET 2003 Paolo Molaro <lupus@ximian.com>
421
422         * threads.c, timed-thread.c, timed-thread.h: use mach
423         semaphores on Darwin (MacOSX) since the posix ones
424         are mostly broken there (threads are not created suspended
425         and they can start executing before they are fully initialized
426         like in tests/thread-static.cs).
427
428 Mon Dec 22 17:18:45 CET 2003 Paolo Molaro <lupus@ximian.com>
429
430         * atomic.h: ppc fixes.
431
432 2003-12-19  Bernie Solomon  <bernard@ugsolutions.com>
433
434         * handles.c: remove my bad use of MONO_ZERO_ARRAY_LENGTH
435         in HDRSIZE 
436
437 2003-12-15  Bernie Solomon  <bernard@ugsolutions.com>
438
439         * shared.c: (_wapi_shm_open) make scratch file
440         not have to immediately regrow to avoid remaps
441         (HPUX can't cope with these).
442         (_wapi_shm_attach) use actual size of file
443         to set scratch data_len for the creating process.
444
445         * handles.c: (_wapi_handle_new_internal) make
446         sure mutex & cond var are initialized even for
447         non process shared ones. 
448         (_wapi_handle_unref) always call destroy 
449         routines on mutex & cond var
450
451 2003-12-15  Bernie Solomon  <bernard@ugsolutions.com>
452
453         * daemon.c: change channel data structure so
454         input sources are removed from glib event loop
455         properly. xsp works better on Solaris and 
456         fixes #51278
457
458 2003-12-12  Bernie Solomon  <bernard@ugsolutions.com>
459
460         * wapi-private.h: Replace G_GNUC_PRETTY_FUNCTION
461         definition with file & line number for non-GCC
462         compiles.
463
464 2003-12-08  Bernie Solomon  <bernard@ugsolutions.com>
465
466         * Makefile.am: make sure hppa_atomic.s is in distribution
467
468 2003-12-01  Dick Porter  <dick@ximian.com>
469
470         * wapi-private.h: 
471         * mutexes.c (CreateMutex): 
472         * mutex-private.h (struct _WapiHandle_mutex): 
473         * handles.c: Look up certain handle types by name, in a shared
474         namespace.  Currently only mutex handles have this implemented.
475         Fixes bug 51089.
476
477         * semaphores.c (CreateSemaphore): 
478         * events.c (CreateEvent): Fix signature
479
480 2003-11-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
481
482         * io.c: don't call g_free before testing errno as it may modify it.
483         If the path exists, return an error if it's not a directory. Fixes
484         bug #50753.
485
486 2003-11-20  Dick Porter  <dick@ximian.com>
487
488         * io.c: Missed a little-endian UTF16 conversion.  Patch from
489         Jeroen Zwartepoorte (Jeroen@xs4all.nl), fixes bug 51065.
490
491 2003-10-29  Dick Porter  <dick@ximian.com>
492
493         * io.c (MoveFile): If the move crosses filesystems, try and fall
494         back to copy and delete.  Patch from Jörg Rosenkranz
495         (JoergR@voelcker.com), fixes bug 50298.
496
497 2003-10-28  Dick Porter  <dick@ximian.com>
498
499         * io.c: Use the new encoding conversion to cope with non-utf8
500         locales in filenames.
501
502         * processes.c: Ditto for process arguments.
503
504 Tue Oct 21 12:01:14 CEST 2003 Paolo Molaro <lupus@ximian.com>
505
506         * atomic.h: some ppc inline asm fixes (incorrect use of labels, 
507         incorrect register constraints, incorrect clobber lists).
508
509 2003-10-13  Bernie Solomon  <bernard@ugsolutions.com>
510
511         * Makefile.am hppa_atomic.s: add HP 64bit
512         implementation of atomic ops
513
514 2003-10-13  Zoltan Varga  <vargaz@freemail.hu>
515
516         * threads.c (CreateThread): Wrap pthread_attr_setstacksize call in
517         a conditional for platforms that don't have it.
518
519 2003-10-09  Bernie Solomon  <bernard@ugsolutions.com>
520
521         * threads.c: (CreateThread) use stacksize argument
522         if non-zero - change default for 64 bits to 4Mb
523
524 2003-09-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
525
526         * sockets.c: set last error when socket creation fails. This shed some
527         light on bug #49015.
528
529 2003-09-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
530
531         * processes.c: fixed bug #48973: we only change \ by / for the argument
532         to be used as command.
533         When getting the program name from the args, don't let the space between
534         them in the args.
535
536 2003-09-24  Bernie Solomon <bernard@ugsolutions.com>
537
538         * atomic.h atomic.c: fix sparc so lock is
539         global, increment does so and it compiles under Sun compiler.
540
541 2003-09-22  Bernie Solomon <bernard@ugsolutions.com>
542
543         * handles.c: include <string.h> directly as may
544         not be nested in <sys/un.h> like Linux
545
546 2003-09-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
547
548         * io.c:
549         (DeleteFile): call SetLastError on failure. Fix by
550         richard.torkar@htu.se (Richard Torkar). Closes bug #48222.
551
552 2003-09-15  Lluis Sanchez Gual  <lluis@ximian.com>
553
554         * daemon.c: In compare_process(), discard handles already signalled.
555
556 2003-09-02  Dick Porter  <dick@ximian.com>
557
558         * io.c: Work around glib brain-dead assumptions about utf8-encoded
559         filenames.  Fixes bug 30781.
560
561 2003-08-28  Dick Porter  <dick@ximian.com>
562
563         * critical-sections.c:  Patch from Bernie Solomon
564         <bernard@ugsolutions.com> to emit a warning if locking a critical
565         section fails.
566
567 2003-07-23  Dick Porter  <dick@ximian.com>
568
569         * shared.c:
570         * daemon.c (maybe_exit): Avoid the race condition when the daemon is
571         closing but another client comes along when the shared data is still
572         visible.  Should fix bugs 33671 and 35213.
573
574 2003-07-23  Dick Porter  <dick@ximian.com>
575
576         * handles.c:  Initialise handle mutex and cond.  Fix by
577         Bernie Solomon <bernard@ugsolutions.com>
578
579 2003-07-15  Dick Porter  <dick@ximian.com>
580
581         * timed-thread.c (timed_thread_start_routine): Fix virtual memory
582         leak when threads quit.  Fixes bug 44067.
583
584 Wed Jun 18 19:08:40 CEST 2003 Paolo Molaro <lupus@ximian.com>
585
586         * io.c: never add write permission for group or others in
587         SetFileAttributes ().
588
589 2003-06-17  Dick Porter  <dick@ximian.com>
590
591         * io.c (SetFileAttributes): Implement the ReadOnly attribute, and
592         ignore the unsupported ones ("fixes" bug 44977).
593
594 2003-06-17  Lluis Sanchez Gual  <lluis@ximian.com>
595
596         * misc.c: fix bug in _wapi_calc_timeout. It gave wrong values for
597           high ms values (there was an overflow).
598
599 2003-06-17  Zoltan Varga  <vargaz@freemail.hu>
600
601         * system.h (struct _WapiSystemInfo ): Fix warnings when using gcc-3.3.
602
603 2003-06-11  Dick Porter  <dick@ximian.com>
604
605         * shared.c: Fix shared directory creation.  Patch from
606         Pablo Baena <pbaena@uol.com.ar>
607
608 2003-06-10  Dick Porter  <dick@ximian.com>
609
610         * atomic.c: Delete the useless compile warning
611
612 2003-06-09  Dick Porter  <dick@ximian.com>
613
614         * daemon.c: Lookup env as a string array.  Fixes bug 44289.  Also
615         make setting the process handle value in the environment actually
616         work.
617
618         * processes.c: Pretty up the process name, if it happens to be
619         "mono" such as when another mono process forks "mono foo.exe"
620
621 2003-06-05  Dick Porter  <dick@ximian.com>
622
623         * processes.c (process_set_current): Don't do an expensive handle
624         search at application startup, check the environment to see if the
625         process handle has already been created.
626
627         * io.c: Don't do an expensive handle search when creating stdin,
628         stdout and stderr handles, just create them all the first time one
629         is requested.
630
631         * wapi-private.h:
632         * shared.c:
633         * shared.h:
634         * handles.c:
635         * handles-private.h:
636         * daemon-messages.h:
637         * daemon-private.h:
638         * daemon.c: Support for "unlimited" number of handles and scratch
639         data.
640
641         Speed up application startup by passing process handle in the
642         environment, rather than let the app scan all handles (which gets
643         really slow when there are more than a few thousand to check.)
644
645         Initialise some structs passed to syscalls, noticed by valgrind.
646         
647
648 2003-05-20  Dick Porter  <dick@ximian.com>
649
650         * io.c (FindFirstFile): Include . files in the glob.  Fixes bug
651         43229.
652
653 2003-05-19  Dick Porter  <dick@ximian.com>
654
655         * threads.c: Set the new thread's stack size to 2M.  Fix needed
656         for BSD, reported by Martin Dvorak <md@9ll.cz>
657
658 2003-05-16  Dick Porter  <dick@ximian.com>
659
660         * io.h:
661         * io.c: Implement GetTempPath()
662
663 2003-05-16  Dick Porter  <dick@ximian.com>
664
665         * processes.c (CreateProcess): Set some error codes
666
667 2003-05-12  Dick Porter  <dick@ximian.com>
668
669         * misc.c (_wapi_calc_timeout): Cope with overflowing tv_nsec.
670         Patch from Martin Dvorak <mdvorak@ninell.cz>.
671
672 2003-05-10  Dick Porter  <dick@ximian.com>
673
674         * io.c (CopyFile): Copy file mode as well as file data.  Based on
675         suggestion by Giuseppe Greco <giuseppe.greco@agamura.com>, bug
676         42706.
677
678 2003-05-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
679
680         * handles.c: don't call GC_gcollect when creating new handles.
681
682 2003-05-05  Gonzalo Paniagua Javier <gonzalo@ximian.com>
683
684         * handles.c: added some debugging code. Call GC_gcollect
685         before creating a new handle. It makes Lupus' test run smoother and
686         faster (from 62 to 83 request per second). Notice that calling
687         GC_finalizer_notifier if needed (GC_should_invoke_finalizer ()) does
688         not improve nor degrade the performance, so i don't do it.
689
690 2003-05-02  Dick Porter  <dick@ximian.com>
691
692         * sockets.c: Rearrange closesocket() and socket_close_private(),
693         and remember to unref the handle, so we don't leak socket handles.
694         Fix from Pelle Johnsen <pelle.johnsen@mail.dk>
695
696 2003-04-11  Dick Porter  <dick@ximian.com>
697
698         * atomic.h: ARM atomic operations by Malte Hildingson
699         <tds00mahi@tellus.thn.htu.se>
700
701 Tue Apr 8 11:37:29 CEST 2003 Paolo Molaro <lupus@ximian.com>
702
703         * atomic.h: fix macosx build by "Urs C. Muff" <umuff@quark.com>.
704
705 2003-04-03  Martin Baulig  <martin@ximian.com>
706
707         The following change is conditional to `WITH_INCLUDED_LIBGC'
708         which is not yet enabled by default.
709
710         * threads.c (SuspendThread, ResumeThread): Fully implemented this.
711         (gc_init): New static function; install a signal handler for
712         SIGPWR which is used to suspend threads.  [FIXME: it SIGPWR
713         doesn't exist on all Unix systems, we need to find another
714         signal].
715         (mono_wapi_push_thread_stack): New public function.  Tells the
716         garbage collector about the current stack pointer of a suspended
717         thread.
718
719 2003-04-03  Martin Baulig  <martin@ximian.com>
720
721         * timed-thread.h (TimedThread): Added `suspended_sem',
722         `suspend_count' and `stack_ptr'.
723
724 2003-03-28  Dick Porter  <dick@ximian.com>
725
726         * atomic.h: PPC support gratiously donated to the public domain
727         by John Duncan <jddst19@mac.com>
728
729 2003-03-20  Dick Porter  <dick@ximian.com>
730
731         * sockets.c (_wapi_connect): If connect() fails with EACCES, try
732         setting SO_BROADCAST and connecting again.  Fixes bug 39178.
733
734 2003-03-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
735
736         * processes.c: included Jerome Laban's patch and call SetLastError when
737         the executable is not found.
738
739 2003-03-03  Dick Porter  <dick@ximian.com>
740
741         * io.c (CreateFile): Try opening directories readonly, so that
742         timestamps can be adjusted.  Patch by Elan Feingold
743         <efeingold@mn.rr.com>.
744
745 2003-02-25  Dick Porter  <dick@ximian.com>
746
747         * shared.c (_wapi_shm_attach): Return a failure code on system
748         call errors, rather than exiting.
749
750 2003-02-21  Dick Porter  <dick@ximian.com>
751
752         * processes.c (GetCurrentProcessId): Use the current process
753         handle to return the process ID, as getpid() is unreliable
754         (linuxthreads gives each thread a different pid).  Fixes bug
755         37550.
756
757 2003-02-21  Dick Porter  <dick@ximian.com>
758
759         * io.c (FindNextFile): Skip over dangling symlinks.  Fixes bug
760         34076.
761
762 2003-02-11  Dick Porter  <dick@ximian.com>
763
764         * timefuncs.h: 
765         * timefuncs.c: Added GetTickCount()
766
767 2003-02-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
768
769         * error.c: added WSA_EHOSTUNREACH mapping.
770
771 2003-01-26  Miguel de Icaza  <miguel@ximian.com>
772
773         * io.c (SetFileAttributes): This routine is not currently
774         implemented for the general case, but I added a special case to
775         set the executable bit on Linux.
776
777 Wed Jan 15 15:55:40 CET 2003 Paolo Molaro <lupus@ximian.com>
778
779         * sockets.h, daemon.c, io.c: compilation fixes on MacOSX.
780
781 2003-01-08  Dick Porter  <dick@ximian.com>
782
783         * sockets.c: Fixed setting blocking mode to true (fixes bug 36388)
784
785 2002-12-11  Juli Mallett  <jmallett@FreeBSD.org>
786
787         * daemon.c, handles-private.h, handles.c, wapi-private.h:
788         Check for an implementation which says it supports
789         _POSIX_THREAD_PROCESS_SHARED, rather than just one that
790         defines the symbol.  Defined but with a value of -1 still
791         means that it is unsupported.
792
793 2002-12-08  Martin Baulig  <martin@ximian.com>
794
795         * handles.c (_wapi_handle_new): Create new non-shared handles with
796         an initial refcount of 1, not 0.
797
798 2002-11-22  Dietmar Maurer  <dietmar@ximian.com>
799
800         * threads.c (TlsGetValue): removed unnecessary mutex
801
802 2002-11-20  Dick Porter  <dick@ximian.com>
803
804         * timed-thread.c (_wapi_timed_thread_attach): Attached threads
805         need to store their data structure too.
806
807         * threads.c: Make sure the threading data is initialised wherever
808         it is needed
809
810 2002-11-15  Dick Porter  <dick@ximian.com>
811
812         * timed-thread.c: Removed unneeded parameters in
813         _wapi_timed_thread_attach().
814
815         * threads.c: Renamed AttachThread() to make it not look like
816         external API.  Removed unneeded parameters.
817
818 2002-11-11  Gonzalo Paniagua Javier <gonzalo@ximian.com>
819
820         * error.[ch]: added errno_to_WSA (). It displays a warning and return
821         WSASYSCALLFAILURE if there is no error mapping for the given errno,
822
823         * sockets.c: use errno_to_WSA and fixed display of warning for h_errno.
824
825 2002-10-31  Dick Porter  <dick@ximian.com>
826
827         * io.h: 
828         * io.c: Define and use INVALID_FILE_ATTRIBUTES
829
830 2002-10-07  Dick Porter  <dick@ximian.com>
831
832         * timefuncs.c:
833         * daemon.c: Use a more accurate time source for process start and
834         end times.
835
836 2002-10-03  Dick Porter  <dick@ximian.com>
837
838         * daemon.c:
839         * handles.c:
840         * threads.c:  Fixes for freebsd.  Make sure that mutex and condition
841         creation and deletion happen in the process that owns them, when
842         POSIX shared thread objects aren't supported.  This breaks on
843         freebsd, as pthread_t is a pointer to data.
844
845 2002-10-02  Dick Porter  <dick@ximian.com>
846
847         * shared.c: Use mmap() instead of sysv shm for the shared data.
848
849         * wapi-private.h (_WAPI_HANDLE_VERSION): Reset back to 0, for the
850         new system
851
852         * daemon-private.h: 
853         * daemon.c: mmap()ed regions survive fork, so just pass the
854         pointer to _wapi_daemon_main instead of mapping it again.
855
856 2002-10-01  Dick Porter  <dick@ximian.com>
857
858         * timed-thread.c: Kludge for CREATE_SUSPENDED thread creation.
859         Unfortunately libgc uses the same thread suspend technique that I
860         want to, and the two don't mix: libgc will deadlock when it tries
861         to stop the world if a thread has already been suspended by
862         someone else.  Just do the simple suspended create rather than the
863         general purpose thread suspension for now.
864
865         * threads.c: Pass create flags to the timed_thread create call, to
866         implement suspended thread creation.  ResumeThread() partially
867         implemented, to cope with the case where a newly created but
868         suspended thread is launched.
869
870 2002-09-30  Dick Porter  <dick@ximian.com>
871
872         * sockets.c (ioctlsocket): Set non-blocking mode in a better way,
873         with fcntl.
874
875 2002-09-27  Dick Porter  <dick@ximian.com>
876
877         * semaphores.c: Only include semaphore.h if it's present. Patch
878         for BSD from jmmv@hispabsd.org (Julio Merino).
879
880 2002-09-27  Dick Porter  <dick@ximian.com>
881
882         * processes.c: Pass environment and working directory to the
883         daemon when forking.  Don't let argv[0] be duplicated when looking
884         for the program name.  Implement EnumProcessModules (simple
885         version for now, lsof-style later if needed), GetModuleBaseName,
886         {Get,Set}ProcessWorkingSetSize (just faked, because the vm hints
887         aren't available on Linux).
888
889         * process-private.h: Store the process name, and the working set
890         min and max
891
892         * handles.c:
893         * handles-private.h: New functions to store and retrieve an array
894         of strings in the scratch space
895
896         * daemon.c: Don't miss deleting some handles when a client exits
897         (we used to rely on the client doing the final cleanup, but
898         obviously if the client is no longer there the daemon has to do
899         it).
900
901         Process forking now sets the environment and the working
902         directory.
903
904         * io.c: Don't confuse fd 0 with an unassigned handle struct
905
906         * atomic.h: Add a google cache alternative to the msdn URL
907
908 2002-09-25  Gonzalo Paniagua Javier <gonzalo@ximian.com>
909
910         * sockets.c:
911         (_wapi_recvfrom): added ECONNRESET to the switch.
912
913 2002-09-24  Mark Crichton  <crichton@gimp.org>
914
915         * atomic.h: Yea.  On linux, sparc isn't sparc, it's __sparc__.
916         Added to ifdef.
917
918 2002-09-19  Mark Crichton  <crichton@gimp.org>
919
920         * daemon.c, shared.c: Added NEED_LINK_UNLINK for systems that
921         dont have Linux's abstract filesystem for sockets.
922
923 2002-09-19  Mark Crichton  <crichton@gimp.org>
924
925         * atomic.h: Added SPARC atomic asm code.
926         * daemon.c, handles-private.h, handles.c, wapi-private.h:
927         undefined _POSIX_THREAD_PROCESS_SHARED.  This actually exists on
928         Solaris 9, however, the code paths don't seem to work.  More testing
929         on the shared case is *really* needed.
930
931 2002-09-03  Dick Porter  <dick@ximian.com>
932
933         * threads.h: 
934         * threads.c: Removed PosixKillThread(), because it's not in the
935         w32 api
936
937 2002-08-20  Dick Porter  <dick@ximian.com>
938
939         * handles.c (_wapi_handle_scratch_store): Made stored byte lengths
940         multiples of 4 bytes, to keep header structures aligned.  Needed
941         for sparc, at least. (Patch from crichton@gimp.org)
942
943         * handles.c: Removed 'disable_shm' variable (we've defaulted to
944         building with shm enabled for months now)
945
946 2002-08-19  Dick Porter  <dick@ximian.com>
947
948         * daemon.c: Rewrote the poll() loop to use GIOChannels instead,
949         for legacy NeXT-based systems.
950
951 2002-08-12  Dick Porter  <dick@ximian.com>
952
953         * atomic.h: Rename some parameters to avoid c++ keywords (Patch
954         from Joseph Wenninger <kde@jowenn.at>)
955
956 2002-08-05  Dietmar Maurer  <dietmar@ximian.com>
957
958         * threads.c: use fast spinlocks by default
959
960 2002-08-02  Dick Porter  <dick@ximian.com>
961
962         * io.c (GetStdHandle): Add a handle reference when returning a
963         duplicate console handle.  This fixes the unref_handle errors in
964         NUnit.
965
966 2002-08-01  Dietmar Maurer  <dietmar@ximian.com>
967
968         * threads.c (TLS_PTHREAD_MUTEX): define this because else some
969         tests does not work
970
971 2002-08-01  Dick Porter  <dick@ximian.com>
972
973         * threads.c: Use atomic spinlocks in TLS functions
974
975         * mono-spinlock.h:
976         * Makefile.am: Added mono-spinlock.h
977
978 2002-07-21  Jeffrey Stedfast  <fejj@ximian.com>
979
980         * daemon-messages.c: #include <sys/types.h> and <sys/sockets.h> -
981         these are needed for sendmsg() and also for struct msghdr (at
982         least on Solaris). Solaris still won't build because struct msghdr
983         doesn't have msg_flags, msg_control, or msg_controllen members.
984         (CMSG_SPACE): Define for systems that don't have it.
985         (CMSG_LEN): Same.
986
987 2002-07-20  Dick Porter  <dick@ximian.com>
988
989         * wapi-private.h:
990         * io-private.h:
991         * io.h:
992         * io.c:
993         * handles.c: Implemented pipe handles
994         
995         * handles.c:
996         * daemon.c: Fixed bug in handle closing.
997
998         * shared.c:
999         * daemon.c: Forked processes now close all open file descriptors.
1000
1001 Fri Jul 19 19:05:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
1002
1003         * sockets.h, io-layer.h, critical-sections.h: don't include config.h
1004         in header files.
1005
1006 2002-07-19  Martin Baulig  <martin@gnome.org>
1007
1008         * threads.c (ExitThread): Call exit() if no threads has been
1009         created yet.
1010
1011 2002-07-17  Dick Porter  <dick@ximian.com>
1012
1013         * daemon-messages.c: Freebsd fixes from Andreas Kohn
1014         <andreas.kohn@gmx.net>
1015
1016 2002-07-15  Dick Porter  <dick@ximian.com>
1017
1018         * io.c: Removed bogus console_flush() method, that was just cut
1019         and pasted from file_flush when I separated the two handle types.
1020
1021 2002-07-12  Dick Porter  <dick@ximian.com>
1022
1023         * io.c (convert_from_flags): Fixed misunderstanding wrt fcntl
1024         flags.  Fixes bug 27633.
1025
1026 2002-07-12  Dick Porter  <dick@ximian.com>
1027
1028         * wapi-private.h:
1029         * handles.c:
1030         * daemon.c: Use size of sockaddr_un.sun_path from config.h
1031
1032 2002-07-12  Dick Porter  <dick@ximian.com>
1033
1034         * processes.c (CreateProcess): Send stdin, stdout and stderr
1035         handles if the startup info doesnt specify new ones
1036
1037         * io.c (GetStdHandle): Return the same handle when the same
1038         standard handle is requested
1039
1040         * handles.c: Pass file descriptors when forking
1041
1042         * daemon.c: Use supplied file descriptors when forking a new
1043         process
1044
1045         * daemon-messages.h: 
1046         * daemon-messages.c: Pass stdin, stdout and stderr file
1047         descriptors to the daemon (used when forking)
1048
1049 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
1050
1051         * daemon.c (_wapi_daemon_main): Use sizeof
1052         (main_socket_address.sun_path) instead of hardcoded 108 value.
1053
1054         * handles.c (shared_init): Use sizeof
1055         (shared_socket_address.sun_path) instead of hardcoded 108 value.
1056
1057 2002-07-10  Dennis Haney  <davh@davh.dk>
1058
1059         * shared.c:
1060         * handles.c:
1061         * daemon.c: Lots of documentation, some added error checking, and
1062         code readability improvements.
1063
1064         * daemon-messages.h: Add the Error request type to improve error
1065         checking.
1066
1067         * daemon-messages.c: Do a bit more error checking on send() and
1068         recv(), and log errors with a higher severity level.
1069
1070 2002-07-04  Dick Porter  <dick@ximian.com>
1071
1072         * daemon.c (process_process_fork): Fix argument handling, due to
1073         buggy understanding of g_strsplit() behaviour.
1074
1075 2002-07-03  Dick Porter  <dick@ximian.com>
1076
1077         * threads.h:
1078         * threads.c: Implement OpenThread().  Define access-control values
1079         for thread handles.
1080
1081         * wapi.h:
1082         * processes.h:
1083         * access.h:
1084         * Makefile.am: Added access.h, to hold shared access-control
1085         definitions
1086
1087 2002-07-02  Dick Porter  <dick@ximian.com>
1088
1089         * wapi-private.h (_WAPI_HANDLE_VERSION): New protocol version
1090         
1091 2002-07-02  Dick Porter  <dick@ximian.com>
1092
1093         * handles.c (shared_init): Make a second attempt to contact the
1094         daemon if the shared memory attach succeeds, but the connect()
1095         fails. (This copes with the daemon crashing without cleaning up
1096         the shared memory.)
1097
1098         * Makefile.am: 
1099         * daemon-private.h:
1100         * daemon.c:
1101         * shared.c (_wapi_shm_attach): Don't exec() anything when we fork
1102         the daemon, it's now built into the library.
1103
1104 2002-06-25  Dick Porter  <dick@ximian.com>
1105
1106         * handles.c:
1107         * handles-private.h:
1108         * daemon-messages.h:
1109         * daemon.c: Process forking and handle data management
1110
1111         * processes.h:
1112         * process-private.h:
1113         * processes.c: Process forking and other support functions
1114
1115 2002-06-25  Dick Porter  <dick@ximian.com>
1116
1117         * versioninfo.h: PE resource decoding
1118
1119         * unicode.c (_wapi_unicode_to_utf8): g_utf16_to_utf8 doesnt need
1120         to be told the string length
1121
1122         * io.c: Removed the ACTUALLY_DO_UNICODE option.  Fixed some leaks.
1123         Moved _wapi_time_t_to_filetime and the WapiFileTime typedef to
1124         timefuncs.c
1125
1126 2002-06-12  Dick Porter  <dick@ximian.com>
1127
1128         * daemon.c: 
1129         * daemon-messages.c: Handle SIGPIPE in a non-stupid way in the
1130         daemon, if MSG_NOSIGNAL isn't available.  Thanks to Jaroslaw
1131         Kowalski <jarek@atm.com.pl> for pointing out the bogosity.
1132
1133 2002-06-10  Jaroslaw Kowalski <jarek@atm.com.pl>
1134
1135         * sockets.c, daemon-messages.c: Prevent SIGPIPE from being raised
1136         when writing to a closed socket.
1137
1138 2002-06-08  Jeffrey Stedfast  <fejj@ximian.com>
1139
1140         * mono-mutex.c (mono_once): New convenience function for my
1141         previous fix.
1142
1143         * handles.c:
1144         * error.c: 
1145         * critical-sections.c: 
1146         * threads.c: 
1147         * sockets.c: 
1148         * semaphores.c: 
1149         * processes.c: 
1150         * mutexes.c: 
1151         * io.c: 
1152         * events.c: 
1153         * atomic.c: Use mono_once() rather than pthread_once().
1154
1155 2002-06-06  Jeffrey Stedfast  <fejj@ximian.com>
1156
1157         * handles.c (_wapi_handle_new): pthread_once() is not atomic, so
1158         if multiple threads all try to call _wapi_handle_new() before the
1159         shared data has been initialized, it is possible that we could get
1160         into a condition where shared_init() is being executed and later
1161         threads will pass by pthread_once() due to the fact that it has
1162         already been called and so therefor will attempt to use the shared
1163         data before it has been completely initialized. If we instead use
1164         a standard mutex locking mechanism around shared_init(), we can
1165         avoid the situation entirely. By wrapping the mutex locking in a
1166         check to see if we've already initialized the data, we can even
1167         avoid wasting resources by having to lock/unlock the mutex in any
1168         later calls (the only time we'd have to worry about
1169         locking/unlocking is the initial race to call shared_init() at
1170         startup).
1171
1172 Sat Jun 1 13:27:11 CEST 2002 Paolo Molaro <lupus@ximian.com>
1173
1174         * atomic.h: inline asm fixes from Dennis Haney (davh@davh.dk).
1175
1176 Fri May 31 16:21:54 CEST 2002 Paolo Molaro <lupus@ximian.com>
1177
1178         * daemon.c, handles.c: rename "sun" local var since it's apparently
1179         a #define on Solaris.
1180
1181 Fri May 31 15:40:14 CEST 2002 Paolo Molaro <lupus@ximian.com>
1182
1183         * daemon-messages.c: work-around MSG_NOSIGNAL missing on some
1184         platforms.
1185
1186 2002-05-15  Dick Porter  <dick@ximian.com>
1187
1188         * wait.c: Fix a deadlock in WaitForMultipleObjects
1189
1190 2002-05-14  Dick Porter  <dick@ximian.com>
1191
1192         * io.c: Fix a cut&paste error, found by
1193         Jaroslaw Kowalski <jarek@atm.com.pl>
1194
1195 2002-05-10  Dan Lewis  <dihlewis@yahoo.co.uk>
1196
1197         * io.c: Nasty typo.
1198
1199 2002-05-09  Dick Porter  <dick@ximian.com>
1200
1201         * threads.c: 
1202         * semaphores.c: 
1203         * processes.c: 
1204         * mutexes.c: 
1205         * handles-private.h: 
1206         * events.c: 
1207         * Makefile.am: Remove now-unused file wait-private.h
1208
1209 2002-05-08  Dick Porter  <dick@ximian.com>
1210
1211         * shared.c: Better error messages, and report when daemon
1212         connection fails rather than blocking forever.  Do some more
1213         shared memory sanity checking.
1214
1215         * handles.c: Better error messages when connecting to shared
1216         memory and the handle daemon.  Fall back to non-shared handles if
1217         an error occurs.  Set the default back to 'shared handles'.  Fix a
1218         crashing bug in scratch space allocation that mangled the block
1219         headers.
1220
1221 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
1222
1223         * handles.c (shared_init): Disable SHM for now, people have too
1224         many problems with this, and the diagnostics are not helping.
1225
1226 2002-05-06  Dan Lewis  <dihlewis@yahoo.co.uk>
1227
1228         * io.c: CreateFile sets win32 last error.
1229
1230 2002-05-05  Dick Porter  <dick@ximian.com>
1231
1232         * wapi-private.h: 
1233         * handles-private.h:
1234         * io.c: 
1235         * io-private.h:
1236         * mutexes.c: 
1237         * mutex-private.h: 
1238         * processes.c: 
1239         * process-private.h: 
1240         * semaphores.c: 
1241         * semaphore-private.h: 
1242         * sockets.c: 
1243         * socket-private.h: 
1244         * events.c: 
1245         * event-private.h: Simplify the WapiHandleOps struct: take out all
1246         the file-specific entries, leaving just the items that operate on
1247         handles themselves.  Split the close operation into shared and
1248         private parts: shared close is called by the daemon.
1249
1250         * handles.c: As above, but also pass handle allocation, ref and
1251         unref operations to the daemon.  Populate the handle_ops array at
1252         compile time, because the daemon needs to call ops on handles too.
1253         Don't bother to track open handle counts any more, the daemon does
1254         that.
1255         
1256         * threads.c: 
1257         * thread-private.h: As above, but also make the thread data
1258         handle-private.
1259
1260         * shared.c: Fork a handle daemon if the calling process created
1261         the shared memory segment.
1262
1263         * daemon.c:
1264         * daemon-messages.c:
1265         * daemon-messages.h:
1266         * Makefile.am: Build a daemon to manage handle allocation and
1267         destruction without needing to lock the shared memory
1268
1269 2002-04-30  Jeffrey Stedfast  <fejj@ximian.com>
1270
1271         * atomic.c: Changed to use a normal mutex rather than a spinlock
1272         since a lot of platforms seem to not have them :\
1273
1274 2002-04-30  Dick Porter  <dick@ximian.com>
1275
1276         * Completely rewrote the handle waiting code: removed the helper
1277         thread and its attendant complexity.  All handle waiting is now
1278         abstracted into the WaitForSingleObject() and
1279         WaitForMultipleObjects() functions.
1280
1281         * Implemented inter-process sharing of handles using sysv shared
1282         memory.  This makes handles even more opaque, with a handle now
1283         just an index into an array.
1284         
1285 2002-04-25  Dan Lewis  <dihlewis@yahoo.co.uk>
1286
1287         * io.c: unitialized pointer in GetCurrentDirectory.
1288
1289 Sat Apr 20 13:37:39 CEST 2002 Paolo Molaro <lupus@ximian.com>
1290
1291         * threads.c: destroy the mutex at thread destruction
1292         (if/when thread destruction code will be actually called).
1293         When protecting a tls data pointer from the gc, use also the 
1294         thread id in the key.
1295         
1296 Wed Apr 17 18:36:27 CEST 2002 Paolo Molaro <lupus@ximian.com>
1297
1298         * timed-thread.c: avoid race condition when setting the thread to
1299         detached.
1300
1301 2002-04-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
1302
1303         * jit.h: to more #include lines to avoid breaking compilation
1304         under windows when upgrading mingw and w32api to version
1305         1.3 (thanks Dick!).
1306
1307 2002-04-16  Dick Porter  <dick@ximian.com>
1308
1309         * atomic.h: Explanatory comment about lack of 80386 support
1310
1311 2002-04-15  Dick Porter  <dick@ximian.com>
1312
1313         * atomic.h: use xaddl for InterlockedIncrement() and
1314         InterlockedDecrement().  Use cmpxchgl in a loop for
1315         InterlockedExchange() and InterlockedExchangePointer().
1316
1317 Mon Apr 15 13:31:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
1318
1319         * unicode.c: fix unicode_len() to not access uninitialized memory
1320         (and updated to conform to mono code style).
1321
1322 Fri Mar 29 17:15:11 CET 2002 Paolo Molaro <lupus@ximian.com>
1323
1324         * io.c: EEXISTS is ignored for directory creation.
1325         * mono-mutex.h: remove silly "pragma }" that emacs users insert
1326         because they use a broken editor:-)
1327
1328 2002-03-28  Dick Porter  <dick@ximian.com>
1329
1330         * sockets.h: 
1331         * sockets.c: 
1332         * io.c: 
1333         * handles.h: 
1334         * handles.c: Warning cleanups
1335
1336 2002-03-27  Dan Lewis <dihlewis@yahoo.co.uk>
1337
1338         * unicode.h, unicode.c: changed to gunichar2
1339         * io.h, io.c: changed strings to gunichar2*, added
1340         SetFileAttributes(), GetCurrentDirectory(), SetCurrentDirectory(),
1341         some fixes to FindFirstFile() and friends.
1342
1343 2002-03-26  Dick Porter  <dick@ximian.com>
1344
1345         * types.h: Implement the large integer struct
1346
1347         * timefuncs.h:
1348         * timefuncs.c: Dummy functions that don't yet implement
1349         QueryPerformanceCounter() and QueryPerformanceFrequency()
1350
1351         * threads.h:
1352         * threads.c: Implement SleepEx()
1353
1354         * system.h:
1355         * system.c: Beginnings of GetSystemInfo()
1356
1357         * mono-mutex.c (pthread_mutex_timedlock): Fix a ms/ns conversion
1358         thinko
1359
1360         * context.h:
1361         * context.c: Dummy function that doesnt yet implement
1362         GetThreadContext()
1363
1364         * atomic.h: 
1365         * atomic.c: Interlocked functions
1366
1367 Mon Mar 25 13:01:40 CET 2002 Paolo Molaro <lupus@ximian.com>
1368
1369         * threads.c: use a gc-safe hash table to store tls pointers.
1370
1371 2002-03-22  Dick Porter  <dick@ximian.com>
1372
1373         * threads.c: Fix a race condition where a thread can start and
1374         exit before the handle has been properly initialised (no reason
1375         why the handle couldn't be initialised beforehand, so do so)
1376
1377         Fix a ms to ns conversion magnitude thinko.
1378
1379 2002-03-21  Dick Porter  <dick@ximian.com>
1380
1381         * semaphores.c: Fix a problem when waiting for one or more
1382         semaphores, and another semaphore is Released (all waiting
1383         semaphores assumed they were signalled)
1384
1385 2002-03-29  Dan Lewis <dihlewis@yahoo.co.uk>
1386
1387         * io.h, io.c, uglify.h: added MoveFile, CopyFile, CreateDirectory,
1388         RemoveDirectory, GetFileAttributes, GetFileAttributesEx
1389
1390 2002-03-19  Dietmar Maurer  <dietmar@ximian.com>
1391
1392         * threads.c (Sleep): bug fix: 1ms == 1000000ns
1393
1394 2002-03-19  Dan Lewis <dihlewis@yahoo.co.uk>
1395
1396         * io.h, io.c, events.c, mutexes.c, semaphores.c, sockets.c,
1397         threads.c, io.c: added flush method to handles.
1398
1399         * io.c: FlushFileBuffers() and FindFirstFile() functions.
1400
1401 Thu Mar 7 17:21:52 CET 2002 Paolo Molaro <lupus@ximian.com>
1402
1403         * threads.c, timed-thread.c, wait.c: Boehm-GC anable.
1404
1405 2002-02-20  Dick Porter  <dick@ximian.com>
1406
1407         * io-layer.h: Always build without cygwin support on windows
1408
1409 Mon Feb 18 15:50:59 CET 2002 Paolo Molaro <lupus@ximian.com>
1410
1411         * sockets.c: #undef DEBUG.
1412
1413 2002-02-14  Jeffrey Stedfast  <fejj@ximian.com>
1414
1415         * io-layer.h: conditionally include sys/filio.h and sys/sockio.h
1416         for FIONBIO, FIONREAD, and SIOCATMARK.
1417
1418 2002-02-14  Jeffrey Stedfast  <fejj@ximian.com>
1419
1420         * sockets.c: conditionally include sys/filio.h and sys/sockio.h
1421         for FIONBIO, FIONREAD, and SIOCATMARK.
1422
1423 2002-02-13  Dick Porter  <dick@ximian.com>
1424
1425         * sockets.c: Implement shutdown and select
1426
1427 2002-02-13  Jeffrey Stedfast  <fejj@ximian.com>
1428
1429         * mono-mutex.[c,h]: New source files that thinly wrap all pthread
1430         functions that take pthread_mutex_t and/or pthread_mutexattr_t
1431         arguments for the sake of portability. Implements recursive
1432         mutexes and pthread_mutex_timedlock.
1433
1434         * critical-sections.c:
1435         * events.c:
1436         * handles.c:
1437         * mutexes.c:
1438         * semaphores.c:
1439         * threads.c:
1440         * timed-thread.c:
1441         * wait.c: Use the mono-mutex wrapper portability functions/macros.
1442
1443         * pthread-compat.[c,h]: Replaced by mono-mutex.[c,h]
1444
1445 2002-01-23  Dick Porter  <dick@ximian.com>
1446
1447         * sockets.c: Networking support, mostly wrapping BSD socket APIs
1448         with handle code, and translating errno into w32 error codes.
1449
1450         * macros.h: Some w32 macros used with the socket support
1451
1452         * error.c: Implemented GetLastError() and SetLastError()
1453
1454         * Makefile.am: Added sockets, with kludge to override some symbols
1455
1456 2001-12-17  Dietmar Maurer  <dietmar@ximian.com>
1457
1458         * unicode.c (_wapi_unicode_to_utf8): byteswap UTF16 strings before
1459         passing them to iconv
1460         (_wapi_unicode_to_utf8): only swap bytes on LE systems, remove bug
1461         from previous commit.
1462
1463 2001-12-11  Dick Porter  <dick@ximian.com>
1464
1465         * io.c: Implement DeleteFile(), GetFileTime(), SetFileTime() and
1466         FileTimeToSystemTime().
1467
1468         * unicode.c (unicode_len): Nasty way of finding length of unicode
1469         string with embedded NULLs (counts until two NULLs together).
1470
1471         * mutexes.c (mutex_close): 
1472         * events.c (event_close): Release the internal pthreads resources
1473
1474 2001-11-26  Dick Porter  <dick@ximian.com>
1475
1476         * critical-sections.c:
1477         * events.c:
1478         * handles.c:
1479         * io.c:
1480         * mutexes.c:
1481         * semaphores.c:
1482         * threads.c:
1483         * timed-thread.c:
1484         * wait.c: turn off DEBUG messages
1485
1486 2001-11-22  Dick Porter  <dick@ximian.com>
1487
1488         * handles.c (SignalObjectAndWait): Implement
1489
1490         * wait.c (WaitForSingleObject): Fix case where timeout == 0
1491
1492         * threads.c:
1493         * semaphores.c:
1494         * mutexes.c:
1495         * io.c:
1496         * events.c: Support for SignalObjectAndWait
1497         
1498 2001-11-21  Dick Porter  <dick@ximian.com>
1499
1500         * events.c:
1501         * handles.c:
1502         * mutexes.c:
1503         * semaphores.c:
1504         * threads.c:
1505         * wait.c: Reliable method of returning which handle was signalled
1506         on return from WaitForMultipleObjects().
1507
1508 2001-11-21  Dick Porter  <dick@ximian.com>
1509
1510         * events.c: Implement events
1511
1512 2001-11-15  Dick Porter  <dick@ximian.com>
1513
1514         * mutexes.c: Implement mutexes
1515
1516         * threads.c: 
1517         * semaphores.c: 
1518         * misc.c: Factor out some common code
1519
1520 2001-11-13  Dick Porter  <dick@ximian.com>
1521
1522         * threads.c: Implement TLS.  Implement GetCurrentThreadId(), and
1523         GetCurrentThread() by maintaining a hash of thread handles.
1524
1525         * threads.h: Define thread and process creation flags
1526
1527 2001-11-12  Dick Porter  <dick@ximian.com>
1528
1529         * critical-sections.c: Implement critical sections
1530
1531 2001-11-12  Dick Porter  <dick@ximian.com>
1532
1533         * semaphores.c: Implement semaphores
1534
1535         * wait.c (wait_for_item): Maintain a wait count rather than count
1536         signalled booleans.
1537
1538         * threads.c (thread_wait_multiple): Don't lock the wait item, that
1539         will block other wait threads
1540
1541 2001-11-11  Dick Porter  <dick@ximian.com>
1542
1543         * Makefile.am: Rename some automake variables
1544         (from Nick Drochak <ndrochak@gol.com>)
1545
1546 2001-11-10  Dick Porter  <dick@ximian.com>
1547
1548         * Makefile.am (libwapiincludedir): Fix include destination
1549
1550         * .cvsignore: Ignore generated files
1551
1552 2001-11-10  Dietmar Maurer  <dietmar@ximian.com>
1553
1554         * pthread-compat.c: added some include files to make it compile on
1555         linux.
1556
1557 2001-11-08  Dick Porter  <dick@ximian.com>
1558
1559         * Initial checkin.
1560
1561         This is a library emulating the win32 threading and IO API.