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