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