1 2007-11-15 Dick Porter <dick@ximian.com>
3 * processes.c: Implement process module support by reading from
4 /proc if it's available.
7 * versioninfo.c: New functions to implement PE file version info
10 2007-11-08 Dick Porter <dick@ximian.com>
12 * critical-sections.h (EnterCriticalSection): Disable the critical
13 section asserts for the release branch
15 2007-11-05 Kornél Pál <kornelpal@gmail.com>
17 * io-layer.h: Added includes for run-time GetProcessId API detection for
20 2007-10-26 Dick Porter <dick@ximian.com>
22 * shared.c (_wapi_shm_file_open): Set the umask when opening
23 shared files, so restrictive defaults don't prevent subsequent
24 processes re-opening them.
26 2007-10-18 Zoltan Varga <vargaz@gmail.com>
28 * atomic.h (InterlockedCompareExchange): Fix the ia64 version so it works for
29 negative values too. Hopefully fixes #332700.
31 2007-09-26 Dick Porter <dick@ximian.com>
33 * io-portability.c (_wapi_io_scandir): Only update the error
34 status of glob() when performing a secondary glob() if the first
35 returned an error. Fixes bug 325107.
37 2007-09-12 Marek Habersack <mhabersack@novell.com>
39 * io-portability.c: options_init moved to
40 utils/mono-io-portability.c
41 Do not initialize portability helpers here, it's done in
43 find_file and find_in_dir moved to utils/mono-io-portability.c
45 2007-09-09 Robert Jordan <robertj@gmx.net>
47 * sockets.c (_wapi_setsockopt): Add support for FreeBSD multicast
48 sockets. Fixes #81891.
49 Code is contributed under MIT/X11 license.
51 2007-09-03 Atsushi Enomoto <atsushi@ximian.com>
53 * processes.h, processes.c : ok, they are simple string.
55 2007-09-03 Atsushi Enomoto <atsushi@ximian.com>
57 * processes.h : sigh, I really hate fixing them on windows :(
59 2007-09-03 Atsushi Enomoto <atsushi@ximian.com>
61 * processes.c : fix build again.
63 2007-09-03 Atsushi Enomoto <atsushi@ximian.com>
65 * processes.h : removed extra parameters from CreateProcessWithLogonW.
67 2007-09-03 Atsushi Enomoto <atsushi@ximian.com>
69 * processes.c, processes.h: added CreateProcessWithLogonW(). For now
70 it just calls CreateProcess().
71 * io-layer.h : CreateProcessWithLogonW() requires WINVER 0x0500
74 2007-08-23 Robert Jordan <robertj@gmx.net>
76 * processes.[c|h]: Implement Get|SetPriorityClass ().
77 Code is contributed under MIT/X11 license.
79 Tue Aug 21 20:08:09 CEST 2007 Paolo Molaro <lupus@ximian.com>
81 * io.c: made convert_arg_to_utf8() and write_file() static.
82 Worked around gcc's incorrect warning.
84 2007-08-20 William Holmes <billholmes54@gmail.com>
86 *io.c: Added implementation for ReplaceFile.
87 *io.h: Added deceleration for ReplaceFile method.
89 Code is contributed under MIT/X11 license.
91 2007-08-20 Wade Berrier <wberrier@novell.com>
93 * processes.c: include sys/resource.h for rusage to fix
96 Mon Aug 20 12:36:42 CEST 2007 Paolo Molaro <lupus@ximian.com>
98 * processes.c: implemented query for user/system times using
101 2007-08-10 Dick Porter <dick@ximian.com>
103 * sockets.c (_wapi_getsockopt, _wapi_setsockopt): Check the option
104 level as well as the name when mangling some of the values. Fixes
107 2007-08-02 Dick Porter <dick@ximian.com>
109 * sockets.c: Changes in error handling, and move the SO_REUSEADDR
110 setting from metadata/socket-io.c.
112 2007-08-01 Dick Porter <dick@ximian.com>
114 * io-portability.c (_wapi_io_scandir): Special-case patterns
115 ending in '.*' so that files with no extension are also matched.
119 * wapi_glob.c: Reinstate WAPI_GLOB_APPEND, and add
120 WAPI_GLOB_UNIQUE to avoid matching the same entry twice when
123 2007-07-26 Dick Porter <dick@ximian.com>
128 * critical-sections.c:
130 * critical-section-private.h:
133 * error.c: Clean up TLS and pthreads structures. Finishes off bug
136 * collection.c (collection_thread): Exit the collection thread if
137 the io-layer has been cleaned up.
139 * mono-mutex.h (mono_mutexattr_destroy): Add this define too
141 Mon Jul 23 10:40:35 CEST 2007 Paolo Molaro <lupus@ximian.com>
143 * timefuncs.c: make TickCount measure from boot time if it's
146 2007-07-19 Juraj Skripsky <js@hotfeet.ch>
148 * io.c (MoveFile): Fix a leak.
150 Fri Jul 13 12:46:15 CEST 2007 Paolo Molaro <lupus@ximian.com>
152 * handles-private.h, handles.c, thread-private.h, threads.c,
153 uglify.h, wait.c: temporarily revert the alertable wait changes
154 (r79386) until the deadlock issues are fixed.
156 2007-06-22 Dick Porter <dick@ximian.com>
158 * shared.c: The non-shared mutexes weren't being initialised properly
159 on macos. Fixes bug 81929.
161 2007-06-13 Randolph Chung <tausq@debian.org>
163 * atomic.h: Enable for all hppa targets.
164 * Makefile.am: rename hppa_atomic.s to hppa_atomic.S so the preprocessor
166 * hppa_atomic.s: Renamed to ...
167 * hppa_atomic.S: ... and updated to work on both HPUX and Linux.
169 2007-06-13 Dick Porter <dick@ximian.com>
171 * handles.c (timedwait_signal_wait_cond): Alertable waits on
172 private handles are now interrupted by signalling the same
173 condition that would end the wait if the handle became signalled,
174 rather than polling. (Shared handles still have to poll.)
176 * threads.c (_wapi_thread_queue_apc): Interrupt the thread if it's
179 * handles-private.h (_wapi_handle_current_thread_set_waiting_on):
180 Helper functions to inform the APC queuing functions when threads
181 are waiting for handles, and to interrupt the wait.
183 * wait.c (WaitForMultipleObjectsEx): Need to tell the handle
184 waiting functions if any of the handles in question are shared
186 2007-06-06 Miguel de Icaza <miguel@novell.com>
188 * processes.c (is_managed_binary): Fix for OSX.
190 2007-06-06 Wade Berrier <wberrier@novell.com>
192 * atomic.h (InterlockedExchangePointer): cast to pointer to to silence
193 compiler warnings (autobuild fails the build on this type of warning)
195 2007-05-21 Dick Porter <dick@ximian.com>
197 * io-portability.c (_wapi_g_dir_open): Don't propagate any errors
198 from the second call to g_dir_open, preserve the original error if
199 the second call still fails but clear the error if it succeeds.
201 2007-05-10 Dick Porter <dick@ximian.com>
203 * sockets.c (_wapi_recvfrom): Refine the fix to bug 75705 so EINTR
204 isn't returned if the remote end shuts down cleanly. Fixes zmd
205 and the second example in bug 75705.
207 2007-04-26 Dick Porter <dick@ximian.com>
209 * shared.c (_wapi_shm_semaphores_init): Need to check
210 MONO_DISABLE_SHM in this entry point, as it's called before
211 _wapi_shm_attach(). Fixes bug 81436.
213 2007-04-24 Dick Porter <dick@ximian.com>
215 * sockets.c (_wapi_recvfrom, socket_close): Force recvfrom() to
216 error if the socket is closed while the receive is blocking.
219 2007-04-13 Dick Porter <dick@ximian.com>
222 * shared.c: Complete the reimplementation of disabling of shared
223 memory, by not allocating sysv semaphores when shm disabling has
224 been requested (either at compile time or run time.)
226 * processes.c (CreateProcess): Don't synchronize locking across
227 processes when forking, when shared memory has been disabled.
229 2007-04-06 Andreas Faerber <andreas.faerber@web.de>
232 * wapi_glob.c: remove reference to sys/cdefs.h, use glib instead.
235 2007-04-05 Dick Porter <dick@ximian.com>
238 * io-portability.c (_wapi_io_scandir): Moved from io.c, and
239 changed to use a cut-down version of glob(3) that has been
240 extended to match with case-insensitivity if needed.
243 * wapi_glob.c: Cut down implementation of glob(3), based on
246 2007-03-22 Dick Porter <dick@ximian.com>
248 * sockets.c (_wapi_connect): Do additional checks when connect(2)
249 fails, because some systems don't let it be restarted. Patch
250 based on one submitted by Robert S Wojciechowski <robertw@ssgx.com>,
253 2007-03-09 Jonathan Chambers <joncham@gmail.com>
255 * io-layer.h: Remove UNICODE and _UNICODE defines as
256 these are done by configure.in now.
258 Code is contributed under MIT/X11 license.
260 Thu Mar 8 19:42:17 CET 2007 Paolo Molaro <lupus@ximian.com>
262 * shared.c: partial support for MONO_DISABLE_SHM env var.
264 2007-03-05 Wade Berrier <wberrier@novell.com>
266 * atomic.h: atomic fixes from Michael Matz for for s390
267 and s390x ( bnc #237611 and bxc #80892 )
269 2007-03-05 Miguel de Icaza <miguel@novell.com>
271 * io.c (CreateFile): Use FILE_ATTRIBUTE_TEMPORARY to mean 0600
272 permissions. For 80688
274 (MoveFile): Use errno_copy here, just to avoid a potential
275 errno-changing code in the future from g_free.
277 Also, ignore EXDEV errors as they are handled immediately after
278 (avoid printing out an error).
282 Mon Feb 12 15:50:24 CET 2007 Paolo Molaro <lupus@ximian.com>
284 * shared.c: exit if semaphores can't be created (bug #80616).
286 2007-02-01 Geoff Norton <gnorton@customerdna.com>
288 * collection.c: NetBSD doesn't define PTHREAD_STACK_MIN.
290 2007-01-26 Dick Porter <dick@ximian.com>
293 * sockets.c (_wapi_getsockopt): Windows seems to not reset
294 SO_ERROR values when they're read, contrary to the documentation.
295 Fixes the new issues raised in bug 79878 (example in C showing
296 winsock behaviour attached to that bug.)
298 2007-01-15 Mark Mason <mason@broadcom.com
300 * atomic.h: add locking primitives for MIPS.
302 2007-01-11 Dick Porter <dick@ximian.com>
304 * sockets.c (_wapi_connect): Don't do the SO_BROADCAST setting
305 here, do it in managed code instead.
306 (_wapi_getsockopt): SO_RCVTIMEO and SO_SNDTIMEO use struct
307 timeval, which has a microsecond field, not milliseconds.
308 (_wapi_setsockopt): ditto.
309 (_wapi_setsockopt): Halve the SO_SNDBUF and SO_RCVBUF values on
310 Linux, as the kernel doubles whatever we set.
311 (_wapi_socket): Save socket domain, type and protocol so it can be
313 (socket_disconnect): Implement socket disconnect (closing the
314 socket, but keeping the file descriptor.)
315 (wapi_disconnectex): A basic implementation of DisconnectEx().
316 (wapi_transmitfile): A very basic implementation of
318 (WSAIoctl): Implement the SIO_GET_EXTENSION_FUNCTION_POINTER
321 * socket-private.h (struct _WapiHandle_socket): Record socket
322 domain, type and protocol info so it can be duplicated later.
324 * sockets.h (WSAID_DISCONNECTEX,WSAID_TRANSMITFILE): Structures
325 and defines needed to look up the DisconnectEx() and
326 TransmitFile() functions by GUID.
328 * error.c (errno_to_WSA): Change ETIMEDOUT mapping to
329 WSAETIMEDOUT; add EDESTADDRREQ.
331 * io-layer.h: Need mswsock.h on windows now.
333 2007-01-04 Miguel de Icaza <miguel@novell.com>
335 * io-portability.c (find_file): Fix a coverity warning (scanning
338 2006-12-31 Miguel de Icaza <miguel@novell.com>
340 * io-portability.c (find_file): Do not abort if an empty filename
341 has been passed. This fixes the case where MONO_IOMAP=all would
342 assert if Directory.Exists ("") was called.
344 Mon Dec 18 14:54:37 CET 2006 Paolo Molaro <lupus@ximian.com>
346 * processes.c: moved a free on the error path.
348 Thu Dec 14 21:42:39 CET 2006 Paolo Molaro <lupus@ximian.com>
350 * processes.c: fixed a few memory leaks when executing
353 Mon Nov 27 13:12:17 GMT 2006 Paolo Molaro <lupus@ximian.com>
355 * atomic.h: fix arm compare and exchange (bug #78500).
357 2006-11-23 Dick Porter <dick@ximian.com>
359 * process-private.h (struct _WapiHandle_process): Add 'waited'
362 * processes.c (process_wait): Check the 'waited' parameter not the
363 signalled state when testing if a process has already been waited
364 for, as the child process itself may set signalled when exiting.
367 * wapi-private.h (_WAPI_HANDLE_VERSION): Bump shared data version
369 * shared.c: Now the shared data version has been incremented we
370 can set the counter semaphore initial value correctly
372 2006-11-22 Dick Porter <dick@ximian.com>
374 * processes.c (process_wait): Cope when the background process
375 reaper gets the process we were waiting for. Special case for
376 waiting for our own process to exit. Fixes bug 77736.
378 2006-11-17 Dick Porter <dick@ximian.com>
380 * processes.c: Fix const correctness and typos that caused memory
383 2006-11-17 Miguel de Icaza <miguel@novell.com>
385 * processes.c (ShellExecuteEx): Check error after CreateProcess,
386 thanks to Dick for pointing this out.
388 2006-11-16 Miguel de Icaza <miguel@novell.com>
390 * processes.c (ShellExecuteEx): If we fail to create a process in
391 ShellExecute, then try to use the xdg-open command, and if that
392 fails, try to use the gnome-open command,
394 Refactor the code so that we do not have to duplicate all this
395 code, but instead use a ucs2-aware version of the code to do
398 2006-11-13 Dick Porter <dick@ximian.com>
400 * io.c (_wapi_stat_to_file_attributes): If the file is a symlink
401 add the FILE_ATTRIBUTE_REPARSE_POINT flag. This is an attempt to
402 follow the specs for the windows symlink support, but will
403 probably have to be reworked when I have test data from a vista
404 machine. Fixes bug 79887.
406 2006-11-11 Miguel de Icaza <miguel@novell.com>
408 * handles.c (CloseHandle): Cope here with the new value
409 INVALID_HANDLE_VALUE set on handles.
411 * processes.c (CreateProcess): Initialize the value of hThread to
412 be INVALID_HANDLE_VALUE on failure, not to be NULL. Improvement
415 2006-11-09 Dick Porter <dick@ximian.com>
417 * sockets.c (_wapi_select): Do some sanity checking on the
418 fd_sets, to avoid file descriptors > FD_SETSIZE.
419 (_wapi_FD_CLR, _wapi_FD_ISSET, _wapi_FD_SET): Avoid file
420 descriptors > FD_SETSIZE.
422 2006-10-27 Dick Porter <dick@ximian.com>
424 * io.c (GetFileAttributes): Force symlinks to directories to be
425 returned as a regular file. Fixes bug 79733.
427 2006-10-18 Miguel de Icaza <miguel@novell.com>
429 * io-portability.c (find_in_dir): First string dup, then closedir.
431 2006-10-12 Dick Porter <dick@ximian.com>
433 * processes.c (_wapi_process_reap): Unref a process handle if we
434 reaped it, found by Zoltan. Fixes bug 79286.
435 (process_wait): Don't wait again if we've already waited for a
438 2006-10-11 Sergey Tikhonov <tsv@solvo.ru>
440 * atomic.h: Fix atomic decrement.
442 * mini/cpu-alpha.md: Use native long shift insts
444 * mono/mono/mini/tramp-alpha.c: Implemented
445 mono_arch_patch_delegate_trampoline method
447 * Started work on using global registers
449 * Use byte/word memory load/store insts if cpu supports it
454 2006-10-09 Zoltan Varga <vargaz@gmail.com>
456 * handles.c (timedwait_signal_poll_cond): Add an alertable parameter, and if it
457 is FALSE, avoid busy waiting.
459 * wait.c: Add an alertable parameter to the wait routines.
461 2006-10-06 Miguel de Icaza <miguel@novell.com>
463 * io-portability.c (find_file): Rename from
464 MONO_IO_PORTABILITY_HELP to MONO_IOMAP.
466 2006-10-03 Dick Porter <dick@ximian.com>
469 * io-portability.c: Optional portability helpers and wrapped
470 system calls to try to cope with windows filenames in
473 * io.c: Use the wrapped system calls
475 2006-09-01 Zoltan Varga <vargaz@gmail.com>
477 * critical-sections.h critical-sections.c: Make Enter/LeaveCriticalSection a macro
478 since they are perf critical.
480 * atomic.h: Applied patch from Jakub Boqusz <qboosh@pld-linux.org>.
481 Add atomic ops implementation for alpha.
483 2006-08-11 Dick Porter <dick@ximian.com>
485 * processes.c (_wapi_process_reap): Avoid a deadlock by setting
486 process termination details in an outer loop, not the
487 _wapi_search_handle() one.
489 2006-08-10 Dick Porter <dick@ximian.com>
491 * threads.c (_wapi_thread_queue_apc)
492 (_wapi_thread_dispatch_apc_queue): Use a process-local mutex here
493 instead of the cross process semaphore. We already check that
494 access to the APC queue is within the owning process so there's no
495 need to protect from other processes. Avoids a global deadlock
496 when a thread is aborted while it holds the handle semaphore
498 (_wapi_thread_apc_pending): Hide an annoying message which can
499 happen if a thread handle has been blown away at process shutdown
500 while it is in an alertable wait.
502 Both problems seen while shutting down monodevelop.
504 2006-07-25 Dick Porter <dick@ximian.com>
506 * shared.c (_wapi_shm_file): Remove '/' characters from the uname
507 results. Fixes bug 78917.
509 2006-07-20 Dick Porter <dick@ximian.com>
511 * threads.c (_wapi_thread_set_termination_details): Improve the
512 test for already-disposed thread handles, and hold the lock around
513 the mutex abandoning.
515 2006-07-17 Dick Porter <dick@ximian.com>
517 * processes.c (CreateProcess): Don't change directory unless a new
518 one has been specified. Fixes bug 78751.
520 2006-07-06 Dick Porter <dick@ximian.com>
522 * io.c (_wapi_stat_to_file_attributes): Do a better job at
523 figuring out the file attributes
524 (_wapi_set_last_path_error_from_errno): New helper function to
525 turn errno into w32 error codes that handles the differences
526 between file and directory errors
527 (file_setendoffile): Try turning off the extra write used to
528 extend files, because we probably don't need it on any modern
529 platform. If it is needed though, we also need to lseek the file
531 (CreateFile): Treat character-special devices as a console handle,
532 because they can't be seeked
533 (CopyFile): If fail_if_exists is set, then the destination needs
534 to be opened with O_EXCL
535 (CopyFile): If fail_if_exists is not set and the destination
536 already exists, then we should set the ERROR_ALREADY_EXISTS error
537 even though we return success
538 (stdhandle_create): STD_INPUT_HANDLES cannot be written to
539 (GetStdHandle): Rework without using mono_once, so console handles
540 can be properly closed and reopened.
541 (mono_io_scandir): Only override errno with EACCES when the
542 directory actually exists
543 (FindFirstFile): Set ERROR_FILE_NOT_FOUND when no files are
545 (FindClose): Cope with NULL handles
546 (CreateDirectory): When the target already exists, just return an
547 error. It's the caller's job to figure out what to do.
548 (SetCurrentDirectory): Cope with a NULL path
549 (RemoveDirectory, GetFileAttributes, GetFileAttributesEx,
550 SetFileAttributes, FindFirstFile, DeleteFile, MoveFile, CopyFile,
551 CreateFile): Set path error correctly
553 * handles.c (CloseHandle): Kludge to try and cope with passing a
556 * error.h: Add NO_ERROR as an alternative to ERROR_SUCCESS
558 * uglify.h: Added some more typedefs
560 2006-07-05 Dick Porter <dick@ximian.com>
562 * io.c (GetFileAttributes, GetFileAttributesEx): Cope with
563 dangling symlinks. Fixes bug 78664.
565 2006-06-23 Dick Porter <dick@ximian.com>
567 * handles.c (handle_cleanup):
568 * threads.c: Clean up threads properly when we're forcibly
569 removing the handle entries from the shared file in
570 handle_cleanup(). Fixes bug 78241, for real this time.
572 2006-06-15 Neale Ferguson <neale@sinenomine.net>
574 * atomic.h: More tinkering with InterlockedExchange/InterlockedCompareExchange
577 2006-06-14 Neale Ferguson <neale@sinenomine.net>
579 * atomic.h: Fix atomic exchange pointer operations for s390x - these
580 were broken as they used 32-bit instructions rather than their 64-bit
583 2006-06-14 Dick Porter <dick@ximian.com>
585 * processes.c: Don't run the atexit handlers when bailing out
588 2006-06-14 Dick Porter <dick@ximian.com>
590 * wait.c: Fix stupid typo shown up by gcc 4.1.1, = not ==
598 * collection.c: Fix a bunch of signed/unsigned warnings from gcc
601 2006-06-09 Neale Ferguson <neale@sinenomine.net>
603 * atomic.h: Fix atomic operations for s390x (not really broken
604 but changed to use full 64-bit opcodes).
606 2006-05-24 Dick Porter <dick@ximian.com>
608 * processes.c (process_set_current): Don't take an extra reference
609 if we have to create our own process handle. Fixes bug 78241
612 * threads.c (_wapi_thread_signal_self): Renamed from
613 _wapi_thread_abandon_mutexes, also sets the thread state to
614 signalled and drops a reference. Called by the runtime when the
615 main thread cleans itself up.
617 * handles.c (handle_cleanup): As a last resort, unref every shared
618 handle as the process is now exiting.
620 2006-05-16 Dick Porter <dick@ximian.com>
622 * processes.c (process_set_termination_details): Unref the handle
623 when we've stored the exit details. Fixes the rest of 78241.
625 2006-05-12 Dick Porter <dick@ximian.com>
627 * threads.c: Implement pseudo handles, making GetCurrentThread()
628 match MS behaviour. Notice when attached threads exit, and unref
629 the handle. Fix usage of GetCurrentThread() in other places.
631 * handles.c (DuplicateHandle): Implement a basic form of
634 * wait.c: Fix usage of GetCurrentThread() throughout, and cope
637 2006-04-26 Miguel de Icaza <miguel@novell.com>
639 * io.c (file_close): Oops, do not use DeleteFile which expects
640 unicode, instead use unlink directly
642 Add support for the new FileOptions bits on .NET 2.0.
644 It might be good if Dick reviews these changes.
646 * io.c (file_close): If DeleteOnClose is set, then delete the file
648 (CreateFile): Do not support encryption per user.
650 If posix_fadvise exists, pass hints on sequential scan and random
651 access. Did not figure out what WRITE_THROUGH maps to.
653 2006-04-26 Dick Porter <dick@ximian.com>
655 * sockets.c (WSAIoctl): Check the output buffer is valid before
658 * handles.c (_wapi_search_handle): Set shared pointer if we find a
659 shared handle that has been already opened.
661 2006-04-21 Dick Porter <dick@ximian.com>
663 * threads.c (GetCurrentThread): Reference the handle if we return
664 an already-known thread.
666 2006-04-07 Dick Porter <dick@ximian.com>
668 * processes.c: Fix build for older glib.
670 2006-04-06 Dick Porter <dick@ximian.com>
672 * processes.c (CreateProcess): Add a reference to the child
673 process' handle, so it won't be destroyed if this process closes
674 its copy of the handle. Fixes bug 77393.
676 * processes.c (process_set_current): Fall through to creating a
677 new one if the handle lookup fails.
679 * processes.c (_wapi_process_signal_self):
680 * handles.c (handle_cleanup): The process is exiting, so set the
681 handle state for this process to signalled. This should let other
682 non-related processes wait for this handle.
684 * handles.c (_wapi_search_handle): Don't search shared handles in
687 * collection.c (collection_thread): No need to do a collection
688 scan straight away, do the waiting first.
690 2006-04-06 Dick Porter <dick@ximian.com>
692 * shared.c: Fix parameters in semctl () call.
694 2006-03-28 Zoltan Varga <vargaz@gmail.com>
696 * atomic.h atomic.c: Applied patch from David S. Miller
697 <davem@davemloft.net>: Reimplement Interlocked* primitives on sparc
698 using CAS/CASx when __GNUC__, else we will fall back to the generic
701 2006-03-27 Dick Porter <dick@ximian.com>
703 * shared.c (_wapi_shm_file_open): Break out of a loop if the
704 shared file is smaller than expected. (We loop a few times in
705 case another process is in the middle of creating the file.)
707 2006-03-22 Dick Porter <dick@ximian.com>
712 * shared.c: Delete the semaphores and shared files when the last
713 process has finished with them
715 2006-03-15 Dick Porter <dick@ximian.com>
723 * threads.c: Explicitly initialise the handle ops struct
725 2006-03-14 Dick Porter <dick@ximian.com>
730 * handles.c: Add a 'prewait' stage to the handle waiting, to give
731 waiting threads a chance to check for bogus states before
734 * mutexes.c (namedmutex_prewait): Use the prewait stage to check
735 for named mutexes that have been abandoned in a locked state (eg
736 if a process exited abnormally while owning the mutex) and
737 override it if needed.
739 2006-03-08 Gonzalo Paniagua Javier <gonzalo@ximian.com>
741 * wait.c: speed up WaitFor* when the timeout is 0.
743 2006-03-03 Dick Porter <dick@ximian.com>
745 * processes.c (ShellExecuteEx): Cope when some of the parameters
748 2006-02-27 Dick Porter <dick@ximian.com>
752 * threads.c: Comparing pthread_t with == is not portable, so use
755 Thu Feb 23 18:47:20 GMT 2006 Paolo Molaro <lupus@ximian.com>
757 * *.h, *.h: patch from Dick to make Linuxthreads systems work again.
759 2006-02-22 Dick Porter <dick@ximian.com>
762 * threads.c: There's no need to use the timed-thread support code
763 any more, as we aren't using the timed join. This greatly
764 simplifies thread setup, and fixes a memory leak (bug 77521).
766 Don't bother to store thread IDs in a hash table, use TLS instead.
767 The one case that needs to look up the handle of a different
768 thread (OpenThread()) can do the extra work itself. Fixes bug
771 * handles.c (_wapi_search_handle): Add a reference when returning
772 a private handle (shared handles are already reffed.)
774 2006-02-17 Dick Porter <dick@ximian.com>
777 * handles.c: Check handle values passed to array lookups. Fixes
780 2006-02-09 Dick Porter <dick@ximian.com>
782 * threads.c: Cope with the problems caused by attaching already
783 existing threads - they don't get the infrastructure to clean up
784 after themselves, especially the ID to handle hash. This fixes
787 2006-02-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
789 * shared.c: use MONO_SHARED_HOSTNAME as a substitute for gethostname()
790 when creating the shared files in the .wapi directory. Fixes bug #77371.
792 2006-02-02 Martin Baulig <martin@ximian.com>
794 * threads.c: Removed the `WITH_INCLUDED_LIBGC' section; it has
795 never been used so far.
797 * timed-thread.h (TimedThread): Removed the `stack_ptr' field; it
798 has only been used by the removed code.
800 2006-01-03 Neale Ferguson <neale@sinenomine.net>
802 * atomic.h: Correct s390x definitions and eliminate compiler warnings.
804 2006-01-03 Sebastien Pouliot <sebastien@ximian.com>
806 * io.c: Patch _wapi_stat_to_file_attributes against bug #76966, where
807 sockets could be considered as directory.
809 2005-12-23 Dick Porter <dick@ximian.com>
813 * semaphores.c: Implement OpenSemaphore
816 * mutexes.h: Implement OpenMutex
822 * event-private.h: Implement named events. Implement OpenEvent.
824 2005-12-15 Dick Porter <dick@ximian.com>
826 * processes.c (CreateProcess): The pipe-based cross-process
827 exclusion technique was trying to write NULL buffers when appname
828 was NULL (eg when coming from ShellExecuteEx,) which usually
829 succeeded even though EFAULT was returned - but sometimes it
830 failed. This meant that the child process could block forever on
831 the pipe read. Replace it with the simpler shared handle
832 semaphore protection used everywhere else. This showed up with
833 the test case in bug 76684.
835 Tue Dec 13 11:41:49 GMT 2005 Paolo Molaro <lupus@ximian.com>
837 * shared.c: fallback to private mmap when shared mmap doesn't work
840 2005-12-06 Dick Porter <dick@ximian.com>
844 * semaphore-private.h:
845 * semaphores.c: Implement named semaphores
847 2005-11-24 Dick Porter <dick@ximian.com>
849 * processes.c (GetProcessId): Implement GetProcessId()
851 2005-11-17 Dick Porter <dick@ximian.com>
854 * processes.c: Implement ShellExecuteEx as a wrapper around
857 2005-11-11 Dick Porter <dick@ximian.com>
859 * threads.c: Give mutex abandoning its own exported function, so
860 it can be called when the runtime is cleaning up.
862 * handles.c (_wapi_search_handle_namespace): Do a handle
863 collection befre starting to check namespace strings, so that any
864 stale cruft gets removed.
866 2005-11-11 Dick Porter <dick@ximian.com>
868 * threads.c: Move thread handles back into the shared space.
870 * handles.c (_wapi_handle_unref): Add support for shared handles
871 with close() handlers
873 2005-11-04 Dick Porter <dick@ximian.com>
875 * sockets.c (ioctlsocket): Use select instead of if to avoid a
876 type promotion problem on 64bit freebsd. Based on patch by Lou
877 Kamenov <kamenovl@gmail.com>, fixes bug 76447.
879 2005-11-04 Dick Porter <dick@ximian.com>
881 * io.c (file_write): Only do the file locking if
882 MONO_STRICT_IO_EMULATION is set.
884 2005-10-21 Dick Porter <dick@ximian.com>
887 * handles.c (_wapi_lookup_handle): Cope when the shared part of a
888 handle has been deleted.
889 (_wapi_handle_unref): And when the deleted shared part is pointed
890 to as a handle is deleted
892 2005-10-20 Dick Porter <dick@ximian.com>
894 * processes.c (process_set_current): If the expected process
895 handle slot doesn't contain the correct pid, create a new handle.
897 * handles.c (_wapi_search_handle): When the search doesn't find
898 anything, return failure instead of the last handle we looked at.
899 (_wapi_handle_ref, _wapi_handle_unref): Don't try to ref or unref
900 unused handles (makes tracking refcounting bugs easier.)
902 2005-10-19 Dick Porter <dick@ximian.com>
909 * collection.c (_wapi_handle_collect): Remove the shared handle
910 indirection layer, and use locking instead. Delete other
911 complexity that is no longer needed. Refcount shared handles and
912 delete them when needed, but keep the timestamps so that orphaned
913 handles will be cleaned up eventually.
915 * shared.c (_wapi_shm_file): Add processor, OS and struct size
916 info to the shared file names, to cope with dual-boot and 32/64bit
917 size issues. Fixes bug 75839.
919 * wait.c (WaitForMultipleObjectsEx): No need to distinguish
920 between shared handles and private, as the wait functions cope
921 with both together now.
923 2005-10-11 Gonzalo Paniagua Javier <gonzalo@ximian.com>
925 * io.c: removed NO_SIGPIPE macro.
926 * sockets.c: no need for MSG_NOSIGNAL or ignoring SIGPIPE.
928 2005-10-11 Dick Porter <dick@ximian.com>
930 * sockets.c (_wapi_getsockopt): Translate SO_ERROR results into
933 * error.c (errno_to_WSA): Don't return a bogus error if someone
934 asks to translate errno 0.
936 2005-10-11 Dick Porter <dick@ximian.com>
938 * handles.c: Fix several race conditions
940 2005-10-11 Miguel de Icaza <miguel@novell.com>
942 * io.c: no need to block SIGPIPE anymore, as it is ignored.
944 2005-10-05 Dick Porter <dick@ximian.com>
946 * threads.c (_wapi_thread_own_mutex, _wapi_thread_disown_mutex):
947 Keep a reference to mutexes owned by threads, so they won't be
948 destroyed prematurely. Fixes dotmsnclient crash.
950 2005-09-26 Sebastien Pouliot <sebastien@ximian.com>
952 * io.c: Apply patch from #76192 (Can't write files past 2gb on AMD64
953 (x86_64)) for Brion on IRC (Dick approved it).
955 2005-09-23 Dick Porter <dick@ximian.com>
957 * processes.c: Don't wait for processes that have already been
958 signalled; also fix typo.
960 * handles.c: Improve locking inside new handle and handle
963 2005-09-20 Dick Porter <dick@ximian.com>
966 * processes.c: Periodically waitpid for known process IDs. Fixes
969 2005-09-15 Gonzalo Paniagua Javier <gonzalo@ximian.com>
972 (CreateFile): if the file is a named pipe, treat the handle as a pipe,
973 not as a file. Fixes bug #76075.
975 2005-08-27 Zoltan Varga <vargaz@gmail.com>
977 * atomic.h: Add support for intel icc.
979 2005-08-25 Zoltan Varga <vargaz@gmail.com>
981 * io-layer.h: Include winbase.h not WinBase.h.
983 2005-08-19 Dick Porter <dick@ximian.com>
985 * threads.c, threads.h, thread-private.h: Use a gsize to store the
986 thread ID, so it can hold a 64 bit value if needed.
988 2005-07-26 Gonzalo Paniagua Javier <gonzalo@ximian.com>
990 * error.c: map ENOENT to WSAECONNREFUSED. It might happen when
991 connecting to unix sockets. Closes bug #75632.
993 2005-07-05 Dick Porter <dick@ximian.com>
995 * io.c: Make sure SIGPIPE is ignored when calling write(2).
996 Prevents the runtime exiting when writing to a closed pipe,
999 2005-06-30 Dick Porter <dick@ximian.com>
1001 * shared.c (_wapi_shm_semaphores_init): Add some helpful error
1002 messages when semget () fails due to lack of resources.
1004 2005-06-21 Dick Porter <dick@ximian.com>
1009 * threads.c: Keep a list of owned mutexes in each thread handle,
1010 so that it is easier to abandon them when the thread exits.
1011 Removes a bottleneck when multiple threads are finishing in
1014 2005-06-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
1016 * io.c: (GetLogicalDrives) when a bogus line is read, don't leak memory.
1017 When the buffer has not enough space, close the file before returning.
1019 2005-06-09 Duncan Mak <duncan@novell.com>
1021 * *.h: Added G_BEGIN_DECLS and G_END_DECLS where appropriate to
1022 all public headers. Fixes #74919.
1024 2005-05-30 Zoltan Varga <vargaz@freemail.hu>
1026 * atomic.h: Add IA64 atomic ops.
1028 2005-05-26 Gonzalo Paniagua Javier <gonzalo@ximian.com>
1030 * processes.c: make ExitCode be valid even if the user didn't call
1031 WaitForExit() and is just polling on HasExited.
1033 2005-05-17 Dick Porter <dick@ximian.com>
1035 * io.c (file_getfilesize): Clear the error value, so that files
1036 with sizes with the low bits 0xFFFFFFFF can be distinguished from
1039 2005-05-11 Gonzalo Paniagua Javier <gonzalo@ximian.com>
1041 * shared.c: forgot to ignore a warning.
1043 2005-05-10 Gonzalo Paniagua Javier <gonzalo@ximian.com>
1045 * shared.c: don't display warnings after reboots.
1047 2005-05-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
1049 * sockets.c: on windows, getsockopt/setsockopt for send/receive timeout
1050 use an integer in milliseconds. We were using a struct timeval.
1052 2005-05-06 Dick Porter <dick@ximian.com>
1054 * handles-private.h:
1061 * collection.h: Use SysV semaphores for managing access to the
1062 shared memory - in return for the ludicrous api we get
1063 synchronisation primitives that can be cleaned up by the kernel
1064 even when a process quits unexpectedly. This removes the
1067 2005-05-05 Lluis Sanchez Gual <lluis@novell.com>
1069 * handles.c: Always use polling in the waits, since
1070 mono_cond_timedwait can't be interruped by the thread abort signal.
1072 2005-04-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
1074 * events.c: calling Set on AutoResetEvent several times has the same
1075 effect as calling it only once if no thread is waiting for it.
1077 2005-04-29 Dick Porter <dick@ximian.com>
1079 * processes.c (EnumProcesses): Use a GArray instead of a GPtrArray
1080 now it's storing pids not handles, also fixes memory leak caused
1081 by unclear glib documentation.
1083 * sockets.c (WSACleanup): Remove unused variable
1085 2005-04-29 Dick Porter <dick@ximian.com>
1087 * handles.c (_wapi_handle_check_share_by_pid): For systems that
1088 don't have file descriptor info in /proc check that the original
1089 opener of a file is still there, if a share violation would
1092 2005-04-28 Gonzalo Paniagua Javier <gonzalo@ximian.com>
1095 * handles-private.h: added _wapi_handle_forecch that loops through all
1096 the handles and call a callback function when a handle of the given
1099 * sockets.c: no need to keep open sockets in an array, as we have them
1100 in the handles structure.
1104 2005-04-28 Dick Porter <dick@ximian.com>
1106 * processes.c: Cope with handles that are only around for as long
1107 as the search is running. If we're searching for process handles,
1108 check to see if the process is still running and signal it if not.
1110 * handles.c (_wapi_search_handle): Search in the shared space as
1111 well. Fixed bug 74752.
1114 * handles.c (_wapi_handle_new_from_offset):
1115 _wapi_handle_new_for_existing_ns () was doing exactly the same as
1116 this, so deleted it.
1118 2005-04-26 Dick Porter <dick@ximian.com>
1120 * handles.c: Fix stupid thinko where if a new shared handle is
1121 created but a collection was needed to free some space, it
1122 returned an error anyway. Should fix the messages shown in bug
1125 2005-04-25 Dick Porter <dick@ximian.com>
1127 * handles.c (_wapi_handle_check_share): Only consider mono
1128 processes when looking to see if a file is still being held open,
1129 while checking share permissions.
1131 2005-04-25 Dick Porter <dick@ximian.com>
1135 * wapi-private.h (struct _WapiHandleOps):
1136 * handles.c (_wapi_handle_unref): When destroying handles, save
1137 the handle data and call the close function only after the array
1138 slot has been cleared. This prevents race conditions with file
1139 descriptors, fixing bug 74713.
1141 * mutexes.c: Delete the handle close functions, they didn't do
1144 * error.c (_wapi_get_win32_file_error): Add a mapping for EINTR so
1145 the "Unknown error" g_warning doesn't get displayed.
1147 2005-04-25 Dick Porter <dick@ximian.com>
1150 * threads.c: Make thread handles process-private for now to take
1151 some of the space pressure off the shared memory, while I work on
1154 2005-04-21 Dick Porter <dick@ximian.com>
1156 * handles.c (_wapi_handle_check_share): Make sure there is a "fd"
1157 dir in /proc before blowing away handle info. Fixes bug 74649.
1159 2005-04-21 Dick Porter <dick@ximian.com>
1161 * wait.c (WaitForMultipleObjectsEx): Implement special waits
1163 * handles.c (_wapi_handle_wait_signal_poll_share): Don't return a
1164 timeout, just wait briefly for the private signals and let the
1165 waiting thread test again. This prevents us missing shared
1168 2005-04-21 Dick Porter <dick@ximian.com>
1170 * collection.h (_WAPI_HANDLE_COLLECTION_EXPIRED_INTERVAL): Reduce
1171 the time before a slot is considered too old and deleted. This is
1172 a workaround while I come up with a proper fix.
1174 2005-04-21 Dick Porter <dick@ximian.com>
1179 * handles.c (_wapi_handle_new): Turn assertions into errors.
1181 * collection.c (_wapi_handle_collect): Use symbols not magic
1182 numbers for timeout values
1184 2005-04-19 Dick Porter <dick@ximian.com>
1188 * handles.c (_wapi_handle_count_signalled_handles)
1189 * handles-private.h (_wapi_handle_shared_lock_handle): Use new
1190 shared handle locks in critical sections.
1192 * handles.c (_wapi_handle_new_for_existing_ns): Reuse old handles
1193 if there is already one there.
1195 * handles.c (_wapi_handle_ref): It was possible for a process to
1196 exit before getting around to updating shared handle timestamps,
1199 Tue Apr 19 16:25:47 CEST 2005 Paolo Molaro <lupus@ximian.com>
1201 * threads.c: fix lookup of the thread id in the has table:
1202 always use the id value, not the pointer to the id.
1204 2005-04-18 Gonzalo Paniagua Javier <gonzalo@ximian.com>
1206 * handles.c: fix handle returned in _wapi_handle_search_handle. Dick
1209 2005-04-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
1211 * io-layer/sockets.c: FIONBIO with a TRUE argument means we want
1212 non-blocking IO, not the other way around.
1214 2005-04-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
1218 * handles-private.h: GetFileType wasn't checking if we have memory
1219 allocated for the handle before dereferencing it. Fixes a FileStream
1222 2005-04-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
1226 * handles-private.h: we were calling g_renew to expand the handle array,
1227 but that might move the memory and we might have pthread conditions or
1228 mutexes in the original memory area that are being used. Now instead of
1229 expanding an existing array, we just create new ones and keep a list of
1230 them. Access to _wapi_private_handles had to be modified accordingly.
1232 2005-04-15 Dick Porter <dick@ximian.com>
1234 * collection.c: FreeBSD needs more than PTHREAD_STACK_MIN
1236 2005-04-14 Raja R Harinath <rharinath@novell.com>
1238 * wapi-private.h: Remove reference to 'daemon-private.h'.
1240 Wed Apr 13 13:12:33 EDT 2005 Paolo Molaro <lupus@ximian.com>
1242 * atomic.h: applied patch from mass@akuma.org (David Waite)
1243 to fix InterlockedExchangeAdd.
1244 Fixed a few other functions, including InterlockedCompareExchange()
1245 which was miscompiled by gcc with optimizations enabled.
1247 2005-04-13 Dick Porter <dick@ximian.com>
1249 * io.c (share_check):
1250 * handles.c (_wapi_handle_check_share): Refine the file check so
1251 that sharing violations within the same process don't cause
1254 2005-04-13 Dick Porter <dick@ximian.com>
1256 * io.c (FindFirstFile): Fix bugs introduced with the merge (bug
1259 2005-04-12 Dick Porter <dick@ximian.com>
1261 The daemon-less io-layer. Extensive lowlevel changes in
1262 handles.c, requiring some corresponding changes in other files
1263 calling these functions. Private_foo structures have been
1266 File descriptor handling differences account for most of the
1267 changes in io.c and sockets.c.
1271 * mutexes.c: Named mutexes are now a distinct type.
1272 * atomic.h: Fix a PPC uninitialised variable warning.
1273 * wait.c: Check conditions before waiting on a condition variable.
1274 * processes.c: Handle process fork and wait without a daemon
1275 (though this has the limitation of only being able to wait for
1278 2005-04-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
1285 * sockets.h: removed dead code that deals with async IO.
1287 2005-03-30 Zoltan Varga <vargaz@freemail.hu>
1289 * atomic.c (InterlockedIncrement): Fix fallback implementation of
1290 InterlockedIncrement and InterlockedDecrement. Fixes #74228.
1292 2005-03-29 Sebastien Pouliot <sebastien@ximian.com>
1294 * io-layer.h: Add required header files for compiling with VS.NET.
1296 2005-03-17 Miguel de Icaza <miguel@novell.com>
1298 * io.c: don't fail on NFS when there are no more locks available.
1300 2005-03-09 Dick Porter <dick@ximian.com>
1302 * error.c (_wapi_get_win32_file_error): ENFILE and EMFILE should
1303 map to ERROR_TOO_MANY_OPEN_FILES, not ERROR_NO_MORE_FILES. Fixes
1306 2005-03-09 Dick Porter <dick@ximian.com>
1308 * daemon.c (process_process_fork): Initialise the handle data
1309 before using it in the error case. This is probably the error
1310 we're working around in the previous change. Spotted by Taru Jain
1311 <tjain@novell.com> and Hemanth Yamijala <YHemanth@novell.com>.
1313 2005-03-07 Dick Porter <dick@ximian.com>
1315 * daemon.c: It looks like g_shell_parse_argv() can return
1316 argv[0]=NULL somehow, yet still not give an error. Make sure we
1317 don't pass NULL to strrchr(), working around a segfault that
1318 showed up on ZLM testing.
1320 2005-03-01 Gonzalo Paniagua Javier <gonzalo@ximian.com>
1322 * sockets.c: translate EINPROGRESS to EWOULDBLOCK in connect. This is
1323 the expected error code showed by the test case in bug #73053.
1325 2005-02-18 Gonzalo Paniagua Javier <gonzalo@ximian.com>
1327 * io.c: another leftover.
1329 Fri Feb 18 17:37:29 CET 2005 Paolo Molaro <lupus@ximian.com>
1331 * io.c: fixed logic in checking errno in rev 40815.
1333 Fri Feb 18 16:00:29 CET 2005 Paolo Molaro <lupus@ximian.com>
1335 * threads.c: we don't depend on the GC checking tls
1337 * processes.c: remove unused ref to GC headers.
1339 Thu Feb 17 19:57:11 CET 2005 Paolo Molaro <lupus@ximian.com>
1341 * io.c: remove _wapi_thread_cur_apc_pending () checks
1342 when the siscall should return immediatly and handle
1343 the case when a syscall is interrupted without
1344 erroring out, but returning a 0 read/write if possible.
1345 Still the cases of read from file need to be handled.
1347 Tue Feb 8 18:28:11 CET 2005 Paolo Molaro <lupus@ximian.com>
1349 * threads.c: make people test with 1 MB stack per thread.
1351 2005-01-17 Dick Porter <dick@ximian.com>
1353 * timefuncs.h: Make WapiFileTime endian-aware, as it's often
1354 cast to and from 64bit ints. Fixes bug 71213.
1356 2005-01-11 Dick Porter <dick@ximian.com>
1358 * error.c (errno_to_WSA): Add EADDRNOTAVAIL error code
1361 Mon Jan 10 16:15:19 EST 2005 Neale Ferguson <nealeferguson@earthlink.net>
1363 * atomic.h: Fix functions on s390.
1365 Mon Jan 10 20:30:19 CET 2005 Paolo Molaro <lupus@ximian.com>
1367 * atomic.h: fix some functions on ppc (tests/interlocked.cs).
1369 2005-01-10 Dick Porter <dick@ximian.com>
1371 * misc.c (_wapi_calc_timeout): Guard against overflow when
1372 calculating timeouts. This makes waiting with a large
1373 (Int32.MaxValue) timeout not return immediately.
1375 2004-12-23 Ben Maurer <bmaurer@ximian.com>
1377 * io.c (io_ops): make this `const' so it is shareable (well, only
1378 really shareable if it is statically linked...)
1380 Mon Dec 20 11:58:33 CET 2004 Paolo Molaro <lupus@ximian.com>
1382 * threads.c, threads.h: add accessor to get the pthread_key_t for
1385 2004-12-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
1387 * io.c: check for the existence of 'dest' and set ERROR_ALREADY_EXISTS
1388 if it exists and is not the same as 'src'.
1390 2004-12-01 Neale Ferguson <Neale.Ferguson@SoftwareAG-usa.com>
1392 * atomic.h : Fix InterlockedCompareExchange for s390/s390x.
1394 2004-12-01 Gonzalo Paniagua Javier <gonzalo@ximian.com>
1396 * processes.c: unquote the cmd path, allow for ' or " when quoting and
1397 pass the quoted program name to the daemon, otherwise the call to
1398 g_shell_unquote in the daemon will break things up.
1400 2004-10-14 Dick Porter <dick@ximian.com>
1402 * sockets.c (_wapi_accept): Revert the previous change. We now
1403 set the accepted socket to have the same blocking status as the
1404 listening socket in managed code. This follows MS behaviour.
1406 2004-10-14 Dick Porter <dick@ximian.com>
1408 * sockets.c (_wapi_accept): On Darwin, make sure a newly
1409 accept()ed socket is blocking. Fixes bug 67355, patch by
1410 grompf@sublimeintervention.com.
1412 2004-10-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
1414 * system.c: check the number of online processors instead of the
1415 existing ones. Sanitize return value if it's an error.
1417 2004-10-03 Ben Maurer <bmaurer@ximian.com>
1419 * system.c: Add support for getting the # of cpus.
1421 2004-09-28 Dick Porter <dick@ximian.com>
1423 * io.c (pipe_close_private): Fix one small typo in the last change
1424 that totally hosed process creation with redirected pipes.
1426 2004-09-24 Dick Porter <dick@ximian.com>
1433 * handles-private.h: Cope when a file descriptor is reused while
1434 the handle that thought it owned it is still referenced, instead
1435 of asserting. Probably fixes bug 66479, though we've been unable
1438 2004-09-09 Dick Porter <dick@ximian.com>
1441 * io.c: Set error codes everywhere.
1443 2004-09-06 Dick Porter <dick@ximian.com>
1445 * handles.c (_wapi_handle_unref): Reset the private record's type
1446 (CloseHandle): Check for a fd mapping failure, and return FALSE.
1447 (_wapi_handle_process_fork): Fix long-standing bug in checking
1448 handle return values. Also do the required bookkeeping with the
1449 new process's handles.
1451 * daemon.c: When creating a new process's handles, check whether
1452 the shared space needs to be increased
1454 2004-09-05 Zoltan Varga <vargaz@freemail.hu>
1456 * shared.c (_wapi_shm_file): Fix leaking of filename.
1458 2004-08-19 Dick Porter <dick@ximian.com>
1460 * handles.c (_wapi_handle_count_signalled_handles): Fix thinko
1461 introduced with the fd offset stuff: unlock handles properly when
1462 backing off. Fixes the monologue hang at exit.
1464 2004-08-18 Dick Porter <dick@ximian.com>
1467 * io.c: Check that new fds fit in the table, return error if not
1469 * daemon.c (_wapi_daemon_main):
1470 * handles.c (shared_init): Have all processes agree on a size for
1473 2004-08-17 Dick Porter <dick@ximian.com>
1475 * daemon.c (process_new):
1476 * handles.c (_wapi_handle_new_internal): Cope when the space
1477 reserved for file descriptors is larger than the shared segment
1478 size. Fixes the crash reported when running mono under gdb on
1481 2004-08-16 Dick Porter <dick@ximian.com>
1485 * handles-private.h (_wapi_handle_fd_offset_to_handle): Improve
1486 error checking with passed-in file descriptors.
1488 2004-08-11 Dick Porter <dick@ximian.com>
1491 * io.c: Returned handle values are the file descriptor the handle
1495 * handles-private.h:
1496 * daemon.c: Reserve the range of handles that can have the same
1497 values as file descriptors. These won't be used, but the values
1498 will be used as file, console, pipe or socket handles. The fd to
1499 handle mapping is done internally and is invisible to users.
1502 * wapi-private.h (_WAPI_HANDLE_VERSION): Increment, because we now
1503 reserve a chunk of handle space.
1505 2004-08-04 Neale Ferguson <Neale.Ferguson@SoftwareAG-usa.com>
1507 * atomic.h: add support for 64-bit S/390
1509 2004-07-22 Dick Porter <dick@ximian.com>
1512 * threads.c: Move the destruction of the internal thread data to
1513 after the thread has been joined. Fixes bug 61418.
1515 2004-07-14 Dick Porter <dick@ximian.com>
1517 * wait.c (test_and_own): When not waiting for all handles to
1518 become signalled, only own and return the lowest. All the
1519 documentation suggests that the old way was correct, but
1520 experimentation shows it actually works like this. Patch by
1521 Sébastien Robitaille
1522 (sebastien.robitaille@croesus.com), fixes bug 61511.
1524 2004-07-09 Ben Maurer <bmaurer@ximian.com>
1526 * threads.c: register roots for gc
1528 2004-07-08 Dick Porter <dick@ximian.com>
1530 * io.c (file_seek): If there is a high 32bit offset part, make
1531 sure the low part isn't sign-extended. Set error codes when
1532 returning failure. Fixes bug 61131.
1534 2004-07-06 Dick Porter <dick@ximian.com>
1536 * io.c (file_setfiletime): Check for underflow when converting to
1537 time_t values. Set error codes when returning failure. Fixes bug
1540 2004-07-05 Dick Porter <dick@ximian.com>
1542 * mutexes.c (mutex_ops_init): Make the named mutex mutex sharable.
1544 * daemon.c (unref_handle): Only destroy a handle if all processes
1545 have released it, not just the current one. Fixes bug 60887.
1547 2004-06-30 Zoltan Varga <vargaz@freemail.hu>
1549 * mono-mutex.h atomic.h: Add G_GNUC_UNUSED to static inline functions
1550 to prevent warnings.
1552 2004-06-24 Dick Porter <dick@ximian.com>
1554 * mutexes.c: Indicate when a named mutex was reused
1556 2004-06-24 Dick Porter <dick@ximian.com>
1558 * threads.c (SuspendThread):
1559 * timed-thread.c (_wapi_timed_thread_suspend): Wrap sem_wait in a
1560 while loop. See bug 58161.
1562 Wed Jun 23 23:29:04 CEST 2004 Paolo Molaro <lupus@ximian.com>
1564 * io.c: don't use sharemode for on-disk file permissions: it's used
1565 for shared access to the open file.
1567 2004-06-22 Dick Porter <dick@ximian.com>
1569 * events.c (CreateEvent): When creating an auto-reset event that
1570 is initially owned, make sure the set count starts at 1.
1572 2004-06-18 Dick Porter <dick@ximian.com>
1575 * events.c: Auto-reset events need to release one thread for each
1576 time SetEvent() is called. Fixes bug 41292.
1580 * mutexes.c: Scan for mutexes that are still locked by a thread
1581 when it exits. Fixes the MS demo app linked by bug 41292.
1583 * wait.c (test_and_own): Make sure a handle is signalled before it
1586 2004-06-16 Dick Porter <dick@ximian.com>
1588 * timed-thread.c: Call the thread cleanup exit routine before taking
1589 the join mutex, because this could deadlock if another thread tries
1590 to join in the meantime. This fixes the hang-at-exit problem seen
1593 2004-06-03 Lluis Sanchez Gual <lluis@ximian.com>
1595 * threads.c: Implemented SleepEx.
1596 * threads.h: Fixed SleepEx signature.
1598 2004-06-03 Miguel de Icaza <miguel@ximian.com>
1600 * threads.c: When running under valgrind, do not allocate too much
1601 stack, as Valgrind default is 1 meg.
1603 2004-05-27 Dick Porter <dick@ximian.com>
1606 * io.c: Implemented LockFile() and UnlockFile()
1608 2004-05-21 Dick Porter <dick@ximian.com>
1610 * io.c (CreateFile): Check for existing share modes when opening
1614 * handles-private.h:
1615 * daemon-messages.h:
1616 * daemon.c: Maintain a hash of file share modes, keying on device
1617 and inode (to cope with symlinks.)
1619 2004-05-20 Lluis Sanchez Gual <lluis@ximian.com>
1621 * daemon-messages.c: Retry if the communication with the daemon is
1622 interrupted by a signal.
1623 * io.c, sockets.c: Check for EINTR in every syscall that can be interrumped.
1624 Only return an error in this case if there is something in the apc queue
1625 (which means that it is an interruption requested by the "user").
1626 * processes.c: Use WaitForSingleObjectEx. No need to pass "alertable" as
1627 true since the wait is small.
1628 * shared.c: Retry write calls when interrumped by a signal.
1629 * timed-thread.h, timed-thread.c: added _wapi_thread_apc_pending, which
1630 returns TRUE if there are pending asynchronous calls (APC) for the
1631 provided thread. Also added _wapi_thread_dispatch_apc_queue which calls
1632 the enqueued APCs. Defined a new struct ApcInfo that holds information
1633 about an enqueued APC.
1634 * thread-private.h, threads.c: Implemented QueueUserAPC (which does the same
1635 as in win32),_wapi_thread_apc_pending and _wapi_thread_dispatch_apc_queue.
1636 These last two methods call the corresponding apc methods in
1637 thread-private using the provided thread handle.
1638 * threads.h: Added QueueUserAPC.
1639 * uglify.h: Added WapiApcProc (needed by QueueUserAPC).
1640 * wait.c, wait.h: Changed WaitForSingleObject to WaitForSingleObjectEx, and
1641 WaitForMultipleObjects to WaitForMultipleObjectsEx. Implemented support
1642 for APCs in those two methods and also in SleepEx.
1644 2004-05-17 Dick Porter <dick@ximian.com>
1646 * io.c (CopyFile): Speed up. Fixes bug 57859.
1648 2004-05-13 Dick Porter <dick@ximian.com>
1649 * mono-mutex.c (mono_mutex_unlock): Return EPERM when the current
1650 thread doesn't own the mutex, rather than assert()ing.
1652 2004-05-11 Dick Porter <dick@ximian.com>
1654 * shared.c (_wapi_shm_attach): Cope when a previous daemon startup
1655 attempt failed, leaving shared files that look like a daemon is
1658 2004-05-10 Gonzalo Paniagua Javier <gonzalo@ximian.com>
1661 (SetFileAttributes): don't the the exec bit if the corresponding read
1664 2004-05-10 Zoltan Varga <vargaz@freemail.hu>
1666 * io.c (FindFirstFile): Fix invalid free.
1668 2004-05-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
1670 * io.c: translate from GFileError to errno codes and don't free
1671 variables right after calling mono_io_scandir, as we may overwrite
1674 2004-05-08 Gonzalo Paniagua Javier <gonzalo@ximian.com>
1676 * io.c: g_dir_open return ENOENT for directories on which we don't have
1677 read/execute permission, while returning EPERM for anything below those.
1678 So, change ENOENT by EPERM if the directory exists.
1680 2004-05-07 Dick Porter <dick@ximian.com>
1682 * io.c (SetFileAttributes): Don't have failed chmod()s cause a
1683 "file not found" error. Fixes bug 54032.
1685 2004-05-07 Dick Porter <dick@ximian.com>
1687 * io.c (FindFirstFile): Comment out a windows-compatibility check
1688 that breaks when directories have metachars in their names.
1689 Workaround for bug 58116.
1691 2004-05-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
1693 * io.c: fixed for FindFirstFile for empty directories. Closes
1696 2004-05-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
1698 * processes.c: set the start time for the current process. Fixes bug
1701 2004-05-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
1703 * io-private.h: 'namelist' is now a gchar ** in _WapiHandlePrivate_find.
1704 * io.c: implemented scandir using glib functions.
1706 2004-05-04 Dick Porter <dick@ximian.com>
1708 * daemon.c (read_message): Return FALSE on error so the GSource
1709 callback itself can return FALSE. Cures the infinite loop poll()
1711 * shared.c: Fix some daemon startup race conditions.
1713 2004-04-29 Miguel de Icaza <miguel@ximian.com>
1715 * io.c (CopyFile): Use 32k buffers to copy the file instead of 2k,
1716 use the stack, do not use dynamic memory.
1718 2004-04-29 Zoltan Varga <vargaz@freemail.hu>
1720 * io.c: Add scandir implementation for platforms which do not have
1723 2004-04-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
1725 * io.[ch]: implemented GetLogicalDriveStrings.
1727 2004-04-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
1730 * sockets.c: use the field name from configure when accessing sigval
1731 pointer field. Makes this work on the Mac.
1733 2004-04-28 Bernie Solomon <bernard@ugsolutions.com>
1735 * atomic.c: (InterlockedExchange) fix typo for
1738 2004-04-28 Gonzalo Paniagua Javier <gonzalo@ximian.com>
1741 * sockets.c: added check for sys/aio.h.
1743 2004-04-28 Gonzalo Paniagua Javier <gonzalo@ximian.com>
1745 * error.[ch]: added _wapi_get_win32_file_error...
1746 * io.c: ... which was _wapi_get_win32_error here.
1747 * sockets.c: rename the function calls here too.
1749 2004-04-28 Dick Porter <dick@ximian.com>
1751 * daemon-messages.c: Avoid a deadlock when a thread is killed while
1752 waiting for the daemon by using a recursive mutex. Helps bug 56699.
1754 2004-04-28 Gonzalo Paniagua Javier <gonzalo@ximian.com>
1756 * io.c: fixed leak in async_notifier().
1758 * sockets.[ch]: added AIO support for sockets and fixed WSAIoctl
1761 * threads.c: removed old comment.
1763 2004-04-26 David Waite <mass@akuma.org>
1765 * daemon-messages.h:
1772 * wapi-private.h: remove comma from end of enumeration declarations
1773 * status.h: cast unsigned int types to int for enum assignment
1775 2004-04-26 David Waite <mass@akuma.org>
1778 * timefuncs.c: declare 64-bit constants as long long types (i.e.
1781 2004-04-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
1783 * socket-wrappers.h: _wapi_socket == WSASocket now. Added
1784 WSA_FLAG_OVERLAPPED.
1786 * sockets.c: new unused parameters for _wapi_socket.
1788 2004-04-22 Miguel de Icaza <miguel@ximian.com>
1790 * timed-thread.c: Replace sem_init with MONO_SEM_INIT to handle
1791 the fact that MacOS X is a piece of junk (sem_init is *defined* in
1792 the libc, but they return `not implemented').
1794 2004-04-22 Dick Porter <dick@ximian.com>
1797 * handles-private.h: Reference the handle when it is locked, so
1798 that another thread can't blow it away while we're waiting for it
1799 to become signalled.
1810 * handles-private.h:
1813 * daemon-messages.c:
1814 * critical-sections.c:
1815 * atomic.c: Added pthreads cleanup handlers and error asserts
1818 * handles.c: Fixed the gcc "variable might be used uninitialised"
1819 warnings. They can't happen, but gcc doesn't know that
1820 g_assert()s don't return.
1822 Fixed the declaration of _wapi_handle_process_kill() so that it
1823 expects the correct type for the pid.
1825 * threads.c: Removed the TLS_PTHREAD_MUTEX style locking that
1826 hasn't been used in ages and just made the code more complex.
1828 2004-04-17 Zoltan Varga <vargaz@freemail.hu>
1830 * processes.c: Include <signal.h> for SIGKILL and SIGILL + fix some
1831 warnings. Fixes #57168.
1833 2004-04-16 Dick Porter <dick@ximian.com>
1835 * threads.c (Sleep): Using div(3) with a negative (when signed)
1836 numerator causes the quotient to be 0 and the remainder to be the
1837 numerator. This feeds a small negative value to nanosleep(3),
1838 which will return immediately and cause a busy wait. Fixes bug
1841 2004-04-15 Dick Porter <dick@ximian.com>
1844 * io.c: Rewrite FindFirstFile and FindNextFile using scandir(3)
1845 and fnmatch(3) instead of glob(3). glob() can't cope with being
1846 given filenames containing metachars. This fixes bug 40557.
1848 2004-04-14 Bernie Solomon <bernard@ugsolutions.com>
1850 * security.c: #warning is a GCC-ism
1852 2004-04-13 Sebastien Pouliot <sebastien@ximian.com>
1854 * security.c: Removed GetUserName as glib g_get_user_name does a
1855 better (portability) job. Added ImpersonateLoggedOnUser and
1858 2004-04-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
1860 * mono-mutex.h: move pthread_mutex_timedlock declaration to...
1861 * mono-mutex.c: ...here. It was causing a warning that prevented
1862 libgdiplus compilation.
1864 2004-04-04 Miguel de Icaza <miguel@ximian.com>
1866 * security.c (GetUserName): Make it work on MacOS X
1868 2004-04-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
1870 * security.c: use getpwuid_r if available. This one is thread-safe.
1872 2004-04-02 Sebastien Pouliot <sebastien@ximian.com>
1874 * Makefile.am: Added security.c|h.
1875 * security.c: New file for security related functions. Added function
1876 GetUserName to fix #56144.
1877 * security.h: New. Header file for security.c
1878 * wapi.h: Added include for security.h
1880 2004-03-25 Gonzalo Paniagua Javier <gonzalo@ximian.com>
1882 * daemon-messages.h: added kill structs.
1884 * daemon.c: implemented process_process_kill.
1885 * handles-private.h: define process_process_kill.
1886 * handles.c: implemented _wapi_handle_process_kill.
1887 * processes.[ch]: implemented TerminateProcess.
1889 2004-03-25 Bernie Solomon <bernard@ugsolutions.com>
1891 * daemon.c (rem_fd): On solaris you seem to get an
1892 error even after removing the input source so don't
1893 try and rem_fd it twice.
1895 2004-03-25 Lluis Sanchez Gual <lluis@ximian.com>
1897 * daemon.c: in process_post_mortem, If the child terminated due to the
1898 receipt of a signal, the exit status must be based on WTERMSIG, since
1899 WEXITSTATUS returns 0 in this case.
1901 2004-03-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
1903 * daemon.c: turned a warning into a DEBUG statement. Now we may hit it.
1905 2004-03-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
1907 * daemon.c: only call getdtablesize () once.
1908 * processes.c: wait 500 ms to check if execve failed and throw the same
1909 exception as MS on failure. Fixes bug #32809.
1911 2004-03-17 Bernie Solomon <bernard@ugsolutions.com>
1913 * io.c (async_notifier): use "union sigval" rather
1914 than sigval_t as Solaris doesn't have sigval_t
1915 (which isn't in IEEE 1003.1 either).
1917 2004-03-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
1919 * io.c: added debug stuff and removed a few redundant lines in
1922 2004-03-15 Gonzalo Paniagua Javier <gonzalo@ximian.com>
1924 * io-private.h: added new fields for file structure. Declare
1925 _wapi_io_add_callback.
1927 * io.c: added _wapi_get_win32_error, support aio_read/write in
1928 file_read/write. Implemented _wapi_io_add_callback, which is where
1931 * io.h: added new fields for WapiOverlapped and typedef for the
1934 * processes.c: fixed off-by-one bug when handling environment variables
1937 * threads.[ch]: implemented BindIoCompletionCallback.
1939 * uglify.h: added typedef for LPOVERLAPPED_COMPLETION_ROUTINE.
1941 2004-03-14 Zoltan Varga <vargaz@freemail.hu>
1943 * socket-wrappers.h: Remove extra semicolon.
1945 2004-03-03 Dave Camp <dave@ximian.com>
1947 * daemon.c: (add_fd), (fd_activity), (_wapi_daemon_main):
1948 Use a new main context.
1950 2004-03-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
1953 (GetFileAttributes): set the error depending on errno instead of
1954 setting ERROR_FILE_NOT_FOUND always. See bug #55160.
1956 2004-03-01 Gonzalo Paniagua Javier <gonzalo@ximian.com>
1959 (CopyFile): free the buffer on error.
1961 (WSAIoctl): free the buffer on error.
1963 2004-02-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
1965 * error.c: fixed mapping for EPROTONOSUPPORT and ESOCKTNOSUPPORT.
1967 * sockets.[ch]: retry creating the socket for AF_INET, SOCK_RAW
1968 using IP protocol with IP over IP. Implemented WSAIoctl UNIX-style.
1970 2004-01-27 Bernie Solomon <bernard@ugsolutions.com>
1972 * shared.c (_wapi_shm_file): add hostname
1973 to shared data file names to handle NFS mounted
1976 Mon Jan 26 16:15:03 CET 2004 Paolo Molaro <lupus@ximian.com>
1978 * sockets.h: remove obsolete soklen_t typedef.
1980 Fri Jan 23 21:07:02 CET 2004 Paolo Molaro <lupus@ximian.com>
1982 * socket-wrappers.h, sockets.h, sockets.c, Makefile.am: move socket
1983 wrappers to its own non-installed header file.
1985 2004-01-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
1988 (FindFirstFile): unlock the handle if FindNextFile fails.
1989 (FindNextFile): g_free a couple of pointers before retrying.
1992 (WaitForMultipleObjects): if only one handle provided, use
1993 WaitForSingleObject.
1995 2003-12-22 Bernie Solomon <bernard@ugsolutions.com>
1997 * handles-private.h: (_wapi_handle_type) check
1998 for segment in range before using it
2000 2003-12-22 Bernie Solomon <bernard@ugsolutions.com>
2002 * thread-private.h: _wapi_thread_ops is now const
2005 Mon Dec 22 18:29:03 CET 2003 Paolo Molaro <lupus@ximian.com>
2007 * threads.c, timed-thread.c, timed-thread.h: use mach
2008 semaphores on Darwin (MacOSX) since the posix ones
2009 are mostly broken there (threads are not created suspended
2010 and they can start executing before they are fully initialized
2011 like in tests/thread-static.cs).
2013 Mon Dec 22 17:18:45 CET 2003 Paolo Molaro <lupus@ximian.com>
2015 * atomic.h: ppc fixes.
2017 2003-12-19 Bernie Solomon <bernard@ugsolutions.com>
2019 * handles.c: remove my bad use of MONO_ZERO_ARRAY_LENGTH
2022 2003-12-15 Bernie Solomon <bernard@ugsolutions.com>
2024 * shared.c: (_wapi_shm_open) make scratch file
2025 not have to immediately regrow to avoid remaps
2026 (HPUX can't cope with these).
2027 (_wapi_shm_attach) use actual size of file
2028 to set scratch data_len for the creating process.
2030 * handles.c: (_wapi_handle_new_internal) make
2031 sure mutex & cond var are initialized even for
2032 non process shared ones.
2033 (_wapi_handle_unref) always call destroy
2034 routines on mutex & cond var
2036 2003-12-15 Bernie Solomon <bernard@ugsolutions.com>
2038 * daemon.c: change channel data structure so
2039 input sources are removed from glib event loop
2040 properly. xsp works better on Solaris and
2043 2003-12-12 Bernie Solomon <bernard@ugsolutions.com>
2045 * wapi-private.h: Replace G_GNUC_PRETTY_FUNCTION
2046 definition with file & line number for non-GCC
2049 2003-12-08 Bernie Solomon <bernard@ugsolutions.com>
2051 * Makefile.am: make sure hppa_atomic.s is in distribution
2053 2003-12-01 Dick Porter <dick@ximian.com>
2056 * mutexes.c (CreateMutex):
2057 * mutex-private.h (struct _WapiHandle_mutex):
2058 * handles.c: Look up certain handle types by name, in a shared
2059 namespace. Currently only mutex handles have this implemented.
2062 * semaphores.c (CreateSemaphore):
2063 * events.c (CreateEvent): Fix signature
2065 2003-11-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
2067 * io.c: don't call g_free before testing errno as it may modify it.
2068 If the path exists, return an error if it's not a directory. Fixes
2071 2003-11-20 Dick Porter <dick@ximian.com>
2073 * io.c: Missed a little-endian UTF16 conversion. Patch from
2074 Jeroen Zwartepoorte (Jeroen@xs4all.nl), fixes bug 51065.
2076 2003-10-29 Dick Porter <dick@ximian.com>
2078 * io.c (MoveFile): If the move crosses filesystems, try and fall
2079 back to copy and delete. Patch from Jörg Rosenkranz
2080 (JoergR@voelcker.com), fixes bug 50298.
2082 2003-10-28 Dick Porter <dick@ximian.com>
2084 * io.c: Use the new encoding conversion to cope with non-utf8
2085 locales in filenames.
2087 * processes.c: Ditto for process arguments.
2089 Tue Oct 21 12:01:14 CEST 2003 Paolo Molaro <lupus@ximian.com>
2091 * atomic.h: some ppc inline asm fixes (incorrect use of labels,
2092 incorrect register constraints, incorrect clobber lists).
2094 2003-10-13 Bernie Solomon <bernard@ugsolutions.com>
2096 * Makefile.am hppa_atomic.s: add HP 64bit
2097 implementation of atomic ops
2099 2003-10-13 Zoltan Varga <vargaz@freemail.hu>
2101 * threads.c (CreateThread): Wrap pthread_attr_setstacksize call in
2102 a conditional for platforms that don't have it.
2104 2003-10-09 Bernie Solomon <bernard@ugsolutions.com>
2106 * threads.c: (CreateThread) use stacksize argument
2107 if non-zero - change default for 64 bits to 4Mb
2109 2003-09-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
2111 * sockets.c: set last error when socket creation fails. This shed some
2112 light on bug #49015.
2114 2003-09-28 Gonzalo Paniagua Javier <gonzalo@ximian.com>
2116 * processes.c: fixed bug #48973: we only change \ by / for the argument
2117 to be used as command.
2118 When getting the program name from the args, don't let the space between
2121 2003-09-24 Bernie Solomon <bernard@ugsolutions.com>
2123 * atomic.h atomic.c: fix sparc so lock is
2124 global, increment does so and it compiles under Sun compiler.
2126 2003-09-22 Bernie Solomon <bernard@ugsolutions.com>
2128 * handles.c: include <string.h> directly as may
2129 not be nested in <sys/un.h> like Linux
2131 2003-09-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
2134 (DeleteFile): call SetLastError on failure. Fix by
2135 richard.torkar@htu.se (Richard Torkar). Closes bug #48222.
2137 2003-09-15 Lluis Sanchez Gual <lluis@ximian.com>
2139 * daemon.c: In compare_process(), discard handles already signalled.
2141 2003-09-02 Dick Porter <dick@ximian.com>
2143 * io.c: Work around glib brain-dead assumptions about utf8-encoded
2144 filenames. Fixes bug 30781.
2146 2003-08-28 Dick Porter <dick@ximian.com>
2148 * critical-sections.c: Patch from Bernie Solomon
2149 <bernard@ugsolutions.com> to emit a warning if locking a critical
2152 2003-07-23 Dick Porter <dick@ximian.com>
2155 * daemon.c (maybe_exit): Avoid the race condition when the daemon is
2156 closing but another client comes along when the shared data is still
2157 visible. Should fix bugs 33671 and 35213.
2159 2003-07-23 Dick Porter <dick@ximian.com>
2161 * handles.c: Initialise handle mutex and cond. Fix by
2162 Bernie Solomon <bernard@ugsolutions.com>
2164 2003-07-15 Dick Porter <dick@ximian.com>
2166 * timed-thread.c (timed_thread_start_routine): Fix virtual memory
2167 leak when threads quit. Fixes bug 44067.
2169 Wed Jun 18 19:08:40 CEST 2003 Paolo Molaro <lupus@ximian.com>
2171 * io.c: never add write permission for group or others in
2172 SetFileAttributes ().
2174 2003-06-17 Dick Porter <dick@ximian.com>
2176 * io.c (SetFileAttributes): Implement the ReadOnly attribute, and
2177 ignore the unsupported ones ("fixes" bug 44977).
2179 2003-06-17 Lluis Sanchez Gual <lluis@ximian.com>
2181 * misc.c: fix bug in _wapi_calc_timeout. It gave wrong values for
2182 high ms values (there was an overflow).
2184 2003-06-17 Zoltan Varga <vargaz@freemail.hu>
2186 * system.h (struct _WapiSystemInfo ): Fix warnings when using gcc-3.3.
2188 2003-06-11 Dick Porter <dick@ximian.com>
2190 * shared.c: Fix shared directory creation. Patch from
2191 Pablo Baena <pbaena@uol.com.ar>
2193 2003-06-10 Dick Porter <dick@ximian.com>
2195 * atomic.c: Delete the useless compile warning
2197 2003-06-09 Dick Porter <dick@ximian.com>
2199 * daemon.c: Lookup env as a string array. Fixes bug 44289. Also
2200 make setting the process handle value in the environment actually
2203 * processes.c: Pretty up the process name, if it happens to be
2204 "mono" such as when another mono process forks "mono foo.exe"
2206 2003-06-05 Dick Porter <dick@ximian.com>
2208 * processes.c (process_set_current): Don't do an expensive handle
2209 search at application startup, check the environment to see if the
2210 process handle has already been created.
2212 * io.c: Don't do an expensive handle search when creating stdin,
2213 stdout and stderr handles, just create them all the first time one
2220 * handles-private.h:
2221 * daemon-messages.h:
2223 * daemon.c: Support for "unlimited" number of handles and scratch
2226 Speed up application startup by passing process handle in the
2227 environment, rather than let the app scan all handles (which gets
2228 really slow when there are more than a few thousand to check.)
2230 Initialise some structs passed to syscalls, noticed by valgrind.
2233 2003-05-20 Dick Porter <dick@ximian.com>
2235 * io.c (FindFirstFile): Include . files in the glob. Fixes bug
2238 2003-05-19 Dick Porter <dick@ximian.com>
2240 * threads.c: Set the new thread's stack size to 2M. Fix needed
2241 for BSD, reported by Martin Dvorak <md@9ll.cz>
2243 2003-05-16 Dick Porter <dick@ximian.com>
2246 * io.c: Implement GetTempPath()
2248 2003-05-16 Dick Porter <dick@ximian.com>
2250 * processes.c (CreateProcess): Set some error codes
2252 2003-05-12 Dick Porter <dick@ximian.com>
2254 * misc.c (_wapi_calc_timeout): Cope with overflowing tv_nsec.
2255 Patch from Martin Dvorak <mdvorak@ninell.cz>.
2257 2003-05-10 Dick Porter <dick@ximian.com>
2259 * io.c (CopyFile): Copy file mode as well as file data. Based on
2260 suggestion by Giuseppe Greco <giuseppe.greco@agamura.com>, bug
2263 2003-05-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
2265 * handles.c: don't call GC_gcollect when creating new handles.
2267 2003-05-05 Gonzalo Paniagua Javier <gonzalo@ximian.com>
2269 * handles.c: added some debugging code. Call GC_gcollect
2270 before creating a new handle. It makes Lupus' test run smoother and
2271 faster (from 62 to 83 request per second). Notice that calling
2272 GC_finalizer_notifier if needed (GC_should_invoke_finalizer ()) does
2273 not improve nor degrade the performance, so i don't do it.
2275 2003-05-02 Dick Porter <dick@ximian.com>
2277 * sockets.c: Rearrange closesocket() and socket_close_private(),
2278 and remember to unref the handle, so we don't leak socket handles.
2279 Fix from Pelle Johnsen <pelle.johnsen@mail.dk>
2281 2003-04-11 Dick Porter <dick@ximian.com>
2283 * atomic.h: ARM atomic operations by Malte Hildingson
2284 <tds00mahi@tellus.thn.htu.se>
2286 Tue Apr 8 11:37:29 CEST 2003 Paolo Molaro <lupus@ximian.com>
2288 * atomic.h: fix macosx build by "Urs C. Muff" <umuff@quark.com>.
2290 2003-04-03 Martin Baulig <martin@ximian.com>
2292 The following change is conditional to `WITH_INCLUDED_LIBGC'
2293 which is not yet enabled by default.
2295 * threads.c (SuspendThread, ResumeThread): Fully implemented this.
2296 (gc_init): New static function; install a signal handler for
2297 SIGPWR which is used to suspend threads. [FIXME: it SIGPWR
2298 doesn't exist on all Unix systems, we need to find another
2300 (mono_wapi_push_thread_stack): New public function. Tells the
2301 garbage collector about the current stack pointer of a suspended
2304 2003-04-03 Martin Baulig <martin@ximian.com>
2306 * timed-thread.h (TimedThread): Added `suspended_sem',
2307 `suspend_count' and `stack_ptr'.
2309 2003-03-28 Dick Porter <dick@ximian.com>
2311 * atomic.h: PPC support gratiously donated to the public domain
2312 by John Duncan <jddst19@mac.com>
2314 2003-03-20 Dick Porter <dick@ximian.com>
2316 * sockets.c (_wapi_connect): If connect() fails with EACCES, try
2317 setting SO_BROADCAST and connecting again. Fixes bug 39178.
2319 2003-03-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
2321 * processes.c: included Jerome Laban's patch and call SetLastError when
2322 the executable is not found.
2324 2003-03-03 Dick Porter <dick@ximian.com>
2326 * io.c (CreateFile): Try opening directories readonly, so that
2327 timestamps can be adjusted. Patch by Elan Feingold
2328 <efeingold@mn.rr.com>.
2330 2003-02-25 Dick Porter <dick@ximian.com>
2332 * shared.c (_wapi_shm_attach): Return a failure code on system
2333 call errors, rather than exiting.
2335 2003-02-21 Dick Porter <dick@ximian.com>
2337 * processes.c (GetCurrentProcessId): Use the current process
2338 handle to return the process ID, as getpid() is unreliable
2339 (linuxthreads gives each thread a different pid). Fixes bug
2342 2003-02-21 Dick Porter <dick@ximian.com>
2344 * io.c (FindNextFile): Skip over dangling symlinks. Fixes bug
2347 2003-02-11 Dick Porter <dick@ximian.com>
2350 * timefuncs.c: Added GetTickCount()
2352 2003-02-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
2354 * error.c: added WSA_EHOSTUNREACH mapping.
2356 2003-01-26 Miguel de Icaza <miguel@ximian.com>
2358 * io.c (SetFileAttributes): This routine is not currently
2359 implemented for the general case, but I added a special case to
2360 set the executable bit on Linux.
2362 Wed Jan 15 15:55:40 CET 2003 Paolo Molaro <lupus@ximian.com>
2364 * sockets.h, daemon.c, io.c: compilation fixes on MacOSX.
2366 2003-01-08 Dick Porter <dick@ximian.com>
2368 * sockets.c: Fixed setting blocking mode to true (fixes bug 36388)
2370 2002-12-11 Juli Mallett <jmallett@FreeBSD.org>
2372 * daemon.c, handles-private.h, handles.c, wapi-private.h:
2373 Check for an implementation which says it supports
2374 _POSIX_THREAD_PROCESS_SHARED, rather than just one that
2375 defines the symbol. Defined but with a value of -1 still
2376 means that it is unsupported.
2378 2002-12-08 Martin Baulig <martin@ximian.com>
2380 * handles.c (_wapi_handle_new): Create new non-shared handles with
2381 an initial refcount of 1, not 0.
2383 2002-11-22 Dietmar Maurer <dietmar@ximian.com>
2385 * threads.c (TlsGetValue): removed unnecessary mutex
2387 2002-11-20 Dick Porter <dick@ximian.com>
2389 * timed-thread.c (_wapi_timed_thread_attach): Attached threads
2390 need to store their data structure too.
2392 * threads.c: Make sure the threading data is initialised wherever
2395 2002-11-15 Dick Porter <dick@ximian.com>
2397 * timed-thread.c: Removed unneeded parameters in
2398 _wapi_timed_thread_attach().
2400 * threads.c: Renamed AttachThread() to make it not look like
2401 external API. Removed unneeded parameters.
2403 2002-11-11 Gonzalo Paniagua Javier <gonzalo@ximian.com>
2405 * error.[ch]: added errno_to_WSA (). It displays a warning and return
2406 WSASYSCALLFAILURE if there is no error mapping for the given errno,
2408 * sockets.c: use errno_to_WSA and fixed display of warning for h_errno.
2410 2002-10-31 Dick Porter <dick@ximian.com>
2413 * io.c: Define and use INVALID_FILE_ATTRIBUTES
2415 2002-10-07 Dick Porter <dick@ximian.com>
2418 * daemon.c: Use a more accurate time source for process start and
2421 2002-10-03 Dick Porter <dick@ximian.com>
2425 * threads.c: Fixes for freebsd. Make sure that mutex and condition
2426 creation and deletion happen in the process that owns them, when
2427 POSIX shared thread objects aren't supported. This breaks on
2428 freebsd, as pthread_t is a pointer to data.
2430 2002-10-02 Dick Porter <dick@ximian.com>
2432 * shared.c: Use mmap() instead of sysv shm for the shared data.
2434 * wapi-private.h (_WAPI_HANDLE_VERSION): Reset back to 0, for the
2438 * daemon.c: mmap()ed regions survive fork, so just pass the
2439 pointer to _wapi_daemon_main instead of mapping it again.
2441 2002-10-01 Dick Porter <dick@ximian.com>
2443 * timed-thread.c: Kludge for CREATE_SUSPENDED thread creation.
2444 Unfortunately libgc uses the same thread suspend technique that I
2445 want to, and the two don't mix: libgc will deadlock when it tries
2446 to stop the world if a thread has already been suspended by
2447 someone else. Just do the simple suspended create rather than the
2448 general purpose thread suspension for now.
2450 * threads.c: Pass create flags to the timed_thread create call, to
2451 implement suspended thread creation. ResumeThread() partially
2452 implemented, to cope with the case where a newly created but
2453 suspended thread is launched.
2455 2002-09-30 Dick Porter <dick@ximian.com>
2457 * sockets.c (ioctlsocket): Set non-blocking mode in a better way,
2460 2002-09-27 Dick Porter <dick@ximian.com>
2462 * semaphores.c: Only include semaphore.h if it's present. Patch
2463 for BSD from jmmv@hispabsd.org (Julio Merino).
2465 2002-09-27 Dick Porter <dick@ximian.com>
2467 * processes.c: Pass environment and working directory to the
2468 daemon when forking. Don't let argv[0] be duplicated when looking
2469 for the program name. Implement EnumProcessModules (simple
2470 version for now, lsof-style later if needed), GetModuleBaseName,
2471 {Get,Set}ProcessWorkingSetSize (just faked, because the vm hints
2472 aren't available on Linux).
2474 * process-private.h: Store the process name, and the working set
2478 * handles-private.h: New functions to store and retrieve an array
2479 of strings in the scratch space
2481 * daemon.c: Don't miss deleting some handles when a client exits
2482 (we used to rely on the client doing the final cleanup, but
2483 obviously if the client is no longer there the daemon has to do
2486 Process forking now sets the environment and the working
2489 * io.c: Don't confuse fd 0 with an unassigned handle struct
2491 * atomic.h: Add a google cache alternative to the msdn URL
2493 2002-09-25 Gonzalo Paniagua Javier <gonzalo@ximian.com>
2496 (_wapi_recvfrom): added ECONNRESET to the switch.
2498 2002-09-24 Mark Crichton <crichton@gimp.org>
2500 * atomic.h: Yea. On linux, sparc isn't sparc, it's __sparc__.
2503 2002-09-19 Mark Crichton <crichton@gimp.org>
2505 * daemon.c, shared.c: Added NEED_LINK_UNLINK for systems that
2506 dont have Linux's abstract filesystem for sockets.
2508 2002-09-19 Mark Crichton <crichton@gimp.org>
2510 * atomic.h: Added SPARC atomic asm code.
2511 * daemon.c, handles-private.h, handles.c, wapi-private.h:
2512 undefined _POSIX_THREAD_PROCESS_SHARED. This actually exists on
2513 Solaris 9, however, the code paths don't seem to work. More testing
2514 on the shared case is *really* needed.
2516 2002-09-03 Dick Porter <dick@ximian.com>
2519 * threads.c: Removed PosixKillThread(), because it's not in the
2522 2002-08-20 Dick Porter <dick@ximian.com>
2524 * handles.c (_wapi_handle_scratch_store): Made stored byte lengths
2525 multiples of 4 bytes, to keep header structures aligned. Needed
2526 for sparc, at least. (Patch from crichton@gimp.org)
2528 * handles.c: Removed 'disable_shm' variable (we've defaulted to
2529 building with shm enabled for months now)
2531 2002-08-19 Dick Porter <dick@ximian.com>
2533 * daemon.c: Rewrote the poll() loop to use GIOChannels instead,
2534 for legacy NeXT-based systems.
2536 2002-08-12 Dick Porter <dick@ximian.com>
2538 * atomic.h: Rename some parameters to avoid c++ keywords (Patch
2539 from Joseph Wenninger <kde@jowenn.at>)
2541 2002-08-05 Dietmar Maurer <dietmar@ximian.com>
2543 * threads.c: use fast spinlocks by default
2545 2002-08-02 Dick Porter <dick@ximian.com>
2547 * io.c (GetStdHandle): Add a handle reference when returning a
2548 duplicate console handle. This fixes the unref_handle errors in
2551 2002-08-01 Dietmar Maurer <dietmar@ximian.com>
2553 * threads.c (TLS_PTHREAD_MUTEX): define this because else some
2556 2002-08-01 Dick Porter <dick@ximian.com>
2558 * threads.c: Use atomic spinlocks in TLS functions
2561 * Makefile.am: Added mono-spinlock.h
2563 2002-07-21 Jeffrey Stedfast <fejj@ximian.com>
2565 * daemon-messages.c: #include <sys/types.h> and <sys/sockets.h> -
2566 these are needed for sendmsg() and also for struct msghdr (at
2567 least on Solaris). Solaris still won't build because struct msghdr
2568 doesn't have msg_flags, msg_control, or msg_controllen members.
2569 (CMSG_SPACE): Define for systems that don't have it.
2572 2002-07-20 Dick Porter <dick@ximian.com>
2578 * handles.c: Implemented pipe handles
2581 * daemon.c: Fixed bug in handle closing.
2584 * daemon.c: Forked processes now close all open file descriptors.
2586 Fri Jul 19 19:05:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
2588 * sockets.h, io-layer.h, critical-sections.h: don't include config.h
2591 2002-07-19 Martin Baulig <martin@gnome.org>
2593 * threads.c (ExitThread): Call exit() if no threads has been
2596 2002-07-17 Dick Porter <dick@ximian.com>
2598 * daemon-messages.c: Freebsd fixes from Andreas Kohn
2599 <andreas.kohn@gmx.net>
2601 2002-07-15 Dick Porter <dick@ximian.com>
2603 * io.c: Removed bogus console_flush() method, that was just cut
2604 and pasted from file_flush when I separated the two handle types.
2606 2002-07-12 Dick Porter <dick@ximian.com>
2608 * io.c (convert_from_flags): Fixed misunderstanding wrt fcntl
2609 flags. Fixes bug 27633.
2611 2002-07-12 Dick Porter <dick@ximian.com>
2615 * daemon.c: Use size of sockaddr_un.sun_path from config.h
2617 2002-07-12 Dick Porter <dick@ximian.com>
2619 * processes.c (CreateProcess): Send stdin, stdout and stderr
2620 handles if the startup info doesnt specify new ones
2622 * io.c (GetStdHandle): Return the same handle when the same
2623 standard handle is requested
2625 * handles.c: Pass file descriptors when forking
2627 * daemon.c: Use supplied file descriptors when forking a new
2630 * daemon-messages.h:
2631 * daemon-messages.c: Pass stdin, stdout and stderr file
2632 descriptors to the daemon (used when forking)
2634 2002-07-11 Miguel de Icaza <miguel@ximian.com>
2636 * daemon.c (_wapi_daemon_main): Use sizeof
2637 (main_socket_address.sun_path) instead of hardcoded 108 value.
2639 * handles.c (shared_init): Use sizeof
2640 (shared_socket_address.sun_path) instead of hardcoded 108 value.
2642 2002-07-10 Dennis Haney <davh@davh.dk>
2646 * daemon.c: Lots of documentation, some added error checking, and
2647 code readability improvements.
2649 * daemon-messages.h: Add the Error request type to improve error
2652 * daemon-messages.c: Do a bit more error checking on send() and
2653 recv(), and log errors with a higher severity level.
2655 2002-07-04 Dick Porter <dick@ximian.com>
2657 * daemon.c (process_process_fork): Fix argument handling, due to
2658 buggy understanding of g_strsplit() behaviour.
2660 2002-07-03 Dick Porter <dick@ximian.com>
2663 * threads.c: Implement OpenThread(). Define access-control values
2669 * Makefile.am: Added access.h, to hold shared access-control
2672 2002-07-02 Dick Porter <dick@ximian.com>
2674 * wapi-private.h (_WAPI_HANDLE_VERSION): New protocol version
2676 2002-07-02 Dick Porter <dick@ximian.com>
2678 * handles.c (shared_init): Make a second attempt to contact the
2679 daemon if the shared memory attach succeeds, but the connect()
2680 fails. (This copes with the daemon crashing without cleaning up
2686 * shared.c (_wapi_shm_attach): Don't exec() anything when we fork
2687 the daemon, it's now built into the library.
2689 2002-06-25 Dick Porter <dick@ximian.com>
2692 * handles-private.h:
2693 * daemon-messages.h:
2694 * daemon.c: Process forking and handle data management
2697 * process-private.h:
2698 * processes.c: Process forking and other support functions
2700 2002-06-25 Dick Porter <dick@ximian.com>
2702 * versioninfo.h: PE resource decoding
2704 * unicode.c (_wapi_unicode_to_utf8): g_utf16_to_utf8 doesnt need
2705 to be told the string length
2707 * io.c: Removed the ACTUALLY_DO_UNICODE option. Fixed some leaks.
2708 Moved _wapi_time_t_to_filetime and the WapiFileTime typedef to
2711 2002-06-12 Dick Porter <dick@ximian.com>
2714 * daemon-messages.c: Handle SIGPIPE in a non-stupid way in the
2715 daemon, if MSG_NOSIGNAL isn't available. Thanks to Jaroslaw
2716 Kowalski <jarek@atm.com.pl> for pointing out the bogosity.
2718 2002-06-10 Jaroslaw Kowalski <jarek@atm.com.pl>
2720 * sockets.c, daemon-messages.c: Prevent SIGPIPE from being raised
2721 when writing to a closed socket.
2723 2002-06-08 Jeffrey Stedfast <fejj@ximian.com>
2725 * mono-mutex.c (mono_once): New convenience function for my
2730 * critical-sections.c:
2738 * atomic.c: Use mono_once() rather than pthread_once().
2740 2002-06-06 Jeffrey Stedfast <fejj@ximian.com>
2742 * handles.c (_wapi_handle_new): pthread_once() is not atomic, so
2743 if multiple threads all try to call _wapi_handle_new() before the
2744 shared data has been initialized, it is possible that we could get
2745 into a condition where shared_init() is being executed and later
2746 threads will pass by pthread_once() due to the fact that it has
2747 already been called and so therefor will attempt to use the shared
2748 data before it has been completely initialized. If we instead use
2749 a standard mutex locking mechanism around shared_init(), we can
2750 avoid the situation entirely. By wrapping the mutex locking in a
2751 check to see if we've already initialized the data, we can even
2752 avoid wasting resources by having to lock/unlock the mutex in any
2753 later calls (the only time we'd have to worry about
2754 locking/unlocking is the initial race to call shared_init() at
2757 Sat Jun 1 13:27:11 CEST 2002 Paolo Molaro <lupus@ximian.com>
2759 * atomic.h: inline asm fixes from Dennis Haney (davh@davh.dk).
2761 Fri May 31 16:21:54 CEST 2002 Paolo Molaro <lupus@ximian.com>
2763 * daemon.c, handles.c: rename "sun" local var since it's apparently
2764 a #define on Solaris.
2766 Fri May 31 15:40:14 CEST 2002 Paolo Molaro <lupus@ximian.com>
2768 * daemon-messages.c: work-around MSG_NOSIGNAL missing on some
2771 2002-05-15 Dick Porter <dick@ximian.com>
2773 * wait.c: Fix a deadlock in WaitForMultipleObjects
2775 2002-05-14 Dick Porter <dick@ximian.com>
2777 * io.c: Fix a cut&paste error, found by
2778 Jaroslaw Kowalski <jarek@atm.com.pl>
2780 2002-05-10 Dan Lewis <dihlewis@yahoo.co.uk>
2784 2002-05-09 Dick Porter <dick@ximian.com>
2790 * handles-private.h:
2792 * Makefile.am: Remove now-unused file wait-private.h
2794 2002-05-08 Dick Porter <dick@ximian.com>
2796 * shared.c: Better error messages, and report when daemon
2797 connection fails rather than blocking forever. Do some more
2798 shared memory sanity checking.
2800 * handles.c: Better error messages when connecting to shared
2801 memory and the handle daemon. Fall back to non-shared handles if
2802 an error occurs. Set the default back to 'shared handles'. Fix a
2803 crashing bug in scratch space allocation that mangled the block
2806 2002-05-07 Miguel de Icaza <miguel@ximian.com>
2808 * handles.c (shared_init): Disable SHM for now, people have too
2809 many problems with this, and the diagnostics are not helping.
2811 2002-05-06 Dan Lewis <dihlewis@yahoo.co.uk>
2813 * io.c: CreateFile sets win32 last error.
2815 2002-05-05 Dick Porter <dick@ximian.com>
2818 * handles-private.h:
2824 * process-private.h:
2826 * semaphore-private.h:
2830 * event-private.h: Simplify the WapiHandleOps struct: take out all
2831 the file-specific entries, leaving just the items that operate on
2832 handles themselves. Split the close operation into shared and
2833 private parts: shared close is called by the daemon.
2835 * handles.c: As above, but also pass handle allocation, ref and
2836 unref operations to the daemon. Populate the handle_ops array at
2837 compile time, because the daemon needs to call ops on handles too.
2838 Don't bother to track open handle counts any more, the daemon does
2842 * thread-private.h: As above, but also make the thread data
2845 * shared.c: Fork a handle daemon if the calling process created
2846 the shared memory segment.
2849 * daemon-messages.c:
2850 * daemon-messages.h:
2851 * Makefile.am: Build a daemon to manage handle allocation and
2852 destruction without needing to lock the shared memory
2854 2002-04-30 Jeffrey Stedfast <fejj@ximian.com>
2856 * atomic.c: Changed to use a normal mutex rather than a spinlock
2857 since a lot of platforms seem to not have them :\
2859 2002-04-30 Dick Porter <dick@ximian.com>
2861 * Completely rewrote the handle waiting code: removed the helper
2862 thread and its attendant complexity. All handle waiting is now
2863 abstracted into the WaitForSingleObject() and
2864 WaitForMultipleObjects() functions.
2866 * Implemented inter-process sharing of handles using sysv shared
2867 memory. This makes handles even more opaque, with a handle now
2868 just an index into an array.
2870 2002-04-25 Dan Lewis <dihlewis@yahoo.co.uk>
2872 * io.c: unitialized pointer in GetCurrentDirectory.
2874 Sat Apr 20 13:37:39 CEST 2002 Paolo Molaro <lupus@ximian.com>
2876 * threads.c: destroy the mutex at thread destruction
2877 (if/when thread destruction code will be actually called).
2878 When protecting a tls data pointer from the gc, use also the
2879 thread id in the key.
2881 Wed Apr 17 18:36:27 CEST 2002 Paolo Molaro <lupus@ximian.com>
2883 * timed-thread.c: avoid race condition when setting the thread to
2886 2002-04-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
2888 * jit.h: to more #include lines to avoid breaking compilation
2889 under windows when upgrading mingw and w32api to version
2892 2002-04-16 Dick Porter <dick@ximian.com>
2894 * atomic.h: Explanatory comment about lack of 80386 support
2896 2002-04-15 Dick Porter <dick@ximian.com>
2898 * atomic.h: use xaddl for InterlockedIncrement() and
2899 InterlockedDecrement(). Use cmpxchgl in a loop for
2900 InterlockedExchange() and InterlockedExchangePointer().
2902 Mon Apr 15 13:31:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
2904 * unicode.c: fix unicode_len() to not access uninitialized memory
2905 (and updated to conform to mono code style).
2907 Fri Mar 29 17:15:11 CET 2002 Paolo Molaro <lupus@ximian.com>
2909 * io.c: EEXISTS is ignored for directory creation.
2910 * mono-mutex.h: remove silly "pragma }" that emacs users insert
2911 because they use a broken editor:-)
2913 2002-03-28 Dick Porter <dick@ximian.com>
2919 * handles.c: Warning cleanups
2921 2002-03-27 Dan Lewis <dihlewis@yahoo.co.uk>
2923 * unicode.h, unicode.c: changed to gunichar2
2924 * io.h, io.c: changed strings to gunichar2*, added
2925 SetFileAttributes(), GetCurrentDirectory(), SetCurrentDirectory(),
2926 some fixes to FindFirstFile() and friends.
2928 2002-03-26 Dick Porter <dick@ximian.com>
2930 * types.h: Implement the large integer struct
2933 * timefuncs.c: Dummy functions that don't yet implement
2934 QueryPerformanceCounter() and QueryPerformanceFrequency()
2937 * threads.c: Implement SleepEx()
2940 * system.c: Beginnings of GetSystemInfo()
2942 * mono-mutex.c (pthread_mutex_timedlock): Fix a ms/ns conversion
2946 * context.c: Dummy function that doesnt yet implement
2950 * atomic.c: Interlocked functions
2952 Mon Mar 25 13:01:40 CET 2002 Paolo Molaro <lupus@ximian.com>
2954 * threads.c: use a gc-safe hash table to store tls pointers.
2956 2002-03-22 Dick Porter <dick@ximian.com>
2958 * threads.c: Fix a race condition where a thread can start and
2959 exit before the handle has been properly initialised (no reason
2960 why the handle couldn't be initialised beforehand, so do so)
2962 Fix a ms to ns conversion magnitude thinko.
2964 2002-03-21 Dick Porter <dick@ximian.com>
2966 * semaphores.c: Fix a problem when waiting for one or more
2967 semaphores, and another semaphore is Released (all waiting
2968 semaphores assumed they were signalled)
2970 2002-03-29 Dan Lewis <dihlewis@yahoo.co.uk>
2972 * io.h, io.c, uglify.h: added MoveFile, CopyFile, CreateDirectory,
2973 RemoveDirectory, GetFileAttributes, GetFileAttributesEx
2975 2002-03-19 Dietmar Maurer <dietmar@ximian.com>
2977 * threads.c (Sleep): bug fix: 1ms == 1000000ns
2979 2002-03-19 Dan Lewis <dihlewis@yahoo.co.uk>
2981 * io.h, io.c, events.c, mutexes.c, semaphores.c, sockets.c,
2982 threads.c, io.c: added flush method to handles.
2984 * io.c: FlushFileBuffers() and FindFirstFile() functions.
2986 Thu Mar 7 17:21:52 CET 2002 Paolo Molaro <lupus@ximian.com>
2988 * threads.c, timed-thread.c, wait.c: Boehm-GC anable.
2990 2002-02-20 Dick Porter <dick@ximian.com>
2992 * io-layer.h: Always build without cygwin support on windows
2994 Mon Feb 18 15:50:59 CET 2002 Paolo Molaro <lupus@ximian.com>
2996 * sockets.c: #undef DEBUG.
2998 2002-02-14 Jeffrey Stedfast <fejj@ximian.com>
3000 * io-layer.h: conditionally include sys/filio.h and sys/sockio.h
3001 for FIONBIO, FIONREAD, and SIOCATMARK.
3003 2002-02-14 Jeffrey Stedfast <fejj@ximian.com>
3005 * sockets.c: conditionally include sys/filio.h and sys/sockio.h
3006 for FIONBIO, FIONREAD, and SIOCATMARK.
3008 2002-02-13 Dick Porter <dick@ximian.com>
3010 * sockets.c: Implement shutdown and select
3012 2002-02-13 Jeffrey Stedfast <fejj@ximian.com>
3014 * mono-mutex.[c,h]: New source files that thinly wrap all pthread
3015 functions that take pthread_mutex_t and/or pthread_mutexattr_t
3016 arguments for the sake of portability. Implements recursive
3017 mutexes and pthread_mutex_timedlock.
3019 * critical-sections.c:
3026 * wait.c: Use the mono-mutex wrapper portability functions/macros.
3028 * pthread-compat.[c,h]: Replaced by mono-mutex.[c,h]
3030 2002-01-23 Dick Porter <dick@ximian.com>
3032 * sockets.c: Networking support, mostly wrapping BSD socket APIs
3033 with handle code, and translating errno into w32 error codes.
3035 * macros.h: Some w32 macros used with the socket support
3037 * error.c: Implemented GetLastError() and SetLastError()
3039 * Makefile.am: Added sockets, with kludge to override some symbols
3041 2001-12-17 Dietmar Maurer <dietmar@ximian.com>
3043 * unicode.c (_wapi_unicode_to_utf8): byteswap UTF16 strings before
3044 passing them to iconv
3045 (_wapi_unicode_to_utf8): only swap bytes on LE systems, remove bug
3046 from previous commit.
3048 2001-12-11 Dick Porter <dick@ximian.com>
3050 * io.c: Implement DeleteFile(), GetFileTime(), SetFileTime() and
3051 FileTimeToSystemTime().
3053 * unicode.c (unicode_len): Nasty way of finding length of unicode
3054 string with embedded NULLs (counts until two NULLs together).
3056 * mutexes.c (mutex_close):
3057 * events.c (event_close): Release the internal pthreads resources
3059 2001-11-26 Dick Porter <dick@ximian.com>
3061 * critical-sections.c:
3069 * wait.c: turn off DEBUG messages
3071 2001-11-22 Dick Porter <dick@ximian.com>
3073 * handles.c (SignalObjectAndWait): Implement
3075 * wait.c (WaitForSingleObject): Fix case where timeout == 0
3081 * events.c: Support for SignalObjectAndWait
3083 2001-11-21 Dick Porter <dick@ximian.com>
3090 * wait.c: Reliable method of returning which handle was signalled
3091 on return from WaitForMultipleObjects().
3093 2001-11-21 Dick Porter <dick@ximian.com>
3095 * events.c: Implement events
3097 2001-11-15 Dick Porter <dick@ximian.com>
3099 * mutexes.c: Implement mutexes
3103 * misc.c: Factor out some common code
3105 2001-11-13 Dick Porter <dick@ximian.com>
3107 * threads.c: Implement TLS. Implement GetCurrentThreadId(), and
3108 GetCurrentThread() by maintaining a hash of thread handles.
3110 * threads.h: Define thread and process creation flags
3112 2001-11-12 Dick Porter <dick@ximian.com>
3114 * critical-sections.c: Implement critical sections
3116 2001-11-12 Dick Porter <dick@ximian.com>
3118 * semaphores.c: Implement semaphores
3120 * wait.c (wait_for_item): Maintain a wait count rather than count
3123 * threads.c (thread_wait_multiple): Don't lock the wait item, that
3124 will block other wait threads
3126 2001-11-11 Dick Porter <dick@ximian.com>
3128 * Makefile.am: Rename some automake variables
3129 (from Nick Drochak <ndrochak@gol.com>)
3131 2001-11-10 Dick Porter <dick@ximian.com>
3133 * Makefile.am (libwapiincludedir): Fix include destination
3135 * .cvsignore: Ignore generated files
3137 2001-11-10 Dietmar Maurer <dietmar@ximian.com>
3139 * pthread-compat.c: added some include files to make it compile on
3142 2001-11-08 Dick Porter <dick@ximian.com>
3146 This is a library emulating the win32 threading and IO API.