2005-09-20 Dick Porter <dick@ximian.com>
[mono.git] / mono / io-layer / ChangeLog
1 2005-09-20  Dick Porter  <dick@ximian.com>
2
3         * collection.c: 
4         * processes.c: Periodically waitpid for known process IDs.  Fixes
5         bug 74870.
6
7 2005-09-15 Gonzalo Paniagua Javier <gonzalo@ximian.com>
8
9         * io.c:
10         (CreateFile): if the file is a named pipe, treat the handle as a pipe,
11         not as a file. Fixes bug #76075.
12
13 2005-08-27  Zoltan Varga  <vargaz@gmail.com>
14
15         * atomic.h: Add support for intel icc.
16
17 2005-08-25  Zoltan Varga  <vargaz@gmail.com>
18
19         * io-layer.h: Include winbase.h not WinBase.h.
20
21 2005-08-19  Dick Porter  <dick@ximian.com>
22
23         * threads.c, threads.h, thread-private.h: Use a gsize to store the
24         thread ID, so it can hold a 64 bit value if needed.
25
26 2005-07-26 Gonzalo Paniagua Javier <gonzalo@ximian.com>
27
28         * error.c: map ENOENT to WSAECONNREFUSED. It might happen when
29         connecting to unix sockets. Closes bug #75632.
30
31 2005-07-05  Dick Porter  <dick@ximian.com>
32
33         * io.c: Make sure SIGPIPE is ignored when calling write(2).
34         Prevents the runtime exiting when writing to a closed pipe,
35         fixing bug 75468.
36
37 2005-06-30  Dick Porter  <dick@ximian.com>
38
39         * shared.c (_wapi_shm_semaphores_init): Add some helpful error
40         messages when semget () fails due to lack of resources.
41
42 2005-06-21  Dick Porter  <dick@ximian.com>
43
44         * mutex-private.h:
45         * thread-private.h:
46         * mutexes.c: 
47         * threads.c: Keep a list of owned mutexes in each thread handle,
48         so that it is easier to abandon them when the thread exits.
49         Removes a bottleneck when multiple threads are finishing in
50         parallel.
51
52 2005-06-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
53
54         * io.c: (GetLogicalDrives) when a bogus line is read, don't leak memory.
55         When the buffer has not enough space, close the file before returning.
56
57 2005-06-09  Duncan Mak  <duncan@novell.com>
58
59         * *.h: Added G_BEGIN_DECLS and G_END_DECLS where appropriate to
60         all public headers. Fixes #74919.
61
62 2005-05-30  Zoltan Varga  <vargaz@freemail.hu>
63
64         * atomic.h: Add IA64 atomic ops.
65
66 2005-05-26 Gonzalo Paniagua Javier <gonzalo@ximian.com>
67
68         * processes.c: make ExitCode be valid even if the user didn't call
69         WaitForExit() and is just polling on HasExited.
70
71 2005-05-17  Dick Porter  <dick@ximian.com>
72
73         * io.c (file_getfilesize): Clear the error value, so that files
74         with sizes with the low bits 0xFFFFFFFF can be distinguished from
75         a genuine error.
76
77 2005-05-11 Gonzalo Paniagua Javier <gonzalo@ximian.com>
78
79         * shared.c: forgot to ignore a warning.
80
81 2005-05-10 Gonzalo Paniagua Javier <gonzalo@ximian.com>
82
83         * shared.c: don't display warnings after reboots.
84
85 2005-05-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
86
87         * sockets.c: on windows, getsockopt/setsockopt for send/receive timeout
88         use an integer in milliseconds. We were using a struct timeval.
89
90 2005-05-06  Dick Porter  <dick@ximian.com>
91
92         * handles-private.h: 
93         * mutexes.c: 
94         * wapi-private.h: 
95         * shared.h:
96         * shared.c: 
97         * wait.c: 
98         * handles.c: 
99         * collection.h: Use SysV semaphores for managing access to the
100         shared memory - in return for the ludicrous api we get
101         synchronisation primitives that can be cleaned up by the kernel
102         even when a process quits unexpectedly.  This removes the
103         timestamp issues.
104
105 2005-05-05  Lluis Sanchez Gual  <lluis@novell.com>
106
107         * handles.c: Always use polling in the waits, since
108         mono_cond_timedwait can't be interruped by the thread abort signal.
109
110 2005-04-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
111
112         * events.c: calling Set on AutoResetEvent several times has the same
113         effect as calling it only once if no thread is waiting for it.
114
115 2005-04-29  Dick Porter  <dick@ximian.com>
116
117         * processes.c (EnumProcesses): Use a GArray instead of a GPtrArray
118         now it's storing pids not handles, also fixes memory leak caused
119         by unclear glib documentation.
120
121         * sockets.c (WSACleanup): Remove unused variable
122
123 2005-04-29  Dick Porter  <dick@ximian.com>
124
125         * handles.c (_wapi_handle_check_share_by_pid): For systems that
126         don't have file descriptor info in /proc check that the original
127         opener of a file is still there, if a share violation would
128         otherwise happen.
129
130 2005-04-28 Gonzalo Paniagua Javier <gonzalo@ximian.com>
131
132         * handles.c:
133         * handles-private.h: added _wapi_handle_forecch that loops through all
134         the handles and call a callback function when a handle of the given
135         type is found.
136
137         * sockets.c: no need to keep open sockets in an array, as we have them 
138         in the handles structure.
139
140         Fixes bug #74755.
141
142 2005-04-28  Dick Porter  <dick@ximian.com>
143
144         * processes.c: Cope with handles that are only around for as long
145         as the search is running.  If we're searching for process handles,
146         check to see if the process is still running and signal it if not.
147
148         * handles.c (_wapi_search_handle): Search in the shared space as
149         well.  Fixed bug 74752.
150
151         * mutexes.c:
152         * handles.c (_wapi_handle_new_from_offset):
153         _wapi_handle_new_for_existing_ns () was doing exactly the same as
154         this, so deleted it.
155
156 2005-04-26  Dick Porter  <dick@ximian.com>
157
158         * handles.c: Fix stupid thinko where if a new shared handle is
159         created but a collection was needed to free some space, it
160         returned an error anyway.  Should fix the messages shown in bug
161         74659.
162
163 2005-04-25  Dick Porter  <dick@ximian.com>
164
165         * handles.c (_wapi_handle_check_share): Only consider mono
166         processes when looking to see if a file is still being held open,
167         while checking share permissions.
168
169 2005-04-25  Dick Porter  <dick@ximian.com>
170
171         * sockets.c: 
172         * io.c: 
173         * wapi-private.h (struct _WapiHandleOps): 
174         * handles.c (_wapi_handle_unref): When destroying handles, save
175         the handle data and call the close function only after the array
176         slot has been cleared.  This prevents race conditions with file
177         descriptors, fixing bug 74713.
178
179         * mutexes.c: Delete the handle close functions, they didn't do
180         anything anyway
181
182         * error.c (_wapi_get_win32_file_error): Add a mapping for EINTR so
183         the "Unknown error" g_warning doesn't get displayed.
184
185 2005-04-25  Dick Porter  <dick@ximian.com>
186
187         * wapi-private.h: 
188         * threads.c: Make thread handles process-private for now to take
189         some of the space pressure off the shared memory, while I work on
190         a real fix.
191
192 2005-04-21  Dick Porter  <dick@ximian.com>
193
194         * handles.c (_wapi_handle_check_share): Make sure there is a "fd"
195         dir in /proc before blowing away handle info.  Fixes bug 74649.
196
197 2005-04-21  Dick Porter  <dick@ximian.com>
198
199         * wait.c (WaitForMultipleObjectsEx): Implement special waits
200
201         * handles.c (_wapi_handle_wait_signal_poll_share): Don't return a
202         timeout, just wait briefly for the private signals and let the
203         waiting thread test again.  This prevents us missing shared
204         signals.
205
206 2005-04-21  Dick Porter  <dick@ximian.com>
207
208         * collection.h (_WAPI_HANDLE_COLLECTION_EXPIRED_INTERVAL): Reduce
209         the time before a slot is considered too old and deleted.  This is
210         a workaround while I come up with a proper fix.
211
212 2005-04-21  Dick Porter  <dick@ximian.com>
213
214         * mutexes.c: 
215         * processes.c: 
216         * threads.c: 
217         * handles.c (_wapi_handle_new): Turn assertions into errors.
218
219         * collection.c (_wapi_handle_collect): Use symbols not magic
220         numbers for timeout values
221
222 2005-04-19  Dick Porter  <dick@ximian.com>
223
224         * mutexes.c: 
225         * wait.c: 
226         * handles.c (_wapi_handle_count_signalled_handles)
227         * handles-private.h (_wapi_handle_shared_lock_handle): Use new
228         shared handle locks in critical sections.
229
230         * handles.c (_wapi_handle_new_for_existing_ns): Reuse old handles
231         if there is already one there.
232         
233         * handles.c (_wapi_handle_ref): It was possible for a process to
234         exit before getting around to updating shared handle timestamps,
235         so do it here too.
236
237 Tue Apr 19 16:25:47 CEST 2005 Paolo Molaro <lupus@ximian.com>
238
239         * threads.c: fix lookup of the thread id in the has table:
240         always use the id value, not the pointer to the id.
241
242 2005-04-18 Gonzalo Paniagua Javier <gonzalo@ximian.com>
243
244         * handles.c: fix handle returned in _wapi_handle_search_handle. Dick
245         pointed it out.
246
247 2005-04-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
248
249         * io-layer/sockets.c: FIONBIO with a TRUE argument means we want
250         non-blocking IO, not the other way around.
251
252 2005-04-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
253
254         * handles.c:
255         * io.c:
256         * handles-private.h: GetFileType wasn't checking if we have memory
257         allocated for the handle before dereferencing it. Fixes a FileStream
258         nunit test.
259
260 2005-04-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
261
262         * handles.c:
263         * processes.c:
264         * handles-private.h: we were calling g_renew to expand the handle array,
265         but that might move the memory and we might have pthread conditions or
266         mutexes in the original memory area that are being used. Now instead of
267         expanding an existing array, we just create new ones and keep a list of
268         them. Access to _wapi_private_handles had to be modified accordingly.
269
270 2005-04-15  Dick Porter  <dick@ximian.com>
271
272         * collection.c: FreeBSD needs more than PTHREAD_STACK_MIN
273
274 2005-04-14  Raja R Harinath  <rharinath@novell.com>
275
276         * wapi-private.h: Remove reference to 'daemon-private.h'.
277
278 Wed Apr 13 13:12:33 EDT 2005 Paolo Molaro <lupus@ximian.com>
279
280         * atomic.h: applied patch from mass@akuma.org (David Waite)
281         to fix InterlockedExchangeAdd.
282         Fixed a few other functions, including InterlockedCompareExchange()
283         which was miscompiled by gcc with optimizations enabled.
284
285 2005-04-13  Dick Porter  <dick@ximian.com>
286
287         * io.c (share_check): 
288         * handles.c (_wapi_handle_check_share): Refine the file check so
289         that sharing violations within the same process don't cause
290         assertion failures.
291
292 2005-04-13  Dick Porter  <dick@ximian.com>
293
294         * io.c (FindFirstFile): Fix bugs introduced with the merge (bug
295         74586)
296
297 2005-04-12  Dick Porter  <dick@ximian.com>
298         
299         The daemon-less io-layer.  Extensive lowlevel changes in
300         handles.c, requiring some corresponding changes in other files
301         calling these functions.  Private_foo structures have been
302         eliminated.
303
304         File descriptor handling differences account for most of the
305         changes in io.c and sockets.c.
306
307         Other highlights:
308         
309         * mutexes.c: Named mutexes are now a distinct type.
310         * atomic.h: Fix a PPC uninitialised variable warning.
311         * wait.c: Check conditions before waiting on a condition variable.
312         * processes.c: Handle process fork and wait without a daemon
313         (though this has the limitation of only being able to wait for
314         child processes.)
315
316 2005-04-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
317
318         * io-private.h:
319         * threads.c:
320         * threads.h:
321         * io.c:
322         * sockets.c:
323         * sockets.h: removed dead code that deals with async IO.
324
325 2005-03-30  Zoltan Varga  <vargaz@freemail.hu>
326
327         * atomic.c (InterlockedIncrement): Fix fallback implementation of
328         InterlockedIncrement and InterlockedDecrement. Fixes #74228.
329
330 2005-03-29  Sebastien Pouliot  <sebastien@ximian.com>
331
332         * io-layer.h: Add required header files for compiling with VS.NET.
333
334 2005-03-17 Miguel de Icaza <miguel@novell.com>
335
336         * io.c: don't fail on NFS when there are no more locks available.
337
338 2005-03-09  Dick Porter  <dick@ximian.com>
339
340         * error.c (_wapi_get_win32_file_error): ENFILE and EMFILE should
341         map to ERROR_TOO_MANY_OPEN_FILES, not ERROR_NO_MORE_FILES.  Fixes
342         bug 72671.
343
344 2005-03-09  Dick Porter  <dick@ximian.com>
345
346         * daemon.c (process_process_fork): Initialise the handle data
347         before using it in the error case.  This is probably the error
348         we're working around in the previous change.  Spotted by Taru Jain
349         <tjain@novell.com> and Hemanth Yamijala <YHemanth@novell.com>.
350
351 2005-03-07  Dick Porter  <dick@ximian.com>
352
353         * daemon.c: It looks like g_shell_parse_argv() can return
354         argv[0]=NULL somehow, yet still not give an error.  Make sure we
355         don't pass NULL to strrchr(), working around a segfault that
356         showed up on ZLM testing.
357
358 2005-03-01 Gonzalo Paniagua Javier <gonzalo@ximian.com>
359
360         * sockets.c: translate EINPROGRESS to EWOULDBLOCK in connect. This is
361         the expected error code showed by the test case in bug #73053.
362
363 2005-02-18 Gonzalo Paniagua Javier <gonzalo@ximian.com>
364
365         * io.c: another leftover.
366
367 Fri Feb 18 17:37:29 CET 2005 Paolo Molaro <lupus@ximian.com>
368
369         * io.c: fixed logic in checking errno in rev 40815.
370
371 Fri Feb 18 16:00:29 CET 2005 Paolo Molaro <lupus@ximian.com>
372
373         * threads.c: we don't depend on the GC checking tls
374         slots anymore.
375         * processes.c: remove unused ref to GC headers.
376
377 Thu Feb 17 19:57:11 CET 2005 Paolo Molaro <lupus@ximian.com>
378
379         * io.c: remove _wapi_thread_cur_apc_pending () checks
380         when the siscall should return immediatly and handle
381         the case when a syscall is interrupted without
382         erroring out, but returning a 0 read/write if possible.
383         Still the cases of read from file need to be handled.
384
385 Tue Feb 8 18:28:11 CET 2005 Paolo Molaro <lupus@ximian.com>
386
387         * threads.c: make people test with 1 MB stack per thread.
388
389 2005-01-17  Dick Porter  <dick@ximian.com>
390
391         * timefuncs.h: Make WapiFileTime endian-aware, as it's often
392         cast to and from 64bit ints.  Fixes bug 71213.
393
394 2005-01-11  Dick Porter  <dick@ximian.com>
395
396         * error.c (errno_to_WSA): Add EADDRNOTAVAIL error code
397         translation.
398
399 Mon Jan 10 16:15:19 EST 2005 Neale Ferguson <nealeferguson@earthlink.net>
400
401         * atomic.h: Fix functions on s390.
402
403 Mon Jan 10 20:30:19 CET 2005 Paolo Molaro <lupus@ximian.com>
404
405         * atomic.h: fix some functions on ppc (tests/interlocked.cs).
406
407 2005-01-10  Dick Porter  <dick@ximian.com>
408
409         * misc.c (_wapi_calc_timeout): Guard against overflow when
410         calculating timeouts.  This makes waiting with a large
411         (Int32.MaxValue) timeout not return immediately.
412
413 2004-12-23  Ben Maurer  <bmaurer@ximian.com>
414
415         * io.c (io_ops): make this `const' so it is shareable (well, only
416         really shareable if it is statically linked...)
417
418 Mon Dec 20 11:58:33 CET 2004 Paolo Molaro <lupus@ximian.com>
419
420         * threads.c, threads.h: add accessor to get the pthread_key_t for
421         a tls id.
422
423 2004-12-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
424
425         * io.c: check for the existence of 'dest' and set ERROR_ALREADY_EXISTS
426         if it exists and is not the same as 'src'.
427
428 2004-12-01 Neale Ferguson <Neale.Ferguson@SoftwareAG-usa.com>
429
430         * atomic.h : Fix InterlockedCompareExchange for s390/s390x.
431
432 2004-12-01 Gonzalo Paniagua Javier <gonzalo@ximian.com>
433
434         * processes.c: unquote the cmd path, allow for ' or " when quoting and
435         pass the quoted program name to the daemon, otherwise the call to
436         g_shell_unquote in the daemon will break things up.
437
438 2004-10-14  Dick Porter  <dick@ximian.com>
439
440         * sockets.c (_wapi_accept): Revert the previous change.  We now
441         set the accepted socket to have the same blocking status as the
442         listening socket in managed code.  This follows MS behaviour.
443         
444 2004-10-14  Dick Porter  <dick@ximian.com>
445
446         * sockets.c (_wapi_accept): On Darwin, make sure a newly
447         accept()ed socket is blocking.  Fixes bug 67355, patch by
448         grompf@sublimeintervention.com.
449
450 2004-10-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
451
452         * system.c: check the number of online processors instead of the
453         existing ones. Sanitize return value if it's an error.
454
455 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
456
457         * system.c: Add support for getting the # of cpus.
458
459 2004-09-28  Dick Porter  <dick@ximian.com>
460
461         * io.c (pipe_close_private): Fix one small typo in the last change
462         that totally hosed process creation with redirected pipes.
463
464 2004-09-24  Dick Porter  <dick@ximian.com>
465
466         * wapi-private.h: 
467         * sockets.c: 
468         * socket-private.h: 
469         * io.c: 
470         * io-private.h: 
471         * handles-private.h: Cope when a file descriptor is reused while
472         the handle that thought it owned it is still referenced, instead
473         of asserting.  Probably fixes bug 66479, though we've been unable
474         to reproduce it.
475
476 2004-09-09  Dick Porter  <dick@ximian.com>
477
478         * error.c:
479         * io.c: Set error codes everywhere.
480
481 2004-09-06  Dick Porter  <dick@ximian.com>
482
483         * handles.c (_wapi_handle_unref): Reset the private record's type
484         (CloseHandle): Check for a fd mapping failure, and return FALSE.
485         (_wapi_handle_process_fork): Fix long-standing bug in checking
486         handle return values.  Also do the required bookkeeping with the
487         new process's handles.
488
489         * daemon.c: When creating a new process's handles, check whether
490         the shared space needs to be increased
491
492 2004-09-05  Zoltan Varga  <vargaz@freemail.hu>
493
494         * shared.c (_wapi_shm_file): Fix leaking of filename.
495
496 2004-08-19  Dick Porter  <dick@ximian.com>
497
498         * handles.c (_wapi_handle_count_signalled_handles): Fix thinko
499         introduced with the fd offset stuff: unlock handles properly when
500         backing off.  Fixes the monologue hang at exit.
501
502 2004-08-18  Dick Porter  <dick@ximian.com>
503
504         * sockets.c: 
505         * io.c: Check that new fds fit in the table, return error if not
506
507         * daemon.c (_wapi_daemon_main): 
508         * handles.c (shared_init): Have all processes agree on a size for
509         the fd table.
510
511 2004-08-17  Dick Porter  <dick@ximian.com>
512
513         * daemon.c (process_new): 
514         * handles.c (_wapi_handle_new_internal): Cope when the space
515         reserved for file descriptors is larger than the shared segment
516         size.  Fixes the crash reported when running mono under gdb on
517         macosx.
518
519 2004-08-16  Dick Porter  <dick@ximian.com>
520
521         * sockets.c:
522         * io.c:
523         * handles-private.h (_wapi_handle_fd_offset_to_handle): Improve
524         error checking with passed-in file descriptors.
525
526 2004-08-11  Dick Porter  <dick@ximian.com>
527
528         * sockets.c: 
529         * io.c: Returned handle values are the file descriptor the handle
530         encapsulates
531
532         * handles.c: 
533         * handles-private.h: 
534         * daemon.c: Reserve the range of handles that can have the same
535         values as file descriptors.  These won't be used, but the values
536         will be used as file, console, pipe or socket handles.  The fd to
537         handle mapping is done internally and is invisible to users.
538         Fixes bug 61828.
539
540         * wapi-private.h (_WAPI_HANDLE_VERSION): Increment, because we now
541         reserve a chunk of handle space.
542
543 2004-08-04  Neale Ferguson <Neale.Ferguson@SoftwareAG-usa.com>
544
545         * atomic.h: add support for 64-bit S/390
546
547 2004-07-22  Dick Porter  <dick@ximian.com>
548
549         * timed-thread.c: 
550         * threads.c: Move the destruction of the internal thread data to
551         after the thread has been joined.  Fixes bug 61418.
552
553 2004-07-14  Dick Porter  <dick@ximian.com>
554
555         * wait.c (test_and_own): When not waiting for all handles to
556         become signalled, only own and return the lowest.  All the
557         documentation suggests that the old way was correct, but
558         experimentation shows it actually works like this.  Patch by
559         Sébastien Robitaille
560         (sebastien.robitaille@croesus.com), fixes bug 61511.
561
562 2004-07-09  Ben Maurer  <bmaurer@ximian.com>
563
564         * threads.c: register roots for gc
565
566 2004-07-08  Dick Porter  <dick@ximian.com>
567
568         * io.c (file_seek): If there is a high 32bit offset part, make
569         sure the low part isn't sign-extended.  Set error codes when
570         returning failure.  Fixes bug 61131.
571
572 2004-07-06  Dick Porter  <dick@ximian.com>
573
574         * io.c (file_setfiletime): Check for underflow when converting to
575         time_t values.  Set error codes when returning failure.  Fixes bug
576         60970.
577
578 2004-07-05  Dick Porter  <dick@ximian.com>
579
580         * mutexes.c (mutex_ops_init): Make the named mutex mutex sharable.
581
582         * daemon.c (unref_handle): Only destroy a handle if all processes
583         have released it, not just the current one.  Fixes bug 60887.
584
585 2004-06-30  Zoltan Varga  <vargaz@freemail.hu>
586
587         * mono-mutex.h atomic.h: Add G_GNUC_UNUSED to static inline functions
588         to prevent warnings.
589
590 2004-06-24  Dick Porter  <dick@ximian.com>
591
592         * mutexes.c: Indicate when a named mutex was reused
593
594 2004-06-24  Dick Porter  <dick@ximian.com>
595
596         * threads.c (SuspendThread): 
597         * timed-thread.c (_wapi_timed_thread_suspend): Wrap sem_wait in a
598         while loop.  See bug 58161.
599
600 Wed Jun 23 23:29:04 CEST 2004 Paolo Molaro <lupus@ximian.com>
601
602         * io.c: don't use sharemode for on-disk file permissions: it's used
603         for shared access to the open file.
604
605 2004-06-22  Dick Porter  <dick@ximian.com>
606
607         * events.c (CreateEvent): When creating an auto-reset event that
608         is initially owned, make sure the set count starts at 1.
609
610 2004-06-18  Dick Porter  <dick@ximian.com>
611
612         * event-private.h:
613         * events.c: Auto-reset events need to release one thread for each
614         time SetEvent() is called.  Fixes bug 41292.
615
616         * threads.h:
617         * mutex-private.h:
618         * mutexes.c: Scan for mutexes that are still locked by a thread
619         when it exits.  Fixes the MS demo app linked by bug 41292.
620
621         * wait.c (test_and_own): Make sure a handle is signalled before it
622         is owned.
623
624 2004-06-16  Dick Porter  <dick@ximian.com>
625
626         * timed-thread.c: Call the thread cleanup exit routine before taking
627         the join mutex, because this could deadlock if another thread tries
628         to join in the meantime.  This fixes the hang-at-exit problem seen
629         on macos.
630
631 2004-06-03  Lluis Sanchez Gual  <lluis@ximian.com>
632
633         * threads.c: Implemented SleepEx.
634         * threads.h: Fixed SleepEx signature.
635
636 2004-06-03  Miguel de Icaza  <miguel@ximian.com>
637
638         * threads.c: When running under valgrind, do not allocate too much
639         stack, as Valgrind default is 1 meg.
640
641 2004-05-27  Dick Porter  <dick@ximian.com>
642
643         * io.h:
644         * io.c: Implemented LockFile() and UnlockFile()
645
646 2004-05-21  Dick Porter  <dick@ximian.com>
647
648         * io.c (CreateFile): Check for existing share modes when opening
649         a file.
650
651         * handles.c: 
652         * handles-private.h: 
653         * daemon-messages.h: 
654         * daemon.c: Maintain a hash of file share modes, keying on device
655         and inode (to cope with symlinks.)
656
657 2004-05-20  Lluis Sanchez Gual  <lluis@ximian.com>
658
659         * daemon-messages.c: Retry if the communication with the daemon is
660           interrupted by a signal.
661         * io.c, sockets.c: Check for EINTR in every syscall that can be interrumped. 
662           Only return an error in this case if there is something in the apc queue
663           (which means that it is an interruption requested by the "user").
664         * processes.c: Use WaitForSingleObjectEx. No need to pass "alertable" as
665           true since the wait is small.
666         * shared.c: Retry write calls when interrumped by a signal.
667         * timed-thread.h, timed-thread.c: added _wapi_thread_apc_pending, which
668           returns TRUE if there are pending asynchronous calls (APC) for the
669           provided thread. Also added _wapi_thread_dispatch_apc_queue which calls
670           the enqueued APCs. Defined a new struct ApcInfo that holds information
671           about an enqueued APC.
672         * thread-private.h, threads.c: Implemented QueueUserAPC (which does the same
673           as in win32),_wapi_thread_apc_pending and _wapi_thread_dispatch_apc_queue. 
674           These last two methods call the corresponding apc methods in 
675           thread-private using the provided thread handle.
676         * threads.h: Added QueueUserAPC.
677         * uglify.h: Added WapiApcProc (needed by QueueUserAPC).
678         * wait.c, wait.h: Changed WaitForSingleObject to WaitForSingleObjectEx, and
679           WaitForMultipleObjects to WaitForMultipleObjectsEx. Implemented support
680           for APCs in those two methods and also in SleepEx.
681
682 2004-05-17  Dick Porter  <dick@ximian.com>
683
684         * io.c (CopyFile): Speed up.  Fixes bug 57859.
685
686 2004-05-13  Dick Porter  <dick@ximian.com>
687         * mono-mutex.c (mono_mutex_unlock): Return EPERM when the current
688         thread doesn't own the mutex, rather than assert()ing.
689
690 2004-05-11  Dick Porter  <dick@ximian.com>
691
692         * shared.c (_wapi_shm_attach): Cope when a previous daemon startup
693         attempt failed, leaving shared files that look like a daemon is
694         still starting.
695
696 2004-05-10  Gonzalo Paniagua Javier <gonzalo@ximian.com>
697
698         * io.c:
699         (SetFileAttributes): don't the the exec bit if the corresponding read
700         bit is not set.
701
702 2004-05-10  Zoltan Varga  <vargaz@freemail.hu>
703
704         * io.c (FindFirstFile): Fix invalid free.
705
706 2004-05-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
707
708         * io.c: translate from GFileError to errno codes and don't free
709         variables right after calling mono_io_scandir, as we may overwrite
710         errno value.
711
712 2004-05-08  Gonzalo Paniagua Javier <gonzalo@ximian.com>
713
714         * io.c: g_dir_open return ENOENT for directories on which we don't have
715         read/execute permission, while returning EPERM for anything below those.
716         So, change ENOENT by EPERM if the directory exists.
717
718 2004-05-07  Dick Porter  <dick@ximian.com>
719
720         * io.c (SetFileAttributes): Don't have failed chmod()s cause a
721         "file not found" error.  Fixes bug 54032.
722         
723 2004-05-07  Dick Porter  <dick@ximian.com>
724
725         * io.c (FindFirstFile): Comment out a windows-compatibility check
726         that breaks when directories have metachars in their names.
727         Workaround for bug 58116.
728
729 2004-05-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
730
731         * io.c: fixed for FindFirstFile for empty directories. Closes
732         bug #58147.
733
734 2004-05-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
735
736         * processes.c: set the start time for the current process. Fixes bug
737         #58109.
738
739 2004-05-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
740
741         * io-private.h: 'namelist' is now a gchar ** in _WapiHandlePrivate_find.
742         * io.c: implemented scandir using glib functions.
743
744 2004-05-04  Dick Porter  <dick@ximian.com>
745
746         * daemon.c (read_message): Return FALSE on error so the GSource
747         callback itself can return FALSE.  Cures the infinite loop poll()
748         warning on MacosX.
749         * shared.c: Fix some daemon startup race conditions.
750
751 2004-04-29  Miguel de Icaza  <miguel@ximian.com>
752
753         * io.c (CopyFile): Use 32k buffers to copy the file instead of 2k,
754         use the stack, do not use dynamic memory.
755
756 2004-04-29  Zoltan Varga  <vargaz@freemail.hu>
757
758         * io.c: Add scandir implementation for platforms which do not have
759         it, like solaris.
760
761 2004-04-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
762
763         * io.[ch]: implemented GetLogicalDriveStrings.
764
765 2004-04-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
766
767         * io.c:
768         * sockets.c: use the field name from configure when accessing sigval
769         pointer field. Makes this work on the Mac.
770
771 2004-04-28  Bernie Solomon  <bernard@ugsolutions.com>
772
773         * atomic.c: (InterlockedExchange) fix typo for
774         mutex name
775
776 2004-04-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
777
778         * io.c:
779         * sockets.c: added check for sys/aio.h.
780
781 2004-04-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
782
783         * error.[ch]: added _wapi_get_win32_file_error...
784         * io.c: ... which was _wapi_get_win32_error here.
785         * sockets.c: rename the function calls here too.
786
787 2004-04-28  Dick Porter  <dick@ximian.com>
788
789         * daemon-messages.c: Avoid a deadlock when a thread is killed while
790         waiting for the daemon by using a recursive mutex.  Helps bug 56699.
791
792 2004-04-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
793
794         * io.c: fixed leak in async_notifier().
795
796         * sockets.[ch]: added AIO support for sockets and fixed WSAIoctl
797         declaration.
798
799         * threads.c: removed old comment.
800
801 2004-04-26  David Waite  <mass@akuma.org>
802
803         * daemon-messages.h:
804         * daemon-private.h
805         * error.h:
806         * io.h:
807         * processes.h:
808         * shared.h:
809         * thread-private.h:
810         * wapi-private.h: remove comma from end of enumeration declarations
811         * status.h: cast unsigned int types to int for enum assignment
812
813 2004-04-26 David Waite <mass@akuma.org>
814
815         * io.c:
816         * timefuncs.c: declare 64-bit constants as long long types (i.e.
817         10ULL)
818
819 2004-04-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
820
821         * socket-wrappers.h: _wapi_socket == WSASocket now. Added
822         WSA_FLAG_OVERLAPPED.
823
824         * sockets.c: new unused parameters for _wapi_socket.
825
826 2004-04-22  Miguel de Icaza  <miguel@ximian.com>
827
828         * timed-thread.c: Replace sem_init with MONO_SEM_INIT to handle
829         the fact that MacOS X is a piece of junk (sem_init is *defined* in
830         the libc, but they return `not implemented'). 
831
832 2004-04-22  Dick Porter  <dick@ximian.com>
833
834         * handles.c: 
835         * handles-private.h: Reference the handle when it is locked, so
836         that another thread can't blow it away while we're waiting for it
837         to become signalled.
838         
839         * wait.c: 
840         * timed-thread.c: 
841         * threads.c: 
842         * sockets.c: 
843         * semaphores.c: 
844         * mutexes.c: 
845         * mono-mutex.c: 
846         * io.c: 
847         * handles.c: 
848         * handles-private.h: 
849         * events.c: 
850         * error.c: 
851         * daemon-messages.c: 
852         * critical-sections.c: 
853         * atomic.c: Added pthreads cleanup handlers and error asserts
854
855         * shared.c: 
856         * handles.c: Fixed the gcc "variable might be used uninitialised"
857         warnings.  They can't happen, but gcc doesn't know that
858         g_assert()s don't return.
859
860         Fixed the declaration of _wapi_handle_process_kill() so that it
861         expects the correct type for the pid.
862         
863         * threads.c: Removed the TLS_PTHREAD_MUTEX style locking that
864         hasn't been used in ages and just made the code more complex.
865
866 2004-04-17  Zoltan Varga  <vargaz@freemail.hu>
867
868         * processes.c: Include <signal.h> for SIGKILL and SIGILL + fix some
869         warnings. Fixes #57168.
870
871 2004-04-16  Dick Porter  <dick@ximian.com>
872
873         * threads.c (Sleep): Using div(3) with a negative (when signed)
874         numerator causes the quotient to be 0 and the remainder to be the
875         numerator.  This feeds a small negative value to nanosleep(3),
876         which will return immediately and cause a busy wait.  Fixes bug
877         56351.
878
879 2004-04-15  Dick Porter  <dick@ximian.com>
880
881         * io-private.h:
882         * io.c: Rewrite FindFirstFile and FindNextFile using scandir(3)
883         and fnmatch(3) instead of glob(3).  glob() can't cope with being
884         given filenames containing metachars.  This fixes bug 40557.
885
886 2004-04-14  Bernie Solomon  <bernard@ugsolutions.com>
887
888         * security.c: #warning is a GCC-ism
889
890 2004-04-13  Sebastien Pouliot  <sebastien@ximian.com>
891
892         * security.c: Removed GetUserName as glib g_get_user_name does a
893         better (portability) job. Added ImpersonateLoggedOnUser and
894         RevertToSelf.
895
896 2004-04-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
897
898         * mono-mutex.h: move pthread_mutex_timedlock declaration to...
899         * mono-mutex.c: ...here. It was causing a warning that prevented
900         libgdiplus compilation.
901
902 2004-04-04  Miguel de Icaza  <miguel@ximian.com>
903
904         * security.c (GetUserName): Make it work on MacOS X
905
906 2004-04-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
907
908         * security.c: use getpwuid_r if available. This one is thread-safe.
909
910 2004-04-02  Sebastien Pouliot  <sebastien@ximian.com>
911
912         * Makefile.am: Added security.c|h.
913         * security.c: New file for security related functions. Added function
914         GetUserName to fix #56144.
915         * security.h: New. Header file for security.c
916         * wapi.h: Added include for security.h
917
918 2004-03-25  Gonzalo Paniagua Javier <gonzalo@ximian.com>
919
920         * daemon-messages.h: added kill structs.
921
922         * daemon.c: implemented process_process_kill.
923         * handles-private.h:  define process_process_kill.
924         * handles.c: implemented _wapi_handle_process_kill.
925         * processes.[ch]: implemented TerminateProcess.
926
927 2004-03-25  Bernie Solomon  <bernard@ugsolutions.com>
928
929         * daemon.c (rem_fd): On solaris you seem to get an
930         error even after removing the input source so don't
931         try and rem_fd it twice.
932
933 2004-03-25  Lluis Sanchez Gual  <lluis@ximian.com>
934
935         * daemon.c: in process_post_mortem, If the child terminated due to the 
936         receipt of a signal, the exit status must be based on WTERMSIG, since 
937         WEXITSTATUS returns 0 in this case.
938
939 2004-03-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
940
941         * daemon.c: turned a warning into a DEBUG statement. Now we may hit it.
942
943 2004-03-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
944
945         * daemon.c: only call getdtablesize () once.
946         * processes.c: wait 500 ms to check if execve failed and throw the same
947         exception as MS on failure. Fixes bug #32809.
948
949 2004-03-17  Bernie Solomon  <bernard@ugsolutions.com>
950
951         * io.c (async_notifier): use "union sigval" rather
952         than sigval_t as Solaris doesn't have sigval_t
953         (which isn't in IEEE 1003.1 either).
954
955 2004-03-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
956
957         * io.c: added debug stuff and removed a few redundant lines in
958         file_write.
959
960 2004-03-15  Gonzalo Paniagua Javier <gonzalo@ximian.com>
961
962         * io-private.h: added new fields for file structure. Declare
963         _wapi_io_add_callback.
964
965         * io.c: added _wapi_get_win32_error, support aio_read/write in
966         file_read/write. Implemented _wapi_io_add_callback, which is where
967         BindHandle ends up.
968         
969         * io.h: added new fields for WapiOverlapped and typedef for the
970         callback.
971
972         * processes.c: fixed off-by-one bug when handling environment variables 
973         passed in.
974
975         * threads.[ch]: implemented BindIoCompletionCallback.
976
977         * uglify.h: added typedef for LPOVERLAPPED_COMPLETION_ROUTINE.
978
979 2004-03-14  Zoltan Varga  <vargaz@freemail.hu>
980
981         * socket-wrappers.h: Remove extra semicolon.
982
983 2004-03-03  Dave Camp  <dave@ximian.com>
984
985         * daemon.c: (add_fd), (fd_activity), (_wapi_daemon_main):
986         Use a new main context.
987
988 2004-03-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
989
990         * io.c:
991         (GetFileAttributes): set the error depending on errno instead of
992         setting ERROR_FILE_NOT_FOUND always. See bug #55160.
993
994 2004-03-01  Gonzalo Paniagua Javier <gonzalo@ximian.com>
995
996         * io.c:
997         (CopyFile): free the buffer on error.
998         * sockets.c:
999         (WSAIoctl): free the buffer on error.
1000
1001 2004-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
1002
1003         * error.c: fixed mapping for EPROTONOSUPPORT and ESOCKTNOSUPPORT.
1004
1005         * sockets.[ch]: retry creating the socket for AF_INET, SOCK_RAW
1006         using IP protocol with IP over IP. Implemented WSAIoctl UNIX-style.
1007
1008 2004-01-27  Bernie Solomon  <bernard@ugsolutions.com>
1009
1010         * shared.c (_wapi_shm_file): add hostname
1011         to shared data file names to handle NFS mounted
1012         .wapi directories.
1013
1014 Mon Jan 26 16:15:03 CET 2004 Paolo Molaro <lupus@ximian.com>
1015
1016         * sockets.h: remove obsolete soklen_t typedef.
1017
1018 Fri Jan 23 21:07:02 CET 2004 Paolo Molaro <lupus@ximian.com>
1019
1020         * socket-wrappers.h, sockets.h, sockets.c, Makefile.am: move socket
1021         wrappers to its own non-installed header file.
1022
1023 2004-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
1024
1025         * io.c:
1026         (FindFirstFile): unlock the handle if FindNextFile fails.
1027         (FindNextFile): g_free a couple of pointers before retrying.
1028
1029         * wait.c:
1030         (WaitForMultipleObjects): if only one handle provided, use
1031         WaitForSingleObject.
1032
1033 2003-12-22  Bernie Solomon  <bernard@ugsolutions.com>
1034
1035         * handles-private.h: (_wapi_handle_type) check
1036         for segment in range before using it
1037
1038 2003-12-22  Bernie Solomon  <bernard@ugsolutions.com>
1039
1040         * thread-private.h: _wapi_thread_ops is now const
1041         must match .c file.
1042
1043 Mon Dec 22 18:29:03 CET 2003 Paolo Molaro <lupus@ximian.com>
1044
1045         * threads.c, timed-thread.c, timed-thread.h: use mach
1046         semaphores on Darwin (MacOSX) since the posix ones
1047         are mostly broken there (threads are not created suspended
1048         and they can start executing before they are fully initialized
1049         like in tests/thread-static.cs).
1050
1051 Mon Dec 22 17:18:45 CET 2003 Paolo Molaro <lupus@ximian.com>
1052
1053         * atomic.h: ppc fixes.
1054
1055 2003-12-19  Bernie Solomon  <bernard@ugsolutions.com>
1056
1057         * handles.c: remove my bad use of MONO_ZERO_ARRAY_LENGTH
1058         in HDRSIZE 
1059
1060 2003-12-15  Bernie Solomon  <bernard@ugsolutions.com>
1061
1062         * shared.c: (_wapi_shm_open) make scratch file
1063         not have to immediately regrow to avoid remaps
1064         (HPUX can't cope with these).
1065         (_wapi_shm_attach) use actual size of file
1066         to set scratch data_len for the creating process.
1067
1068         * handles.c: (_wapi_handle_new_internal) make
1069         sure mutex & cond var are initialized even for
1070         non process shared ones. 
1071         (_wapi_handle_unref) always call destroy 
1072         routines on mutex & cond var
1073
1074 2003-12-15  Bernie Solomon  <bernard@ugsolutions.com>
1075
1076         * daemon.c: change channel data structure so
1077         input sources are removed from glib event loop
1078         properly. xsp works better on Solaris and 
1079         fixes #51278
1080
1081 2003-12-12  Bernie Solomon  <bernard@ugsolutions.com>
1082
1083         * wapi-private.h: Replace G_GNUC_PRETTY_FUNCTION
1084         definition with file & line number for non-GCC
1085         compiles.
1086
1087 2003-12-08  Bernie Solomon  <bernard@ugsolutions.com>
1088
1089         * Makefile.am: make sure hppa_atomic.s is in distribution
1090
1091 2003-12-01  Dick Porter  <dick@ximian.com>
1092
1093         * wapi-private.h: 
1094         * mutexes.c (CreateMutex): 
1095         * mutex-private.h (struct _WapiHandle_mutex): 
1096         * handles.c: Look up certain handle types by name, in a shared
1097         namespace.  Currently only mutex handles have this implemented.
1098         Fixes bug 51089.
1099
1100         * semaphores.c (CreateSemaphore): 
1101         * events.c (CreateEvent): Fix signature
1102
1103 2003-11-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
1104
1105         * io.c: don't call g_free before testing errno as it may modify it.
1106         If the path exists, return an error if it's not a directory. Fixes
1107         bug #50753.
1108
1109 2003-11-20  Dick Porter  <dick@ximian.com>
1110
1111         * io.c: Missed a little-endian UTF16 conversion.  Patch from
1112         Jeroen Zwartepoorte (Jeroen@xs4all.nl), fixes bug 51065.
1113
1114 2003-10-29  Dick Porter  <dick@ximian.com>
1115
1116         * io.c (MoveFile): If the move crosses filesystems, try and fall
1117         back to copy and delete.  Patch from Jörg Rosenkranz
1118         (JoergR@voelcker.com), fixes bug 50298.
1119
1120 2003-10-28  Dick Porter  <dick@ximian.com>
1121
1122         * io.c: Use the new encoding conversion to cope with non-utf8
1123         locales in filenames.
1124
1125         * processes.c: Ditto for process arguments.
1126
1127 Tue Oct 21 12:01:14 CEST 2003 Paolo Molaro <lupus@ximian.com>
1128
1129         * atomic.h: some ppc inline asm fixes (incorrect use of labels, 
1130         incorrect register constraints, incorrect clobber lists).
1131
1132 2003-10-13  Bernie Solomon  <bernard@ugsolutions.com>
1133
1134         * Makefile.am hppa_atomic.s: add HP 64bit
1135         implementation of atomic ops
1136
1137 2003-10-13  Zoltan Varga  <vargaz@freemail.hu>
1138
1139         * threads.c (CreateThread): Wrap pthread_attr_setstacksize call in
1140         a conditional for platforms that don't have it.
1141
1142 2003-10-09  Bernie Solomon  <bernard@ugsolutions.com>
1143
1144         * threads.c: (CreateThread) use stacksize argument
1145         if non-zero - change default for 64 bits to 4Mb
1146
1147 2003-09-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
1148
1149         * sockets.c: set last error when socket creation fails. This shed some
1150         light on bug #49015.
1151
1152 2003-09-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
1153
1154         * processes.c: fixed bug #48973: we only change \ by / for the argument
1155         to be used as command.
1156         When getting the program name from the args, don't let the space between
1157         them in the args.
1158
1159 2003-09-24  Bernie Solomon <bernard@ugsolutions.com>
1160
1161         * atomic.h atomic.c: fix sparc so lock is
1162         global, increment does so and it compiles under Sun compiler.
1163
1164 2003-09-22  Bernie Solomon <bernard@ugsolutions.com>
1165
1166         * handles.c: include <string.h> directly as may
1167         not be nested in <sys/un.h> like Linux
1168
1169 2003-09-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
1170
1171         * io.c:
1172         (DeleteFile): call SetLastError on failure. Fix by
1173         richard.torkar@htu.se (Richard Torkar). Closes bug #48222.
1174
1175 2003-09-15  Lluis Sanchez Gual  <lluis@ximian.com>
1176
1177         * daemon.c: In compare_process(), discard handles already signalled.
1178
1179 2003-09-02  Dick Porter  <dick@ximian.com>
1180
1181         * io.c: Work around glib brain-dead assumptions about utf8-encoded
1182         filenames.  Fixes bug 30781.
1183
1184 2003-08-28  Dick Porter  <dick@ximian.com>
1185
1186         * critical-sections.c:  Patch from Bernie Solomon
1187         <bernard@ugsolutions.com> to emit a warning if locking a critical
1188         section fails.
1189
1190 2003-07-23  Dick Porter  <dick@ximian.com>
1191
1192         * shared.c:
1193         * daemon.c (maybe_exit): Avoid the race condition when the daemon is
1194         closing but another client comes along when the shared data is still
1195         visible.  Should fix bugs 33671 and 35213.
1196
1197 2003-07-23  Dick Porter  <dick@ximian.com>
1198
1199         * handles.c:  Initialise handle mutex and cond.  Fix by
1200         Bernie Solomon <bernard@ugsolutions.com>
1201
1202 2003-07-15  Dick Porter  <dick@ximian.com>
1203
1204         * timed-thread.c (timed_thread_start_routine): Fix virtual memory
1205         leak when threads quit.  Fixes bug 44067.
1206
1207 Wed Jun 18 19:08:40 CEST 2003 Paolo Molaro <lupus@ximian.com>
1208
1209         * io.c: never add write permission for group or others in
1210         SetFileAttributes ().
1211
1212 2003-06-17  Dick Porter  <dick@ximian.com>
1213
1214         * io.c (SetFileAttributes): Implement the ReadOnly attribute, and
1215         ignore the unsupported ones ("fixes" bug 44977).
1216
1217 2003-06-17  Lluis Sanchez Gual  <lluis@ximian.com>
1218
1219         * misc.c: fix bug in _wapi_calc_timeout. It gave wrong values for
1220           high ms values (there was an overflow).
1221
1222 2003-06-17  Zoltan Varga  <vargaz@freemail.hu>
1223
1224         * system.h (struct _WapiSystemInfo ): Fix warnings when using gcc-3.3.
1225
1226 2003-06-11  Dick Porter  <dick@ximian.com>
1227
1228         * shared.c: Fix shared directory creation.  Patch from
1229         Pablo Baena <pbaena@uol.com.ar>
1230
1231 2003-06-10  Dick Porter  <dick@ximian.com>
1232
1233         * atomic.c: Delete the useless compile warning
1234
1235 2003-06-09  Dick Porter  <dick@ximian.com>
1236
1237         * daemon.c: Lookup env as a string array.  Fixes bug 44289.  Also
1238         make setting the process handle value in the environment actually
1239         work.
1240
1241         * processes.c: Pretty up the process name, if it happens to be
1242         "mono" such as when another mono process forks "mono foo.exe"
1243
1244 2003-06-05  Dick Porter  <dick@ximian.com>
1245
1246         * processes.c (process_set_current): Don't do an expensive handle
1247         search at application startup, check the environment to see if the
1248         process handle has already been created.
1249
1250         * io.c: Don't do an expensive handle search when creating stdin,
1251         stdout and stderr handles, just create them all the first time one
1252         is requested.
1253
1254         * wapi-private.h:
1255         * shared.c:
1256         * shared.h:
1257         * handles.c:
1258         * handles-private.h:
1259         * daemon-messages.h:
1260         * daemon-private.h:
1261         * daemon.c: Support for "unlimited" number of handles and scratch
1262         data.
1263
1264         Speed up application startup by passing process handle in the
1265         environment, rather than let the app scan all handles (which gets
1266         really slow when there are more than a few thousand to check.)
1267
1268         Initialise some structs passed to syscalls, noticed by valgrind.
1269         
1270
1271 2003-05-20  Dick Porter  <dick@ximian.com>
1272
1273         * io.c (FindFirstFile): Include . files in the glob.  Fixes bug
1274         43229.
1275
1276 2003-05-19  Dick Porter  <dick@ximian.com>
1277
1278         * threads.c: Set the new thread's stack size to 2M.  Fix needed
1279         for BSD, reported by Martin Dvorak <md@9ll.cz>
1280
1281 2003-05-16  Dick Porter  <dick@ximian.com>
1282
1283         * io.h:
1284         * io.c: Implement GetTempPath()
1285
1286 2003-05-16  Dick Porter  <dick@ximian.com>
1287
1288         * processes.c (CreateProcess): Set some error codes
1289
1290 2003-05-12  Dick Porter  <dick@ximian.com>
1291
1292         * misc.c (_wapi_calc_timeout): Cope with overflowing tv_nsec.
1293         Patch from Martin Dvorak <mdvorak@ninell.cz>.
1294
1295 2003-05-10  Dick Porter  <dick@ximian.com>
1296
1297         * io.c (CopyFile): Copy file mode as well as file data.  Based on
1298         suggestion by Giuseppe Greco <giuseppe.greco@agamura.com>, bug
1299         42706.
1300
1301 2003-05-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
1302
1303         * handles.c: don't call GC_gcollect when creating new handles.
1304
1305 2003-05-05  Gonzalo Paniagua Javier <gonzalo@ximian.com>
1306
1307         * handles.c: added some debugging code. Call GC_gcollect
1308         before creating a new handle. It makes Lupus' test run smoother and
1309         faster (from 62 to 83 request per second). Notice that calling
1310         GC_finalizer_notifier if needed (GC_should_invoke_finalizer ()) does
1311         not improve nor degrade the performance, so i don't do it.
1312
1313 2003-05-02  Dick Porter  <dick@ximian.com>
1314
1315         * sockets.c: Rearrange closesocket() and socket_close_private(),
1316         and remember to unref the handle, so we don't leak socket handles.
1317         Fix from Pelle Johnsen <pelle.johnsen@mail.dk>
1318
1319 2003-04-11  Dick Porter  <dick@ximian.com>
1320
1321         * atomic.h: ARM atomic operations by Malte Hildingson
1322         <tds00mahi@tellus.thn.htu.se>
1323
1324 Tue Apr 8 11:37:29 CEST 2003 Paolo Molaro <lupus@ximian.com>
1325
1326         * atomic.h: fix macosx build by "Urs C. Muff" <umuff@quark.com>.
1327
1328 2003-04-03  Martin Baulig  <martin@ximian.com>
1329
1330         The following change is conditional to `WITH_INCLUDED_LIBGC'
1331         which is not yet enabled by default.
1332
1333         * threads.c (SuspendThread, ResumeThread): Fully implemented this.
1334         (gc_init): New static function; install a signal handler for
1335         SIGPWR which is used to suspend threads.  [FIXME: it SIGPWR
1336         doesn't exist on all Unix systems, we need to find another
1337         signal].
1338         (mono_wapi_push_thread_stack): New public function.  Tells the
1339         garbage collector about the current stack pointer of a suspended
1340         thread.
1341
1342 2003-04-03  Martin Baulig  <martin@ximian.com>
1343
1344         * timed-thread.h (TimedThread): Added `suspended_sem',
1345         `suspend_count' and `stack_ptr'.
1346
1347 2003-03-28  Dick Porter  <dick@ximian.com>
1348
1349         * atomic.h: PPC support gratiously donated to the public domain
1350         by John Duncan <jddst19@mac.com>
1351
1352 2003-03-20  Dick Porter  <dick@ximian.com>
1353
1354         * sockets.c (_wapi_connect): If connect() fails with EACCES, try
1355         setting SO_BROADCAST and connecting again.  Fixes bug 39178.
1356
1357 2003-03-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
1358
1359         * processes.c: included Jerome Laban's patch and call SetLastError when
1360         the executable is not found.
1361
1362 2003-03-03  Dick Porter  <dick@ximian.com>
1363
1364         * io.c (CreateFile): Try opening directories readonly, so that
1365         timestamps can be adjusted.  Patch by Elan Feingold
1366         <efeingold@mn.rr.com>.
1367
1368 2003-02-25  Dick Porter  <dick@ximian.com>
1369
1370         * shared.c (_wapi_shm_attach): Return a failure code on system
1371         call errors, rather than exiting.
1372
1373 2003-02-21  Dick Porter  <dick@ximian.com>
1374
1375         * processes.c (GetCurrentProcessId): Use the current process
1376         handle to return the process ID, as getpid() is unreliable
1377         (linuxthreads gives each thread a different pid).  Fixes bug
1378         37550.
1379
1380 2003-02-21  Dick Porter  <dick@ximian.com>
1381
1382         * io.c (FindNextFile): Skip over dangling symlinks.  Fixes bug
1383         34076.
1384
1385 2003-02-11  Dick Porter  <dick@ximian.com>
1386
1387         * timefuncs.h: 
1388         * timefuncs.c: Added GetTickCount()
1389
1390 2003-02-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
1391
1392         * error.c: added WSA_EHOSTUNREACH mapping.
1393
1394 2003-01-26  Miguel de Icaza  <miguel@ximian.com>
1395
1396         * io.c (SetFileAttributes): This routine is not currently
1397         implemented for the general case, but I added a special case to
1398         set the executable bit on Linux.
1399
1400 Wed Jan 15 15:55:40 CET 2003 Paolo Molaro <lupus@ximian.com>
1401
1402         * sockets.h, daemon.c, io.c: compilation fixes on MacOSX.
1403
1404 2003-01-08  Dick Porter  <dick@ximian.com>
1405
1406         * sockets.c: Fixed setting blocking mode to true (fixes bug 36388)
1407
1408 2002-12-11  Juli Mallett  <jmallett@FreeBSD.org>
1409
1410         * daemon.c, handles-private.h, handles.c, wapi-private.h:
1411         Check for an implementation which says it supports
1412         _POSIX_THREAD_PROCESS_SHARED, rather than just one that
1413         defines the symbol.  Defined but with a value of -1 still
1414         means that it is unsupported.
1415
1416 2002-12-08  Martin Baulig  <martin@ximian.com>
1417
1418         * handles.c (_wapi_handle_new): Create new non-shared handles with
1419         an initial refcount of 1, not 0.
1420
1421 2002-11-22  Dietmar Maurer  <dietmar@ximian.com>
1422
1423         * threads.c (TlsGetValue): removed unnecessary mutex
1424
1425 2002-11-20  Dick Porter  <dick@ximian.com>
1426
1427         * timed-thread.c (_wapi_timed_thread_attach): Attached threads
1428         need to store their data structure too.
1429
1430         * threads.c: Make sure the threading data is initialised wherever
1431         it is needed
1432
1433 2002-11-15  Dick Porter  <dick@ximian.com>
1434
1435         * timed-thread.c: Removed unneeded parameters in
1436         _wapi_timed_thread_attach().
1437
1438         * threads.c: Renamed AttachThread() to make it not look like
1439         external API.  Removed unneeded parameters.
1440
1441 2002-11-11  Gonzalo Paniagua Javier <gonzalo@ximian.com>
1442
1443         * error.[ch]: added errno_to_WSA (). It displays a warning and return
1444         WSASYSCALLFAILURE if there is no error mapping for the given errno,
1445
1446         * sockets.c: use errno_to_WSA and fixed display of warning for h_errno.
1447
1448 2002-10-31  Dick Porter  <dick@ximian.com>
1449
1450         * io.h: 
1451         * io.c: Define and use INVALID_FILE_ATTRIBUTES
1452
1453 2002-10-07  Dick Porter  <dick@ximian.com>
1454
1455         * timefuncs.c:
1456         * daemon.c: Use a more accurate time source for process start and
1457         end times.
1458
1459 2002-10-03  Dick Porter  <dick@ximian.com>
1460
1461         * daemon.c:
1462         * handles.c:
1463         * threads.c:  Fixes for freebsd.  Make sure that mutex and condition
1464         creation and deletion happen in the process that owns them, when
1465         POSIX shared thread objects aren't supported.  This breaks on
1466         freebsd, as pthread_t is a pointer to data.
1467
1468 2002-10-02  Dick Porter  <dick@ximian.com>
1469
1470         * shared.c: Use mmap() instead of sysv shm for the shared data.
1471
1472         * wapi-private.h (_WAPI_HANDLE_VERSION): Reset back to 0, for the
1473         new system
1474
1475         * daemon-private.h: 
1476         * daemon.c: mmap()ed regions survive fork, so just pass the
1477         pointer to _wapi_daemon_main instead of mapping it again.
1478
1479 2002-10-01  Dick Porter  <dick@ximian.com>
1480
1481         * timed-thread.c: Kludge for CREATE_SUSPENDED thread creation.
1482         Unfortunately libgc uses the same thread suspend technique that I
1483         want to, and the two don't mix: libgc will deadlock when it tries
1484         to stop the world if a thread has already been suspended by
1485         someone else.  Just do the simple suspended create rather than the
1486         general purpose thread suspension for now.
1487
1488         * threads.c: Pass create flags to the timed_thread create call, to
1489         implement suspended thread creation.  ResumeThread() partially
1490         implemented, to cope with the case where a newly created but
1491         suspended thread is launched.
1492
1493 2002-09-30  Dick Porter  <dick@ximian.com>
1494
1495         * sockets.c (ioctlsocket): Set non-blocking mode in a better way,
1496         with fcntl.
1497
1498 2002-09-27  Dick Porter  <dick@ximian.com>
1499
1500         * semaphores.c: Only include semaphore.h if it's present. Patch
1501         for BSD from jmmv@hispabsd.org (Julio Merino).
1502
1503 2002-09-27  Dick Porter  <dick@ximian.com>
1504
1505         * processes.c: Pass environment and working directory to the
1506         daemon when forking.  Don't let argv[0] be duplicated when looking
1507         for the program name.  Implement EnumProcessModules (simple
1508         version for now, lsof-style later if needed), GetModuleBaseName,
1509         {Get,Set}ProcessWorkingSetSize (just faked, because the vm hints
1510         aren't available on Linux).
1511
1512         * process-private.h: Store the process name, and the working set
1513         min and max
1514
1515         * handles.c:
1516         * handles-private.h: New functions to store and retrieve an array
1517         of strings in the scratch space
1518
1519         * daemon.c: Don't miss deleting some handles when a client exits
1520         (we used to rely on the client doing the final cleanup, but
1521         obviously if the client is no longer there the daemon has to do
1522         it).
1523
1524         Process forking now sets the environment and the working
1525         directory.
1526
1527         * io.c: Don't confuse fd 0 with an unassigned handle struct
1528
1529         * atomic.h: Add a google cache alternative to the msdn URL
1530
1531 2002-09-25  Gonzalo Paniagua Javier <gonzalo@ximian.com>
1532
1533         * sockets.c:
1534         (_wapi_recvfrom): added ECONNRESET to the switch.
1535
1536 2002-09-24  Mark Crichton  <crichton@gimp.org>
1537
1538         * atomic.h: Yea.  On linux, sparc isn't sparc, it's __sparc__.
1539         Added to ifdef.
1540
1541 2002-09-19  Mark Crichton  <crichton@gimp.org>
1542
1543         * daemon.c, shared.c: Added NEED_LINK_UNLINK for systems that
1544         dont have Linux's abstract filesystem for sockets.
1545
1546 2002-09-19  Mark Crichton  <crichton@gimp.org>
1547
1548         * atomic.h: Added SPARC atomic asm code.
1549         * daemon.c, handles-private.h, handles.c, wapi-private.h:
1550         undefined _POSIX_THREAD_PROCESS_SHARED.  This actually exists on
1551         Solaris 9, however, the code paths don't seem to work.  More testing
1552         on the shared case is *really* needed.
1553
1554 2002-09-03  Dick Porter  <dick@ximian.com>
1555
1556         * threads.h: 
1557         * threads.c: Removed PosixKillThread(), because it's not in the
1558         w32 api
1559
1560 2002-08-20  Dick Porter  <dick@ximian.com>
1561
1562         * handles.c (_wapi_handle_scratch_store): Made stored byte lengths
1563         multiples of 4 bytes, to keep header structures aligned.  Needed
1564         for sparc, at least. (Patch from crichton@gimp.org)
1565
1566         * handles.c: Removed 'disable_shm' variable (we've defaulted to
1567         building with shm enabled for months now)
1568
1569 2002-08-19  Dick Porter  <dick@ximian.com>
1570
1571         * daemon.c: Rewrote the poll() loop to use GIOChannels instead,
1572         for legacy NeXT-based systems.
1573
1574 2002-08-12  Dick Porter  <dick@ximian.com>
1575
1576         * atomic.h: Rename some parameters to avoid c++ keywords (Patch
1577         from Joseph Wenninger <kde@jowenn.at>)
1578
1579 2002-08-05  Dietmar Maurer  <dietmar@ximian.com>
1580
1581         * threads.c: use fast spinlocks by default
1582
1583 2002-08-02  Dick Porter  <dick@ximian.com>
1584
1585         * io.c (GetStdHandle): Add a handle reference when returning a
1586         duplicate console handle.  This fixes the unref_handle errors in
1587         NUnit.
1588
1589 2002-08-01  Dietmar Maurer  <dietmar@ximian.com>
1590
1591         * threads.c (TLS_PTHREAD_MUTEX): define this because else some
1592         tests does not work
1593
1594 2002-08-01  Dick Porter  <dick@ximian.com>
1595
1596         * threads.c: Use atomic spinlocks in TLS functions
1597
1598         * mono-spinlock.h:
1599         * Makefile.am: Added mono-spinlock.h
1600
1601 2002-07-21  Jeffrey Stedfast  <fejj@ximian.com>
1602
1603         * daemon-messages.c: #include <sys/types.h> and <sys/sockets.h> -
1604         these are needed for sendmsg() and also for struct msghdr (at
1605         least on Solaris). Solaris still won't build because struct msghdr
1606         doesn't have msg_flags, msg_control, or msg_controllen members.
1607         (CMSG_SPACE): Define for systems that don't have it.
1608         (CMSG_LEN): Same.
1609
1610 2002-07-20  Dick Porter  <dick@ximian.com>
1611
1612         * wapi-private.h:
1613         * io-private.h:
1614         * io.h:
1615         * io.c:
1616         * handles.c: Implemented pipe handles
1617         
1618         * handles.c:
1619         * daemon.c: Fixed bug in handle closing.
1620
1621         * shared.c:
1622         * daemon.c: Forked processes now close all open file descriptors.
1623
1624 Fri Jul 19 19:05:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
1625
1626         * sockets.h, io-layer.h, critical-sections.h: don't include config.h
1627         in header files.
1628
1629 2002-07-19  Martin Baulig  <martin@gnome.org>
1630
1631         * threads.c (ExitThread): Call exit() if no threads has been
1632         created yet.
1633
1634 2002-07-17  Dick Porter  <dick@ximian.com>
1635
1636         * daemon-messages.c: Freebsd fixes from Andreas Kohn
1637         <andreas.kohn@gmx.net>
1638
1639 2002-07-15  Dick Porter  <dick@ximian.com>
1640
1641         * io.c: Removed bogus console_flush() method, that was just cut
1642         and pasted from file_flush when I separated the two handle types.
1643
1644 2002-07-12  Dick Porter  <dick@ximian.com>
1645
1646         * io.c (convert_from_flags): Fixed misunderstanding wrt fcntl
1647         flags.  Fixes bug 27633.
1648
1649 2002-07-12  Dick Porter  <dick@ximian.com>
1650
1651         * wapi-private.h:
1652         * handles.c:
1653         * daemon.c: Use size of sockaddr_un.sun_path from config.h
1654
1655 2002-07-12  Dick Porter  <dick@ximian.com>
1656
1657         * processes.c (CreateProcess): Send stdin, stdout and stderr
1658         handles if the startup info doesnt specify new ones
1659
1660         * io.c (GetStdHandle): Return the same handle when the same
1661         standard handle is requested
1662
1663         * handles.c: Pass file descriptors when forking
1664
1665         * daemon.c: Use supplied file descriptors when forking a new
1666         process
1667
1668         * daemon-messages.h: 
1669         * daemon-messages.c: Pass stdin, stdout and stderr file
1670         descriptors to the daemon (used when forking)
1671
1672 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
1673
1674         * daemon.c (_wapi_daemon_main): Use sizeof
1675         (main_socket_address.sun_path) instead of hardcoded 108 value.
1676
1677         * handles.c (shared_init): Use sizeof
1678         (shared_socket_address.sun_path) instead of hardcoded 108 value.
1679
1680 2002-07-10  Dennis Haney  <davh@davh.dk>
1681
1682         * shared.c:
1683         * handles.c:
1684         * daemon.c: Lots of documentation, some added error checking, and
1685         code readability improvements.
1686
1687         * daemon-messages.h: Add the Error request type to improve error
1688         checking.
1689
1690         * daemon-messages.c: Do a bit more error checking on send() and
1691         recv(), and log errors with a higher severity level.
1692
1693 2002-07-04  Dick Porter  <dick@ximian.com>
1694
1695         * daemon.c (process_process_fork): Fix argument handling, due to
1696         buggy understanding of g_strsplit() behaviour.
1697
1698 2002-07-03  Dick Porter  <dick@ximian.com>
1699
1700         * threads.h:
1701         * threads.c: Implement OpenThread().  Define access-control values
1702         for thread handles.
1703
1704         * wapi.h:
1705         * processes.h:
1706         * access.h:
1707         * Makefile.am: Added access.h, to hold shared access-control
1708         definitions
1709
1710 2002-07-02  Dick Porter  <dick@ximian.com>
1711
1712         * wapi-private.h (_WAPI_HANDLE_VERSION): New protocol version
1713         
1714 2002-07-02  Dick Porter  <dick@ximian.com>
1715
1716         * handles.c (shared_init): Make a second attempt to contact the
1717         daemon if the shared memory attach succeeds, but the connect()
1718         fails. (This copes with the daemon crashing without cleaning up
1719         the shared memory.)
1720
1721         * Makefile.am: 
1722         * daemon-private.h:
1723         * daemon.c:
1724         * shared.c (_wapi_shm_attach): Don't exec() anything when we fork
1725         the daemon, it's now built into the library.
1726
1727 2002-06-25  Dick Porter  <dick@ximian.com>
1728
1729         * handles.c:
1730         * handles-private.h:
1731         * daemon-messages.h:
1732         * daemon.c: Process forking and handle data management
1733
1734         * processes.h:
1735         * process-private.h:
1736         * processes.c: Process forking and other support functions
1737
1738 2002-06-25  Dick Porter  <dick@ximian.com>
1739
1740         * versioninfo.h: PE resource decoding
1741
1742         * unicode.c (_wapi_unicode_to_utf8): g_utf16_to_utf8 doesnt need
1743         to be told the string length
1744
1745         * io.c: Removed the ACTUALLY_DO_UNICODE option.  Fixed some leaks.
1746         Moved _wapi_time_t_to_filetime and the WapiFileTime typedef to
1747         timefuncs.c
1748
1749 2002-06-12  Dick Porter  <dick@ximian.com>
1750
1751         * daemon.c: 
1752         * daemon-messages.c: Handle SIGPIPE in a non-stupid way in the
1753         daemon, if MSG_NOSIGNAL isn't available.  Thanks to Jaroslaw
1754         Kowalski <jarek@atm.com.pl> for pointing out the bogosity.
1755
1756 2002-06-10  Jaroslaw Kowalski <jarek@atm.com.pl>
1757
1758         * sockets.c, daemon-messages.c: Prevent SIGPIPE from being raised
1759         when writing to a closed socket.
1760
1761 2002-06-08  Jeffrey Stedfast  <fejj@ximian.com>
1762
1763         * mono-mutex.c (mono_once): New convenience function for my
1764         previous fix.
1765
1766         * handles.c:
1767         * error.c: 
1768         * critical-sections.c: 
1769         * threads.c: 
1770         * sockets.c: 
1771         * semaphores.c: 
1772         * processes.c: 
1773         * mutexes.c: 
1774         * io.c: 
1775         * events.c: 
1776         * atomic.c: Use mono_once() rather than pthread_once().
1777
1778 2002-06-06  Jeffrey Stedfast  <fejj@ximian.com>
1779
1780         * handles.c (_wapi_handle_new): pthread_once() is not atomic, so
1781         if multiple threads all try to call _wapi_handle_new() before the
1782         shared data has been initialized, it is possible that we could get
1783         into a condition where shared_init() is being executed and later
1784         threads will pass by pthread_once() due to the fact that it has
1785         already been called and so therefor will attempt to use the shared
1786         data before it has been completely initialized. If we instead use
1787         a standard mutex locking mechanism around shared_init(), we can
1788         avoid the situation entirely. By wrapping the mutex locking in a
1789         check to see if we've already initialized the data, we can even
1790         avoid wasting resources by having to lock/unlock the mutex in any
1791         later calls (the only time we'd have to worry about
1792         locking/unlocking is the initial race to call shared_init() at
1793         startup).
1794
1795 Sat Jun 1 13:27:11 CEST 2002 Paolo Molaro <lupus@ximian.com>
1796
1797         * atomic.h: inline asm fixes from Dennis Haney (davh@davh.dk).
1798
1799 Fri May 31 16:21:54 CEST 2002 Paolo Molaro <lupus@ximian.com>
1800
1801         * daemon.c, handles.c: rename "sun" local var since it's apparently
1802         a #define on Solaris.
1803
1804 Fri May 31 15:40:14 CEST 2002 Paolo Molaro <lupus@ximian.com>
1805
1806         * daemon-messages.c: work-around MSG_NOSIGNAL missing on some
1807         platforms.
1808
1809 2002-05-15  Dick Porter  <dick@ximian.com>
1810
1811         * wait.c: Fix a deadlock in WaitForMultipleObjects
1812
1813 2002-05-14  Dick Porter  <dick@ximian.com>
1814
1815         * io.c: Fix a cut&paste error, found by
1816         Jaroslaw Kowalski <jarek@atm.com.pl>
1817
1818 2002-05-10  Dan Lewis  <dihlewis@yahoo.co.uk>
1819
1820         * io.c: Nasty typo.
1821
1822 2002-05-09  Dick Porter  <dick@ximian.com>
1823
1824         * threads.c: 
1825         * semaphores.c: 
1826         * processes.c: 
1827         * mutexes.c: 
1828         * handles-private.h: 
1829         * events.c: 
1830         * Makefile.am: Remove now-unused file wait-private.h
1831
1832 2002-05-08  Dick Porter  <dick@ximian.com>
1833
1834         * shared.c: Better error messages, and report when daemon
1835         connection fails rather than blocking forever.  Do some more
1836         shared memory sanity checking.
1837
1838         * handles.c: Better error messages when connecting to shared
1839         memory and the handle daemon.  Fall back to non-shared handles if
1840         an error occurs.  Set the default back to 'shared handles'.  Fix a
1841         crashing bug in scratch space allocation that mangled the block
1842         headers.
1843
1844 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
1845
1846         * handles.c (shared_init): Disable SHM for now, people have too
1847         many problems with this, and the diagnostics are not helping.
1848
1849 2002-05-06  Dan Lewis  <dihlewis@yahoo.co.uk>
1850
1851         * io.c: CreateFile sets win32 last error.
1852
1853 2002-05-05  Dick Porter  <dick@ximian.com>
1854
1855         * wapi-private.h: 
1856         * handles-private.h:
1857         * io.c: 
1858         * io-private.h:
1859         * mutexes.c: 
1860         * mutex-private.h: 
1861         * processes.c: 
1862         * process-private.h: 
1863         * semaphores.c: 
1864         * semaphore-private.h: 
1865         * sockets.c: 
1866         * socket-private.h: 
1867         * events.c: 
1868         * event-private.h: Simplify the WapiHandleOps struct: take out all
1869         the file-specific entries, leaving just the items that operate on
1870         handles themselves.  Split the close operation into shared and
1871         private parts: shared close is called by the daemon.
1872
1873         * handles.c: As above, but also pass handle allocation, ref and
1874         unref operations to the daemon.  Populate the handle_ops array at
1875         compile time, because the daemon needs to call ops on handles too.
1876         Don't bother to track open handle counts any more, the daemon does
1877         that.
1878         
1879         * threads.c: 
1880         * thread-private.h: As above, but also make the thread data
1881         handle-private.
1882
1883         * shared.c: Fork a handle daemon if the calling process created
1884         the shared memory segment.
1885
1886         * daemon.c:
1887         * daemon-messages.c:
1888         * daemon-messages.h:
1889         * Makefile.am: Build a daemon to manage handle allocation and
1890         destruction without needing to lock the shared memory
1891
1892 2002-04-30  Jeffrey Stedfast  <fejj@ximian.com>
1893
1894         * atomic.c: Changed to use a normal mutex rather than a spinlock
1895         since a lot of platforms seem to not have them :\
1896
1897 2002-04-30  Dick Porter  <dick@ximian.com>
1898
1899         * Completely rewrote the handle waiting code: removed the helper
1900         thread and its attendant complexity.  All handle waiting is now
1901         abstracted into the WaitForSingleObject() and
1902         WaitForMultipleObjects() functions.
1903
1904         * Implemented inter-process sharing of handles using sysv shared
1905         memory.  This makes handles even more opaque, with a handle now
1906         just an index into an array.
1907         
1908 2002-04-25  Dan Lewis  <dihlewis@yahoo.co.uk>
1909
1910         * io.c: unitialized pointer in GetCurrentDirectory.
1911
1912 Sat Apr 20 13:37:39 CEST 2002 Paolo Molaro <lupus@ximian.com>
1913
1914         * threads.c: destroy the mutex at thread destruction
1915         (if/when thread destruction code will be actually called).
1916         When protecting a tls data pointer from the gc, use also the 
1917         thread id in the key.
1918         
1919 Wed Apr 17 18:36:27 CEST 2002 Paolo Molaro <lupus@ximian.com>
1920
1921         * timed-thread.c: avoid race condition when setting the thread to
1922         detached.
1923
1924 2002-04-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
1925
1926         * jit.h: to more #include lines to avoid breaking compilation
1927         under windows when upgrading mingw and w32api to version
1928         1.3 (thanks Dick!).
1929
1930 2002-04-16  Dick Porter  <dick@ximian.com>
1931
1932         * atomic.h: Explanatory comment about lack of 80386 support
1933
1934 2002-04-15  Dick Porter  <dick@ximian.com>
1935
1936         * atomic.h: use xaddl for InterlockedIncrement() and
1937         InterlockedDecrement().  Use cmpxchgl in a loop for
1938         InterlockedExchange() and InterlockedExchangePointer().
1939
1940 Mon Apr 15 13:31:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
1941
1942         * unicode.c: fix unicode_len() to not access uninitialized memory
1943         (and updated to conform to mono code style).
1944
1945 Fri Mar 29 17:15:11 CET 2002 Paolo Molaro <lupus@ximian.com>
1946
1947         * io.c: EEXISTS is ignored for directory creation.
1948         * mono-mutex.h: remove silly "pragma }" that emacs users insert
1949         because they use a broken editor:-)
1950
1951 2002-03-28  Dick Porter  <dick@ximian.com>
1952
1953         * sockets.h: 
1954         * sockets.c: 
1955         * io.c: 
1956         * handles.h: 
1957         * handles.c: Warning cleanups
1958
1959 2002-03-27  Dan Lewis <dihlewis@yahoo.co.uk>
1960
1961         * unicode.h, unicode.c: changed to gunichar2
1962         * io.h, io.c: changed strings to gunichar2*, added
1963         SetFileAttributes(), GetCurrentDirectory(), SetCurrentDirectory(),
1964         some fixes to FindFirstFile() and friends.
1965
1966 2002-03-26  Dick Porter  <dick@ximian.com>
1967
1968         * types.h: Implement the large integer struct
1969
1970         * timefuncs.h:
1971         * timefuncs.c: Dummy functions that don't yet implement
1972         QueryPerformanceCounter() and QueryPerformanceFrequency()
1973
1974         * threads.h:
1975         * threads.c: Implement SleepEx()
1976
1977         * system.h:
1978         * system.c: Beginnings of GetSystemInfo()
1979
1980         * mono-mutex.c (pthread_mutex_timedlock): Fix a ms/ns conversion
1981         thinko
1982
1983         * context.h:
1984         * context.c: Dummy function that doesnt yet implement
1985         GetThreadContext()
1986
1987         * atomic.h: 
1988         * atomic.c: Interlocked functions
1989
1990 Mon Mar 25 13:01:40 CET 2002 Paolo Molaro <lupus@ximian.com>
1991
1992         * threads.c: use a gc-safe hash table to store tls pointers.
1993
1994 2002-03-22  Dick Porter  <dick@ximian.com>
1995
1996         * threads.c: Fix a race condition where a thread can start and
1997         exit before the handle has been properly initialised (no reason
1998         why the handle couldn't be initialised beforehand, so do so)
1999
2000         Fix a ms to ns conversion magnitude thinko.
2001
2002 2002-03-21  Dick Porter  <dick@ximian.com>
2003
2004         * semaphores.c: Fix a problem when waiting for one or more
2005         semaphores, and another semaphore is Released (all waiting
2006         semaphores assumed they were signalled)
2007
2008 2002-03-29  Dan Lewis <dihlewis@yahoo.co.uk>
2009
2010         * io.h, io.c, uglify.h: added MoveFile, CopyFile, CreateDirectory,
2011         RemoveDirectory, GetFileAttributes, GetFileAttributesEx
2012
2013 2002-03-19  Dietmar Maurer  <dietmar@ximian.com>
2014
2015         * threads.c (Sleep): bug fix: 1ms == 1000000ns
2016
2017 2002-03-19  Dan Lewis <dihlewis@yahoo.co.uk>
2018
2019         * io.h, io.c, events.c, mutexes.c, semaphores.c, sockets.c,
2020         threads.c, io.c: added flush method to handles.
2021
2022         * io.c: FlushFileBuffers() and FindFirstFile() functions.
2023
2024 Thu Mar 7 17:21:52 CET 2002 Paolo Molaro <lupus@ximian.com>
2025
2026         * threads.c, timed-thread.c, wait.c: Boehm-GC anable.
2027
2028 2002-02-20  Dick Porter  <dick@ximian.com>
2029
2030         * io-layer.h: Always build without cygwin support on windows
2031
2032 Mon Feb 18 15:50:59 CET 2002 Paolo Molaro <lupus@ximian.com>
2033
2034         * sockets.c: #undef DEBUG.
2035
2036 2002-02-14  Jeffrey Stedfast  <fejj@ximian.com>
2037
2038         * io-layer.h: conditionally include sys/filio.h and sys/sockio.h
2039         for FIONBIO, FIONREAD, and SIOCATMARK.
2040
2041 2002-02-14  Jeffrey Stedfast  <fejj@ximian.com>
2042
2043         * sockets.c: conditionally include sys/filio.h and sys/sockio.h
2044         for FIONBIO, FIONREAD, and SIOCATMARK.
2045
2046 2002-02-13  Dick Porter  <dick@ximian.com>
2047
2048         * sockets.c: Implement shutdown and select
2049
2050 2002-02-13  Jeffrey Stedfast  <fejj@ximian.com>
2051
2052         * mono-mutex.[c,h]: New source files that thinly wrap all pthread
2053         functions that take pthread_mutex_t and/or pthread_mutexattr_t
2054         arguments for the sake of portability. Implements recursive
2055         mutexes and pthread_mutex_timedlock.
2056
2057         * critical-sections.c:
2058         * events.c:
2059         * handles.c:
2060         * mutexes.c:
2061         * semaphores.c:
2062         * threads.c:
2063         * timed-thread.c:
2064         * wait.c: Use the mono-mutex wrapper portability functions/macros.
2065
2066         * pthread-compat.[c,h]: Replaced by mono-mutex.[c,h]
2067
2068 2002-01-23  Dick Porter  <dick@ximian.com>
2069
2070         * sockets.c: Networking support, mostly wrapping BSD socket APIs
2071         with handle code, and translating errno into w32 error codes.
2072
2073         * macros.h: Some w32 macros used with the socket support
2074
2075         * error.c: Implemented GetLastError() and SetLastError()
2076
2077         * Makefile.am: Added sockets, with kludge to override some symbols
2078
2079 2001-12-17  Dietmar Maurer  <dietmar@ximian.com>
2080
2081         * unicode.c (_wapi_unicode_to_utf8): byteswap UTF16 strings before
2082         passing them to iconv
2083         (_wapi_unicode_to_utf8): only swap bytes on LE systems, remove bug
2084         from previous commit.
2085
2086 2001-12-11  Dick Porter  <dick@ximian.com>
2087
2088         * io.c: Implement DeleteFile(), GetFileTime(), SetFileTime() and
2089         FileTimeToSystemTime().
2090
2091         * unicode.c (unicode_len): Nasty way of finding length of unicode
2092         string with embedded NULLs (counts until two NULLs together).
2093
2094         * mutexes.c (mutex_close): 
2095         * events.c (event_close): Release the internal pthreads resources
2096
2097 2001-11-26  Dick Porter  <dick@ximian.com>
2098
2099         * critical-sections.c:
2100         * events.c:
2101         * handles.c:
2102         * io.c:
2103         * mutexes.c:
2104         * semaphores.c:
2105         * threads.c:
2106         * timed-thread.c:
2107         * wait.c: turn off DEBUG messages
2108
2109 2001-11-22  Dick Porter  <dick@ximian.com>
2110
2111         * handles.c (SignalObjectAndWait): Implement
2112
2113         * wait.c (WaitForSingleObject): Fix case where timeout == 0
2114
2115         * threads.c:
2116         * semaphores.c:
2117         * mutexes.c:
2118         * io.c:
2119         * events.c: Support for SignalObjectAndWait
2120         
2121 2001-11-21  Dick Porter  <dick@ximian.com>
2122
2123         * events.c:
2124         * handles.c:
2125         * mutexes.c:
2126         * semaphores.c:
2127         * threads.c:
2128         * wait.c: Reliable method of returning which handle was signalled
2129         on return from WaitForMultipleObjects().
2130
2131 2001-11-21  Dick Porter  <dick@ximian.com>
2132
2133         * events.c: Implement events
2134
2135 2001-11-15  Dick Porter  <dick@ximian.com>
2136
2137         * mutexes.c: Implement mutexes
2138
2139         * threads.c: 
2140         * semaphores.c: 
2141         * misc.c: Factor out some common code
2142
2143 2001-11-13  Dick Porter  <dick@ximian.com>
2144
2145         * threads.c: Implement TLS.  Implement GetCurrentThreadId(), and
2146         GetCurrentThread() by maintaining a hash of thread handles.
2147
2148         * threads.h: Define thread and process creation flags
2149
2150 2001-11-12  Dick Porter  <dick@ximian.com>
2151
2152         * critical-sections.c: Implement critical sections
2153
2154 2001-11-12  Dick Porter  <dick@ximian.com>
2155
2156         * semaphores.c: Implement semaphores
2157
2158         * wait.c (wait_for_item): Maintain a wait count rather than count
2159         signalled booleans.
2160
2161         * threads.c (thread_wait_multiple): Don't lock the wait item, that
2162         will block other wait threads
2163
2164 2001-11-11  Dick Porter  <dick@ximian.com>
2165
2166         * Makefile.am: Rename some automake variables
2167         (from Nick Drochak <ndrochak@gol.com>)
2168
2169 2001-11-10  Dick Porter  <dick@ximian.com>
2170
2171         * Makefile.am (libwapiincludedir): Fix include destination
2172
2173         * .cvsignore: Ignore generated files
2174
2175 2001-11-10  Dietmar Maurer  <dietmar@ximian.com>
2176
2177         * pthread-compat.c: added some include files to make it compile on
2178         linux.
2179
2180 2001-11-08  Dick Porter  <dick@ximian.com>
2181
2182         * Initial checkin.
2183
2184         This is a library emulating the win32 threading and IO API.