2003-06-17 Zoltan Varga <vargaz@freemail.hu>
[mono.git] / mono / io-layer / ChangeLog
1 2003-06-17  Zoltan Varga  <vargaz@freemail.hu>
2
3         * system.h (struct _WapiSystemInfo ): Fix warnings when using gcc-3.3.
4
5 2003-06-11  Dick Porter  <dick@ximian.com>
6
7         * shared.c: Fix shared directory creation.  Patch from
8         Pablo Baena <pbaena@uol.com.ar>
9
10 2003-06-10  Dick Porter  <dick@ximian.com>
11
12         * atomic.c: Delete the useless compile warning
13
14 2003-06-09  Dick Porter  <dick@ximian.com>
15
16         * daemon.c: Lookup env as a string array.  Fixes bug 44289.  Also
17         make setting the process handle value in the environment actually
18         work.
19
20         * processes.c: Pretty up the process name, if it happens to be
21         "mono" such as when another mono process forks "mono foo.exe"
22
23 2003-06-05  Dick Porter  <dick@ximian.com>
24
25         * processes.c (process_set_current): Don't do an expensive handle
26         search at application startup, check the environment to see if the
27         process handle has already been created.
28
29         * io.c: Don't do an expensive handle search when creating stdin,
30         stdout and stderr handles, just create them all the first time one
31         is requested.
32
33         * wapi-private.h:
34         * shared.c:
35         * shared.h:
36         * handles.c:
37         * handles-private.h:
38         * daemon-messages.h:
39         * daemon-private.h:
40         * daemon.c: Support for "unlimited" number of handles and scratch
41         data.
42
43         Speed up application startup by passing process handle in the
44         environment, rather than let the app scan all handles (which gets
45         really slow when there are more than a few thousand to check.)
46
47         Initialise some structs passed to syscalls, noticed by valgrind.
48         
49
50 2003-05-20  Dick Porter  <dick@ximian.com>
51
52         * io.c (FindFirstFile): Include . files in the glob.  Fixes bug
53         43229.
54
55 2003-05-19  Dick Porter  <dick@ximian.com>
56
57         * threads.c: Set the new thread's stack size to 2M.  Fix needed
58         for BSD, reported by Martin Dvorak <md@9ll.cz>
59
60 2003-05-16  Dick Porter  <dick@ximian.com>
61
62         * io.h:
63         * io.c: Implement GetTempPath()
64
65 2003-05-16  Dick Porter  <dick@ximian.com>
66
67         * processes.c (CreateProcess): Set some error codes
68
69 2003-05-12  Dick Porter  <dick@ximian.com>
70
71         * misc.c (_wapi_calc_timeout): Cope with overflowing tv_nsec.
72         Patch from Martin Dvorak <mdvorak@ninell.cz>.
73
74 2003-05-10  Dick Porter  <dick@ximian.com>
75
76         * io.c (CopyFile): Copy file mode as well as file data.  Based on
77         suggestion by Giuseppe Greco <giuseppe.greco@agamura.com>, bug
78         42706.
79
80 2003-05-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
81
82         * handles.c: don't call GC_gcollect when creating new handles.
83
84 2003-05-05  Gonzalo Paniagua Javier <gonzalo@ximian.com>
85
86         * handles.c: added some debugging code. Call GC_gcollect
87         before creating a new handle. It makes Lupus' test run smoother and
88         faster (from 62 to 83 request per second). Notice that calling
89         GC_finalizer_notifier if needed (GC_should_invoke_finalizer ()) does
90         not improve nor degrade the performance, so i don't do it.
91
92 2003-05-02  Dick Porter  <dick@ximian.com>
93
94         * sockets.c: Rearrange closesocket() and socket_close_private(),
95         and remember to unref the handle, so we don't leak socket handles.
96         Fix from Pelle Johnsen <pelle.johnsen@mail.dk>
97
98 2003-04-11  Dick Porter  <dick@ximian.com>
99
100         * atomic.h: ARM atomic operations by Malte Hildingson
101         <tds00mahi@tellus.thn.htu.se>
102
103 Tue Apr 8 11:37:29 CEST 2003 Paolo Molaro <lupus@ximian.com>
104
105         * atomic.h: fix macosx build by "Urs C. Muff" <umuff@quark.com>.
106
107 2003-04-03  Martin Baulig  <martin@ximian.com>
108
109         The following change is conditional to `WITH_INCLUDED_LIBGC'
110         which is not yet enabled by default.
111
112         * threads.c (SuspendThread, ResumeThread): Fully implemented this.
113         (gc_init): New static function; install a signal handler for
114         SIGPWR which is used to suspend threads.  [FIXME: it SIGPWR
115         doesn't exist on all Unix systems, we need to find another
116         signal].
117         (mono_wapi_push_thread_stack): New public function.  Tells the
118         garbage collector about the current stack pointer of a suspended
119         thread.
120
121 2003-04-03  Martin Baulig  <martin@ximian.com>
122
123         * timed-thread.h (TimedThread): Added `suspended_sem',
124         `suspend_count' and `stack_ptr'.
125
126 2003-03-28  Dick Porter  <dick@ximian.com>
127
128         * atomic.h: PPC support gratiously donated to the public domain
129         by John Duncan <jddst19@mac.com>
130
131 2003-03-20  Dick Porter  <dick@ximian.com>
132
133         * sockets.c (_wapi_connect): If connect() fails with EACCES, try
134         setting SO_BROADCAST and connecting again.  Fixes bug 39178.
135
136 2003-03-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
137
138         * processes.c: included Jerome Laban's patch and call SetLastError when
139         the executable is not found.
140
141 2003-03-03  Dick Porter  <dick@ximian.com>
142
143         * io.c (CreateFile): Try opening directories readonly, so that
144         timestamps can be adjusted.  Patch by Elan Feingold
145         <efeingold@mn.rr.com>.
146
147 2003-02-25  Dick Porter  <dick@ximian.com>
148
149         * shared.c (_wapi_shm_attach): Return a failure code on system
150         call errors, rather than exiting.
151
152 2003-02-21  Dick Porter  <dick@ximian.com>
153
154         * processes.c (GetCurrentProcessId): Use the current process
155         handle to return the process ID, as getpid() is unreliable
156         (linuxthreads gives each thread a different pid).  Fixes bug
157         37550.
158
159 2003-02-21  Dick Porter  <dick@ximian.com>
160
161         * io.c (FindNextFile): Skip over dangling symlinks.  Fixes bug
162         34076.
163
164 2003-02-11  Dick Porter  <dick@ximian.com>
165
166         * timefuncs.h: 
167         * timefuncs.c: Added GetTickCount()
168
169 2003-02-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
170
171         * error.c: added WSA_EHOSTUNREACH mapping.
172
173 2003-01-26  Miguel de Icaza  <miguel@ximian.com>
174
175         * io.c (SetFileAttributes): This routine is not currently
176         implemented for the general case, but I added a special case to
177         set the executable bit on Linux.
178
179 Wed Jan 15 15:55:40 CET 2003 Paolo Molaro <lupus@ximian.com>
180
181         * sockets.h, daemon.c, io.c: compilation fixes on MacOSX.
182
183 2003-01-08  Dick Porter  <dick@ximian.com>
184
185         * sockets.c: Fixed setting blocking mode to true (fixes bug 36388)
186
187 2002-12-11  Juli Mallett  <jmallett@FreeBSD.org>
188
189         * daemon.c, handles-private.h, handles.c, wapi-private.h:
190         Check for an implementation which says it supports
191         _POSIX_THREAD_PROCESS_SHARED, rather than just one that
192         defines the symbol.  Defined but with a value of -1 still
193         means that it is unsupported.
194
195 2002-12-08  Martin Baulig  <martin@ximian.com>
196
197         * handles.c (_wapi_handle_new): Create new non-shared handles with
198         an initial refcount of 1, not 0.
199
200 2002-11-22  Dietmar Maurer  <dietmar@ximian.com>
201
202         * threads.c (TlsGetValue): removed unnecessary mutex
203
204 2002-11-20  Dick Porter  <dick@ximian.com>
205
206         * timed-thread.c (_wapi_timed_thread_attach): Attached threads
207         need to store their data structure too.
208
209         * threads.c: Make sure the threading data is initialised wherever
210         it is needed
211
212 2002-11-15  Dick Porter  <dick@ximian.com>
213
214         * timed-thread.c: Removed unneeded parameters in
215         _wapi_timed_thread_attach().
216
217         * threads.c: Renamed AttachThread() to make it not look like
218         external API.  Removed unneeded parameters.
219
220 2002-11-11  Gonzalo Paniagua Javier <gonzalo@ximian.com>
221
222         * error.[ch]: added errno_to_WSA (). It displays a warning and return
223         WSASYSCALLFAILURE if there is no error mapping for the given errno,
224
225         * sockets.c: use errno_to_WSA and fixed display of warning for h_errno.
226
227 2002-10-31  Dick Porter  <dick@ximian.com>
228
229         * io.h: 
230         * io.c: Define and use INVALID_FILE_ATTRIBUTES
231
232 2002-10-07  Dick Porter  <dick@ximian.com>
233
234         * timefuncs.c:
235         * daemon.c: Use a more accurate time source for process start and
236         end times.
237
238 2002-10-03  Dick Porter  <dick@ximian.com>
239
240         * daemon.c:
241         * handles.c:
242         * threads.c:  Fixes for freebsd.  Make sure that mutex and condition
243         creation and deletion happen in the process that owns them, when
244         POSIX shared thread objects aren't supported.  This breaks on
245         freebsd, as pthread_t is a pointer to data.
246
247 2002-10-02  Dick Porter  <dick@ximian.com>
248
249         * shared.c: Use mmap() instead of sysv shm for the shared data.
250
251         * wapi-private.h (_WAPI_HANDLE_VERSION): Reset back to 0, for the
252         new system
253
254         * daemon-private.h: 
255         * daemon.c: mmap()ed regions survive fork, so just pass the
256         pointer to _wapi_daemon_main instead of mapping it again.
257
258 2002-10-01  Dick Porter  <dick@ximian.com>
259
260         * timed-thread.c: Kludge for CREATE_SUSPENDED thread creation.
261         Unfortunately libgc uses the same thread suspend technique that I
262         want to, and the two don't mix: libgc will deadlock when it tries
263         to stop the world if a thread has already been suspended by
264         someone else.  Just do the simple suspended create rather than the
265         general purpose thread suspension for now.
266
267         * threads.c: Pass create flags to the timed_thread create call, to
268         implement suspended thread creation.  ResumeThread() partially
269         implemented, to cope with the case where a newly created but
270         suspended thread is launched.
271
272 2002-09-30  Dick Porter  <dick@ximian.com>
273
274         * sockets.c (ioctlsocket): Set non-blocking mode in a better way,
275         with fcntl.
276
277 2002-09-27  Dick Porter  <dick@ximian.com>
278
279         * semaphores.c: Only include semaphore.h if it's present. Patch
280         for BSD from jmmv@hispabsd.org (Julio Merino).
281
282 2002-09-27  Dick Porter  <dick@ximian.com>
283
284         * processes.c: Pass environment and working directory to the
285         daemon when forking.  Don't let argv[0] be duplicated when looking
286         for the program name.  Implement EnumProcessModules (simple
287         version for now, lsof-style later if needed), GetModuleBaseName,
288         {Get,Set}ProcessWorkingSetSize (just faked, because the vm hints
289         aren't available on Linux).
290
291         * process-private.h: Store the process name, and the working set
292         min and max
293
294         * handles.c:
295         * handles-private.h: New functions to store and retrieve an array
296         of strings in the scratch space
297
298         * daemon.c: Don't miss deleting some handles when a client exits
299         (we used to rely on the client doing the final cleanup, but
300         obviously if the client is no longer there the daemon has to do
301         it).
302
303         Process forking now sets the environment and the working
304         directory.
305
306         * io.c: Don't confuse fd 0 with an unassigned handle struct
307
308         * atomic.h: Add a google cache alternative to the msdn URL
309
310 2002-09-25  Gonzalo Paniagua Javier <gonzalo@ximian.com>
311
312         * sockets.c:
313         (_wapi_recvfrom): added ECONNRESET to the switch.
314
315 2002-09-24  Mark Crichton  <crichton@gimp.org>
316
317         * atomic.h: Yea.  On linux, sparc isn't sparc, it's __sparc__.
318         Added to ifdef.
319
320 2002-09-19  Mark Crichton  <crichton@gimp.org>
321
322         * daemon.c, shared.c: Added NEED_LINK_UNLINK for systems that
323         dont have Linux's abstract filesystem for sockets.
324
325 2002-09-19  Mark Crichton  <crichton@gimp.org>
326
327         * atomic.h: Added SPARC atomic asm code.
328         * daemon.c, handles-private.h, handles.c, wapi-private.h:
329         undefined _POSIX_THREAD_PROCESS_SHARED.  This actually exists on
330         Solaris 9, however, the code paths don't seem to work.  More testing
331         on the shared case is *really* needed.
332
333 2002-09-03  Dick Porter  <dick@ximian.com>
334
335         * threads.h: 
336         * threads.c: Removed PosixKillThread(), because it's not in the
337         w32 api
338
339 2002-08-20  Dick Porter  <dick@ximian.com>
340
341         * handles.c (_wapi_handle_scratch_store): Made stored byte lengths
342         multiples of 4 bytes, to keep header structures aligned.  Needed
343         for sparc, at least. (Patch from crichton@gimp.org)
344
345         * handles.c: Removed 'disable_shm' variable (we've defaulted to
346         building with shm enabled for months now)
347
348 2002-08-19  Dick Porter  <dick@ximian.com>
349
350         * daemon.c: Rewrote the poll() loop to use GIOChannels instead,
351         for legacy NeXT-based systems.
352
353 2002-08-12  Dick Porter  <dick@ximian.com>
354
355         * atomic.h: Rename some parameters to avoid c++ keywords (Patch
356         from Joseph Wenninger <kde@jowenn.at>)
357
358 2002-08-05  Dietmar Maurer  <dietmar@ximian.com>
359
360         * threads.c: use fast spinlocks by default
361
362 2002-08-02  Dick Porter  <dick@ximian.com>
363
364         * io.c (GetStdHandle): Add a handle reference when returning a
365         duplicate console handle.  This fixes the unref_handle errors in
366         NUnit.
367
368 2002-08-01  Dietmar Maurer  <dietmar@ximian.com>
369
370         * threads.c (TLS_PTHREAD_MUTEX): define this because else some
371         tests does not work
372
373 2002-08-01  Dick Porter  <dick@ximian.com>
374
375         * threads.c: Use atomic spinlocks in TLS functions
376
377         * mono-spinlock.h:
378         * Makefile.am: Added mono-spinlock.h
379
380 2002-07-21  Jeffrey Stedfast  <fejj@ximian.com>
381
382         * daemon-messages.c: #include <sys/types.h> and <sys/sockets.h> -
383         these are needed for sendmsg() and also for struct msghdr (at
384         least on Solaris). Solaris still won't build because struct msghdr
385         doesn't have msg_flags, msg_control, or msg_controllen members.
386         (CMSG_SPACE): Define for systems that don't have it.
387         (CMSG_LEN): Same.
388
389 2002-07-20  Dick Porter  <dick@ximian.com>
390
391         * wapi-private.h:
392         * io-private.h:
393         * io.h:
394         * io.c:
395         * handles.c: Implemented pipe handles
396         
397         * handles.c:
398         * daemon.c: Fixed bug in handle closing.
399
400         * shared.c:
401         * daemon.c: Forked processes now close all open file descriptors.
402
403 Fri Jul 19 19:05:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
404
405         * sockets.h, io-layer.h, critical-sections.h: don't include config.h
406         in header files.
407
408 2002-07-19  Martin Baulig  <martin@gnome.org>
409
410         * threads.c (ExitThread): Call exit() if no threads has been
411         created yet.
412
413 2002-07-17  Dick Porter  <dick@ximian.com>
414
415         * daemon-messages.c: Freebsd fixes from Andreas Kohn
416         <andreas.kohn@gmx.net>
417
418 2002-07-15  Dick Porter  <dick@ximian.com>
419
420         * io.c: Removed bogus console_flush() method, that was just cut
421         and pasted from file_flush when I separated the two handle types.
422
423 2002-07-12  Dick Porter  <dick@ximian.com>
424
425         * io.c (convert_from_flags): Fixed misunderstanding wrt fcntl
426         flags.  Fixes bug 27633.
427
428 2002-07-12  Dick Porter  <dick@ximian.com>
429
430         * wapi-private.h:
431         * handles.c:
432         * daemon.c: Use size of sockaddr_un.sun_path from config.h
433
434 2002-07-12  Dick Porter  <dick@ximian.com>
435
436         * processes.c (CreateProcess): Send stdin, stdout and stderr
437         handles if the startup info doesnt specify new ones
438
439         * io.c (GetStdHandle): Return the same handle when the same
440         standard handle is requested
441
442         * handles.c: Pass file descriptors when forking
443
444         * daemon.c: Use supplied file descriptors when forking a new
445         process
446
447         * daemon-messages.h: 
448         * daemon-messages.c: Pass stdin, stdout and stderr file
449         descriptors to the daemon (used when forking)
450
451 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
452
453         * daemon.c (_wapi_daemon_main): Use sizeof
454         (main_socket_address.sun_path) instead of hardcoded 108 value.
455
456         * handles.c (shared_init): Use sizeof
457         (shared_socket_address.sun_path) instead of hardcoded 108 value.
458
459 2002-07-10  Dennis Haney  <davh@davh.dk>
460
461         * shared.c:
462         * handles.c:
463         * daemon.c: Lots of documentation, some added error checking, and
464         code readability improvements.
465
466         * daemon-messages.h: Add the Error request type to improve error
467         checking.
468
469         * daemon-messages.c: Do a bit more error checking on send() and
470         recv(), and log errors with a higher severity level.
471
472 2002-07-04  Dick Porter  <dick@ximian.com>
473
474         * daemon.c (process_process_fork): Fix argument handling, due to
475         buggy understanding of g_strsplit() behaviour.
476
477 2002-07-03  Dick Porter  <dick@ximian.com>
478
479         * threads.h:
480         * threads.c: Implement OpenThread().  Define access-control values
481         for thread handles.
482
483         * wapi.h:
484         * processes.h:
485         * access.h:
486         * Makefile.am: Added access.h, to hold shared access-control
487         definitions
488
489 2002-07-02  Dick Porter  <dick@ximian.com>
490
491         * wapi-private.h (_WAPI_HANDLE_VERSION): New protocol version
492         
493 2002-07-02  Dick Porter  <dick@ximian.com>
494
495         * handles.c (shared_init): Make a second attempt to contact the
496         daemon if the shared memory attach succeeds, but the connect()
497         fails. (This copes with the daemon crashing without cleaning up
498         the shared memory.)
499
500         * Makefile.am: 
501         * daemon-private.h:
502         * daemon.c:
503         * shared.c (_wapi_shm_attach): Don't exec() anything when we fork
504         the daemon, it's now built into the library.
505
506 2002-06-25  Dick Porter  <dick@ximian.com>
507
508         * handles.c:
509         * handles-private.h:
510         * daemon-messages.h:
511         * daemon.c: Process forking and handle data management
512
513         * processes.h:
514         * process-private.h:
515         * processes.c: Process forking and other support functions
516
517 2002-06-25  Dick Porter  <dick@ximian.com>
518
519         * versioninfo.h: PE resource decoding
520
521         * unicode.c (_wapi_unicode_to_utf8): g_utf16_to_utf8 doesnt need
522         to be told the string length
523
524         * io.c: Removed the ACTUALLY_DO_UNICODE option.  Fixed some leaks.
525         Moved _wapi_time_t_to_filetime and the WapiFileTime typedef to
526         timefuncs.c
527
528 2002-06-12  Dick Porter  <dick@ximian.com>
529
530         * daemon.c: 
531         * daemon-messages.c: Handle SIGPIPE in a non-stupid way in the
532         daemon, if MSG_NOSIGNAL isn't available.  Thanks to Jaroslaw
533         Kowalski <jarek@atm.com.pl> for pointing out the bogosity.
534
535 2002-06-10  Jaroslaw Kowalski <jarek@atm.com.pl>
536
537         * sockets.c, daemon-messages.c: Prevent SIGPIPE from being raised
538         when writing to a closed socket.
539
540 2002-06-08  Jeffrey Stedfast  <fejj@ximian.com>
541
542         * mono-mutex.c (mono_once): New convenience function for my
543         previous fix.
544
545         * handles.c:
546         * error.c: 
547         * critical-sections.c: 
548         * threads.c: 
549         * sockets.c: 
550         * semaphores.c: 
551         * processes.c: 
552         * mutexes.c: 
553         * io.c: 
554         * events.c: 
555         * atomic.c: Use mono_once() rather than pthread_once().
556
557 2002-06-06  Jeffrey Stedfast  <fejj@ximian.com>
558
559         * handles.c (_wapi_handle_new): pthread_once() is not atomic, so
560         if multiple threads all try to call _wapi_handle_new() before the
561         shared data has been initialized, it is possible that we could get
562         into a condition where shared_init() is being executed and later
563         threads will pass by pthread_once() due to the fact that it has
564         already been called and so therefor will attempt to use the shared
565         data before it has been completely initialized. If we instead use
566         a standard mutex locking mechanism around shared_init(), we can
567         avoid the situation entirely. By wrapping the mutex locking in a
568         check to see if we've already initialized the data, we can even
569         avoid wasting resources by having to lock/unlock the mutex in any
570         later calls (the only time we'd have to worry about
571         locking/unlocking is the initial race to call shared_init() at
572         startup).
573
574 Sat Jun 1 13:27:11 CEST 2002 Paolo Molaro <lupus@ximian.com>
575
576         * atomic.h: inline asm fixes from Dennis Haney (davh@davh.dk).
577
578 Fri May 31 16:21:54 CEST 2002 Paolo Molaro <lupus@ximian.com>
579
580         * daemon.c, handles.c: rename "sun" local var since it's apparently
581         a #define on Solaris.
582
583 Fri May 31 15:40:14 CEST 2002 Paolo Molaro <lupus@ximian.com>
584
585         * daemon-messages.c: work-around MSG_NOSIGNAL missing on some
586         platforms.
587
588 2002-05-15  Dick Porter  <dick@ximian.com>
589
590         * wait.c: Fix a deadlock in WaitForMultipleObjects
591
592 2002-05-14  Dick Porter  <dick@ximian.com>
593
594         * io.c: Fix a cut&paste error, found by
595         Jaroslaw Kowalski <jarek@atm.com.pl>
596
597 2002-05-10  Dan Lewis  <dihlewis@yahoo.co.uk>
598
599         * io.c: Nasty typo.
600
601 2002-05-09  Dick Porter  <dick@ximian.com>
602
603         * threads.c: 
604         * semaphores.c: 
605         * processes.c: 
606         * mutexes.c: 
607         * handles-private.h: 
608         * events.c: 
609         * Makefile.am: Remove now-unused file wait-private.h
610
611 2002-05-08  Dick Porter  <dick@ximian.com>
612
613         * shared.c: Better error messages, and report when daemon
614         connection fails rather than blocking forever.  Do some more
615         shared memory sanity checking.
616
617         * handles.c: Better error messages when connecting to shared
618         memory and the handle daemon.  Fall back to non-shared handles if
619         an error occurs.  Set the default back to 'shared handles'.  Fix a
620         crashing bug in scratch space allocation that mangled the block
621         headers.
622
623 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
624
625         * handles.c (shared_init): Disable SHM for now, people have too
626         many problems with this, and the diagnostics are not helping.
627
628 2002-05-06  Dan Lewis  <dihlewis@yahoo.co.uk>
629
630         * io.c: CreateFile sets win32 last error.
631
632 2002-05-05  Dick Porter  <dick@ximian.com>
633
634         * wapi-private.h: 
635         * handles-private.h:
636         * io.c: 
637         * io-private.h:
638         * mutexes.c: 
639         * mutex-private.h: 
640         * processes.c: 
641         * process-private.h: 
642         * semaphores.c: 
643         * semaphore-private.h: 
644         * sockets.c: 
645         * socket-private.h: 
646         * events.c: 
647         * event-private.h: Simplify the WapiHandleOps struct: take out all
648         the file-specific entries, leaving just the items that operate on
649         handles themselves.  Split the close operation into shared and
650         private parts: shared close is called by the daemon.
651
652         * handles.c: As above, but also pass handle allocation, ref and
653         unref operations to the daemon.  Populate the handle_ops array at
654         compile time, because the daemon needs to call ops on handles too.
655         Don't bother to track open handle counts any more, the daemon does
656         that.
657         
658         * threads.c: 
659         * thread-private.h: As above, but also make the thread data
660         handle-private.
661
662         * shared.c: Fork a handle daemon if the calling process created
663         the shared memory segment.
664
665         * daemon.c:
666         * daemon-messages.c:
667         * daemon-messages.h:
668         * Makefile.am: Build a daemon to manage handle allocation and
669         destruction without needing to lock the shared memory
670
671 2002-04-30  Jeffrey Stedfast  <fejj@ximian.com>
672
673         * atomic.c: Changed to use a normal mutex rather than a spinlock
674         since a lot of platforms seem to not have them :\
675
676 2002-04-30  Dick Porter  <dick@ximian.com>
677
678         * Completely rewrote the handle waiting code: removed the helper
679         thread and its attendant complexity.  All handle waiting is now
680         abstracted into the WaitForSingleObject() and
681         WaitForMultipleObjects() functions.
682
683         * Implemented inter-process sharing of handles using sysv shared
684         memory.  This makes handles even more opaque, with a handle now
685         just an index into an array.
686         
687 2002-04-25  Dan Lewis  <dihlewis@yahoo.co.uk>
688
689         * io.c: unitialized pointer in GetCurrentDirectory.
690
691 Sat Apr 20 13:37:39 CEST 2002 Paolo Molaro <lupus@ximian.com>
692
693         * threads.c: destroy the mutex at thread destruction
694         (if/when thread destruction code will be actually called).
695         When protecting a tls data pointer from the gc, use also the 
696         thread id in the key.
697         
698 Wed Apr 17 18:36:27 CEST 2002 Paolo Molaro <lupus@ximian.com>
699
700         * timed-thread.c: avoid race condition when setting the thread to
701         detached.
702
703 2002-04-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
704
705         * jit.h: to more #include lines to avoid breaking compilation
706         under windows when upgrading mingw and w32api to version
707         1.3 (thanks Dick!).
708
709 2002-04-16  Dick Porter  <dick@ximian.com>
710
711         * atomic.h: Explanatory comment about lack of 80386 support
712
713 2002-04-15  Dick Porter  <dick@ximian.com>
714
715         * atomic.h: use xaddl for InterlockedIncrement() and
716         InterlockedDecrement().  Use cmpxchgl in a loop for
717         InterlockedExchange() and InterlockedExchangePointer().
718
719 Mon Apr 15 13:31:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
720
721         * unicode.c: fix unicode_len() to not access uninitialized memory
722         (and updated to conform to mono code style).
723
724 Fri Mar 29 17:15:11 CET 2002 Paolo Molaro <lupus@ximian.com>
725
726         * io.c: EEXISTS is ignored for directory creation.
727         * mono-mutex.h: remove silly "pragma }" that emacs users insert
728         because they use a broken editor:-)
729
730 2002-03-28  Dick Porter  <dick@ximian.com>
731
732         * sockets.h: 
733         * sockets.c: 
734         * io.c: 
735         * handles.h: 
736         * handles.c: Warning cleanups
737
738 2002-03-27  Dan Lewis <dihlewis@yahoo.co.uk>
739
740         * unicode.h, unicode.c: changed to gunichar2
741         * io.h, io.c: changed strings to gunichar2*, added
742         SetFileAttributes(), GetCurrentDirectory(), SetCurrentDirectory(),
743         some fixes to FindFirstFile() and friends.
744
745 2002-03-26  Dick Porter  <dick@ximian.com>
746
747         * types.h: Implement the large integer struct
748
749         * timefuncs.h:
750         * timefuncs.c: Dummy functions that don't yet implement
751         QueryPerformanceCounter() and QueryPerformanceFrequency()
752
753         * threads.h:
754         * threads.c: Implement SleepEx()
755
756         * system.h:
757         * system.c: Beginnings of GetSystemInfo()
758
759         * mono-mutex.c (pthread_mutex_timedlock): Fix a ms/ns conversion
760         thinko
761
762         * context.h:
763         * context.c: Dummy function that doesnt yet implement
764         GetThreadContext()
765
766         * atomic.h: 
767         * atomic.c: Interlocked functions
768
769 Mon Mar 25 13:01:40 CET 2002 Paolo Molaro <lupus@ximian.com>
770
771         * threads.c: use a gc-safe hash table to store tls pointers.
772
773 2002-03-22  Dick Porter  <dick@ximian.com>
774
775         * threads.c: Fix a race condition where a thread can start and
776         exit before the handle has been properly initialised (no reason
777         why the handle couldn't be initialised beforehand, so do so)
778
779         Fix a ms to ns conversion magnitude thinko.
780
781 2002-03-21  Dick Porter  <dick@ximian.com>
782
783         * semaphores.c: Fix a problem when waiting for one or more
784         semaphores, and another semaphore is Released (all waiting
785         semaphores assumed they were signalled)
786
787 2002-03-29  Dan Lewis <dihlewis@yahoo.co.uk>
788
789         * io.h, io.c, uglify.h: added MoveFile, CopyFile, CreateDirectory,
790         RemoveDirectory, GetFileAttributes, GetFileAttributesEx
791
792 2002-03-19  Dietmar Maurer  <dietmar@ximian.com>
793
794         * threads.c (Sleep): bug fix: 1ms == 1000000ns
795
796 2002-03-19  Dan Lewis <dihlewis@yahoo.co.uk>
797
798         * io.h, io.c, events.c, mutexes.c, semaphores.c, sockets.c,
799         threads.c, io.c: added flush method to handles.
800
801         * io.c: FlushFileBuffers() and FindFirstFile() functions.
802
803 Thu Mar 7 17:21:52 CET 2002 Paolo Molaro <lupus@ximian.com>
804
805         * threads.c, timed-thread.c, wait.c: Boehm-GC anable.
806
807 2002-02-20  Dick Porter  <dick@ximian.com>
808
809         * io-layer.h: Always build without cygwin support on windows
810
811 Mon Feb 18 15:50:59 CET 2002 Paolo Molaro <lupus@ximian.com>
812
813         * sockets.c: #undef DEBUG.
814
815 2002-02-14  Jeffrey Stedfast  <fejj@ximian.com>
816
817         * io-layer.h: conditionally include sys/filio.h and sys/sockio.h
818         for FIONBIO, FIONREAD, and SIOCATMARK.
819
820 2002-02-14  Jeffrey Stedfast  <fejj@ximian.com>
821
822         * sockets.c: conditionally include sys/filio.h and sys/sockio.h
823         for FIONBIO, FIONREAD, and SIOCATMARK.
824
825 2002-02-13  Dick Porter  <dick@ximian.com>
826
827         * sockets.c: Implement shutdown and select
828
829 2002-02-13  Jeffrey Stedfast  <fejj@ximian.com>
830
831         * mono-mutex.[c,h]: New source files that thinly wrap all pthread
832         functions that take pthread_mutex_t and/or pthread_mutexattr_t
833         arguments for the sake of portability. Implements recursive
834         mutexes and pthread_mutex_timedlock.
835
836         * critical-sections.c:
837         * events.c:
838         * handles.c:
839         * mutexes.c:
840         * semaphores.c:
841         * threads.c:
842         * timed-thread.c:
843         * wait.c: Use the mono-mutex wrapper portability functions/macros.
844
845         * pthread-compat.[c,h]: Replaced by mono-mutex.[c,h]
846
847 2002-01-23  Dick Porter  <dick@ximian.com>
848
849         * sockets.c: Networking support, mostly wrapping BSD socket APIs
850         with handle code, and translating errno into w32 error codes.
851
852         * macros.h: Some w32 macros used with the socket support
853
854         * error.c: Implemented GetLastError() and SetLastError()
855
856         * Makefile.am: Added sockets, with kludge to override some symbols
857
858 2001-12-17  Dietmar Maurer  <dietmar@ximian.com>
859
860         * unicode.c (_wapi_unicode_to_utf8): byteswap UTF16 strings before
861         passing them to iconv
862         (_wapi_unicode_to_utf8): only swap bytes on LE systems, remove bug
863         from previous commit.
864
865 2001-12-11  Dick Porter  <dick@ximian.com>
866
867         * io.c: Implement DeleteFile(), GetFileTime(), SetFileTime() and
868         FileTimeToSystemTime().
869
870         * unicode.c (unicode_len): Nasty way of finding length of unicode
871         string with embedded NULLs (counts until two NULLs together).
872
873         * mutexes.c (mutex_close): 
874         * events.c (event_close): Release the internal pthreads resources
875
876 2001-11-26  Dick Porter  <dick@ximian.com>
877
878         * critical-sections.c:
879         * events.c:
880         * handles.c:
881         * io.c:
882         * mutexes.c:
883         * semaphores.c:
884         * threads.c:
885         * timed-thread.c:
886         * wait.c: turn off DEBUG messages
887
888 2001-11-22  Dick Porter  <dick@ximian.com>
889
890         * handles.c (SignalObjectAndWait): Implement
891
892         * wait.c (WaitForSingleObject): Fix case where timeout == 0
893
894         * threads.c:
895         * semaphores.c:
896         * mutexes.c:
897         * io.c:
898         * events.c: Support for SignalObjectAndWait
899         
900 2001-11-21  Dick Porter  <dick@ximian.com>
901
902         * events.c:
903         * handles.c:
904         * mutexes.c:
905         * semaphores.c:
906         * threads.c:
907         * wait.c: Reliable method of returning which handle was signalled
908         on return from WaitForMultipleObjects().
909
910 2001-11-21  Dick Porter  <dick@ximian.com>
911
912         * events.c: Implement events
913
914 2001-11-15  Dick Porter  <dick@ximian.com>
915
916         * mutexes.c: Implement mutexes
917
918         * threads.c: 
919         * semaphores.c: 
920         * misc.c: Factor out some common code
921
922 2001-11-13  Dick Porter  <dick@ximian.com>
923
924         * threads.c: Implement TLS.  Implement GetCurrentThreadId(), and
925         GetCurrentThread() by maintaining a hash of thread handles.
926
927         * threads.h: Define thread and process creation flags
928
929 2001-11-12  Dick Porter  <dick@ximian.com>
930
931         * critical-sections.c: Implement critical sections
932
933 2001-11-12  Dick Porter  <dick@ximian.com>
934
935         * semaphores.c: Implement semaphores
936
937         * wait.c (wait_for_item): Maintain a wait count rather than count
938         signalled booleans.
939
940         * threads.c (thread_wait_multiple): Don't lock the wait item, that
941         will block other wait threads
942
943 2001-11-11  Dick Porter  <dick@ximian.com>
944
945         * Makefile.am: Rename some automake variables
946         (from Nick Drochak <ndrochak@gol.com>)
947
948 2001-11-10  Dick Porter  <dick@ximian.com>
949
950         * Makefile.am (libwapiincludedir): Fix include destination
951
952         * .cvsignore: Ignore generated files
953
954 2001-11-10  Dietmar Maurer  <dietmar@ximian.com>
955
956         * pthread-compat.c: added some include files to make it compile on
957         linux.
958
959 2001-11-08  Dick Porter  <dick@ximian.com>
960
961         * Initial checkin.
962
963         This is a library emulating the win32 threading and IO API.
964
965