1 2004-05-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
3 * io.c: translate from GFileError to errno codes and don't free
4 variables right after calling mono_io_scandir, as we may overwrite
7 2004-05-08 Gonzalo Paniagua Javier <gonzalo@ximian.com>
9 * io.c: g_dir_open return ENOENT for directories on which we don't have
10 read/execute permission, while returning EPERM for anything below those.
11 So, change ENOENT by EPERM if the directory exists.
13 2004-05-07 Dick Porter <dick@ximian.com>
15 * io.c (SetFileAttributes): Don't have failed chmod()s cause a
16 "file not found" error. Fixes bug 54032.
18 2004-05-07 Dick Porter <dick@ximian.com>
20 * io.c (FindFirstFile): Comment out a windows-compatibility check
21 that breaks when directories have metachars in their names.
22 Workaround for bug 58116.
24 2004-05-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
26 * io.c: fixed for FindFirstFile for empty directories. Closes
29 2004-05-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
31 * processes.c: set the start time for the current process. Fixes bug
34 2004-05-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
36 * io-private.h: 'namelist' is now a gchar ** in _WapiHandlePrivate_find.
37 * io.c: implemented scandir using glib functions.
39 2004-05-04 Dick Porter <dick@ximian.com>
41 * daemon.c (read_message): Return FALSE on error so the GSource
42 callback itself can return FALSE. Cures the infinite loop poll()
44 * shared.c: Fix some daemon startup race conditions.
46 2004-04-29 Miguel de Icaza <miguel@ximian.com>
48 * io.c (CopyFile): Use 32k buffers to copy the file instead of 2k,
49 use the stack, do not use dynamic memory.
51 2004-04-29 Zoltan Varga <vargaz@freemail.hu>
53 * io.c: Add scandir implementation for platforms which do not have
56 2004-04-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
58 * io.[ch]: implemented GetLogicalDriveStrings.
60 2004-04-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
63 * sockets.c: use the field name from configure when accessing sigval
64 pointer field. Makes this work on the Mac.
66 2004-04-28 Bernie Solomon <bernard@ugsolutions.com>
68 * atomic.c: (InterlockedExchange) fix typo for
71 2004-04-28 Gonzalo Paniagua Javier <gonzalo@ximian.com>
74 * sockets.c: added check for sys/aio.h.
76 2004-04-28 Gonzalo Paniagua Javier <gonzalo@ximian.com>
78 * error.[ch]: added _wapi_get_win32_file_error...
79 * io.c: ... which was _wapi_get_win32_error here.
80 * sockets.c: rename the function calls here too.
82 2004-04-28 Dick Porter <dick@ximian.com>
84 * daemon-messages.c: Avoid a deadlock when a thread is killed while
85 waiting for the daemon by using a recursive mutex. Helps bug 56699.
87 2004-04-28 Gonzalo Paniagua Javier <gonzalo@ximian.com>
89 * io.c: fixed leak in async_notifier().
91 * sockets.[ch]: added AIO support for sockets and fixed WSAIoctl
94 * threads.c: removed old comment.
96 2004-04-26 David Waite <mass@akuma.org>
105 * wapi-private.h: remove comma from end of enumeration declarations
106 * status.h: cast unsigned int types to int for enum assignment
108 2004-04-26 David Waite <mass@akuma.org>
111 * timefuncs.c: declare 64-bit constants as long long types (i.e.
114 2004-04-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
116 * socket-wrappers.h: _wapi_socket == WSASocket now. Added
119 * sockets.c: new unused parameters for _wapi_socket.
121 2004-04-22 Miguel de Icaza <miguel@ximian.com>
123 * timed-thread.c: Replace sem_init with MONO_SEM_INIT to handle
124 the fact that MacOS X is a piece of junk (sem_init is *defined* in
125 the libc, but they return `not implemented').
127 2004-04-22 Dick Porter <dick@ximian.com>
130 * handles-private.h: Reference the handle when it is locked, so
131 that another thread can't blow it away while we're waiting for it
147 * critical-sections.c:
148 * atomic.c: Added pthreads cleanup handlers and error asserts
151 * handles.c: Fixed the gcc "variable might be used uninitialised"
152 warnings. They can't happen, but gcc doesn't know that
153 g_assert()s don't return.
155 Fixed the declaration of _wapi_handle_process_kill() so that it
156 expects the correct type for the pid.
158 * threads.c: Removed the TLS_PTHREAD_MUTEX style locking that
159 hasn't been used in ages and just made the code more complex.
161 2004-04-17 Zoltan Varga <vargaz@freemail.hu>
163 * processes.c: Include <signal.h> for SIGKILL and SIGILL + fix some
164 warnings. Fixes #57168.
166 2004-04-16 Dick Porter <dick@ximian.com>
168 * threads.c (Sleep): Using div(3) with a negative (when signed)
169 numerator causes the quotient to be 0 and the remainder to be the
170 numerator. This feeds a small negative value to nanosleep(3),
171 which will return immediately and cause a busy wait. Fixes bug
174 2004-04-15 Dick Porter <dick@ximian.com>
177 * io.c: Rewrite FindFirstFile and FindNextFile using scandir(3)
178 and fnmatch(3) instead of glob(3). glob() can't cope with being
179 given filenames containing metachars. This fixes bug 40557.
181 2004-04-14 Bernie Solomon <bernard@ugsolutions.com>
183 * security.c: #warning is a GCC-ism
185 2004-04-13 Sebastien Pouliot <sebastien@ximian.com>
187 * security.c: Removed GetUserName as glib g_get_user_name does a
188 better (portability) job. Added ImpersonateLoggedOnUser and
191 2004-04-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
193 * mono-mutex.h: move pthread_mutex_timedlock declaration to...
194 * mono-mutex.c: ...here. It was causing a warning that prevented
195 libgdiplus compilation.
197 2004-04-04 Miguel de Icaza <miguel@ximian.com>
199 * security.c (GetUserName): Make it work on MacOS X
201 2004-04-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
203 * security.c: use getpwuid_r if available. This one is thread-safe.
205 2004-04-02 Sebastien Pouliot <sebastien@ximian.com>
207 * Makefile.am: Added security.c|h.
208 * security.c: New file for security related functions. Added function
209 GetUserName to fix #56144.
210 * security.h: New. Header file for security.c
211 * wapi.h: Added include for security.h
213 2004-03-25 Gonzalo Paniagua Javier <gonzalo@ximian.com>
215 * daemon-messages.h: added kill structs.
217 * daemon.c: implemented process_process_kill.
218 * handles-private.h: define process_process_kill.
219 * handles.c: implemented _wapi_handle_process_kill.
220 * processes.[ch]: implemented TerminateProcess.
222 2004-03-25 Bernie Solomon <bernard@ugsolutions.com>
224 * daemon.c (rem_fd): On solaris you seem to get an
225 error even after removing the input source so don't
226 try and rem_fd it twice.
228 2004-03-25 Lluis Sanchez Gual <lluis@ximian.com>
230 * daemon.c: in process_post_mortem, If the child terminated due to the
231 receipt of a signal, the exit status must be based on WTERMSIG, since
232 WEXITSTATUS returns 0 in this case.
234 2004-03-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
236 * daemon.c: turned a warning into a DEBUG statement. Now we may hit it.
238 2004-03-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
240 * daemon.c: only call getdtablesize () once.
241 * processes.c: wait 500 ms to check if execve failed and throw the same
242 exception as MS on failure. Fixes bug #32809.
244 2004-03-17 Bernie Solomon <bernard@ugsolutions.com>
246 * io.c (async_notifier): use "union sigval" rather
247 than sigval_t as Solaris doesn't have sigval_t
248 (which isn't in IEEE 1003.1 either).
250 2004-03-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
252 * io.c: added debug stuff and removed a few redundant lines in
255 2004-03-15 Gonzalo Paniagua Javier <gonzalo@ximian.com>
257 * io-private.h: added new fields for file structure. Declare
258 _wapi_io_add_callback.
260 * io.c: added _wapi_get_win32_error, support aio_read/write in
261 file_read/write. Implemented _wapi_io_add_callback, which is where
264 * io.h: added new fields for WapiOverlapped and typedef for the
267 * processes.c: fixed off-by-one bug when handling environment variables
270 * threads.[ch]: implemented BindIoCompletionCallback.
272 * uglify.h: added typedef for LPOVERLAPPED_COMPLETION_ROUTINE.
274 2004-03-14 Zoltan Varga <vargaz@freemail.hu>
276 * socket-wrappers.h: Remove extra semicolon.
278 2004-03-03 Dave Camp <dave@ximian.com>
280 * daemon.c: (add_fd), (fd_activity), (_wapi_daemon_main):
281 Use a new main context.
283 2004-03-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
286 (GetFileAttributes): set the error depending on errno instead of
287 setting ERROR_FILE_NOT_FOUND always. See bug #55160.
289 2004-03-01 Gonzalo Paniagua Javier <gonzalo@ximian.com>
292 (CopyFile): free the buffer on error.
294 (WSAIoctl): free the buffer on error.
296 2004-02-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
298 * error.c: fixed mapping for EPROTONOSUPPORT and ESOCKTNOSUPPORT.
300 * sockets.[ch]: retry creating the socket for AF_INET, SOCK_RAW
301 using IP protocol with IP over IP. Implemented WSAIoctl UNIX-style.
303 2004-01-27 Bernie Solomon <bernard@ugsolutions.com>
305 * shared.c (_wapi_shm_file): add hostname
306 to shared data file names to handle NFS mounted
309 Mon Jan 26 16:15:03 CET 2004 Paolo Molaro <lupus@ximian.com>
311 * sockets.h: remove obsolete soklen_t typedef.
313 Fri Jan 23 21:07:02 CET 2004 Paolo Molaro <lupus@ximian.com>
315 * socket-wrappers.h, sockets.h, sockets.c, Makefile.am: move socket
316 wrappers to its own non-installed header file.
318 2004-01-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
321 (FindFirstFile): unlock the handle if FindNextFile fails.
322 (FindNextFile): g_free a couple of pointers before retrying.
325 (WaitForMultipleObjects): if only one handle provided, use
328 2003-12-22 Bernie Solomon <bernard@ugsolutions.com>
330 * handles-private.h: (_wapi_handle_type) check
331 for segment in range before using it
333 2003-12-22 Bernie Solomon <bernard@ugsolutions.com>
335 * thread-private.h: _wapi_thread_ops is now const
338 Mon Dec 22 18:29:03 CET 2003 Paolo Molaro <lupus@ximian.com>
340 * threads.c, timed-thread.c, timed-thread.h: use mach
341 semaphores on Darwin (MacOSX) since the posix ones
342 are mostly broken there (threads are not created suspended
343 and they can start executing before they are fully initialized
344 like in tests/thread-static.cs).
346 Mon Dec 22 17:18:45 CET 2003 Paolo Molaro <lupus@ximian.com>
348 * atomic.h: ppc fixes.
350 2003-12-19 Bernie Solomon <bernard@ugsolutions.com>
352 * handles.c: remove my bad use of MONO_ZERO_ARRAY_LENGTH
355 2003-12-15 Bernie Solomon <bernard@ugsolutions.com>
357 * shared.c: (_wapi_shm_open) make scratch file
358 not have to immediately regrow to avoid remaps
359 (HPUX can't cope with these).
360 (_wapi_shm_attach) use actual size of file
361 to set scratch data_len for the creating process.
363 * handles.c: (_wapi_handle_new_internal) make
364 sure mutex & cond var are initialized even for
365 non process shared ones.
366 (_wapi_handle_unref) always call destroy
367 routines on mutex & cond var
369 2003-12-15 Bernie Solomon <bernard@ugsolutions.com>
371 * daemon.c: change channel data structure so
372 input sources are removed from glib event loop
373 properly. xsp works better on Solaris and
376 2003-12-12 Bernie Solomon <bernard@ugsolutions.com>
378 * wapi-private.h: Replace G_GNUC_PRETTY_FUNCTION
379 definition with file & line number for non-GCC
382 2003-12-08 Bernie Solomon <bernard@ugsolutions.com>
384 * Makefile.am: make sure hppa_atomic.s is in distribution
386 2003-12-01 Dick Porter <dick@ximian.com>
389 * mutexes.c (CreateMutex):
390 * mutex-private.h (struct _WapiHandle_mutex):
391 * handles.c: Look up certain handle types by name, in a shared
392 namespace. Currently only mutex handles have this implemented.
395 * semaphores.c (CreateSemaphore):
396 * events.c (CreateEvent): Fix signature
398 2003-11-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
400 * io.c: don't call g_free before testing errno as it may modify it.
401 If the path exists, return an error if it's not a directory. Fixes
404 2003-11-20 Dick Porter <dick@ximian.com>
406 * io.c: Missed a little-endian UTF16 conversion. Patch from
407 Jeroen Zwartepoorte (Jeroen@xs4all.nl), fixes bug 51065.
409 2003-10-29 Dick Porter <dick@ximian.com>
411 * io.c (MoveFile): If the move crosses filesystems, try and fall
412 back to copy and delete. Patch from Jörg Rosenkranz
413 (JoergR@voelcker.com), fixes bug 50298.
415 2003-10-28 Dick Porter <dick@ximian.com>
417 * io.c: Use the new encoding conversion to cope with non-utf8
418 locales in filenames.
420 * processes.c: Ditto for process arguments.
422 Tue Oct 21 12:01:14 CEST 2003 Paolo Molaro <lupus@ximian.com>
424 * atomic.h: some ppc inline asm fixes (incorrect use of labels,
425 incorrect register constraints, incorrect clobber lists).
427 2003-10-13 Bernie Solomon <bernard@ugsolutions.com>
429 * Makefile.am hppa_atomic.s: add HP 64bit
430 implementation of atomic ops
432 2003-10-13 Zoltan Varga <vargaz@freemail.hu>
434 * threads.c (CreateThread): Wrap pthread_attr_setstacksize call in
435 a conditional for platforms that don't have it.
437 2003-10-09 Bernie Solomon <bernard@ugsolutions.com>
439 * threads.c: (CreateThread) use stacksize argument
440 if non-zero - change default for 64 bits to 4Mb
442 2003-09-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
444 * sockets.c: set last error when socket creation fails. This shed some
447 2003-09-28 Gonzalo Paniagua Javier <gonzalo@ximian.com>
449 * processes.c: fixed bug #48973: we only change \ by / for the argument
450 to be used as command.
451 When getting the program name from the args, don't let the space between
454 2003-09-24 Bernie Solomon <bernard@ugsolutions.com>
456 * atomic.h atomic.c: fix sparc so lock is
457 global, increment does so and it compiles under Sun compiler.
459 2003-09-22 Bernie Solomon <bernard@ugsolutions.com>
461 * handles.c: include <string.h> directly as may
462 not be nested in <sys/un.h> like Linux
464 2003-09-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
467 (DeleteFile): call SetLastError on failure. Fix by
468 richard.torkar@htu.se (Richard Torkar). Closes bug #48222.
470 2003-09-15 Lluis Sanchez Gual <lluis@ximian.com>
472 * daemon.c: In compare_process(), discard handles already signalled.
474 2003-09-02 Dick Porter <dick@ximian.com>
476 * io.c: Work around glib brain-dead assumptions about utf8-encoded
477 filenames. Fixes bug 30781.
479 2003-08-28 Dick Porter <dick@ximian.com>
481 * critical-sections.c: Patch from Bernie Solomon
482 <bernard@ugsolutions.com> to emit a warning if locking a critical
485 2003-07-23 Dick Porter <dick@ximian.com>
488 * daemon.c (maybe_exit): Avoid the race condition when the daemon is
489 closing but another client comes along when the shared data is still
490 visible. Should fix bugs 33671 and 35213.
492 2003-07-23 Dick Porter <dick@ximian.com>
494 * handles.c: Initialise handle mutex and cond. Fix by
495 Bernie Solomon <bernard@ugsolutions.com>
497 2003-07-15 Dick Porter <dick@ximian.com>
499 * timed-thread.c (timed_thread_start_routine): Fix virtual memory
500 leak when threads quit. Fixes bug 44067.
502 Wed Jun 18 19:08:40 CEST 2003 Paolo Molaro <lupus@ximian.com>
504 * io.c: never add write permission for group or others in
505 SetFileAttributes ().
507 2003-06-17 Dick Porter <dick@ximian.com>
509 * io.c (SetFileAttributes): Implement the ReadOnly attribute, and
510 ignore the unsupported ones ("fixes" bug 44977).
512 2003-06-17 Lluis Sanchez Gual <lluis@ximian.com>
514 * misc.c: fix bug in _wapi_calc_timeout. It gave wrong values for
515 high ms values (there was an overflow).
517 2003-06-17 Zoltan Varga <vargaz@freemail.hu>
519 * system.h (struct _WapiSystemInfo ): Fix warnings when using gcc-3.3.
521 2003-06-11 Dick Porter <dick@ximian.com>
523 * shared.c: Fix shared directory creation. Patch from
524 Pablo Baena <pbaena@uol.com.ar>
526 2003-06-10 Dick Porter <dick@ximian.com>
528 * atomic.c: Delete the useless compile warning
530 2003-06-09 Dick Porter <dick@ximian.com>
532 * daemon.c: Lookup env as a string array. Fixes bug 44289. Also
533 make setting the process handle value in the environment actually
536 * processes.c: Pretty up the process name, if it happens to be
537 "mono" such as when another mono process forks "mono foo.exe"
539 2003-06-05 Dick Porter <dick@ximian.com>
541 * processes.c (process_set_current): Don't do an expensive handle
542 search at application startup, check the environment to see if the
543 process handle has already been created.
545 * io.c: Don't do an expensive handle search when creating stdin,
546 stdout and stderr handles, just create them all the first time one
556 * daemon.c: Support for "unlimited" number of handles and scratch
559 Speed up application startup by passing process handle in the
560 environment, rather than let the app scan all handles (which gets
561 really slow when there are more than a few thousand to check.)
563 Initialise some structs passed to syscalls, noticed by valgrind.
566 2003-05-20 Dick Porter <dick@ximian.com>
568 * io.c (FindFirstFile): Include . files in the glob. Fixes bug
571 2003-05-19 Dick Porter <dick@ximian.com>
573 * threads.c: Set the new thread's stack size to 2M. Fix needed
574 for BSD, reported by Martin Dvorak <md@9ll.cz>
576 2003-05-16 Dick Porter <dick@ximian.com>
579 * io.c: Implement GetTempPath()
581 2003-05-16 Dick Porter <dick@ximian.com>
583 * processes.c (CreateProcess): Set some error codes
585 2003-05-12 Dick Porter <dick@ximian.com>
587 * misc.c (_wapi_calc_timeout): Cope with overflowing tv_nsec.
588 Patch from Martin Dvorak <mdvorak@ninell.cz>.
590 2003-05-10 Dick Porter <dick@ximian.com>
592 * io.c (CopyFile): Copy file mode as well as file data. Based on
593 suggestion by Giuseppe Greco <giuseppe.greco@agamura.com>, bug
596 2003-05-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
598 * handles.c: don't call GC_gcollect when creating new handles.
600 2003-05-05 Gonzalo Paniagua Javier <gonzalo@ximian.com>
602 * handles.c: added some debugging code. Call GC_gcollect
603 before creating a new handle. It makes Lupus' test run smoother and
604 faster (from 62 to 83 request per second). Notice that calling
605 GC_finalizer_notifier if needed (GC_should_invoke_finalizer ()) does
606 not improve nor degrade the performance, so i don't do it.
608 2003-05-02 Dick Porter <dick@ximian.com>
610 * sockets.c: Rearrange closesocket() and socket_close_private(),
611 and remember to unref the handle, so we don't leak socket handles.
612 Fix from Pelle Johnsen <pelle.johnsen@mail.dk>
614 2003-04-11 Dick Porter <dick@ximian.com>
616 * atomic.h: ARM atomic operations by Malte Hildingson
617 <tds00mahi@tellus.thn.htu.se>
619 Tue Apr 8 11:37:29 CEST 2003 Paolo Molaro <lupus@ximian.com>
621 * atomic.h: fix macosx build by "Urs C. Muff" <umuff@quark.com>.
623 2003-04-03 Martin Baulig <martin@ximian.com>
625 The following change is conditional to `WITH_INCLUDED_LIBGC'
626 which is not yet enabled by default.
628 * threads.c (SuspendThread, ResumeThread): Fully implemented this.
629 (gc_init): New static function; install a signal handler for
630 SIGPWR which is used to suspend threads. [FIXME: it SIGPWR
631 doesn't exist on all Unix systems, we need to find another
633 (mono_wapi_push_thread_stack): New public function. Tells the
634 garbage collector about the current stack pointer of a suspended
637 2003-04-03 Martin Baulig <martin@ximian.com>
639 * timed-thread.h (TimedThread): Added `suspended_sem',
640 `suspend_count' and `stack_ptr'.
642 2003-03-28 Dick Porter <dick@ximian.com>
644 * atomic.h: PPC support gratiously donated to the public domain
645 by John Duncan <jddst19@mac.com>
647 2003-03-20 Dick Porter <dick@ximian.com>
649 * sockets.c (_wapi_connect): If connect() fails with EACCES, try
650 setting SO_BROADCAST and connecting again. Fixes bug 39178.
652 2003-03-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
654 * processes.c: included Jerome Laban's patch and call SetLastError when
655 the executable is not found.
657 2003-03-03 Dick Porter <dick@ximian.com>
659 * io.c (CreateFile): Try opening directories readonly, so that
660 timestamps can be adjusted. Patch by Elan Feingold
661 <efeingold@mn.rr.com>.
663 2003-02-25 Dick Porter <dick@ximian.com>
665 * shared.c (_wapi_shm_attach): Return a failure code on system
666 call errors, rather than exiting.
668 2003-02-21 Dick Porter <dick@ximian.com>
670 * processes.c (GetCurrentProcessId): Use the current process
671 handle to return the process ID, as getpid() is unreliable
672 (linuxthreads gives each thread a different pid). Fixes bug
675 2003-02-21 Dick Porter <dick@ximian.com>
677 * io.c (FindNextFile): Skip over dangling symlinks. Fixes bug
680 2003-02-11 Dick Porter <dick@ximian.com>
683 * timefuncs.c: Added GetTickCount()
685 2003-02-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
687 * error.c: added WSA_EHOSTUNREACH mapping.
689 2003-01-26 Miguel de Icaza <miguel@ximian.com>
691 * io.c (SetFileAttributes): This routine is not currently
692 implemented for the general case, but I added a special case to
693 set the executable bit on Linux.
695 Wed Jan 15 15:55:40 CET 2003 Paolo Molaro <lupus@ximian.com>
697 * sockets.h, daemon.c, io.c: compilation fixes on MacOSX.
699 2003-01-08 Dick Porter <dick@ximian.com>
701 * sockets.c: Fixed setting blocking mode to true (fixes bug 36388)
703 2002-12-11 Juli Mallett <jmallett@FreeBSD.org>
705 * daemon.c, handles-private.h, handles.c, wapi-private.h:
706 Check for an implementation which says it supports
707 _POSIX_THREAD_PROCESS_SHARED, rather than just one that
708 defines the symbol. Defined but with a value of -1 still
709 means that it is unsupported.
711 2002-12-08 Martin Baulig <martin@ximian.com>
713 * handles.c (_wapi_handle_new): Create new non-shared handles with
714 an initial refcount of 1, not 0.
716 2002-11-22 Dietmar Maurer <dietmar@ximian.com>
718 * threads.c (TlsGetValue): removed unnecessary mutex
720 2002-11-20 Dick Porter <dick@ximian.com>
722 * timed-thread.c (_wapi_timed_thread_attach): Attached threads
723 need to store their data structure too.
725 * threads.c: Make sure the threading data is initialised wherever
728 2002-11-15 Dick Porter <dick@ximian.com>
730 * timed-thread.c: Removed unneeded parameters in
731 _wapi_timed_thread_attach().
733 * threads.c: Renamed AttachThread() to make it not look like
734 external API. Removed unneeded parameters.
736 2002-11-11 Gonzalo Paniagua Javier <gonzalo@ximian.com>
738 * error.[ch]: added errno_to_WSA (). It displays a warning and return
739 WSASYSCALLFAILURE if there is no error mapping for the given errno,
741 * sockets.c: use errno_to_WSA and fixed display of warning for h_errno.
743 2002-10-31 Dick Porter <dick@ximian.com>
746 * io.c: Define and use INVALID_FILE_ATTRIBUTES
748 2002-10-07 Dick Porter <dick@ximian.com>
751 * daemon.c: Use a more accurate time source for process start and
754 2002-10-03 Dick Porter <dick@ximian.com>
758 * threads.c: Fixes for freebsd. Make sure that mutex and condition
759 creation and deletion happen in the process that owns them, when
760 POSIX shared thread objects aren't supported. This breaks on
761 freebsd, as pthread_t is a pointer to data.
763 2002-10-02 Dick Porter <dick@ximian.com>
765 * shared.c: Use mmap() instead of sysv shm for the shared data.
767 * wapi-private.h (_WAPI_HANDLE_VERSION): Reset back to 0, for the
771 * daemon.c: mmap()ed regions survive fork, so just pass the
772 pointer to _wapi_daemon_main instead of mapping it again.
774 2002-10-01 Dick Porter <dick@ximian.com>
776 * timed-thread.c: Kludge for CREATE_SUSPENDED thread creation.
777 Unfortunately libgc uses the same thread suspend technique that I
778 want to, and the two don't mix: libgc will deadlock when it tries
779 to stop the world if a thread has already been suspended by
780 someone else. Just do the simple suspended create rather than the
781 general purpose thread suspension for now.
783 * threads.c: Pass create flags to the timed_thread create call, to
784 implement suspended thread creation. ResumeThread() partially
785 implemented, to cope with the case where a newly created but
786 suspended thread is launched.
788 2002-09-30 Dick Porter <dick@ximian.com>
790 * sockets.c (ioctlsocket): Set non-blocking mode in a better way,
793 2002-09-27 Dick Porter <dick@ximian.com>
795 * semaphores.c: Only include semaphore.h if it's present. Patch
796 for BSD from jmmv@hispabsd.org (Julio Merino).
798 2002-09-27 Dick Porter <dick@ximian.com>
800 * processes.c: Pass environment and working directory to the
801 daemon when forking. Don't let argv[0] be duplicated when looking
802 for the program name. Implement EnumProcessModules (simple
803 version for now, lsof-style later if needed), GetModuleBaseName,
804 {Get,Set}ProcessWorkingSetSize (just faked, because the vm hints
805 aren't available on Linux).
807 * process-private.h: Store the process name, and the working set
811 * handles-private.h: New functions to store and retrieve an array
812 of strings in the scratch space
814 * daemon.c: Don't miss deleting some handles when a client exits
815 (we used to rely on the client doing the final cleanup, but
816 obviously if the client is no longer there the daemon has to do
819 Process forking now sets the environment and the working
822 * io.c: Don't confuse fd 0 with an unassigned handle struct
824 * atomic.h: Add a google cache alternative to the msdn URL
826 2002-09-25 Gonzalo Paniagua Javier <gonzalo@ximian.com>
829 (_wapi_recvfrom): added ECONNRESET to the switch.
831 2002-09-24 Mark Crichton <crichton@gimp.org>
833 * atomic.h: Yea. On linux, sparc isn't sparc, it's __sparc__.
836 2002-09-19 Mark Crichton <crichton@gimp.org>
838 * daemon.c, shared.c: Added NEED_LINK_UNLINK for systems that
839 dont have Linux's abstract filesystem for sockets.
841 2002-09-19 Mark Crichton <crichton@gimp.org>
843 * atomic.h: Added SPARC atomic asm code.
844 * daemon.c, handles-private.h, handles.c, wapi-private.h:
845 undefined _POSIX_THREAD_PROCESS_SHARED. This actually exists on
846 Solaris 9, however, the code paths don't seem to work. More testing
847 on the shared case is *really* needed.
849 2002-09-03 Dick Porter <dick@ximian.com>
852 * threads.c: Removed PosixKillThread(), because it's not in the
855 2002-08-20 Dick Porter <dick@ximian.com>
857 * handles.c (_wapi_handle_scratch_store): Made stored byte lengths
858 multiples of 4 bytes, to keep header structures aligned. Needed
859 for sparc, at least. (Patch from crichton@gimp.org)
861 * handles.c: Removed 'disable_shm' variable (we've defaulted to
862 building with shm enabled for months now)
864 2002-08-19 Dick Porter <dick@ximian.com>
866 * daemon.c: Rewrote the poll() loop to use GIOChannels instead,
867 for legacy NeXT-based systems.
869 2002-08-12 Dick Porter <dick@ximian.com>
871 * atomic.h: Rename some parameters to avoid c++ keywords (Patch
872 from Joseph Wenninger <kde@jowenn.at>)
874 2002-08-05 Dietmar Maurer <dietmar@ximian.com>
876 * threads.c: use fast spinlocks by default
878 2002-08-02 Dick Porter <dick@ximian.com>
880 * io.c (GetStdHandle): Add a handle reference when returning a
881 duplicate console handle. This fixes the unref_handle errors in
884 2002-08-01 Dietmar Maurer <dietmar@ximian.com>
886 * threads.c (TLS_PTHREAD_MUTEX): define this because else some
889 2002-08-01 Dick Porter <dick@ximian.com>
891 * threads.c: Use atomic spinlocks in TLS functions
894 * Makefile.am: Added mono-spinlock.h
896 2002-07-21 Jeffrey Stedfast <fejj@ximian.com>
898 * daemon-messages.c: #include <sys/types.h> and <sys/sockets.h> -
899 these are needed for sendmsg() and also for struct msghdr (at
900 least on Solaris). Solaris still won't build because struct msghdr
901 doesn't have msg_flags, msg_control, or msg_controllen members.
902 (CMSG_SPACE): Define for systems that don't have it.
905 2002-07-20 Dick Porter <dick@ximian.com>
911 * handles.c: Implemented pipe handles
914 * daemon.c: Fixed bug in handle closing.
917 * daemon.c: Forked processes now close all open file descriptors.
919 Fri Jul 19 19:05:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
921 * sockets.h, io-layer.h, critical-sections.h: don't include config.h
924 2002-07-19 Martin Baulig <martin@gnome.org>
926 * threads.c (ExitThread): Call exit() if no threads has been
929 2002-07-17 Dick Porter <dick@ximian.com>
931 * daemon-messages.c: Freebsd fixes from Andreas Kohn
932 <andreas.kohn@gmx.net>
934 2002-07-15 Dick Porter <dick@ximian.com>
936 * io.c: Removed bogus console_flush() method, that was just cut
937 and pasted from file_flush when I separated the two handle types.
939 2002-07-12 Dick Porter <dick@ximian.com>
941 * io.c (convert_from_flags): Fixed misunderstanding wrt fcntl
942 flags. Fixes bug 27633.
944 2002-07-12 Dick Porter <dick@ximian.com>
948 * daemon.c: Use size of sockaddr_un.sun_path from config.h
950 2002-07-12 Dick Porter <dick@ximian.com>
952 * processes.c (CreateProcess): Send stdin, stdout and stderr
953 handles if the startup info doesnt specify new ones
955 * io.c (GetStdHandle): Return the same handle when the same
956 standard handle is requested
958 * handles.c: Pass file descriptors when forking
960 * daemon.c: Use supplied file descriptors when forking a new
964 * daemon-messages.c: Pass stdin, stdout and stderr file
965 descriptors to the daemon (used when forking)
967 2002-07-11 Miguel de Icaza <miguel@ximian.com>
969 * daemon.c (_wapi_daemon_main): Use sizeof
970 (main_socket_address.sun_path) instead of hardcoded 108 value.
972 * handles.c (shared_init): Use sizeof
973 (shared_socket_address.sun_path) instead of hardcoded 108 value.
975 2002-07-10 Dennis Haney <davh@davh.dk>
979 * daemon.c: Lots of documentation, some added error checking, and
980 code readability improvements.
982 * daemon-messages.h: Add the Error request type to improve error
985 * daemon-messages.c: Do a bit more error checking on send() and
986 recv(), and log errors with a higher severity level.
988 2002-07-04 Dick Porter <dick@ximian.com>
990 * daemon.c (process_process_fork): Fix argument handling, due to
991 buggy understanding of g_strsplit() behaviour.
993 2002-07-03 Dick Porter <dick@ximian.com>
996 * threads.c: Implement OpenThread(). Define access-control values
1002 * Makefile.am: Added access.h, to hold shared access-control
1005 2002-07-02 Dick Porter <dick@ximian.com>
1007 * wapi-private.h (_WAPI_HANDLE_VERSION): New protocol version
1009 2002-07-02 Dick Porter <dick@ximian.com>
1011 * handles.c (shared_init): Make a second attempt to contact the
1012 daemon if the shared memory attach succeeds, but the connect()
1013 fails. (This copes with the daemon crashing without cleaning up
1019 * shared.c (_wapi_shm_attach): Don't exec() anything when we fork
1020 the daemon, it's now built into the library.
1022 2002-06-25 Dick Porter <dick@ximian.com>
1025 * handles-private.h:
1026 * daemon-messages.h:
1027 * daemon.c: Process forking and handle data management
1030 * process-private.h:
1031 * processes.c: Process forking and other support functions
1033 2002-06-25 Dick Porter <dick@ximian.com>
1035 * versioninfo.h: PE resource decoding
1037 * unicode.c (_wapi_unicode_to_utf8): g_utf16_to_utf8 doesnt need
1038 to be told the string length
1040 * io.c: Removed the ACTUALLY_DO_UNICODE option. Fixed some leaks.
1041 Moved _wapi_time_t_to_filetime and the WapiFileTime typedef to
1044 2002-06-12 Dick Porter <dick@ximian.com>
1047 * daemon-messages.c: Handle SIGPIPE in a non-stupid way in the
1048 daemon, if MSG_NOSIGNAL isn't available. Thanks to Jaroslaw
1049 Kowalski <jarek@atm.com.pl> for pointing out the bogosity.
1051 2002-06-10 Jaroslaw Kowalski <jarek@atm.com.pl>
1053 * sockets.c, daemon-messages.c: Prevent SIGPIPE from being raised
1054 when writing to a closed socket.
1056 2002-06-08 Jeffrey Stedfast <fejj@ximian.com>
1058 * mono-mutex.c (mono_once): New convenience function for my
1063 * critical-sections.c:
1071 * atomic.c: Use mono_once() rather than pthread_once().
1073 2002-06-06 Jeffrey Stedfast <fejj@ximian.com>
1075 * handles.c (_wapi_handle_new): pthread_once() is not atomic, so
1076 if multiple threads all try to call _wapi_handle_new() before the
1077 shared data has been initialized, it is possible that we could get
1078 into a condition where shared_init() is being executed and later
1079 threads will pass by pthread_once() due to the fact that it has
1080 already been called and so therefor will attempt to use the shared
1081 data before it has been completely initialized. If we instead use
1082 a standard mutex locking mechanism around shared_init(), we can
1083 avoid the situation entirely. By wrapping the mutex locking in a
1084 check to see if we've already initialized the data, we can even
1085 avoid wasting resources by having to lock/unlock the mutex in any
1086 later calls (the only time we'd have to worry about
1087 locking/unlocking is the initial race to call shared_init() at
1090 Sat Jun 1 13:27:11 CEST 2002 Paolo Molaro <lupus@ximian.com>
1092 * atomic.h: inline asm fixes from Dennis Haney (davh@davh.dk).
1094 Fri May 31 16:21:54 CEST 2002 Paolo Molaro <lupus@ximian.com>
1096 * daemon.c, handles.c: rename "sun" local var since it's apparently
1097 a #define on Solaris.
1099 Fri May 31 15:40:14 CEST 2002 Paolo Molaro <lupus@ximian.com>
1101 * daemon-messages.c: work-around MSG_NOSIGNAL missing on some
1104 2002-05-15 Dick Porter <dick@ximian.com>
1106 * wait.c: Fix a deadlock in WaitForMultipleObjects
1108 2002-05-14 Dick Porter <dick@ximian.com>
1110 * io.c: Fix a cut&paste error, found by
1111 Jaroslaw Kowalski <jarek@atm.com.pl>
1113 2002-05-10 Dan Lewis <dihlewis@yahoo.co.uk>
1117 2002-05-09 Dick Porter <dick@ximian.com>
1123 * handles-private.h:
1125 * Makefile.am: Remove now-unused file wait-private.h
1127 2002-05-08 Dick Porter <dick@ximian.com>
1129 * shared.c: Better error messages, and report when daemon
1130 connection fails rather than blocking forever. Do some more
1131 shared memory sanity checking.
1133 * handles.c: Better error messages when connecting to shared
1134 memory and the handle daemon. Fall back to non-shared handles if
1135 an error occurs. Set the default back to 'shared handles'. Fix a
1136 crashing bug in scratch space allocation that mangled the block
1139 2002-05-07 Miguel de Icaza <miguel@ximian.com>
1141 * handles.c (shared_init): Disable SHM for now, people have too
1142 many problems with this, and the diagnostics are not helping.
1144 2002-05-06 Dan Lewis <dihlewis@yahoo.co.uk>
1146 * io.c: CreateFile sets win32 last error.
1148 2002-05-05 Dick Porter <dick@ximian.com>
1151 * handles-private.h:
1157 * process-private.h:
1159 * semaphore-private.h:
1163 * event-private.h: Simplify the WapiHandleOps struct: take out all
1164 the file-specific entries, leaving just the items that operate on
1165 handles themselves. Split the close operation into shared and
1166 private parts: shared close is called by the daemon.
1168 * handles.c: As above, but also pass handle allocation, ref and
1169 unref operations to the daemon. Populate the handle_ops array at
1170 compile time, because the daemon needs to call ops on handles too.
1171 Don't bother to track open handle counts any more, the daemon does
1175 * thread-private.h: As above, but also make the thread data
1178 * shared.c: Fork a handle daemon if the calling process created
1179 the shared memory segment.
1182 * daemon-messages.c:
1183 * daemon-messages.h:
1184 * Makefile.am: Build a daemon to manage handle allocation and
1185 destruction without needing to lock the shared memory
1187 2002-04-30 Jeffrey Stedfast <fejj@ximian.com>
1189 * atomic.c: Changed to use a normal mutex rather than a spinlock
1190 since a lot of platforms seem to not have them :\
1192 2002-04-30 Dick Porter <dick@ximian.com>
1194 * Completely rewrote the handle waiting code: removed the helper
1195 thread and its attendant complexity. All handle waiting is now
1196 abstracted into the WaitForSingleObject() and
1197 WaitForMultipleObjects() functions.
1199 * Implemented inter-process sharing of handles using sysv shared
1200 memory. This makes handles even more opaque, with a handle now
1201 just an index into an array.
1203 2002-04-25 Dan Lewis <dihlewis@yahoo.co.uk>
1205 * io.c: unitialized pointer in GetCurrentDirectory.
1207 Sat Apr 20 13:37:39 CEST 2002 Paolo Molaro <lupus@ximian.com>
1209 * threads.c: destroy the mutex at thread destruction
1210 (if/when thread destruction code will be actually called).
1211 When protecting a tls data pointer from the gc, use also the
1212 thread id in the key.
1214 Wed Apr 17 18:36:27 CEST 2002 Paolo Molaro <lupus@ximian.com>
1216 * timed-thread.c: avoid race condition when setting the thread to
1219 2002-04-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
1221 * jit.h: to more #include lines to avoid breaking compilation
1222 under windows when upgrading mingw and w32api to version
1225 2002-04-16 Dick Porter <dick@ximian.com>
1227 * atomic.h: Explanatory comment about lack of 80386 support
1229 2002-04-15 Dick Porter <dick@ximian.com>
1231 * atomic.h: use xaddl for InterlockedIncrement() and
1232 InterlockedDecrement(). Use cmpxchgl in a loop for
1233 InterlockedExchange() and InterlockedExchangePointer().
1235 Mon Apr 15 13:31:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
1237 * unicode.c: fix unicode_len() to not access uninitialized memory
1238 (and updated to conform to mono code style).
1240 Fri Mar 29 17:15:11 CET 2002 Paolo Molaro <lupus@ximian.com>
1242 * io.c: EEXISTS is ignored for directory creation.
1243 * mono-mutex.h: remove silly "pragma }" that emacs users insert
1244 because they use a broken editor:-)
1246 2002-03-28 Dick Porter <dick@ximian.com>
1252 * handles.c: Warning cleanups
1254 2002-03-27 Dan Lewis <dihlewis@yahoo.co.uk>
1256 * unicode.h, unicode.c: changed to gunichar2
1257 * io.h, io.c: changed strings to gunichar2*, added
1258 SetFileAttributes(), GetCurrentDirectory(), SetCurrentDirectory(),
1259 some fixes to FindFirstFile() and friends.
1261 2002-03-26 Dick Porter <dick@ximian.com>
1263 * types.h: Implement the large integer struct
1266 * timefuncs.c: Dummy functions that don't yet implement
1267 QueryPerformanceCounter() and QueryPerformanceFrequency()
1270 * threads.c: Implement SleepEx()
1273 * system.c: Beginnings of GetSystemInfo()
1275 * mono-mutex.c (pthread_mutex_timedlock): Fix a ms/ns conversion
1279 * context.c: Dummy function that doesnt yet implement
1283 * atomic.c: Interlocked functions
1285 Mon Mar 25 13:01:40 CET 2002 Paolo Molaro <lupus@ximian.com>
1287 * threads.c: use a gc-safe hash table to store tls pointers.
1289 2002-03-22 Dick Porter <dick@ximian.com>
1291 * threads.c: Fix a race condition where a thread can start and
1292 exit before the handle has been properly initialised (no reason
1293 why the handle couldn't be initialised beforehand, so do so)
1295 Fix a ms to ns conversion magnitude thinko.
1297 2002-03-21 Dick Porter <dick@ximian.com>
1299 * semaphores.c: Fix a problem when waiting for one or more
1300 semaphores, and another semaphore is Released (all waiting
1301 semaphores assumed they were signalled)
1303 2002-03-29 Dan Lewis <dihlewis@yahoo.co.uk>
1305 * io.h, io.c, uglify.h: added MoveFile, CopyFile, CreateDirectory,
1306 RemoveDirectory, GetFileAttributes, GetFileAttributesEx
1308 2002-03-19 Dietmar Maurer <dietmar@ximian.com>
1310 * threads.c (Sleep): bug fix: 1ms == 1000000ns
1312 2002-03-19 Dan Lewis <dihlewis@yahoo.co.uk>
1314 * io.h, io.c, events.c, mutexes.c, semaphores.c, sockets.c,
1315 threads.c, io.c: added flush method to handles.
1317 * io.c: FlushFileBuffers() and FindFirstFile() functions.
1319 Thu Mar 7 17:21:52 CET 2002 Paolo Molaro <lupus@ximian.com>
1321 * threads.c, timed-thread.c, wait.c: Boehm-GC anable.
1323 2002-02-20 Dick Porter <dick@ximian.com>
1325 * io-layer.h: Always build without cygwin support on windows
1327 Mon Feb 18 15:50:59 CET 2002 Paolo Molaro <lupus@ximian.com>
1329 * sockets.c: #undef DEBUG.
1331 2002-02-14 Jeffrey Stedfast <fejj@ximian.com>
1333 * io-layer.h: conditionally include sys/filio.h and sys/sockio.h
1334 for FIONBIO, FIONREAD, and SIOCATMARK.
1336 2002-02-14 Jeffrey Stedfast <fejj@ximian.com>
1338 * sockets.c: conditionally include sys/filio.h and sys/sockio.h
1339 for FIONBIO, FIONREAD, and SIOCATMARK.
1341 2002-02-13 Dick Porter <dick@ximian.com>
1343 * sockets.c: Implement shutdown and select
1345 2002-02-13 Jeffrey Stedfast <fejj@ximian.com>
1347 * mono-mutex.[c,h]: New source files that thinly wrap all pthread
1348 functions that take pthread_mutex_t and/or pthread_mutexattr_t
1349 arguments for the sake of portability. Implements recursive
1350 mutexes and pthread_mutex_timedlock.
1352 * critical-sections.c:
1359 * wait.c: Use the mono-mutex wrapper portability functions/macros.
1361 * pthread-compat.[c,h]: Replaced by mono-mutex.[c,h]
1363 2002-01-23 Dick Porter <dick@ximian.com>
1365 * sockets.c: Networking support, mostly wrapping BSD socket APIs
1366 with handle code, and translating errno into w32 error codes.
1368 * macros.h: Some w32 macros used with the socket support
1370 * error.c: Implemented GetLastError() and SetLastError()
1372 * Makefile.am: Added sockets, with kludge to override some symbols
1374 2001-12-17 Dietmar Maurer <dietmar@ximian.com>
1376 * unicode.c (_wapi_unicode_to_utf8): byteswap UTF16 strings before
1377 passing them to iconv
1378 (_wapi_unicode_to_utf8): only swap bytes on LE systems, remove bug
1379 from previous commit.
1381 2001-12-11 Dick Porter <dick@ximian.com>
1383 * io.c: Implement DeleteFile(), GetFileTime(), SetFileTime() and
1384 FileTimeToSystemTime().
1386 * unicode.c (unicode_len): Nasty way of finding length of unicode
1387 string with embedded NULLs (counts until two NULLs together).
1389 * mutexes.c (mutex_close):
1390 * events.c (event_close): Release the internal pthreads resources
1392 2001-11-26 Dick Porter <dick@ximian.com>
1394 * critical-sections.c:
1402 * wait.c: turn off DEBUG messages
1404 2001-11-22 Dick Porter <dick@ximian.com>
1406 * handles.c (SignalObjectAndWait): Implement
1408 * wait.c (WaitForSingleObject): Fix case where timeout == 0
1414 * events.c: Support for SignalObjectAndWait
1416 2001-11-21 Dick Porter <dick@ximian.com>
1423 * wait.c: Reliable method of returning which handle was signalled
1424 on return from WaitForMultipleObjects().
1426 2001-11-21 Dick Porter <dick@ximian.com>
1428 * events.c: Implement events
1430 2001-11-15 Dick Porter <dick@ximian.com>
1432 * mutexes.c: Implement mutexes
1436 * misc.c: Factor out some common code
1438 2001-11-13 Dick Porter <dick@ximian.com>
1440 * threads.c: Implement TLS. Implement GetCurrentThreadId(), and
1441 GetCurrentThread() by maintaining a hash of thread handles.
1443 * threads.h: Define thread and process creation flags
1445 2001-11-12 Dick Porter <dick@ximian.com>
1447 * critical-sections.c: Implement critical sections
1449 2001-11-12 Dick Porter <dick@ximian.com>
1451 * semaphores.c: Implement semaphores
1453 * wait.c (wait_for_item): Maintain a wait count rather than count
1456 * threads.c (thread_wait_multiple): Don't lock the wait item, that
1457 will block other wait threads
1459 2001-11-11 Dick Porter <dick@ximian.com>
1461 * Makefile.am: Rename some automake variables
1462 (from Nick Drochak <ndrochak@gol.com>)
1464 2001-11-10 Dick Porter <dick@ximian.com>
1466 * Makefile.am (libwapiincludedir): Fix include destination
1468 * .cvsignore: Ignore generated files
1470 2001-11-10 Dietmar Maurer <dietmar@ximian.com>
1472 * pthread-compat.c: added some include files to make it compile on
1475 2001-11-08 Dick Porter <dick@ximian.com>
1479 This is a library emulating the win32 threading and IO API.