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