2010-06-01 Geoff Norton <gnorton@novell.com>
[mono.git] / mono / io-layer / ChangeLog
1 2010-06-01  Geoff Norton  <gnorton@novell.com>
2
3         * sockets.c: Don't call poll directly, use mono_poll.
4
5 2010-04-29  Geoff Norton  <gnorton@novell.com>
6
7         * mono-spinlock.h: Remove
8         * wthreads.c: Don't spinlock here, use a mutex instead
9
10 2010-04-26  Geoff Norton  <gnorton@novell.com>
11
12         * processes.c: Fix this for 64-bit darwin.
13
14 2010-04-20  Jonathan Pryor  <jpryor@novell.com>
15
16         * collection.c: Cleanup platform checks around
17           pthread_attr_setstacksize(), and instead always use
18           MAX(65536, PTHREAD_STACK_MIN) as the stack size.
19         * mono-mutex.c: Remove near duplicate pthread_mutex_timedlock()
20           declarations, and merge via a CONST_NEEDED intermediate #define.
21
22 2010-04-19  Jonathan Pryor  <jpryor@novell.com>
23
24         * collection.c, mono-mutex.c: Add Android support.
25
26 2010-04-14  Zoltan Varga  <vargaz@gmail.com>
27
28         * collection.c (_wapi_collection_init): Set stack size on openbsd similarly to
29         the other BSDs.
30
31 2010-04-10  Andreas Färber  <andreas.faerber@web.de>
32
33         * processes.c (EnumProcesses, load_modules): Add implementations
34         for Haiku. Fixes build on Haiku.
35         (OpenProcess, EnumProcessModules, get_process_name_from_proc):
36         Tweak implementations for Haiku.
37         * process-private.h: Fix _WAPI_PROCESS_UNHANDLED_PID_MASK for
38         32-bit pids (Haiku).
39         * ChangeLog: Fix UTF-8 encoding
40
41         Code is contributed under MIT/X11 license.
42
43 2010-04-09  Zoltan Varga  <vargaz@gmail.com>
44
45         * processes.c: Applied more openbsd changes from Robert Nagy <robert@openbsd.org>.
46
47 2009-04-06 Rodrigo Kumpera  <rkumpera@novell.com>
48
49         * wthreads.c (TlsSetValue): Don't take locks here. We trust pthread_setspecific
50         return value to tell if we tried to store to an invalid slot.
51
52 2010-04-04  Zoltan Varga  <vargaz@gmail.com>
53
54         * processes.c: Applied more openbsd changes from Robert Nagy <robert@openbsd.org>.
55
56 2010-04-03  Zoltan Varga  <vargaz@gmail.com>
57
58         * processes.c: Applied more openbsd changes from Robert Nagy <robert@openbsd.org>.
59
60 2010-04-03  Zoltan Varga  <vargaz@gmail.com>
61
62         * processes.c: Applied some openbsd changes from Robert Nagy <robert@openbsd.org>.
63
64 2010-03-26  Zoltan Varga  <vargaz@gmail.com>
65
66         * sockets.c: Apply some openbsd changes from openbsd ports.
67
68 2010-03-26  Zoltan Varga  <vargaz@gmail.com>
69
70         * shared.c: Disable shared supported by default, it can be enabled by setting
71         the MONO_ENABLE_SHM env variable.
72
73 2009-03-22 Rodrigo Kumpera  <rkumpera@novell.com>
74
75         * threads.h: Add wapi_self_interrupt.
76
77         * wthreads.c: Add wapi_self_interrupt which puts the current
78         thread in interrupted state.
79
80         * wthreads.c (wapi_thread_clear_wait_handle): Previous handle
81         can possibly be NULL if an async interrupt cleared it.
82
83         This is safe because it is only async cleared if running inside a
84         handler block.
85
86 2010-03-06 Gonzalo Paniagua Javier <gonzalo@novell.com>
87
88         * processes.c: made ShellExecuteEx actually work when the file name to
89         execute is quoted. Display a message intead of blindly ignoring the
90         result of g_shell_parse_argv(). Fixes bug #385497.
91
92 2010-03-05  Zoltan Varga  <vargaz@gmail.com>
93
94         * shared.c (shm_semaphores_init): Applied patch from Cal Page
95         (age.cal@gmail.com). Fix support for USE_SHM.
96
97 2010-02-25  Geoff Norton  <gnorton@novell.com>
98
99         * wait.c: If any of our handles are shared, we need to do
100         a polling wait so we're notified of the signal change.
101
102 Wed Feb 24 16:01:37 CET 2010 Paolo Molaro <lupus@ximian.com>
103
104         * Makefile.am: don't install the headers anymore, they are private.
105
106 2010-02-20  Zoltan Varga  <vargaz@gmail.com>
107
108         * versioninfo.c (VerLanguageName): Remove code duplication a bit.
109
110 2009-12-02  Miguel de Icaza  <miguel@novell.com>
111
112         * processes.c (EnumProcesses): Add support for OSX, patch from Tom
113         Philpot <tom.philpot@logos.com>
114
115 2009-11-30  Carlos Alberto Cortez <calberto.cortez@gmail.com>
116
117         * io.cs: In CopyFile check if the destination already exists before
118         trying to open it, and if it is the same as the source, report an error,
119         just as .net does. We do the check here to take advantage of the IOMAP
120         capability.
121         Fixes #510230.
122
123 2009-11-13 Jonathan Chambers <joncham@gmail.com>
124
125         * mono-mutex.h: Implementation for Windows platform.
126         
127         Code contributed under MIT/X11 license.
128
129 2009-11-13  Zoltan Varga  <vargaz@gmail.com>
130
131         * processes.c: Include mono-path.h.
132
133 2009-11-12  Geoff Norton  <gnorton@novell.com>
134
135         * processes.c: match_procname_to_modulename should resolve
136         symlinks when checking if two process modules match.
137
138 2009-11-04 Jonathan Chambers <joncham@gmail.com>
139
140         * mono-mutex.h: Add skeleton implementation for Windows platform.
141         
142         Code contributed under MIT/X11 license.
143
144 2009-10-21 Gonzalo Paniagua Javier <gonzalo@novell.com>
145
146         * sockets.[ch]: fix function definition.
147
148 2009-10-21 Gonzalo Paniagua Javier <gonzalo@novell.com>
149
150         * sockets.[ch]: added TransmitFile implementation.
151
152 2009-10-04  Zoltan Varga  <vargaz@gmail.com>
153
154         * processes.c: Implement get_process_name_from_proc () on solaris.
155
156 2009-09-24  Zoltan Varga  <vargaz@gmail.com>
157
158         * processes.c (load_modules): Applied patch from Thomas Philpot
159         (tom.philpot@logos.com). Fixes #533893.
160
161 2009-09-15  Jeffrey Stedfast  <fejj@novell.com>
162
163         * io.c (CreateFile): In the directory fallback case, use
164         _wapi_open() again so that IOMAP magic happens.
165         (CopyFile): Need to consistently use _wapi_open() here too.
166         (ReplaceFile): Use _wapi_open() here too and get rid of the
167         fallback code that tried re-opening the file w/o O_TRUNC since
168         there's no reason to do that.
169
170 2009-09-05  Zoltan Varga  <vargaz@gmail.com>
171
172         * handles.c (_wapi_handle_real_new): Call _wapi_process_reap () when running
173         out of shared handes. Fixes #536776.
174
175         * processes.c (CreateProcess): Return false and set the error to
176         ERROR_OUTOFMEMORY when a process handle cannot be created.
177         (ShellExecuteEx): Propagate an ERROR_OUTOFMEMORY error code. Fixes part of
178         #536776.
179
180 2009-09-01  Zoltan Varga  <vargaz@gmail.com>
181
182         * processes.c (EnumProcessModules): Applied patch from Romain Tartière
183         (romain@blogreen.org). Fix this on freebsd/OSX. Fixes #533893.
184
185 2009-08-18  Christian Hergert  <chris@dronelabs.com>
186
187         * wthreads.c: Roll back change for thread-id as it "embraces
188         and extends" the api by passing word-size for thread id on
189         s390 and amd64.
190
191 2009-08-18  Christian Hergert  <chris@dronelabs.com>
192
193         * security.c:
194         * processes.c:
195         * wthreads.c: Be explicit when we are changing word sizes.
196
197 2009-08-18  Christian Hergert  <chris@dronelabs.com>
198
199         * processes.c: Fix method declaration warnings.
200         * sockets.c: getsockopt() wants socklen_t for size.
201
202 2009-08-04  Miguel de Icaza  <miguel@novell.com>
203
204         * posix.c (_wapi_stdhandle_create): Split this into a new file to
205         more easily support non-Posix platforms.
206
207 2009-07-20  Geoff Norton  <gnorton@novell.com>
208
209         * thread-private.h: Use the new mono-semaphore.h.
210
211 2009-06-25 Gonzalo Paniagua Javier <gonzalo@novell.com>
212
213         * sockets.c: add the error number to the message so we can figure out
214         when this happens.
215
216 2009-06-25 Gonzalo Paniagua Javier <gonzalo@novell.com>
217
218         * wait.c: add missing 'break'.
219
220 2009-06-20  Zoltan Varga  <vargaz@gmail.com>
221
222         * atomic.h: Fix ilp32 support on ppc.
223
224 2009-05-28  Mark Probst  <mark.probst@gmail.com>
225
226         * collection.c (_wapi_collection_init): If pthread_create() fails,
227         try again with larger and then with no stack size set.  Fixes
228         #470336.
229
230 2009-05-26  Zoltan Varga  <vargaz@gmail.com>
231
232         * shared.c (_wapi_shm_file): Avoid creating a .wapi directory here, create
233         it in _wapi_shm_file_open (), since platforms using posix shm don't need it.
234
235 2009-05-22  Miguel de Icaza  <miguel@novell.com>
236
237         * wapi_glob.c: Do not need sys/param.h anymore, we now use the
238         POSIX PATH_MAX instead of BSD's MAXPATHLEN
239
240         * handles.c: Do not pull a reference to sockets if they are
241         disabled.
242
243         * sockets.c: Allow for ports to define their own ioctlsocket. 
244
245         * wthreads.c: Remove obsolete code that I recently introudced (the
246         hook for mono_register_thread_attr.
247
248 2009-05-22  Miguel de Icaza  <miguel@novell.com>
249
250         * versioninfo.c: One missing signature, fixed.
251
252 2009-05-21  Miguel de Icaza  <miguel@novell.com>
253
254         * daemon.c: Remove more DEBUG ifdef mess.
255
256         * shared.c (_wapi_shm_attach): Implemention for DISABLE_SHARED_HANDLES 
257
258 2009-05-20  Miguel de Icaza  <miguel@novell.com>
259
260         * sockets.c (ioctlsocket): Move support for MacOS semantics to the
261         ioctlsocket from the ifdef that was previously on metadata/
262
263         * wapi_glob.c (_wapi_glob): Use PATH_MAX from limits.h instead of
264         the BSD name from sys/param.h (MAXPATHLEN)
265
266         Do not include pwd.h as it is not used.
267
268         * thread-private.h: Use indent ifdef style for clarity
269
270         * sockets-wrappers.h: sys/socket.h conditional
271
272         * daemon-messages.h: sys/uio.h conditional.
273
274         * sockets.c: sys/ioctl.h conditional
275
276         * wthreads.c: work around for platforms with no thread fetching
277         information. 
278
279         * versioninfo.c: Use the portable mono_map_ interface instead of
280         using mmap directly and change the style to the Mono style.
281
282         Remove more DEBUG/ifdefs combos
283
284         * shared.c: Split the code to make DISABLE_SHARED remove all the
285         code that does not use the shared handles.   Before it merely
286         removed some of it, with this we avoid hacks on platforms that can
287         not implement it.
288
289         Split the code to reduce the amount of ifdefs.
290
291         Remove #ifdef DEBUG from the source and use a macro instead.
292
293 2009-05-20  Miguel de Icaza  <miguel@novell.com>
294
295         * locking.c: Split locking code into a separate file.
296
297 2009-05-18  Miguel de Icaza  <miguel@novell.com>
298
299         * daemon.c: Move the compile check of MONO_SIZEOF_SUNPATH to the
300         file that uses it.
301
302         * Rename `threads.c' to `wthreads.c' as broken build systems are
303         not able to cope with two files with the same name across multiple
304         directories. 
305
306 2009-05-15  Geoff Norton  <gnorton@novell.com>
307
308         * handles.c: Don't start the collection thread if we've disabled
309         shared handles.
310
311 2009-05-12  Zoltan Varga  <vargaz@gmail.com>
312
313         * collection.c (collection_thread): Get rid of all the ifdefs and
314         gcc attributes, simply return NULL.
315
316 2009-05-11  Zoltan Varga  <vargaz@gmail.com>
317
318         * shared.c: Applied patch from Koushik K. Dutta (koush@koushikdutta.com).
319         Fix the build on android.
320
321 2009-05-09  Miguel de Icaza  <miguel@novell.com>
322
323         * messages.c: Split the scan into common and uncommon messages to
324         allow the messages that are not produced by Mono to be removed on
325         embedded scenarios.
326         
327         * messages.c (message_string): instead of having a gigantic switch
328         table, use a sorted structure in memory and do a binary search on
329         it.
330
331         This reduces the runtime size by 49k and the debugging symbols by
332         400k.
333
334 2009-04-29 Gonzalo Paniagua Javier <gonzalo@novell.com>
335
336         * sockets.c: don't display a warning when connect() fails because the
337         socket was closed in another thread.
338
339 2009-04-23 Rodrigo Kumpera  <rkumpera@novell.com>
340
341         * shared.c: Fix a bunch of memleaks.
342
343 2009-03-27  Zoltan Varga  <vargaz@gmail.com>
344
345         * threads.h: Add a comment to CreateThread.
346
347 2009-03-20  Zoltan Varga  <vargaz@gmail.com>
348
349         * threads.c handles.c wait.c: Change location of gc_wrapper.h.
350
351 2009-02-22  Robert Jordan  <robertj@gmx.net>
352
353         * sockets.c: implement WSASend/WSARecv using sendmsg/recvmsg.
354         Fixes #470021.
355
356         Code is contributed under MIT/X11 license.
357
358 2009-02-20 Gonzalo Paniagua Javier <gonzalo@novell.com>
359
360         * events.c: fix event_signal and namedevent_signal to actually signal
361         the handle.
362
363 2009-02-12 Gonzalo Paniagua Javier <gonzalo@novell.com>
364
365         * io.c: EXDEV when moving directories fails now without creating a
366         file in the destination.
367         Fixes bug #326983.
368
369 2009-02-09  Zoltan Varga  <vargaz@gmail.com>
370
371         * wait.c (WaitForMultipleObjectsEx): Initialize poll variable.
372
373 2009-02-05  Miguel De Icaza  <miguel@novell.com>
374
375         * sockets.c (_wapi_setsockopt): SO_REUSEPORT is needed also on
376         MacOS X.  Fixes bug #471292
377
378 2009-01-29  Zoltan Varga  <vargaz@gmail.com>
379
380         * shared.c: Fall back to file based shared storage if shm_open () fails
381         because /dev/shm is not mounted.
382         
383         * shared.c: Add an alternative implementation using shared memory instead of
384         files. This fixes problems where the mono process would spin up the disk
385         every x secs on laptops. Fixes #434566, #415373 and #321949.
386
387 2009-01-16  Miguel de Icaza  <miguel@novell.com>
388
389         * sockets.c (WSASend): Fix memory leak, and optimize for the case
390         with 1 segment. 
391
392         This should really use writev or sendmsg to use the kernel
393         scatter/gather facility instead of emulating it by copying buffers.
394
395 2009-01-26  Rodrigo Kumpera  <rkumpera@novell.com>
396
397         * critical-sections.h (Enter/LeaveCriticalSection): Show
398         helpfull warning messages before crashing.
399
400 2009-01-26  Rodrigo Kumpera  <rkumpera@novell.com>
401
402         * handles-private.h (_wapi_handle_set_signal_state): Show
403         helpfull warning messages before crashing.
404
405 2009-01-26  Jeffrey Stedfast  <fejj@novell.com>
406
407         * mono-mutex.[c,h]: Removed GPLv2 copyright notice which should
408         not have been there.
409
410 2009-01-20  Rodrigo Kumpera  <rkumpera@novell.com>
411
412         * threads.c: Add wapi_current_thread_desc that produces
413         a string representation of the current thread state.
414
415         * threads.h: Export wapi_current_thread_desc.
416
417 2009-01-18  Zoltan Varga  <vargaz@gmail.com>
418
419         * io.c (GetDiskFreeSpaceEx): Applied patch from Koushik Dutta
420         (koush@koushikdutta.com). Disable this on android.
421
422 2009-01-16  Rodrigo Kumpera  <rkumpera@novell.com>
423
424         * handles.c (_wapi_handle_timedwait_signal_handle): Don't use the
425         set_wait_handle/clear_wait_handle machinery for alertable waits in
426         case of non-alertable waits.
427
428         Non-alertable waits must continue and wait on the cond as this will
429         release the lock. Otherwise this will cause a deadlock as anyone trying
430         to pulse the cond will block trying to acquire the said lock because
431         the thread in non-alertable wait will be busy looping in WaitForSingleObjectEx
432         or similar function, never releasing the lock.
433
434         Thou this fixes quite a few of the hangs introduced by non-pooling alertable
435         waits, the long term plan is to verify if all non-alertable waits really need
436         to be as such.
437
438 2009-01-14  Zoltan Varga  <vargaz@gmail.com>
439
440         * handles-private.h (_wapi_handle_set_signal_state): Set the signalled state
441         of the handle while locking the global signal cond mutex.
442
443         * wait.c (WaitForMultipleObjectsEx): Check the signalled state of handles
444         inside the critical section before waiting, otherwise we could go to waiting
445         even when the handles are already signalled.
446
447 2009-01-13  Zoltan Varga  <vargaz@gmail.com>
448
449         Reapply r122913, this time handling processes by falling back to polling.
450         
451         * handles.c: Rework the way the global signal stuff is handled: instead of
452         allocating a separate mutex/condvar pair for it, allocate a normal handle.
453         This way, it can reuse the alertable waiting code, allowing 
454         WaitForMultipleObject to work without polling.
455
456 2009-01-09  Miguel de Icaza  <miguel@novell.com>
457
458         Incorporate a few patches from Paolo, slightly modified:        
459
460         * handles.c (_wapi_handle_check_share): On non-Linux systems, do
461         not even compile in the code that scans for /proc/fd, and go
462         directly to the fallback function.
463
464 2009-01-09  Paolo Molaro (lupus@ximian.com)
465
466         * handles.c: Do not include some header files in platforms that
467         lack it.
468
469 2009-01-09  Miguel de Icaza  <miguel@novell.com>
470
471         * messages.c: Eliminate a warning.
472         
473 2009-01-09  Paolo Molaro (lupus@ximian.com)
474
475         * error.c: On some platforms that do not define these variables,
476         do not use them.
477
478         * security.c, io-private.h: Only include some headers if they
479         exist on the system
480
481         * sockets.c, sockets.h: do not import on this header files that
482         are only consumed internally in sockets.c.
483
484 2009-01-09  Zoltan Varga  <vargaz@gmail.com>
485
486         * threads.c (_wapi_thread_apc_pending): Check for thread->wait_handle ==
487         INTERRUPTION_REQUESTED_HANDLE too.
488         (wapi_interrupt_thread): Rework the comments, the thread is no longer
489         required to call QueueUserAPC to make the wait functions return.
490
491         * threads.c handles.c threads-internal.h: Implement alertable waits without
492         polling.
493
494 2009-01-08  Geoff Norton  <gnorton@novell.com>
495
496         * processes.c: Fix the osx version check to properly detect 10.5 v 10.4
497
498 2009-01-08  Christian Prochnow  <cproch@seculogix.de>
499
500         * types.h: added WapiULargeInteger.
501
502         * uglify.h: added ULARGE_INTEGER, PULARGE_INTEGER.
503
504         * io.h: added WapiDriveType, added method declarations
505         for GetDiskFreeSpaceEx and GetDriveType
506
507         * io.c: added GetDiskFreeSpaceEx() to query disk size
508         and free space via statvfs or statfs system call.
509         added GetDriveType to query drive type via /etc/mtab or /etc/mnttab.
510
511 2009-01-07  Geoff Norton  <gnorton@novell.com>
512
513         * processes.c: Properly implement support for Process.Modules on OSX.
514         Fixes OSX on nunit 2.4
515
516 2009-01-07 Rodrigo Kumpera  <rkumpera@novell.com>
517
518         * io.c (GetCurrentDirectory): Avoid calling g_get_current_dir straight
519         away as it doesn't handle ENAMETOOLONG correctly. As a bonus we avoid
520         allocating memory in the common path.
521
522 2009-01-07  Geoff Norton  <gnorton@novell.com>
523
524         * processes.c: Only use open -W on OSX 10.5+.  Patch from
525         Miguel
526
527 2008-12-19  Bill Holmes  <billholmes54@gmail.com>
528
529         * processes.c (get_module_name) : adjust size for unicode characters.
530
531         Code is contributed under MIT/X11 license.
532
533 2008-11-21  Zoltan Varga  <vargaz@gmail.com>
534
535         * atomic.h: Applied patch from Mihai Chelaru <kefren@ngnetworks.ro>. Add
536         netbsd support.
537
538 2008-11-18  Mark Probst  <mark.probst@gmail.com>
539
540         * atomic.h: InterlockedExchangePointer and
541         InterlockedCompareExchangePointer for PPC64.
542
543         Code submitted by andreas.faerber@web.de at
544         https://bugzilla.novell.com/show_bug.cgi?id=324134 under the
545         X11/MIT license.
546
547 2008-11-13  Bill Holmes  <billholmes54@gmail.com>
548
549         * wait.h : Adding method declaration for WaitForInputIdle.
550
551         * wait.c : Adding implementation for WaitForInputIdle.
552
553         Code is contributed under MIT/X11 license.
554
555 Fri Oct 17 15:23:00 CEST 2008 Paolo Molaro <lupus@ximian.com>
556
557         * processes.c: patch from Geoff Norton (gnorton@novell.com) to
558         strdup the open program on OSX (bug #431811).
559
560 2008-10-10 Gonzalo Paniagua Javier <gonzalo@novell.com>
561
562         * versioninfo.c: remove the use of g_strdown.
563
564 2008-09-25  Dick Porter  <dick@ximian.com>
565
566         * wait.c: Make sure we keep references to handles we're waiting
567         for.  Fixes bug 424851.
568
569 2008-07-29  Dick Porter  <dick@ximian.com>
570
571         * processes.c (get_module_name): Make a last-ditch effort to
572         figure out the process name.  Fixes bug 413723, patch by Casey
573         Marshall <casey.s.marshall@gmail.com>
574
575 2008-07-28  Dick Porter  <dick@ximian.com>
576
577         * handles.c (_wapi_handle_count_signalled_handles): Remove an
578         unmatched _wapi_handle_ref().  Fixes bug 410743.
579
580 2008-07-15  Rodrigo Kumpera  <rkumpera@novell.com>
581
582         * versioninfo.c (map_pe_file): Fix memory leak.
583
584 2008-07-01  Zoltan Varga  <vargaz@gmail.com>
585
586         * process-private.h (_WAPI_PROCESS_UNHANDLED_PID_MASK): Fix the amd64 build.
587
588 2008-06-27  Dick Porter  <dick@ximian.com>
589
590         * processes.c: Implement a form of process pseudo-handle to allow
591         non-mono processes to be manipulated.  Fixes bug 313231.
592
593         * wait.c: Check for process pseudo-handles and fail if an attempt
594         is made to wait on one.
595
596 2008-06-19  Dick Porter  <dick@ximian.com>
597
598         * sockets.c: Implement WSASend() and WSAReceive().
599
600 2008-06-02  Dick Porter  <dick@ximian.com>
601
602         * wapi.h: 
603         * Makefile.am: 
604         * messages.h: 
605         * messages.c: Implement FormatMessage, fixes bug 321827.
606
607 2008-05-29  Dick Porter  <dick@ximian.com>
608
609         * sockets.c (socket_close): Clear any saved errors
610         (_wapi_connect): Don't save EWOULDBLOCK errors here, as that
611         breaks async connects.  (Bug 377589 test case broken by the
612         previous fix to bug 356552)
613
614 2008-05-25  Zoltan Varga  <vargaz@gmail.com>
615
616         * thread-private.h (struct _WapiHandle_thread): Remove 'owner_pid' field. Reorder
617         fields so this struct (which is the biggest of the handle structs) takes less
618         space.
619
620         * threads.c (QueueUserAPC): Make this function signal safe by adding some
621         restrictions on its usage.
622
623 2008-05-14  Zoltan Varga  <vargaz@gmail.com>
624
625         * mono-mutex.h: Get rid of the #ifdef __cplusplus defines, use G_BEGIN_DECLS
626         /G_END_DECLS.
627
628 2008-05-07  Dick Porter  <dick@ximian.com>
629
630         * io.c (FindNextFile): Handle symlinks correctly.  Fixes bug
631         385765.
632
633 2008-04-25  Zoltan Varga  <vargaz@gmail.com>
634
635         * handles.c (_wapi_handle_check_share): Fix a crash introduced by the lazy
636         creation of wapi handle slots.
637
638 2008-04-24  Zoltan Varga  <vargaz@gmail.com>
639
640         * handles.c (shared_init): Align _wapi_fd_reserve to a multiple of 
641         _WAPI_HANDLE_INITIAL_COUNT to avoid a problem when allocating handles.
642
643 2008-04-23  Zoltan Varga  <vargaz@gmail.com>
644
645         * handles.c: Initialize the handle array entries on demand to save memory.
646
647         * wapi-private.h (_WAPI_HANDLE_INITIAL_COUNT): Decrease this to 256 to save
648         memory.
649
650         * handles-private.h (_WAPI_PRIVATE_MAX_SLOTS): Increase this to 1024*16 to
651         compensate for the decrease in _WAPI_HANDLE_INITIAL_COUNT.
652         
653         * threads.c: Use #ifdef instead of #if for checking for valgrind/memcheck.h.
654
655 2008-04-22  Dick Porter  <dick@ximian.com>
656
657         * wapi_glob.c (globextend): Comment out the code using ARG_MAX, as
658         that is broken on the latest opensuse.
659
660 2008-04-21  Dick Porter  <dick@ximian.com>
661
662         * io.c (DeleteFile): Disable for now the bug fix for 323389, it's
663         breaking too much other stuff.
664
665 2008-04-20  Geoff Norton  <gnorton@novell.com>
666
667         * processes.c: Fix the _NSGetEnviron define to prevent an impropoer
668         pointer dereference.
669
670 2008-04-18  Miguel de Icaza  <miguel@novell.com>
671
672         * Applied patch from Dick Porter from bug #380649
673
674 2008-04-17  Dick Porter  <dick@ximian.com>
675
676         * io.c (DeleteFile): Check file shares before deleting a file.
677         Fixes bug 323389.
678
679 2008-04-17  Dick Porter  <dick@ximian.com>
680
681         * io.c (DeleteFile): Return ERROR_ACCESS_DENIED if the file is
682         readonly.  Fixes bug 378229.
683
684 2008-04-11  Geoff Norton  <gnorton@novell.com>
685
686         * processes.c: The global extern environ doesn't exist on Mac.  We
687         need to call NSGetEnviron instead.
688
689 2008-04-08  Dick Porter  <dick@ximian.com>
690
691         * processes.c (CreateProcess): Improve the managed binary support,
692         so it works when the executable is passed in as the appname.
693         Fixes bug 377815.
694
695 2008-04-04  Dick Porter  <dick@ximian.com>
696
697         * io.c (MoveFile): Check file shares before moving a file.  Fixes
698         bug 377049.
699
700 2008-04-04  Dick Porter  <dick@ximian.com>
701
702         * error.c (errno_to_WSA): handle ENODEV.  Fixes the reopened part
703         of bug 324035.
704
705 2008-04-04  Dick Porter  <dick@ximian.com>
706
707         * processes.c (GetModuleInformation): 
708         * versioninfo.h: 
709         * versioninfo.c: 64bit fixes
710
711 2008-04-03  Dick Porter  <dick@ximian.com>
712
713         * io-portability.c (_wapi_basename, _wapi_dirname): Only turn \
714         into / when MONO_IOMAP is in effect.  Fixes bug 346123.
715
716 2008-04-03  Dick Porter  <dick@ximian.com>
717
718         * timefuncs.c (GetTickCount): Use mono_msec_ticks(), see bug
719         347476.
720
721 2008-04-01  Dick Porter  <dick@ximian.com>
722
723         * versioninfo.c (get_string_block): Refine the fix for bug 354856
724         (r93661) so that it also fixes the new part of bug 374600.
725
726 2008-03-28  Dick Porter  <dick@ximian.com>
727
728         * processes.c (GetExitCodeProcess): Check if a process has exited
729         and recorded it's exit code, before seeing if the process is
730         signalled.  Fixes bug 325463.
731
732 2008-03-27  Dick Porter  <dick@ximian.com>
733
734         * processes.c (match_procname_to_modulename): Check the whole
735         process name first, in case it is recorded as an absolute path.
736         Fixes bug 360348.
737
738 2008-03-27  Dick Porter  <dick@ximian.com>
739
740         * processes.c (ShellExecuteEx): Grotty kludge to work around
741         unpleasant feature in g_shell_parse_argv() where it treats '#'
742         embedded in a filename as a comment marker, and throws away the
743         rest of the line.  When we're directly opening URLs quote the
744         filename, to avoid this.  Fixes bug 371567.
745
746 2008-03-25  Dick Porter  <dick@ximian.com>
747
748         * wapi-private.h (_WAPI_HANDLE_VERSION): Increment file layout
749         version
750
751         * threads.c: Make thread handles private to the process that owns
752         them.
753
754 2008-03-22  Kornél Pál  <kornelpal@gmail.com>
755
756         * io-layer.h: Windows: Rename GetProcessId to __GetProcessId for targets not
757         supporting it. This fixes MSVC build with new Windows SDKs that declare
758         GetProcessId unconditionally.
759
760 2008-03-20  Kornél Pál  <kornelpal@gmail.com>
761
762         * io-layer.h: Removed Windows version macros.
763
764 Thu Mar 13 16:24:53 CET 2008 Paolo Molaro <lupus@ximian.com>
765
766         * processes.c: properly check for executable files (fixes bug #368829).
767
768 2008-02-05  Dick Porter  <dick@ximian.com>
769
770         * versioninfo.c (VerLanguageName): Implement VerLanguageName.
771
772 2008-01-31  Bill Holmes  <billholmes54@gmail.com>
773         * processes.c (match_procname_to_modulename) : Added to check if the last 
774           part of module name is equal to the process name.
775
776         * processes.c (EnumProcessModules) : Changed the first entry in the returned 
777           modules array (the process module) to be populated from the entry found
778           in /proc/<PID>/maps.
779
780         * processes.c (get_module_name & GetModuleInformation) : In the case where 
781           the module passed in is NULL, search the /proc/<PID>/maps for a name that
782           matches the process name to populate the return information.
783
784         Fixes #357062
785
786 2008-01-29  Zoltan Varga  <vargaz@gmail.com>
787
788         * security.c (RevertToSelf): Make this return TRUE if impersonating is not
789         supported.
790
791         * sockets.c (_wapi_connect): Add a workaround to a solaris x86 problem where
792         getsockopt (SO_ERROR) doesn't return an error code after connect () fails. Fixes
793         #356552.
794
795 2008-01-23  Dick Porter  <dick@ximian.com>
796
797         * versioninfo.c (get_string_block): When stepping over the
798         StringTable block, do not read an extra block at the end.  Fixes
799         the new part of bug 354856.
800
801 2008-01-19  Dick Porter  <dick@ximian.com>
802
803         * versioninfo.c (get_stringtable_block): Cope when the StringTable
804         block is first in the resources data, and we just need to step
805         over it.  Fixes bug 354856.
806
807 2008-01-16  Dick Porter  <dick@ximian.com>
808
809         * threads.c (_wapi_thread_set_termination_details): Move the
810         thread abandonment to outside the shared handle lock.  Fixes bug
811         349680.
812
813 2008-01-16  Dick Porter  <dick@ximian.com>
814
815         * versioninfo.c (VerQueryValue): Include trailing null in returned
816         string length, for MS compatibility.
817
818 2008-01-09  Dick Porter  <dick@ximian.com>
819
820         * versioninfo.c (get_ptr_from_rva, scan_resource_dir): Make it
821         work on big-endian systems.
822         (scan_resource_dir): Copy the resource directory entry and
823         byteswap if necessary so it works big-endian.  This fixes bug
824         345972 for real this time.
825         (VerQueryValue): String values set the length to the number of
826         unicode chars, but the data length reported was already correct so
827         don't halve it again.  Fixes the previous fix for bug 345972.
828         (GetFileVersionInfo): On big-endian systems, scan the resource
829         data and turn all unicode strings into UTF-16BE.  FileVersionInfo
830         now works big-endian.
831
832 2008-01-04  Dick Porter  <dick@ximian.com>
833
834         * versioninfo.c (VerQueryValue): Returned buffer length counts
835         chars not bytes for string data.  Fixes bug 345972 again.
836         (get_enclosing_section_header): Make sure values read are treated
837         as LE.  Fixes crash on ppc reported in bug 345972.
838
839 2007-12-17  Mark Probst  <mark.probst@gmail.com>
840
841         * threads.c: Guard against a race condition involving
842         thread_hash_key that can occur during shutdown.
843
844 2007-12-08  Zoltan Varga  <vargaz@gmail.com>
845
846         * processes.c: Include sys/mkdev.h if exists. Fixes solaris x86 build.
847
848 2007-12-06  Dick Porter  <dick@ximian.com>
849
850         * versioninfo.c: Resource language values must be compared in a
851         'case'-insensitive manner.  Fixes bug 345972.
852
853 2007-12-05  Dick Porter  <dick@ximian.com>
854
855         * io.c (CreateFile): Create files with mode 0666 (&~umask) by
856         default.  Fixes bugs 325299 and 337040.
857
858 2007-11-22  Dick Porter  <dick@ximian.com>
859
860         * critical-sections.h (EnterCriticalSection): Reinstate the
861         asserts in the devel branch, so any problems aren't obscured.
862
863 2007-11-22  Dick Porter  <dick@ximian.com>
864
865         * versioninfo.c (find_pe_file_resources): Make it work on 64bit
866         systems.  Fixes bug 343353.
867
868 2007-11-21  Dick Porter  <dick@ximian.com>
869
870         * processes.c (load_modules): Rewrite based on the libgc
871         /proc/<pid>/maps parsing to avoid using glib functions only
872         available since 2004.
873         (load_modules): Check for duplicates before adding a module to the
874         list.
875
876 2007-11-15  Dick Porter  <dick@ximian.com>
877
878         * processes.c (load_modules): Don't bother if we don't have
879         g_strsplit_set() and g_strv_length().  Allows building against old
880         glib versions.
881         (EnumProcessModules): Don't miss the first module returned by
882         load_modules().
883
884 2007-11-15  Dick Porter  <dick@ximian.com>
885
886         * processes.c: Implement process module support by reading from
887         /proc if it's available.
888
889         * versioninfo.h: 
890         * versioninfo.c: New functions to implement PE file version info
891         support.
892
893 2007-11-08  Dick Porter  <dick@ximian.com>
894
895         * critical-sections.h (EnterCriticalSection): Disable the critical
896         section asserts for the release branch
897
898 2007-11-05  Kornél Pál  <kornelpal@gmail.com>
899
900         * io-layer.h: Added includes for run-time GetProcessId API detection for
901         Windows.
902
903 2007-10-26  Dick Porter  <dick@ximian.com>
904
905         * shared.c (_wapi_shm_file_open): Set the umask when opening
906         shared files, so restrictive defaults don't prevent subsequent
907         processes re-opening them.
908
909 2007-10-18  Zoltan Varga  <vargaz@gmail.com>
910
911         * atomic.h (InterlockedCompareExchange): Fix the ia64 version so it works for
912         negative values too. Hopefully fixes #332700.
913
914 2007-09-26  Dick Porter  <dick@ximian.com>
915
916         * io-portability.c (_wapi_io_scandir): Only update the error
917         status of glob() when performing a secondary glob() if the first
918         returned an error.  Fixes bug 325107.
919
920 2007-09-12  Marek Habersack  <mhabersack@novell.com>
921
922         * io-portability.c: options_init moved to
923         utils/mono-io-portability.c
924         Do not initialize portability helpers here, it's done in
925         mono_runtime_init.
926         find_file and find_in_dir moved to utils/mono-io-portability.c
927
928 2007-09-09  Robert Jordan  <robertj@gmx.net>
929
930         * sockets.c (_wapi_setsockopt): Add support for FreeBSD multicast
931         sockets. Fixes #81891.
932         Code is contributed under MIT/X11 license.
933
934 2007-09-03  Atsushi Enomoto  <atsushi@ximian.com>
935
936         * processes.h, processes.c : ok, they are simple string.
937
938 2007-09-03  Atsushi Enomoto  <atsushi@ximian.com>
939
940         * processes.h : sigh, I really hate fixing them on windows :(
941
942 2007-09-03  Atsushi Enomoto  <atsushi@ximian.com>
943
944         * processes.c : fix build again.
945
946 2007-09-03  Atsushi Enomoto  <atsushi@ximian.com>
947
948         * processes.h : removed extra parameters from CreateProcessWithLogonW.
949
950 2007-09-03  Atsushi Enomoto  <atsushi@ximian.com>
951
952         * processes.c, processes.h: added CreateProcessWithLogonW(). For now
953           it just calls CreateProcess().
954         * io-layer.h : CreateProcessWithLogonW() requires WINVER 0x0500
955           on Windows.
956
957 2007-08-23  Robert Jordan  <robertj@gmx.net>
958
959         * processes.[c|h]: Implement Get|SetPriorityClass ().
960         Code is contributed under MIT/X11 license.
961
962 Tue Aug 21 20:08:09 CEST 2007 Paolo Molaro <lupus@ximian.com>
963
964         * io.c: made convert_arg_to_utf8() and write_file() static.
965         Worked around gcc's incorrect warning.
966
967 2007-08-20  William Holmes  <billholmes54@gmail.com>
968
969         *io.c: Added implementation for ReplaceFile.
970         *io.h: Added deceleration for ReplaceFile method.
971
972         Code is contributed under MIT/X11 license.
973
974 2007-08-20  Wade Berrier  <wberrier@novell.com>
975
976         * processes.c: include sys/resource.h for rusage to fix 
977         mac 10.3 build
978
979 Mon Aug 20 12:36:42 CEST 2007 Paolo Molaro <lupus@ximian.com>
980
981         * processes.c: implemented query for user/system times using
982         getrusage ().
983
984 2007-08-10  Dick Porter  <dick@ximian.com>
985
986         * sockets.c (_wapi_getsockopt, _wapi_setsockopt): Check the option
987         level as well as the name when mangling some of the values.  Fixes
988         bug 82000.
989
990 2007-08-02  Dick Porter  <dick@ximian.com>
991
992         * sockets.c: Changes in error handling, and move the SO_REUSEADDR
993         setting from metadata/socket-io.c.
994
995 2007-08-01  Dick Porter  <dick@ximian.com>
996
997         * io-portability.c (_wapi_io_scandir): Special-case patterns
998         ending in '.*' so that files with no extension are also matched.
999         Fixes bug 82212.
1000
1001         * wapi_glob.h: 
1002         * wapi_glob.c: Reinstate WAPI_GLOB_APPEND, and add
1003         WAPI_GLOB_UNIQUE to avoid matching the same entry twice when
1004         appending.
1005
1006 2007-07-26  Dick Porter  <dick@ximian.com>
1007
1008         * handles-private.h: 
1009         * thread-private.h: 
1010         * handles.h: 
1011         * critical-sections.c: 
1012         * handles.c: 
1013         * critical-section-private.h:
1014         * error.h: 
1015         * threads.c: 
1016         * error.c: Clean up TLS and pthreads structures.  Finishes off bug
1017         78739.
1018
1019         * collection.c (collection_thread): Exit the collection thread if
1020         the io-layer has been cleaned up.
1021
1022         * mono-mutex.h (mono_mutexattr_destroy): Add this define too
1023
1024 Mon Jul 23 10:40:35 CEST 2007 Paolo Molaro <lupus@ximian.com>
1025
1026         * timefuncs.c: make TickCount measure from boot time if it's
1027         available.
1028
1029 2007-07-19  Juraj Skripsky  <js@hotfeet.ch>
1030
1031         * io.c (MoveFile): Fix a leak. 
1032
1033 Fri Jul 13 12:46:15 CEST 2007 Paolo Molaro <lupus@ximian.com>
1034
1035         * handles-private.h, handles.c, thread-private.h, threads.c,
1036         uglify.h, wait.c: temporarily revert the alertable wait changes
1037         (r79386) until the deadlock issues are fixed.
1038
1039 2007-06-22  Dick Porter  <dick@ximian.com>
1040
1041         * shared.c: The non-shared mutexes weren't being initialised properly
1042         on macos.  Fixes bug 81929.
1043
1044 2007-06-13  Randolph Chung  <tausq@debian.org>
1045
1046         * atomic.h: Enable for all hppa targets.
1047         * Makefile.am: rename hppa_atomic.s to hppa_atomic.S so the preprocessor
1048         can handle the file.
1049         * hppa_atomic.s: Renamed to ...
1050         * hppa_atomic.S: ... and updated to work on both HPUX and Linux.
1051
1052 2007-06-13  Dick Porter  <dick@ximian.com>
1053
1054         * handles.c (timedwait_signal_wait_cond): Alertable waits on
1055         private handles are now interrupted by signalling the same
1056         condition that would end the wait if the handle became signalled,
1057         rather than polling.  (Shared handles still have to poll.)
1058
1059         * threads.c (_wapi_thread_queue_apc): Interrupt the thread if it's
1060         waiting on a handle
1061
1062         * handles-private.h (_wapi_handle_current_thread_set_waiting_on):
1063         Helper functions to inform the APC queuing functions when threads
1064         are waiting for handles, and to interrupt the wait.
1065
1066         * wait.c (WaitForMultipleObjectsEx): Need to tell the handle
1067         waiting functions if any of the handles in question are shared
1068
1069 2007-06-06  Miguel de Icaza  <miguel@novell.com>
1070
1071         * processes.c (is_managed_binary): Fix for OSX.
1072
1073 2007-06-06  Wade Berrier  <wberrier@novell.com>
1074
1075         * atomic.h (InterlockedExchangePointer): cast to pointer to to silence
1076         compiler warnings (autobuild fails the build on this type of warning)
1077
1078 2007-05-21  Dick Porter  <dick@ximian.com>
1079
1080         * io-portability.c (_wapi_g_dir_open): Don't propagate any errors
1081         from the second call to g_dir_open, preserve the original error if
1082         the second call still fails but clear the error if it succeeds.
1083
1084 2007-05-10  Dick Porter  <dick@ximian.com>
1085
1086         * sockets.c (_wapi_recvfrom): Refine the fix to bug 75705 so EINTR
1087         isn't returned if the remote end shuts down cleanly.  Fixes zmd
1088         and the second example in bug 75705.
1089
1090 2007-04-26  Dick Porter  <dick@ximian.com>
1091
1092         * shared.c (_wapi_shm_semaphores_init): Need to check
1093         MONO_DISABLE_SHM in this entry point, as it's called before
1094         _wapi_shm_attach().  Fixes bug 81436.
1095
1096 2007-04-24  Dick Porter  <dick@ximian.com>
1097
1098         * sockets.c (_wapi_recvfrom, socket_close): Force recvfrom() to
1099         error if the socket is closed while the receive is blocking.
1100         Fixes bug 75705.
1101
1102 2007-04-13  Dick Porter  <dick@ximian.com>
1103
1104         * shared.h:
1105         * shared.c: Complete the reimplementation of disabling of shared
1106         memory, by not allocating sysv semaphores when shm disabling has
1107         been requested (either at compile time or run time.)
1108
1109         * processes.c (CreateProcess): Don't synchronize locking across
1110         processes when forking, when shared memory has been disabled.
1111
1112 2007-04-06  Andreas Faerber  <andreas.faerber@web.de>
1113
1114         * wapi_glob.h:
1115         * wapi_glob.c: remove reference to sys/cdefs.h, use glib instead.
1116         Fixes: 81326
1117
1118 2007-04-05  Dick Porter  <dick@ximian.com>
1119
1120         * io.c:
1121         * io-portability.c (_wapi_io_scandir): Moved from io.c, and
1122         changed to use a cut-down version of glob(3) that has been
1123         extended to match with case-insensitivity if needed.
1124
1125         * wapi_glob.h:
1126         * wapi_glob.c: Cut down implementation of glob(3), based on
1127         OpenBSD.
1128
1129 2007-03-22  Dick Porter  <dick@ximian.com>
1130
1131         * sockets.c (_wapi_connect): Do additional checks when connect(2)
1132         fails, because some systems don't let it be restarted.  Patch
1133         based on one submitted by Robert S Wojciechowski <robertw@ssgx.com>,
1134         fixes bug 81010.
1135
1136 2007-03-09  Jonathan Chambers  <joncham@gmail.com>
1137
1138         * io-layer.h:  Remove UNICODE and _UNICODE defines as 
1139         these are done by configure.in now.
1140         
1141         Code is contributed under MIT/X11 license.
1142         
1143 Thu Mar 8 19:42:17 CET 2007 Paolo Molaro <lupus@ximian.com>
1144
1145         * shared.c: partial support for MONO_DISABLE_SHM env var.
1146
1147 2007-03-05  Wade Berrier  <wberrier@novell.com>
1148
1149         * atomic.h: atomic fixes from Michael Matz for for s390 
1150         and s390x ( bnc #237611 and bxc #80892 )
1151
1152 2007-03-05  Miguel de Icaza  <miguel@novell.com>
1153
1154         * io.c (CreateFile): Use FILE_ATTRIBUTE_TEMPORARY to mean 0600
1155         permissions.  For 80688
1156
1157         (MoveFile): Use errno_copy here, just to avoid a potential
1158         errno-changing code in the future from g_free. 
1159         
1160         Also, ignore EXDEV errors as they are handled immediately after
1161         (avoid printing out an error). 
1162
1163         Fixes: 80655
1164
1165 Mon Feb 12 15:50:24 CET 2007 Paolo Molaro <lupus@ximian.com>
1166
1167         * shared.c: exit if semaphores can't be created (bug #80616).
1168
1169 2007-02-01  Geoff Norton  <gnorton@customerdna.com>
1170
1171         * collection.c: NetBSD doesn't define PTHREAD_STACK_MIN.
1172
1173 2007-01-26  Dick Porter  <dick@ximian.com>
1174
1175         * socket-private.h: 
1176         * sockets.c (_wapi_getsockopt): Windows seems to not reset
1177         SO_ERROR values when they're read, contrary to the documentation.
1178         Fixes the new issues raised in bug 79878 (example in C showing
1179         winsock behaviour attached to that bug.)
1180
1181 2007-01-15 Mark Mason <mason@broadcom.com
1182
1183         * atomic.h: add locking primitives for MIPS.
1184         
1185 2007-01-11  Dick Porter  <dick@ximian.com>
1186
1187         * sockets.c (_wapi_connect): Don't do the SO_BROADCAST setting
1188         here, do it in managed code instead.
1189         (_wapi_getsockopt): SO_RCVTIMEO and SO_SNDTIMEO use struct
1190         timeval, which has a microsecond field, not milliseconds.
1191         (_wapi_setsockopt): ditto.
1192         (_wapi_setsockopt): Halve the SO_SNDBUF and SO_RCVBUF values on
1193         Linux, as the kernel doubles whatever we set.
1194         (_wapi_socket): Save socket domain, type and protocol so it can be
1195         duplicated later.
1196         (socket_disconnect): Implement socket disconnect (closing the
1197         socket, but keeping the file descriptor.)
1198         (wapi_disconnectex): A basic implementation of DisconnectEx().
1199         (wapi_transmitfile): A very basic implementation of
1200         TransmitFile().
1201         (WSAIoctl): Implement the SIO_GET_EXTENSION_FUNCTION_POINTER
1202         ioctl.
1203
1204         * socket-private.h (struct _WapiHandle_socket): Record socket
1205         domain, type and protocol info so it can be duplicated later.
1206
1207         * sockets.h (WSAID_DISCONNECTEX,WSAID_TRANSMITFILE): Structures
1208         and defines needed to look up the DisconnectEx() and
1209         TransmitFile() functions by GUID.
1210
1211         * error.c (errno_to_WSA): Change ETIMEDOUT mapping to
1212         WSAETIMEDOUT; add EDESTADDRREQ.
1213
1214         * io-layer.h: Need mswsock.h on windows now.
1215
1216 2007-01-04  Miguel de Icaza  <miguel@novell.com>
1217
1218         * io-portability.c (find_file): Fix a coverity warning (scanning
1219         being unassigned).   
1220
1221 2006-12-31  Miguel de Icaza  <miguel@novell.com>
1222
1223         * io-portability.c (find_file): Do not abort if an empty filename
1224         has been passed.  This fixes the case where MONO_IOMAP=all would
1225         assert if Directory.Exists ("") was called.
1226
1227 Mon Dec 18 14:54:37 CET 2006 Paolo Molaro <lupus@ximian.com>
1228
1229         * processes.c: moved a free on the error path.
1230
1231 Thu Dec 14 21:42:39 CET 2006 Paolo Molaro <lupus@ximian.com>
1232
1233         * processes.c: fixed a few memory leaks when executing
1234         processes.
1235
1236 Mon Nov 27 13:12:17 GMT 2006 Paolo Molaro <lupus@ximian.com>
1237
1238         * atomic.h: fix arm compare and exchange (bug #78500).
1239
1240 2006-11-23  Dick Porter  <dick@ximian.com>
1241
1242         * process-private.h (struct _WapiHandle_process): Add 'waited'
1243         parameter
1244
1245         * processes.c (process_wait): Check the 'waited' parameter not the
1246         signalled state when testing if a process has already been waited
1247         for, as the child process itself may set signalled when exiting.
1248         Fixes bug 79885.
1249
1250         * wapi-private.h (_WAPI_HANDLE_VERSION): Bump shared data version
1251
1252         * shared.c: Now the shared data version has been incremented we
1253         can set the counter semaphore initial value correctly
1254
1255 2006-11-22  Dick Porter  <dick@ximian.com>
1256
1257         * processes.c (process_wait): Cope when the background process
1258         reaper gets the process we were waiting for.  Special case for
1259         waiting for our own process to exit.  Fixes bug 77736.
1260
1261 2006-11-17  Dick Porter  <dick@ximian.com>
1262
1263         * processes.c: Fix const correctness and typos that caused memory
1264         corruption. 
1265         
1266 2006-11-17  Miguel de Icaza  <miguel@novell.com>
1267
1268         * processes.c (ShellExecuteEx): Check error after CreateProcess,
1269         thanks to Dick for pointing this out. 
1270
1271 2006-11-16  Miguel de Icaza  <miguel@novell.com>
1272
1273         * processes.c (ShellExecuteEx): If we fail to create a process in
1274         ShellExecute, then try to use the xdg-open command, and if that
1275         fails, try to use the gnome-open command, 
1276
1277         Refactor the code so that we do not have to duplicate all this
1278         code, but instead use a ucs2-aware version of the code to do
1279         concatenations.
1280
1281 2006-11-13  Dick Porter  <dick@ximian.com>
1282
1283         * io.c (_wapi_stat_to_file_attributes): If the file is a symlink
1284         add the FILE_ATTRIBUTE_REPARSE_POINT flag.  This is an attempt to
1285         follow the specs for the windows symlink support, but will
1286         probably have to be reworked when I have test data from a vista
1287         machine.  Fixes bug 79887.
1288
1289 2006-11-11  Miguel de Icaza  <miguel@novell.com>
1290
1291         * handles.c (CloseHandle): Cope here with the new value
1292         INVALID_HANDLE_VALUE set on handles.  
1293
1294         * processes.c (CreateProcess): Initialize the value of hThread to
1295         be INVALID_HANDLE_VALUE on failure, not to be NULL.  Improvement
1296         for #75733
1297
1298 2006-11-09  Dick Porter  <dick@ximian.com>
1299
1300         * sockets.c (_wapi_select): Do some sanity checking on the
1301         fd_sets, to avoid file descriptors > FD_SETSIZE.
1302         (_wapi_FD_CLR, _wapi_FD_ISSET, _wapi_FD_SET): Avoid file
1303         descriptors > FD_SETSIZE.
1304
1305 2006-10-27  Dick Porter  <dick@ximian.com>
1306
1307         * io.c (GetFileAttributes): Force symlinks to directories to be
1308         returned as a regular file.  Fixes bug 79733.
1309
1310 2006-10-18  Miguel de Icaza  <miguel@novell.com>
1311
1312         * io-portability.c (find_in_dir): First string dup, then closedir.
1313
1314 2006-10-12  Dick Porter  <dick@ximian.com>
1315
1316         * processes.c (_wapi_process_reap): Unref a process handle if we
1317         reaped it, found by Zoltan.  Fixes bug 79286.
1318         (process_wait): Don't wait again if we've already waited for a
1319         process.
1320
1321 2006-10-11  Sergey Tikhonov <tsv@solvo.ru>
1322
1323         * atomic.h: Fix atomic decrement.
1324
1325         * mini/cpu-alpha.md: Use native long shift insts
1326
1327         * mono/mono/mini/tramp-alpha.c: Implemented
1328         mono_arch_patch_delegate_trampoline method
1329
1330         * Started work on using global registers
1331         
1332         * Use byte/word memory load/store insts if cpu supports it
1333         
1334         * Code clean up
1335
1336         
1337 2006-10-09  Zoltan Varga  <vargaz@gmail.com>
1338
1339         * handles.c (timedwait_signal_poll_cond): Add an alertable parameter, and if it
1340         is FALSE, avoid busy waiting.
1341
1342         * wait.c: Add an alertable parameter to the wait routines.
1343
1344 2006-10-06  Miguel de Icaza  <miguel@novell.com>
1345
1346         * io-portability.c (find_file): Rename from
1347         MONO_IO_PORTABILITY_HELP to MONO_IOMAP.
1348
1349 2006-10-03  Dick Porter  <dick@ximian.com>
1350
1351         * io-portability.h: 
1352         * io-portability.c: Optional portability helpers and wrapped
1353         system calls to try to cope with windows filenames in
1354         applications.
1355
1356         * io.c: Use the wrapped system calls
1357
1358 2006-09-01  Zoltan Varga  <vargaz@gmail.com>
1359
1360         * critical-sections.h critical-sections.c: Make Enter/LeaveCriticalSection a macro
1361         since they are perf critical.
1362
1363         * atomic.h: Applied patch from Jakub Boqusz <qboosh@pld-linux.org>.
1364         Add atomic ops implementation for alpha.
1365
1366 2006-08-11  Dick Porter  <dick@ximian.com>
1367
1368         * processes.c (_wapi_process_reap): Avoid a deadlock by setting
1369         process termination details in an outer loop, not the
1370         _wapi_search_handle() one.
1371
1372 2006-08-10  Dick Porter  <dick@ximian.com>
1373
1374         * threads.c (_wapi_thread_queue_apc)
1375         (_wapi_thread_dispatch_apc_queue): Use a process-local mutex here
1376         instead of the cross process semaphore.  We already check that
1377         access to the APC queue is within the owning process so there's no
1378         need to protect from other processes.  Avoids a global deadlock
1379         when a thread is aborted while it holds the handle semaphore
1380         locked.
1381         (_wapi_thread_apc_pending): Hide an annoying message which can
1382         happen if a thread handle has been blown away at process shutdown
1383         while it is in an alertable wait.
1384
1385         Both problems seen while shutting down monodevelop.
1386
1387 2006-07-25  Dick Porter  <dick@ximian.com>
1388
1389         * shared.c (_wapi_shm_file): Remove '/' characters from the uname
1390         results.  Fixes bug 78917.
1391
1392 2006-07-20  Dick Porter  <dick@ximian.com>
1393
1394         * threads.c (_wapi_thread_set_termination_details): Improve the
1395         test for already-disposed thread handles, and hold the lock around
1396         the mutex abandoning.
1397
1398 2006-07-17  Dick Porter  <dick@ximian.com>
1399
1400         * processes.c (CreateProcess): Don't change directory unless a new
1401         one has been specified.  Fixes bug 78751.
1402
1403 2006-07-06  Dick Porter  <dick@ximian.com>
1404
1405         * io.c (_wapi_stat_to_file_attributes): Do a better job at
1406         figuring out the file attributes
1407         (_wapi_set_last_path_error_from_errno): New helper function to
1408         turn errno into w32 error codes that handles the differences
1409         between file and directory errors
1410         (file_setendoffile): Try turning off the extra write used to
1411         extend files, because we probably don't need it on any modern
1412         platform.  If it is needed though, we also need to lseek the file
1413         position back again
1414         (CreateFile): Treat character-special devices as a console handle,
1415         because they can't be seeked
1416         (CopyFile): If fail_if_exists is set, then the destination needs
1417         to be opened with O_EXCL
1418         (CopyFile): If fail_if_exists is not set and the destination
1419         already exists, then we should set the ERROR_ALREADY_EXISTS error
1420         even though we return success
1421         (stdhandle_create): STD_INPUT_HANDLES cannot be written to
1422         (GetStdHandle): Rework without using mono_once, so console handles
1423         can be properly closed and reopened.
1424         (mono_io_scandir): Only override errno with EACCES when the
1425         directory actually exists
1426         (FindFirstFile): Set ERROR_FILE_NOT_FOUND when no files are
1427         returned
1428         (FindClose): Cope with NULL handles
1429         (CreateDirectory): When the target already exists, just return an
1430         error.  It's the caller's job to figure out what to do.
1431         (SetCurrentDirectory): Cope with a NULL path
1432         (RemoveDirectory, GetFileAttributes, GetFileAttributesEx,
1433         SetFileAttributes, FindFirstFile, DeleteFile, MoveFile, CopyFile,
1434         CreateFile): Set path error correctly
1435
1436         * handles.c (CloseHandle): Kludge to try and cope with passing a
1437         NULL handle
1438
1439         * error.h: Add NO_ERROR as an alternative to ERROR_SUCCESS
1440
1441         * uglify.h: Added some more typedefs
1442
1443 2006-07-05  Dick Porter  <dick@ximian.com>
1444
1445         * io.c (GetFileAttributes, GetFileAttributesEx): Cope with
1446         dangling symlinks.  Fixes bug 78664.
1447
1448 2006-06-23  Dick Porter  <dick@ximian.com>
1449
1450         * handles.c (handle_cleanup): 
1451         * threads.c: Clean up threads properly when we're forcibly
1452         removing the handle entries from the shared file in
1453         handle_cleanup().  Fixes bug 78241, for real this time.
1454
1455 2006-06-15 Neale Ferguson <neale@sinenomine.net>
1456
1457         * atomic.h: More tinkering with InterlockedExchange/InterlockedCompareExchange
1458         for s390/s390x.
1459
1460 2006-06-14 Neale Ferguson <neale@sinenomine.net>
1461
1462         * atomic.h: Fix atomic exchange pointer operations for s390x - these
1463         were broken as they used 32-bit instructions rather than their 64-bit
1464         versions.
1465
1466 2006-06-14  Dick Porter  <dick@ximian.com>
1467
1468         * processes.c: Don't run the atexit handlers when bailing out
1469         of a fork/exec.
1470
1471 2006-06-14  Dick Porter  <dick@ximian.com>
1472
1473         * wait.c: Fix stupid typo shown up by gcc 4.1.1, = not ==
1474
1475         * handles-private.h: 
1476         * shared.c: 
1477         * io.c: 
1478         * processes.c: 
1479         * mono-spinlock.h: 
1480         * handles.c: 
1481         * collection.c: Fix a bunch of signed/unsigned warnings from gcc
1482         4.1.1
1483
1484 2006-06-09 Neale Ferguson <neale@sinenomine.net>
1485
1486         * atomic.h: Fix atomic operations for s390x (not really broken 
1487         but changed to use full 64-bit opcodes).
1488
1489 2006-05-24  Dick Porter  <dick@ximian.com>
1490
1491         * processes.c (process_set_current): Don't take an extra reference
1492         if we have to create our own process handle.  Fixes bug 78241
1493         again.
1494
1495         * threads.c (_wapi_thread_signal_self): Renamed from
1496         _wapi_thread_abandon_mutexes, also sets the thread state to
1497         signalled and drops a reference.  Called by the runtime when the
1498         main thread cleans itself up.
1499
1500         * handles.c (handle_cleanup): As a last resort, unref every shared
1501         handle as the process is now exiting.
1502
1503 2006-05-16  Dick Porter  <dick@ximian.com>
1504
1505         * processes.c (process_set_termination_details): Unref the handle
1506         when we've stored the exit details.  Fixes the rest of 78241.
1507
1508 2006-05-12  Dick Porter  <dick@ximian.com>
1509
1510         * threads.c: Implement pseudo handles, making GetCurrentThread()
1511         match MS behaviour.  Notice when attached threads exit, and unref
1512         the handle.  Fix usage of GetCurrentThread() in other places.
1513
1514         * handles.c (DuplicateHandle): Implement a basic form of
1515         DuplicateHandle().
1516
1517         * wait.c: Fix usage of GetCurrentThread() throughout, and cope
1518         with pseudo handles.
1519
1520 2006-04-26  Miguel de Icaza  <miguel@novell.com>
1521
1522         * io.c (file_close): Oops, do not use DeleteFile which expects
1523         unicode, instead use unlink directly
1524
1525         Add support for the new FileOptions bits on .NET 2.0.
1526
1527         It might be good if Dick reviews these changes.
1528         
1529         * io.c (file_close): If DeleteOnClose is set, then delete the file
1530         before freeing it.
1531         (CreateFile): Do not support encryption per user. 
1532         
1533         If posix_fadvise exists, pass hints on sequential scan and random
1534         access.   Did not figure out what WRITE_THROUGH maps to.
1535
1536 2006-04-26  Dick Porter  <dick@ximian.com>
1537
1538         * sockets.c (WSAIoctl): Check the output buffer is valid before
1539         writing to it.
1540
1541         * handles.c (_wapi_search_handle): Set shared pointer if we find a
1542         shared handle that has been already opened.
1543
1544 2006-04-21  Dick Porter  <dick@ximian.com>
1545
1546         * threads.c (GetCurrentThread): Reference the handle if we return
1547         an already-known thread.
1548
1549 2006-04-07  Dick Porter  <dick@ximian.com>
1550
1551         * processes.c: Fix build for older glib.
1552
1553 2006-04-06  Dick Porter  <dick@ximian.com>
1554         
1555         * processes.c (CreateProcess): Add a reference to the child
1556         process' handle, so it won't be destroyed if this process closes
1557         its copy of the handle.  Fixes bug 77393.
1558         
1559         * processes.c (process_set_current): Fall through to creating a
1560         new one if the handle lookup fails.
1561
1562         * processes.c (_wapi_process_signal_self):
1563         * handles.c (handle_cleanup): The process is exiting, so set the
1564         handle state for this process to signalled.  This should let other
1565         non-related processes wait for this handle.
1566         
1567         * handles.c (_wapi_search_handle): Don't search shared handles in
1568         all cases.
1569
1570         * collection.c (collection_thread): No need to do a collection
1571         scan straight away, do the waiting first.
1572
1573 2006-04-06  Dick Porter  <dick@ximian.com>
1574
1575         * shared.c: Fix parameters in semctl () call.
1576
1577 2006-03-28  Zoltan Varga  <vargaz@gmail.com>
1578
1579         * atomic.h atomic.c: Applied patch from David S. Miller 
1580         <davem@davemloft.net>: Reimplement Interlocked* primitives on sparc 
1581         using CAS/CASx when __GNUC__, else we will fall back to the generic 
1582         pthread version.
1583
1584 2006-03-27  Dick Porter  <dick@ximian.com>
1585
1586         * shared.c (_wapi_shm_file_open): Break out of a loop if the
1587         shared file is smaller than expected.  (We loop a few times in
1588         case another process is in the middle of creating the file.)
1589
1590 2006-03-22  Dick Porter  <dick@ximian.com>
1591
1592         * handles.c:
1593         * wapi-private.h:
1594         * shared.h:
1595         * shared.c: Delete the semaphores and shared files when the last
1596         process has finished with them
1597
1598 2006-03-15  Dick Porter  <dick@ximian.com>
1599
1600         * events.c: 
1601         * io.c: 
1602         * mutexes.c: 
1603         * processes.c: 
1604         * semaphores.c: 
1605         * sockets.c: 
1606         * threads.c: Explicitly initialise the handle ops struct
1607
1608 2006-03-14  Dick Porter  <dick@ximian.com>
1609
1610         * handles-private.h: 
1611         * wapi-private.h: 
1612         * wait.c: 
1613         * handles.c: Add a 'prewait' stage to the handle waiting, to give
1614         waiting threads a chance to check for bogus states before
1615         blocking.
1616
1617         * mutexes.c (namedmutex_prewait): Use the prewait stage to check
1618         for named mutexes that have been abandoned in a locked state (eg
1619         if a process exited abnormally while owning the mutex) and
1620         override it if needed.
1621
1622 2006-03-08 Gonzalo Paniagua Javier <gonzalo@ximian.com>
1623
1624         * wait.c: speed up WaitFor* when the timeout is 0.
1625
1626 2006-03-03  Dick Porter  <dick@ximian.com>
1627
1628         * processes.c (ShellExecuteEx): Cope when some of the parameters
1629         are NULL.
1630
1631 2006-02-27  Dick Porter  <dick@ximian.com>
1632
1633         * mutexes.c: 
1634         * mono-mutex.c: 
1635         * threads.c: Comparing pthread_t with == is not portable, so use
1636         pthread_equal().
1637
1638 Thu Feb 23 18:47:20 GMT 2006 Paolo Molaro <lupus@ximian.com>
1639
1640         * *.h, *.h: patch from Dick to make Linuxthreads systems work again.
1641
1642 2006-02-22  Dick Porter  <dick@ximian.com>
1643
1644         * thread-private.h: 
1645         * threads.c: There's no need to use the timed-thread support code
1646         any more, as we aren't using the timed join.  This greatly
1647         simplifies thread setup, and fixes a memory leak (bug 77521).
1648
1649         Don't bother to store thread IDs in a hash table, use TLS instead.
1650         The one case that needs to look up the handle of a different
1651         thread (OpenThread()) can do the extra work itself.  Fixes bug
1652         77536.
1653
1654         * handles.c (_wapi_search_handle): Add a reference when returning
1655         a private handle (shared handles are already reffed.)
1656         
1657 2006-02-17  Dick Porter  <dick@ximian.com>
1658
1659         * handles-private.h: 
1660         * handles.c: Check handle values passed to array lookups.  Fixes
1661         bug 77572.
1662
1663 2006-02-09  Dick Porter  <dick@ximian.com>
1664
1665         * threads.c: Cope with the problems caused by attaching already
1666         existing threads - they don't get the infrastructure to clean up
1667         after themselves, especially the ID to handle hash.  This fixes
1668         bug 77468.
1669
1670 2006-02-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
1671
1672         * shared.c: use MONO_SHARED_HOSTNAME as a substitute for gethostname()
1673         when creating the shared files in the .wapi directory. Fixes bug #77371.
1674
1675 2006-02-02  Martin Baulig  <martin@ximian.com>
1676
1677         * threads.c: Removed the `WITH_INCLUDED_LIBGC' section; it has
1678         never been used so far. 
1679
1680         * timed-thread.h (TimedThread): Removed the `stack_ptr' field; it
1681         has only been used by the removed code.
1682
1683 2006-01-03  Neale Ferguson <neale@sinenomine.net>
1684
1685         * atomic.h: Correct s390x definitions and eliminate compiler warnings.
1686
1687 2006-01-03  Sebastien Pouliot  <sebastien@ximian.com>
1688
1689         * io.c: Patch _wapi_stat_to_file_attributes against bug #76966, where
1690         sockets could be considered as directory.
1691
1692 2005-12-23  Dick Porter  <dick@ximian.com>
1693
1694
1695         * semaphores.h: 
1696         * semaphores.c: Implement OpenSemaphore
1697
1698         * mutexes.c: 
1699         * mutexes.h: Implement OpenMutex
1700
1701         * wapi-private.h: 
1702         * handles.c: 
1703         * events.c: 
1704         * events.h: 
1705         * event-private.h: Implement named events.  Implement OpenEvent.
1706
1707 2005-12-15  Dick Porter  <dick@ximian.com>
1708
1709         * processes.c (CreateProcess): The pipe-based cross-process
1710         exclusion technique was trying to write NULL buffers when appname
1711         was NULL (eg when coming from ShellExecuteEx,) which usually
1712         succeeded even though EFAULT was returned - but sometimes it
1713         failed.  This meant that the child process could block forever on
1714         the pipe read.  Replace it with the simpler shared handle
1715         semaphore protection used everywhere else.  This showed up with
1716         the test case in bug 76684.
1717
1718 Tue Dec 13 11:41:49 GMT 2005 Paolo Molaro <lupus@ximian.com>
1719
1720         * shared.c: fallback to private mmap when shared mmap doesn't work
1721         (like on jffs).
1722
1723 2005-12-06  Dick Porter  <dick@ximian.com>
1724
1725         * wapi-private.h: 
1726         * handles.c: 
1727         * semaphore-private.h: 
1728         * semaphores.c: Implement named semaphores
1729
1730 2005-11-24  Dick Porter  <dick@ximian.com>
1731
1732         * processes.c (GetProcessId): Implement GetProcessId()
1733
1734 2005-11-17  Dick Porter  <dick@ximian.com>
1735
1736         * processes.h: 
1737         * processes.c: Implement ShellExecuteEx as a wrapper around
1738         CreateProcess.
1739
1740 2005-11-11  Dick Porter  <dick@ximian.com>
1741
1742         * threads.c: Give mutex abandoning its own exported function, so
1743         it can be called when the runtime is cleaning up.
1744
1745         * handles.c (_wapi_search_handle_namespace): Do a handle
1746         collection befre starting to check namespace strings, so that any
1747         stale cruft gets removed.
1748
1749 2005-11-11  Dick Porter  <dick@ximian.com>
1750
1751         * threads.c: Move thread handles back into the shared space.
1752
1753         * handles.c (_wapi_handle_unref): Add support for shared handles
1754         with close() handlers
1755
1756 2005-11-04  Dick Porter  <dick@ximian.com>
1757
1758         * sockets.c (ioctlsocket): Use select instead of if to avoid a
1759         type promotion problem on 64bit freebsd.  Based on patch by Lou
1760         Kamenov <kamenovl@gmail.com>, fixes bug 76447.
1761
1762 2005-11-04  Dick Porter  <dick@ximian.com>
1763
1764         * io.c (file_write): Only do the file locking if
1765         MONO_STRICT_IO_EMULATION is set.
1766
1767 2005-10-21  Dick Porter  <dick@ximian.com>
1768
1769         * processes.c: 
1770         * handles.c (_wapi_lookup_handle): Cope when the shared part of a
1771         handle has been deleted.
1772         (_wapi_handle_unref): And when the deleted shared part is pointed
1773         to as a handle is deleted
1774
1775 2005-10-20  Dick Porter  <dick@ximian.com>
1776
1777         * processes.c (process_set_current): If the expected process
1778         handle slot doesn't contain the correct pid, create a new handle.
1779
1780         * handles.c (_wapi_search_handle): When the search doesn't find
1781         anything, return failure instead of the last handle we looked at.
1782         (_wapi_handle_ref, _wapi_handle_unref): Don't try to ref or unref
1783         unused handles (makes tracking refcounting bugs easier.)
1784
1785 2005-10-19  Dick Porter  <dick@ximian.com>
1786
1787         * handles.c:
1788         * handles-private.h:
1789         * wapi-private.h: 
1790         * processes.c: 
1791         * mutexes.c:
1792         * collection.c (_wapi_handle_collect): Remove the shared handle
1793         indirection layer, and use locking instead.  Delete other
1794         complexity that is no longer needed.  Refcount shared handles and
1795         delete them when needed, but keep the timestamps so that orphaned
1796         handles will be cleaned up eventually.
1797
1798         * shared.c (_wapi_shm_file): Add processor, OS and struct size
1799         info to the shared file names, to cope with dual-boot and 32/64bit
1800         size issues.  Fixes bug 75839.
1801
1802         * wait.c (WaitForMultipleObjectsEx): No need to distinguish
1803         between shared handles and private, as the wait functions cope
1804         with both together now.
1805
1806 2005-10-11 Gonzalo Paniagua Javier <gonzalo@ximian.com>
1807
1808         * io.c: removed NO_SIGPIPE macro.
1809         * sockets.c: no need for MSG_NOSIGNAL or ignoring SIGPIPE.
1810
1811 2005-10-11  Dick Porter  <dick@ximian.com>
1812
1813         * sockets.c (_wapi_getsockopt): Translate SO_ERROR results into
1814         w32 error codes.
1815
1816         * error.c (errno_to_WSA): Don't return a bogus error if someone
1817         asks to translate errno 0.
1818
1819 2005-10-11  Dick Porter  <dick@ximian.com>
1820
1821         * handles.c: Fix several race conditions
1822
1823 2005-10-11 Miguel de Icaza <miguel@novell.com>
1824
1825         * io.c: no need to block SIGPIPE anymore, as it is ignored.
1826
1827 2005-10-05  Dick Porter  <dick@ximian.com>
1828
1829         * threads.c (_wapi_thread_own_mutex, _wapi_thread_disown_mutex):
1830         Keep a reference to mutexes owned by threads, so they won't be
1831         destroyed prematurely.  Fixes dotmsnclient crash.
1832
1833 2005-09-26  Sebastien Pouliot  <sebastien@ximian.com>
1834
1835         * io.c: Apply patch from #76192 (Can't write files past 2gb on AMD64 
1836         (x86_64)) for Brion on IRC (Dick approved it).
1837
1838 2005-09-23  Dick Porter  <dick@ximian.com>
1839
1840         * processes.c: Don't wait for processes that have already been
1841         signalled; also fix typo.
1842
1843         * handles.c: Improve locking inside new handle and handle
1844         searching functions.
1845
1846 2005-09-20  Dick Porter  <dick@ximian.com>
1847
1848         * collection.c: 
1849         * processes.c: Periodically waitpid for known process IDs.  Fixes
1850         bug 74870.
1851
1852 2005-09-15 Gonzalo Paniagua Javier <gonzalo@ximian.com>
1853
1854         * io.c:
1855         (CreateFile): if the file is a named pipe, treat the handle as a pipe,
1856         not as a file. Fixes bug #76075.
1857
1858 2005-08-27  Zoltan Varga  <vargaz@gmail.com>
1859
1860         * atomic.h: Add support for intel icc.
1861
1862 2005-08-25  Zoltan Varga  <vargaz@gmail.com>
1863
1864         * io-layer.h: Include winbase.h not WinBase.h.
1865
1866 2005-08-19  Dick Porter  <dick@ximian.com>
1867
1868         * threads.c, threads.h, thread-private.h: Use a gsize to store the
1869         thread ID, so it can hold a 64 bit value if needed.
1870
1871 2005-07-26 Gonzalo Paniagua Javier <gonzalo@ximian.com>
1872
1873         * error.c: map ENOENT to WSAECONNREFUSED. It might happen when
1874         connecting to unix sockets. Closes bug #75632.
1875
1876 2005-07-05  Dick Porter  <dick@ximian.com>
1877
1878         * io.c: Make sure SIGPIPE is ignored when calling write(2).
1879         Prevents the runtime exiting when writing to a closed pipe,
1880         fixing bug 75468.
1881
1882 2005-06-30  Dick Porter  <dick@ximian.com>
1883
1884         * shared.c (_wapi_shm_semaphores_init): Add some helpful error
1885         messages when semget () fails due to lack of resources.
1886
1887 2005-06-21  Dick Porter  <dick@ximian.com>
1888
1889         * mutex-private.h:
1890         * thread-private.h:
1891         * mutexes.c: 
1892         * threads.c: Keep a list of owned mutexes in each thread handle,
1893         so that it is easier to abandon them when the thread exits.
1894         Removes a bottleneck when multiple threads are finishing in
1895         parallel.
1896
1897 2005-06-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
1898
1899         * io.c: (GetLogicalDrives) when a bogus line is read, don't leak memory.
1900         When the buffer has not enough space, close the file before returning.
1901
1902 2005-06-09  Duncan Mak  <duncan@novell.com>
1903
1904         * *.h: Added G_BEGIN_DECLS and G_END_DECLS where appropriate to
1905         all public headers. Fixes #74919.
1906
1907 2005-05-30  Zoltan Varga  <vargaz@freemail.hu>
1908
1909         * atomic.h: Add IA64 atomic ops.
1910
1911 2005-05-26 Gonzalo Paniagua Javier <gonzalo@ximian.com>
1912
1913         * processes.c: make ExitCode be valid even if the user didn't call
1914         WaitForExit() and is just polling on HasExited.
1915
1916 2005-05-17  Dick Porter  <dick@ximian.com>
1917
1918         * io.c (file_getfilesize): Clear the error value, so that files
1919         with sizes with the low bits 0xFFFFFFFF can be distinguished from
1920         a genuine error.
1921
1922 2005-05-11 Gonzalo Paniagua Javier <gonzalo@ximian.com>
1923
1924         * shared.c: forgot to ignore a warning.
1925
1926 2005-05-10 Gonzalo Paniagua Javier <gonzalo@ximian.com>
1927
1928         * shared.c: don't display warnings after reboots.
1929
1930 2005-05-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
1931
1932         * sockets.c: on windows, getsockopt/setsockopt for send/receive timeout
1933         use an integer in milliseconds. We were using a struct timeval.
1934
1935 2005-05-06  Dick Porter  <dick@ximian.com>
1936
1937         * handles-private.h: 
1938         * mutexes.c: 
1939         * wapi-private.h: 
1940         * shared.h:
1941         * shared.c: 
1942         * wait.c: 
1943         * handles.c: 
1944         * collection.h: Use SysV semaphores for managing access to the
1945         shared memory - in return for the ludicrous api we get
1946         synchronisation primitives that can be cleaned up by the kernel
1947         even when a process quits unexpectedly.  This removes the
1948         timestamp issues.
1949
1950 2005-05-05  Lluis Sanchez Gual  <lluis@novell.com>
1951
1952         * handles.c: Always use polling in the waits, since
1953         mono_cond_timedwait can't be interruped by the thread abort signal.
1954
1955 2005-04-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
1956
1957         * events.c: calling Set on AutoResetEvent several times has the same
1958         effect as calling it only once if no thread is waiting for it.
1959
1960 2005-04-29  Dick Porter  <dick@ximian.com>
1961
1962         * processes.c (EnumProcesses): Use a GArray instead of a GPtrArray
1963         now it's storing pids not handles, also fixes memory leak caused
1964         by unclear glib documentation.
1965
1966         * sockets.c (WSACleanup): Remove unused variable
1967
1968 2005-04-29  Dick Porter  <dick@ximian.com>
1969
1970         * handles.c (_wapi_handle_check_share_by_pid): For systems that
1971         don't have file descriptor info in /proc check that the original
1972         opener of a file is still there, if a share violation would
1973         otherwise happen.
1974
1975 2005-04-28 Gonzalo Paniagua Javier <gonzalo@ximian.com>
1976
1977         * handles.c:
1978         * handles-private.h: added _wapi_handle_forecch that loops through all
1979         the handles and call a callback function when a handle of the given
1980         type is found.
1981
1982         * sockets.c: no need to keep open sockets in an array, as we have them 
1983         in the handles structure.
1984
1985         Fixes bug #74755.
1986
1987 2005-04-28  Dick Porter  <dick@ximian.com>
1988
1989         * processes.c: Cope with handles that are only around for as long
1990         as the search is running.  If we're searching for process handles,
1991         check to see if the process is still running and signal it if not.
1992
1993         * handles.c (_wapi_search_handle): Search in the shared space as
1994         well.  Fixed bug 74752.
1995
1996         * mutexes.c:
1997         * handles.c (_wapi_handle_new_from_offset):
1998         _wapi_handle_new_for_existing_ns () was doing exactly the same as
1999         this, so deleted it.
2000
2001 2005-04-26  Dick Porter  <dick@ximian.com>
2002
2003         * handles.c: Fix stupid thinko where if a new shared handle is
2004         created but a collection was needed to free some space, it
2005         returned an error anyway.  Should fix the messages shown in bug
2006         74659.
2007
2008 2005-04-25  Dick Porter  <dick@ximian.com>
2009
2010         * handles.c (_wapi_handle_check_share): Only consider mono
2011         processes when looking to see if a file is still being held open,
2012         while checking share permissions.
2013
2014 2005-04-25  Dick Porter  <dick@ximian.com>
2015
2016         * sockets.c: 
2017         * io.c: 
2018         * wapi-private.h (struct _WapiHandleOps): 
2019         * handles.c (_wapi_handle_unref): When destroying handles, save
2020         the handle data and call the close function only after the array
2021         slot has been cleared.  This prevents race conditions with file
2022         descriptors, fixing bug 74713.
2023
2024         * mutexes.c: Delete the handle close functions, they didn't do
2025         anything anyway
2026
2027         * error.c (_wapi_get_win32_file_error): Add a mapping for EINTR so
2028         the "Unknown error" g_warning doesn't get displayed.
2029
2030 2005-04-25  Dick Porter  <dick@ximian.com>
2031
2032         * wapi-private.h: 
2033         * threads.c: Make thread handles process-private for now to take
2034         some of the space pressure off the shared memory, while I work on
2035         a real fix.
2036
2037 2005-04-21  Dick Porter  <dick@ximian.com>
2038
2039         * handles.c (_wapi_handle_check_share): Make sure there is a "fd"
2040         dir in /proc before blowing away handle info.  Fixes bug 74649.
2041
2042 2005-04-21  Dick Porter  <dick@ximian.com>
2043
2044         * wait.c (WaitForMultipleObjectsEx): Implement special waits
2045
2046         * handles.c (_wapi_handle_wait_signal_poll_share): Don't return a
2047         timeout, just wait briefly for the private signals and let the
2048         waiting thread test again.  This prevents us missing shared
2049         signals.
2050
2051 2005-04-21  Dick Porter  <dick@ximian.com>
2052
2053         * collection.h (_WAPI_HANDLE_COLLECTION_EXPIRED_INTERVAL): Reduce
2054         the time before a slot is considered too old and deleted.  This is
2055         a workaround while I come up with a proper fix.
2056
2057 2005-04-21  Dick Porter  <dick@ximian.com>
2058
2059         * mutexes.c: 
2060         * processes.c: 
2061         * threads.c: 
2062         * handles.c (_wapi_handle_new): Turn assertions into errors.
2063
2064         * collection.c (_wapi_handle_collect): Use symbols not magic
2065         numbers for timeout values
2066
2067 2005-04-19  Dick Porter  <dick@ximian.com>
2068
2069         * mutexes.c: 
2070         * wait.c: 
2071         * handles.c (_wapi_handle_count_signalled_handles)
2072         * handles-private.h (_wapi_handle_shared_lock_handle): Use new
2073         shared handle locks in critical sections.
2074
2075         * handles.c (_wapi_handle_new_for_existing_ns): Reuse old handles
2076         if there is already one there.
2077         
2078         * handles.c (_wapi_handle_ref): It was possible for a process to
2079         exit before getting around to updating shared handle timestamps,
2080         so do it here too.
2081
2082 Tue Apr 19 16:25:47 CEST 2005 Paolo Molaro <lupus@ximian.com>
2083
2084         * threads.c: fix lookup of the thread id in the has table:
2085         always use the id value, not the pointer to the id.
2086
2087 2005-04-18 Gonzalo Paniagua Javier <gonzalo@ximian.com>
2088
2089         * handles.c: fix handle returned in _wapi_handle_search_handle. Dick
2090         pointed it out.
2091
2092 2005-04-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
2093
2094         * io-layer/sockets.c: FIONBIO with a TRUE argument means we want
2095         non-blocking IO, not the other way around.
2096
2097 2005-04-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
2098
2099         * handles.c:
2100         * io.c:
2101         * handles-private.h: GetFileType wasn't checking if we have memory
2102         allocated for the handle before dereferencing it. Fixes a FileStream
2103         nunit test.
2104
2105 2005-04-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
2106
2107         * handles.c:
2108         * processes.c:
2109         * handles-private.h: we were calling g_renew to expand the handle array,
2110         but that might move the memory and we might have pthread conditions or
2111         mutexes in the original memory area that are being used. Now instead of
2112         expanding an existing array, we just create new ones and keep a list of
2113         them. Access to _wapi_private_handles had to be modified accordingly.
2114
2115 2005-04-15  Dick Porter  <dick@ximian.com>
2116
2117         * collection.c: FreeBSD needs more than PTHREAD_STACK_MIN
2118
2119 2005-04-14  Raja R Harinath  <rharinath@novell.com>
2120
2121         * wapi-private.h: Remove reference to 'daemon-private.h'.
2122
2123 Wed Apr 13 13:12:33 EDT 2005 Paolo Molaro <lupus@ximian.com>
2124
2125         * atomic.h: applied patch from mass@akuma.org (David Waite)
2126         to fix InterlockedExchangeAdd.
2127         Fixed a few other functions, including InterlockedCompareExchange()
2128         which was miscompiled by gcc with optimizations enabled.
2129
2130 2005-04-13  Dick Porter  <dick@ximian.com>
2131
2132         * io.c (share_check): 
2133         * handles.c (_wapi_handle_check_share): Refine the file check so
2134         that sharing violations within the same process don't cause
2135         assertion failures.
2136
2137 2005-04-13  Dick Porter  <dick@ximian.com>
2138
2139         * io.c (FindFirstFile): Fix bugs introduced with the merge (bug
2140         74586)
2141
2142 2005-04-12  Dick Porter  <dick@ximian.com>
2143         
2144         The daemon-less io-layer.  Extensive lowlevel changes in
2145         handles.c, requiring some corresponding changes in other files
2146         calling these functions.  Private_foo structures have been
2147         eliminated.
2148
2149         File descriptor handling differences account for most of the
2150         changes in io.c and sockets.c.
2151
2152         Other highlights:
2153         
2154         * mutexes.c: Named mutexes are now a distinct type.
2155         * atomic.h: Fix a PPC uninitialised variable warning.
2156         * wait.c: Check conditions before waiting on a condition variable.
2157         * processes.c: Handle process fork and wait without a daemon
2158         (though this has the limitation of only being able to wait for
2159         child processes.)
2160
2161 2005-04-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
2162
2163         * io-private.h:
2164         * threads.c:
2165         * threads.h:
2166         * io.c:
2167         * sockets.c:
2168         * sockets.h: removed dead code that deals with async IO.
2169
2170 2005-03-30  Zoltan Varga  <vargaz@freemail.hu>
2171
2172         * atomic.c (InterlockedIncrement): Fix fallback implementation of
2173         InterlockedIncrement and InterlockedDecrement. Fixes #74228.
2174
2175 2005-03-29  Sebastien Pouliot  <sebastien@ximian.com>
2176
2177         * io-layer.h: Add required header files for compiling with VS.NET.
2178
2179 2005-03-17 Miguel de Icaza <miguel@novell.com>
2180
2181         * io.c: don't fail on NFS when there are no more locks available.
2182
2183 2005-03-09  Dick Porter  <dick@ximian.com>
2184
2185         * error.c (_wapi_get_win32_file_error): ENFILE and EMFILE should
2186         map to ERROR_TOO_MANY_OPEN_FILES, not ERROR_NO_MORE_FILES.  Fixes
2187         bug 72671.
2188
2189 2005-03-09  Dick Porter  <dick@ximian.com>
2190
2191         * daemon.c (process_process_fork): Initialise the handle data
2192         before using it in the error case.  This is probably the error
2193         we're working around in the previous change.  Spotted by Taru Jain
2194         <tjain@novell.com> and Hemanth Yamijala <YHemanth@novell.com>.
2195
2196 2005-03-07  Dick Porter  <dick@ximian.com>
2197
2198         * daemon.c: It looks like g_shell_parse_argv() can return
2199         argv[0]=NULL somehow, yet still not give an error.  Make sure we
2200         don't pass NULL to strrchr(), working around a segfault that
2201         showed up on ZLM testing.
2202
2203 2005-03-01 Gonzalo Paniagua Javier <gonzalo@ximian.com>
2204
2205         * sockets.c: translate EINPROGRESS to EWOULDBLOCK in connect. This is
2206         the expected error code showed by the test case in bug #73053.
2207
2208 2005-02-18 Gonzalo Paniagua Javier <gonzalo@ximian.com>
2209
2210         * io.c: another leftover.
2211
2212 Fri Feb 18 17:37:29 CET 2005 Paolo Molaro <lupus@ximian.com>
2213
2214         * io.c: fixed logic in checking errno in rev 40815.
2215
2216 Fri Feb 18 16:00:29 CET 2005 Paolo Molaro <lupus@ximian.com>
2217
2218         * threads.c: we don't depend on the GC checking tls
2219         slots anymore.
2220         * processes.c: remove unused ref to GC headers.
2221
2222 Thu Feb 17 19:57:11 CET 2005 Paolo Molaro <lupus@ximian.com>
2223
2224         * io.c: remove _wapi_thread_cur_apc_pending () checks
2225         when the siscall should return immediatly and handle
2226         the case when a syscall is interrupted without
2227         erroring out, but returning a 0 read/write if possible.
2228         Still the cases of read from file need to be handled.
2229
2230 Tue Feb 8 18:28:11 CET 2005 Paolo Molaro <lupus@ximian.com>
2231
2232         * threads.c: make people test with 1 MB stack per thread.
2233
2234 2005-01-17  Dick Porter  <dick@ximian.com>
2235
2236         * timefuncs.h: Make WapiFileTime endian-aware, as it's often
2237         cast to and from 64bit ints.  Fixes bug 71213.
2238
2239 2005-01-11  Dick Porter  <dick@ximian.com>
2240
2241         * error.c (errno_to_WSA): Add EADDRNOTAVAIL error code
2242         translation.
2243
2244 Mon Jan 10 16:15:19 EST 2005 Neale Ferguson <nealeferguson@earthlink.net>
2245
2246         * atomic.h: Fix functions on s390.
2247
2248 Mon Jan 10 20:30:19 CET 2005 Paolo Molaro <lupus@ximian.com>
2249
2250         * atomic.h: fix some functions on ppc (tests/interlocked.cs).
2251
2252 2005-01-10  Dick Porter  <dick@ximian.com>
2253
2254         * misc.c (_wapi_calc_timeout): Guard against overflow when
2255         calculating timeouts.  This makes waiting with a large
2256         (Int32.MaxValue) timeout not return immediately.
2257
2258 2004-12-23  Ben Maurer  <bmaurer@ximian.com>
2259
2260         * io.c (io_ops): make this `const' so it is shareable (well, only
2261         really shareable if it is statically linked...)
2262
2263 Mon Dec 20 11:58:33 CET 2004 Paolo Molaro <lupus@ximian.com>
2264
2265         * threads.c, threads.h: add accessor to get the pthread_key_t for
2266         a tls id.
2267
2268 2004-12-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
2269
2270         * io.c: check for the existence of 'dest' and set ERROR_ALREADY_EXISTS
2271         if it exists and is not the same as 'src'.
2272
2273 2004-12-01 Neale Ferguson <Neale.Ferguson@SoftwareAG-usa.com>
2274
2275         * atomic.h : Fix InterlockedCompareExchange for s390/s390x.
2276
2277 2004-12-01 Gonzalo Paniagua Javier <gonzalo@ximian.com>
2278
2279         * processes.c: unquote the cmd path, allow for ' or " when quoting and
2280         pass the quoted program name to the daemon, otherwise the call to
2281         g_shell_unquote in the daemon will break things up.
2282
2283 2004-10-14  Dick Porter  <dick@ximian.com>
2284
2285         * sockets.c (_wapi_accept): Revert the previous change.  We now
2286         set the accepted socket to have the same blocking status as the
2287         listening socket in managed code.  This follows MS behaviour.
2288         
2289 2004-10-14  Dick Porter  <dick@ximian.com>
2290
2291         * sockets.c (_wapi_accept): On Darwin, make sure a newly
2292         accept()ed socket is blocking.  Fixes bug 67355, patch by
2293         grompf@sublimeintervention.com.
2294
2295 2004-10-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
2296
2297         * system.c: check the number of online processors instead of the
2298         existing ones. Sanitize return value if it's an error.
2299
2300 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
2301
2302         * system.c: Add support for getting the # of cpus.
2303
2304 2004-09-28  Dick Porter  <dick@ximian.com>
2305
2306         * io.c (pipe_close_private): Fix one small typo in the last change
2307         that totally hosed process creation with redirected pipes.
2308
2309 2004-09-24  Dick Porter  <dick@ximian.com>
2310
2311         * wapi-private.h: 
2312         * sockets.c: 
2313         * socket-private.h: 
2314         * io.c: 
2315         * io-private.h: 
2316         * handles-private.h: Cope when a file descriptor is reused while
2317         the handle that thought it owned it is still referenced, instead
2318         of asserting.  Probably fixes bug 66479, though we've been unable
2319         to reproduce it.
2320
2321 2004-09-09  Dick Porter  <dick@ximian.com>
2322
2323         * error.c:
2324         * io.c: Set error codes everywhere.
2325
2326 2004-09-06  Dick Porter  <dick@ximian.com>
2327
2328         * handles.c (_wapi_handle_unref): Reset the private record's type
2329         (CloseHandle): Check for a fd mapping failure, and return FALSE.
2330         (_wapi_handle_process_fork): Fix long-standing bug in checking
2331         handle return values.  Also do the required bookkeeping with the
2332         new process's handles.
2333
2334         * daemon.c: When creating a new process's handles, check whether
2335         the shared space needs to be increased
2336
2337 2004-09-05  Zoltan Varga  <vargaz@freemail.hu>
2338
2339         * shared.c (_wapi_shm_file): Fix leaking of filename.
2340
2341 2004-08-19  Dick Porter  <dick@ximian.com>
2342
2343         * handles.c (_wapi_handle_count_signalled_handles): Fix thinko
2344         introduced with the fd offset stuff: unlock handles properly when
2345         backing off.  Fixes the monologue hang at exit.
2346
2347 2004-08-18  Dick Porter  <dick@ximian.com>
2348
2349         * sockets.c: 
2350         * io.c: Check that new fds fit in the table, return error if not
2351
2352         * daemon.c (_wapi_daemon_main): 
2353         * handles.c (shared_init): Have all processes agree on a size for
2354         the fd table.
2355
2356 2004-08-17  Dick Porter  <dick@ximian.com>
2357
2358         * daemon.c (process_new): 
2359         * handles.c (_wapi_handle_new_internal): Cope when the space
2360         reserved for file descriptors is larger than the shared segment
2361         size.  Fixes the crash reported when running mono under gdb on
2362         macosx.
2363
2364 2004-08-16  Dick Porter  <dick@ximian.com>
2365
2366         * sockets.c:
2367         * io.c:
2368         * handles-private.h (_wapi_handle_fd_offset_to_handle): Improve
2369         error checking with passed-in file descriptors.
2370
2371 2004-08-11  Dick Porter  <dick@ximian.com>
2372
2373         * sockets.c: 
2374         * io.c: Returned handle values are the file descriptor the handle
2375         encapsulates
2376
2377         * handles.c: 
2378         * handles-private.h: 
2379         * daemon.c: Reserve the range of handles that can have the same
2380         values as file descriptors.  These won't be used, but the values
2381         will be used as file, console, pipe or socket handles.  The fd to
2382         handle mapping is done internally and is invisible to users.
2383         Fixes bug 61828.
2384
2385         * wapi-private.h (_WAPI_HANDLE_VERSION): Increment, because we now
2386         reserve a chunk of handle space.
2387
2388 2004-08-04  Neale Ferguson <Neale.Ferguson@SoftwareAG-usa.com>
2389
2390         * atomic.h: add support for 64-bit S/390
2391
2392 2004-07-22  Dick Porter  <dick@ximian.com>
2393
2394         * timed-thread.c: 
2395         * threads.c: Move the destruction of the internal thread data to
2396         after the thread has been joined.  Fixes bug 61418.
2397
2398 2004-07-14  Dick Porter  <dick@ximian.com>
2399
2400         * wait.c (test_and_own): When not waiting for all handles to
2401         become signalled, only own and return the lowest.  All the
2402         documentation suggests that the old way was correct, but
2403         experimentation shows it actually works like this.  Patch by
2404         Sébastien Robitaille
2405         (sebastien.robitaille@croesus.com), fixes bug 61511.
2406
2407 2004-07-09  Ben Maurer  <bmaurer@ximian.com>
2408
2409         * threads.c: register roots for gc
2410
2411 2004-07-08  Dick Porter  <dick@ximian.com>
2412
2413         * io.c (file_seek): If there is a high 32bit offset part, make
2414         sure the low part isn't sign-extended.  Set error codes when
2415         returning failure.  Fixes bug 61131.
2416
2417 2004-07-06  Dick Porter  <dick@ximian.com>
2418
2419         * io.c (file_setfiletime): Check for underflow when converting to
2420         time_t values.  Set error codes when returning failure.  Fixes bug
2421         60970.
2422
2423 2004-07-05  Dick Porter  <dick@ximian.com>
2424
2425         * mutexes.c (mutex_ops_init): Make the named mutex mutex sharable.
2426
2427         * daemon.c (unref_handle): Only destroy a handle if all processes
2428         have released it, not just the current one.  Fixes bug 60887.
2429
2430 2004-06-30  Zoltan Varga  <vargaz@freemail.hu>
2431
2432         * mono-mutex.h atomic.h: Add G_GNUC_UNUSED to static inline functions
2433         to prevent warnings.
2434
2435 2004-06-24  Dick Porter  <dick@ximian.com>
2436
2437         * mutexes.c: Indicate when a named mutex was reused
2438
2439 2004-06-24  Dick Porter  <dick@ximian.com>
2440
2441         * threads.c (SuspendThread): 
2442         * timed-thread.c (_wapi_timed_thread_suspend): Wrap sem_wait in a
2443         while loop.  See bug 58161.
2444
2445 Wed Jun 23 23:29:04 CEST 2004 Paolo Molaro <lupus@ximian.com>
2446
2447         * io.c: don't use sharemode for on-disk file permissions: it's used
2448         for shared access to the open file.
2449
2450 2004-06-22  Dick Porter  <dick@ximian.com>
2451
2452         * events.c (CreateEvent): When creating an auto-reset event that
2453         is initially owned, make sure the set count starts at 1.
2454
2455 2004-06-18  Dick Porter  <dick@ximian.com>
2456
2457         * event-private.h:
2458         * events.c: Auto-reset events need to release one thread for each
2459         time SetEvent() is called.  Fixes bug 41292.
2460
2461         * threads.h:
2462         * mutex-private.h:
2463         * mutexes.c: Scan for mutexes that are still locked by a thread
2464         when it exits.  Fixes the MS demo app linked by bug 41292.
2465
2466         * wait.c (test_and_own): Make sure a handle is signalled before it
2467         is owned.
2468
2469 2004-06-16  Dick Porter  <dick@ximian.com>
2470
2471         * timed-thread.c: Call the thread cleanup exit routine before taking
2472         the join mutex, because this could deadlock if another thread tries
2473         to join in the meantime.  This fixes the hang-at-exit problem seen
2474         on macos.
2475
2476 2004-06-03  Lluis Sanchez Gual  <lluis@ximian.com>
2477
2478         * threads.c: Implemented SleepEx.
2479         * threads.h: Fixed SleepEx signature.
2480
2481 2004-06-03  Miguel de Icaza  <miguel@ximian.com>
2482
2483         * threads.c: When running under valgrind, do not allocate too much
2484         stack, as Valgrind default is 1 meg.
2485
2486 2004-05-27  Dick Porter  <dick@ximian.com>
2487
2488         * io.h:
2489         * io.c: Implemented LockFile() and UnlockFile()
2490
2491 2004-05-21  Dick Porter  <dick@ximian.com>
2492
2493         * io.c (CreateFile): Check for existing share modes when opening
2494         a file.
2495
2496         * handles.c: 
2497         * handles-private.h: 
2498         * daemon-messages.h: 
2499         * daemon.c: Maintain a hash of file share modes, keying on device
2500         and inode (to cope with symlinks.)
2501
2502 2004-05-20  Lluis Sanchez Gual  <lluis@ximian.com>
2503
2504         * daemon-messages.c: Retry if the communication with the daemon is
2505           interrupted by a signal.
2506         * io.c, sockets.c: Check for EINTR in every syscall that can be interrumped. 
2507           Only return an error in this case if there is something in the apc queue
2508           (which means that it is an interruption requested by the "user").
2509         * processes.c: Use WaitForSingleObjectEx. No need to pass "alertable" as
2510           true since the wait is small.
2511         * shared.c: Retry write calls when interrumped by a signal.
2512         * timed-thread.h, timed-thread.c: added _wapi_thread_apc_pending, which
2513           returns TRUE if there are pending asynchronous calls (APC) for the
2514           provided thread. Also added _wapi_thread_dispatch_apc_queue which calls
2515           the enqueued APCs. Defined a new struct ApcInfo that holds information
2516           about an enqueued APC.
2517         * thread-private.h, threads.c: Implemented QueueUserAPC (which does the same
2518           as in win32),_wapi_thread_apc_pending and _wapi_thread_dispatch_apc_queue. 
2519           These last two methods call the corresponding apc methods in 
2520           thread-private using the provided thread handle.
2521         * threads.h: Added QueueUserAPC.
2522         * uglify.h: Added WapiApcProc (needed by QueueUserAPC).
2523         * wait.c, wait.h: Changed WaitForSingleObject to WaitForSingleObjectEx, and
2524           WaitForMultipleObjects to WaitForMultipleObjectsEx. Implemented support
2525           for APCs in those two methods and also in SleepEx.
2526
2527 2004-05-17  Dick Porter  <dick@ximian.com>
2528
2529         * io.c (CopyFile): Speed up.  Fixes bug 57859.
2530
2531 2004-05-13  Dick Porter  <dick@ximian.com>
2532         * mono-mutex.c (mono_mutex_unlock): Return EPERM when the current
2533         thread doesn't own the mutex, rather than assert()ing.
2534
2535 2004-05-11  Dick Porter  <dick@ximian.com>
2536
2537         * shared.c (_wapi_shm_attach): Cope when a previous daemon startup
2538         attempt failed, leaving shared files that look like a daemon is
2539         still starting.
2540
2541 2004-05-10  Gonzalo Paniagua Javier <gonzalo@ximian.com>
2542
2543         * io.c:
2544         (SetFileAttributes): don't the the exec bit if the corresponding read
2545         bit is not set.
2546
2547 2004-05-10  Zoltan Varga  <vargaz@freemail.hu>
2548
2549         * io.c (FindFirstFile): Fix invalid free.
2550
2551 2004-05-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
2552
2553         * io.c: translate from GFileError to errno codes and don't free
2554         variables right after calling mono_io_scandir, as we may overwrite
2555         errno value.
2556
2557 2004-05-08  Gonzalo Paniagua Javier <gonzalo@ximian.com>
2558
2559         * io.c: g_dir_open return ENOENT for directories on which we don't have
2560         read/execute permission, while returning EPERM for anything below those.
2561         So, change ENOENT by EPERM if the directory exists.
2562
2563 2004-05-07  Dick Porter  <dick@ximian.com>
2564
2565         * io.c (SetFileAttributes): Don't have failed chmod()s cause a
2566         "file not found" error.  Fixes bug 54032.
2567         
2568 2004-05-07  Dick Porter  <dick@ximian.com>
2569
2570         * io.c (FindFirstFile): Comment out a windows-compatibility check
2571         that breaks when directories have metachars in their names.
2572         Workaround for bug 58116.
2573
2574 2004-05-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
2575
2576         * io.c: fixed for FindFirstFile for empty directories. Closes
2577         bug #58147.
2578
2579 2004-05-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
2580
2581         * processes.c: set the start time for the current process. Fixes bug
2582         #58109.
2583
2584 2004-05-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
2585
2586         * io-private.h: 'namelist' is now a gchar ** in _WapiHandlePrivate_find.
2587         * io.c: implemented scandir using glib functions.
2588
2589 2004-05-04  Dick Porter  <dick@ximian.com>
2590
2591         * daemon.c (read_message): Return FALSE on error so the GSource
2592         callback itself can return FALSE.  Cures the infinite loop poll()
2593         warning on MacosX.
2594         * shared.c: Fix some daemon startup race conditions.
2595
2596 2004-04-29  Miguel de Icaza  <miguel@ximian.com>
2597
2598         * io.c (CopyFile): Use 32k buffers to copy the file instead of 2k,
2599         use the stack, do not use dynamic memory.
2600
2601 2004-04-29  Zoltan Varga  <vargaz@freemail.hu>
2602
2603         * io.c: Add scandir implementation for platforms which do not have
2604         it, like solaris.
2605
2606 2004-04-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
2607
2608         * io.[ch]: implemented GetLogicalDriveStrings.
2609
2610 2004-04-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
2611
2612         * io.c:
2613         * sockets.c: use the field name from configure when accessing sigval
2614         pointer field. Makes this work on the Mac.
2615
2616 2004-04-28  Bernie Solomon  <bernard@ugsolutions.com>
2617
2618         * atomic.c: (InterlockedExchange) fix typo for
2619         mutex name
2620
2621 2004-04-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
2622
2623         * io.c:
2624         * sockets.c: added check for sys/aio.h.
2625
2626 2004-04-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
2627
2628         * error.[ch]: added _wapi_get_win32_file_error...
2629         * io.c: ... which was _wapi_get_win32_error here.
2630         * sockets.c: rename the function calls here too.
2631
2632 2004-04-28  Dick Porter  <dick@ximian.com>
2633
2634         * daemon-messages.c: Avoid a deadlock when a thread is killed while
2635         waiting for the daemon by using a recursive mutex.  Helps bug 56699.
2636
2637 2004-04-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
2638
2639         * io.c: fixed leak in async_notifier().
2640
2641         * sockets.[ch]: added AIO support for sockets and fixed WSAIoctl
2642         declaration.
2643
2644         * threads.c: removed old comment.
2645
2646 2004-04-26  David Waite  <mass@akuma.org>
2647
2648         * daemon-messages.h:
2649         * daemon-private.h
2650         * error.h:
2651         * io.h:
2652         * processes.h:
2653         * shared.h:
2654         * thread-private.h:
2655         * wapi-private.h: remove comma from end of enumeration declarations
2656         * status.h: cast unsigned int types to int for enum assignment
2657
2658 2004-04-26 David Waite <mass@akuma.org>
2659
2660         * io.c:
2661         * timefuncs.c: declare 64-bit constants as long long types (i.e.
2662         10ULL)
2663
2664 2004-04-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
2665
2666         * socket-wrappers.h: _wapi_socket == WSASocket now. Added
2667         WSA_FLAG_OVERLAPPED.
2668
2669         * sockets.c: new unused parameters for _wapi_socket.
2670
2671 2004-04-22  Miguel de Icaza  <miguel@ximian.com>
2672
2673         * timed-thread.c: Replace sem_init with MONO_SEM_INIT to handle
2674         the fact that MacOS X is a piece of junk (sem_init is *defined* in
2675         the libc, but they return `not implemented'). 
2676
2677 2004-04-22  Dick Porter  <dick@ximian.com>
2678
2679         * handles.c: 
2680         * handles-private.h: Reference the handle when it is locked, so
2681         that another thread can't blow it away while we're waiting for it
2682         to become signalled.
2683         
2684         * wait.c: 
2685         * timed-thread.c: 
2686         * threads.c: 
2687         * sockets.c: 
2688         * semaphores.c: 
2689         * mutexes.c: 
2690         * mono-mutex.c: 
2691         * io.c: 
2692         * handles.c: 
2693         * handles-private.h: 
2694         * events.c: 
2695         * error.c: 
2696         * daemon-messages.c: 
2697         * critical-sections.c: 
2698         * atomic.c: Added pthreads cleanup handlers and error asserts
2699
2700         * shared.c: 
2701         * handles.c: Fixed the gcc "variable might be used uninitialised"
2702         warnings.  They can't happen, but gcc doesn't know that
2703         g_assert()s don't return.
2704
2705         Fixed the declaration of _wapi_handle_process_kill() so that it
2706         expects the correct type for the pid.
2707         
2708         * threads.c: Removed the TLS_PTHREAD_MUTEX style locking that
2709         hasn't been used in ages and just made the code more complex.
2710
2711 2004-04-17  Zoltan Varga  <vargaz@freemail.hu>
2712
2713         * processes.c: Include <signal.h> for SIGKILL and SIGILL + fix some
2714         warnings. Fixes #57168.
2715
2716 2004-04-16  Dick Porter  <dick@ximian.com>
2717
2718         * threads.c (Sleep): Using div(3) with a negative (when signed)
2719         numerator causes the quotient to be 0 and the remainder to be the
2720         numerator.  This feeds a small negative value to nanosleep(3),
2721         which will return immediately and cause a busy wait.  Fixes bug
2722         56351.
2723
2724 2004-04-15  Dick Porter  <dick@ximian.com>
2725
2726         * io-private.h:
2727         * io.c: Rewrite FindFirstFile and FindNextFile using scandir(3)
2728         and fnmatch(3) instead of glob(3).  glob() can't cope with being
2729         given filenames containing metachars.  This fixes bug 40557.
2730
2731 2004-04-14  Bernie Solomon  <bernard@ugsolutions.com>
2732
2733         * security.c: #warning is a GCC-ism
2734
2735 2004-04-13  Sebastien Pouliot  <sebastien@ximian.com>
2736
2737         * security.c: Removed GetUserName as glib g_get_user_name does a
2738         better (portability) job. Added ImpersonateLoggedOnUser and
2739         RevertToSelf.
2740
2741 2004-04-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
2742
2743         * mono-mutex.h: move pthread_mutex_timedlock declaration to...
2744         * mono-mutex.c: ...here. It was causing a warning that prevented
2745         libgdiplus compilation.
2746
2747 2004-04-04  Miguel de Icaza  <miguel@ximian.com>
2748
2749         * security.c (GetUserName): Make it work on MacOS X
2750
2751 2004-04-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
2752
2753         * security.c: use getpwuid_r if available. This one is thread-safe.
2754
2755 2004-04-02  Sebastien Pouliot  <sebastien@ximian.com>
2756
2757         * Makefile.am: Added security.c|h.
2758         * security.c: New file for security related functions. Added function
2759         GetUserName to fix #56144.
2760         * security.h: New. Header file for security.c
2761         * wapi.h: Added include for security.h
2762
2763 2004-03-25  Gonzalo Paniagua Javier <gonzalo@ximian.com>
2764
2765         * daemon-messages.h: added kill structs.
2766
2767         * daemon.c: implemented process_process_kill.
2768         * handles-private.h:  define process_process_kill.
2769         * handles.c: implemented _wapi_handle_process_kill.
2770         * processes.[ch]: implemented TerminateProcess.
2771
2772 2004-03-25  Bernie Solomon  <bernard@ugsolutions.com>
2773
2774         * daemon.c (rem_fd): On solaris you seem to get an
2775         error even after removing the input source so don't
2776         try and rem_fd it twice.
2777
2778 2004-03-25  Lluis Sanchez Gual  <lluis@ximian.com>
2779
2780         * daemon.c: in process_post_mortem, If the child terminated due to the 
2781         receipt of a signal, the exit status must be based on WTERMSIG, since 
2782         WEXITSTATUS returns 0 in this case.
2783
2784 2004-03-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
2785
2786         * daemon.c: turned a warning into a DEBUG statement. Now we may hit it.
2787
2788 2004-03-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
2789
2790         * daemon.c: only call getdtablesize () once.
2791         * processes.c: wait 500 ms to check if execve failed and throw the same
2792         exception as MS on failure. Fixes bug #32809.
2793
2794 2004-03-17  Bernie Solomon  <bernard@ugsolutions.com>
2795
2796         * io.c (async_notifier): use "union sigval" rather
2797         than sigval_t as Solaris doesn't have sigval_t
2798         (which isn't in IEEE 1003.1 either).
2799
2800 2004-03-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
2801
2802         * io.c: added debug stuff and removed a few redundant lines in
2803         file_write.
2804
2805 2004-03-15  Gonzalo Paniagua Javier <gonzalo@ximian.com>
2806
2807         * io-private.h: added new fields for file structure. Declare
2808         _wapi_io_add_callback.
2809
2810         * io.c: added _wapi_get_win32_error, support aio_read/write in
2811         file_read/write. Implemented _wapi_io_add_callback, which is where
2812         BindHandle ends up.
2813         
2814         * io.h: added new fields for WapiOverlapped and typedef for the
2815         callback.
2816
2817         * processes.c: fixed off-by-one bug when handling environment variables 
2818         passed in.
2819
2820         * threads.[ch]: implemented BindIoCompletionCallback.
2821
2822         * uglify.h: added typedef for LPOVERLAPPED_COMPLETION_ROUTINE.
2823
2824 2004-03-14  Zoltan Varga  <vargaz@freemail.hu>
2825
2826         * socket-wrappers.h: Remove extra semicolon.
2827
2828 2004-03-03  Dave Camp  <dave@ximian.com>
2829
2830         * daemon.c: (add_fd), (fd_activity), (_wapi_daemon_main):
2831         Use a new main context.
2832
2833 2004-03-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
2834
2835         * io.c:
2836         (GetFileAttributes): set the error depending on errno instead of
2837         setting ERROR_FILE_NOT_FOUND always. See bug #55160.
2838
2839 2004-03-01  Gonzalo Paniagua Javier <gonzalo@ximian.com>
2840
2841         * io.c:
2842         (CopyFile): free the buffer on error.
2843         * sockets.c:
2844         (WSAIoctl): free the buffer on error.
2845
2846 2004-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
2847
2848         * error.c: fixed mapping for EPROTONOSUPPORT and ESOCKTNOSUPPORT.
2849
2850         * sockets.[ch]: retry creating the socket for AF_INET, SOCK_RAW
2851         using IP protocol with IP over IP. Implemented WSAIoctl UNIX-style.
2852
2853 2004-01-27  Bernie Solomon  <bernard@ugsolutions.com>
2854
2855         * shared.c (_wapi_shm_file): add hostname
2856         to shared data file names to handle NFS mounted
2857         .wapi directories.
2858
2859 Mon Jan 26 16:15:03 CET 2004 Paolo Molaro <lupus@ximian.com>
2860
2861         * sockets.h: remove obsolete soklen_t typedef.
2862
2863 Fri Jan 23 21:07:02 CET 2004 Paolo Molaro <lupus@ximian.com>
2864
2865         * socket-wrappers.h, sockets.h, sockets.c, Makefile.am: move socket
2866         wrappers to its own non-installed header file.
2867
2868 2004-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
2869
2870         * io.c:
2871         (FindFirstFile): unlock the handle if FindNextFile fails.
2872         (FindNextFile): g_free a couple of pointers before retrying.
2873
2874         * wait.c:
2875         (WaitForMultipleObjects): if only one handle provided, use
2876         WaitForSingleObject.
2877
2878 2003-12-22  Bernie Solomon  <bernard@ugsolutions.com>
2879
2880         * handles-private.h: (_wapi_handle_type) check
2881         for segment in range before using it
2882
2883 2003-12-22  Bernie Solomon  <bernard@ugsolutions.com>
2884
2885         * thread-private.h: _wapi_thread_ops is now const
2886         must match .c file.
2887
2888 Mon Dec 22 18:29:03 CET 2003 Paolo Molaro <lupus@ximian.com>
2889
2890         * threads.c, timed-thread.c, timed-thread.h: use mach
2891         semaphores on Darwin (MacOSX) since the posix ones
2892         are mostly broken there (threads are not created suspended
2893         and they can start executing before they are fully initialized
2894         like in tests/thread-static.cs).
2895
2896 Mon Dec 22 17:18:45 CET 2003 Paolo Molaro <lupus@ximian.com>
2897
2898         * atomic.h: ppc fixes.
2899
2900 2003-12-19  Bernie Solomon  <bernard@ugsolutions.com>
2901
2902         * handles.c: remove my bad use of MONO_ZERO_ARRAY_LENGTH
2903         in HDRSIZE 
2904
2905 2003-12-15  Bernie Solomon  <bernard@ugsolutions.com>
2906
2907         * shared.c: (_wapi_shm_open) make scratch file
2908         not have to immediately regrow to avoid remaps
2909         (HPUX can't cope with these).
2910         (_wapi_shm_attach) use actual size of file
2911         to set scratch data_len for the creating process.
2912
2913         * handles.c: (_wapi_handle_new_internal) make
2914         sure mutex & cond var are initialized even for
2915         non process shared ones. 
2916         (_wapi_handle_unref) always call destroy 
2917         routines on mutex & cond var
2918
2919 2003-12-15  Bernie Solomon  <bernard@ugsolutions.com>
2920
2921         * daemon.c: change channel data structure so
2922         input sources are removed from glib event loop
2923         properly. xsp works better on Solaris and 
2924         fixes #51278
2925
2926 2003-12-12  Bernie Solomon  <bernard@ugsolutions.com>
2927
2928         * wapi-private.h: Replace G_GNUC_PRETTY_FUNCTION
2929         definition with file & line number for non-GCC
2930         compiles.
2931
2932 2003-12-08  Bernie Solomon  <bernard@ugsolutions.com>
2933
2934         * Makefile.am: make sure hppa_atomic.s is in distribution
2935
2936 2003-12-01  Dick Porter  <dick@ximian.com>
2937
2938         * wapi-private.h: 
2939         * mutexes.c (CreateMutex): 
2940         * mutex-private.h (struct _WapiHandle_mutex): 
2941         * handles.c: Look up certain handle types by name, in a shared
2942         namespace.  Currently only mutex handles have this implemented.
2943         Fixes bug 51089.
2944
2945         * semaphores.c (CreateSemaphore): 
2946         * events.c (CreateEvent): Fix signature
2947
2948 2003-11-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
2949
2950         * io.c: don't call g_free before testing errno as it may modify it.
2951         If the path exists, return an error if it's not a directory. Fixes
2952         bug #50753.
2953
2954 2003-11-20  Dick Porter  <dick@ximian.com>
2955
2956         * io.c: Missed a little-endian UTF16 conversion.  Patch from
2957         Jeroen Zwartepoorte (Jeroen@xs4all.nl), fixes bug 51065.
2958
2959 2003-10-29  Dick Porter  <dick@ximian.com>
2960
2961         * io.c (MoveFile): If the move crosses filesystems, try and fall
2962         back to copy and delete.  Patch from Jörg Rosenkranz
2963         (JoergR@voelcker.com), fixes bug 50298.
2964
2965 2003-10-28  Dick Porter  <dick@ximian.com>
2966
2967         * io.c: Use the new encoding conversion to cope with non-utf8
2968         locales in filenames.
2969
2970         * processes.c: Ditto for process arguments.
2971
2972 Tue Oct 21 12:01:14 CEST 2003 Paolo Molaro <lupus@ximian.com>
2973
2974         * atomic.h: some ppc inline asm fixes (incorrect use of labels, 
2975         incorrect register constraints, incorrect clobber lists).
2976
2977 2003-10-13  Bernie Solomon  <bernard@ugsolutions.com>
2978
2979         * Makefile.am hppa_atomic.s: add HP 64bit
2980         implementation of atomic ops
2981
2982 2003-10-13  Zoltan Varga  <vargaz@freemail.hu>
2983
2984         * threads.c (CreateThread): Wrap pthread_attr_setstacksize call in
2985         a conditional for platforms that don't have it.
2986
2987 2003-10-09  Bernie Solomon  <bernard@ugsolutions.com>
2988
2989         * threads.c: (CreateThread) use stacksize argument
2990         if non-zero - change default for 64 bits to 4Mb
2991
2992 2003-09-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
2993
2994         * sockets.c: set last error when socket creation fails. This shed some
2995         light on bug #49015.
2996
2997 2003-09-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
2998
2999         * processes.c: fixed bug #48973: we only change \ by / for the argument
3000         to be used as command.
3001         When getting the program name from the args, don't let the space between
3002         them in the args.
3003
3004 2003-09-24  Bernie Solomon <bernard@ugsolutions.com>
3005
3006         * atomic.h atomic.c: fix sparc so lock is
3007         global, increment does so and it compiles under Sun compiler.
3008
3009 2003-09-22  Bernie Solomon <bernard@ugsolutions.com>
3010
3011         * handles.c: include <string.h> directly as may
3012         not be nested in <sys/un.h> like Linux
3013
3014 2003-09-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
3015
3016         * io.c:
3017         (DeleteFile): call SetLastError on failure. Fix by
3018         richard.torkar@htu.se (Richard Torkar). Closes bug #48222.
3019
3020 2003-09-15  Lluis Sanchez Gual  <lluis@ximian.com>
3021
3022         * daemon.c: In compare_process(), discard handles already signalled.
3023
3024 2003-09-02  Dick Porter  <dick@ximian.com>
3025
3026         * io.c: Work around glib brain-dead assumptions about utf8-encoded
3027         filenames.  Fixes bug 30781.
3028
3029 2003-08-28  Dick Porter  <dick@ximian.com>
3030
3031         * critical-sections.c:  Patch from Bernie Solomon
3032         <bernard@ugsolutions.com> to emit a warning if locking a critical
3033         section fails.
3034
3035 2003-07-23  Dick Porter  <dick@ximian.com>
3036
3037         * shared.c:
3038         * daemon.c (maybe_exit): Avoid the race condition when the daemon is
3039         closing but another client comes along when the shared data is still
3040         visible.  Should fix bugs 33671 and 35213.
3041
3042 2003-07-23  Dick Porter  <dick@ximian.com>
3043
3044         * handles.c:  Initialise handle mutex and cond.  Fix by
3045         Bernie Solomon <bernard@ugsolutions.com>
3046
3047 2003-07-15  Dick Porter  <dick@ximian.com>
3048
3049         * timed-thread.c (timed_thread_start_routine): Fix virtual memory
3050         leak when threads quit.  Fixes bug 44067.
3051
3052 Wed Jun 18 19:08:40 CEST 2003 Paolo Molaro <lupus@ximian.com>
3053
3054         * io.c: never add write permission for group or others in
3055         SetFileAttributes ().
3056
3057 2003-06-17  Dick Porter  <dick@ximian.com>
3058
3059         * io.c (SetFileAttributes): Implement the ReadOnly attribute, and
3060         ignore the unsupported ones ("fixes" bug 44977).
3061
3062 2003-06-17  Lluis Sanchez Gual  <lluis@ximian.com>
3063
3064         * misc.c: fix bug in _wapi_calc_timeout. It gave wrong values for
3065           high ms values (there was an overflow).
3066
3067 2003-06-17  Zoltan Varga  <vargaz@freemail.hu>
3068
3069         * system.h (struct _WapiSystemInfo ): Fix warnings when using gcc-3.3.
3070
3071 2003-06-11  Dick Porter  <dick@ximian.com>
3072
3073         * shared.c: Fix shared directory creation.  Patch from
3074         Pablo Baena <pbaena@uol.com.ar>
3075
3076 2003-06-10  Dick Porter  <dick@ximian.com>
3077
3078         * atomic.c: Delete the useless compile warning
3079
3080 2003-06-09  Dick Porter  <dick@ximian.com>
3081
3082         * daemon.c: Lookup env as a string array.  Fixes bug 44289.  Also
3083         make setting the process handle value in the environment actually
3084         work.
3085
3086         * processes.c: Pretty up the process name, if it happens to be
3087         "mono" such as when another mono process forks "mono foo.exe"
3088
3089 2003-06-05  Dick Porter  <dick@ximian.com>
3090
3091         * processes.c (process_set_current): Don't do an expensive handle
3092         search at application startup, check the environment to see if the
3093         process handle has already been created.
3094
3095         * io.c: Don't do an expensive handle search when creating stdin,
3096         stdout and stderr handles, just create them all the first time one
3097         is requested.
3098
3099         * wapi-private.h:
3100         * shared.c:
3101         * shared.h:
3102         * handles.c:
3103         * handles-private.h:
3104         * daemon-messages.h:
3105         * daemon-private.h:
3106         * daemon.c: Support for "unlimited" number of handles and scratch
3107         data.
3108
3109         Speed up application startup by passing process handle in the
3110         environment, rather than let the app scan all handles (which gets
3111         really slow when there are more than a few thousand to check.)
3112
3113         Initialise some structs passed to syscalls, noticed by valgrind.
3114         
3115
3116 2003-05-20  Dick Porter  <dick@ximian.com>
3117
3118         * io.c (FindFirstFile): Include . files in the glob.  Fixes bug
3119         43229.
3120
3121 2003-05-19  Dick Porter  <dick@ximian.com>
3122
3123         * threads.c: Set the new thread's stack size to 2M.  Fix needed
3124         for BSD, reported by Martin Dvorak <md@9ll.cz>
3125
3126 2003-05-16  Dick Porter  <dick@ximian.com>
3127
3128         * io.h:
3129         * io.c: Implement GetTempPath()
3130
3131 2003-05-16  Dick Porter  <dick@ximian.com>
3132
3133         * processes.c (CreateProcess): Set some error codes
3134
3135 2003-05-12  Dick Porter  <dick@ximian.com>
3136
3137         * misc.c (_wapi_calc_timeout): Cope with overflowing tv_nsec.
3138         Patch from Martin Dvorak <mdvorak@ninell.cz>.
3139
3140 2003-05-10  Dick Porter  <dick@ximian.com>
3141
3142         * io.c (CopyFile): Copy file mode as well as file data.  Based on
3143         suggestion by Giuseppe Greco <giuseppe.greco@agamura.com>, bug
3144         42706.
3145
3146 2003-05-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
3147
3148         * handles.c: don't call GC_gcollect when creating new handles.
3149
3150 2003-05-05  Gonzalo Paniagua Javier <gonzalo@ximian.com>
3151
3152         * handles.c: added some debugging code. Call GC_gcollect
3153         before creating a new handle. It makes Lupus' test run smoother and
3154         faster (from 62 to 83 request per second). Notice that calling
3155         GC_finalizer_notifier if needed (GC_should_invoke_finalizer ()) does
3156         not improve nor degrade the performance, so i don't do it.
3157
3158 2003-05-02  Dick Porter  <dick@ximian.com>
3159
3160         * sockets.c: Rearrange closesocket() and socket_close_private(),
3161         and remember to unref the handle, so we don't leak socket handles.
3162         Fix from Pelle Johnsen <pelle.johnsen@mail.dk>
3163
3164 2003-04-11  Dick Porter  <dick@ximian.com>
3165
3166         * atomic.h: ARM atomic operations by Malte Hildingson
3167         <tds00mahi@tellus.thn.htu.se>
3168
3169 Tue Apr 8 11:37:29 CEST 2003 Paolo Molaro <lupus@ximian.com>
3170
3171         * atomic.h: fix macosx build by "Urs C. Muff" <umuff@quark.com>.
3172
3173 2003-04-03  Martin Baulig  <martin@ximian.com>
3174
3175         The following change is conditional to `WITH_INCLUDED_LIBGC'
3176         which is not yet enabled by default.
3177
3178         * threads.c (SuspendThread, ResumeThread): Fully implemented this.
3179         (gc_init): New static function; install a signal handler for
3180         SIGPWR which is used to suspend threads.  [FIXME: it SIGPWR
3181         doesn't exist on all Unix systems, we need to find another
3182         signal].
3183         (mono_wapi_push_thread_stack): New public function.  Tells the
3184         garbage collector about the current stack pointer of a suspended
3185         thread.
3186
3187 2003-04-03  Martin Baulig  <martin@ximian.com>
3188
3189         * timed-thread.h (TimedThread): Added `suspended_sem',
3190         `suspend_count' and `stack_ptr'.
3191
3192 2003-03-28  Dick Porter  <dick@ximian.com>
3193
3194         * atomic.h: PPC support gratiously donated to the public domain
3195         by John Duncan <jddst19@mac.com>
3196
3197 2003-03-20  Dick Porter  <dick@ximian.com>
3198
3199         * sockets.c (_wapi_connect): If connect() fails with EACCES, try
3200         setting SO_BROADCAST and connecting again.  Fixes bug 39178.
3201
3202 2003-03-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
3203
3204         * processes.c: included Jerome Laban's patch and call SetLastError when
3205         the executable is not found.
3206
3207 2003-03-03  Dick Porter  <dick@ximian.com>
3208
3209         * io.c (CreateFile): Try opening directories readonly, so that
3210         timestamps can be adjusted.  Patch by Elan Feingold
3211         <efeingold@mn.rr.com>.
3212
3213 2003-02-25  Dick Porter  <dick@ximian.com>
3214
3215         * shared.c (_wapi_shm_attach): Return a failure code on system
3216         call errors, rather than exiting.
3217
3218 2003-02-21  Dick Porter  <dick@ximian.com>
3219
3220         * processes.c (GetCurrentProcessId): Use the current process
3221         handle to return the process ID, as getpid() is unreliable
3222         (linuxthreads gives each thread a different pid).  Fixes bug
3223         37550.
3224
3225 2003-02-21  Dick Porter  <dick@ximian.com>
3226
3227         * io.c (FindNextFile): Skip over dangling symlinks.  Fixes bug
3228         34076.
3229
3230 2003-02-11  Dick Porter  <dick@ximian.com>
3231
3232         * timefuncs.h: 
3233         * timefuncs.c: Added GetTickCount()
3234
3235 2003-02-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
3236
3237         * error.c: added WSA_EHOSTUNREACH mapping.
3238
3239 2003-01-26  Miguel de Icaza  <miguel@ximian.com>
3240
3241         * io.c (SetFileAttributes): This routine is not currently
3242         implemented for the general case, but I added a special case to
3243         set the executable bit on Linux.
3244
3245 Wed Jan 15 15:55:40 CET 2003 Paolo Molaro <lupus@ximian.com>
3246
3247         * sockets.h, daemon.c, io.c: compilation fixes on MacOSX.
3248
3249 2003-01-08  Dick Porter  <dick@ximian.com>
3250
3251         * sockets.c: Fixed setting blocking mode to true (fixes bug 36388)
3252
3253 2002-12-11  Juli Mallett  <jmallett@FreeBSD.org>
3254
3255         * daemon.c, handles-private.h, handles.c, wapi-private.h:
3256         Check for an implementation which says it supports
3257         _POSIX_THREAD_PROCESS_SHARED, rather than just one that
3258         defines the symbol.  Defined but with a value of -1 still
3259         means that it is unsupported.
3260
3261 2002-12-08  Martin Baulig  <martin@ximian.com>
3262
3263         * handles.c (_wapi_handle_new): Create new non-shared handles with
3264         an initial refcount of 1, not 0.
3265
3266 2002-11-22  Dietmar Maurer  <dietmar@ximian.com>
3267
3268         * threads.c (TlsGetValue): removed unnecessary mutex
3269
3270 2002-11-20  Dick Porter  <dick@ximian.com>
3271
3272         * timed-thread.c (_wapi_timed_thread_attach): Attached threads
3273         need to store their data structure too.
3274
3275         * threads.c: Make sure the threading data is initialised wherever
3276         it is needed
3277
3278 2002-11-15  Dick Porter  <dick@ximian.com>
3279
3280         * timed-thread.c: Removed unneeded parameters in
3281         _wapi_timed_thread_attach().
3282
3283         * threads.c: Renamed AttachThread() to make it not look like
3284         external API.  Removed unneeded parameters.
3285
3286 2002-11-11  Gonzalo Paniagua Javier <gonzalo@ximian.com>
3287
3288         * error.[ch]: added errno_to_WSA (). It displays a warning and return
3289         WSASYSCALLFAILURE if there is no error mapping for the given errno,
3290
3291         * sockets.c: use errno_to_WSA and fixed display of warning for h_errno.
3292
3293 2002-10-31  Dick Porter  <dick@ximian.com>
3294
3295         * io.h: 
3296         * io.c: Define and use INVALID_FILE_ATTRIBUTES
3297
3298 2002-10-07  Dick Porter  <dick@ximian.com>
3299
3300         * timefuncs.c:
3301         * daemon.c: Use a more accurate time source for process start and
3302         end times.
3303
3304 2002-10-03  Dick Porter  <dick@ximian.com>
3305
3306         * daemon.c:
3307         * handles.c:
3308         * threads.c:  Fixes for freebsd.  Make sure that mutex and condition
3309         creation and deletion happen in the process that owns them, when
3310         POSIX shared thread objects aren't supported.  This breaks on
3311         freebsd, as pthread_t is a pointer to data.
3312
3313 2002-10-02  Dick Porter  <dick@ximian.com>
3314
3315         * shared.c: Use mmap() instead of sysv shm for the shared data.
3316
3317         * wapi-private.h (_WAPI_HANDLE_VERSION): Reset back to 0, for the
3318         new system
3319
3320         * daemon-private.h: 
3321         * daemon.c: mmap()ed regions survive fork, so just pass the
3322         pointer to _wapi_daemon_main instead of mapping it again.
3323
3324 2002-10-01  Dick Porter  <dick@ximian.com>
3325
3326         * timed-thread.c: Kludge for CREATE_SUSPENDED thread creation.
3327         Unfortunately libgc uses the same thread suspend technique that I
3328         want to, and the two don't mix: libgc will deadlock when it tries
3329         to stop the world if a thread has already been suspended by
3330         someone else.  Just do the simple suspended create rather than the
3331         general purpose thread suspension for now.
3332
3333         * threads.c: Pass create flags to the timed_thread create call, to
3334         implement suspended thread creation.  ResumeThread() partially
3335         implemented, to cope with the case where a newly created but
3336         suspended thread is launched.
3337
3338 2002-09-30  Dick Porter  <dick@ximian.com>
3339
3340         * sockets.c (ioctlsocket): Set non-blocking mode in a better way,
3341         with fcntl.
3342
3343 2002-09-27  Dick Porter  <dick@ximian.com>
3344
3345         * semaphores.c: Only include semaphore.h if it's present. Patch
3346         for BSD from jmmv@hispabsd.org (Julio Merino).
3347
3348 2002-09-27  Dick Porter  <dick@ximian.com>
3349
3350         * processes.c: Pass environment and working directory to the
3351         daemon when forking.  Don't let argv[0] be duplicated when looking
3352         for the program name.  Implement EnumProcessModules (simple
3353         version for now, lsof-style later if needed), GetModuleBaseName,
3354         {Get,Set}ProcessWorkingSetSize (just faked, because the vm hints
3355         aren't available on Linux).
3356
3357         * process-private.h: Store the process name, and the working set
3358         min and max
3359
3360         * handles.c:
3361         * handles-private.h: New functions to store and retrieve an array
3362         of strings in the scratch space
3363
3364         * daemon.c: Don't miss deleting some handles when a client exits
3365         (we used to rely on the client doing the final cleanup, but
3366         obviously if the client is no longer there the daemon has to do
3367         it).
3368
3369         Process forking now sets the environment and the working
3370         directory.
3371
3372         * io.c: Don't confuse fd 0 with an unassigned handle struct
3373
3374         * atomic.h: Add a google cache alternative to the msdn URL
3375
3376 2002-09-25  Gonzalo Paniagua Javier <gonzalo@ximian.com>
3377
3378         * sockets.c:
3379         (_wapi_recvfrom): added ECONNRESET to the switch.
3380
3381 2002-09-24  Mark Crichton  <crichton@gimp.org>
3382
3383         * atomic.h: Yea.  On linux, sparc isn't sparc, it's __sparc__.
3384         Added to ifdef.
3385
3386 2002-09-19  Mark Crichton  <crichton@gimp.org>
3387
3388         * daemon.c, shared.c: Added NEED_LINK_UNLINK for systems that
3389         dont have Linux's abstract filesystem for sockets.
3390
3391 2002-09-19  Mark Crichton  <crichton@gimp.org>
3392
3393         * atomic.h: Added SPARC atomic asm code.
3394         * daemon.c, handles-private.h, handles.c, wapi-private.h:
3395         undefined _POSIX_THREAD_PROCESS_SHARED.  This actually exists on
3396         Solaris 9, however, the code paths don't seem to work.  More testing
3397         on the shared case is *really* needed.
3398
3399 2002-09-03  Dick Porter  <dick@ximian.com>
3400
3401         * threads.h: 
3402         * threads.c: Removed PosixKillThread(), because it's not in the
3403         w32 api
3404
3405 2002-08-20  Dick Porter  <dick@ximian.com>
3406
3407         * handles.c (_wapi_handle_scratch_store): Made stored byte lengths
3408         multiples of 4 bytes, to keep header structures aligned.  Needed
3409         for sparc, at least. (Patch from crichton@gimp.org)
3410
3411         * handles.c: Removed 'disable_shm' variable (we've defaulted to
3412         building with shm enabled for months now)
3413
3414 2002-08-19  Dick Porter  <dick@ximian.com>
3415
3416         * daemon.c: Rewrote the poll() loop to use GIOChannels instead,
3417         for legacy NeXT-based systems.
3418
3419 2002-08-12  Dick Porter  <dick@ximian.com>
3420
3421         * atomic.h: Rename some parameters to avoid c++ keywords (Patch
3422         from Joseph Wenninger <kde@jowenn.at>)
3423
3424 2002-08-05  Dietmar Maurer  <dietmar@ximian.com>
3425
3426         * threads.c: use fast spinlocks by default
3427
3428 2002-08-02  Dick Porter  <dick@ximian.com>
3429
3430         * io.c (GetStdHandle): Add a handle reference when returning a
3431         duplicate console handle.  This fixes the unref_handle errors in
3432         NUnit.
3433
3434 2002-08-01  Dietmar Maurer  <dietmar@ximian.com>
3435
3436         * threads.c (TLS_PTHREAD_MUTEX): define this because else some
3437         tests does not work
3438
3439 2002-08-01  Dick Porter  <dick@ximian.com>
3440
3441         * threads.c: Use atomic spinlocks in TLS functions
3442
3443         * mono-spinlock.h:
3444         * Makefile.am: Added mono-spinlock.h
3445
3446 2002-07-21  Jeffrey Stedfast  <fejj@ximian.com>
3447
3448         * daemon-messages.c: #include <sys/types.h> and <sys/sockets.h> -
3449         these are needed for sendmsg() and also for struct msghdr (at
3450         least on Solaris). Solaris still won't build because struct msghdr
3451         doesn't have msg_flags, msg_control, or msg_controllen members.
3452         (CMSG_SPACE): Define for systems that don't have it.
3453         (CMSG_LEN): Same.
3454
3455 2002-07-20  Dick Porter  <dick@ximian.com>
3456
3457         * wapi-private.h:
3458         * io-private.h:
3459         * io.h:
3460         * io.c:
3461         * handles.c: Implemented pipe handles
3462         
3463         * handles.c:
3464         * daemon.c: Fixed bug in handle closing.
3465
3466         * shared.c:
3467         * daemon.c: Forked processes now close all open file descriptors.
3468
3469 Fri Jul 19 19:05:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
3470
3471         * sockets.h, io-layer.h, critical-sections.h: don't include config.h
3472         in header files.
3473
3474 2002-07-19  Martin Baulig  <martin@gnome.org>
3475
3476         * threads.c (ExitThread): Call exit() if no threads has been
3477         created yet.
3478
3479 2002-07-17  Dick Porter  <dick@ximian.com>
3480
3481         * daemon-messages.c: Freebsd fixes from Andreas Kohn
3482         <andreas.kohn@gmx.net>
3483
3484 2002-07-15  Dick Porter  <dick@ximian.com>
3485
3486         * io.c: Removed bogus console_flush() method, that was just cut
3487         and pasted from file_flush when I separated the two handle types.
3488
3489 2002-07-12  Dick Porter  <dick@ximian.com>
3490
3491         * io.c (convert_from_flags): Fixed misunderstanding wrt fcntl
3492         flags.  Fixes bug 27633.
3493
3494 2002-07-12  Dick Porter  <dick@ximian.com>
3495
3496         * wapi-private.h:
3497         * handles.c:
3498         * daemon.c: Use size of sockaddr_un.sun_path from config.h
3499
3500 2002-07-12  Dick Porter  <dick@ximian.com>
3501
3502         * processes.c (CreateProcess): Send stdin, stdout and stderr
3503         handles if the startup info doesnt specify new ones
3504
3505         * io.c (GetStdHandle): Return the same handle when the same
3506         standard handle is requested
3507
3508         * handles.c: Pass file descriptors when forking
3509
3510         * daemon.c: Use supplied file descriptors when forking a new
3511         process
3512
3513         * daemon-messages.h: 
3514         * daemon-messages.c: Pass stdin, stdout and stderr file
3515         descriptors to the daemon (used when forking)
3516
3517 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
3518
3519         * daemon.c (_wapi_daemon_main): Use sizeof
3520         (main_socket_address.sun_path) instead of hardcoded 108 value.
3521
3522         * handles.c (shared_init): Use sizeof
3523         (shared_socket_address.sun_path) instead of hardcoded 108 value.
3524
3525 2002-07-10  Dennis Haney  <davh@davh.dk>
3526
3527         * shared.c:
3528         * handles.c:
3529         * daemon.c: Lots of documentation, some added error checking, and
3530         code readability improvements.
3531
3532         * daemon-messages.h: Add the Error request type to improve error
3533         checking.
3534
3535         * daemon-messages.c: Do a bit more error checking on send() and
3536         recv(), and log errors with a higher severity level.
3537
3538 2002-07-04  Dick Porter  <dick@ximian.com>
3539
3540         * daemon.c (process_process_fork): Fix argument handling, due to
3541         buggy understanding of g_strsplit() behaviour.
3542
3543 2002-07-03  Dick Porter  <dick@ximian.com>
3544
3545         * threads.h:
3546         * threads.c: Implement OpenThread().  Define access-control values
3547         for thread handles.
3548
3549         * wapi.h:
3550         * processes.h:
3551         * access.h:
3552         * Makefile.am: Added access.h, to hold shared access-control
3553         definitions
3554
3555 2002-07-02  Dick Porter  <dick@ximian.com>
3556
3557         * wapi-private.h (_WAPI_HANDLE_VERSION): New protocol version
3558         
3559 2002-07-02  Dick Porter  <dick@ximian.com>
3560
3561         * handles.c (shared_init): Make a second attempt to contact the
3562         daemon if the shared memory attach succeeds, but the connect()
3563         fails. (This copes with the daemon crashing without cleaning up
3564         the shared memory.)
3565
3566         * Makefile.am: 
3567         * daemon-private.h:
3568         * daemon.c:
3569         * shared.c (_wapi_shm_attach): Don't exec() anything when we fork
3570         the daemon, it's now built into the library.
3571
3572 2002-06-25  Dick Porter  <dick@ximian.com>
3573
3574         * handles.c:
3575         * handles-private.h:
3576         * daemon-messages.h:
3577         * daemon.c: Process forking and handle data management
3578
3579         * processes.h:
3580         * process-private.h:
3581         * processes.c: Process forking and other support functions
3582
3583 2002-06-25  Dick Porter  <dick@ximian.com>
3584
3585         * versioninfo.h: PE resource decoding
3586
3587         * unicode.c (_wapi_unicode_to_utf8): g_utf16_to_utf8 doesnt need
3588         to be told the string length
3589
3590         * io.c: Removed the ACTUALLY_DO_UNICODE option.  Fixed some leaks.
3591         Moved _wapi_time_t_to_filetime and the WapiFileTime typedef to
3592         timefuncs.c
3593
3594 2002-06-12  Dick Porter  <dick@ximian.com>
3595
3596         * daemon.c: 
3597         * daemon-messages.c: Handle SIGPIPE in a non-stupid way in the
3598         daemon, if MSG_NOSIGNAL isn't available.  Thanks to Jaroslaw
3599         Kowalski <jarek@atm.com.pl> for pointing out the bogosity.
3600
3601 2002-06-10  Jaroslaw Kowalski <jarek@atm.com.pl>
3602
3603         * sockets.c, daemon-messages.c: Prevent SIGPIPE from being raised
3604         when writing to a closed socket.
3605
3606 2002-06-08  Jeffrey Stedfast  <fejj@ximian.com>
3607
3608         * mono-mutex.c (mono_once): New convenience function for my
3609         previous fix.
3610
3611         * handles.c:
3612         * error.c: 
3613         * critical-sections.c: 
3614         * threads.c: 
3615         * sockets.c: 
3616         * semaphores.c: 
3617         * processes.c: 
3618         * mutexes.c: 
3619         * io.c: 
3620         * events.c: 
3621         * atomic.c: Use mono_once() rather than pthread_once().
3622
3623 2002-06-06  Jeffrey Stedfast  <fejj@ximian.com>
3624
3625         * handles.c (_wapi_handle_new): pthread_once() is not atomic, so
3626         if multiple threads all try to call _wapi_handle_new() before the
3627         shared data has been initialized, it is possible that we could get
3628         into a condition where shared_init() is being executed and later
3629         threads will pass by pthread_once() due to the fact that it has
3630         already been called and so therefor will attempt to use the shared
3631         data before it has been completely initialized. If we instead use
3632         a standard mutex locking mechanism around shared_init(), we can
3633         avoid the situation entirely. By wrapping the mutex locking in a
3634         check to see if we've already initialized the data, we can even
3635         avoid wasting resources by having to lock/unlock the mutex in any
3636         later calls (the only time we'd have to worry about
3637         locking/unlocking is the initial race to call shared_init() at
3638         startup).
3639
3640 Sat Jun 1 13:27:11 CEST 2002 Paolo Molaro <lupus@ximian.com>
3641
3642         * atomic.h: inline asm fixes from Dennis Haney (davh@davh.dk).
3643
3644 Fri May 31 16:21:54 CEST 2002 Paolo Molaro <lupus@ximian.com>
3645
3646         * daemon.c, handles.c: rename "sun" local var since it's apparently
3647         a #define on Solaris.
3648
3649 Fri May 31 15:40:14 CEST 2002 Paolo Molaro <lupus@ximian.com>
3650
3651         * daemon-messages.c: work-around MSG_NOSIGNAL missing on some
3652         platforms.
3653
3654 2002-05-15  Dick Porter  <dick@ximian.com>
3655
3656         * wait.c: Fix a deadlock in WaitForMultipleObjects
3657
3658 2002-05-14  Dick Porter  <dick@ximian.com>
3659
3660         * io.c: Fix a cut&paste error, found by
3661         Jaroslaw Kowalski <jarek@atm.com.pl>
3662
3663 2002-05-10  Dan Lewis  <dihlewis@yahoo.co.uk>
3664
3665         * io.c: Nasty typo.
3666
3667 2002-05-09  Dick Porter  <dick@ximian.com>
3668
3669         * threads.c: 
3670         * semaphores.c: 
3671         * processes.c: 
3672         * mutexes.c: 
3673         * handles-private.h: 
3674         * events.c: 
3675         * Makefile.am: Remove now-unused file wait-private.h
3676
3677 2002-05-08  Dick Porter  <dick@ximian.com>
3678
3679         * shared.c: Better error messages, and report when daemon
3680         connection fails rather than blocking forever.  Do some more
3681         shared memory sanity checking.
3682
3683         * handles.c: Better error messages when connecting to shared
3684         memory and the handle daemon.  Fall back to non-shared handles if
3685         an error occurs.  Set the default back to 'shared handles'.  Fix a
3686         crashing bug in scratch space allocation that mangled the block
3687         headers.
3688
3689 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
3690
3691         * handles.c (shared_init): Disable SHM for now, people have too
3692         many problems with this, and the diagnostics are not helping.
3693
3694 2002-05-06  Dan Lewis  <dihlewis@yahoo.co.uk>
3695
3696         * io.c: CreateFile sets win32 last error.
3697
3698 2002-05-05  Dick Porter  <dick@ximian.com>
3699
3700         * wapi-private.h: 
3701         * handles-private.h:
3702         * io.c: 
3703         * io-private.h:
3704         * mutexes.c: 
3705         * mutex-private.h: 
3706         * processes.c: 
3707         * process-private.h: 
3708         * semaphores.c: 
3709         * semaphore-private.h: 
3710         * sockets.c: 
3711         * socket-private.h: 
3712         * events.c: 
3713         * event-private.h: Simplify the WapiHandleOps struct: take out all
3714         the file-specific entries, leaving just the items that operate on
3715         handles themselves.  Split the close operation into shared and
3716         private parts: shared close is called by the daemon.
3717
3718         * handles.c: As above, but also pass handle allocation, ref and
3719         unref operations to the daemon.  Populate the handle_ops array at
3720         compile time, because the daemon needs to call ops on handles too.
3721         Don't bother to track open handle counts any more, the daemon does
3722         that.
3723         
3724         * threads.c: 
3725         * thread-private.h: As above, but also make the thread data
3726         handle-private.
3727
3728         * shared.c: Fork a handle daemon if the calling process created
3729         the shared memory segment.
3730
3731         * daemon.c:
3732         * daemon-messages.c:
3733         * daemon-messages.h:
3734         * Makefile.am: Build a daemon to manage handle allocation and
3735         destruction without needing to lock the shared memory
3736
3737 2002-04-30  Jeffrey Stedfast  <fejj@ximian.com>
3738
3739         * atomic.c: Changed to use a normal mutex rather than a spinlock
3740         since a lot of platforms seem to not have them :\
3741
3742 2002-04-30  Dick Porter  <dick@ximian.com>
3743
3744         * Completely rewrote the handle waiting code: removed the helper
3745         thread and its attendant complexity.  All handle waiting is now
3746         abstracted into the WaitForSingleObject() and
3747         WaitForMultipleObjects() functions.
3748
3749         * Implemented inter-process sharing of handles using sysv shared
3750         memory.  This makes handles even more opaque, with a handle now
3751         just an index into an array.
3752         
3753 2002-04-25  Dan Lewis  <dihlewis@yahoo.co.uk>
3754
3755         * io.c: unitialized pointer in GetCurrentDirectory.
3756
3757 Sat Apr 20 13:37:39 CEST 2002 Paolo Molaro <lupus@ximian.com>
3758
3759         * threads.c: destroy the mutex at thread destruction
3760         (if/when thread destruction code will be actually called).
3761         When protecting a tls data pointer from the gc, use also the 
3762         thread id in the key.
3763         
3764 Wed Apr 17 18:36:27 CEST 2002 Paolo Molaro <lupus@ximian.com>
3765
3766         * timed-thread.c: avoid race condition when setting the thread to
3767         detached.
3768
3769 2002-04-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
3770
3771         * jit.h: to more #include lines to avoid breaking compilation
3772         under windows when upgrading mingw and w32api to version
3773         1.3 (thanks Dick!).
3774
3775 2002-04-16  Dick Porter  <dick@ximian.com>
3776
3777         * atomic.h: Explanatory comment about lack of 80386 support
3778
3779 2002-04-15  Dick Porter  <dick@ximian.com>
3780
3781         * atomic.h: use xaddl for InterlockedIncrement() and
3782         InterlockedDecrement().  Use cmpxchgl in a loop for
3783         InterlockedExchange() and InterlockedExchangePointer().
3784
3785 Mon Apr 15 13:31:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
3786
3787         * unicode.c: fix unicode_len() to not access uninitialized memory
3788         (and updated to conform to mono code style).
3789
3790 Fri Mar 29 17:15:11 CET 2002 Paolo Molaro <lupus@ximian.com>
3791
3792         * io.c: EEXISTS is ignored for directory creation.
3793         * mono-mutex.h: remove silly "pragma }" that emacs users insert
3794         because they use a broken editor:-)
3795
3796 2002-03-28  Dick Porter  <dick@ximian.com>
3797
3798         * sockets.h: 
3799         * sockets.c: 
3800         * io.c: 
3801         * handles.h: 
3802         * handles.c: Warning cleanups
3803
3804 2002-03-27  Dan Lewis <dihlewis@yahoo.co.uk>
3805
3806         * unicode.h, unicode.c: changed to gunichar2
3807         * io.h, io.c: changed strings to gunichar2*, added
3808         SetFileAttributes(), GetCurrentDirectory(), SetCurrentDirectory(),
3809         some fixes to FindFirstFile() and friends.
3810
3811 2002-03-26  Dick Porter  <dick@ximian.com>
3812
3813         * types.h: Implement the large integer struct
3814
3815         * timefuncs.h:
3816         * timefuncs.c: Dummy functions that don't yet implement
3817         QueryPerformanceCounter() and QueryPerformanceFrequency()
3818
3819         * threads.h:
3820         * threads.c: Implement SleepEx()
3821
3822         * system.h:
3823         * system.c: Beginnings of GetSystemInfo()
3824
3825         * mono-mutex.c (pthread_mutex_timedlock): Fix a ms/ns conversion
3826         thinko
3827
3828         * context.h:
3829         * context.c: Dummy function that doesnt yet implement
3830         GetThreadContext()
3831
3832         * atomic.h: 
3833         * atomic.c: Interlocked functions
3834
3835 Mon Mar 25 13:01:40 CET 2002 Paolo Molaro <lupus@ximian.com>
3836
3837         * threads.c: use a gc-safe hash table to store tls pointers.
3838
3839 2002-03-22  Dick Porter  <dick@ximian.com>
3840
3841         * threads.c: Fix a race condition where a thread can start and
3842         exit before the handle has been properly initialised (no reason
3843         why the handle couldn't be initialised beforehand, so do so)
3844
3845         Fix a ms to ns conversion magnitude thinko.
3846
3847 2002-03-21  Dick Porter  <dick@ximian.com>
3848
3849         * semaphores.c: Fix a problem when waiting for one or more
3850         semaphores, and another semaphore is Released (all waiting
3851         semaphores assumed they were signalled)
3852
3853 2002-03-29  Dan Lewis <dihlewis@yahoo.co.uk>
3854
3855         * io.h, io.c, uglify.h: added MoveFile, CopyFile, CreateDirectory,
3856         RemoveDirectory, GetFileAttributes, GetFileAttributesEx
3857
3858 2002-03-19  Dietmar Maurer  <dietmar@ximian.com>
3859
3860         * threads.c (Sleep): bug fix: 1ms == 1000000ns
3861
3862 2002-03-19  Dan Lewis <dihlewis@yahoo.co.uk>
3863
3864         * io.h, io.c, events.c, mutexes.c, semaphores.c, sockets.c,
3865         threads.c, io.c: added flush method to handles.
3866
3867         * io.c: FlushFileBuffers() and FindFirstFile() functions.
3868
3869 Thu Mar 7 17:21:52 CET 2002 Paolo Molaro <lupus@ximian.com>
3870
3871         * threads.c, timed-thread.c, wait.c: Boehm-GC anable.
3872
3873 2002-02-20  Dick Porter  <dick@ximian.com>
3874
3875         * io-layer.h: Always build without cygwin support on windows
3876
3877 Mon Feb 18 15:50:59 CET 2002 Paolo Molaro <lupus@ximian.com>
3878
3879         * sockets.c: #undef DEBUG.
3880
3881 2002-02-14  Jeffrey Stedfast  <fejj@ximian.com>
3882
3883         * io-layer.h: conditionally include sys/filio.h and sys/sockio.h
3884         for FIONBIO, FIONREAD, and SIOCATMARK.
3885
3886 2002-02-14  Jeffrey Stedfast  <fejj@ximian.com>
3887
3888         * sockets.c: conditionally include sys/filio.h and sys/sockio.h
3889         for FIONBIO, FIONREAD, and SIOCATMARK.
3890
3891 2002-02-13  Dick Porter  <dick@ximian.com>
3892
3893         * sockets.c: Implement shutdown and select
3894
3895 2002-02-13  Jeffrey Stedfast  <fejj@ximian.com>
3896
3897         * mono-mutex.[c,h]: New source files that thinly wrap all pthread
3898         functions that take pthread_mutex_t and/or pthread_mutexattr_t
3899         arguments for the sake of portability. Implements recursive
3900         mutexes and pthread_mutex_timedlock.
3901
3902         * critical-sections.c:
3903         * events.c:
3904         * handles.c:
3905         * mutexes.c:
3906         * semaphores.c:
3907         * threads.c:
3908         * timed-thread.c:
3909         * wait.c: Use the mono-mutex wrapper portability functions/macros.
3910
3911         * pthread-compat.[c,h]: Replaced by mono-mutex.[c,h]
3912
3913 2002-01-23  Dick Porter  <dick@ximian.com>
3914
3915         * sockets.c: Networking support, mostly wrapping BSD socket APIs
3916         with handle code, and translating errno into w32 error codes.
3917
3918         * macros.h: Some w32 macros used with the socket support
3919
3920         * error.c: Implemented GetLastError() and SetLastError()
3921
3922         * Makefile.am: Added sockets, with kludge to override some symbols
3923
3924 2001-12-17  Dietmar Maurer  <dietmar@ximian.com>
3925
3926         * unicode.c (_wapi_unicode_to_utf8): byteswap UTF16 strings before
3927         passing them to iconv
3928         (_wapi_unicode_to_utf8): only swap bytes on LE systems, remove bug
3929         from previous commit.
3930
3931 2001-12-11  Dick Porter  <dick@ximian.com>
3932
3933         * io.c: Implement DeleteFile(), GetFileTime(), SetFileTime() and
3934         FileTimeToSystemTime().
3935
3936         * unicode.c (unicode_len): Nasty way of finding length of unicode
3937         string with embedded NULLs (counts until two NULLs together).
3938
3939         * mutexes.c (mutex_close): 
3940         * events.c (event_close): Release the internal pthreads resources
3941
3942 2001-11-26  Dick Porter  <dick@ximian.com>
3943
3944         * critical-sections.c:
3945         * events.c:
3946         * handles.c:
3947         * io.c:
3948         * mutexes.c:
3949         * semaphores.c:
3950         * threads.c:
3951         * timed-thread.c:
3952         * wait.c: turn off DEBUG messages
3953
3954 2001-11-22  Dick Porter  <dick@ximian.com>
3955
3956         * handles.c (SignalObjectAndWait): Implement
3957
3958         * wait.c (WaitForSingleObject): Fix case where timeout == 0
3959
3960         * threads.c:
3961         * semaphores.c:
3962         * mutexes.c:
3963         * io.c:
3964         * events.c: Support for SignalObjectAndWait
3965         
3966 2001-11-21  Dick Porter  <dick@ximian.com>
3967
3968         * events.c:
3969         * handles.c:
3970         * mutexes.c:
3971         * semaphores.c:
3972         * threads.c:
3973         * wait.c: Reliable method of returning which handle was signalled
3974         on return from WaitForMultipleObjects().
3975
3976 2001-11-21  Dick Porter  <dick@ximian.com>
3977
3978         * events.c: Implement events
3979
3980 2001-11-15  Dick Porter  <dick@ximian.com>
3981
3982         * mutexes.c: Implement mutexes
3983
3984         * threads.c: 
3985         * semaphores.c: 
3986         * misc.c: Factor out some common code
3987
3988 2001-11-13  Dick Porter  <dick@ximian.com>
3989
3990         * threads.c: Implement TLS.  Implement GetCurrentThreadId(), and
3991         GetCurrentThread() by maintaining a hash of thread handles.
3992
3993         * threads.h: Define thread and process creation flags
3994
3995 2001-11-12  Dick Porter  <dick@ximian.com>
3996
3997         * critical-sections.c: Implement critical sections
3998
3999 2001-11-12  Dick Porter  <dick@ximian.com>
4000
4001         * semaphores.c: Implement semaphores
4002
4003         * wait.c (wait_for_item): Maintain a wait count rather than count
4004         signalled booleans.
4005
4006         * threads.c (thread_wait_multiple): Don't lock the wait item, that
4007         will block other wait threads
4008
4009 2001-11-11  Dick Porter  <dick@ximian.com>
4010
4011         * Makefile.am: Rename some automake variables
4012         (from Nick Drochak <ndrochak@gol.com>)
4013
4014 2001-11-10  Dick Porter  <dick@ximian.com>
4015
4016         * Makefile.am (libwapiincludedir): Fix include destination
4017
4018         * .cvsignore: Ignore generated files
4019
4020 2001-11-10  Dietmar Maurer  <dietmar@ximian.com>
4021
4022         * pthread-compat.c: added some include files to make it compile on
4023         linux.
4024
4025 2001-11-08  Dick Porter  <dick@ximian.com>
4026
4027         * Initial checkin.
4028
4029         This is a library emulating the win32 threading and IO API.