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