1 2010-07-04 Gonzalo Paniagua Javier <gonzalo@novell.com>
3 * io.c: don't strip out directory paths in the pattern.
5 2010-06-29 Geoff Norton <gnorton@novell.com>
7 * atomics.h: Implement armv6+ variants of our atomics.
9 2010-06-25 Zoltan Varga <vargaz@gmail.com>
11 * Makefile: Don't build an sgen aware version, it is no longer needed.
13 * wait.c handles.c wthreads.c: Call the mono_gc_ wrapper functions of some pthread
14 apis. This breaks the compile time dependency between io-layer and the GC.
16 2010-06-23 Miguel de Icaza <miguel@novell.com>
18 * Makefile.am: Add support for building a sgen-aware versions of
19 the library: libwapisgen.la libmonoruntimesgen-static it shares
20 all the components of the default, but use a differen set of
21 CFLAGS to enable SGEN instead.
23 2010-06-01 Geoff Norton <gnorton@novell.com>
25 * sockets.c: Don't call poll directly, use mono_poll.
27 2010-04-29 Geoff Norton <gnorton@novell.com>
29 * mono-spinlock.h: Remove
30 * wthreads.c: Don't spinlock here, use a mutex instead
32 2010-04-26 Geoff Norton <gnorton@novell.com>
34 * processes.c: Fix this for 64-bit darwin.
36 2010-04-20 Jonathan Pryor <jpryor@novell.com>
38 * collection.c: Cleanup platform checks around
39 pthread_attr_setstacksize(), and instead always use
40 MAX(65536, PTHREAD_STACK_MIN) as the stack size.
41 * mono-mutex.c: Remove near duplicate pthread_mutex_timedlock()
42 declarations, and merge via a CONST_NEEDED intermediate #define.
44 2010-04-19 Jonathan Pryor <jpryor@novell.com>
46 * collection.c, mono-mutex.c: Add Android support.
48 2010-04-14 Zoltan Varga <vargaz@gmail.com>
50 * collection.c (_wapi_collection_init): Set stack size on openbsd similarly to
53 2010-04-10 Andreas Färber <andreas.faerber@web.de>
55 * processes.c (EnumProcesses, load_modules): Add implementations
56 for Haiku. Fixes build on Haiku.
57 (OpenProcess, EnumProcessModules, get_process_name_from_proc):
58 Tweak implementations for Haiku.
59 * process-private.h: Fix _WAPI_PROCESS_UNHANDLED_PID_MASK for
61 * ChangeLog: Fix UTF-8 encoding
63 Code is contributed under MIT/X11 license.
65 2010-04-09 Zoltan Varga <vargaz@gmail.com>
67 * processes.c: Applied more openbsd changes from Robert Nagy <robert@openbsd.org>.
69 2009-04-06 Rodrigo Kumpera <rkumpera@novell.com>
71 * wthreads.c (TlsSetValue): Don't take locks here. We trust pthread_setspecific
72 return value to tell if we tried to store to an invalid slot.
74 2010-04-04 Zoltan Varga <vargaz@gmail.com>
76 * processes.c: Applied more openbsd changes from Robert Nagy <robert@openbsd.org>.
78 2010-04-03 Zoltan Varga <vargaz@gmail.com>
80 * processes.c: Applied more openbsd changes from Robert Nagy <robert@openbsd.org>.
82 2010-04-03 Zoltan Varga <vargaz@gmail.com>
84 * processes.c: Applied some openbsd changes from Robert Nagy <robert@openbsd.org>.
86 2010-03-26 Zoltan Varga <vargaz@gmail.com>
88 * sockets.c: Apply some openbsd changes from openbsd ports.
90 2010-03-26 Zoltan Varga <vargaz@gmail.com>
92 * shared.c: Disable shared supported by default, it can be enabled by setting
93 the MONO_ENABLE_SHM env variable.
95 2009-03-22 Rodrigo Kumpera <rkumpera@novell.com>
97 * threads.h: Add wapi_self_interrupt.
99 * wthreads.c: Add wapi_self_interrupt which puts the current
100 thread in interrupted state.
102 * wthreads.c (wapi_thread_clear_wait_handle): Previous handle
103 can possibly be NULL if an async interrupt cleared it.
105 This is safe because it is only async cleared if running inside a
108 2010-03-06 Gonzalo Paniagua Javier <gonzalo@novell.com>
110 * processes.c: made ShellExecuteEx actually work when the file name to
111 execute is quoted. Display a message intead of blindly ignoring the
112 result of g_shell_parse_argv(). Fixes bug #385497.
114 2010-03-05 Zoltan Varga <vargaz@gmail.com>
116 * shared.c (shm_semaphores_init): Applied patch from Cal Page
117 (age.cal@gmail.com). Fix support for USE_SHM.
119 2010-02-25 Geoff Norton <gnorton@novell.com>
121 * wait.c: If any of our handles are shared, we need to do
122 a polling wait so we're notified of the signal change.
124 Wed Feb 24 16:01:37 CET 2010 Paolo Molaro <lupus@ximian.com>
126 * Makefile.am: don't install the headers anymore, they are private.
128 2010-02-20 Zoltan Varga <vargaz@gmail.com>
130 * versioninfo.c (VerLanguageName): Remove code duplication a bit.
132 2009-12-02 Miguel de Icaza <miguel@novell.com>
134 * processes.c (EnumProcesses): Add support for OSX, patch from Tom
135 Philpot <tom.philpot@logos.com>
137 2009-11-30 Carlos Alberto Cortez <calberto.cortez@gmail.com>
139 * io.cs: In CopyFile check if the destination already exists before
140 trying to open it, and if it is the same as the source, report an error,
141 just as .net does. We do the check here to take advantage of the IOMAP
145 2009-11-13 Jonathan Chambers <joncham@gmail.com>
147 * mono-mutex.h: Implementation for Windows platform.
149 Code contributed under MIT/X11 license.
151 2009-11-13 Zoltan Varga <vargaz@gmail.com>
153 * processes.c: Include mono-path.h.
155 2009-11-12 Geoff Norton <gnorton@novell.com>
157 * processes.c: match_procname_to_modulename should resolve
158 symlinks when checking if two process modules match.
160 2009-11-04 Jonathan Chambers <joncham@gmail.com>
162 * mono-mutex.h: Add skeleton implementation for Windows platform.
164 Code contributed under MIT/X11 license.
166 2009-10-21 Gonzalo Paniagua Javier <gonzalo@novell.com>
168 * sockets.[ch]: fix function definition.
170 2009-10-21 Gonzalo Paniagua Javier <gonzalo@novell.com>
172 * sockets.[ch]: added TransmitFile implementation.
174 2009-10-04 Zoltan Varga <vargaz@gmail.com>
176 * processes.c: Implement get_process_name_from_proc () on solaris.
178 2009-09-24 Zoltan Varga <vargaz@gmail.com>
180 * processes.c (load_modules): Applied patch from Thomas Philpot
181 (tom.philpot@logos.com). Fixes #533893.
183 2009-09-15 Jeffrey Stedfast <fejj@novell.com>
185 * io.c (CreateFile): In the directory fallback case, use
186 _wapi_open() again so that IOMAP magic happens.
187 (CopyFile): Need to consistently use _wapi_open() here too.
188 (ReplaceFile): Use _wapi_open() here too and get rid of the
189 fallback code that tried re-opening the file w/o O_TRUNC since
190 there's no reason to do that.
192 2009-09-05 Zoltan Varga <vargaz@gmail.com>
194 * handles.c (_wapi_handle_real_new): Call _wapi_process_reap () when running
195 out of shared handes. Fixes #536776.
197 * processes.c (CreateProcess): Return false and set the error to
198 ERROR_OUTOFMEMORY when a process handle cannot be created.
199 (ShellExecuteEx): Propagate an ERROR_OUTOFMEMORY error code. Fixes part of
202 2009-09-01 Zoltan Varga <vargaz@gmail.com>
204 * processes.c (EnumProcessModules): Applied patch from Romain Tartière
205 (romain@blogreen.org). Fix this on freebsd/OSX. Fixes #533893.
207 2009-08-18 Christian Hergert <chris@dronelabs.com>
209 * wthreads.c: Roll back change for thread-id as it "embraces
210 and extends" the api by passing word-size for thread id on
213 2009-08-18 Christian Hergert <chris@dronelabs.com>
217 * wthreads.c: Be explicit when we are changing word sizes.
219 2009-08-18 Christian Hergert <chris@dronelabs.com>
221 * processes.c: Fix method declaration warnings.
222 * sockets.c: getsockopt() wants socklen_t for size.
224 2009-08-04 Miguel de Icaza <miguel@novell.com>
226 * posix.c (_wapi_stdhandle_create): Split this into a new file to
227 more easily support non-Posix platforms.
229 2009-07-20 Geoff Norton <gnorton@novell.com>
231 * thread-private.h: Use the new mono-semaphore.h.
233 2009-06-25 Gonzalo Paniagua Javier <gonzalo@novell.com>
235 * sockets.c: add the error number to the message so we can figure out
238 2009-06-25 Gonzalo Paniagua Javier <gonzalo@novell.com>
240 * wait.c: add missing 'break'.
242 2009-06-20 Zoltan Varga <vargaz@gmail.com>
244 * atomic.h: Fix ilp32 support on ppc.
246 2009-05-28 Mark Probst <mark.probst@gmail.com>
248 * collection.c (_wapi_collection_init): If pthread_create() fails,
249 try again with larger and then with no stack size set. Fixes
252 2009-05-26 Zoltan Varga <vargaz@gmail.com>
254 * shared.c (_wapi_shm_file): Avoid creating a .wapi directory here, create
255 it in _wapi_shm_file_open (), since platforms using posix shm don't need it.
257 2009-05-22 Miguel de Icaza <miguel@novell.com>
259 * wapi_glob.c: Do not need sys/param.h anymore, we now use the
260 POSIX PATH_MAX instead of BSD's MAXPATHLEN
262 * handles.c: Do not pull a reference to sockets if they are
265 * sockets.c: Allow for ports to define their own ioctlsocket.
267 * wthreads.c: Remove obsolete code that I recently introudced (the
268 hook for mono_register_thread_attr.
270 2009-05-22 Miguel de Icaza <miguel@novell.com>
272 * versioninfo.c: One missing signature, fixed.
274 2009-05-21 Miguel de Icaza <miguel@novell.com>
276 * daemon.c: Remove more DEBUG ifdef mess.
278 * shared.c (_wapi_shm_attach): Implemention for DISABLE_SHARED_HANDLES
280 2009-05-20 Miguel de Icaza <miguel@novell.com>
282 * sockets.c (ioctlsocket): Move support for MacOS semantics to the
283 ioctlsocket from the ifdef that was previously on metadata/
285 * wapi_glob.c (_wapi_glob): Use PATH_MAX from limits.h instead of
286 the BSD name from sys/param.h (MAXPATHLEN)
288 Do not include pwd.h as it is not used.
290 * thread-private.h: Use indent ifdef style for clarity
292 * sockets-wrappers.h: sys/socket.h conditional
294 * daemon-messages.h: sys/uio.h conditional.
296 * sockets.c: sys/ioctl.h conditional
298 * wthreads.c: work around for platforms with no thread fetching
301 * versioninfo.c: Use the portable mono_map_ interface instead of
302 using mmap directly and change the style to the Mono style.
304 Remove more DEBUG/ifdefs combos
306 * shared.c: Split the code to make DISABLE_SHARED remove all the
307 code that does not use the shared handles. Before it merely
308 removed some of it, with this we avoid hacks on platforms that can
311 Split the code to reduce the amount of ifdefs.
313 Remove #ifdef DEBUG from the source and use a macro instead.
315 2009-05-20 Miguel de Icaza <miguel@novell.com>
317 * locking.c: Split locking code into a separate file.
319 2009-05-18 Miguel de Icaza <miguel@novell.com>
321 * daemon.c: Move the compile check of MONO_SIZEOF_SUNPATH to the
324 * Rename `threads.c' to `wthreads.c' as broken build systems are
325 not able to cope with two files with the same name across multiple
328 2009-05-15 Geoff Norton <gnorton@novell.com>
330 * handles.c: Don't start the collection thread if we've disabled
333 2009-05-12 Zoltan Varga <vargaz@gmail.com>
335 * collection.c (collection_thread): Get rid of all the ifdefs and
336 gcc attributes, simply return NULL.
338 2009-05-11 Zoltan Varga <vargaz@gmail.com>
340 * shared.c: Applied patch from Koushik K. Dutta (koush@koushikdutta.com).
341 Fix the build on android.
343 2009-05-09 Miguel de Icaza <miguel@novell.com>
345 * messages.c: Split the scan into common and uncommon messages to
346 allow the messages that are not produced by Mono to be removed on
349 * messages.c (message_string): instead of having a gigantic switch
350 table, use a sorted structure in memory and do a binary search on
353 This reduces the runtime size by 49k and the debugging symbols by
356 2009-04-29 Gonzalo Paniagua Javier <gonzalo@novell.com>
358 * sockets.c: don't display a warning when connect() fails because the
359 socket was closed in another thread.
361 2009-04-23 Rodrigo Kumpera <rkumpera@novell.com>
363 * shared.c: Fix a bunch of memleaks.
365 2009-03-27 Zoltan Varga <vargaz@gmail.com>
367 * threads.h: Add a comment to CreateThread.
369 2009-03-20 Zoltan Varga <vargaz@gmail.com>
371 * threads.c handles.c wait.c: Change location of gc_wrapper.h.
373 2009-02-22 Robert Jordan <robertj@gmx.net>
375 * sockets.c: implement WSASend/WSARecv using sendmsg/recvmsg.
378 Code is contributed under MIT/X11 license.
380 2009-02-20 Gonzalo Paniagua Javier <gonzalo@novell.com>
382 * events.c: fix event_signal and namedevent_signal to actually signal
385 2009-02-12 Gonzalo Paniagua Javier <gonzalo@novell.com>
387 * io.c: EXDEV when moving directories fails now without creating a
388 file in the destination.
391 2009-02-09 Zoltan Varga <vargaz@gmail.com>
393 * wait.c (WaitForMultipleObjectsEx): Initialize poll variable.
395 2009-02-05 Miguel De Icaza <miguel@novell.com>
397 * sockets.c (_wapi_setsockopt): SO_REUSEPORT is needed also on
398 MacOS X. Fixes bug #471292
400 2009-01-29 Zoltan Varga <vargaz@gmail.com>
402 * shared.c: Fall back to file based shared storage if shm_open () fails
403 because /dev/shm is not mounted.
405 * shared.c: Add an alternative implementation using shared memory instead of
406 files. This fixes problems where the mono process would spin up the disk
407 every x secs on laptops. Fixes #434566, #415373 and #321949.
409 2009-01-16 Miguel de Icaza <miguel@novell.com>
411 * sockets.c (WSASend): Fix memory leak, and optimize for the case
414 This should really use writev or sendmsg to use the kernel
415 scatter/gather facility instead of emulating it by copying buffers.
417 2009-01-26 Rodrigo Kumpera <rkumpera@novell.com>
419 * critical-sections.h (Enter/LeaveCriticalSection): Show
420 helpfull warning messages before crashing.
422 2009-01-26 Rodrigo Kumpera <rkumpera@novell.com>
424 * handles-private.h (_wapi_handle_set_signal_state): Show
425 helpfull warning messages before crashing.
427 2009-01-26 Jeffrey Stedfast <fejj@novell.com>
429 * mono-mutex.[c,h]: Removed GPLv2 copyright notice which should
432 2009-01-20 Rodrigo Kumpera <rkumpera@novell.com>
434 * threads.c: Add wapi_current_thread_desc that produces
435 a string representation of the current thread state.
437 * threads.h: Export wapi_current_thread_desc.
439 2009-01-18 Zoltan Varga <vargaz@gmail.com>
441 * io.c (GetDiskFreeSpaceEx): Applied patch from Koushik Dutta
442 (koush@koushikdutta.com). Disable this on android.
444 2009-01-16 Rodrigo Kumpera <rkumpera@novell.com>
446 * handles.c (_wapi_handle_timedwait_signal_handle): Don't use the
447 set_wait_handle/clear_wait_handle machinery for alertable waits in
448 case of non-alertable waits.
450 Non-alertable waits must continue and wait on the cond as this will
451 release the lock. Otherwise this will cause a deadlock as anyone trying
452 to pulse the cond will block trying to acquire the said lock because
453 the thread in non-alertable wait will be busy looping in WaitForSingleObjectEx
454 or similar function, never releasing the lock.
456 Thou this fixes quite a few of the hangs introduced by non-pooling alertable
457 waits, the long term plan is to verify if all non-alertable waits really need
460 2009-01-14 Zoltan Varga <vargaz@gmail.com>
462 * handles-private.h (_wapi_handle_set_signal_state): Set the signalled state
463 of the handle while locking the global signal cond mutex.
465 * wait.c (WaitForMultipleObjectsEx): Check the signalled state of handles
466 inside the critical section before waiting, otherwise we could go to waiting
467 even when the handles are already signalled.
469 2009-01-13 Zoltan Varga <vargaz@gmail.com>
471 Reapply r122913, this time handling processes by falling back to polling.
473 * handles.c: Rework the way the global signal stuff is handled: instead of
474 allocating a separate mutex/condvar pair for it, allocate a normal handle.
475 This way, it can reuse the alertable waiting code, allowing
476 WaitForMultipleObject to work without polling.
478 2009-01-09 Miguel de Icaza <miguel@novell.com>
480 Incorporate a few patches from Paolo, slightly modified:
482 * handles.c (_wapi_handle_check_share): On non-Linux systems, do
483 not even compile in the code that scans for /proc/fd, and go
484 directly to the fallback function.
486 2009-01-09 Paolo Molaro (lupus@ximian.com)
488 * handles.c: Do not include some header files in platforms that
491 2009-01-09 Miguel de Icaza <miguel@novell.com>
493 * messages.c: Eliminate a warning.
495 2009-01-09 Paolo Molaro (lupus@ximian.com)
497 * error.c: On some platforms that do not define these variables,
500 * security.c, io-private.h: Only include some headers if they
503 * sockets.c, sockets.h: do not import on this header files that
504 are only consumed internally in sockets.c.
506 2009-01-09 Zoltan Varga <vargaz@gmail.com>
508 * threads.c (_wapi_thread_apc_pending): Check for thread->wait_handle ==
509 INTERRUPTION_REQUESTED_HANDLE too.
510 (wapi_interrupt_thread): Rework the comments, the thread is no longer
511 required to call QueueUserAPC to make the wait functions return.
513 * threads.c handles.c threads-internal.h: Implement alertable waits without
516 2009-01-08 Geoff Norton <gnorton@novell.com>
518 * processes.c: Fix the osx version check to properly detect 10.5 v 10.4
520 2009-01-08 Christian Prochnow <cproch@seculogix.de>
522 * types.h: added WapiULargeInteger.
524 * uglify.h: added ULARGE_INTEGER, PULARGE_INTEGER.
526 * io.h: added WapiDriveType, added method declarations
527 for GetDiskFreeSpaceEx and GetDriveType
529 * io.c: added GetDiskFreeSpaceEx() to query disk size
530 and free space via statvfs or statfs system call.
531 added GetDriveType to query drive type via /etc/mtab or /etc/mnttab.
533 2009-01-07 Geoff Norton <gnorton@novell.com>
535 * processes.c: Properly implement support for Process.Modules on OSX.
536 Fixes OSX on nunit 2.4
538 2009-01-07 Rodrigo Kumpera <rkumpera@novell.com>
540 * io.c (GetCurrentDirectory): Avoid calling g_get_current_dir straight
541 away as it doesn't handle ENAMETOOLONG correctly. As a bonus we avoid
542 allocating memory in the common path.
544 2009-01-07 Geoff Norton <gnorton@novell.com>
546 * processes.c: Only use open -W on OSX 10.5+. Patch from
549 2008-12-19 Bill Holmes <billholmes54@gmail.com>
551 * processes.c (get_module_name) : adjust size for unicode characters.
553 Code is contributed under MIT/X11 license.
555 2008-11-21 Zoltan Varga <vargaz@gmail.com>
557 * atomic.h: Applied patch from Mihai Chelaru <kefren@ngnetworks.ro>. Add
560 2008-11-18 Mark Probst <mark.probst@gmail.com>
562 * atomic.h: InterlockedExchangePointer and
563 InterlockedCompareExchangePointer for PPC64.
565 Code submitted by andreas.faerber@web.de at
566 https://bugzilla.novell.com/show_bug.cgi?id=324134 under the
569 2008-11-13 Bill Holmes <billholmes54@gmail.com>
571 * wait.h : Adding method declaration for WaitForInputIdle.
573 * wait.c : Adding implementation for WaitForInputIdle.
575 Code is contributed under MIT/X11 license.
577 Fri Oct 17 15:23:00 CEST 2008 Paolo Molaro <lupus@ximian.com>
579 * processes.c: patch from Geoff Norton (gnorton@novell.com) to
580 strdup the open program on OSX (bug #431811).
582 2008-10-10 Gonzalo Paniagua Javier <gonzalo@novell.com>
584 * versioninfo.c: remove the use of g_strdown.
586 2008-09-25 Dick Porter <dick@ximian.com>
588 * wait.c: Make sure we keep references to handles we're waiting
589 for. Fixes bug 424851.
591 2008-07-29 Dick Porter <dick@ximian.com>
593 * processes.c (get_module_name): Make a last-ditch effort to
594 figure out the process name. Fixes bug 413723, patch by Casey
595 Marshall <casey.s.marshall@gmail.com>
597 2008-07-28 Dick Porter <dick@ximian.com>
599 * handles.c (_wapi_handle_count_signalled_handles): Remove an
600 unmatched _wapi_handle_ref(). Fixes bug 410743.
602 2008-07-15 Rodrigo Kumpera <rkumpera@novell.com>
604 * versioninfo.c (map_pe_file): Fix memory leak.
606 2008-07-01 Zoltan Varga <vargaz@gmail.com>
608 * process-private.h (_WAPI_PROCESS_UNHANDLED_PID_MASK): Fix the amd64 build.
610 2008-06-27 Dick Porter <dick@ximian.com>
612 * processes.c: Implement a form of process pseudo-handle to allow
613 non-mono processes to be manipulated. Fixes bug 313231.
615 * wait.c: Check for process pseudo-handles and fail if an attempt
616 is made to wait on one.
618 2008-06-19 Dick Porter <dick@ximian.com>
620 * sockets.c: Implement WSASend() and WSAReceive().
622 2008-06-02 Dick Porter <dick@ximian.com>
627 * messages.c: Implement FormatMessage, fixes bug 321827.
629 2008-05-29 Dick Porter <dick@ximian.com>
631 * sockets.c (socket_close): Clear any saved errors
632 (_wapi_connect): Don't save EWOULDBLOCK errors here, as that
633 breaks async connects. (Bug 377589 test case broken by the
634 previous fix to bug 356552)
636 2008-05-25 Zoltan Varga <vargaz@gmail.com>
638 * thread-private.h (struct _WapiHandle_thread): Remove 'owner_pid' field. Reorder
639 fields so this struct (which is the biggest of the handle structs) takes less
642 * threads.c (QueueUserAPC): Make this function signal safe by adding some
643 restrictions on its usage.
645 2008-05-14 Zoltan Varga <vargaz@gmail.com>
647 * mono-mutex.h: Get rid of the #ifdef __cplusplus defines, use G_BEGIN_DECLS
650 2008-05-07 Dick Porter <dick@ximian.com>
652 * io.c (FindNextFile): Handle symlinks correctly. Fixes bug
655 2008-04-25 Zoltan Varga <vargaz@gmail.com>
657 * handles.c (_wapi_handle_check_share): Fix a crash introduced by the lazy
658 creation of wapi handle slots.
660 2008-04-24 Zoltan Varga <vargaz@gmail.com>
662 * handles.c (shared_init): Align _wapi_fd_reserve to a multiple of
663 _WAPI_HANDLE_INITIAL_COUNT to avoid a problem when allocating handles.
665 2008-04-23 Zoltan Varga <vargaz@gmail.com>
667 * handles.c: Initialize the handle array entries on demand to save memory.
669 * wapi-private.h (_WAPI_HANDLE_INITIAL_COUNT): Decrease this to 256 to save
672 * handles-private.h (_WAPI_PRIVATE_MAX_SLOTS): Increase this to 1024*16 to
673 compensate for the decrease in _WAPI_HANDLE_INITIAL_COUNT.
675 * threads.c: Use #ifdef instead of #if for checking for valgrind/memcheck.h.
677 2008-04-22 Dick Porter <dick@ximian.com>
679 * wapi_glob.c (globextend): Comment out the code using ARG_MAX, as
680 that is broken on the latest opensuse.
682 2008-04-21 Dick Porter <dick@ximian.com>
684 * io.c (DeleteFile): Disable for now the bug fix for 323389, it's
685 breaking too much other stuff.
687 2008-04-20 Geoff Norton <gnorton@novell.com>
689 * processes.c: Fix the _NSGetEnviron define to prevent an impropoer
692 2008-04-18 Miguel de Icaza <miguel@novell.com>
694 * Applied patch from Dick Porter from bug #380649
696 2008-04-17 Dick Porter <dick@ximian.com>
698 * io.c (DeleteFile): Check file shares before deleting a file.
701 2008-04-17 Dick Porter <dick@ximian.com>
703 * io.c (DeleteFile): Return ERROR_ACCESS_DENIED if the file is
704 readonly. Fixes bug 378229.
706 2008-04-11 Geoff Norton <gnorton@novell.com>
708 * processes.c: The global extern environ doesn't exist on Mac. We
709 need to call NSGetEnviron instead.
711 2008-04-08 Dick Porter <dick@ximian.com>
713 * processes.c (CreateProcess): Improve the managed binary support,
714 so it works when the executable is passed in as the appname.
717 2008-04-04 Dick Porter <dick@ximian.com>
719 * io.c (MoveFile): Check file shares before moving a file. Fixes
722 2008-04-04 Dick Porter <dick@ximian.com>
724 * error.c (errno_to_WSA): handle ENODEV. Fixes the reopened part
727 2008-04-04 Dick Porter <dick@ximian.com>
729 * processes.c (GetModuleInformation):
731 * versioninfo.c: 64bit fixes
733 2008-04-03 Dick Porter <dick@ximian.com>
735 * io-portability.c (_wapi_basename, _wapi_dirname): Only turn \
736 into / when MONO_IOMAP is in effect. Fixes bug 346123.
738 2008-04-03 Dick Porter <dick@ximian.com>
740 * timefuncs.c (GetTickCount): Use mono_msec_ticks(), see bug
743 2008-04-01 Dick Porter <dick@ximian.com>
745 * versioninfo.c (get_string_block): Refine the fix for bug 354856
746 (r93661) so that it also fixes the new part of bug 374600.
748 2008-03-28 Dick Porter <dick@ximian.com>
750 * processes.c (GetExitCodeProcess): Check if a process has exited
751 and recorded it's exit code, before seeing if the process is
752 signalled. Fixes bug 325463.
754 2008-03-27 Dick Porter <dick@ximian.com>
756 * processes.c (match_procname_to_modulename): Check the whole
757 process name first, in case it is recorded as an absolute path.
760 2008-03-27 Dick Porter <dick@ximian.com>
762 * processes.c (ShellExecuteEx): Grotty kludge to work around
763 unpleasant feature in g_shell_parse_argv() where it treats '#'
764 embedded in a filename as a comment marker, and throws away the
765 rest of the line. When we're directly opening URLs quote the
766 filename, to avoid this. Fixes bug 371567.
768 2008-03-25 Dick Porter <dick@ximian.com>
770 * wapi-private.h (_WAPI_HANDLE_VERSION): Increment file layout
773 * threads.c: Make thread handles private to the process that owns
776 2008-03-22 Kornél Pál <kornelpal@gmail.com>
778 * io-layer.h: Windows: Rename GetProcessId to __GetProcessId for targets not
779 supporting it. This fixes MSVC build with new Windows SDKs that declare
780 GetProcessId unconditionally.
782 2008-03-20 Kornél Pál <kornelpal@gmail.com>
784 * io-layer.h: Removed Windows version macros.
786 Thu Mar 13 16:24:53 CET 2008 Paolo Molaro <lupus@ximian.com>
788 * processes.c: properly check for executable files (fixes bug #368829).
790 2008-02-05 Dick Porter <dick@ximian.com>
792 * versioninfo.c (VerLanguageName): Implement VerLanguageName.
794 2008-01-31 Bill Holmes <billholmes54@gmail.com>
795 * processes.c (match_procname_to_modulename) : Added to check if the last
796 part of module name is equal to the process name.
798 * processes.c (EnumProcessModules) : Changed the first entry in the returned
799 modules array (the process module) to be populated from the entry found
802 * processes.c (get_module_name & GetModuleInformation) : In the case where
803 the module passed in is NULL, search the /proc/<PID>/maps for a name that
804 matches the process name to populate the return information.
808 2008-01-29 Zoltan Varga <vargaz@gmail.com>
810 * security.c (RevertToSelf): Make this return TRUE if impersonating is not
813 * sockets.c (_wapi_connect): Add a workaround to a solaris x86 problem where
814 getsockopt (SO_ERROR) doesn't return an error code after connect () fails. Fixes
817 2008-01-23 Dick Porter <dick@ximian.com>
819 * versioninfo.c (get_string_block): When stepping over the
820 StringTable block, do not read an extra block at the end. Fixes
821 the new part of bug 354856.
823 2008-01-19 Dick Porter <dick@ximian.com>
825 * versioninfo.c (get_stringtable_block): Cope when the StringTable
826 block is first in the resources data, and we just need to step
827 over it. Fixes bug 354856.
829 2008-01-16 Dick Porter <dick@ximian.com>
831 * threads.c (_wapi_thread_set_termination_details): Move the
832 thread abandonment to outside the shared handle lock. Fixes bug
835 2008-01-16 Dick Porter <dick@ximian.com>
837 * versioninfo.c (VerQueryValue): Include trailing null in returned
838 string length, for MS compatibility.
840 2008-01-09 Dick Porter <dick@ximian.com>
842 * versioninfo.c (get_ptr_from_rva, scan_resource_dir): Make it
843 work on big-endian systems.
844 (scan_resource_dir): Copy the resource directory entry and
845 byteswap if necessary so it works big-endian. This fixes bug
846 345972 for real this time.
847 (VerQueryValue): String values set the length to the number of
848 unicode chars, but the data length reported was already correct so
849 don't halve it again. Fixes the previous fix for bug 345972.
850 (GetFileVersionInfo): On big-endian systems, scan the resource
851 data and turn all unicode strings into UTF-16BE. FileVersionInfo
852 now works big-endian.
854 2008-01-04 Dick Porter <dick@ximian.com>
856 * versioninfo.c (VerQueryValue): Returned buffer length counts
857 chars not bytes for string data. Fixes bug 345972 again.
858 (get_enclosing_section_header): Make sure values read are treated
859 as LE. Fixes crash on ppc reported in bug 345972.
861 2007-12-17 Mark Probst <mark.probst@gmail.com>
863 * threads.c: Guard against a race condition involving
864 thread_hash_key that can occur during shutdown.
866 2007-12-08 Zoltan Varga <vargaz@gmail.com>
868 * processes.c: Include sys/mkdev.h if exists. Fixes solaris x86 build.
870 2007-12-06 Dick Porter <dick@ximian.com>
872 * versioninfo.c: Resource language values must be compared in a
873 'case'-insensitive manner. Fixes bug 345972.
875 2007-12-05 Dick Porter <dick@ximian.com>
877 * io.c (CreateFile): Create files with mode 0666 (&~umask) by
878 default. Fixes bugs 325299 and 337040.
880 2007-11-22 Dick Porter <dick@ximian.com>
882 * critical-sections.h (EnterCriticalSection): Reinstate the
883 asserts in the devel branch, so any problems aren't obscured.
885 2007-11-22 Dick Porter <dick@ximian.com>
887 * versioninfo.c (find_pe_file_resources): Make it work on 64bit
888 systems. Fixes bug 343353.
890 2007-11-21 Dick Porter <dick@ximian.com>
892 * processes.c (load_modules): Rewrite based on the libgc
893 /proc/<pid>/maps parsing to avoid using glib functions only
894 available since 2004.
895 (load_modules): Check for duplicates before adding a module to the
898 2007-11-15 Dick Porter <dick@ximian.com>
900 * processes.c (load_modules): Don't bother if we don't have
901 g_strsplit_set() and g_strv_length(). Allows building against old
903 (EnumProcessModules): Don't miss the first module returned by
906 2007-11-15 Dick Porter <dick@ximian.com>
908 * processes.c: Implement process module support by reading from
909 /proc if it's available.
912 * versioninfo.c: New functions to implement PE file version info
915 2007-11-08 Dick Porter <dick@ximian.com>
917 * critical-sections.h (EnterCriticalSection): Disable the critical
918 section asserts for the release branch
920 2007-11-05 Kornél Pál <kornelpal@gmail.com>
922 * io-layer.h: Added includes for run-time GetProcessId API detection for
925 2007-10-26 Dick Porter <dick@ximian.com>
927 * shared.c (_wapi_shm_file_open): Set the umask when opening
928 shared files, so restrictive defaults don't prevent subsequent
929 processes re-opening them.
931 2007-10-18 Zoltan Varga <vargaz@gmail.com>
933 * atomic.h (InterlockedCompareExchange): Fix the ia64 version so it works for
934 negative values too. Hopefully fixes #332700.
936 2007-09-26 Dick Porter <dick@ximian.com>
938 * io-portability.c (_wapi_io_scandir): Only update the error
939 status of glob() when performing a secondary glob() if the first
940 returned an error. Fixes bug 325107.
942 2007-09-12 Marek Habersack <mhabersack@novell.com>
944 * io-portability.c: options_init moved to
945 utils/mono-io-portability.c
946 Do not initialize portability helpers here, it's done in
948 find_file and find_in_dir moved to utils/mono-io-portability.c
950 2007-09-09 Robert Jordan <robertj@gmx.net>
952 * sockets.c (_wapi_setsockopt): Add support for FreeBSD multicast
953 sockets. Fixes #81891.
954 Code is contributed under MIT/X11 license.
956 2007-09-03 Atsushi Enomoto <atsushi@ximian.com>
958 * processes.h, processes.c : ok, they are simple string.
960 2007-09-03 Atsushi Enomoto <atsushi@ximian.com>
962 * processes.h : sigh, I really hate fixing them on windows :(
964 2007-09-03 Atsushi Enomoto <atsushi@ximian.com>
966 * processes.c : fix build again.
968 2007-09-03 Atsushi Enomoto <atsushi@ximian.com>
970 * processes.h : removed extra parameters from CreateProcessWithLogonW.
972 2007-09-03 Atsushi Enomoto <atsushi@ximian.com>
974 * processes.c, processes.h: added CreateProcessWithLogonW(). For now
975 it just calls CreateProcess().
976 * io-layer.h : CreateProcessWithLogonW() requires WINVER 0x0500
979 2007-08-23 Robert Jordan <robertj@gmx.net>
981 * processes.[c|h]: Implement Get|SetPriorityClass ().
982 Code is contributed under MIT/X11 license.
984 Tue Aug 21 20:08:09 CEST 2007 Paolo Molaro <lupus@ximian.com>
986 * io.c: made convert_arg_to_utf8() and write_file() static.
987 Worked around gcc's incorrect warning.
989 2007-08-20 William Holmes <billholmes54@gmail.com>
991 *io.c: Added implementation for ReplaceFile.
992 *io.h: Added deceleration for ReplaceFile method.
994 Code is contributed under MIT/X11 license.
996 2007-08-20 Wade Berrier <wberrier@novell.com>
998 * processes.c: include sys/resource.h for rusage to fix
1001 Mon Aug 20 12:36:42 CEST 2007 Paolo Molaro <lupus@ximian.com>
1003 * processes.c: implemented query for user/system times using
1006 2007-08-10 Dick Porter <dick@ximian.com>
1008 * sockets.c (_wapi_getsockopt, _wapi_setsockopt): Check the option
1009 level as well as the name when mangling some of the values. Fixes
1012 2007-08-02 Dick Porter <dick@ximian.com>
1014 * sockets.c: Changes in error handling, and move the SO_REUSEADDR
1015 setting from metadata/socket-io.c.
1017 2007-08-01 Dick Porter <dick@ximian.com>
1019 * io-portability.c (_wapi_io_scandir): Special-case patterns
1020 ending in '.*' so that files with no extension are also matched.
1024 * wapi_glob.c: Reinstate WAPI_GLOB_APPEND, and add
1025 WAPI_GLOB_UNIQUE to avoid matching the same entry twice when
1028 2007-07-26 Dick Porter <dick@ximian.com>
1030 * handles-private.h:
1033 * critical-sections.c:
1035 * critical-section-private.h:
1038 * error.c: Clean up TLS and pthreads structures. Finishes off bug
1041 * collection.c (collection_thread): Exit the collection thread if
1042 the io-layer has been cleaned up.
1044 * mono-mutex.h (mono_mutexattr_destroy): Add this define too
1046 Mon Jul 23 10:40:35 CEST 2007 Paolo Molaro <lupus@ximian.com>
1048 * timefuncs.c: make TickCount measure from boot time if it's
1051 2007-07-19 Juraj Skripsky <js@hotfeet.ch>
1053 * io.c (MoveFile): Fix a leak.
1055 Fri Jul 13 12:46:15 CEST 2007 Paolo Molaro <lupus@ximian.com>
1057 * handles-private.h, handles.c, thread-private.h, threads.c,
1058 uglify.h, wait.c: temporarily revert the alertable wait changes
1059 (r79386) until the deadlock issues are fixed.
1061 2007-06-22 Dick Porter <dick@ximian.com>
1063 * shared.c: The non-shared mutexes weren't being initialised properly
1064 on macos. Fixes bug 81929.
1066 2007-06-13 Randolph Chung <tausq@debian.org>
1068 * atomic.h: Enable for all hppa targets.
1069 * Makefile.am: rename hppa_atomic.s to hppa_atomic.S so the preprocessor
1070 can handle the file.
1071 * hppa_atomic.s: Renamed to ...
1072 * hppa_atomic.S: ... and updated to work on both HPUX and Linux.
1074 2007-06-13 Dick Porter <dick@ximian.com>
1076 * handles.c (timedwait_signal_wait_cond): Alertable waits on
1077 private handles are now interrupted by signalling the same
1078 condition that would end the wait if the handle became signalled,
1079 rather than polling. (Shared handles still have to poll.)
1081 * threads.c (_wapi_thread_queue_apc): Interrupt the thread if it's
1084 * handles-private.h (_wapi_handle_current_thread_set_waiting_on):
1085 Helper functions to inform the APC queuing functions when threads
1086 are waiting for handles, and to interrupt the wait.
1088 * wait.c (WaitForMultipleObjectsEx): Need to tell the handle
1089 waiting functions if any of the handles in question are shared
1091 2007-06-06 Miguel de Icaza <miguel@novell.com>
1093 * processes.c (is_managed_binary): Fix for OSX.
1095 2007-06-06 Wade Berrier <wberrier@novell.com>
1097 * atomic.h (InterlockedExchangePointer): cast to pointer to to silence
1098 compiler warnings (autobuild fails the build on this type of warning)
1100 2007-05-21 Dick Porter <dick@ximian.com>
1102 * io-portability.c (_wapi_g_dir_open): Don't propagate any errors
1103 from the second call to g_dir_open, preserve the original error if
1104 the second call still fails but clear the error if it succeeds.
1106 2007-05-10 Dick Porter <dick@ximian.com>
1108 * sockets.c (_wapi_recvfrom): Refine the fix to bug 75705 so EINTR
1109 isn't returned if the remote end shuts down cleanly. Fixes zmd
1110 and the second example in bug 75705.
1112 2007-04-26 Dick Porter <dick@ximian.com>
1114 * shared.c (_wapi_shm_semaphores_init): Need to check
1115 MONO_DISABLE_SHM in this entry point, as it's called before
1116 _wapi_shm_attach(). Fixes bug 81436.
1118 2007-04-24 Dick Porter <dick@ximian.com>
1120 * sockets.c (_wapi_recvfrom, socket_close): Force recvfrom() to
1121 error if the socket is closed while the receive is blocking.
1124 2007-04-13 Dick Porter <dick@ximian.com>
1127 * shared.c: Complete the reimplementation of disabling of shared
1128 memory, by not allocating sysv semaphores when shm disabling has
1129 been requested (either at compile time or run time.)
1131 * processes.c (CreateProcess): Don't synchronize locking across
1132 processes when forking, when shared memory has been disabled.
1134 2007-04-06 Andreas Faerber <andreas.faerber@web.de>
1137 * wapi_glob.c: remove reference to sys/cdefs.h, use glib instead.
1140 2007-04-05 Dick Porter <dick@ximian.com>
1143 * io-portability.c (_wapi_io_scandir): Moved from io.c, and
1144 changed to use a cut-down version of glob(3) that has been
1145 extended to match with case-insensitivity if needed.
1148 * wapi_glob.c: Cut down implementation of glob(3), based on
1151 2007-03-22 Dick Porter <dick@ximian.com>
1153 * sockets.c (_wapi_connect): Do additional checks when connect(2)
1154 fails, because some systems don't let it be restarted. Patch
1155 based on one submitted by Robert S Wojciechowski <robertw@ssgx.com>,
1158 2007-03-09 Jonathan Chambers <joncham@gmail.com>
1160 * io-layer.h: Remove UNICODE and _UNICODE defines as
1161 these are done by configure.in now.
1163 Code is contributed under MIT/X11 license.
1165 Thu Mar 8 19:42:17 CET 2007 Paolo Molaro <lupus@ximian.com>
1167 * shared.c: partial support for MONO_DISABLE_SHM env var.
1169 2007-03-05 Wade Berrier <wberrier@novell.com>
1171 * atomic.h: atomic fixes from Michael Matz for for s390
1172 and s390x ( bnc #237611 and bxc #80892 )
1174 2007-03-05 Miguel de Icaza <miguel@novell.com>
1176 * io.c (CreateFile): Use FILE_ATTRIBUTE_TEMPORARY to mean 0600
1177 permissions. For 80688
1179 (MoveFile): Use errno_copy here, just to avoid a potential
1180 errno-changing code in the future from g_free.
1182 Also, ignore EXDEV errors as they are handled immediately after
1183 (avoid printing out an error).
1187 Mon Feb 12 15:50:24 CET 2007 Paolo Molaro <lupus@ximian.com>
1189 * shared.c: exit if semaphores can't be created (bug #80616).
1191 2007-02-01 Geoff Norton <gnorton@customerdna.com>
1193 * collection.c: NetBSD doesn't define PTHREAD_STACK_MIN.
1195 2007-01-26 Dick Porter <dick@ximian.com>
1198 * sockets.c (_wapi_getsockopt): Windows seems to not reset
1199 SO_ERROR values when they're read, contrary to the documentation.
1200 Fixes the new issues raised in bug 79878 (example in C showing
1201 winsock behaviour attached to that bug.)
1203 2007-01-15 Mark Mason <mason@broadcom.com
1205 * atomic.h: add locking primitives for MIPS.
1207 2007-01-11 Dick Porter <dick@ximian.com>
1209 * sockets.c (_wapi_connect): Don't do the SO_BROADCAST setting
1210 here, do it in managed code instead.
1211 (_wapi_getsockopt): SO_RCVTIMEO and SO_SNDTIMEO use struct
1212 timeval, which has a microsecond field, not milliseconds.
1213 (_wapi_setsockopt): ditto.
1214 (_wapi_setsockopt): Halve the SO_SNDBUF and SO_RCVBUF values on
1215 Linux, as the kernel doubles whatever we set.
1216 (_wapi_socket): Save socket domain, type and protocol so it can be
1218 (socket_disconnect): Implement socket disconnect (closing the
1219 socket, but keeping the file descriptor.)
1220 (wapi_disconnectex): A basic implementation of DisconnectEx().
1221 (wapi_transmitfile): A very basic implementation of
1223 (WSAIoctl): Implement the SIO_GET_EXTENSION_FUNCTION_POINTER
1226 * socket-private.h (struct _WapiHandle_socket): Record socket
1227 domain, type and protocol info so it can be duplicated later.
1229 * sockets.h (WSAID_DISCONNECTEX,WSAID_TRANSMITFILE): Structures
1230 and defines needed to look up the DisconnectEx() and
1231 TransmitFile() functions by GUID.
1233 * error.c (errno_to_WSA): Change ETIMEDOUT mapping to
1234 WSAETIMEDOUT; add EDESTADDRREQ.
1236 * io-layer.h: Need mswsock.h on windows now.
1238 2007-01-04 Miguel de Icaza <miguel@novell.com>
1240 * io-portability.c (find_file): Fix a coverity warning (scanning
1243 2006-12-31 Miguel de Icaza <miguel@novell.com>
1245 * io-portability.c (find_file): Do not abort if an empty filename
1246 has been passed. This fixes the case where MONO_IOMAP=all would
1247 assert if Directory.Exists ("") was called.
1249 Mon Dec 18 14:54:37 CET 2006 Paolo Molaro <lupus@ximian.com>
1251 * processes.c: moved a free on the error path.
1253 Thu Dec 14 21:42:39 CET 2006 Paolo Molaro <lupus@ximian.com>
1255 * processes.c: fixed a few memory leaks when executing
1258 Mon Nov 27 13:12:17 GMT 2006 Paolo Molaro <lupus@ximian.com>
1260 * atomic.h: fix arm compare and exchange (bug #78500).
1262 2006-11-23 Dick Porter <dick@ximian.com>
1264 * process-private.h (struct _WapiHandle_process): Add 'waited'
1267 * processes.c (process_wait): Check the 'waited' parameter not the
1268 signalled state when testing if a process has already been waited
1269 for, as the child process itself may set signalled when exiting.
1272 * wapi-private.h (_WAPI_HANDLE_VERSION): Bump shared data version
1274 * shared.c: Now the shared data version has been incremented we
1275 can set the counter semaphore initial value correctly
1277 2006-11-22 Dick Porter <dick@ximian.com>
1279 * processes.c (process_wait): Cope when the background process
1280 reaper gets the process we were waiting for. Special case for
1281 waiting for our own process to exit. Fixes bug 77736.
1283 2006-11-17 Dick Porter <dick@ximian.com>
1285 * processes.c: Fix const correctness and typos that caused memory
1288 2006-11-17 Miguel de Icaza <miguel@novell.com>
1290 * processes.c (ShellExecuteEx): Check error after CreateProcess,
1291 thanks to Dick for pointing this out.
1293 2006-11-16 Miguel de Icaza <miguel@novell.com>
1295 * processes.c (ShellExecuteEx): If we fail to create a process in
1296 ShellExecute, then try to use the xdg-open command, and if that
1297 fails, try to use the gnome-open command,
1299 Refactor the code so that we do not have to duplicate all this
1300 code, but instead use a ucs2-aware version of the code to do
1303 2006-11-13 Dick Porter <dick@ximian.com>
1305 * io.c (_wapi_stat_to_file_attributes): If the file is a symlink
1306 add the FILE_ATTRIBUTE_REPARSE_POINT flag. This is an attempt to
1307 follow the specs for the windows symlink support, but will
1308 probably have to be reworked when I have test data from a vista
1309 machine. Fixes bug 79887.
1311 2006-11-11 Miguel de Icaza <miguel@novell.com>
1313 * handles.c (CloseHandle): Cope here with the new value
1314 INVALID_HANDLE_VALUE set on handles.
1316 * processes.c (CreateProcess): Initialize the value of hThread to
1317 be INVALID_HANDLE_VALUE on failure, not to be NULL. Improvement
1320 2006-11-09 Dick Porter <dick@ximian.com>
1322 * sockets.c (_wapi_select): Do some sanity checking on the
1323 fd_sets, to avoid file descriptors > FD_SETSIZE.
1324 (_wapi_FD_CLR, _wapi_FD_ISSET, _wapi_FD_SET): Avoid file
1325 descriptors > FD_SETSIZE.
1327 2006-10-27 Dick Porter <dick@ximian.com>
1329 * io.c (GetFileAttributes): Force symlinks to directories to be
1330 returned as a regular file. Fixes bug 79733.
1332 2006-10-18 Miguel de Icaza <miguel@novell.com>
1334 * io-portability.c (find_in_dir): First string dup, then closedir.
1336 2006-10-12 Dick Porter <dick@ximian.com>
1338 * processes.c (_wapi_process_reap): Unref a process handle if we
1339 reaped it, found by Zoltan. Fixes bug 79286.
1340 (process_wait): Don't wait again if we've already waited for a
1343 2006-10-11 Sergey Tikhonov <tsv@solvo.ru>
1345 * atomic.h: Fix atomic decrement.
1347 * mini/cpu-alpha.md: Use native long shift insts
1349 * mono/mono/mini/tramp-alpha.c: Implemented
1350 mono_arch_patch_delegate_trampoline method
1352 * Started work on using global registers
1354 * Use byte/word memory load/store insts if cpu supports it
1359 2006-10-09 Zoltan Varga <vargaz@gmail.com>
1361 * handles.c (timedwait_signal_poll_cond): Add an alertable parameter, and if it
1362 is FALSE, avoid busy waiting.
1364 * wait.c: Add an alertable parameter to the wait routines.
1366 2006-10-06 Miguel de Icaza <miguel@novell.com>
1368 * io-portability.c (find_file): Rename from
1369 MONO_IO_PORTABILITY_HELP to MONO_IOMAP.
1371 2006-10-03 Dick Porter <dick@ximian.com>
1374 * io-portability.c: Optional portability helpers and wrapped
1375 system calls to try to cope with windows filenames in
1378 * io.c: Use the wrapped system calls
1380 2006-09-01 Zoltan Varga <vargaz@gmail.com>
1382 * critical-sections.h critical-sections.c: Make Enter/LeaveCriticalSection a macro
1383 since they are perf critical.
1385 * atomic.h: Applied patch from Jakub Boqusz <qboosh@pld-linux.org>.
1386 Add atomic ops implementation for alpha.
1388 2006-08-11 Dick Porter <dick@ximian.com>
1390 * processes.c (_wapi_process_reap): Avoid a deadlock by setting
1391 process termination details in an outer loop, not the
1392 _wapi_search_handle() one.
1394 2006-08-10 Dick Porter <dick@ximian.com>
1396 * threads.c (_wapi_thread_queue_apc)
1397 (_wapi_thread_dispatch_apc_queue): Use a process-local mutex here
1398 instead of the cross process semaphore. We already check that
1399 access to the APC queue is within the owning process so there's no
1400 need to protect from other processes. Avoids a global deadlock
1401 when a thread is aborted while it holds the handle semaphore
1403 (_wapi_thread_apc_pending): Hide an annoying message which can
1404 happen if a thread handle has been blown away at process shutdown
1405 while it is in an alertable wait.
1407 Both problems seen while shutting down monodevelop.
1409 2006-07-25 Dick Porter <dick@ximian.com>
1411 * shared.c (_wapi_shm_file): Remove '/' characters from the uname
1412 results. Fixes bug 78917.
1414 2006-07-20 Dick Porter <dick@ximian.com>
1416 * threads.c (_wapi_thread_set_termination_details): Improve the
1417 test for already-disposed thread handles, and hold the lock around
1418 the mutex abandoning.
1420 2006-07-17 Dick Porter <dick@ximian.com>
1422 * processes.c (CreateProcess): Don't change directory unless a new
1423 one has been specified. Fixes bug 78751.
1425 2006-07-06 Dick Porter <dick@ximian.com>
1427 * io.c (_wapi_stat_to_file_attributes): Do a better job at
1428 figuring out the file attributes
1429 (_wapi_set_last_path_error_from_errno): New helper function to
1430 turn errno into w32 error codes that handles the differences
1431 between file and directory errors
1432 (file_setendoffile): Try turning off the extra write used to
1433 extend files, because we probably don't need it on any modern
1434 platform. If it is needed though, we also need to lseek the file
1436 (CreateFile): Treat character-special devices as a console handle,
1437 because they can't be seeked
1438 (CopyFile): If fail_if_exists is set, then the destination needs
1439 to be opened with O_EXCL
1440 (CopyFile): If fail_if_exists is not set and the destination
1441 already exists, then we should set the ERROR_ALREADY_EXISTS error
1442 even though we return success
1443 (stdhandle_create): STD_INPUT_HANDLES cannot be written to
1444 (GetStdHandle): Rework without using mono_once, so console handles
1445 can be properly closed and reopened.
1446 (mono_io_scandir): Only override errno with EACCES when the
1447 directory actually exists
1448 (FindFirstFile): Set ERROR_FILE_NOT_FOUND when no files are
1450 (FindClose): Cope with NULL handles
1451 (CreateDirectory): When the target already exists, just return an
1452 error. It's the caller's job to figure out what to do.
1453 (SetCurrentDirectory): Cope with a NULL path
1454 (RemoveDirectory, GetFileAttributes, GetFileAttributesEx,
1455 SetFileAttributes, FindFirstFile, DeleteFile, MoveFile, CopyFile,
1456 CreateFile): Set path error correctly
1458 * handles.c (CloseHandle): Kludge to try and cope with passing a
1461 * error.h: Add NO_ERROR as an alternative to ERROR_SUCCESS
1463 * uglify.h: Added some more typedefs
1465 2006-07-05 Dick Porter <dick@ximian.com>
1467 * io.c (GetFileAttributes, GetFileAttributesEx): Cope with
1468 dangling symlinks. Fixes bug 78664.
1470 2006-06-23 Dick Porter <dick@ximian.com>
1472 * handles.c (handle_cleanup):
1473 * threads.c: Clean up threads properly when we're forcibly
1474 removing the handle entries from the shared file in
1475 handle_cleanup(). Fixes bug 78241, for real this time.
1477 2006-06-15 Neale Ferguson <neale@sinenomine.net>
1479 * atomic.h: More tinkering with InterlockedExchange/InterlockedCompareExchange
1482 2006-06-14 Neale Ferguson <neale@sinenomine.net>
1484 * atomic.h: Fix atomic exchange pointer operations for s390x - these
1485 were broken as they used 32-bit instructions rather than their 64-bit
1488 2006-06-14 Dick Porter <dick@ximian.com>
1490 * processes.c: Don't run the atexit handlers when bailing out
1493 2006-06-14 Dick Porter <dick@ximian.com>
1495 * wait.c: Fix stupid typo shown up by gcc 4.1.1, = not ==
1497 * handles-private.h:
1503 * collection.c: Fix a bunch of signed/unsigned warnings from gcc
1506 2006-06-09 Neale Ferguson <neale@sinenomine.net>
1508 * atomic.h: Fix atomic operations for s390x (not really broken
1509 but changed to use full 64-bit opcodes).
1511 2006-05-24 Dick Porter <dick@ximian.com>
1513 * processes.c (process_set_current): Don't take an extra reference
1514 if we have to create our own process handle. Fixes bug 78241
1517 * threads.c (_wapi_thread_signal_self): Renamed from
1518 _wapi_thread_abandon_mutexes, also sets the thread state to
1519 signalled and drops a reference. Called by the runtime when the
1520 main thread cleans itself up.
1522 * handles.c (handle_cleanup): As a last resort, unref every shared
1523 handle as the process is now exiting.
1525 2006-05-16 Dick Porter <dick@ximian.com>
1527 * processes.c (process_set_termination_details): Unref the handle
1528 when we've stored the exit details. Fixes the rest of 78241.
1530 2006-05-12 Dick Porter <dick@ximian.com>
1532 * threads.c: Implement pseudo handles, making GetCurrentThread()
1533 match MS behaviour. Notice when attached threads exit, and unref
1534 the handle. Fix usage of GetCurrentThread() in other places.
1536 * handles.c (DuplicateHandle): Implement a basic form of
1539 * wait.c: Fix usage of GetCurrentThread() throughout, and cope
1540 with pseudo handles.
1542 2006-04-26 Miguel de Icaza <miguel@novell.com>
1544 * io.c (file_close): Oops, do not use DeleteFile which expects
1545 unicode, instead use unlink directly
1547 Add support for the new FileOptions bits on .NET 2.0.
1549 It might be good if Dick reviews these changes.
1551 * io.c (file_close): If DeleteOnClose is set, then delete the file
1553 (CreateFile): Do not support encryption per user.
1555 If posix_fadvise exists, pass hints on sequential scan and random
1556 access. Did not figure out what WRITE_THROUGH maps to.
1558 2006-04-26 Dick Porter <dick@ximian.com>
1560 * sockets.c (WSAIoctl): Check the output buffer is valid before
1563 * handles.c (_wapi_search_handle): Set shared pointer if we find a
1564 shared handle that has been already opened.
1566 2006-04-21 Dick Porter <dick@ximian.com>
1568 * threads.c (GetCurrentThread): Reference the handle if we return
1569 an already-known thread.
1571 2006-04-07 Dick Porter <dick@ximian.com>
1573 * processes.c: Fix build for older glib.
1575 2006-04-06 Dick Porter <dick@ximian.com>
1577 * processes.c (CreateProcess): Add a reference to the child
1578 process' handle, so it won't be destroyed if this process closes
1579 its copy of the handle. Fixes bug 77393.
1581 * processes.c (process_set_current): Fall through to creating a
1582 new one if the handle lookup fails.
1584 * processes.c (_wapi_process_signal_self):
1585 * handles.c (handle_cleanup): The process is exiting, so set the
1586 handle state for this process to signalled. This should let other
1587 non-related processes wait for this handle.
1589 * handles.c (_wapi_search_handle): Don't search shared handles in
1592 * collection.c (collection_thread): No need to do a collection
1593 scan straight away, do the waiting first.
1595 2006-04-06 Dick Porter <dick@ximian.com>
1597 * shared.c: Fix parameters in semctl () call.
1599 2006-03-28 Zoltan Varga <vargaz@gmail.com>
1601 * atomic.h atomic.c: Applied patch from David S. Miller
1602 <davem@davemloft.net>: Reimplement Interlocked* primitives on sparc
1603 using CAS/CASx when __GNUC__, else we will fall back to the generic
1606 2006-03-27 Dick Porter <dick@ximian.com>
1608 * shared.c (_wapi_shm_file_open): Break out of a loop if the
1609 shared file is smaller than expected. (We loop a few times in
1610 case another process is in the middle of creating the file.)
1612 2006-03-22 Dick Porter <dick@ximian.com>
1617 * shared.c: Delete the semaphores and shared files when the last
1618 process has finished with them
1620 2006-03-15 Dick Porter <dick@ximian.com>
1628 * threads.c: Explicitly initialise the handle ops struct
1630 2006-03-14 Dick Porter <dick@ximian.com>
1632 * handles-private.h:
1635 * handles.c: Add a 'prewait' stage to the handle waiting, to give
1636 waiting threads a chance to check for bogus states before
1639 * mutexes.c (namedmutex_prewait): Use the prewait stage to check
1640 for named mutexes that have been abandoned in a locked state (eg
1641 if a process exited abnormally while owning the mutex) and
1642 override it if needed.
1644 2006-03-08 Gonzalo Paniagua Javier <gonzalo@ximian.com>
1646 * wait.c: speed up WaitFor* when the timeout is 0.
1648 2006-03-03 Dick Porter <dick@ximian.com>
1650 * processes.c (ShellExecuteEx): Cope when some of the parameters
1653 2006-02-27 Dick Porter <dick@ximian.com>
1657 * threads.c: Comparing pthread_t with == is not portable, so use
1660 Thu Feb 23 18:47:20 GMT 2006 Paolo Molaro <lupus@ximian.com>
1662 * *.h, *.h: patch from Dick to make Linuxthreads systems work again.
1664 2006-02-22 Dick Porter <dick@ximian.com>
1667 * threads.c: There's no need to use the timed-thread support code
1668 any more, as we aren't using the timed join. This greatly
1669 simplifies thread setup, and fixes a memory leak (bug 77521).
1671 Don't bother to store thread IDs in a hash table, use TLS instead.
1672 The one case that needs to look up the handle of a different
1673 thread (OpenThread()) can do the extra work itself. Fixes bug
1676 * handles.c (_wapi_search_handle): Add a reference when returning
1677 a private handle (shared handles are already reffed.)
1679 2006-02-17 Dick Porter <dick@ximian.com>
1681 * handles-private.h:
1682 * handles.c: Check handle values passed to array lookups. Fixes
1685 2006-02-09 Dick Porter <dick@ximian.com>
1687 * threads.c: Cope with the problems caused by attaching already
1688 existing threads - they don't get the infrastructure to clean up
1689 after themselves, especially the ID to handle hash. This fixes
1692 2006-02-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
1694 * shared.c: use MONO_SHARED_HOSTNAME as a substitute for gethostname()
1695 when creating the shared files in the .wapi directory. Fixes bug #77371.
1697 2006-02-02 Martin Baulig <martin@ximian.com>
1699 * threads.c: Removed the `WITH_INCLUDED_LIBGC' section; it has
1700 never been used so far.
1702 * timed-thread.h (TimedThread): Removed the `stack_ptr' field; it
1703 has only been used by the removed code.
1705 2006-01-03 Neale Ferguson <neale@sinenomine.net>
1707 * atomic.h: Correct s390x definitions and eliminate compiler warnings.
1709 2006-01-03 Sebastien Pouliot <sebastien@ximian.com>
1711 * io.c: Patch _wapi_stat_to_file_attributes against bug #76966, where
1712 sockets could be considered as directory.
1714 2005-12-23 Dick Porter <dick@ximian.com>
1718 * semaphores.c: Implement OpenSemaphore
1721 * mutexes.h: Implement OpenMutex
1727 * event-private.h: Implement named events. Implement OpenEvent.
1729 2005-12-15 Dick Porter <dick@ximian.com>
1731 * processes.c (CreateProcess): The pipe-based cross-process
1732 exclusion technique was trying to write NULL buffers when appname
1733 was NULL (eg when coming from ShellExecuteEx,) which usually
1734 succeeded even though EFAULT was returned - but sometimes it
1735 failed. This meant that the child process could block forever on
1736 the pipe read. Replace it with the simpler shared handle
1737 semaphore protection used everywhere else. This showed up with
1738 the test case in bug 76684.
1740 Tue Dec 13 11:41:49 GMT 2005 Paolo Molaro <lupus@ximian.com>
1742 * shared.c: fallback to private mmap when shared mmap doesn't work
1745 2005-12-06 Dick Porter <dick@ximian.com>
1749 * semaphore-private.h:
1750 * semaphores.c: Implement named semaphores
1752 2005-11-24 Dick Porter <dick@ximian.com>
1754 * processes.c (GetProcessId): Implement GetProcessId()
1756 2005-11-17 Dick Porter <dick@ximian.com>
1759 * processes.c: Implement ShellExecuteEx as a wrapper around
1762 2005-11-11 Dick Porter <dick@ximian.com>
1764 * threads.c: Give mutex abandoning its own exported function, so
1765 it can be called when the runtime is cleaning up.
1767 * handles.c (_wapi_search_handle_namespace): Do a handle
1768 collection befre starting to check namespace strings, so that any
1769 stale cruft gets removed.
1771 2005-11-11 Dick Porter <dick@ximian.com>
1773 * threads.c: Move thread handles back into the shared space.
1775 * handles.c (_wapi_handle_unref): Add support for shared handles
1776 with close() handlers
1778 2005-11-04 Dick Porter <dick@ximian.com>
1780 * sockets.c (ioctlsocket): Use select instead of if to avoid a
1781 type promotion problem on 64bit freebsd. Based on patch by Lou
1782 Kamenov <kamenovl@gmail.com>, fixes bug 76447.
1784 2005-11-04 Dick Porter <dick@ximian.com>
1786 * io.c (file_write): Only do the file locking if
1787 MONO_STRICT_IO_EMULATION is set.
1789 2005-10-21 Dick Porter <dick@ximian.com>
1792 * handles.c (_wapi_lookup_handle): Cope when the shared part of a
1793 handle has been deleted.
1794 (_wapi_handle_unref): And when the deleted shared part is pointed
1795 to as a handle is deleted
1797 2005-10-20 Dick Porter <dick@ximian.com>
1799 * processes.c (process_set_current): If the expected process
1800 handle slot doesn't contain the correct pid, create a new handle.
1802 * handles.c (_wapi_search_handle): When the search doesn't find
1803 anything, return failure instead of the last handle we looked at.
1804 (_wapi_handle_ref, _wapi_handle_unref): Don't try to ref or unref
1805 unused handles (makes tracking refcounting bugs easier.)
1807 2005-10-19 Dick Porter <dick@ximian.com>
1810 * handles-private.h:
1814 * collection.c (_wapi_handle_collect): Remove the shared handle
1815 indirection layer, and use locking instead. Delete other
1816 complexity that is no longer needed. Refcount shared handles and
1817 delete them when needed, but keep the timestamps so that orphaned
1818 handles will be cleaned up eventually.
1820 * shared.c (_wapi_shm_file): Add processor, OS and struct size
1821 info to the shared file names, to cope with dual-boot and 32/64bit
1822 size issues. Fixes bug 75839.
1824 * wait.c (WaitForMultipleObjectsEx): No need to distinguish
1825 between shared handles and private, as the wait functions cope
1826 with both together now.
1828 2005-10-11 Gonzalo Paniagua Javier <gonzalo@ximian.com>
1830 * io.c: removed NO_SIGPIPE macro.
1831 * sockets.c: no need for MSG_NOSIGNAL or ignoring SIGPIPE.
1833 2005-10-11 Dick Porter <dick@ximian.com>
1835 * sockets.c (_wapi_getsockopt): Translate SO_ERROR results into
1838 * error.c (errno_to_WSA): Don't return a bogus error if someone
1839 asks to translate errno 0.
1841 2005-10-11 Dick Porter <dick@ximian.com>
1843 * handles.c: Fix several race conditions
1845 2005-10-11 Miguel de Icaza <miguel@novell.com>
1847 * io.c: no need to block SIGPIPE anymore, as it is ignored.
1849 2005-10-05 Dick Porter <dick@ximian.com>
1851 * threads.c (_wapi_thread_own_mutex, _wapi_thread_disown_mutex):
1852 Keep a reference to mutexes owned by threads, so they won't be
1853 destroyed prematurely. Fixes dotmsnclient crash.
1855 2005-09-26 Sebastien Pouliot <sebastien@ximian.com>
1857 * io.c: Apply patch from #76192 (Can't write files past 2gb on AMD64
1858 (x86_64)) for Brion on IRC (Dick approved it).
1860 2005-09-23 Dick Porter <dick@ximian.com>
1862 * processes.c: Don't wait for processes that have already been
1863 signalled; also fix typo.
1865 * handles.c: Improve locking inside new handle and handle
1866 searching functions.
1868 2005-09-20 Dick Porter <dick@ximian.com>
1871 * processes.c: Periodically waitpid for known process IDs. Fixes
1874 2005-09-15 Gonzalo Paniagua Javier <gonzalo@ximian.com>
1877 (CreateFile): if the file is a named pipe, treat the handle as a pipe,
1878 not as a file. Fixes bug #76075.
1880 2005-08-27 Zoltan Varga <vargaz@gmail.com>
1882 * atomic.h: Add support for intel icc.
1884 2005-08-25 Zoltan Varga <vargaz@gmail.com>
1886 * io-layer.h: Include winbase.h not WinBase.h.
1888 2005-08-19 Dick Porter <dick@ximian.com>
1890 * threads.c, threads.h, thread-private.h: Use a gsize to store the
1891 thread ID, so it can hold a 64 bit value if needed.
1893 2005-07-26 Gonzalo Paniagua Javier <gonzalo@ximian.com>
1895 * error.c: map ENOENT to WSAECONNREFUSED. It might happen when
1896 connecting to unix sockets. Closes bug #75632.
1898 2005-07-05 Dick Porter <dick@ximian.com>
1900 * io.c: Make sure SIGPIPE is ignored when calling write(2).
1901 Prevents the runtime exiting when writing to a closed pipe,
1904 2005-06-30 Dick Porter <dick@ximian.com>
1906 * shared.c (_wapi_shm_semaphores_init): Add some helpful error
1907 messages when semget () fails due to lack of resources.
1909 2005-06-21 Dick Porter <dick@ximian.com>
1914 * threads.c: Keep a list of owned mutexes in each thread handle,
1915 so that it is easier to abandon them when the thread exits.
1916 Removes a bottleneck when multiple threads are finishing in
1919 2005-06-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
1921 * io.c: (GetLogicalDrives) when a bogus line is read, don't leak memory.
1922 When the buffer has not enough space, close the file before returning.
1924 2005-06-09 Duncan Mak <duncan@novell.com>
1926 * *.h: Added G_BEGIN_DECLS and G_END_DECLS where appropriate to
1927 all public headers. Fixes #74919.
1929 2005-05-30 Zoltan Varga <vargaz@freemail.hu>
1931 * atomic.h: Add IA64 atomic ops.
1933 2005-05-26 Gonzalo Paniagua Javier <gonzalo@ximian.com>
1935 * processes.c: make ExitCode be valid even if the user didn't call
1936 WaitForExit() and is just polling on HasExited.
1938 2005-05-17 Dick Porter <dick@ximian.com>
1940 * io.c (file_getfilesize): Clear the error value, so that files
1941 with sizes with the low bits 0xFFFFFFFF can be distinguished from
1944 2005-05-11 Gonzalo Paniagua Javier <gonzalo@ximian.com>
1946 * shared.c: forgot to ignore a warning.
1948 2005-05-10 Gonzalo Paniagua Javier <gonzalo@ximian.com>
1950 * shared.c: don't display warnings after reboots.
1952 2005-05-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
1954 * sockets.c: on windows, getsockopt/setsockopt for send/receive timeout
1955 use an integer in milliseconds. We were using a struct timeval.
1957 2005-05-06 Dick Porter <dick@ximian.com>
1959 * handles-private.h:
1966 * collection.h: Use SysV semaphores for managing access to the
1967 shared memory - in return for the ludicrous api we get
1968 synchronisation primitives that can be cleaned up by the kernel
1969 even when a process quits unexpectedly. This removes the
1972 2005-05-05 Lluis Sanchez Gual <lluis@novell.com>
1974 * handles.c: Always use polling in the waits, since
1975 mono_cond_timedwait can't be interruped by the thread abort signal.
1977 2005-04-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
1979 * events.c: calling Set on AutoResetEvent several times has the same
1980 effect as calling it only once if no thread is waiting for it.
1982 2005-04-29 Dick Porter <dick@ximian.com>
1984 * processes.c (EnumProcesses): Use a GArray instead of a GPtrArray
1985 now it's storing pids not handles, also fixes memory leak caused
1986 by unclear glib documentation.
1988 * sockets.c (WSACleanup): Remove unused variable
1990 2005-04-29 Dick Porter <dick@ximian.com>
1992 * handles.c (_wapi_handle_check_share_by_pid): For systems that
1993 don't have file descriptor info in /proc check that the original
1994 opener of a file is still there, if a share violation would
1997 2005-04-28 Gonzalo Paniagua Javier <gonzalo@ximian.com>
2000 * handles-private.h: added _wapi_handle_forecch that loops through all
2001 the handles and call a callback function when a handle of the given
2004 * sockets.c: no need to keep open sockets in an array, as we have them
2005 in the handles structure.
2009 2005-04-28 Dick Porter <dick@ximian.com>
2011 * processes.c: Cope with handles that are only around for as long
2012 as the search is running. If we're searching for process handles,
2013 check to see if the process is still running and signal it if not.
2015 * handles.c (_wapi_search_handle): Search in the shared space as
2016 well. Fixed bug 74752.
2019 * handles.c (_wapi_handle_new_from_offset):
2020 _wapi_handle_new_for_existing_ns () was doing exactly the same as
2021 this, so deleted it.
2023 2005-04-26 Dick Porter <dick@ximian.com>
2025 * handles.c: Fix stupid thinko where if a new shared handle is
2026 created but a collection was needed to free some space, it
2027 returned an error anyway. Should fix the messages shown in bug
2030 2005-04-25 Dick Porter <dick@ximian.com>
2032 * handles.c (_wapi_handle_check_share): Only consider mono
2033 processes when looking to see if a file is still being held open,
2034 while checking share permissions.
2036 2005-04-25 Dick Porter <dick@ximian.com>
2040 * wapi-private.h (struct _WapiHandleOps):
2041 * handles.c (_wapi_handle_unref): When destroying handles, save
2042 the handle data and call the close function only after the array
2043 slot has been cleared. This prevents race conditions with file
2044 descriptors, fixing bug 74713.
2046 * mutexes.c: Delete the handle close functions, they didn't do
2049 * error.c (_wapi_get_win32_file_error): Add a mapping for EINTR so
2050 the "Unknown error" g_warning doesn't get displayed.
2052 2005-04-25 Dick Porter <dick@ximian.com>
2055 * threads.c: Make thread handles process-private for now to take
2056 some of the space pressure off the shared memory, while I work on
2059 2005-04-21 Dick Porter <dick@ximian.com>
2061 * handles.c (_wapi_handle_check_share): Make sure there is a "fd"
2062 dir in /proc before blowing away handle info. Fixes bug 74649.
2064 2005-04-21 Dick Porter <dick@ximian.com>
2066 * wait.c (WaitForMultipleObjectsEx): Implement special waits
2068 * handles.c (_wapi_handle_wait_signal_poll_share): Don't return a
2069 timeout, just wait briefly for the private signals and let the
2070 waiting thread test again. This prevents us missing shared
2073 2005-04-21 Dick Porter <dick@ximian.com>
2075 * collection.h (_WAPI_HANDLE_COLLECTION_EXPIRED_INTERVAL): Reduce
2076 the time before a slot is considered too old and deleted. This is
2077 a workaround while I come up with a proper fix.
2079 2005-04-21 Dick Porter <dick@ximian.com>
2084 * handles.c (_wapi_handle_new): Turn assertions into errors.
2086 * collection.c (_wapi_handle_collect): Use symbols not magic
2087 numbers for timeout values
2089 2005-04-19 Dick Porter <dick@ximian.com>
2093 * handles.c (_wapi_handle_count_signalled_handles)
2094 * handles-private.h (_wapi_handle_shared_lock_handle): Use new
2095 shared handle locks in critical sections.
2097 * handles.c (_wapi_handle_new_for_existing_ns): Reuse old handles
2098 if there is already one there.
2100 * handles.c (_wapi_handle_ref): It was possible for a process to
2101 exit before getting around to updating shared handle timestamps,
2104 Tue Apr 19 16:25:47 CEST 2005 Paolo Molaro <lupus@ximian.com>
2106 * threads.c: fix lookup of the thread id in the has table:
2107 always use the id value, not the pointer to the id.
2109 2005-04-18 Gonzalo Paniagua Javier <gonzalo@ximian.com>
2111 * handles.c: fix handle returned in _wapi_handle_search_handle. Dick
2114 2005-04-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
2116 * io-layer/sockets.c: FIONBIO with a TRUE argument means we want
2117 non-blocking IO, not the other way around.
2119 2005-04-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
2123 * handles-private.h: GetFileType wasn't checking if we have memory
2124 allocated for the handle before dereferencing it. Fixes a FileStream
2127 2005-04-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
2131 * handles-private.h: we were calling g_renew to expand the handle array,
2132 but that might move the memory and we might have pthread conditions or
2133 mutexes in the original memory area that are being used. Now instead of
2134 expanding an existing array, we just create new ones and keep a list of
2135 them. Access to _wapi_private_handles had to be modified accordingly.
2137 2005-04-15 Dick Porter <dick@ximian.com>
2139 * collection.c: FreeBSD needs more than PTHREAD_STACK_MIN
2141 2005-04-14 Raja R Harinath <rharinath@novell.com>
2143 * wapi-private.h: Remove reference to 'daemon-private.h'.
2145 Wed Apr 13 13:12:33 EDT 2005 Paolo Molaro <lupus@ximian.com>
2147 * atomic.h: applied patch from mass@akuma.org (David Waite)
2148 to fix InterlockedExchangeAdd.
2149 Fixed a few other functions, including InterlockedCompareExchange()
2150 which was miscompiled by gcc with optimizations enabled.
2152 2005-04-13 Dick Porter <dick@ximian.com>
2154 * io.c (share_check):
2155 * handles.c (_wapi_handle_check_share): Refine the file check so
2156 that sharing violations within the same process don't cause
2159 2005-04-13 Dick Porter <dick@ximian.com>
2161 * io.c (FindFirstFile): Fix bugs introduced with the merge (bug
2164 2005-04-12 Dick Porter <dick@ximian.com>
2166 The daemon-less io-layer. Extensive lowlevel changes in
2167 handles.c, requiring some corresponding changes in other files
2168 calling these functions. Private_foo structures have been
2171 File descriptor handling differences account for most of the
2172 changes in io.c and sockets.c.
2176 * mutexes.c: Named mutexes are now a distinct type.
2177 * atomic.h: Fix a PPC uninitialised variable warning.
2178 * wait.c: Check conditions before waiting on a condition variable.
2179 * processes.c: Handle process fork and wait without a daemon
2180 (though this has the limitation of only being able to wait for
2183 2005-04-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
2190 * sockets.h: removed dead code that deals with async IO.
2192 2005-03-30 Zoltan Varga <vargaz@freemail.hu>
2194 * atomic.c (InterlockedIncrement): Fix fallback implementation of
2195 InterlockedIncrement and InterlockedDecrement. Fixes #74228.
2197 2005-03-29 Sebastien Pouliot <sebastien@ximian.com>
2199 * io-layer.h: Add required header files for compiling with VS.NET.
2201 2005-03-17 Miguel de Icaza <miguel@novell.com>
2203 * io.c: don't fail on NFS when there are no more locks available.
2205 2005-03-09 Dick Porter <dick@ximian.com>
2207 * error.c (_wapi_get_win32_file_error): ENFILE and EMFILE should
2208 map to ERROR_TOO_MANY_OPEN_FILES, not ERROR_NO_MORE_FILES. Fixes
2211 2005-03-09 Dick Porter <dick@ximian.com>
2213 * daemon.c (process_process_fork): Initialise the handle data
2214 before using it in the error case. This is probably the error
2215 we're working around in the previous change. Spotted by Taru Jain
2216 <tjain@novell.com> and Hemanth Yamijala <YHemanth@novell.com>.
2218 2005-03-07 Dick Porter <dick@ximian.com>
2220 * daemon.c: It looks like g_shell_parse_argv() can return
2221 argv[0]=NULL somehow, yet still not give an error. Make sure we
2222 don't pass NULL to strrchr(), working around a segfault that
2223 showed up on ZLM testing.
2225 2005-03-01 Gonzalo Paniagua Javier <gonzalo@ximian.com>
2227 * sockets.c: translate EINPROGRESS to EWOULDBLOCK in connect. This is
2228 the expected error code showed by the test case in bug #73053.
2230 2005-02-18 Gonzalo Paniagua Javier <gonzalo@ximian.com>
2232 * io.c: another leftover.
2234 Fri Feb 18 17:37:29 CET 2005 Paolo Molaro <lupus@ximian.com>
2236 * io.c: fixed logic in checking errno in rev 40815.
2238 Fri Feb 18 16:00:29 CET 2005 Paolo Molaro <lupus@ximian.com>
2240 * threads.c: we don't depend on the GC checking tls
2242 * processes.c: remove unused ref to GC headers.
2244 Thu Feb 17 19:57:11 CET 2005 Paolo Molaro <lupus@ximian.com>
2246 * io.c: remove _wapi_thread_cur_apc_pending () checks
2247 when the siscall should return immediatly and handle
2248 the case when a syscall is interrupted without
2249 erroring out, but returning a 0 read/write if possible.
2250 Still the cases of read from file need to be handled.
2252 Tue Feb 8 18:28:11 CET 2005 Paolo Molaro <lupus@ximian.com>
2254 * threads.c: make people test with 1 MB stack per thread.
2256 2005-01-17 Dick Porter <dick@ximian.com>
2258 * timefuncs.h: Make WapiFileTime endian-aware, as it's often
2259 cast to and from 64bit ints. Fixes bug 71213.
2261 2005-01-11 Dick Porter <dick@ximian.com>
2263 * error.c (errno_to_WSA): Add EADDRNOTAVAIL error code
2266 Mon Jan 10 16:15:19 EST 2005 Neale Ferguson <nealeferguson@earthlink.net>
2268 * atomic.h: Fix functions on s390.
2270 Mon Jan 10 20:30:19 CET 2005 Paolo Molaro <lupus@ximian.com>
2272 * atomic.h: fix some functions on ppc (tests/interlocked.cs).
2274 2005-01-10 Dick Porter <dick@ximian.com>
2276 * misc.c (_wapi_calc_timeout): Guard against overflow when
2277 calculating timeouts. This makes waiting with a large
2278 (Int32.MaxValue) timeout not return immediately.
2280 2004-12-23 Ben Maurer <bmaurer@ximian.com>
2282 * io.c (io_ops): make this `const' so it is shareable (well, only
2283 really shareable if it is statically linked...)
2285 Mon Dec 20 11:58:33 CET 2004 Paolo Molaro <lupus@ximian.com>
2287 * threads.c, threads.h: add accessor to get the pthread_key_t for
2290 2004-12-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
2292 * io.c: check for the existence of 'dest' and set ERROR_ALREADY_EXISTS
2293 if it exists and is not the same as 'src'.
2295 2004-12-01 Neale Ferguson <Neale.Ferguson@SoftwareAG-usa.com>
2297 * atomic.h : Fix InterlockedCompareExchange for s390/s390x.
2299 2004-12-01 Gonzalo Paniagua Javier <gonzalo@ximian.com>
2301 * processes.c: unquote the cmd path, allow for ' or " when quoting and
2302 pass the quoted program name to the daemon, otherwise the call to
2303 g_shell_unquote in the daemon will break things up.
2305 2004-10-14 Dick Porter <dick@ximian.com>
2307 * sockets.c (_wapi_accept): Revert the previous change. We now
2308 set the accepted socket to have the same blocking status as the
2309 listening socket in managed code. This follows MS behaviour.
2311 2004-10-14 Dick Porter <dick@ximian.com>
2313 * sockets.c (_wapi_accept): On Darwin, make sure a newly
2314 accept()ed socket is blocking. Fixes bug 67355, patch by
2315 grompf@sublimeintervention.com.
2317 2004-10-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
2319 * system.c: check the number of online processors instead of the
2320 existing ones. Sanitize return value if it's an error.
2322 2004-10-03 Ben Maurer <bmaurer@ximian.com>
2324 * system.c: Add support for getting the # of cpus.
2326 2004-09-28 Dick Porter <dick@ximian.com>
2328 * io.c (pipe_close_private): Fix one small typo in the last change
2329 that totally hosed process creation with redirected pipes.
2331 2004-09-24 Dick Porter <dick@ximian.com>
2338 * handles-private.h: Cope when a file descriptor is reused while
2339 the handle that thought it owned it is still referenced, instead
2340 of asserting. Probably fixes bug 66479, though we've been unable
2343 2004-09-09 Dick Porter <dick@ximian.com>
2346 * io.c: Set error codes everywhere.
2348 2004-09-06 Dick Porter <dick@ximian.com>
2350 * handles.c (_wapi_handle_unref): Reset the private record's type
2351 (CloseHandle): Check for a fd mapping failure, and return FALSE.
2352 (_wapi_handle_process_fork): Fix long-standing bug in checking
2353 handle return values. Also do the required bookkeeping with the
2354 new process's handles.
2356 * daemon.c: When creating a new process's handles, check whether
2357 the shared space needs to be increased
2359 2004-09-05 Zoltan Varga <vargaz@freemail.hu>
2361 * shared.c (_wapi_shm_file): Fix leaking of filename.
2363 2004-08-19 Dick Porter <dick@ximian.com>
2365 * handles.c (_wapi_handle_count_signalled_handles): Fix thinko
2366 introduced with the fd offset stuff: unlock handles properly when
2367 backing off. Fixes the monologue hang at exit.
2369 2004-08-18 Dick Porter <dick@ximian.com>
2372 * io.c: Check that new fds fit in the table, return error if not
2374 * daemon.c (_wapi_daemon_main):
2375 * handles.c (shared_init): Have all processes agree on a size for
2378 2004-08-17 Dick Porter <dick@ximian.com>
2380 * daemon.c (process_new):
2381 * handles.c (_wapi_handle_new_internal): Cope when the space
2382 reserved for file descriptors is larger than the shared segment
2383 size. Fixes the crash reported when running mono under gdb on
2386 2004-08-16 Dick Porter <dick@ximian.com>
2390 * handles-private.h (_wapi_handle_fd_offset_to_handle): Improve
2391 error checking with passed-in file descriptors.
2393 2004-08-11 Dick Porter <dick@ximian.com>
2396 * io.c: Returned handle values are the file descriptor the handle
2400 * handles-private.h:
2401 * daemon.c: Reserve the range of handles that can have the same
2402 values as file descriptors. These won't be used, but the values
2403 will be used as file, console, pipe or socket handles. The fd to
2404 handle mapping is done internally and is invisible to users.
2407 * wapi-private.h (_WAPI_HANDLE_VERSION): Increment, because we now
2408 reserve a chunk of handle space.
2410 2004-08-04 Neale Ferguson <Neale.Ferguson@SoftwareAG-usa.com>
2412 * atomic.h: add support for 64-bit S/390
2414 2004-07-22 Dick Porter <dick@ximian.com>
2417 * threads.c: Move the destruction of the internal thread data to
2418 after the thread has been joined. Fixes bug 61418.
2420 2004-07-14 Dick Porter <dick@ximian.com>
2422 * wait.c (test_and_own): When not waiting for all handles to
2423 become signalled, only own and return the lowest. All the
2424 documentation suggests that the old way was correct, but
2425 experimentation shows it actually works like this. Patch by
2426 Sébastien Robitaille
2427 (sebastien.robitaille@croesus.com), fixes bug 61511.
2429 2004-07-09 Ben Maurer <bmaurer@ximian.com>
2431 * threads.c: register roots for gc
2433 2004-07-08 Dick Porter <dick@ximian.com>
2435 * io.c (file_seek): If there is a high 32bit offset part, make
2436 sure the low part isn't sign-extended. Set error codes when
2437 returning failure. Fixes bug 61131.
2439 2004-07-06 Dick Porter <dick@ximian.com>
2441 * io.c (file_setfiletime): Check for underflow when converting to
2442 time_t values. Set error codes when returning failure. Fixes bug
2445 2004-07-05 Dick Porter <dick@ximian.com>
2447 * mutexes.c (mutex_ops_init): Make the named mutex mutex sharable.
2449 * daemon.c (unref_handle): Only destroy a handle if all processes
2450 have released it, not just the current one. Fixes bug 60887.
2452 2004-06-30 Zoltan Varga <vargaz@freemail.hu>
2454 * mono-mutex.h atomic.h: Add G_GNUC_UNUSED to static inline functions
2455 to prevent warnings.
2457 2004-06-24 Dick Porter <dick@ximian.com>
2459 * mutexes.c: Indicate when a named mutex was reused
2461 2004-06-24 Dick Porter <dick@ximian.com>
2463 * threads.c (SuspendThread):
2464 * timed-thread.c (_wapi_timed_thread_suspend): Wrap sem_wait in a
2465 while loop. See bug 58161.
2467 Wed Jun 23 23:29:04 CEST 2004 Paolo Molaro <lupus@ximian.com>
2469 * io.c: don't use sharemode for on-disk file permissions: it's used
2470 for shared access to the open file.
2472 2004-06-22 Dick Porter <dick@ximian.com>
2474 * events.c (CreateEvent): When creating an auto-reset event that
2475 is initially owned, make sure the set count starts at 1.
2477 2004-06-18 Dick Porter <dick@ximian.com>
2480 * events.c: Auto-reset events need to release one thread for each
2481 time SetEvent() is called. Fixes bug 41292.
2485 * mutexes.c: Scan for mutexes that are still locked by a thread
2486 when it exits. Fixes the MS demo app linked by bug 41292.
2488 * wait.c (test_and_own): Make sure a handle is signalled before it
2491 2004-06-16 Dick Porter <dick@ximian.com>
2493 * timed-thread.c: Call the thread cleanup exit routine before taking
2494 the join mutex, because this could deadlock if another thread tries
2495 to join in the meantime. This fixes the hang-at-exit problem seen
2498 2004-06-03 Lluis Sanchez Gual <lluis@ximian.com>
2500 * threads.c: Implemented SleepEx.
2501 * threads.h: Fixed SleepEx signature.
2503 2004-06-03 Miguel de Icaza <miguel@ximian.com>
2505 * threads.c: When running under valgrind, do not allocate too much
2506 stack, as Valgrind default is 1 meg.
2508 2004-05-27 Dick Porter <dick@ximian.com>
2511 * io.c: Implemented LockFile() and UnlockFile()
2513 2004-05-21 Dick Porter <dick@ximian.com>
2515 * io.c (CreateFile): Check for existing share modes when opening
2519 * handles-private.h:
2520 * daemon-messages.h:
2521 * daemon.c: Maintain a hash of file share modes, keying on device
2522 and inode (to cope with symlinks.)
2524 2004-05-20 Lluis Sanchez Gual <lluis@ximian.com>
2526 * daemon-messages.c: Retry if the communication with the daemon is
2527 interrupted by a signal.
2528 * io.c, sockets.c: Check for EINTR in every syscall that can be interrumped.
2529 Only return an error in this case if there is something in the apc queue
2530 (which means that it is an interruption requested by the "user").
2531 * processes.c: Use WaitForSingleObjectEx. No need to pass "alertable" as
2532 true since the wait is small.
2533 * shared.c: Retry write calls when interrumped by a signal.
2534 * timed-thread.h, timed-thread.c: added _wapi_thread_apc_pending, which
2535 returns TRUE if there are pending asynchronous calls (APC) for the
2536 provided thread. Also added _wapi_thread_dispatch_apc_queue which calls
2537 the enqueued APCs. Defined a new struct ApcInfo that holds information
2538 about an enqueued APC.
2539 * thread-private.h, threads.c: Implemented QueueUserAPC (which does the same
2540 as in win32),_wapi_thread_apc_pending and _wapi_thread_dispatch_apc_queue.
2541 These last two methods call the corresponding apc methods in
2542 thread-private using the provided thread handle.
2543 * threads.h: Added QueueUserAPC.
2544 * uglify.h: Added WapiApcProc (needed by QueueUserAPC).
2545 * wait.c, wait.h: Changed WaitForSingleObject to WaitForSingleObjectEx, and
2546 WaitForMultipleObjects to WaitForMultipleObjectsEx. Implemented support
2547 for APCs in those two methods and also in SleepEx.
2549 2004-05-17 Dick Porter <dick@ximian.com>
2551 * io.c (CopyFile): Speed up. Fixes bug 57859.
2553 2004-05-13 Dick Porter <dick@ximian.com>
2554 * mono-mutex.c (mono_mutex_unlock): Return EPERM when the current
2555 thread doesn't own the mutex, rather than assert()ing.
2557 2004-05-11 Dick Porter <dick@ximian.com>
2559 * shared.c (_wapi_shm_attach): Cope when a previous daemon startup
2560 attempt failed, leaving shared files that look like a daemon is
2563 2004-05-10 Gonzalo Paniagua Javier <gonzalo@ximian.com>
2566 (SetFileAttributes): don't the the exec bit if the corresponding read
2569 2004-05-10 Zoltan Varga <vargaz@freemail.hu>
2571 * io.c (FindFirstFile): Fix invalid free.
2573 2004-05-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
2575 * io.c: translate from GFileError to errno codes and don't free
2576 variables right after calling mono_io_scandir, as we may overwrite
2579 2004-05-08 Gonzalo Paniagua Javier <gonzalo@ximian.com>
2581 * io.c: g_dir_open return ENOENT for directories on which we don't have
2582 read/execute permission, while returning EPERM for anything below those.
2583 So, change ENOENT by EPERM if the directory exists.
2585 2004-05-07 Dick Porter <dick@ximian.com>
2587 * io.c (SetFileAttributes): Don't have failed chmod()s cause a
2588 "file not found" error. Fixes bug 54032.
2590 2004-05-07 Dick Porter <dick@ximian.com>
2592 * io.c (FindFirstFile): Comment out a windows-compatibility check
2593 that breaks when directories have metachars in their names.
2594 Workaround for bug 58116.
2596 2004-05-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
2598 * io.c: fixed for FindFirstFile for empty directories. Closes
2601 2004-05-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
2603 * processes.c: set the start time for the current process. Fixes bug
2606 2004-05-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
2608 * io-private.h: 'namelist' is now a gchar ** in _WapiHandlePrivate_find.
2609 * io.c: implemented scandir using glib functions.
2611 2004-05-04 Dick Porter <dick@ximian.com>
2613 * daemon.c (read_message): Return FALSE on error so the GSource
2614 callback itself can return FALSE. Cures the infinite loop poll()
2616 * shared.c: Fix some daemon startup race conditions.
2618 2004-04-29 Miguel de Icaza <miguel@ximian.com>
2620 * io.c (CopyFile): Use 32k buffers to copy the file instead of 2k,
2621 use the stack, do not use dynamic memory.
2623 2004-04-29 Zoltan Varga <vargaz@freemail.hu>
2625 * io.c: Add scandir implementation for platforms which do not have
2628 2004-04-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
2630 * io.[ch]: implemented GetLogicalDriveStrings.
2632 2004-04-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
2635 * sockets.c: use the field name from configure when accessing sigval
2636 pointer field. Makes this work on the Mac.
2638 2004-04-28 Bernie Solomon <bernard@ugsolutions.com>
2640 * atomic.c: (InterlockedExchange) fix typo for
2643 2004-04-28 Gonzalo Paniagua Javier <gonzalo@ximian.com>
2646 * sockets.c: added check for sys/aio.h.
2648 2004-04-28 Gonzalo Paniagua Javier <gonzalo@ximian.com>
2650 * error.[ch]: added _wapi_get_win32_file_error...
2651 * io.c: ... which was _wapi_get_win32_error here.
2652 * sockets.c: rename the function calls here too.
2654 2004-04-28 Dick Porter <dick@ximian.com>
2656 * daemon-messages.c: Avoid a deadlock when a thread is killed while
2657 waiting for the daemon by using a recursive mutex. Helps bug 56699.
2659 2004-04-28 Gonzalo Paniagua Javier <gonzalo@ximian.com>
2661 * io.c: fixed leak in async_notifier().
2663 * sockets.[ch]: added AIO support for sockets and fixed WSAIoctl
2666 * threads.c: removed old comment.
2668 2004-04-26 David Waite <mass@akuma.org>
2670 * daemon-messages.h:
2677 * wapi-private.h: remove comma from end of enumeration declarations
2678 * status.h: cast unsigned int types to int for enum assignment
2680 2004-04-26 David Waite <mass@akuma.org>
2683 * timefuncs.c: declare 64-bit constants as long long types (i.e.
2686 2004-04-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
2688 * socket-wrappers.h: _wapi_socket == WSASocket now. Added
2689 WSA_FLAG_OVERLAPPED.
2691 * sockets.c: new unused parameters for _wapi_socket.
2693 2004-04-22 Miguel de Icaza <miguel@ximian.com>
2695 * timed-thread.c: Replace sem_init with MONO_SEM_INIT to handle
2696 the fact that MacOS X is a piece of junk (sem_init is *defined* in
2697 the libc, but they return `not implemented').
2699 2004-04-22 Dick Porter <dick@ximian.com>
2702 * handles-private.h: Reference the handle when it is locked, so
2703 that another thread can't blow it away while we're waiting for it
2704 to become signalled.
2715 * handles-private.h:
2718 * daemon-messages.c:
2719 * critical-sections.c:
2720 * atomic.c: Added pthreads cleanup handlers and error asserts
2723 * handles.c: Fixed the gcc "variable might be used uninitialised"
2724 warnings. They can't happen, but gcc doesn't know that
2725 g_assert()s don't return.
2727 Fixed the declaration of _wapi_handle_process_kill() so that it
2728 expects the correct type for the pid.
2730 * threads.c: Removed the TLS_PTHREAD_MUTEX style locking that
2731 hasn't been used in ages and just made the code more complex.
2733 2004-04-17 Zoltan Varga <vargaz@freemail.hu>
2735 * processes.c: Include <signal.h> for SIGKILL and SIGILL + fix some
2736 warnings. Fixes #57168.
2738 2004-04-16 Dick Porter <dick@ximian.com>
2740 * threads.c (Sleep): Using div(3) with a negative (when signed)
2741 numerator causes the quotient to be 0 and the remainder to be the
2742 numerator. This feeds a small negative value to nanosleep(3),
2743 which will return immediately and cause a busy wait. Fixes bug
2746 2004-04-15 Dick Porter <dick@ximian.com>
2749 * io.c: Rewrite FindFirstFile and FindNextFile using scandir(3)
2750 and fnmatch(3) instead of glob(3). glob() can't cope with being
2751 given filenames containing metachars. This fixes bug 40557.
2753 2004-04-14 Bernie Solomon <bernard@ugsolutions.com>
2755 * security.c: #warning is a GCC-ism
2757 2004-04-13 Sebastien Pouliot <sebastien@ximian.com>
2759 * security.c: Removed GetUserName as glib g_get_user_name does a
2760 better (portability) job. Added ImpersonateLoggedOnUser and
2763 2004-04-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
2765 * mono-mutex.h: move pthread_mutex_timedlock declaration to...
2766 * mono-mutex.c: ...here. It was causing a warning that prevented
2767 libgdiplus compilation.
2769 2004-04-04 Miguel de Icaza <miguel@ximian.com>
2771 * security.c (GetUserName): Make it work on MacOS X
2773 2004-04-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
2775 * security.c: use getpwuid_r if available. This one is thread-safe.
2777 2004-04-02 Sebastien Pouliot <sebastien@ximian.com>
2779 * Makefile.am: Added security.c|h.
2780 * security.c: New file for security related functions. Added function
2781 GetUserName to fix #56144.
2782 * security.h: New. Header file for security.c
2783 * wapi.h: Added include for security.h
2785 2004-03-25 Gonzalo Paniagua Javier <gonzalo@ximian.com>
2787 * daemon-messages.h: added kill structs.
2789 * daemon.c: implemented process_process_kill.
2790 * handles-private.h: define process_process_kill.
2791 * handles.c: implemented _wapi_handle_process_kill.
2792 * processes.[ch]: implemented TerminateProcess.
2794 2004-03-25 Bernie Solomon <bernard@ugsolutions.com>
2796 * daemon.c (rem_fd): On solaris you seem to get an
2797 error even after removing the input source so don't
2798 try and rem_fd it twice.
2800 2004-03-25 Lluis Sanchez Gual <lluis@ximian.com>
2802 * daemon.c: in process_post_mortem, If the child terminated due to the
2803 receipt of a signal, the exit status must be based on WTERMSIG, since
2804 WEXITSTATUS returns 0 in this case.
2806 2004-03-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
2808 * daemon.c: turned a warning into a DEBUG statement. Now we may hit it.
2810 2004-03-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
2812 * daemon.c: only call getdtablesize () once.
2813 * processes.c: wait 500 ms to check if execve failed and throw the same
2814 exception as MS on failure. Fixes bug #32809.
2816 2004-03-17 Bernie Solomon <bernard@ugsolutions.com>
2818 * io.c (async_notifier): use "union sigval" rather
2819 than sigval_t as Solaris doesn't have sigval_t
2820 (which isn't in IEEE 1003.1 either).
2822 2004-03-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
2824 * io.c: added debug stuff and removed a few redundant lines in
2827 2004-03-15 Gonzalo Paniagua Javier <gonzalo@ximian.com>
2829 * io-private.h: added new fields for file structure. Declare
2830 _wapi_io_add_callback.
2832 * io.c: added _wapi_get_win32_error, support aio_read/write in
2833 file_read/write. Implemented _wapi_io_add_callback, which is where
2836 * io.h: added new fields for WapiOverlapped and typedef for the
2839 * processes.c: fixed off-by-one bug when handling environment variables
2842 * threads.[ch]: implemented BindIoCompletionCallback.
2844 * uglify.h: added typedef for LPOVERLAPPED_COMPLETION_ROUTINE.
2846 2004-03-14 Zoltan Varga <vargaz@freemail.hu>
2848 * socket-wrappers.h: Remove extra semicolon.
2850 2004-03-03 Dave Camp <dave@ximian.com>
2852 * daemon.c: (add_fd), (fd_activity), (_wapi_daemon_main):
2853 Use a new main context.
2855 2004-03-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
2858 (GetFileAttributes): set the error depending on errno instead of
2859 setting ERROR_FILE_NOT_FOUND always. See bug #55160.
2861 2004-03-01 Gonzalo Paniagua Javier <gonzalo@ximian.com>
2864 (CopyFile): free the buffer on error.
2866 (WSAIoctl): free the buffer on error.
2868 2004-02-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
2870 * error.c: fixed mapping for EPROTONOSUPPORT and ESOCKTNOSUPPORT.
2872 * sockets.[ch]: retry creating the socket for AF_INET, SOCK_RAW
2873 using IP protocol with IP over IP. Implemented WSAIoctl UNIX-style.
2875 2004-01-27 Bernie Solomon <bernard@ugsolutions.com>
2877 * shared.c (_wapi_shm_file): add hostname
2878 to shared data file names to handle NFS mounted
2881 Mon Jan 26 16:15:03 CET 2004 Paolo Molaro <lupus@ximian.com>
2883 * sockets.h: remove obsolete soklen_t typedef.
2885 Fri Jan 23 21:07:02 CET 2004 Paolo Molaro <lupus@ximian.com>
2887 * socket-wrappers.h, sockets.h, sockets.c, Makefile.am: move socket
2888 wrappers to its own non-installed header file.
2890 2004-01-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
2893 (FindFirstFile): unlock the handle if FindNextFile fails.
2894 (FindNextFile): g_free a couple of pointers before retrying.
2897 (WaitForMultipleObjects): if only one handle provided, use
2898 WaitForSingleObject.
2900 2003-12-22 Bernie Solomon <bernard@ugsolutions.com>
2902 * handles-private.h: (_wapi_handle_type) check
2903 for segment in range before using it
2905 2003-12-22 Bernie Solomon <bernard@ugsolutions.com>
2907 * thread-private.h: _wapi_thread_ops is now const
2910 Mon Dec 22 18:29:03 CET 2003 Paolo Molaro <lupus@ximian.com>
2912 * threads.c, timed-thread.c, timed-thread.h: use mach
2913 semaphores on Darwin (MacOSX) since the posix ones
2914 are mostly broken there (threads are not created suspended
2915 and they can start executing before they are fully initialized
2916 like in tests/thread-static.cs).
2918 Mon Dec 22 17:18:45 CET 2003 Paolo Molaro <lupus@ximian.com>
2920 * atomic.h: ppc fixes.
2922 2003-12-19 Bernie Solomon <bernard@ugsolutions.com>
2924 * handles.c: remove my bad use of MONO_ZERO_ARRAY_LENGTH
2927 2003-12-15 Bernie Solomon <bernard@ugsolutions.com>
2929 * shared.c: (_wapi_shm_open) make scratch file
2930 not have to immediately regrow to avoid remaps
2931 (HPUX can't cope with these).
2932 (_wapi_shm_attach) use actual size of file
2933 to set scratch data_len for the creating process.
2935 * handles.c: (_wapi_handle_new_internal) make
2936 sure mutex & cond var are initialized even for
2937 non process shared ones.
2938 (_wapi_handle_unref) always call destroy
2939 routines on mutex & cond var
2941 2003-12-15 Bernie Solomon <bernard@ugsolutions.com>
2943 * daemon.c: change channel data structure so
2944 input sources are removed from glib event loop
2945 properly. xsp works better on Solaris and
2948 2003-12-12 Bernie Solomon <bernard@ugsolutions.com>
2950 * wapi-private.h: Replace G_GNUC_PRETTY_FUNCTION
2951 definition with file & line number for non-GCC
2954 2003-12-08 Bernie Solomon <bernard@ugsolutions.com>
2956 * Makefile.am: make sure hppa_atomic.s is in distribution
2958 2003-12-01 Dick Porter <dick@ximian.com>
2961 * mutexes.c (CreateMutex):
2962 * mutex-private.h (struct _WapiHandle_mutex):
2963 * handles.c: Look up certain handle types by name, in a shared
2964 namespace. Currently only mutex handles have this implemented.
2967 * semaphores.c (CreateSemaphore):
2968 * events.c (CreateEvent): Fix signature
2970 2003-11-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
2972 * io.c: don't call g_free before testing errno as it may modify it.
2973 If the path exists, return an error if it's not a directory. Fixes
2976 2003-11-20 Dick Porter <dick@ximian.com>
2978 * io.c: Missed a little-endian UTF16 conversion. Patch from
2979 Jeroen Zwartepoorte (Jeroen@xs4all.nl), fixes bug 51065.
2981 2003-10-29 Dick Porter <dick@ximian.com>
2983 * io.c (MoveFile): If the move crosses filesystems, try and fall
2984 back to copy and delete. Patch from Jörg Rosenkranz
2985 (JoergR@voelcker.com), fixes bug 50298.
2987 2003-10-28 Dick Porter <dick@ximian.com>
2989 * io.c: Use the new encoding conversion to cope with non-utf8
2990 locales in filenames.
2992 * processes.c: Ditto for process arguments.
2994 Tue Oct 21 12:01:14 CEST 2003 Paolo Molaro <lupus@ximian.com>
2996 * atomic.h: some ppc inline asm fixes (incorrect use of labels,
2997 incorrect register constraints, incorrect clobber lists).
2999 2003-10-13 Bernie Solomon <bernard@ugsolutions.com>
3001 * Makefile.am hppa_atomic.s: add HP 64bit
3002 implementation of atomic ops
3004 2003-10-13 Zoltan Varga <vargaz@freemail.hu>
3006 * threads.c (CreateThread): Wrap pthread_attr_setstacksize call in
3007 a conditional for platforms that don't have it.
3009 2003-10-09 Bernie Solomon <bernard@ugsolutions.com>
3011 * threads.c: (CreateThread) use stacksize argument
3012 if non-zero - change default for 64 bits to 4Mb
3014 2003-09-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
3016 * sockets.c: set last error when socket creation fails. This shed some
3017 light on bug #49015.
3019 2003-09-28 Gonzalo Paniagua Javier <gonzalo@ximian.com>
3021 * processes.c: fixed bug #48973: we only change \ by / for the argument
3022 to be used as command.
3023 When getting the program name from the args, don't let the space between
3026 2003-09-24 Bernie Solomon <bernard@ugsolutions.com>
3028 * atomic.h atomic.c: fix sparc so lock is
3029 global, increment does so and it compiles under Sun compiler.
3031 2003-09-22 Bernie Solomon <bernard@ugsolutions.com>
3033 * handles.c: include <string.h> directly as may
3034 not be nested in <sys/un.h> like Linux
3036 2003-09-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
3039 (DeleteFile): call SetLastError on failure. Fix by
3040 richard.torkar@htu.se (Richard Torkar). Closes bug #48222.
3042 2003-09-15 Lluis Sanchez Gual <lluis@ximian.com>
3044 * daemon.c: In compare_process(), discard handles already signalled.
3046 2003-09-02 Dick Porter <dick@ximian.com>
3048 * io.c: Work around glib brain-dead assumptions about utf8-encoded
3049 filenames. Fixes bug 30781.
3051 2003-08-28 Dick Porter <dick@ximian.com>
3053 * critical-sections.c: Patch from Bernie Solomon
3054 <bernard@ugsolutions.com> to emit a warning if locking a critical
3057 2003-07-23 Dick Porter <dick@ximian.com>
3060 * daemon.c (maybe_exit): Avoid the race condition when the daemon is
3061 closing but another client comes along when the shared data is still
3062 visible. Should fix bugs 33671 and 35213.
3064 2003-07-23 Dick Porter <dick@ximian.com>
3066 * handles.c: Initialise handle mutex and cond. Fix by
3067 Bernie Solomon <bernard@ugsolutions.com>
3069 2003-07-15 Dick Porter <dick@ximian.com>
3071 * timed-thread.c (timed_thread_start_routine): Fix virtual memory
3072 leak when threads quit. Fixes bug 44067.
3074 Wed Jun 18 19:08:40 CEST 2003 Paolo Molaro <lupus@ximian.com>
3076 * io.c: never add write permission for group or others in
3077 SetFileAttributes ().
3079 2003-06-17 Dick Porter <dick@ximian.com>
3081 * io.c (SetFileAttributes): Implement the ReadOnly attribute, and
3082 ignore the unsupported ones ("fixes" bug 44977).
3084 2003-06-17 Lluis Sanchez Gual <lluis@ximian.com>
3086 * misc.c: fix bug in _wapi_calc_timeout. It gave wrong values for
3087 high ms values (there was an overflow).
3089 2003-06-17 Zoltan Varga <vargaz@freemail.hu>
3091 * system.h (struct _WapiSystemInfo ): Fix warnings when using gcc-3.3.
3093 2003-06-11 Dick Porter <dick@ximian.com>
3095 * shared.c: Fix shared directory creation. Patch from
3096 Pablo Baena <pbaena@uol.com.ar>
3098 2003-06-10 Dick Porter <dick@ximian.com>
3100 * atomic.c: Delete the useless compile warning
3102 2003-06-09 Dick Porter <dick@ximian.com>
3104 * daemon.c: Lookup env as a string array. Fixes bug 44289. Also
3105 make setting the process handle value in the environment actually
3108 * processes.c: Pretty up the process name, if it happens to be
3109 "mono" such as when another mono process forks "mono foo.exe"
3111 2003-06-05 Dick Porter <dick@ximian.com>
3113 * processes.c (process_set_current): Don't do an expensive handle
3114 search at application startup, check the environment to see if the
3115 process handle has already been created.
3117 * io.c: Don't do an expensive handle search when creating stdin,
3118 stdout and stderr handles, just create them all the first time one
3125 * handles-private.h:
3126 * daemon-messages.h:
3128 * daemon.c: Support for "unlimited" number of handles and scratch
3131 Speed up application startup by passing process handle in the
3132 environment, rather than let the app scan all handles (which gets
3133 really slow when there are more than a few thousand to check.)
3135 Initialise some structs passed to syscalls, noticed by valgrind.
3138 2003-05-20 Dick Porter <dick@ximian.com>
3140 * io.c (FindFirstFile): Include . files in the glob. Fixes bug
3143 2003-05-19 Dick Porter <dick@ximian.com>
3145 * threads.c: Set the new thread's stack size to 2M. Fix needed
3146 for BSD, reported by Martin Dvorak <md@9ll.cz>
3148 2003-05-16 Dick Porter <dick@ximian.com>
3151 * io.c: Implement GetTempPath()
3153 2003-05-16 Dick Porter <dick@ximian.com>
3155 * processes.c (CreateProcess): Set some error codes
3157 2003-05-12 Dick Porter <dick@ximian.com>
3159 * misc.c (_wapi_calc_timeout): Cope with overflowing tv_nsec.
3160 Patch from Martin Dvorak <mdvorak@ninell.cz>.
3162 2003-05-10 Dick Porter <dick@ximian.com>
3164 * io.c (CopyFile): Copy file mode as well as file data. Based on
3165 suggestion by Giuseppe Greco <giuseppe.greco@agamura.com>, bug
3168 2003-05-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
3170 * handles.c: don't call GC_gcollect when creating new handles.
3172 2003-05-05 Gonzalo Paniagua Javier <gonzalo@ximian.com>
3174 * handles.c: added some debugging code. Call GC_gcollect
3175 before creating a new handle. It makes Lupus' test run smoother and
3176 faster (from 62 to 83 request per second). Notice that calling
3177 GC_finalizer_notifier if needed (GC_should_invoke_finalizer ()) does
3178 not improve nor degrade the performance, so i don't do it.
3180 2003-05-02 Dick Porter <dick@ximian.com>
3182 * sockets.c: Rearrange closesocket() and socket_close_private(),
3183 and remember to unref the handle, so we don't leak socket handles.
3184 Fix from Pelle Johnsen <pelle.johnsen@mail.dk>
3186 2003-04-11 Dick Porter <dick@ximian.com>
3188 * atomic.h: ARM atomic operations by Malte Hildingson
3189 <tds00mahi@tellus.thn.htu.se>
3191 Tue Apr 8 11:37:29 CEST 2003 Paolo Molaro <lupus@ximian.com>
3193 * atomic.h: fix macosx build by "Urs C. Muff" <umuff@quark.com>.
3195 2003-04-03 Martin Baulig <martin@ximian.com>
3197 The following change is conditional to `WITH_INCLUDED_LIBGC'
3198 which is not yet enabled by default.
3200 * threads.c (SuspendThread, ResumeThread): Fully implemented this.
3201 (gc_init): New static function; install a signal handler for
3202 SIGPWR which is used to suspend threads. [FIXME: it SIGPWR
3203 doesn't exist on all Unix systems, we need to find another
3205 (mono_wapi_push_thread_stack): New public function. Tells the
3206 garbage collector about the current stack pointer of a suspended
3209 2003-04-03 Martin Baulig <martin@ximian.com>
3211 * timed-thread.h (TimedThread): Added `suspended_sem',
3212 `suspend_count' and `stack_ptr'.
3214 2003-03-28 Dick Porter <dick@ximian.com>
3216 * atomic.h: PPC support gratiously donated to the public domain
3217 by John Duncan <jddst19@mac.com>
3219 2003-03-20 Dick Porter <dick@ximian.com>
3221 * sockets.c (_wapi_connect): If connect() fails with EACCES, try
3222 setting SO_BROADCAST and connecting again. Fixes bug 39178.
3224 2003-03-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
3226 * processes.c: included Jerome Laban's patch and call SetLastError when
3227 the executable is not found.
3229 2003-03-03 Dick Porter <dick@ximian.com>
3231 * io.c (CreateFile): Try opening directories readonly, so that
3232 timestamps can be adjusted. Patch by Elan Feingold
3233 <efeingold@mn.rr.com>.
3235 2003-02-25 Dick Porter <dick@ximian.com>
3237 * shared.c (_wapi_shm_attach): Return a failure code on system
3238 call errors, rather than exiting.
3240 2003-02-21 Dick Porter <dick@ximian.com>
3242 * processes.c (GetCurrentProcessId): Use the current process
3243 handle to return the process ID, as getpid() is unreliable
3244 (linuxthreads gives each thread a different pid). Fixes bug
3247 2003-02-21 Dick Porter <dick@ximian.com>
3249 * io.c (FindNextFile): Skip over dangling symlinks. Fixes bug
3252 2003-02-11 Dick Porter <dick@ximian.com>
3255 * timefuncs.c: Added GetTickCount()
3257 2003-02-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
3259 * error.c: added WSA_EHOSTUNREACH mapping.
3261 2003-01-26 Miguel de Icaza <miguel@ximian.com>
3263 * io.c (SetFileAttributes): This routine is not currently
3264 implemented for the general case, but I added a special case to
3265 set the executable bit on Linux.
3267 Wed Jan 15 15:55:40 CET 2003 Paolo Molaro <lupus@ximian.com>
3269 * sockets.h, daemon.c, io.c: compilation fixes on MacOSX.
3271 2003-01-08 Dick Porter <dick@ximian.com>
3273 * sockets.c: Fixed setting blocking mode to true (fixes bug 36388)
3275 2002-12-11 Juli Mallett <jmallett@FreeBSD.org>
3277 * daemon.c, handles-private.h, handles.c, wapi-private.h:
3278 Check for an implementation which says it supports
3279 _POSIX_THREAD_PROCESS_SHARED, rather than just one that
3280 defines the symbol. Defined but with a value of -1 still
3281 means that it is unsupported.
3283 2002-12-08 Martin Baulig <martin@ximian.com>
3285 * handles.c (_wapi_handle_new): Create new non-shared handles with
3286 an initial refcount of 1, not 0.
3288 2002-11-22 Dietmar Maurer <dietmar@ximian.com>
3290 * threads.c (TlsGetValue): removed unnecessary mutex
3292 2002-11-20 Dick Porter <dick@ximian.com>
3294 * timed-thread.c (_wapi_timed_thread_attach): Attached threads
3295 need to store their data structure too.
3297 * threads.c: Make sure the threading data is initialised wherever
3300 2002-11-15 Dick Porter <dick@ximian.com>
3302 * timed-thread.c: Removed unneeded parameters in
3303 _wapi_timed_thread_attach().
3305 * threads.c: Renamed AttachThread() to make it not look like
3306 external API. Removed unneeded parameters.
3308 2002-11-11 Gonzalo Paniagua Javier <gonzalo@ximian.com>
3310 * error.[ch]: added errno_to_WSA (). It displays a warning and return
3311 WSASYSCALLFAILURE if there is no error mapping for the given errno,
3313 * sockets.c: use errno_to_WSA and fixed display of warning for h_errno.
3315 2002-10-31 Dick Porter <dick@ximian.com>
3318 * io.c: Define and use INVALID_FILE_ATTRIBUTES
3320 2002-10-07 Dick Porter <dick@ximian.com>
3323 * daemon.c: Use a more accurate time source for process start and
3326 2002-10-03 Dick Porter <dick@ximian.com>
3330 * threads.c: Fixes for freebsd. Make sure that mutex and condition
3331 creation and deletion happen in the process that owns them, when
3332 POSIX shared thread objects aren't supported. This breaks on
3333 freebsd, as pthread_t is a pointer to data.
3335 2002-10-02 Dick Porter <dick@ximian.com>
3337 * shared.c: Use mmap() instead of sysv shm for the shared data.
3339 * wapi-private.h (_WAPI_HANDLE_VERSION): Reset back to 0, for the
3343 * daemon.c: mmap()ed regions survive fork, so just pass the
3344 pointer to _wapi_daemon_main instead of mapping it again.
3346 2002-10-01 Dick Porter <dick@ximian.com>
3348 * timed-thread.c: Kludge for CREATE_SUSPENDED thread creation.
3349 Unfortunately libgc uses the same thread suspend technique that I
3350 want to, and the two don't mix: libgc will deadlock when it tries
3351 to stop the world if a thread has already been suspended by
3352 someone else. Just do the simple suspended create rather than the
3353 general purpose thread suspension for now.
3355 * threads.c: Pass create flags to the timed_thread create call, to
3356 implement suspended thread creation. ResumeThread() partially
3357 implemented, to cope with the case where a newly created but
3358 suspended thread is launched.
3360 2002-09-30 Dick Porter <dick@ximian.com>
3362 * sockets.c (ioctlsocket): Set non-blocking mode in a better way,
3365 2002-09-27 Dick Porter <dick@ximian.com>
3367 * semaphores.c: Only include semaphore.h if it's present. Patch
3368 for BSD from jmmv@hispabsd.org (Julio Merino).
3370 2002-09-27 Dick Porter <dick@ximian.com>
3372 * processes.c: Pass environment and working directory to the
3373 daemon when forking. Don't let argv[0] be duplicated when looking
3374 for the program name. Implement EnumProcessModules (simple
3375 version for now, lsof-style later if needed), GetModuleBaseName,
3376 {Get,Set}ProcessWorkingSetSize (just faked, because the vm hints
3377 aren't available on Linux).
3379 * process-private.h: Store the process name, and the working set
3383 * handles-private.h: New functions to store and retrieve an array
3384 of strings in the scratch space
3386 * daemon.c: Don't miss deleting some handles when a client exits
3387 (we used to rely on the client doing the final cleanup, but
3388 obviously if the client is no longer there the daemon has to do
3391 Process forking now sets the environment and the working
3394 * io.c: Don't confuse fd 0 with an unassigned handle struct
3396 * atomic.h: Add a google cache alternative to the msdn URL
3398 2002-09-25 Gonzalo Paniagua Javier <gonzalo@ximian.com>
3401 (_wapi_recvfrom): added ECONNRESET to the switch.
3403 2002-09-24 Mark Crichton <crichton@gimp.org>
3405 * atomic.h: Yea. On linux, sparc isn't sparc, it's __sparc__.
3408 2002-09-19 Mark Crichton <crichton@gimp.org>
3410 * daemon.c, shared.c: Added NEED_LINK_UNLINK for systems that
3411 dont have Linux's abstract filesystem for sockets.
3413 2002-09-19 Mark Crichton <crichton@gimp.org>
3415 * atomic.h: Added SPARC atomic asm code.
3416 * daemon.c, handles-private.h, handles.c, wapi-private.h:
3417 undefined _POSIX_THREAD_PROCESS_SHARED. This actually exists on
3418 Solaris 9, however, the code paths don't seem to work. More testing
3419 on the shared case is *really* needed.
3421 2002-09-03 Dick Porter <dick@ximian.com>
3424 * threads.c: Removed PosixKillThread(), because it's not in the
3427 2002-08-20 Dick Porter <dick@ximian.com>
3429 * handles.c (_wapi_handle_scratch_store): Made stored byte lengths
3430 multiples of 4 bytes, to keep header structures aligned. Needed
3431 for sparc, at least. (Patch from crichton@gimp.org)
3433 * handles.c: Removed 'disable_shm' variable (we've defaulted to
3434 building with shm enabled for months now)
3436 2002-08-19 Dick Porter <dick@ximian.com>
3438 * daemon.c: Rewrote the poll() loop to use GIOChannels instead,
3439 for legacy NeXT-based systems.
3441 2002-08-12 Dick Porter <dick@ximian.com>
3443 * atomic.h: Rename some parameters to avoid c++ keywords (Patch
3444 from Joseph Wenninger <kde@jowenn.at>)
3446 2002-08-05 Dietmar Maurer <dietmar@ximian.com>
3448 * threads.c: use fast spinlocks by default
3450 2002-08-02 Dick Porter <dick@ximian.com>
3452 * io.c (GetStdHandle): Add a handle reference when returning a
3453 duplicate console handle. This fixes the unref_handle errors in
3456 2002-08-01 Dietmar Maurer <dietmar@ximian.com>
3458 * threads.c (TLS_PTHREAD_MUTEX): define this because else some
3461 2002-08-01 Dick Porter <dick@ximian.com>
3463 * threads.c: Use atomic spinlocks in TLS functions
3466 * Makefile.am: Added mono-spinlock.h
3468 2002-07-21 Jeffrey Stedfast <fejj@ximian.com>
3470 * daemon-messages.c: #include <sys/types.h> and <sys/sockets.h> -
3471 these are needed for sendmsg() and also for struct msghdr (at
3472 least on Solaris). Solaris still won't build because struct msghdr
3473 doesn't have msg_flags, msg_control, or msg_controllen members.
3474 (CMSG_SPACE): Define for systems that don't have it.
3477 2002-07-20 Dick Porter <dick@ximian.com>
3483 * handles.c: Implemented pipe handles
3486 * daemon.c: Fixed bug in handle closing.
3489 * daemon.c: Forked processes now close all open file descriptors.
3491 Fri Jul 19 19:05:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
3493 * sockets.h, io-layer.h, critical-sections.h: don't include config.h
3496 2002-07-19 Martin Baulig <martin@gnome.org>
3498 * threads.c (ExitThread): Call exit() if no threads has been
3501 2002-07-17 Dick Porter <dick@ximian.com>
3503 * daemon-messages.c: Freebsd fixes from Andreas Kohn
3504 <andreas.kohn@gmx.net>
3506 2002-07-15 Dick Porter <dick@ximian.com>
3508 * io.c: Removed bogus console_flush() method, that was just cut
3509 and pasted from file_flush when I separated the two handle types.
3511 2002-07-12 Dick Porter <dick@ximian.com>
3513 * io.c (convert_from_flags): Fixed misunderstanding wrt fcntl
3514 flags. Fixes bug 27633.
3516 2002-07-12 Dick Porter <dick@ximian.com>
3520 * daemon.c: Use size of sockaddr_un.sun_path from config.h
3522 2002-07-12 Dick Porter <dick@ximian.com>
3524 * processes.c (CreateProcess): Send stdin, stdout and stderr
3525 handles if the startup info doesnt specify new ones
3527 * io.c (GetStdHandle): Return the same handle when the same
3528 standard handle is requested
3530 * handles.c: Pass file descriptors when forking
3532 * daemon.c: Use supplied file descriptors when forking a new
3535 * daemon-messages.h:
3536 * daemon-messages.c: Pass stdin, stdout and stderr file
3537 descriptors to the daemon (used when forking)
3539 2002-07-11 Miguel de Icaza <miguel@ximian.com>
3541 * daemon.c (_wapi_daemon_main): Use sizeof
3542 (main_socket_address.sun_path) instead of hardcoded 108 value.
3544 * handles.c (shared_init): Use sizeof
3545 (shared_socket_address.sun_path) instead of hardcoded 108 value.
3547 2002-07-10 Dennis Haney <davh@davh.dk>
3551 * daemon.c: Lots of documentation, some added error checking, and
3552 code readability improvements.
3554 * daemon-messages.h: Add the Error request type to improve error
3557 * daemon-messages.c: Do a bit more error checking on send() and
3558 recv(), and log errors with a higher severity level.
3560 2002-07-04 Dick Porter <dick@ximian.com>
3562 * daemon.c (process_process_fork): Fix argument handling, due to
3563 buggy understanding of g_strsplit() behaviour.
3565 2002-07-03 Dick Porter <dick@ximian.com>
3568 * threads.c: Implement OpenThread(). Define access-control values
3574 * Makefile.am: Added access.h, to hold shared access-control
3577 2002-07-02 Dick Porter <dick@ximian.com>
3579 * wapi-private.h (_WAPI_HANDLE_VERSION): New protocol version
3581 2002-07-02 Dick Porter <dick@ximian.com>
3583 * handles.c (shared_init): Make a second attempt to contact the
3584 daemon if the shared memory attach succeeds, but the connect()
3585 fails. (This copes with the daemon crashing without cleaning up
3591 * shared.c (_wapi_shm_attach): Don't exec() anything when we fork
3592 the daemon, it's now built into the library.
3594 2002-06-25 Dick Porter <dick@ximian.com>
3597 * handles-private.h:
3598 * daemon-messages.h:
3599 * daemon.c: Process forking and handle data management
3602 * process-private.h:
3603 * processes.c: Process forking and other support functions
3605 2002-06-25 Dick Porter <dick@ximian.com>
3607 * versioninfo.h: PE resource decoding
3609 * unicode.c (_wapi_unicode_to_utf8): g_utf16_to_utf8 doesnt need
3610 to be told the string length
3612 * io.c: Removed the ACTUALLY_DO_UNICODE option. Fixed some leaks.
3613 Moved _wapi_time_t_to_filetime and the WapiFileTime typedef to
3616 2002-06-12 Dick Porter <dick@ximian.com>
3619 * daemon-messages.c: Handle SIGPIPE in a non-stupid way in the
3620 daemon, if MSG_NOSIGNAL isn't available. Thanks to Jaroslaw
3621 Kowalski <jarek@atm.com.pl> for pointing out the bogosity.
3623 2002-06-10 Jaroslaw Kowalski <jarek@atm.com.pl>
3625 * sockets.c, daemon-messages.c: Prevent SIGPIPE from being raised
3626 when writing to a closed socket.
3628 2002-06-08 Jeffrey Stedfast <fejj@ximian.com>
3630 * mono-mutex.c (mono_once): New convenience function for my
3635 * critical-sections.c:
3643 * atomic.c: Use mono_once() rather than pthread_once().
3645 2002-06-06 Jeffrey Stedfast <fejj@ximian.com>
3647 * handles.c (_wapi_handle_new): pthread_once() is not atomic, so
3648 if multiple threads all try to call _wapi_handle_new() before the
3649 shared data has been initialized, it is possible that we could get
3650 into a condition where shared_init() is being executed and later
3651 threads will pass by pthread_once() due to the fact that it has
3652 already been called and so therefor will attempt to use the shared
3653 data before it has been completely initialized. If we instead use
3654 a standard mutex locking mechanism around shared_init(), we can
3655 avoid the situation entirely. By wrapping the mutex locking in a
3656 check to see if we've already initialized the data, we can even
3657 avoid wasting resources by having to lock/unlock the mutex in any
3658 later calls (the only time we'd have to worry about
3659 locking/unlocking is the initial race to call shared_init() at
3662 Sat Jun 1 13:27:11 CEST 2002 Paolo Molaro <lupus@ximian.com>
3664 * atomic.h: inline asm fixes from Dennis Haney (davh@davh.dk).
3666 Fri May 31 16:21:54 CEST 2002 Paolo Molaro <lupus@ximian.com>
3668 * daemon.c, handles.c: rename "sun" local var since it's apparently
3669 a #define on Solaris.
3671 Fri May 31 15:40:14 CEST 2002 Paolo Molaro <lupus@ximian.com>
3673 * daemon-messages.c: work-around MSG_NOSIGNAL missing on some
3676 2002-05-15 Dick Porter <dick@ximian.com>
3678 * wait.c: Fix a deadlock in WaitForMultipleObjects
3680 2002-05-14 Dick Porter <dick@ximian.com>
3682 * io.c: Fix a cut&paste error, found by
3683 Jaroslaw Kowalski <jarek@atm.com.pl>
3685 2002-05-10 Dan Lewis <dihlewis@yahoo.co.uk>
3689 2002-05-09 Dick Porter <dick@ximian.com>
3695 * handles-private.h:
3697 * Makefile.am: Remove now-unused file wait-private.h
3699 2002-05-08 Dick Porter <dick@ximian.com>
3701 * shared.c: Better error messages, and report when daemon
3702 connection fails rather than blocking forever. Do some more
3703 shared memory sanity checking.
3705 * handles.c: Better error messages when connecting to shared
3706 memory and the handle daemon. Fall back to non-shared handles if
3707 an error occurs. Set the default back to 'shared handles'. Fix a
3708 crashing bug in scratch space allocation that mangled the block
3711 2002-05-07 Miguel de Icaza <miguel@ximian.com>
3713 * handles.c (shared_init): Disable SHM for now, people have too
3714 many problems with this, and the diagnostics are not helping.
3716 2002-05-06 Dan Lewis <dihlewis@yahoo.co.uk>
3718 * io.c: CreateFile sets win32 last error.
3720 2002-05-05 Dick Porter <dick@ximian.com>
3723 * handles-private.h:
3729 * process-private.h:
3731 * semaphore-private.h:
3735 * event-private.h: Simplify the WapiHandleOps struct: take out all
3736 the file-specific entries, leaving just the items that operate on
3737 handles themselves. Split the close operation into shared and
3738 private parts: shared close is called by the daemon.
3740 * handles.c: As above, but also pass handle allocation, ref and
3741 unref operations to the daemon. Populate the handle_ops array at
3742 compile time, because the daemon needs to call ops on handles too.
3743 Don't bother to track open handle counts any more, the daemon does
3747 * thread-private.h: As above, but also make the thread data
3750 * shared.c: Fork a handle daemon if the calling process created
3751 the shared memory segment.
3754 * daemon-messages.c:
3755 * daemon-messages.h:
3756 * Makefile.am: Build a daemon to manage handle allocation and
3757 destruction without needing to lock the shared memory
3759 2002-04-30 Jeffrey Stedfast <fejj@ximian.com>
3761 * atomic.c: Changed to use a normal mutex rather than a spinlock
3762 since a lot of platforms seem to not have them :\
3764 2002-04-30 Dick Porter <dick@ximian.com>
3766 * Completely rewrote the handle waiting code: removed the helper
3767 thread and its attendant complexity. All handle waiting is now
3768 abstracted into the WaitForSingleObject() and
3769 WaitForMultipleObjects() functions.
3771 * Implemented inter-process sharing of handles using sysv shared
3772 memory. This makes handles even more opaque, with a handle now
3773 just an index into an array.
3775 2002-04-25 Dan Lewis <dihlewis@yahoo.co.uk>
3777 * io.c: unitialized pointer in GetCurrentDirectory.
3779 Sat Apr 20 13:37:39 CEST 2002 Paolo Molaro <lupus@ximian.com>
3781 * threads.c: destroy the mutex at thread destruction
3782 (if/when thread destruction code will be actually called).
3783 When protecting a tls data pointer from the gc, use also the
3784 thread id in the key.
3786 Wed Apr 17 18:36:27 CEST 2002 Paolo Molaro <lupus@ximian.com>
3788 * timed-thread.c: avoid race condition when setting the thread to
3791 2002-04-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
3793 * jit.h: to more #include lines to avoid breaking compilation
3794 under windows when upgrading mingw and w32api to version
3797 2002-04-16 Dick Porter <dick@ximian.com>
3799 * atomic.h: Explanatory comment about lack of 80386 support
3801 2002-04-15 Dick Porter <dick@ximian.com>
3803 * atomic.h: use xaddl for InterlockedIncrement() and
3804 InterlockedDecrement(). Use cmpxchgl in a loop for
3805 InterlockedExchange() and InterlockedExchangePointer().
3807 Mon Apr 15 13:31:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
3809 * unicode.c: fix unicode_len() to not access uninitialized memory
3810 (and updated to conform to mono code style).
3812 Fri Mar 29 17:15:11 CET 2002 Paolo Molaro <lupus@ximian.com>
3814 * io.c: EEXISTS is ignored for directory creation.
3815 * mono-mutex.h: remove silly "pragma }" that emacs users insert
3816 because they use a broken editor:-)
3818 2002-03-28 Dick Porter <dick@ximian.com>
3824 * handles.c: Warning cleanups
3826 2002-03-27 Dan Lewis <dihlewis@yahoo.co.uk>
3828 * unicode.h, unicode.c: changed to gunichar2
3829 * io.h, io.c: changed strings to gunichar2*, added
3830 SetFileAttributes(), GetCurrentDirectory(), SetCurrentDirectory(),
3831 some fixes to FindFirstFile() and friends.
3833 2002-03-26 Dick Porter <dick@ximian.com>
3835 * types.h: Implement the large integer struct
3838 * timefuncs.c: Dummy functions that don't yet implement
3839 QueryPerformanceCounter() and QueryPerformanceFrequency()
3842 * threads.c: Implement SleepEx()
3845 * system.c: Beginnings of GetSystemInfo()
3847 * mono-mutex.c (pthread_mutex_timedlock): Fix a ms/ns conversion
3851 * context.c: Dummy function that doesnt yet implement
3855 * atomic.c: Interlocked functions
3857 Mon Mar 25 13:01:40 CET 2002 Paolo Molaro <lupus@ximian.com>
3859 * threads.c: use a gc-safe hash table to store tls pointers.
3861 2002-03-22 Dick Porter <dick@ximian.com>
3863 * threads.c: Fix a race condition where a thread can start and
3864 exit before the handle has been properly initialised (no reason
3865 why the handle couldn't be initialised beforehand, so do so)
3867 Fix a ms to ns conversion magnitude thinko.
3869 2002-03-21 Dick Porter <dick@ximian.com>
3871 * semaphores.c: Fix a problem when waiting for one or more
3872 semaphores, and another semaphore is Released (all waiting
3873 semaphores assumed they were signalled)
3875 2002-03-29 Dan Lewis <dihlewis@yahoo.co.uk>
3877 * io.h, io.c, uglify.h: added MoveFile, CopyFile, CreateDirectory,
3878 RemoveDirectory, GetFileAttributes, GetFileAttributesEx
3880 2002-03-19 Dietmar Maurer <dietmar@ximian.com>
3882 * threads.c (Sleep): bug fix: 1ms == 1000000ns
3884 2002-03-19 Dan Lewis <dihlewis@yahoo.co.uk>
3886 * io.h, io.c, events.c, mutexes.c, semaphores.c, sockets.c,
3887 threads.c, io.c: added flush method to handles.
3889 * io.c: FlushFileBuffers() and FindFirstFile() functions.
3891 Thu Mar 7 17:21:52 CET 2002 Paolo Molaro <lupus@ximian.com>
3893 * threads.c, timed-thread.c, wait.c: Boehm-GC anable.
3895 2002-02-20 Dick Porter <dick@ximian.com>
3897 * io-layer.h: Always build without cygwin support on windows
3899 Mon Feb 18 15:50:59 CET 2002 Paolo Molaro <lupus@ximian.com>
3901 * sockets.c: #undef DEBUG.
3903 2002-02-14 Jeffrey Stedfast <fejj@ximian.com>
3905 * io-layer.h: conditionally include sys/filio.h and sys/sockio.h
3906 for FIONBIO, FIONREAD, and SIOCATMARK.
3908 2002-02-14 Jeffrey Stedfast <fejj@ximian.com>
3910 * sockets.c: conditionally include sys/filio.h and sys/sockio.h
3911 for FIONBIO, FIONREAD, and SIOCATMARK.
3913 2002-02-13 Dick Porter <dick@ximian.com>
3915 * sockets.c: Implement shutdown and select
3917 2002-02-13 Jeffrey Stedfast <fejj@ximian.com>
3919 * mono-mutex.[c,h]: New source files that thinly wrap all pthread
3920 functions that take pthread_mutex_t and/or pthread_mutexattr_t
3921 arguments for the sake of portability. Implements recursive
3922 mutexes and pthread_mutex_timedlock.
3924 * critical-sections.c:
3931 * wait.c: Use the mono-mutex wrapper portability functions/macros.
3933 * pthread-compat.[c,h]: Replaced by mono-mutex.[c,h]
3935 2002-01-23 Dick Porter <dick@ximian.com>
3937 * sockets.c: Networking support, mostly wrapping BSD socket APIs
3938 with handle code, and translating errno into w32 error codes.
3940 * macros.h: Some w32 macros used with the socket support
3942 * error.c: Implemented GetLastError() and SetLastError()
3944 * Makefile.am: Added sockets, with kludge to override some symbols
3946 2001-12-17 Dietmar Maurer <dietmar@ximian.com>
3948 * unicode.c (_wapi_unicode_to_utf8): byteswap UTF16 strings before
3949 passing them to iconv
3950 (_wapi_unicode_to_utf8): only swap bytes on LE systems, remove bug
3951 from previous commit.
3953 2001-12-11 Dick Porter <dick@ximian.com>
3955 * io.c: Implement DeleteFile(), GetFileTime(), SetFileTime() and
3956 FileTimeToSystemTime().
3958 * unicode.c (unicode_len): Nasty way of finding length of unicode
3959 string with embedded NULLs (counts until two NULLs together).
3961 * mutexes.c (mutex_close):
3962 * events.c (event_close): Release the internal pthreads resources
3964 2001-11-26 Dick Porter <dick@ximian.com>
3966 * critical-sections.c:
3974 * wait.c: turn off DEBUG messages
3976 2001-11-22 Dick Porter <dick@ximian.com>
3978 * handles.c (SignalObjectAndWait): Implement
3980 * wait.c (WaitForSingleObject): Fix case where timeout == 0
3986 * events.c: Support for SignalObjectAndWait
3988 2001-11-21 Dick Porter <dick@ximian.com>
3995 * wait.c: Reliable method of returning which handle was signalled
3996 on return from WaitForMultipleObjects().
3998 2001-11-21 Dick Porter <dick@ximian.com>
4000 * events.c: Implement events
4002 2001-11-15 Dick Porter <dick@ximian.com>
4004 * mutexes.c: Implement mutexes
4008 * misc.c: Factor out some common code
4010 2001-11-13 Dick Porter <dick@ximian.com>
4012 * threads.c: Implement TLS. Implement GetCurrentThreadId(), and
4013 GetCurrentThread() by maintaining a hash of thread handles.
4015 * threads.h: Define thread and process creation flags
4017 2001-11-12 Dick Porter <dick@ximian.com>
4019 * critical-sections.c: Implement critical sections
4021 2001-11-12 Dick Porter <dick@ximian.com>
4023 * semaphores.c: Implement semaphores
4025 * wait.c (wait_for_item): Maintain a wait count rather than count
4028 * threads.c (thread_wait_multiple): Don't lock the wait item, that
4029 will block other wait threads
4031 2001-11-11 Dick Porter <dick@ximian.com>
4033 * Makefile.am: Rename some automake variables
4034 (from Nick Drochak <ndrochak@gol.com>)
4036 2001-11-10 Dick Porter <dick@ximian.com>
4038 * Makefile.am (libwapiincludedir): Fix include destination
4040 * .cvsignore: Ignore generated files
4042 2001-11-10 Dietmar Maurer <dietmar@ximian.com>
4044 * pthread-compat.c: added some include files to make it compile on
4047 2001-11-08 Dick Porter <dick@ximian.com>
4051 This is a library emulating the win32 threading and IO API.