1 2005-09-20 Dick Porter <dick@ximian.com>
4 * processes.c: Periodically waitpid for known process IDs. Fixes
7 2005-09-15 Gonzalo Paniagua Javier <gonzalo@ximian.com>
10 (CreateFile): if the file is a named pipe, treat the handle as a pipe,
11 not as a file. Fixes bug #76075.
13 2005-08-27 Zoltan Varga <vargaz@gmail.com>
15 * atomic.h: Add support for intel icc.
17 2005-08-25 Zoltan Varga <vargaz@gmail.com>
19 * io-layer.h: Include winbase.h not WinBase.h.
21 2005-08-19 Dick Porter <dick@ximian.com>
23 * threads.c, threads.h, thread-private.h: Use a gsize to store the
24 thread ID, so it can hold a 64 bit value if needed.
26 2005-07-26 Gonzalo Paniagua Javier <gonzalo@ximian.com>
28 * error.c: map ENOENT to WSAECONNREFUSED. It might happen when
29 connecting to unix sockets. Closes bug #75632.
31 2005-07-05 Dick Porter <dick@ximian.com>
33 * io.c: Make sure SIGPIPE is ignored when calling write(2).
34 Prevents the runtime exiting when writing to a closed pipe,
37 2005-06-30 Dick Porter <dick@ximian.com>
39 * shared.c (_wapi_shm_semaphores_init): Add some helpful error
40 messages when semget () fails due to lack of resources.
42 2005-06-21 Dick Porter <dick@ximian.com>
47 * threads.c: Keep a list of owned mutexes in each thread handle,
48 so that it is easier to abandon them when the thread exits.
49 Removes a bottleneck when multiple threads are finishing in
52 2005-06-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
54 * io.c: (GetLogicalDrives) when a bogus line is read, don't leak memory.
55 When the buffer has not enough space, close the file before returning.
57 2005-06-09 Duncan Mak <duncan@novell.com>
59 * *.h: Added G_BEGIN_DECLS and G_END_DECLS where appropriate to
60 all public headers. Fixes #74919.
62 2005-05-30 Zoltan Varga <vargaz@freemail.hu>
64 * atomic.h: Add IA64 atomic ops.
66 2005-05-26 Gonzalo Paniagua Javier <gonzalo@ximian.com>
68 * processes.c: make ExitCode be valid even if the user didn't call
69 WaitForExit() and is just polling on HasExited.
71 2005-05-17 Dick Porter <dick@ximian.com>
73 * io.c (file_getfilesize): Clear the error value, so that files
74 with sizes with the low bits 0xFFFFFFFF can be distinguished from
77 2005-05-11 Gonzalo Paniagua Javier <gonzalo@ximian.com>
79 * shared.c: forgot to ignore a warning.
81 2005-05-10 Gonzalo Paniagua Javier <gonzalo@ximian.com>
83 * shared.c: don't display warnings after reboots.
85 2005-05-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
87 * sockets.c: on windows, getsockopt/setsockopt for send/receive timeout
88 use an integer in milliseconds. We were using a struct timeval.
90 2005-05-06 Dick Porter <dick@ximian.com>
99 * collection.h: Use SysV semaphores for managing access to the
100 shared memory - in return for the ludicrous api we get
101 synchronisation primitives that can be cleaned up by the kernel
102 even when a process quits unexpectedly. This removes the
105 2005-05-05 Lluis Sanchez Gual <lluis@novell.com>
107 * handles.c: Always use polling in the waits, since
108 mono_cond_timedwait can't be interruped by the thread abort signal.
110 2005-04-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
112 * events.c: calling Set on AutoResetEvent several times has the same
113 effect as calling it only once if no thread is waiting for it.
115 2005-04-29 Dick Porter <dick@ximian.com>
117 * processes.c (EnumProcesses): Use a GArray instead of a GPtrArray
118 now it's storing pids not handles, also fixes memory leak caused
119 by unclear glib documentation.
121 * sockets.c (WSACleanup): Remove unused variable
123 2005-04-29 Dick Porter <dick@ximian.com>
125 * handles.c (_wapi_handle_check_share_by_pid): For systems that
126 don't have file descriptor info in /proc check that the original
127 opener of a file is still there, if a share violation would
130 2005-04-28 Gonzalo Paniagua Javier <gonzalo@ximian.com>
133 * handles-private.h: added _wapi_handle_forecch that loops through all
134 the handles and call a callback function when a handle of the given
137 * sockets.c: no need to keep open sockets in an array, as we have them
138 in the handles structure.
142 2005-04-28 Dick Porter <dick@ximian.com>
144 * processes.c: Cope with handles that are only around for as long
145 as the search is running. If we're searching for process handles,
146 check to see if the process is still running and signal it if not.
148 * handles.c (_wapi_search_handle): Search in the shared space as
149 well. Fixed bug 74752.
152 * handles.c (_wapi_handle_new_from_offset):
153 _wapi_handle_new_for_existing_ns () was doing exactly the same as
156 2005-04-26 Dick Porter <dick@ximian.com>
158 * handles.c: Fix stupid thinko where if a new shared handle is
159 created but a collection was needed to free some space, it
160 returned an error anyway. Should fix the messages shown in bug
163 2005-04-25 Dick Porter <dick@ximian.com>
165 * handles.c (_wapi_handle_check_share): Only consider mono
166 processes when looking to see if a file is still being held open,
167 while checking share permissions.
169 2005-04-25 Dick Porter <dick@ximian.com>
173 * wapi-private.h (struct _WapiHandleOps):
174 * handles.c (_wapi_handle_unref): When destroying handles, save
175 the handle data and call the close function only after the array
176 slot has been cleared. This prevents race conditions with file
177 descriptors, fixing bug 74713.
179 * mutexes.c: Delete the handle close functions, they didn't do
182 * error.c (_wapi_get_win32_file_error): Add a mapping for EINTR so
183 the "Unknown error" g_warning doesn't get displayed.
185 2005-04-25 Dick Porter <dick@ximian.com>
188 * threads.c: Make thread handles process-private for now to take
189 some of the space pressure off the shared memory, while I work on
192 2005-04-21 Dick Porter <dick@ximian.com>
194 * handles.c (_wapi_handle_check_share): Make sure there is a "fd"
195 dir in /proc before blowing away handle info. Fixes bug 74649.
197 2005-04-21 Dick Porter <dick@ximian.com>
199 * wait.c (WaitForMultipleObjectsEx): Implement special waits
201 * handles.c (_wapi_handle_wait_signal_poll_share): Don't return a
202 timeout, just wait briefly for the private signals and let the
203 waiting thread test again. This prevents us missing shared
206 2005-04-21 Dick Porter <dick@ximian.com>
208 * collection.h (_WAPI_HANDLE_COLLECTION_EXPIRED_INTERVAL): Reduce
209 the time before a slot is considered too old and deleted. This is
210 a workaround while I come up with a proper fix.
212 2005-04-21 Dick Porter <dick@ximian.com>
217 * handles.c (_wapi_handle_new): Turn assertions into errors.
219 * collection.c (_wapi_handle_collect): Use symbols not magic
220 numbers for timeout values
222 2005-04-19 Dick Porter <dick@ximian.com>
226 * handles.c (_wapi_handle_count_signalled_handles)
227 * handles-private.h (_wapi_handle_shared_lock_handle): Use new
228 shared handle locks in critical sections.
230 * handles.c (_wapi_handle_new_for_existing_ns): Reuse old handles
231 if there is already one there.
233 * handles.c (_wapi_handle_ref): It was possible for a process to
234 exit before getting around to updating shared handle timestamps,
237 Tue Apr 19 16:25:47 CEST 2005 Paolo Molaro <lupus@ximian.com>
239 * threads.c: fix lookup of the thread id in the has table:
240 always use the id value, not the pointer to the id.
242 2005-04-18 Gonzalo Paniagua Javier <gonzalo@ximian.com>
244 * handles.c: fix handle returned in _wapi_handle_search_handle. Dick
247 2005-04-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
249 * io-layer/sockets.c: FIONBIO with a TRUE argument means we want
250 non-blocking IO, not the other way around.
252 2005-04-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
256 * handles-private.h: GetFileType wasn't checking if we have memory
257 allocated for the handle before dereferencing it. Fixes a FileStream
260 2005-04-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
264 * handles-private.h: we were calling g_renew to expand the handle array,
265 but that might move the memory and we might have pthread conditions or
266 mutexes in the original memory area that are being used. Now instead of
267 expanding an existing array, we just create new ones and keep a list of
268 them. Access to _wapi_private_handles had to be modified accordingly.
270 2005-04-15 Dick Porter <dick@ximian.com>
272 * collection.c: FreeBSD needs more than PTHREAD_STACK_MIN
274 2005-04-14 Raja R Harinath <rharinath@novell.com>
276 * wapi-private.h: Remove reference to 'daemon-private.h'.
278 Wed Apr 13 13:12:33 EDT 2005 Paolo Molaro <lupus@ximian.com>
280 * atomic.h: applied patch from mass@akuma.org (David Waite)
281 to fix InterlockedExchangeAdd.
282 Fixed a few other functions, including InterlockedCompareExchange()
283 which was miscompiled by gcc with optimizations enabled.
285 2005-04-13 Dick Porter <dick@ximian.com>
287 * io.c (share_check):
288 * handles.c (_wapi_handle_check_share): Refine the file check so
289 that sharing violations within the same process don't cause
292 2005-04-13 Dick Porter <dick@ximian.com>
294 * io.c (FindFirstFile): Fix bugs introduced with the merge (bug
297 2005-04-12 Dick Porter <dick@ximian.com>
299 The daemon-less io-layer. Extensive lowlevel changes in
300 handles.c, requiring some corresponding changes in other files
301 calling these functions. Private_foo structures have been
304 File descriptor handling differences account for most of the
305 changes in io.c and sockets.c.
309 * mutexes.c: Named mutexes are now a distinct type.
310 * atomic.h: Fix a PPC uninitialised variable warning.
311 * wait.c: Check conditions before waiting on a condition variable.
312 * processes.c: Handle process fork and wait without a daemon
313 (though this has the limitation of only being able to wait for
316 2005-04-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
323 * sockets.h: removed dead code that deals with async IO.
325 2005-03-30 Zoltan Varga <vargaz@freemail.hu>
327 * atomic.c (InterlockedIncrement): Fix fallback implementation of
328 InterlockedIncrement and InterlockedDecrement. Fixes #74228.
330 2005-03-29 Sebastien Pouliot <sebastien@ximian.com>
332 * io-layer.h: Add required header files for compiling with VS.NET.
334 2005-03-17 Miguel de Icaza <miguel@novell.com>
336 * io.c: don't fail on NFS when there are no more locks available.
338 2005-03-09 Dick Porter <dick@ximian.com>
340 * error.c (_wapi_get_win32_file_error): ENFILE and EMFILE should
341 map to ERROR_TOO_MANY_OPEN_FILES, not ERROR_NO_MORE_FILES. Fixes
344 2005-03-09 Dick Porter <dick@ximian.com>
346 * daemon.c (process_process_fork): Initialise the handle data
347 before using it in the error case. This is probably the error
348 we're working around in the previous change. Spotted by Taru Jain
349 <tjain@novell.com> and Hemanth Yamijala <YHemanth@novell.com>.
351 2005-03-07 Dick Porter <dick@ximian.com>
353 * daemon.c: It looks like g_shell_parse_argv() can return
354 argv[0]=NULL somehow, yet still not give an error. Make sure we
355 don't pass NULL to strrchr(), working around a segfault that
356 showed up on ZLM testing.
358 2005-03-01 Gonzalo Paniagua Javier <gonzalo@ximian.com>
360 * sockets.c: translate EINPROGRESS to EWOULDBLOCK in connect. This is
361 the expected error code showed by the test case in bug #73053.
363 2005-02-18 Gonzalo Paniagua Javier <gonzalo@ximian.com>
365 * io.c: another leftover.
367 Fri Feb 18 17:37:29 CET 2005 Paolo Molaro <lupus@ximian.com>
369 * io.c: fixed logic in checking errno in rev 40815.
371 Fri Feb 18 16:00:29 CET 2005 Paolo Molaro <lupus@ximian.com>
373 * threads.c: we don't depend on the GC checking tls
375 * processes.c: remove unused ref to GC headers.
377 Thu Feb 17 19:57:11 CET 2005 Paolo Molaro <lupus@ximian.com>
379 * io.c: remove _wapi_thread_cur_apc_pending () checks
380 when the siscall should return immediatly and handle
381 the case when a syscall is interrupted without
382 erroring out, but returning a 0 read/write if possible.
383 Still the cases of read from file need to be handled.
385 Tue Feb 8 18:28:11 CET 2005 Paolo Molaro <lupus@ximian.com>
387 * threads.c: make people test with 1 MB stack per thread.
389 2005-01-17 Dick Porter <dick@ximian.com>
391 * timefuncs.h: Make WapiFileTime endian-aware, as it's often
392 cast to and from 64bit ints. Fixes bug 71213.
394 2005-01-11 Dick Porter <dick@ximian.com>
396 * error.c (errno_to_WSA): Add EADDRNOTAVAIL error code
399 Mon Jan 10 16:15:19 EST 2005 Neale Ferguson <nealeferguson@earthlink.net>
401 * atomic.h: Fix functions on s390.
403 Mon Jan 10 20:30:19 CET 2005 Paolo Molaro <lupus@ximian.com>
405 * atomic.h: fix some functions on ppc (tests/interlocked.cs).
407 2005-01-10 Dick Porter <dick@ximian.com>
409 * misc.c (_wapi_calc_timeout): Guard against overflow when
410 calculating timeouts. This makes waiting with a large
411 (Int32.MaxValue) timeout not return immediately.
413 2004-12-23 Ben Maurer <bmaurer@ximian.com>
415 * io.c (io_ops): make this `const' so it is shareable (well, only
416 really shareable if it is statically linked...)
418 Mon Dec 20 11:58:33 CET 2004 Paolo Molaro <lupus@ximian.com>
420 * threads.c, threads.h: add accessor to get the pthread_key_t for
423 2004-12-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
425 * io.c: check for the existence of 'dest' and set ERROR_ALREADY_EXISTS
426 if it exists and is not the same as 'src'.
428 2004-12-01 Neale Ferguson <Neale.Ferguson@SoftwareAG-usa.com>
430 * atomic.h : Fix InterlockedCompareExchange for s390/s390x.
432 2004-12-01 Gonzalo Paniagua Javier <gonzalo@ximian.com>
434 * processes.c: unquote the cmd path, allow for ' or " when quoting and
435 pass the quoted program name to the daemon, otherwise the call to
436 g_shell_unquote in the daemon will break things up.
438 2004-10-14 Dick Porter <dick@ximian.com>
440 * sockets.c (_wapi_accept): Revert the previous change. We now
441 set the accepted socket to have the same blocking status as the
442 listening socket in managed code. This follows MS behaviour.
444 2004-10-14 Dick Porter <dick@ximian.com>
446 * sockets.c (_wapi_accept): On Darwin, make sure a newly
447 accept()ed socket is blocking. Fixes bug 67355, patch by
448 grompf@sublimeintervention.com.
450 2004-10-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
452 * system.c: check the number of online processors instead of the
453 existing ones. Sanitize return value if it's an error.
455 2004-10-03 Ben Maurer <bmaurer@ximian.com>
457 * system.c: Add support for getting the # of cpus.
459 2004-09-28 Dick Porter <dick@ximian.com>
461 * io.c (pipe_close_private): Fix one small typo in the last change
462 that totally hosed process creation with redirected pipes.
464 2004-09-24 Dick Porter <dick@ximian.com>
471 * handles-private.h: Cope when a file descriptor is reused while
472 the handle that thought it owned it is still referenced, instead
473 of asserting. Probably fixes bug 66479, though we've been unable
476 2004-09-09 Dick Porter <dick@ximian.com>
479 * io.c: Set error codes everywhere.
481 2004-09-06 Dick Porter <dick@ximian.com>
483 * handles.c (_wapi_handle_unref): Reset the private record's type
484 (CloseHandle): Check for a fd mapping failure, and return FALSE.
485 (_wapi_handle_process_fork): Fix long-standing bug in checking
486 handle return values. Also do the required bookkeeping with the
487 new process's handles.
489 * daemon.c: When creating a new process's handles, check whether
490 the shared space needs to be increased
492 2004-09-05 Zoltan Varga <vargaz@freemail.hu>
494 * shared.c (_wapi_shm_file): Fix leaking of filename.
496 2004-08-19 Dick Porter <dick@ximian.com>
498 * handles.c (_wapi_handle_count_signalled_handles): Fix thinko
499 introduced with the fd offset stuff: unlock handles properly when
500 backing off. Fixes the monologue hang at exit.
502 2004-08-18 Dick Porter <dick@ximian.com>
505 * io.c: Check that new fds fit in the table, return error if not
507 * daemon.c (_wapi_daemon_main):
508 * handles.c (shared_init): Have all processes agree on a size for
511 2004-08-17 Dick Porter <dick@ximian.com>
513 * daemon.c (process_new):
514 * handles.c (_wapi_handle_new_internal): Cope when the space
515 reserved for file descriptors is larger than the shared segment
516 size. Fixes the crash reported when running mono under gdb on
519 2004-08-16 Dick Porter <dick@ximian.com>
523 * handles-private.h (_wapi_handle_fd_offset_to_handle): Improve
524 error checking with passed-in file descriptors.
526 2004-08-11 Dick Porter <dick@ximian.com>
529 * io.c: Returned handle values are the file descriptor the handle
534 * daemon.c: Reserve the range of handles that can have the same
535 values as file descriptors. These won't be used, but the values
536 will be used as file, console, pipe or socket handles. The fd to
537 handle mapping is done internally and is invisible to users.
540 * wapi-private.h (_WAPI_HANDLE_VERSION): Increment, because we now
541 reserve a chunk of handle space.
543 2004-08-04 Neale Ferguson <Neale.Ferguson@SoftwareAG-usa.com>
545 * atomic.h: add support for 64-bit S/390
547 2004-07-22 Dick Porter <dick@ximian.com>
550 * threads.c: Move the destruction of the internal thread data to
551 after the thread has been joined. Fixes bug 61418.
553 2004-07-14 Dick Porter <dick@ximian.com>
555 * wait.c (test_and_own): When not waiting for all handles to
556 become signalled, only own and return the lowest. All the
557 documentation suggests that the old way was correct, but
558 experimentation shows it actually works like this. Patch by
559 Sébastien Robitaille
560 (sebastien.robitaille@croesus.com), fixes bug 61511.
562 2004-07-09 Ben Maurer <bmaurer@ximian.com>
564 * threads.c: register roots for gc
566 2004-07-08 Dick Porter <dick@ximian.com>
568 * io.c (file_seek): If there is a high 32bit offset part, make
569 sure the low part isn't sign-extended. Set error codes when
570 returning failure. Fixes bug 61131.
572 2004-07-06 Dick Porter <dick@ximian.com>
574 * io.c (file_setfiletime): Check for underflow when converting to
575 time_t values. Set error codes when returning failure. Fixes bug
578 2004-07-05 Dick Porter <dick@ximian.com>
580 * mutexes.c (mutex_ops_init): Make the named mutex mutex sharable.
582 * daemon.c (unref_handle): Only destroy a handle if all processes
583 have released it, not just the current one. Fixes bug 60887.
585 2004-06-30 Zoltan Varga <vargaz@freemail.hu>
587 * mono-mutex.h atomic.h: Add G_GNUC_UNUSED to static inline functions
590 2004-06-24 Dick Porter <dick@ximian.com>
592 * mutexes.c: Indicate when a named mutex was reused
594 2004-06-24 Dick Porter <dick@ximian.com>
596 * threads.c (SuspendThread):
597 * timed-thread.c (_wapi_timed_thread_suspend): Wrap sem_wait in a
598 while loop. See bug 58161.
600 Wed Jun 23 23:29:04 CEST 2004 Paolo Molaro <lupus@ximian.com>
602 * io.c: don't use sharemode for on-disk file permissions: it's used
603 for shared access to the open file.
605 2004-06-22 Dick Porter <dick@ximian.com>
607 * events.c (CreateEvent): When creating an auto-reset event that
608 is initially owned, make sure the set count starts at 1.
610 2004-06-18 Dick Porter <dick@ximian.com>
613 * events.c: Auto-reset events need to release one thread for each
614 time SetEvent() is called. Fixes bug 41292.
618 * mutexes.c: Scan for mutexes that are still locked by a thread
619 when it exits. Fixes the MS demo app linked by bug 41292.
621 * wait.c (test_and_own): Make sure a handle is signalled before it
624 2004-06-16 Dick Porter <dick@ximian.com>
626 * timed-thread.c: Call the thread cleanup exit routine before taking
627 the join mutex, because this could deadlock if another thread tries
628 to join in the meantime. This fixes the hang-at-exit problem seen
631 2004-06-03 Lluis Sanchez Gual <lluis@ximian.com>
633 * threads.c: Implemented SleepEx.
634 * threads.h: Fixed SleepEx signature.
636 2004-06-03 Miguel de Icaza <miguel@ximian.com>
638 * threads.c: When running under valgrind, do not allocate too much
639 stack, as Valgrind default is 1 meg.
641 2004-05-27 Dick Porter <dick@ximian.com>
644 * io.c: Implemented LockFile() and UnlockFile()
646 2004-05-21 Dick Porter <dick@ximian.com>
648 * io.c (CreateFile): Check for existing share modes when opening
654 * daemon.c: Maintain a hash of file share modes, keying on device
655 and inode (to cope with symlinks.)
657 2004-05-20 Lluis Sanchez Gual <lluis@ximian.com>
659 * daemon-messages.c: Retry if the communication with the daemon is
660 interrupted by a signal.
661 * io.c, sockets.c: Check for EINTR in every syscall that can be interrumped.
662 Only return an error in this case if there is something in the apc queue
663 (which means that it is an interruption requested by the "user").
664 * processes.c: Use WaitForSingleObjectEx. No need to pass "alertable" as
665 true since the wait is small.
666 * shared.c: Retry write calls when interrumped by a signal.
667 * timed-thread.h, timed-thread.c: added _wapi_thread_apc_pending, which
668 returns TRUE if there are pending asynchronous calls (APC) for the
669 provided thread. Also added _wapi_thread_dispatch_apc_queue which calls
670 the enqueued APCs. Defined a new struct ApcInfo that holds information
671 about an enqueued APC.
672 * thread-private.h, threads.c: Implemented QueueUserAPC (which does the same
673 as in win32),_wapi_thread_apc_pending and _wapi_thread_dispatch_apc_queue.
674 These last two methods call the corresponding apc methods in
675 thread-private using the provided thread handle.
676 * threads.h: Added QueueUserAPC.
677 * uglify.h: Added WapiApcProc (needed by QueueUserAPC).
678 * wait.c, wait.h: Changed WaitForSingleObject to WaitForSingleObjectEx, and
679 WaitForMultipleObjects to WaitForMultipleObjectsEx. Implemented support
680 for APCs in those two methods and also in SleepEx.
682 2004-05-17 Dick Porter <dick@ximian.com>
684 * io.c (CopyFile): Speed up. Fixes bug 57859.
686 2004-05-13 Dick Porter <dick@ximian.com>
687 * mono-mutex.c (mono_mutex_unlock): Return EPERM when the current
688 thread doesn't own the mutex, rather than assert()ing.
690 2004-05-11 Dick Porter <dick@ximian.com>
692 * shared.c (_wapi_shm_attach): Cope when a previous daemon startup
693 attempt failed, leaving shared files that look like a daemon is
696 2004-05-10 Gonzalo Paniagua Javier <gonzalo@ximian.com>
699 (SetFileAttributes): don't the the exec bit if the corresponding read
702 2004-05-10 Zoltan Varga <vargaz@freemail.hu>
704 * io.c (FindFirstFile): Fix invalid free.
706 2004-05-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
708 * io.c: translate from GFileError to errno codes and don't free
709 variables right after calling mono_io_scandir, as we may overwrite
712 2004-05-08 Gonzalo Paniagua Javier <gonzalo@ximian.com>
714 * io.c: g_dir_open return ENOENT for directories on which we don't have
715 read/execute permission, while returning EPERM for anything below those.
716 So, change ENOENT by EPERM if the directory exists.
718 2004-05-07 Dick Porter <dick@ximian.com>
720 * io.c (SetFileAttributes): Don't have failed chmod()s cause a
721 "file not found" error. Fixes bug 54032.
723 2004-05-07 Dick Porter <dick@ximian.com>
725 * io.c (FindFirstFile): Comment out a windows-compatibility check
726 that breaks when directories have metachars in their names.
727 Workaround for bug 58116.
729 2004-05-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
731 * io.c: fixed for FindFirstFile for empty directories. Closes
734 2004-05-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
736 * processes.c: set the start time for the current process. Fixes bug
739 2004-05-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
741 * io-private.h: 'namelist' is now a gchar ** in _WapiHandlePrivate_find.
742 * io.c: implemented scandir using glib functions.
744 2004-05-04 Dick Porter <dick@ximian.com>
746 * daemon.c (read_message): Return FALSE on error so the GSource
747 callback itself can return FALSE. Cures the infinite loop poll()
749 * shared.c: Fix some daemon startup race conditions.
751 2004-04-29 Miguel de Icaza <miguel@ximian.com>
753 * io.c (CopyFile): Use 32k buffers to copy the file instead of 2k,
754 use the stack, do not use dynamic memory.
756 2004-04-29 Zoltan Varga <vargaz@freemail.hu>
758 * io.c: Add scandir implementation for platforms which do not have
761 2004-04-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
763 * io.[ch]: implemented GetLogicalDriveStrings.
765 2004-04-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
768 * sockets.c: use the field name from configure when accessing sigval
769 pointer field. Makes this work on the Mac.
771 2004-04-28 Bernie Solomon <bernard@ugsolutions.com>
773 * atomic.c: (InterlockedExchange) fix typo for
776 2004-04-28 Gonzalo Paniagua Javier <gonzalo@ximian.com>
779 * sockets.c: added check for sys/aio.h.
781 2004-04-28 Gonzalo Paniagua Javier <gonzalo@ximian.com>
783 * error.[ch]: added _wapi_get_win32_file_error...
784 * io.c: ... which was _wapi_get_win32_error here.
785 * sockets.c: rename the function calls here too.
787 2004-04-28 Dick Porter <dick@ximian.com>
789 * daemon-messages.c: Avoid a deadlock when a thread is killed while
790 waiting for the daemon by using a recursive mutex. Helps bug 56699.
792 2004-04-28 Gonzalo Paniagua Javier <gonzalo@ximian.com>
794 * io.c: fixed leak in async_notifier().
796 * sockets.[ch]: added AIO support for sockets and fixed WSAIoctl
799 * threads.c: removed old comment.
801 2004-04-26 David Waite <mass@akuma.org>
810 * wapi-private.h: remove comma from end of enumeration declarations
811 * status.h: cast unsigned int types to int for enum assignment
813 2004-04-26 David Waite <mass@akuma.org>
816 * timefuncs.c: declare 64-bit constants as long long types (i.e.
819 2004-04-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
821 * socket-wrappers.h: _wapi_socket == WSASocket now. Added
824 * sockets.c: new unused parameters for _wapi_socket.
826 2004-04-22 Miguel de Icaza <miguel@ximian.com>
828 * timed-thread.c: Replace sem_init with MONO_SEM_INIT to handle
829 the fact that MacOS X is a piece of junk (sem_init is *defined* in
830 the libc, but they return `not implemented').
832 2004-04-22 Dick Porter <dick@ximian.com>
835 * handles-private.h: Reference the handle when it is locked, so
836 that another thread can't blow it away while we're waiting for it
852 * critical-sections.c:
853 * atomic.c: Added pthreads cleanup handlers and error asserts
856 * handles.c: Fixed the gcc "variable might be used uninitialised"
857 warnings. They can't happen, but gcc doesn't know that
858 g_assert()s don't return.
860 Fixed the declaration of _wapi_handle_process_kill() so that it
861 expects the correct type for the pid.
863 * threads.c: Removed the TLS_PTHREAD_MUTEX style locking that
864 hasn't been used in ages and just made the code more complex.
866 2004-04-17 Zoltan Varga <vargaz@freemail.hu>
868 * processes.c: Include <signal.h> for SIGKILL and SIGILL + fix some
869 warnings. Fixes #57168.
871 2004-04-16 Dick Porter <dick@ximian.com>
873 * threads.c (Sleep): Using div(3) with a negative (when signed)
874 numerator causes the quotient to be 0 and the remainder to be the
875 numerator. This feeds a small negative value to nanosleep(3),
876 which will return immediately and cause a busy wait. Fixes bug
879 2004-04-15 Dick Porter <dick@ximian.com>
882 * io.c: Rewrite FindFirstFile and FindNextFile using scandir(3)
883 and fnmatch(3) instead of glob(3). glob() can't cope with being
884 given filenames containing metachars. This fixes bug 40557.
886 2004-04-14 Bernie Solomon <bernard@ugsolutions.com>
888 * security.c: #warning is a GCC-ism
890 2004-04-13 Sebastien Pouliot <sebastien@ximian.com>
892 * security.c: Removed GetUserName as glib g_get_user_name does a
893 better (portability) job. Added ImpersonateLoggedOnUser and
896 2004-04-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
898 * mono-mutex.h: move pthread_mutex_timedlock declaration to...
899 * mono-mutex.c: ...here. It was causing a warning that prevented
900 libgdiplus compilation.
902 2004-04-04 Miguel de Icaza <miguel@ximian.com>
904 * security.c (GetUserName): Make it work on MacOS X
906 2004-04-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
908 * security.c: use getpwuid_r if available. This one is thread-safe.
910 2004-04-02 Sebastien Pouliot <sebastien@ximian.com>
912 * Makefile.am: Added security.c|h.
913 * security.c: New file for security related functions. Added function
914 GetUserName to fix #56144.
915 * security.h: New. Header file for security.c
916 * wapi.h: Added include for security.h
918 2004-03-25 Gonzalo Paniagua Javier <gonzalo@ximian.com>
920 * daemon-messages.h: added kill structs.
922 * daemon.c: implemented process_process_kill.
923 * handles-private.h: define process_process_kill.
924 * handles.c: implemented _wapi_handle_process_kill.
925 * processes.[ch]: implemented TerminateProcess.
927 2004-03-25 Bernie Solomon <bernard@ugsolutions.com>
929 * daemon.c (rem_fd): On solaris you seem to get an
930 error even after removing the input source so don't
931 try and rem_fd it twice.
933 2004-03-25 Lluis Sanchez Gual <lluis@ximian.com>
935 * daemon.c: in process_post_mortem, If the child terminated due to the
936 receipt of a signal, the exit status must be based on WTERMSIG, since
937 WEXITSTATUS returns 0 in this case.
939 2004-03-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
941 * daemon.c: turned a warning into a DEBUG statement. Now we may hit it.
943 2004-03-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
945 * daemon.c: only call getdtablesize () once.
946 * processes.c: wait 500 ms to check if execve failed and throw the same
947 exception as MS on failure. Fixes bug #32809.
949 2004-03-17 Bernie Solomon <bernard@ugsolutions.com>
951 * io.c (async_notifier): use "union sigval" rather
952 than sigval_t as Solaris doesn't have sigval_t
953 (which isn't in IEEE 1003.1 either).
955 2004-03-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
957 * io.c: added debug stuff and removed a few redundant lines in
960 2004-03-15 Gonzalo Paniagua Javier <gonzalo@ximian.com>
962 * io-private.h: added new fields for file structure. Declare
963 _wapi_io_add_callback.
965 * io.c: added _wapi_get_win32_error, support aio_read/write in
966 file_read/write. Implemented _wapi_io_add_callback, which is where
969 * io.h: added new fields for WapiOverlapped and typedef for the
972 * processes.c: fixed off-by-one bug when handling environment variables
975 * threads.[ch]: implemented BindIoCompletionCallback.
977 * uglify.h: added typedef for LPOVERLAPPED_COMPLETION_ROUTINE.
979 2004-03-14 Zoltan Varga <vargaz@freemail.hu>
981 * socket-wrappers.h: Remove extra semicolon.
983 2004-03-03 Dave Camp <dave@ximian.com>
985 * daemon.c: (add_fd), (fd_activity), (_wapi_daemon_main):
986 Use a new main context.
988 2004-03-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
991 (GetFileAttributes): set the error depending on errno instead of
992 setting ERROR_FILE_NOT_FOUND always. See bug #55160.
994 2004-03-01 Gonzalo Paniagua Javier <gonzalo@ximian.com>
997 (CopyFile): free the buffer on error.
999 (WSAIoctl): free the buffer on error.
1001 2004-02-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
1003 * error.c: fixed mapping for EPROTONOSUPPORT and ESOCKTNOSUPPORT.
1005 * sockets.[ch]: retry creating the socket for AF_INET, SOCK_RAW
1006 using IP protocol with IP over IP. Implemented WSAIoctl UNIX-style.
1008 2004-01-27 Bernie Solomon <bernard@ugsolutions.com>
1010 * shared.c (_wapi_shm_file): add hostname
1011 to shared data file names to handle NFS mounted
1014 Mon Jan 26 16:15:03 CET 2004 Paolo Molaro <lupus@ximian.com>
1016 * sockets.h: remove obsolete soklen_t typedef.
1018 Fri Jan 23 21:07:02 CET 2004 Paolo Molaro <lupus@ximian.com>
1020 * socket-wrappers.h, sockets.h, sockets.c, Makefile.am: move socket
1021 wrappers to its own non-installed header file.
1023 2004-01-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
1026 (FindFirstFile): unlock the handle if FindNextFile fails.
1027 (FindNextFile): g_free a couple of pointers before retrying.
1030 (WaitForMultipleObjects): if only one handle provided, use
1031 WaitForSingleObject.
1033 2003-12-22 Bernie Solomon <bernard@ugsolutions.com>
1035 * handles-private.h: (_wapi_handle_type) check
1036 for segment in range before using it
1038 2003-12-22 Bernie Solomon <bernard@ugsolutions.com>
1040 * thread-private.h: _wapi_thread_ops is now const
1043 Mon Dec 22 18:29:03 CET 2003 Paolo Molaro <lupus@ximian.com>
1045 * threads.c, timed-thread.c, timed-thread.h: use mach
1046 semaphores on Darwin (MacOSX) since the posix ones
1047 are mostly broken there (threads are not created suspended
1048 and they can start executing before they are fully initialized
1049 like in tests/thread-static.cs).
1051 Mon Dec 22 17:18:45 CET 2003 Paolo Molaro <lupus@ximian.com>
1053 * atomic.h: ppc fixes.
1055 2003-12-19 Bernie Solomon <bernard@ugsolutions.com>
1057 * handles.c: remove my bad use of MONO_ZERO_ARRAY_LENGTH
1060 2003-12-15 Bernie Solomon <bernard@ugsolutions.com>
1062 * shared.c: (_wapi_shm_open) make scratch file
1063 not have to immediately regrow to avoid remaps
1064 (HPUX can't cope with these).
1065 (_wapi_shm_attach) use actual size of file
1066 to set scratch data_len for the creating process.
1068 * handles.c: (_wapi_handle_new_internal) make
1069 sure mutex & cond var are initialized even for
1070 non process shared ones.
1071 (_wapi_handle_unref) always call destroy
1072 routines on mutex & cond var
1074 2003-12-15 Bernie Solomon <bernard@ugsolutions.com>
1076 * daemon.c: change channel data structure so
1077 input sources are removed from glib event loop
1078 properly. xsp works better on Solaris and
1081 2003-12-12 Bernie Solomon <bernard@ugsolutions.com>
1083 * wapi-private.h: Replace G_GNUC_PRETTY_FUNCTION
1084 definition with file & line number for non-GCC
1087 2003-12-08 Bernie Solomon <bernard@ugsolutions.com>
1089 * Makefile.am: make sure hppa_atomic.s is in distribution
1091 2003-12-01 Dick Porter <dick@ximian.com>
1094 * mutexes.c (CreateMutex):
1095 * mutex-private.h (struct _WapiHandle_mutex):
1096 * handles.c: Look up certain handle types by name, in a shared
1097 namespace. Currently only mutex handles have this implemented.
1100 * semaphores.c (CreateSemaphore):
1101 * events.c (CreateEvent): Fix signature
1103 2003-11-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
1105 * io.c: don't call g_free before testing errno as it may modify it.
1106 If the path exists, return an error if it's not a directory. Fixes
1109 2003-11-20 Dick Porter <dick@ximian.com>
1111 * io.c: Missed a little-endian UTF16 conversion. Patch from
1112 Jeroen Zwartepoorte (Jeroen@xs4all.nl), fixes bug 51065.
1114 2003-10-29 Dick Porter <dick@ximian.com>
1116 * io.c (MoveFile): If the move crosses filesystems, try and fall
1117 back to copy and delete. Patch from Jörg Rosenkranz
1118 (JoergR@voelcker.com), fixes bug 50298.
1120 2003-10-28 Dick Porter <dick@ximian.com>
1122 * io.c: Use the new encoding conversion to cope with non-utf8
1123 locales in filenames.
1125 * processes.c: Ditto for process arguments.
1127 Tue Oct 21 12:01:14 CEST 2003 Paolo Molaro <lupus@ximian.com>
1129 * atomic.h: some ppc inline asm fixes (incorrect use of labels,
1130 incorrect register constraints, incorrect clobber lists).
1132 2003-10-13 Bernie Solomon <bernard@ugsolutions.com>
1134 * Makefile.am hppa_atomic.s: add HP 64bit
1135 implementation of atomic ops
1137 2003-10-13 Zoltan Varga <vargaz@freemail.hu>
1139 * threads.c (CreateThread): Wrap pthread_attr_setstacksize call in
1140 a conditional for platforms that don't have it.
1142 2003-10-09 Bernie Solomon <bernard@ugsolutions.com>
1144 * threads.c: (CreateThread) use stacksize argument
1145 if non-zero - change default for 64 bits to 4Mb
1147 2003-09-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
1149 * sockets.c: set last error when socket creation fails. This shed some
1150 light on bug #49015.
1152 2003-09-28 Gonzalo Paniagua Javier <gonzalo@ximian.com>
1154 * processes.c: fixed bug #48973: we only change \ by / for the argument
1155 to be used as command.
1156 When getting the program name from the args, don't let the space between
1159 2003-09-24 Bernie Solomon <bernard@ugsolutions.com>
1161 * atomic.h atomic.c: fix sparc so lock is
1162 global, increment does so and it compiles under Sun compiler.
1164 2003-09-22 Bernie Solomon <bernard@ugsolutions.com>
1166 * handles.c: include <string.h> directly as may
1167 not be nested in <sys/un.h> like Linux
1169 2003-09-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
1172 (DeleteFile): call SetLastError on failure. Fix by
1173 richard.torkar@htu.se (Richard Torkar). Closes bug #48222.
1175 2003-09-15 Lluis Sanchez Gual <lluis@ximian.com>
1177 * daemon.c: In compare_process(), discard handles already signalled.
1179 2003-09-02 Dick Porter <dick@ximian.com>
1181 * io.c: Work around glib brain-dead assumptions about utf8-encoded
1182 filenames. Fixes bug 30781.
1184 2003-08-28 Dick Porter <dick@ximian.com>
1186 * critical-sections.c: Patch from Bernie Solomon
1187 <bernard@ugsolutions.com> to emit a warning if locking a critical
1190 2003-07-23 Dick Porter <dick@ximian.com>
1193 * daemon.c (maybe_exit): Avoid the race condition when the daemon is
1194 closing but another client comes along when the shared data is still
1195 visible. Should fix bugs 33671 and 35213.
1197 2003-07-23 Dick Porter <dick@ximian.com>
1199 * handles.c: Initialise handle mutex and cond. Fix by
1200 Bernie Solomon <bernard@ugsolutions.com>
1202 2003-07-15 Dick Porter <dick@ximian.com>
1204 * timed-thread.c (timed_thread_start_routine): Fix virtual memory
1205 leak when threads quit. Fixes bug 44067.
1207 Wed Jun 18 19:08:40 CEST 2003 Paolo Molaro <lupus@ximian.com>
1209 * io.c: never add write permission for group or others in
1210 SetFileAttributes ().
1212 2003-06-17 Dick Porter <dick@ximian.com>
1214 * io.c (SetFileAttributes): Implement the ReadOnly attribute, and
1215 ignore the unsupported ones ("fixes" bug 44977).
1217 2003-06-17 Lluis Sanchez Gual <lluis@ximian.com>
1219 * misc.c: fix bug in _wapi_calc_timeout. It gave wrong values for
1220 high ms values (there was an overflow).
1222 2003-06-17 Zoltan Varga <vargaz@freemail.hu>
1224 * system.h (struct _WapiSystemInfo ): Fix warnings when using gcc-3.3.
1226 2003-06-11 Dick Porter <dick@ximian.com>
1228 * shared.c: Fix shared directory creation. Patch from
1229 Pablo Baena <pbaena@uol.com.ar>
1231 2003-06-10 Dick Porter <dick@ximian.com>
1233 * atomic.c: Delete the useless compile warning
1235 2003-06-09 Dick Porter <dick@ximian.com>
1237 * daemon.c: Lookup env as a string array. Fixes bug 44289. Also
1238 make setting the process handle value in the environment actually
1241 * processes.c: Pretty up the process name, if it happens to be
1242 "mono" such as when another mono process forks "mono foo.exe"
1244 2003-06-05 Dick Porter <dick@ximian.com>
1246 * processes.c (process_set_current): Don't do an expensive handle
1247 search at application startup, check the environment to see if the
1248 process handle has already been created.
1250 * io.c: Don't do an expensive handle search when creating stdin,
1251 stdout and stderr handles, just create them all the first time one
1258 * handles-private.h:
1259 * daemon-messages.h:
1261 * daemon.c: Support for "unlimited" number of handles and scratch
1264 Speed up application startup by passing process handle in the
1265 environment, rather than let the app scan all handles (which gets
1266 really slow when there are more than a few thousand to check.)
1268 Initialise some structs passed to syscalls, noticed by valgrind.
1271 2003-05-20 Dick Porter <dick@ximian.com>
1273 * io.c (FindFirstFile): Include . files in the glob. Fixes bug
1276 2003-05-19 Dick Porter <dick@ximian.com>
1278 * threads.c: Set the new thread's stack size to 2M. Fix needed
1279 for BSD, reported by Martin Dvorak <md@9ll.cz>
1281 2003-05-16 Dick Porter <dick@ximian.com>
1284 * io.c: Implement GetTempPath()
1286 2003-05-16 Dick Porter <dick@ximian.com>
1288 * processes.c (CreateProcess): Set some error codes
1290 2003-05-12 Dick Porter <dick@ximian.com>
1292 * misc.c (_wapi_calc_timeout): Cope with overflowing tv_nsec.
1293 Patch from Martin Dvorak <mdvorak@ninell.cz>.
1295 2003-05-10 Dick Porter <dick@ximian.com>
1297 * io.c (CopyFile): Copy file mode as well as file data. Based on
1298 suggestion by Giuseppe Greco <giuseppe.greco@agamura.com>, bug
1301 2003-05-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
1303 * handles.c: don't call GC_gcollect when creating new handles.
1305 2003-05-05 Gonzalo Paniagua Javier <gonzalo@ximian.com>
1307 * handles.c: added some debugging code. Call GC_gcollect
1308 before creating a new handle. It makes Lupus' test run smoother and
1309 faster (from 62 to 83 request per second). Notice that calling
1310 GC_finalizer_notifier if needed (GC_should_invoke_finalizer ()) does
1311 not improve nor degrade the performance, so i don't do it.
1313 2003-05-02 Dick Porter <dick@ximian.com>
1315 * sockets.c: Rearrange closesocket() and socket_close_private(),
1316 and remember to unref the handle, so we don't leak socket handles.
1317 Fix from Pelle Johnsen <pelle.johnsen@mail.dk>
1319 2003-04-11 Dick Porter <dick@ximian.com>
1321 * atomic.h: ARM atomic operations by Malte Hildingson
1322 <tds00mahi@tellus.thn.htu.se>
1324 Tue Apr 8 11:37:29 CEST 2003 Paolo Molaro <lupus@ximian.com>
1326 * atomic.h: fix macosx build by "Urs C. Muff" <umuff@quark.com>.
1328 2003-04-03 Martin Baulig <martin@ximian.com>
1330 The following change is conditional to `WITH_INCLUDED_LIBGC'
1331 which is not yet enabled by default.
1333 * threads.c (SuspendThread, ResumeThread): Fully implemented this.
1334 (gc_init): New static function; install a signal handler for
1335 SIGPWR which is used to suspend threads. [FIXME: it SIGPWR
1336 doesn't exist on all Unix systems, we need to find another
1338 (mono_wapi_push_thread_stack): New public function. Tells the
1339 garbage collector about the current stack pointer of a suspended
1342 2003-04-03 Martin Baulig <martin@ximian.com>
1344 * timed-thread.h (TimedThread): Added `suspended_sem',
1345 `suspend_count' and `stack_ptr'.
1347 2003-03-28 Dick Porter <dick@ximian.com>
1349 * atomic.h: PPC support gratiously donated to the public domain
1350 by John Duncan <jddst19@mac.com>
1352 2003-03-20 Dick Porter <dick@ximian.com>
1354 * sockets.c (_wapi_connect): If connect() fails with EACCES, try
1355 setting SO_BROADCAST and connecting again. Fixes bug 39178.
1357 2003-03-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
1359 * processes.c: included Jerome Laban's patch and call SetLastError when
1360 the executable is not found.
1362 2003-03-03 Dick Porter <dick@ximian.com>
1364 * io.c (CreateFile): Try opening directories readonly, so that
1365 timestamps can be adjusted. Patch by Elan Feingold
1366 <efeingold@mn.rr.com>.
1368 2003-02-25 Dick Porter <dick@ximian.com>
1370 * shared.c (_wapi_shm_attach): Return a failure code on system
1371 call errors, rather than exiting.
1373 2003-02-21 Dick Porter <dick@ximian.com>
1375 * processes.c (GetCurrentProcessId): Use the current process
1376 handle to return the process ID, as getpid() is unreliable
1377 (linuxthreads gives each thread a different pid). Fixes bug
1380 2003-02-21 Dick Porter <dick@ximian.com>
1382 * io.c (FindNextFile): Skip over dangling symlinks. Fixes bug
1385 2003-02-11 Dick Porter <dick@ximian.com>
1388 * timefuncs.c: Added GetTickCount()
1390 2003-02-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
1392 * error.c: added WSA_EHOSTUNREACH mapping.
1394 2003-01-26 Miguel de Icaza <miguel@ximian.com>
1396 * io.c (SetFileAttributes): This routine is not currently
1397 implemented for the general case, but I added a special case to
1398 set the executable bit on Linux.
1400 Wed Jan 15 15:55:40 CET 2003 Paolo Molaro <lupus@ximian.com>
1402 * sockets.h, daemon.c, io.c: compilation fixes on MacOSX.
1404 2003-01-08 Dick Porter <dick@ximian.com>
1406 * sockets.c: Fixed setting blocking mode to true (fixes bug 36388)
1408 2002-12-11 Juli Mallett <jmallett@FreeBSD.org>
1410 * daemon.c, handles-private.h, handles.c, wapi-private.h:
1411 Check for an implementation which says it supports
1412 _POSIX_THREAD_PROCESS_SHARED, rather than just one that
1413 defines the symbol. Defined but with a value of -1 still
1414 means that it is unsupported.
1416 2002-12-08 Martin Baulig <martin@ximian.com>
1418 * handles.c (_wapi_handle_new): Create new non-shared handles with
1419 an initial refcount of 1, not 0.
1421 2002-11-22 Dietmar Maurer <dietmar@ximian.com>
1423 * threads.c (TlsGetValue): removed unnecessary mutex
1425 2002-11-20 Dick Porter <dick@ximian.com>
1427 * timed-thread.c (_wapi_timed_thread_attach): Attached threads
1428 need to store their data structure too.
1430 * threads.c: Make sure the threading data is initialised wherever
1433 2002-11-15 Dick Porter <dick@ximian.com>
1435 * timed-thread.c: Removed unneeded parameters in
1436 _wapi_timed_thread_attach().
1438 * threads.c: Renamed AttachThread() to make it not look like
1439 external API. Removed unneeded parameters.
1441 2002-11-11 Gonzalo Paniagua Javier <gonzalo@ximian.com>
1443 * error.[ch]: added errno_to_WSA (). It displays a warning and return
1444 WSASYSCALLFAILURE if there is no error mapping for the given errno,
1446 * sockets.c: use errno_to_WSA and fixed display of warning for h_errno.
1448 2002-10-31 Dick Porter <dick@ximian.com>
1451 * io.c: Define and use INVALID_FILE_ATTRIBUTES
1453 2002-10-07 Dick Porter <dick@ximian.com>
1456 * daemon.c: Use a more accurate time source for process start and
1459 2002-10-03 Dick Porter <dick@ximian.com>
1463 * threads.c: Fixes for freebsd. Make sure that mutex and condition
1464 creation and deletion happen in the process that owns them, when
1465 POSIX shared thread objects aren't supported. This breaks on
1466 freebsd, as pthread_t is a pointer to data.
1468 2002-10-02 Dick Porter <dick@ximian.com>
1470 * shared.c: Use mmap() instead of sysv shm for the shared data.
1472 * wapi-private.h (_WAPI_HANDLE_VERSION): Reset back to 0, for the
1476 * daemon.c: mmap()ed regions survive fork, so just pass the
1477 pointer to _wapi_daemon_main instead of mapping it again.
1479 2002-10-01 Dick Porter <dick@ximian.com>
1481 * timed-thread.c: Kludge for CREATE_SUSPENDED thread creation.
1482 Unfortunately libgc uses the same thread suspend technique that I
1483 want to, and the two don't mix: libgc will deadlock when it tries
1484 to stop the world if a thread has already been suspended by
1485 someone else. Just do the simple suspended create rather than the
1486 general purpose thread suspension for now.
1488 * threads.c: Pass create flags to the timed_thread create call, to
1489 implement suspended thread creation. ResumeThread() partially
1490 implemented, to cope with the case where a newly created but
1491 suspended thread is launched.
1493 2002-09-30 Dick Porter <dick@ximian.com>
1495 * sockets.c (ioctlsocket): Set non-blocking mode in a better way,
1498 2002-09-27 Dick Porter <dick@ximian.com>
1500 * semaphores.c: Only include semaphore.h if it's present. Patch
1501 for BSD from jmmv@hispabsd.org (Julio Merino).
1503 2002-09-27 Dick Porter <dick@ximian.com>
1505 * processes.c: Pass environment and working directory to the
1506 daemon when forking. Don't let argv[0] be duplicated when looking
1507 for the program name. Implement EnumProcessModules (simple
1508 version for now, lsof-style later if needed), GetModuleBaseName,
1509 {Get,Set}ProcessWorkingSetSize (just faked, because the vm hints
1510 aren't available on Linux).
1512 * process-private.h: Store the process name, and the working set
1516 * handles-private.h: New functions to store and retrieve an array
1517 of strings in the scratch space
1519 * daemon.c: Don't miss deleting some handles when a client exits
1520 (we used to rely on the client doing the final cleanup, but
1521 obviously if the client is no longer there the daemon has to do
1524 Process forking now sets the environment and the working
1527 * io.c: Don't confuse fd 0 with an unassigned handle struct
1529 * atomic.h: Add a google cache alternative to the msdn URL
1531 2002-09-25 Gonzalo Paniagua Javier <gonzalo@ximian.com>
1534 (_wapi_recvfrom): added ECONNRESET to the switch.
1536 2002-09-24 Mark Crichton <crichton@gimp.org>
1538 * atomic.h: Yea. On linux, sparc isn't sparc, it's __sparc__.
1541 2002-09-19 Mark Crichton <crichton@gimp.org>
1543 * daemon.c, shared.c: Added NEED_LINK_UNLINK for systems that
1544 dont have Linux's abstract filesystem for sockets.
1546 2002-09-19 Mark Crichton <crichton@gimp.org>
1548 * atomic.h: Added SPARC atomic asm code.
1549 * daemon.c, handles-private.h, handles.c, wapi-private.h:
1550 undefined _POSIX_THREAD_PROCESS_SHARED. This actually exists on
1551 Solaris 9, however, the code paths don't seem to work. More testing
1552 on the shared case is *really* needed.
1554 2002-09-03 Dick Porter <dick@ximian.com>
1557 * threads.c: Removed PosixKillThread(), because it's not in the
1560 2002-08-20 Dick Porter <dick@ximian.com>
1562 * handles.c (_wapi_handle_scratch_store): Made stored byte lengths
1563 multiples of 4 bytes, to keep header structures aligned. Needed
1564 for sparc, at least. (Patch from crichton@gimp.org)
1566 * handles.c: Removed 'disable_shm' variable (we've defaulted to
1567 building with shm enabled for months now)
1569 2002-08-19 Dick Porter <dick@ximian.com>
1571 * daemon.c: Rewrote the poll() loop to use GIOChannels instead,
1572 for legacy NeXT-based systems.
1574 2002-08-12 Dick Porter <dick@ximian.com>
1576 * atomic.h: Rename some parameters to avoid c++ keywords (Patch
1577 from Joseph Wenninger <kde@jowenn.at>)
1579 2002-08-05 Dietmar Maurer <dietmar@ximian.com>
1581 * threads.c: use fast spinlocks by default
1583 2002-08-02 Dick Porter <dick@ximian.com>
1585 * io.c (GetStdHandle): Add a handle reference when returning a
1586 duplicate console handle. This fixes the unref_handle errors in
1589 2002-08-01 Dietmar Maurer <dietmar@ximian.com>
1591 * threads.c (TLS_PTHREAD_MUTEX): define this because else some
1594 2002-08-01 Dick Porter <dick@ximian.com>
1596 * threads.c: Use atomic spinlocks in TLS functions
1599 * Makefile.am: Added mono-spinlock.h
1601 2002-07-21 Jeffrey Stedfast <fejj@ximian.com>
1603 * daemon-messages.c: #include <sys/types.h> and <sys/sockets.h> -
1604 these are needed for sendmsg() and also for struct msghdr (at
1605 least on Solaris). Solaris still won't build because struct msghdr
1606 doesn't have msg_flags, msg_control, or msg_controllen members.
1607 (CMSG_SPACE): Define for systems that don't have it.
1610 2002-07-20 Dick Porter <dick@ximian.com>
1616 * handles.c: Implemented pipe handles
1619 * daemon.c: Fixed bug in handle closing.
1622 * daemon.c: Forked processes now close all open file descriptors.
1624 Fri Jul 19 19:05:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
1626 * sockets.h, io-layer.h, critical-sections.h: don't include config.h
1629 2002-07-19 Martin Baulig <martin@gnome.org>
1631 * threads.c (ExitThread): Call exit() if no threads has been
1634 2002-07-17 Dick Porter <dick@ximian.com>
1636 * daemon-messages.c: Freebsd fixes from Andreas Kohn
1637 <andreas.kohn@gmx.net>
1639 2002-07-15 Dick Porter <dick@ximian.com>
1641 * io.c: Removed bogus console_flush() method, that was just cut
1642 and pasted from file_flush when I separated the two handle types.
1644 2002-07-12 Dick Porter <dick@ximian.com>
1646 * io.c (convert_from_flags): Fixed misunderstanding wrt fcntl
1647 flags. Fixes bug 27633.
1649 2002-07-12 Dick Porter <dick@ximian.com>
1653 * daemon.c: Use size of sockaddr_un.sun_path from config.h
1655 2002-07-12 Dick Porter <dick@ximian.com>
1657 * processes.c (CreateProcess): Send stdin, stdout and stderr
1658 handles if the startup info doesnt specify new ones
1660 * io.c (GetStdHandle): Return the same handle when the same
1661 standard handle is requested
1663 * handles.c: Pass file descriptors when forking
1665 * daemon.c: Use supplied file descriptors when forking a new
1668 * daemon-messages.h:
1669 * daemon-messages.c: Pass stdin, stdout and stderr file
1670 descriptors to the daemon (used when forking)
1672 2002-07-11 Miguel de Icaza <miguel@ximian.com>
1674 * daemon.c (_wapi_daemon_main): Use sizeof
1675 (main_socket_address.sun_path) instead of hardcoded 108 value.
1677 * handles.c (shared_init): Use sizeof
1678 (shared_socket_address.sun_path) instead of hardcoded 108 value.
1680 2002-07-10 Dennis Haney <davh@davh.dk>
1684 * daemon.c: Lots of documentation, some added error checking, and
1685 code readability improvements.
1687 * daemon-messages.h: Add the Error request type to improve error
1690 * daemon-messages.c: Do a bit more error checking on send() and
1691 recv(), and log errors with a higher severity level.
1693 2002-07-04 Dick Porter <dick@ximian.com>
1695 * daemon.c (process_process_fork): Fix argument handling, due to
1696 buggy understanding of g_strsplit() behaviour.
1698 2002-07-03 Dick Porter <dick@ximian.com>
1701 * threads.c: Implement OpenThread(). Define access-control values
1707 * Makefile.am: Added access.h, to hold shared access-control
1710 2002-07-02 Dick Porter <dick@ximian.com>
1712 * wapi-private.h (_WAPI_HANDLE_VERSION): New protocol version
1714 2002-07-02 Dick Porter <dick@ximian.com>
1716 * handles.c (shared_init): Make a second attempt to contact the
1717 daemon if the shared memory attach succeeds, but the connect()
1718 fails. (This copes with the daemon crashing without cleaning up
1724 * shared.c (_wapi_shm_attach): Don't exec() anything when we fork
1725 the daemon, it's now built into the library.
1727 2002-06-25 Dick Porter <dick@ximian.com>
1730 * handles-private.h:
1731 * daemon-messages.h:
1732 * daemon.c: Process forking and handle data management
1735 * process-private.h:
1736 * processes.c: Process forking and other support functions
1738 2002-06-25 Dick Porter <dick@ximian.com>
1740 * versioninfo.h: PE resource decoding
1742 * unicode.c (_wapi_unicode_to_utf8): g_utf16_to_utf8 doesnt need
1743 to be told the string length
1745 * io.c: Removed the ACTUALLY_DO_UNICODE option. Fixed some leaks.
1746 Moved _wapi_time_t_to_filetime and the WapiFileTime typedef to
1749 2002-06-12 Dick Porter <dick@ximian.com>
1752 * daemon-messages.c: Handle SIGPIPE in a non-stupid way in the
1753 daemon, if MSG_NOSIGNAL isn't available. Thanks to Jaroslaw
1754 Kowalski <jarek@atm.com.pl> for pointing out the bogosity.
1756 2002-06-10 Jaroslaw Kowalski <jarek@atm.com.pl>
1758 * sockets.c, daemon-messages.c: Prevent SIGPIPE from being raised
1759 when writing to a closed socket.
1761 2002-06-08 Jeffrey Stedfast <fejj@ximian.com>
1763 * mono-mutex.c (mono_once): New convenience function for my
1768 * critical-sections.c:
1776 * atomic.c: Use mono_once() rather than pthread_once().
1778 2002-06-06 Jeffrey Stedfast <fejj@ximian.com>
1780 * handles.c (_wapi_handle_new): pthread_once() is not atomic, so
1781 if multiple threads all try to call _wapi_handle_new() before the
1782 shared data has been initialized, it is possible that we could get
1783 into a condition where shared_init() is being executed and later
1784 threads will pass by pthread_once() due to the fact that it has
1785 already been called and so therefor will attempt to use the shared
1786 data before it has been completely initialized. If we instead use
1787 a standard mutex locking mechanism around shared_init(), we can
1788 avoid the situation entirely. By wrapping the mutex locking in a
1789 check to see if we've already initialized the data, we can even
1790 avoid wasting resources by having to lock/unlock the mutex in any
1791 later calls (the only time we'd have to worry about
1792 locking/unlocking is the initial race to call shared_init() at
1795 Sat Jun 1 13:27:11 CEST 2002 Paolo Molaro <lupus@ximian.com>
1797 * atomic.h: inline asm fixes from Dennis Haney (davh@davh.dk).
1799 Fri May 31 16:21:54 CEST 2002 Paolo Molaro <lupus@ximian.com>
1801 * daemon.c, handles.c: rename "sun" local var since it's apparently
1802 a #define on Solaris.
1804 Fri May 31 15:40:14 CEST 2002 Paolo Molaro <lupus@ximian.com>
1806 * daemon-messages.c: work-around MSG_NOSIGNAL missing on some
1809 2002-05-15 Dick Porter <dick@ximian.com>
1811 * wait.c: Fix a deadlock in WaitForMultipleObjects
1813 2002-05-14 Dick Porter <dick@ximian.com>
1815 * io.c: Fix a cut&paste error, found by
1816 Jaroslaw Kowalski <jarek@atm.com.pl>
1818 2002-05-10 Dan Lewis <dihlewis@yahoo.co.uk>
1822 2002-05-09 Dick Porter <dick@ximian.com>
1828 * handles-private.h:
1830 * Makefile.am: Remove now-unused file wait-private.h
1832 2002-05-08 Dick Porter <dick@ximian.com>
1834 * shared.c: Better error messages, and report when daemon
1835 connection fails rather than blocking forever. Do some more
1836 shared memory sanity checking.
1838 * handles.c: Better error messages when connecting to shared
1839 memory and the handle daemon. Fall back to non-shared handles if
1840 an error occurs. Set the default back to 'shared handles'. Fix a
1841 crashing bug in scratch space allocation that mangled the block
1844 2002-05-07 Miguel de Icaza <miguel@ximian.com>
1846 * handles.c (shared_init): Disable SHM for now, people have too
1847 many problems with this, and the diagnostics are not helping.
1849 2002-05-06 Dan Lewis <dihlewis@yahoo.co.uk>
1851 * io.c: CreateFile sets win32 last error.
1853 2002-05-05 Dick Porter <dick@ximian.com>
1856 * handles-private.h:
1862 * process-private.h:
1864 * semaphore-private.h:
1868 * event-private.h: Simplify the WapiHandleOps struct: take out all
1869 the file-specific entries, leaving just the items that operate on
1870 handles themselves. Split the close operation into shared and
1871 private parts: shared close is called by the daemon.
1873 * handles.c: As above, but also pass handle allocation, ref and
1874 unref operations to the daemon. Populate the handle_ops array at
1875 compile time, because the daemon needs to call ops on handles too.
1876 Don't bother to track open handle counts any more, the daemon does
1880 * thread-private.h: As above, but also make the thread data
1883 * shared.c: Fork a handle daemon if the calling process created
1884 the shared memory segment.
1887 * daemon-messages.c:
1888 * daemon-messages.h:
1889 * Makefile.am: Build a daemon to manage handle allocation and
1890 destruction without needing to lock the shared memory
1892 2002-04-30 Jeffrey Stedfast <fejj@ximian.com>
1894 * atomic.c: Changed to use a normal mutex rather than a spinlock
1895 since a lot of platforms seem to not have them :\
1897 2002-04-30 Dick Porter <dick@ximian.com>
1899 * Completely rewrote the handle waiting code: removed the helper
1900 thread and its attendant complexity. All handle waiting is now
1901 abstracted into the WaitForSingleObject() and
1902 WaitForMultipleObjects() functions.
1904 * Implemented inter-process sharing of handles using sysv shared
1905 memory. This makes handles even more opaque, with a handle now
1906 just an index into an array.
1908 2002-04-25 Dan Lewis <dihlewis@yahoo.co.uk>
1910 * io.c: unitialized pointer in GetCurrentDirectory.
1912 Sat Apr 20 13:37:39 CEST 2002 Paolo Molaro <lupus@ximian.com>
1914 * threads.c: destroy the mutex at thread destruction
1915 (if/when thread destruction code will be actually called).
1916 When protecting a tls data pointer from the gc, use also the
1917 thread id in the key.
1919 Wed Apr 17 18:36:27 CEST 2002 Paolo Molaro <lupus@ximian.com>
1921 * timed-thread.c: avoid race condition when setting the thread to
1924 2002-04-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
1926 * jit.h: to more #include lines to avoid breaking compilation
1927 under windows when upgrading mingw and w32api to version
1930 2002-04-16 Dick Porter <dick@ximian.com>
1932 * atomic.h: Explanatory comment about lack of 80386 support
1934 2002-04-15 Dick Porter <dick@ximian.com>
1936 * atomic.h: use xaddl for InterlockedIncrement() and
1937 InterlockedDecrement(). Use cmpxchgl in a loop for
1938 InterlockedExchange() and InterlockedExchangePointer().
1940 Mon Apr 15 13:31:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
1942 * unicode.c: fix unicode_len() to not access uninitialized memory
1943 (and updated to conform to mono code style).
1945 Fri Mar 29 17:15:11 CET 2002 Paolo Molaro <lupus@ximian.com>
1947 * io.c: EEXISTS is ignored for directory creation.
1948 * mono-mutex.h: remove silly "pragma }" that emacs users insert
1949 because they use a broken editor:-)
1951 2002-03-28 Dick Porter <dick@ximian.com>
1957 * handles.c: Warning cleanups
1959 2002-03-27 Dan Lewis <dihlewis@yahoo.co.uk>
1961 * unicode.h, unicode.c: changed to gunichar2
1962 * io.h, io.c: changed strings to gunichar2*, added
1963 SetFileAttributes(), GetCurrentDirectory(), SetCurrentDirectory(),
1964 some fixes to FindFirstFile() and friends.
1966 2002-03-26 Dick Porter <dick@ximian.com>
1968 * types.h: Implement the large integer struct
1971 * timefuncs.c: Dummy functions that don't yet implement
1972 QueryPerformanceCounter() and QueryPerformanceFrequency()
1975 * threads.c: Implement SleepEx()
1978 * system.c: Beginnings of GetSystemInfo()
1980 * mono-mutex.c (pthread_mutex_timedlock): Fix a ms/ns conversion
1984 * context.c: Dummy function that doesnt yet implement
1988 * atomic.c: Interlocked functions
1990 Mon Mar 25 13:01:40 CET 2002 Paolo Molaro <lupus@ximian.com>
1992 * threads.c: use a gc-safe hash table to store tls pointers.
1994 2002-03-22 Dick Porter <dick@ximian.com>
1996 * threads.c: Fix a race condition where a thread can start and
1997 exit before the handle has been properly initialised (no reason
1998 why the handle couldn't be initialised beforehand, so do so)
2000 Fix a ms to ns conversion magnitude thinko.
2002 2002-03-21 Dick Porter <dick@ximian.com>
2004 * semaphores.c: Fix a problem when waiting for one or more
2005 semaphores, and another semaphore is Released (all waiting
2006 semaphores assumed they were signalled)
2008 2002-03-29 Dan Lewis <dihlewis@yahoo.co.uk>
2010 * io.h, io.c, uglify.h: added MoveFile, CopyFile, CreateDirectory,
2011 RemoveDirectory, GetFileAttributes, GetFileAttributesEx
2013 2002-03-19 Dietmar Maurer <dietmar@ximian.com>
2015 * threads.c (Sleep): bug fix: 1ms == 1000000ns
2017 2002-03-19 Dan Lewis <dihlewis@yahoo.co.uk>
2019 * io.h, io.c, events.c, mutexes.c, semaphores.c, sockets.c,
2020 threads.c, io.c: added flush method to handles.
2022 * io.c: FlushFileBuffers() and FindFirstFile() functions.
2024 Thu Mar 7 17:21:52 CET 2002 Paolo Molaro <lupus@ximian.com>
2026 * threads.c, timed-thread.c, wait.c: Boehm-GC anable.
2028 2002-02-20 Dick Porter <dick@ximian.com>
2030 * io-layer.h: Always build without cygwin support on windows
2032 Mon Feb 18 15:50:59 CET 2002 Paolo Molaro <lupus@ximian.com>
2034 * sockets.c: #undef DEBUG.
2036 2002-02-14 Jeffrey Stedfast <fejj@ximian.com>
2038 * io-layer.h: conditionally include sys/filio.h and sys/sockio.h
2039 for FIONBIO, FIONREAD, and SIOCATMARK.
2041 2002-02-14 Jeffrey Stedfast <fejj@ximian.com>
2043 * sockets.c: conditionally include sys/filio.h and sys/sockio.h
2044 for FIONBIO, FIONREAD, and SIOCATMARK.
2046 2002-02-13 Dick Porter <dick@ximian.com>
2048 * sockets.c: Implement shutdown and select
2050 2002-02-13 Jeffrey Stedfast <fejj@ximian.com>
2052 * mono-mutex.[c,h]: New source files that thinly wrap all pthread
2053 functions that take pthread_mutex_t and/or pthread_mutexattr_t
2054 arguments for the sake of portability. Implements recursive
2055 mutexes and pthread_mutex_timedlock.
2057 * critical-sections.c:
2064 * wait.c: Use the mono-mutex wrapper portability functions/macros.
2066 * pthread-compat.[c,h]: Replaced by mono-mutex.[c,h]
2068 2002-01-23 Dick Porter <dick@ximian.com>
2070 * sockets.c: Networking support, mostly wrapping BSD socket APIs
2071 with handle code, and translating errno into w32 error codes.
2073 * macros.h: Some w32 macros used with the socket support
2075 * error.c: Implemented GetLastError() and SetLastError()
2077 * Makefile.am: Added sockets, with kludge to override some symbols
2079 2001-12-17 Dietmar Maurer <dietmar@ximian.com>
2081 * unicode.c (_wapi_unicode_to_utf8): byteswap UTF16 strings before
2082 passing them to iconv
2083 (_wapi_unicode_to_utf8): only swap bytes on LE systems, remove bug
2084 from previous commit.
2086 2001-12-11 Dick Porter <dick@ximian.com>
2088 * io.c: Implement DeleteFile(), GetFileTime(), SetFileTime() and
2089 FileTimeToSystemTime().
2091 * unicode.c (unicode_len): Nasty way of finding length of unicode
2092 string with embedded NULLs (counts until two NULLs together).
2094 * mutexes.c (mutex_close):
2095 * events.c (event_close): Release the internal pthreads resources
2097 2001-11-26 Dick Porter <dick@ximian.com>
2099 * critical-sections.c:
2107 * wait.c: turn off DEBUG messages
2109 2001-11-22 Dick Porter <dick@ximian.com>
2111 * handles.c (SignalObjectAndWait): Implement
2113 * wait.c (WaitForSingleObject): Fix case where timeout == 0
2119 * events.c: Support for SignalObjectAndWait
2121 2001-11-21 Dick Porter <dick@ximian.com>
2128 * wait.c: Reliable method of returning which handle was signalled
2129 on return from WaitForMultipleObjects().
2131 2001-11-21 Dick Porter <dick@ximian.com>
2133 * events.c: Implement events
2135 2001-11-15 Dick Porter <dick@ximian.com>
2137 * mutexes.c: Implement mutexes
2141 * misc.c: Factor out some common code
2143 2001-11-13 Dick Porter <dick@ximian.com>
2145 * threads.c: Implement TLS. Implement GetCurrentThreadId(), and
2146 GetCurrentThread() by maintaining a hash of thread handles.
2148 * threads.h: Define thread and process creation flags
2150 2001-11-12 Dick Porter <dick@ximian.com>
2152 * critical-sections.c: Implement critical sections
2154 2001-11-12 Dick Porter <dick@ximian.com>
2156 * semaphores.c: Implement semaphores
2158 * wait.c (wait_for_item): Maintain a wait count rather than count
2161 * threads.c (thread_wait_multiple): Don't lock the wait item, that
2162 will block other wait threads
2164 2001-11-11 Dick Porter <dick@ximian.com>
2166 * Makefile.am: Rename some automake variables
2167 (from Nick Drochak <ndrochak@gol.com>)
2169 2001-11-10 Dick Porter <dick@ximian.com>
2171 * Makefile.am (libwapiincludedir): Fix include destination
2173 * .cvsignore: Ignore generated files
2175 2001-11-10 Dietmar Maurer <dietmar@ximian.com>
2177 * pthread-compat.c: added some include files to make it compile on
2180 2001-11-08 Dick Porter <dick@ximian.com>
2184 This is a library emulating the win32 threading and IO API.