Flush
[mono.git] / mono / io-layer / ChangeLog
1 2004-06-03  Lluis Sanchez Gual  <lluis@ximian.com>
2
3         * threads.c: Implemented SleepEx.
4         * threads.h: Fixed SleepEx signature.
5
6 2004-06-03  Miguel de Icaza  <miguel@ximian.com>
7
8         * threads.c: When running under valgrind, do not allocate too much
9         stack, as Valgrind default is 1 meg.
10
11 2004-05-27  Dick Porter  <dick@ximian.com>
12
13         * io.h:
14         * io.c: Implemented LockFile() and UnlockFile()
15
16 2004-05-21  Dick Porter  <dick@ximian.com>
17
18         * io.c (CreateFile): Check for existing share modes when opening
19         a file.
20
21         * handles.c: 
22         * handles-private.h: 
23         * daemon-messages.h: 
24         * daemon.c: Maintain a hash of file share modes, keying on device
25         and inode (to cope with symlinks.)
26
27 2004-05-20  Lluis Sanchez Gual  <lluis@ximian.com>
28
29         * daemon-messages.c: Retry if the communication with the daemon is
30           interrupted by a signal.
31         * io.c, sockets.c: Check for EINTR in every syscall that can be interrumped. 
32           Only return an error in this case if there is something in the apc queue
33           (which means that it is an interruption requested by the "user").
34         * processes.c: Use WaitForSingleObjectEx. No need to pass "alertable" as
35           true since the wait is small.
36         * shared.c: Retry write calls when interrumped by a signal.
37         * timed-thread.h, timed-thread.c: added _wapi_thread_apc_pending, which
38           returns TRUE if there are pending asynchronous calls (APC) for the
39           provided thread. Also added _wapi_thread_dispatch_apc_queue which calls
40           the enqueued APCs. Defined a new struct ApcInfo that holds information
41           about an enqueued APC.
42         * thread-private.h, threads.c: Implemented QueueUserAPC (which does the same
43           as in win32),_wapi_thread_apc_pending and _wapi_thread_dispatch_apc_queue. 
44           These last two methods call the corresponding apc methods in 
45           thread-private using the provided thread handle.
46         * threads.h: Added QueueUserAPC.
47         * uglify.h: Added WapiApcProc (needed by QueueUserAPC).
48         * wait.c, wait.h: Changed WaitForSingleObject to WaitForSingleObjectEx, and
49           WaitForMultipleObjects to WaitForMultipleObjectsEx. Implemented support
50           for APCs in those two methods and also in SleepEx.
51
52 2004-05-17  Dick Porter  <dick@ximian.com>
53
54         * io.c (CopyFile): Speed up.  Fixes bug 57859.
55
56 2004-05-13  Dick Porter  <dick@ximian.com>
57         * mono-mutex.c (mono_mutex_unlock): Return EPERM when the current
58         thread doesn't own the mutex, rather than assert()ing.
59
60 2004-05-11  Dick Porter  <dick@ximian.com>
61
62         * shared.c (_wapi_shm_attach): Cope when a previous daemon startup
63         attempt failed, leaving shared files that look like a daemon is
64         still starting.
65
66 2004-05-10  Gonzalo Paniagua Javier <gonzalo@ximian.com>
67
68         * io.c:
69         (SetFileAttributes): don't the the exec bit if the corresponding read
70         bit is not set.
71
72 2004-05-10  Zoltan Varga  <vargaz@freemail.hu>
73
74         * io.c (FindFirstFile): Fix invalid free.
75
76 2004-05-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
77
78         * io.c: translate from GFileError to errno codes and don't free
79         variables right after calling mono_io_scandir, as we may overwrite
80         errno value.
81
82 2004-05-08  Gonzalo Paniagua Javier <gonzalo@ximian.com>
83
84         * io.c: g_dir_open return ENOENT for directories on which we don't have
85         read/execute permission, while returning EPERM for anything below those.
86         So, change ENOENT by EPERM if the directory exists.
87
88 2004-05-07  Dick Porter  <dick@ximian.com>
89
90         * io.c (SetFileAttributes): Don't have failed chmod()s cause a
91         "file not found" error.  Fixes bug 54032.
92         
93 2004-05-07  Dick Porter  <dick@ximian.com>
94
95         * io.c (FindFirstFile): Comment out a windows-compatibility check
96         that breaks when directories have metachars in their names.
97         Workaround for bug 58116.
98
99 2004-05-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
100
101         * io.c: fixed for FindFirstFile for empty directories. Closes
102         bug #58147.
103
104 2004-05-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
105
106         * processes.c: set the start time for the current process. Fixes bug
107         #58109.
108
109 2004-05-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
110
111         * io-private.h: 'namelist' is now a gchar ** in _WapiHandlePrivate_find.
112         * io.c: implemented scandir using glib functions.
113
114 2004-05-04  Dick Porter  <dick@ximian.com>
115
116         * daemon.c (read_message): Return FALSE on error so the GSource
117         callback itself can return FALSE.  Cures the infinite loop poll()
118         warning on MacosX.
119         * shared.c: Fix some daemon startup race conditions.
120
121 2004-04-29  Miguel de Icaza  <miguel@ximian.com>
122
123         * io.c (CopyFile): Use 32k buffers to copy the file instead of 2k,
124         use the stack, do not use dynamic memory.
125
126 2004-04-29  Zoltan Varga  <vargaz@freemail.hu>
127
128         * io.c: Add scandir implementation for platforms which do not have
129         it, like solaris.
130
131 2004-04-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
132
133         * io.[ch]: implemented GetLogicalDriveStrings.
134
135 2004-04-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
136
137         * io.c:
138         * sockets.c: use the field name from configure when accessing sigval
139         pointer field. Makes this work on the Mac.
140
141 2004-04-28  Bernie Solomon  <bernard@ugsolutions.com>
142
143         * atomic.c: (InterlockedExchange) fix typo for
144         mutex name
145
146 2004-04-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
147
148         * io.c:
149         * sockets.c: added check for sys/aio.h.
150
151 2004-04-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
152
153         * error.[ch]: added _wapi_get_win32_file_error...
154         * io.c: ... which was _wapi_get_win32_error here.
155         * sockets.c: rename the function calls here too.
156
157 2004-04-28  Dick Porter  <dick@ximian.com>
158
159         * daemon-messages.c: Avoid a deadlock when a thread is killed while
160         waiting for the daemon by using a recursive mutex.  Helps bug 56699.
161
162 2004-04-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
163
164         * io.c: fixed leak in async_notifier().
165
166         * sockets.[ch]: added AIO support for sockets and fixed WSAIoctl
167         declaration.
168
169         * threads.c: removed old comment.
170
171 2004-04-26  David Waite  <mass@akuma.org>
172
173         * daemon-messages.h:
174         * daemon-private.h
175         * error.h:
176         * io.h:
177         * processes.h:
178         * shared.h:
179         * thread-private.h:
180         * wapi-private.h: remove comma from end of enumeration declarations
181         * status.h: cast unsigned int types to int for enum assignment
182
183 2004-04-26 David Waite <mass@akuma.org>
184
185         * io.c:
186         * timefuncs.c: declare 64-bit constants as long long types (i.e.
187         10ULL)
188
189 2004-04-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
190
191         * socket-wrappers.h: _wapi_socket == WSASocket now. Added
192         WSA_FLAG_OVERLAPPED.
193
194         * sockets.c: new unused parameters for _wapi_socket.
195
196 2004-04-22  Miguel de Icaza  <miguel@ximian.com>
197
198         * timed-thread.c: Replace sem_init with MONO_SEM_INIT to handle
199         the fact that MacOS X is a piece of junk (sem_init is *defined* in
200         the libc, but they return `not implemented'). 
201
202 2004-04-22  Dick Porter  <dick@ximian.com>
203
204         * handles.c: 
205         * handles-private.h: Reference the handle when it is locked, so
206         that another thread can't blow it away while we're waiting for it
207         to become signalled.
208         
209         * wait.c: 
210         * timed-thread.c: 
211         * threads.c: 
212         * sockets.c: 
213         * semaphores.c: 
214         * mutexes.c: 
215         * mono-mutex.c: 
216         * io.c: 
217         * handles.c: 
218         * handles-private.h: 
219         * events.c: 
220         * error.c: 
221         * daemon-messages.c: 
222         * critical-sections.c: 
223         * atomic.c: Added pthreads cleanup handlers and error asserts
224
225         * shared.c: 
226         * handles.c: Fixed the gcc "variable might be used uninitialised"
227         warnings.  They can't happen, but gcc doesn't know that
228         g_assert()s don't return.
229
230         Fixed the declaration of _wapi_handle_process_kill() so that it
231         expects the correct type for the pid.
232         
233         * threads.c: Removed the TLS_PTHREAD_MUTEX style locking that
234         hasn't been used in ages and just made the code more complex.
235
236 2004-04-17  Zoltan Varga  <vargaz@freemail.hu>
237
238         * processes.c: Include <signal.h> for SIGKILL and SIGILL + fix some
239         warnings. Fixes #57168.
240
241 2004-04-16  Dick Porter  <dick@ximian.com>
242
243         * threads.c (Sleep): Using div(3) with a negative (when signed)
244         numerator causes the quotient to be 0 and the remainder to be the
245         numerator.  This feeds a small negative value to nanosleep(3),
246         which will return immediately and cause a busy wait.  Fixes bug
247         56351.
248
249 2004-04-15  Dick Porter  <dick@ximian.com>
250
251         * io-private.h:
252         * io.c: Rewrite FindFirstFile and FindNextFile using scandir(3)
253         and fnmatch(3) instead of glob(3).  glob() can't cope with being
254         given filenames containing metachars.  This fixes bug 40557.
255
256 2004-04-14  Bernie Solomon  <bernard@ugsolutions.com>
257
258         * security.c: #warning is a GCC-ism
259
260 2004-04-13  Sebastien Pouliot  <sebastien@ximian.com>
261
262         * security.c: Removed GetUserName as glib g_get_user_name does a
263         better (portability) job. Added ImpersonateLoggedOnUser and
264         RevertToSelf.
265
266 2004-04-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
267
268         * mono-mutex.h: move pthread_mutex_timedlock declaration to...
269         * mono-mutex.c: ...here. It was causing a warning that prevented
270         libgdiplus compilation.
271
272 2004-04-04  Miguel de Icaza  <miguel@ximian.com>
273
274         * security.c (GetUserName): Make it work on MacOS X
275
276 2004-04-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
277
278         * security.c: use getpwuid_r if available. This one is thread-safe.
279
280 2004-04-02  Sebastien Pouliot  <sebastien@ximian.com>
281
282         * Makefile.am: Added security.c|h.
283         * security.c: New file for security related functions. Added function
284         GetUserName to fix #56144.
285         * security.h: New. Header file for security.c
286         * wapi.h: Added include for security.h
287
288 2004-03-25  Gonzalo Paniagua Javier <gonzalo@ximian.com>
289
290         * daemon-messages.h: added kill structs.
291
292         * daemon.c: implemented process_process_kill.
293         * handles-private.h:  define process_process_kill.
294         * handles.c: implemented _wapi_handle_process_kill.
295         * processes.[ch]: implemented TerminateProcess.
296
297 2004-03-25  Bernie Solomon  <bernard@ugsolutions.com>
298
299         * daemon.c (rem_fd): On solaris you seem to get an
300         error even after removing the input source so don't
301         try and rem_fd it twice.
302
303 2004-03-25  Lluis Sanchez Gual  <lluis@ximian.com>
304
305         * daemon.c: in process_post_mortem, If the child terminated due to the 
306         receipt of a signal, the exit status must be based on WTERMSIG, since 
307         WEXITSTATUS returns 0 in this case.
308
309 2004-03-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
310
311         * daemon.c: turned a warning into a DEBUG statement. Now we may hit it.
312
313 2004-03-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
314
315         * daemon.c: only call getdtablesize () once.
316         * processes.c: wait 500 ms to check if execve failed and throw the same
317         exception as MS on failure. Fixes bug #32809.
318
319 2004-03-17  Bernie Solomon  <bernard@ugsolutions.com>
320
321         * io.c (async_notifier): use "union sigval" rather
322         than sigval_t as Solaris doesn't have sigval_t
323         (which isn't in IEEE 1003.1 either).
324
325 2004-03-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
326
327         * io.c: added debug stuff and removed a few redundant lines in
328         file_write.
329
330 2004-03-15  Gonzalo Paniagua Javier <gonzalo@ximian.com>
331
332         * io-private.h: added new fields for file structure. Declare
333         _wapi_io_add_callback.
334
335         * io.c: added _wapi_get_win32_error, support aio_read/write in
336         file_read/write. Implemented _wapi_io_add_callback, which is where
337         BindHandle ends up.
338         
339         * io.h: added new fields for WapiOverlapped and typedef for the
340         callback.
341
342         * processes.c: fixed off-by-one bug when handling environment variables 
343         passed in.
344
345         * threads.[ch]: implemented BindIoCompletionCallback.
346
347         * uglify.h: added typedef for LPOVERLAPPED_COMPLETION_ROUTINE.
348
349 2004-03-14  Zoltan Varga  <vargaz@freemail.hu>
350
351         * socket-wrappers.h: Remove extra semicolon.
352
353 2004-03-03  Dave Camp  <dave@ximian.com>
354
355         * daemon.c: (add_fd), (fd_activity), (_wapi_daemon_main):
356         Use a new main context.
357
358 2004-03-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
359
360         * io.c:
361         (GetFileAttributes): set the error depending on errno instead of
362         setting ERROR_FILE_NOT_FOUND always. See bug #55160.
363
364 2004-03-01  Gonzalo Paniagua Javier <gonzalo@ximian.com>
365
366         * io.c:
367         (CopyFile): free the buffer on error.
368         * sockets.c:
369         (WSAIoctl): free the buffer on error.
370
371 2004-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
372
373         * error.c: fixed mapping for EPROTONOSUPPORT and ESOCKTNOSUPPORT.
374
375         * sockets.[ch]: retry creating the socket for AF_INET, SOCK_RAW
376         using IP protocol with IP over IP. Implemented WSAIoctl UNIX-style.
377
378 2004-01-27  Bernie Solomon  <bernard@ugsolutions.com>
379
380         * shared.c (_wapi_shm_file): add hostname
381         to shared data file names to handle NFS mounted
382         .wapi directories.
383
384 Mon Jan 26 16:15:03 CET 2004 Paolo Molaro <lupus@ximian.com>
385
386         * sockets.h: remove obsolete soklen_t typedef.
387
388 Fri Jan 23 21:07:02 CET 2004 Paolo Molaro <lupus@ximian.com>
389
390         * socket-wrappers.h, sockets.h, sockets.c, Makefile.am: move socket
391         wrappers to its own non-installed header file.
392
393 2004-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
394
395         * io.c:
396         (FindFirstFile): unlock the handle if FindNextFile fails.
397         (FindNextFile): g_free a couple of pointers before retrying.
398
399         * wait.c:
400         (WaitForMultipleObjects): if only one handle provided, use
401         WaitForSingleObject.
402
403 2003-12-22  Bernie Solomon  <bernard@ugsolutions.com>
404
405         * handles-private.h: (_wapi_handle_type) check
406         for segment in range before using it
407
408 2003-12-22  Bernie Solomon  <bernard@ugsolutions.com>
409
410         * thread-private.h: _wapi_thread_ops is now const
411         must match .c file.
412
413 Mon Dec 22 18:29:03 CET 2003 Paolo Molaro <lupus@ximian.com>
414
415         * threads.c, timed-thread.c, timed-thread.h: use mach
416         semaphores on Darwin (MacOSX) since the posix ones
417         are mostly broken there (threads are not created suspended
418         and they can start executing before they are fully initialized
419         like in tests/thread-static.cs).
420
421 Mon Dec 22 17:18:45 CET 2003 Paolo Molaro <lupus@ximian.com>
422
423         * atomic.h: ppc fixes.
424
425 2003-12-19  Bernie Solomon  <bernard@ugsolutions.com>
426
427         * handles.c: remove my bad use of MONO_ZERO_ARRAY_LENGTH
428         in HDRSIZE 
429
430 2003-12-15  Bernie Solomon  <bernard@ugsolutions.com>
431
432         * shared.c: (_wapi_shm_open) make scratch file
433         not have to immediately regrow to avoid remaps
434         (HPUX can't cope with these).
435         (_wapi_shm_attach) use actual size of file
436         to set scratch data_len for the creating process.
437
438         * handles.c: (_wapi_handle_new_internal) make
439         sure mutex & cond var are initialized even for
440         non process shared ones. 
441         (_wapi_handle_unref) always call destroy 
442         routines on mutex & cond var
443
444 2003-12-15  Bernie Solomon  <bernard@ugsolutions.com>
445
446         * daemon.c: change channel data structure so
447         input sources are removed from glib event loop
448         properly. xsp works better on Solaris and 
449         fixes #51278
450
451 2003-12-12  Bernie Solomon  <bernard@ugsolutions.com>
452
453         * wapi-private.h: Replace G_GNUC_PRETTY_FUNCTION
454         definition with file & line number for non-GCC
455         compiles.
456
457 2003-12-08  Bernie Solomon  <bernard@ugsolutions.com>
458
459         * Makefile.am: make sure hppa_atomic.s is in distribution
460
461 2003-12-01  Dick Porter  <dick@ximian.com>
462
463         * wapi-private.h: 
464         * mutexes.c (CreateMutex): 
465         * mutex-private.h (struct _WapiHandle_mutex): 
466         * handles.c: Look up certain handle types by name, in a shared
467         namespace.  Currently only mutex handles have this implemented.
468         Fixes bug 51089.
469
470         * semaphores.c (CreateSemaphore): 
471         * events.c (CreateEvent): Fix signature
472
473 2003-11-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
474
475         * io.c: don't call g_free before testing errno as it may modify it.
476         If the path exists, return an error if it's not a directory. Fixes
477         bug #50753.
478
479 2003-11-20  Dick Porter  <dick@ximian.com>
480
481         * io.c: Missed a little-endian UTF16 conversion.  Patch from
482         Jeroen Zwartepoorte (Jeroen@xs4all.nl), fixes bug 51065.
483
484 2003-10-29  Dick Porter  <dick@ximian.com>
485
486         * io.c (MoveFile): If the move crosses filesystems, try and fall
487         back to copy and delete.  Patch from Jörg Rosenkranz
488         (JoergR@voelcker.com), fixes bug 50298.
489
490 2003-10-28  Dick Porter  <dick@ximian.com>
491
492         * io.c: Use the new encoding conversion to cope with non-utf8
493         locales in filenames.
494
495         * processes.c: Ditto for process arguments.
496
497 Tue Oct 21 12:01:14 CEST 2003 Paolo Molaro <lupus@ximian.com>
498
499         * atomic.h: some ppc inline asm fixes (incorrect use of labels, 
500         incorrect register constraints, incorrect clobber lists).
501
502 2003-10-13  Bernie Solomon  <bernard@ugsolutions.com>
503
504         * Makefile.am hppa_atomic.s: add HP 64bit
505         implementation of atomic ops
506
507 2003-10-13  Zoltan Varga  <vargaz@freemail.hu>
508
509         * threads.c (CreateThread): Wrap pthread_attr_setstacksize call in
510         a conditional for platforms that don't have it.
511
512 2003-10-09  Bernie Solomon  <bernard@ugsolutions.com>
513
514         * threads.c: (CreateThread) use stacksize argument
515         if non-zero - change default for 64 bits to 4Mb
516
517 2003-09-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
518
519         * sockets.c: set last error when socket creation fails. This shed some
520         light on bug #49015.
521
522 2003-09-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
523
524         * processes.c: fixed bug #48973: we only change \ by / for the argument
525         to be used as command.
526         When getting the program name from the args, don't let the space between
527         them in the args.
528
529 2003-09-24  Bernie Solomon <bernard@ugsolutions.com>
530
531         * atomic.h atomic.c: fix sparc so lock is
532         global, increment does so and it compiles under Sun compiler.
533
534 2003-09-22  Bernie Solomon <bernard@ugsolutions.com>
535
536         * handles.c: include <string.h> directly as may
537         not be nested in <sys/un.h> like Linux
538
539 2003-09-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
540
541         * io.c:
542         (DeleteFile): call SetLastError on failure. Fix by
543         richard.torkar@htu.se (Richard Torkar). Closes bug #48222.
544
545 2003-09-15  Lluis Sanchez Gual  <lluis@ximian.com>
546
547         * daemon.c: In compare_process(), discard handles already signalled.
548
549 2003-09-02  Dick Porter  <dick@ximian.com>
550
551         * io.c: Work around glib brain-dead assumptions about utf8-encoded
552         filenames.  Fixes bug 30781.
553
554 2003-08-28  Dick Porter  <dick@ximian.com>
555
556         * critical-sections.c:  Patch from Bernie Solomon
557         <bernard@ugsolutions.com> to emit a warning if locking a critical
558         section fails.
559
560 2003-07-23  Dick Porter  <dick@ximian.com>
561
562         * shared.c:
563         * daemon.c (maybe_exit): Avoid the race condition when the daemon is
564         closing but another client comes along when the shared data is still
565         visible.  Should fix bugs 33671 and 35213.
566
567 2003-07-23  Dick Porter  <dick@ximian.com>
568
569         * handles.c:  Initialise handle mutex and cond.  Fix by
570         Bernie Solomon <bernard@ugsolutions.com>
571
572 2003-07-15  Dick Porter  <dick@ximian.com>
573
574         * timed-thread.c (timed_thread_start_routine): Fix virtual memory
575         leak when threads quit.  Fixes bug 44067.
576
577 Wed Jun 18 19:08:40 CEST 2003 Paolo Molaro <lupus@ximian.com>
578
579         * io.c: never add write permission for group or others in
580         SetFileAttributes ().
581
582 2003-06-17  Dick Porter  <dick@ximian.com>
583
584         * io.c (SetFileAttributes): Implement the ReadOnly attribute, and
585         ignore the unsupported ones ("fixes" bug 44977).
586
587 2003-06-17  Lluis Sanchez Gual  <lluis@ximian.com>
588
589         * misc.c: fix bug in _wapi_calc_timeout. It gave wrong values for
590           high ms values (there was an overflow).
591
592 2003-06-17  Zoltan Varga  <vargaz@freemail.hu>
593
594         * system.h (struct _WapiSystemInfo ): Fix warnings when using gcc-3.3.
595
596 2003-06-11  Dick Porter  <dick@ximian.com>
597
598         * shared.c: Fix shared directory creation.  Patch from
599         Pablo Baena <pbaena@uol.com.ar>
600
601 2003-06-10  Dick Porter  <dick@ximian.com>
602
603         * atomic.c: Delete the useless compile warning
604
605 2003-06-09  Dick Porter  <dick@ximian.com>
606
607         * daemon.c: Lookup env as a string array.  Fixes bug 44289.  Also
608         make setting the process handle value in the environment actually
609         work.
610
611         * processes.c: Pretty up the process name, if it happens to be
612         "mono" such as when another mono process forks "mono foo.exe"
613
614 2003-06-05  Dick Porter  <dick@ximian.com>
615
616         * processes.c (process_set_current): Don't do an expensive handle
617         search at application startup, check the environment to see if the
618         process handle has already been created.
619
620         * io.c: Don't do an expensive handle search when creating stdin,
621         stdout and stderr handles, just create them all the first time one
622         is requested.
623
624         * wapi-private.h:
625         * shared.c:
626         * shared.h:
627         * handles.c:
628         * handles-private.h:
629         * daemon-messages.h:
630         * daemon-private.h:
631         * daemon.c: Support for "unlimited" number of handles and scratch
632         data.
633
634         Speed up application startup by passing process handle in the
635         environment, rather than let the app scan all handles (which gets
636         really slow when there are more than a few thousand to check.)
637
638         Initialise some structs passed to syscalls, noticed by valgrind.
639         
640
641 2003-05-20  Dick Porter  <dick@ximian.com>
642
643         * io.c (FindFirstFile): Include . files in the glob.  Fixes bug
644         43229.
645
646 2003-05-19  Dick Porter  <dick@ximian.com>
647
648         * threads.c: Set the new thread's stack size to 2M.  Fix needed
649         for BSD, reported by Martin Dvorak <md@9ll.cz>
650
651 2003-05-16  Dick Porter  <dick@ximian.com>
652
653         * io.h:
654         * io.c: Implement GetTempPath()
655
656 2003-05-16  Dick Porter  <dick@ximian.com>
657
658         * processes.c (CreateProcess): Set some error codes
659
660 2003-05-12  Dick Porter  <dick@ximian.com>
661
662         * misc.c (_wapi_calc_timeout): Cope with overflowing tv_nsec.
663         Patch from Martin Dvorak <mdvorak@ninell.cz>.
664
665 2003-05-10  Dick Porter  <dick@ximian.com>
666
667         * io.c (CopyFile): Copy file mode as well as file data.  Based on
668         suggestion by Giuseppe Greco <giuseppe.greco@agamura.com>, bug
669         42706.
670
671 2003-05-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
672
673         * handles.c: don't call GC_gcollect when creating new handles.
674
675 2003-05-05  Gonzalo Paniagua Javier <gonzalo@ximian.com>
676
677         * handles.c: added some debugging code. Call GC_gcollect
678         before creating a new handle. It makes Lupus' test run smoother and
679         faster (from 62 to 83 request per second). Notice that calling
680         GC_finalizer_notifier if needed (GC_should_invoke_finalizer ()) does
681         not improve nor degrade the performance, so i don't do it.
682
683 2003-05-02  Dick Porter  <dick@ximian.com>
684
685         * sockets.c: Rearrange closesocket() and socket_close_private(),
686         and remember to unref the handle, so we don't leak socket handles.
687         Fix from Pelle Johnsen <pelle.johnsen@mail.dk>
688
689 2003-04-11  Dick Porter  <dick@ximian.com>
690
691         * atomic.h: ARM atomic operations by Malte Hildingson
692         <tds00mahi@tellus.thn.htu.se>
693
694 Tue Apr 8 11:37:29 CEST 2003 Paolo Molaro <lupus@ximian.com>
695
696         * atomic.h: fix macosx build by "Urs C. Muff" <umuff@quark.com>.
697
698 2003-04-03  Martin Baulig  <martin@ximian.com>
699
700         The following change is conditional to `WITH_INCLUDED_LIBGC'
701         which is not yet enabled by default.
702
703         * threads.c (SuspendThread, ResumeThread): Fully implemented this.
704         (gc_init): New static function; install a signal handler for
705         SIGPWR which is used to suspend threads.  [FIXME: it SIGPWR
706         doesn't exist on all Unix systems, we need to find another
707         signal].
708         (mono_wapi_push_thread_stack): New public function.  Tells the
709         garbage collector about the current stack pointer of a suspended
710         thread.
711
712 2003-04-03  Martin Baulig  <martin@ximian.com>
713
714         * timed-thread.h (TimedThread): Added `suspended_sem',
715         `suspend_count' and `stack_ptr'.
716
717 2003-03-28  Dick Porter  <dick@ximian.com>
718
719         * atomic.h: PPC support gratiously donated to the public domain
720         by John Duncan <jddst19@mac.com>
721
722 2003-03-20  Dick Porter  <dick@ximian.com>
723
724         * sockets.c (_wapi_connect): If connect() fails with EACCES, try
725         setting SO_BROADCAST and connecting again.  Fixes bug 39178.
726
727 2003-03-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
728
729         * processes.c: included Jerome Laban's patch and call SetLastError when
730         the executable is not found.
731
732 2003-03-03  Dick Porter  <dick@ximian.com>
733
734         * io.c (CreateFile): Try opening directories readonly, so that
735         timestamps can be adjusted.  Patch by Elan Feingold
736         <efeingold@mn.rr.com>.
737
738 2003-02-25  Dick Porter  <dick@ximian.com>
739
740         * shared.c (_wapi_shm_attach): Return a failure code on system
741         call errors, rather than exiting.
742
743 2003-02-21  Dick Porter  <dick@ximian.com>
744
745         * processes.c (GetCurrentProcessId): Use the current process
746         handle to return the process ID, as getpid() is unreliable
747         (linuxthreads gives each thread a different pid).  Fixes bug
748         37550.
749
750 2003-02-21  Dick Porter  <dick@ximian.com>
751
752         * io.c (FindNextFile): Skip over dangling symlinks.  Fixes bug
753         34076.
754
755 2003-02-11  Dick Porter  <dick@ximian.com>
756
757         * timefuncs.h: 
758         * timefuncs.c: Added GetTickCount()
759
760 2003-02-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
761
762         * error.c: added WSA_EHOSTUNREACH mapping.
763
764 2003-01-26  Miguel de Icaza  <miguel@ximian.com>
765
766         * io.c (SetFileAttributes): This routine is not currently
767         implemented for the general case, but I added a special case to
768         set the executable bit on Linux.
769
770 Wed Jan 15 15:55:40 CET 2003 Paolo Molaro <lupus@ximian.com>
771
772         * sockets.h, daemon.c, io.c: compilation fixes on MacOSX.
773
774 2003-01-08  Dick Porter  <dick@ximian.com>
775
776         * sockets.c: Fixed setting blocking mode to true (fixes bug 36388)
777
778 2002-12-11  Juli Mallett  <jmallett@FreeBSD.org>
779
780         * daemon.c, handles-private.h, handles.c, wapi-private.h:
781         Check for an implementation which says it supports
782         _POSIX_THREAD_PROCESS_SHARED, rather than just one that
783         defines the symbol.  Defined but with a value of -1 still
784         means that it is unsupported.
785
786 2002-12-08  Martin Baulig  <martin@ximian.com>
787
788         * handles.c (_wapi_handle_new): Create new non-shared handles with
789         an initial refcount of 1, not 0.
790
791 2002-11-22  Dietmar Maurer  <dietmar@ximian.com>
792
793         * threads.c (TlsGetValue): removed unnecessary mutex
794
795 2002-11-20  Dick Porter  <dick@ximian.com>
796
797         * timed-thread.c (_wapi_timed_thread_attach): Attached threads
798         need to store their data structure too.
799
800         * threads.c: Make sure the threading data is initialised wherever
801         it is needed
802
803 2002-11-15  Dick Porter  <dick@ximian.com>
804
805         * timed-thread.c: Removed unneeded parameters in
806         _wapi_timed_thread_attach().
807
808         * threads.c: Renamed AttachThread() to make it not look like
809         external API.  Removed unneeded parameters.
810
811 2002-11-11  Gonzalo Paniagua Javier <gonzalo@ximian.com>
812
813         * error.[ch]: added errno_to_WSA (). It displays a warning and return
814         WSASYSCALLFAILURE if there is no error mapping for the given errno,
815
816         * sockets.c: use errno_to_WSA and fixed display of warning for h_errno.
817
818 2002-10-31  Dick Porter  <dick@ximian.com>
819
820         * io.h: 
821         * io.c: Define and use INVALID_FILE_ATTRIBUTES
822
823 2002-10-07  Dick Porter  <dick@ximian.com>
824
825         * timefuncs.c:
826         * daemon.c: Use a more accurate time source for process start and
827         end times.
828
829 2002-10-03  Dick Porter  <dick@ximian.com>
830
831         * daemon.c:
832         * handles.c:
833         * threads.c:  Fixes for freebsd.  Make sure that mutex and condition
834         creation and deletion happen in the process that owns them, when
835         POSIX shared thread objects aren't supported.  This breaks on
836         freebsd, as pthread_t is a pointer to data.
837
838 2002-10-02  Dick Porter  <dick@ximian.com>
839
840         * shared.c: Use mmap() instead of sysv shm for the shared data.
841
842         * wapi-private.h (_WAPI_HANDLE_VERSION): Reset back to 0, for the
843         new system
844
845         * daemon-private.h: 
846         * daemon.c: mmap()ed regions survive fork, so just pass the
847         pointer to _wapi_daemon_main instead of mapping it again.
848
849 2002-10-01  Dick Porter  <dick@ximian.com>
850
851         * timed-thread.c: Kludge for CREATE_SUSPENDED thread creation.
852         Unfortunately libgc uses the same thread suspend technique that I
853         want to, and the two don't mix: libgc will deadlock when it tries
854         to stop the world if a thread has already been suspended by
855         someone else.  Just do the simple suspended create rather than the
856         general purpose thread suspension for now.
857
858         * threads.c: Pass create flags to the timed_thread create call, to
859         implement suspended thread creation.  ResumeThread() partially
860         implemented, to cope with the case where a newly created but
861         suspended thread is launched.
862
863 2002-09-30  Dick Porter  <dick@ximian.com>
864
865         * sockets.c (ioctlsocket): Set non-blocking mode in a better way,
866         with fcntl.
867
868 2002-09-27  Dick Porter  <dick@ximian.com>
869
870         * semaphores.c: Only include semaphore.h if it's present. Patch
871         for BSD from jmmv@hispabsd.org (Julio Merino).
872
873 2002-09-27  Dick Porter  <dick@ximian.com>
874
875         * processes.c: Pass environment and working directory to the
876         daemon when forking.  Don't let argv[0] be duplicated when looking
877         for the program name.  Implement EnumProcessModules (simple
878         version for now, lsof-style later if needed), GetModuleBaseName,
879         {Get,Set}ProcessWorkingSetSize (just faked, because the vm hints
880         aren't available on Linux).
881
882         * process-private.h: Store the process name, and the working set
883         min and max
884
885         * handles.c:
886         * handles-private.h: New functions to store and retrieve an array
887         of strings in the scratch space
888
889         * daemon.c: Don't miss deleting some handles when a client exits
890         (we used to rely on the client doing the final cleanup, but
891         obviously if the client is no longer there the daemon has to do
892         it).
893
894         Process forking now sets the environment and the working
895         directory.
896
897         * io.c: Don't confuse fd 0 with an unassigned handle struct
898
899         * atomic.h: Add a google cache alternative to the msdn URL
900
901 2002-09-25  Gonzalo Paniagua Javier <gonzalo@ximian.com>
902
903         * sockets.c:
904         (_wapi_recvfrom): added ECONNRESET to the switch.
905
906 2002-09-24  Mark Crichton  <crichton@gimp.org>
907
908         * atomic.h: Yea.  On linux, sparc isn't sparc, it's __sparc__.
909         Added to ifdef.
910
911 2002-09-19  Mark Crichton  <crichton@gimp.org>
912
913         * daemon.c, shared.c: Added NEED_LINK_UNLINK for systems that
914         dont have Linux's abstract filesystem for sockets.
915
916 2002-09-19  Mark Crichton  <crichton@gimp.org>
917
918         * atomic.h: Added SPARC atomic asm code.
919         * daemon.c, handles-private.h, handles.c, wapi-private.h:
920         undefined _POSIX_THREAD_PROCESS_SHARED.  This actually exists on
921         Solaris 9, however, the code paths don't seem to work.  More testing
922         on the shared case is *really* needed.
923
924 2002-09-03  Dick Porter  <dick@ximian.com>
925
926         * threads.h: 
927         * threads.c: Removed PosixKillThread(), because it's not in the
928         w32 api
929
930 2002-08-20  Dick Porter  <dick@ximian.com>
931
932         * handles.c (_wapi_handle_scratch_store): Made stored byte lengths
933         multiples of 4 bytes, to keep header structures aligned.  Needed
934         for sparc, at least. (Patch from crichton@gimp.org)
935
936         * handles.c: Removed 'disable_shm' variable (we've defaulted to
937         building with shm enabled for months now)
938
939 2002-08-19  Dick Porter  <dick@ximian.com>
940
941         * daemon.c: Rewrote the poll() loop to use GIOChannels instead,
942         for legacy NeXT-based systems.
943
944 2002-08-12  Dick Porter  <dick@ximian.com>
945
946         * atomic.h: Rename some parameters to avoid c++ keywords (Patch
947         from Joseph Wenninger <kde@jowenn.at>)
948
949 2002-08-05  Dietmar Maurer  <dietmar@ximian.com>
950
951         * threads.c: use fast spinlocks by default
952
953 2002-08-02  Dick Porter  <dick@ximian.com>
954
955         * io.c (GetStdHandle): Add a handle reference when returning a
956         duplicate console handle.  This fixes the unref_handle errors in
957         NUnit.
958
959 2002-08-01  Dietmar Maurer  <dietmar@ximian.com>
960
961         * threads.c (TLS_PTHREAD_MUTEX): define this because else some
962         tests does not work
963
964 2002-08-01  Dick Porter  <dick@ximian.com>
965
966         * threads.c: Use atomic spinlocks in TLS functions
967
968         * mono-spinlock.h:
969         * Makefile.am: Added mono-spinlock.h
970
971 2002-07-21  Jeffrey Stedfast  <fejj@ximian.com>
972
973         * daemon-messages.c: #include <sys/types.h> and <sys/sockets.h> -
974         these are needed for sendmsg() and also for struct msghdr (at
975         least on Solaris). Solaris still won't build because struct msghdr
976         doesn't have msg_flags, msg_control, or msg_controllen members.
977         (CMSG_SPACE): Define for systems that don't have it.
978         (CMSG_LEN): Same.
979
980 2002-07-20  Dick Porter  <dick@ximian.com>
981
982         * wapi-private.h:
983         * io-private.h:
984         * io.h:
985         * io.c:
986         * handles.c: Implemented pipe handles
987         
988         * handles.c:
989         * daemon.c: Fixed bug in handle closing.
990
991         * shared.c:
992         * daemon.c: Forked processes now close all open file descriptors.
993
994 Fri Jul 19 19:05:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
995
996         * sockets.h, io-layer.h, critical-sections.h: don't include config.h
997         in header files.
998
999 2002-07-19  Martin Baulig  <martin@gnome.org>
1000
1001         * threads.c (ExitThread): Call exit() if no threads has been
1002         created yet.
1003
1004 2002-07-17  Dick Porter  <dick@ximian.com>
1005
1006         * daemon-messages.c: Freebsd fixes from Andreas Kohn
1007         <andreas.kohn@gmx.net>
1008
1009 2002-07-15  Dick Porter  <dick@ximian.com>
1010
1011         * io.c: Removed bogus console_flush() method, that was just cut
1012         and pasted from file_flush when I separated the two handle types.
1013
1014 2002-07-12  Dick Porter  <dick@ximian.com>
1015
1016         * io.c (convert_from_flags): Fixed misunderstanding wrt fcntl
1017         flags.  Fixes bug 27633.
1018
1019 2002-07-12  Dick Porter  <dick@ximian.com>
1020
1021         * wapi-private.h:
1022         * handles.c:
1023         * daemon.c: Use size of sockaddr_un.sun_path from config.h
1024
1025 2002-07-12  Dick Porter  <dick@ximian.com>
1026
1027         * processes.c (CreateProcess): Send stdin, stdout and stderr
1028         handles if the startup info doesnt specify new ones
1029
1030         * io.c (GetStdHandle): Return the same handle when the same
1031         standard handle is requested
1032
1033         * handles.c: Pass file descriptors when forking
1034
1035         * daemon.c: Use supplied file descriptors when forking a new
1036         process
1037
1038         * daemon-messages.h: 
1039         * daemon-messages.c: Pass stdin, stdout and stderr file
1040         descriptors to the daemon (used when forking)
1041
1042 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
1043
1044         * daemon.c (_wapi_daemon_main): Use sizeof
1045         (main_socket_address.sun_path) instead of hardcoded 108 value.
1046
1047         * handles.c (shared_init): Use sizeof
1048         (shared_socket_address.sun_path) instead of hardcoded 108 value.
1049
1050 2002-07-10  Dennis Haney  <davh@davh.dk>
1051
1052         * shared.c:
1053         * handles.c:
1054         * daemon.c: Lots of documentation, some added error checking, and
1055         code readability improvements.
1056
1057         * daemon-messages.h: Add the Error request type to improve error
1058         checking.
1059
1060         * daemon-messages.c: Do a bit more error checking on send() and
1061         recv(), and log errors with a higher severity level.
1062
1063 2002-07-04  Dick Porter  <dick@ximian.com>
1064
1065         * daemon.c (process_process_fork): Fix argument handling, due to
1066         buggy understanding of g_strsplit() behaviour.
1067
1068 2002-07-03  Dick Porter  <dick@ximian.com>
1069
1070         * threads.h:
1071         * threads.c: Implement OpenThread().  Define access-control values
1072         for thread handles.
1073
1074         * wapi.h:
1075         * processes.h:
1076         * access.h:
1077         * Makefile.am: Added access.h, to hold shared access-control
1078         definitions
1079
1080 2002-07-02  Dick Porter  <dick@ximian.com>
1081
1082         * wapi-private.h (_WAPI_HANDLE_VERSION): New protocol version
1083         
1084 2002-07-02  Dick Porter  <dick@ximian.com>
1085
1086         * handles.c (shared_init): Make a second attempt to contact the
1087         daemon if the shared memory attach succeeds, but the connect()
1088         fails. (This copes with the daemon crashing without cleaning up
1089         the shared memory.)
1090
1091         * Makefile.am: 
1092         * daemon-private.h:
1093         * daemon.c:
1094         * shared.c (_wapi_shm_attach): Don't exec() anything when we fork
1095         the daemon, it's now built into the library.
1096
1097 2002-06-25  Dick Porter  <dick@ximian.com>
1098
1099         * handles.c:
1100         * handles-private.h:
1101         * daemon-messages.h:
1102         * daemon.c: Process forking and handle data management
1103
1104         * processes.h:
1105         * process-private.h:
1106         * processes.c: Process forking and other support functions
1107
1108 2002-06-25  Dick Porter  <dick@ximian.com>
1109
1110         * versioninfo.h: PE resource decoding
1111
1112         * unicode.c (_wapi_unicode_to_utf8): g_utf16_to_utf8 doesnt need
1113         to be told the string length
1114
1115         * io.c: Removed the ACTUALLY_DO_UNICODE option.  Fixed some leaks.
1116         Moved _wapi_time_t_to_filetime and the WapiFileTime typedef to
1117         timefuncs.c
1118
1119 2002-06-12  Dick Porter  <dick@ximian.com>
1120
1121         * daemon.c: 
1122         * daemon-messages.c: Handle SIGPIPE in a non-stupid way in the
1123         daemon, if MSG_NOSIGNAL isn't available.  Thanks to Jaroslaw
1124         Kowalski <jarek@atm.com.pl> for pointing out the bogosity.
1125
1126 2002-06-10  Jaroslaw Kowalski <jarek@atm.com.pl>
1127
1128         * sockets.c, daemon-messages.c: Prevent SIGPIPE from being raised
1129         when writing to a closed socket.
1130
1131 2002-06-08  Jeffrey Stedfast  <fejj@ximian.com>
1132
1133         * mono-mutex.c (mono_once): New convenience function for my
1134         previous fix.
1135
1136         * handles.c:
1137         * error.c: 
1138         * critical-sections.c: 
1139         * threads.c: 
1140         * sockets.c: 
1141         * semaphores.c: 
1142         * processes.c: 
1143         * mutexes.c: 
1144         * io.c: 
1145         * events.c: 
1146         * atomic.c: Use mono_once() rather than pthread_once().
1147
1148 2002-06-06  Jeffrey Stedfast  <fejj@ximian.com>
1149
1150         * handles.c (_wapi_handle_new): pthread_once() is not atomic, so
1151         if multiple threads all try to call _wapi_handle_new() before the
1152         shared data has been initialized, it is possible that we could get
1153         into a condition where shared_init() is being executed and later
1154         threads will pass by pthread_once() due to the fact that it has
1155         already been called and so therefor will attempt to use the shared
1156         data before it has been completely initialized. If we instead use
1157         a standard mutex locking mechanism around shared_init(), we can
1158         avoid the situation entirely. By wrapping the mutex locking in a
1159         check to see if we've already initialized the data, we can even
1160         avoid wasting resources by having to lock/unlock the mutex in any
1161         later calls (the only time we'd have to worry about
1162         locking/unlocking is the initial race to call shared_init() at
1163         startup).
1164
1165 Sat Jun 1 13:27:11 CEST 2002 Paolo Molaro <lupus@ximian.com>
1166
1167         * atomic.h: inline asm fixes from Dennis Haney (davh@davh.dk).
1168
1169 Fri May 31 16:21:54 CEST 2002 Paolo Molaro <lupus@ximian.com>
1170
1171         * daemon.c, handles.c: rename "sun" local var since it's apparently
1172         a #define on Solaris.
1173
1174 Fri May 31 15:40:14 CEST 2002 Paolo Molaro <lupus@ximian.com>
1175
1176         * daemon-messages.c: work-around MSG_NOSIGNAL missing on some
1177         platforms.
1178
1179 2002-05-15  Dick Porter  <dick@ximian.com>
1180
1181         * wait.c: Fix a deadlock in WaitForMultipleObjects
1182
1183 2002-05-14  Dick Porter  <dick@ximian.com>
1184
1185         * io.c: Fix a cut&paste error, found by
1186         Jaroslaw Kowalski <jarek@atm.com.pl>
1187
1188 2002-05-10  Dan Lewis  <dihlewis@yahoo.co.uk>
1189
1190         * io.c: Nasty typo.
1191
1192 2002-05-09  Dick Porter  <dick@ximian.com>
1193
1194         * threads.c: 
1195         * semaphores.c: 
1196         * processes.c: 
1197         * mutexes.c: 
1198         * handles-private.h: 
1199         * events.c: 
1200         * Makefile.am: Remove now-unused file wait-private.h
1201
1202 2002-05-08  Dick Porter  <dick@ximian.com>
1203
1204         * shared.c: Better error messages, and report when daemon
1205         connection fails rather than blocking forever.  Do some more
1206         shared memory sanity checking.
1207
1208         * handles.c: Better error messages when connecting to shared
1209         memory and the handle daemon.  Fall back to non-shared handles if
1210         an error occurs.  Set the default back to 'shared handles'.  Fix a
1211         crashing bug in scratch space allocation that mangled the block
1212         headers.
1213
1214 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
1215
1216         * handles.c (shared_init): Disable SHM for now, people have too
1217         many problems with this, and the diagnostics are not helping.
1218
1219 2002-05-06  Dan Lewis  <dihlewis@yahoo.co.uk>
1220
1221         * io.c: CreateFile sets win32 last error.
1222
1223 2002-05-05  Dick Porter  <dick@ximian.com>
1224
1225         * wapi-private.h: 
1226         * handles-private.h:
1227         * io.c: 
1228         * io-private.h:
1229         * mutexes.c: 
1230         * mutex-private.h: 
1231         * processes.c: 
1232         * process-private.h: 
1233         * semaphores.c: 
1234         * semaphore-private.h: 
1235         * sockets.c: 
1236         * socket-private.h: 
1237         * events.c: 
1238         * event-private.h: Simplify the WapiHandleOps struct: take out all
1239         the file-specific entries, leaving just the items that operate on
1240         handles themselves.  Split the close operation into shared and
1241         private parts: shared close is called by the daemon.
1242
1243         * handles.c: As above, but also pass handle allocation, ref and
1244         unref operations to the daemon.  Populate the handle_ops array at
1245         compile time, because the daemon needs to call ops on handles too.
1246         Don't bother to track open handle counts any more, the daemon does
1247         that.
1248         
1249         * threads.c: 
1250         * thread-private.h: As above, but also make the thread data
1251         handle-private.
1252
1253         * shared.c: Fork a handle daemon if the calling process created
1254         the shared memory segment.
1255
1256         * daemon.c:
1257         * daemon-messages.c:
1258         * daemon-messages.h:
1259         * Makefile.am: Build a daemon to manage handle allocation and
1260         destruction without needing to lock the shared memory
1261
1262 2002-04-30  Jeffrey Stedfast  <fejj@ximian.com>
1263
1264         * atomic.c: Changed to use a normal mutex rather than a spinlock
1265         since a lot of platforms seem to not have them :\
1266
1267 2002-04-30  Dick Porter  <dick@ximian.com>
1268
1269         * Completely rewrote the handle waiting code: removed the helper
1270         thread and its attendant complexity.  All handle waiting is now
1271         abstracted into the WaitForSingleObject() and
1272         WaitForMultipleObjects() functions.
1273
1274         * Implemented inter-process sharing of handles using sysv shared
1275         memory.  This makes handles even more opaque, with a handle now
1276         just an index into an array.
1277         
1278 2002-04-25  Dan Lewis  <dihlewis@yahoo.co.uk>
1279
1280         * io.c: unitialized pointer in GetCurrentDirectory.
1281
1282 Sat Apr 20 13:37:39 CEST 2002 Paolo Molaro <lupus@ximian.com>
1283
1284         * threads.c: destroy the mutex at thread destruction
1285         (if/when thread destruction code will be actually called).
1286         When protecting a tls data pointer from the gc, use also the 
1287         thread id in the key.
1288         
1289 Wed Apr 17 18:36:27 CEST 2002 Paolo Molaro <lupus@ximian.com>
1290
1291         * timed-thread.c: avoid race condition when setting the thread to
1292         detached.
1293
1294 2002-04-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
1295
1296         * jit.h: to more #include lines to avoid breaking compilation
1297         under windows when upgrading mingw and w32api to version
1298         1.3 (thanks Dick!).
1299
1300 2002-04-16  Dick Porter  <dick@ximian.com>
1301
1302         * atomic.h: Explanatory comment about lack of 80386 support
1303
1304 2002-04-15  Dick Porter  <dick@ximian.com>
1305
1306         * atomic.h: use xaddl for InterlockedIncrement() and
1307         InterlockedDecrement().  Use cmpxchgl in a loop for
1308         InterlockedExchange() and InterlockedExchangePointer().
1309
1310 Mon Apr 15 13:31:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
1311
1312         * unicode.c: fix unicode_len() to not access uninitialized memory
1313         (and updated to conform to mono code style).
1314
1315 Fri Mar 29 17:15:11 CET 2002 Paolo Molaro <lupus@ximian.com>
1316
1317         * io.c: EEXISTS is ignored for directory creation.
1318         * mono-mutex.h: remove silly "pragma }" that emacs users insert
1319         because they use a broken editor:-)
1320
1321 2002-03-28  Dick Porter  <dick@ximian.com>
1322
1323         * sockets.h: 
1324         * sockets.c: 
1325         * io.c: 
1326         * handles.h: 
1327         * handles.c: Warning cleanups
1328
1329 2002-03-27  Dan Lewis <dihlewis@yahoo.co.uk>
1330
1331         * unicode.h, unicode.c: changed to gunichar2
1332         * io.h, io.c: changed strings to gunichar2*, added
1333         SetFileAttributes(), GetCurrentDirectory(), SetCurrentDirectory(),
1334         some fixes to FindFirstFile() and friends.
1335
1336 2002-03-26  Dick Porter  <dick@ximian.com>
1337
1338         * types.h: Implement the large integer struct
1339
1340         * timefuncs.h:
1341         * timefuncs.c: Dummy functions that don't yet implement
1342         QueryPerformanceCounter() and QueryPerformanceFrequency()
1343
1344         * threads.h:
1345         * threads.c: Implement SleepEx()
1346
1347         * system.h:
1348         * system.c: Beginnings of GetSystemInfo()
1349
1350         * mono-mutex.c (pthread_mutex_timedlock): Fix a ms/ns conversion
1351         thinko
1352
1353         * context.h:
1354         * context.c: Dummy function that doesnt yet implement
1355         GetThreadContext()
1356
1357         * atomic.h: 
1358         * atomic.c: Interlocked functions
1359
1360 Mon Mar 25 13:01:40 CET 2002 Paolo Molaro <lupus@ximian.com>
1361
1362         * threads.c: use a gc-safe hash table to store tls pointers.
1363
1364 2002-03-22  Dick Porter  <dick@ximian.com>
1365
1366         * threads.c: Fix a race condition where a thread can start and
1367         exit before the handle has been properly initialised (no reason
1368         why the handle couldn't be initialised beforehand, so do so)
1369
1370         Fix a ms to ns conversion magnitude thinko.
1371
1372 2002-03-21  Dick Porter  <dick@ximian.com>
1373
1374         * semaphores.c: Fix a problem when waiting for one or more
1375         semaphores, and another semaphore is Released (all waiting
1376         semaphores assumed they were signalled)
1377
1378 2002-03-29  Dan Lewis <dihlewis@yahoo.co.uk>
1379
1380         * io.h, io.c, uglify.h: added MoveFile, CopyFile, CreateDirectory,
1381         RemoveDirectory, GetFileAttributes, GetFileAttributesEx
1382
1383 2002-03-19  Dietmar Maurer  <dietmar@ximian.com>
1384
1385         * threads.c (Sleep): bug fix: 1ms == 1000000ns
1386
1387 2002-03-19  Dan Lewis <dihlewis@yahoo.co.uk>
1388
1389         * io.h, io.c, events.c, mutexes.c, semaphores.c, sockets.c,
1390         threads.c, io.c: added flush method to handles.
1391
1392         * io.c: FlushFileBuffers() and FindFirstFile() functions.
1393
1394 Thu Mar 7 17:21:52 CET 2002 Paolo Molaro <lupus@ximian.com>
1395
1396         * threads.c, timed-thread.c, wait.c: Boehm-GC anable.
1397
1398 2002-02-20  Dick Porter  <dick@ximian.com>
1399
1400         * io-layer.h: Always build without cygwin support on windows
1401
1402 Mon Feb 18 15:50:59 CET 2002 Paolo Molaro <lupus@ximian.com>
1403
1404         * sockets.c: #undef DEBUG.
1405
1406 2002-02-14  Jeffrey Stedfast  <fejj@ximian.com>
1407
1408         * io-layer.h: conditionally include sys/filio.h and sys/sockio.h
1409         for FIONBIO, FIONREAD, and SIOCATMARK.
1410
1411 2002-02-14  Jeffrey Stedfast  <fejj@ximian.com>
1412
1413         * sockets.c: conditionally include sys/filio.h and sys/sockio.h
1414         for FIONBIO, FIONREAD, and SIOCATMARK.
1415
1416 2002-02-13  Dick Porter  <dick@ximian.com>
1417
1418         * sockets.c: Implement shutdown and select
1419
1420 2002-02-13  Jeffrey Stedfast  <fejj@ximian.com>
1421
1422         * mono-mutex.[c,h]: New source files that thinly wrap all pthread
1423         functions that take pthread_mutex_t and/or pthread_mutexattr_t
1424         arguments for the sake of portability. Implements recursive
1425         mutexes and pthread_mutex_timedlock.
1426
1427         * critical-sections.c:
1428         * events.c:
1429         * handles.c:
1430         * mutexes.c:
1431         * semaphores.c:
1432         * threads.c:
1433         * timed-thread.c:
1434         * wait.c: Use the mono-mutex wrapper portability functions/macros.
1435
1436         * pthread-compat.[c,h]: Replaced by mono-mutex.[c,h]
1437
1438 2002-01-23  Dick Porter  <dick@ximian.com>
1439
1440         * sockets.c: Networking support, mostly wrapping BSD socket APIs
1441         with handle code, and translating errno into w32 error codes.
1442
1443         * macros.h: Some w32 macros used with the socket support
1444
1445         * error.c: Implemented GetLastError() and SetLastError()
1446
1447         * Makefile.am: Added sockets, with kludge to override some symbols
1448
1449 2001-12-17  Dietmar Maurer  <dietmar@ximian.com>
1450
1451         * unicode.c (_wapi_unicode_to_utf8): byteswap UTF16 strings before
1452         passing them to iconv
1453         (_wapi_unicode_to_utf8): only swap bytes on LE systems, remove bug
1454         from previous commit.
1455
1456 2001-12-11  Dick Porter  <dick@ximian.com>
1457
1458         * io.c: Implement DeleteFile(), GetFileTime(), SetFileTime() and
1459         FileTimeToSystemTime().
1460
1461         * unicode.c (unicode_len): Nasty way of finding length of unicode
1462         string with embedded NULLs (counts until two NULLs together).
1463
1464         * mutexes.c (mutex_close): 
1465         * events.c (event_close): Release the internal pthreads resources
1466
1467 2001-11-26  Dick Porter  <dick@ximian.com>
1468
1469         * critical-sections.c:
1470         * events.c:
1471         * handles.c:
1472         * io.c:
1473         * mutexes.c:
1474         * semaphores.c:
1475         * threads.c:
1476         * timed-thread.c:
1477         * wait.c: turn off DEBUG messages
1478
1479 2001-11-22  Dick Porter  <dick@ximian.com>
1480
1481         * handles.c (SignalObjectAndWait): Implement
1482
1483         * wait.c (WaitForSingleObject): Fix case where timeout == 0
1484
1485         * threads.c:
1486         * semaphores.c:
1487         * mutexes.c:
1488         * io.c:
1489         * events.c: Support for SignalObjectAndWait
1490         
1491 2001-11-21  Dick Porter  <dick@ximian.com>
1492
1493         * events.c:
1494         * handles.c:
1495         * mutexes.c:
1496         * semaphores.c:
1497         * threads.c:
1498         * wait.c: Reliable method of returning which handle was signalled
1499         on return from WaitForMultipleObjects().
1500
1501 2001-11-21  Dick Porter  <dick@ximian.com>
1502
1503         * events.c: Implement events
1504
1505 2001-11-15  Dick Porter  <dick@ximian.com>
1506
1507         * mutexes.c: Implement mutexes
1508
1509         * threads.c: 
1510         * semaphores.c: 
1511         * misc.c: Factor out some common code
1512
1513 2001-11-13  Dick Porter  <dick@ximian.com>
1514
1515         * threads.c: Implement TLS.  Implement GetCurrentThreadId(), and
1516         GetCurrentThread() by maintaining a hash of thread handles.
1517
1518         * threads.h: Define thread and process creation flags
1519
1520 2001-11-12  Dick Porter  <dick@ximian.com>
1521
1522         * critical-sections.c: Implement critical sections
1523
1524 2001-11-12  Dick Porter  <dick@ximian.com>
1525
1526         * semaphores.c: Implement semaphores
1527
1528         * wait.c (wait_for_item): Maintain a wait count rather than count
1529         signalled booleans.
1530
1531         * threads.c (thread_wait_multiple): Don't lock the wait item, that
1532         will block other wait threads
1533
1534 2001-11-11  Dick Porter  <dick@ximian.com>
1535
1536         * Makefile.am: Rename some automake variables
1537         (from Nick Drochak <ndrochak@gol.com>)
1538
1539 2001-11-10  Dick Porter  <dick@ximian.com>
1540
1541         * Makefile.am (libwapiincludedir): Fix include destination
1542
1543         * .cvsignore: Ignore generated files
1544
1545 2001-11-10  Dietmar Maurer  <dietmar@ximian.com>
1546
1547         * pthread-compat.c: added some include files to make it compile on
1548         linux.
1549
1550 2001-11-08  Dick Porter  <dick@ximian.com>
1551
1552         * Initial checkin.
1553
1554         This is a library emulating the win32 threading and IO API.