1 2004-05-10 Gonzalo Paniagua Javier <gonzalo@ximian.com>
4 (SetFileAttributes): don't the the exec bit if the corresponding read
7 2004-05-10 Zoltan Varga <vargaz@freemail.hu>
9 * io.c (FindFirstFile): Fix invalid free.
11 2004-05-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13 * io.c: translate from GFileError to errno codes and don't free
14 variables right after calling mono_io_scandir, as we may overwrite
17 2004-05-08 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19 * io.c: g_dir_open return ENOENT for directories on which we don't have
20 read/execute permission, while returning EPERM for anything below those.
21 So, change ENOENT by EPERM if the directory exists.
23 2004-05-07 Dick Porter <dick@ximian.com>
25 * io.c (SetFileAttributes): Don't have failed chmod()s cause a
26 "file not found" error. Fixes bug 54032.
28 2004-05-07 Dick Porter <dick@ximian.com>
30 * io.c (FindFirstFile): Comment out a windows-compatibility check
31 that breaks when directories have metachars in their names.
32 Workaround for bug 58116.
34 2004-05-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
36 * io.c: fixed for FindFirstFile for empty directories. Closes
39 2004-05-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
41 * processes.c: set the start time for the current process. Fixes bug
44 2004-05-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
46 * io-private.h: 'namelist' is now a gchar ** in _WapiHandlePrivate_find.
47 * io.c: implemented scandir using glib functions.
49 2004-05-04 Dick Porter <dick@ximian.com>
51 * daemon.c (read_message): Return FALSE on error so the GSource
52 callback itself can return FALSE. Cures the infinite loop poll()
54 * shared.c: Fix some daemon startup race conditions.
56 2004-04-29 Miguel de Icaza <miguel@ximian.com>
58 * io.c (CopyFile): Use 32k buffers to copy the file instead of 2k,
59 use the stack, do not use dynamic memory.
61 2004-04-29 Zoltan Varga <vargaz@freemail.hu>
63 * io.c: Add scandir implementation for platforms which do not have
66 2004-04-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
68 * io.[ch]: implemented GetLogicalDriveStrings.
70 2004-04-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
73 * sockets.c: use the field name from configure when accessing sigval
74 pointer field. Makes this work on the Mac.
76 2004-04-28 Bernie Solomon <bernard@ugsolutions.com>
78 * atomic.c: (InterlockedExchange) fix typo for
81 2004-04-28 Gonzalo Paniagua Javier <gonzalo@ximian.com>
84 * sockets.c: added check for sys/aio.h.
86 2004-04-28 Gonzalo Paniagua Javier <gonzalo@ximian.com>
88 * error.[ch]: added _wapi_get_win32_file_error...
89 * io.c: ... which was _wapi_get_win32_error here.
90 * sockets.c: rename the function calls here too.
92 2004-04-28 Dick Porter <dick@ximian.com>
94 * daemon-messages.c: Avoid a deadlock when a thread is killed while
95 waiting for the daemon by using a recursive mutex. Helps bug 56699.
97 2004-04-28 Gonzalo Paniagua Javier <gonzalo@ximian.com>
99 * io.c: fixed leak in async_notifier().
101 * sockets.[ch]: added AIO support for sockets and fixed WSAIoctl
104 * threads.c: removed old comment.
106 2004-04-26 David Waite <mass@akuma.org>
115 * wapi-private.h: remove comma from end of enumeration declarations
116 * status.h: cast unsigned int types to int for enum assignment
118 2004-04-26 David Waite <mass@akuma.org>
121 * timefuncs.c: declare 64-bit constants as long long types (i.e.
124 2004-04-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
126 * socket-wrappers.h: _wapi_socket == WSASocket now. Added
129 * sockets.c: new unused parameters for _wapi_socket.
131 2004-04-22 Miguel de Icaza <miguel@ximian.com>
133 * timed-thread.c: Replace sem_init with MONO_SEM_INIT to handle
134 the fact that MacOS X is a piece of junk (sem_init is *defined* in
135 the libc, but they return `not implemented').
137 2004-04-22 Dick Porter <dick@ximian.com>
140 * handles-private.h: Reference the handle when it is locked, so
141 that another thread can't blow it away while we're waiting for it
157 * critical-sections.c:
158 * atomic.c: Added pthreads cleanup handlers and error asserts
161 * handles.c: Fixed the gcc "variable might be used uninitialised"
162 warnings. They can't happen, but gcc doesn't know that
163 g_assert()s don't return.
165 Fixed the declaration of _wapi_handle_process_kill() so that it
166 expects the correct type for the pid.
168 * threads.c: Removed the TLS_PTHREAD_MUTEX style locking that
169 hasn't been used in ages and just made the code more complex.
171 2004-04-17 Zoltan Varga <vargaz@freemail.hu>
173 * processes.c: Include <signal.h> for SIGKILL and SIGILL + fix some
174 warnings. Fixes #57168.
176 2004-04-16 Dick Porter <dick@ximian.com>
178 * threads.c (Sleep): Using div(3) with a negative (when signed)
179 numerator causes the quotient to be 0 and the remainder to be the
180 numerator. This feeds a small negative value to nanosleep(3),
181 which will return immediately and cause a busy wait. Fixes bug
184 2004-04-15 Dick Porter <dick@ximian.com>
187 * io.c: Rewrite FindFirstFile and FindNextFile using scandir(3)
188 and fnmatch(3) instead of glob(3). glob() can't cope with being
189 given filenames containing metachars. This fixes bug 40557.
191 2004-04-14 Bernie Solomon <bernard@ugsolutions.com>
193 * security.c: #warning is a GCC-ism
195 2004-04-13 Sebastien Pouliot <sebastien@ximian.com>
197 * security.c: Removed GetUserName as glib g_get_user_name does a
198 better (portability) job. Added ImpersonateLoggedOnUser and
201 2004-04-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
203 * mono-mutex.h: move pthread_mutex_timedlock declaration to...
204 * mono-mutex.c: ...here. It was causing a warning that prevented
205 libgdiplus compilation.
207 2004-04-04 Miguel de Icaza <miguel@ximian.com>
209 * security.c (GetUserName): Make it work on MacOS X
211 2004-04-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
213 * security.c: use getpwuid_r if available. This one is thread-safe.
215 2004-04-02 Sebastien Pouliot <sebastien@ximian.com>
217 * Makefile.am: Added security.c|h.
218 * security.c: New file for security related functions. Added function
219 GetUserName to fix #56144.
220 * security.h: New. Header file for security.c
221 * wapi.h: Added include for security.h
223 2004-03-25 Gonzalo Paniagua Javier <gonzalo@ximian.com>
225 * daemon-messages.h: added kill structs.
227 * daemon.c: implemented process_process_kill.
228 * handles-private.h: define process_process_kill.
229 * handles.c: implemented _wapi_handle_process_kill.
230 * processes.[ch]: implemented TerminateProcess.
232 2004-03-25 Bernie Solomon <bernard@ugsolutions.com>
234 * daemon.c (rem_fd): On solaris you seem to get an
235 error even after removing the input source so don't
236 try and rem_fd it twice.
238 2004-03-25 Lluis Sanchez Gual <lluis@ximian.com>
240 * daemon.c: in process_post_mortem, If the child terminated due to the
241 receipt of a signal, the exit status must be based on WTERMSIG, since
242 WEXITSTATUS returns 0 in this case.
244 2004-03-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
246 * daemon.c: turned a warning into a DEBUG statement. Now we may hit it.
248 2004-03-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
250 * daemon.c: only call getdtablesize () once.
251 * processes.c: wait 500 ms to check if execve failed and throw the same
252 exception as MS on failure. Fixes bug #32809.
254 2004-03-17 Bernie Solomon <bernard@ugsolutions.com>
256 * io.c (async_notifier): use "union sigval" rather
257 than sigval_t as Solaris doesn't have sigval_t
258 (which isn't in IEEE 1003.1 either).
260 2004-03-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
262 * io.c: added debug stuff and removed a few redundant lines in
265 2004-03-15 Gonzalo Paniagua Javier <gonzalo@ximian.com>
267 * io-private.h: added new fields for file structure. Declare
268 _wapi_io_add_callback.
270 * io.c: added _wapi_get_win32_error, support aio_read/write in
271 file_read/write. Implemented _wapi_io_add_callback, which is where
274 * io.h: added new fields for WapiOverlapped and typedef for the
277 * processes.c: fixed off-by-one bug when handling environment variables
280 * threads.[ch]: implemented BindIoCompletionCallback.
282 * uglify.h: added typedef for LPOVERLAPPED_COMPLETION_ROUTINE.
284 2004-03-14 Zoltan Varga <vargaz@freemail.hu>
286 * socket-wrappers.h: Remove extra semicolon.
288 2004-03-03 Dave Camp <dave@ximian.com>
290 * daemon.c: (add_fd), (fd_activity), (_wapi_daemon_main):
291 Use a new main context.
293 2004-03-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
296 (GetFileAttributes): set the error depending on errno instead of
297 setting ERROR_FILE_NOT_FOUND always. See bug #55160.
299 2004-03-01 Gonzalo Paniagua Javier <gonzalo@ximian.com>
302 (CopyFile): free the buffer on error.
304 (WSAIoctl): free the buffer on error.
306 2004-02-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
308 * error.c: fixed mapping for EPROTONOSUPPORT and ESOCKTNOSUPPORT.
310 * sockets.[ch]: retry creating the socket for AF_INET, SOCK_RAW
311 using IP protocol with IP over IP. Implemented WSAIoctl UNIX-style.
313 2004-01-27 Bernie Solomon <bernard@ugsolutions.com>
315 * shared.c (_wapi_shm_file): add hostname
316 to shared data file names to handle NFS mounted
319 Mon Jan 26 16:15:03 CET 2004 Paolo Molaro <lupus@ximian.com>
321 * sockets.h: remove obsolete soklen_t typedef.
323 Fri Jan 23 21:07:02 CET 2004 Paolo Molaro <lupus@ximian.com>
325 * socket-wrappers.h, sockets.h, sockets.c, Makefile.am: move socket
326 wrappers to its own non-installed header file.
328 2004-01-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
331 (FindFirstFile): unlock the handle if FindNextFile fails.
332 (FindNextFile): g_free a couple of pointers before retrying.
335 (WaitForMultipleObjects): if only one handle provided, use
338 2003-12-22 Bernie Solomon <bernard@ugsolutions.com>
340 * handles-private.h: (_wapi_handle_type) check
341 for segment in range before using it
343 2003-12-22 Bernie Solomon <bernard@ugsolutions.com>
345 * thread-private.h: _wapi_thread_ops is now const
348 Mon Dec 22 18:29:03 CET 2003 Paolo Molaro <lupus@ximian.com>
350 * threads.c, timed-thread.c, timed-thread.h: use mach
351 semaphores on Darwin (MacOSX) since the posix ones
352 are mostly broken there (threads are not created suspended
353 and they can start executing before they are fully initialized
354 like in tests/thread-static.cs).
356 Mon Dec 22 17:18:45 CET 2003 Paolo Molaro <lupus@ximian.com>
358 * atomic.h: ppc fixes.
360 2003-12-19 Bernie Solomon <bernard@ugsolutions.com>
362 * handles.c: remove my bad use of MONO_ZERO_ARRAY_LENGTH
365 2003-12-15 Bernie Solomon <bernard@ugsolutions.com>
367 * shared.c: (_wapi_shm_open) make scratch file
368 not have to immediately regrow to avoid remaps
369 (HPUX can't cope with these).
370 (_wapi_shm_attach) use actual size of file
371 to set scratch data_len for the creating process.
373 * handles.c: (_wapi_handle_new_internal) make
374 sure mutex & cond var are initialized even for
375 non process shared ones.
376 (_wapi_handle_unref) always call destroy
377 routines on mutex & cond var
379 2003-12-15 Bernie Solomon <bernard@ugsolutions.com>
381 * daemon.c: change channel data structure so
382 input sources are removed from glib event loop
383 properly. xsp works better on Solaris and
386 2003-12-12 Bernie Solomon <bernard@ugsolutions.com>
388 * wapi-private.h: Replace G_GNUC_PRETTY_FUNCTION
389 definition with file & line number for non-GCC
392 2003-12-08 Bernie Solomon <bernard@ugsolutions.com>
394 * Makefile.am: make sure hppa_atomic.s is in distribution
396 2003-12-01 Dick Porter <dick@ximian.com>
399 * mutexes.c (CreateMutex):
400 * mutex-private.h (struct _WapiHandle_mutex):
401 * handles.c: Look up certain handle types by name, in a shared
402 namespace. Currently only mutex handles have this implemented.
405 * semaphores.c (CreateSemaphore):
406 * events.c (CreateEvent): Fix signature
408 2003-11-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
410 * io.c: don't call g_free before testing errno as it may modify it.
411 If the path exists, return an error if it's not a directory. Fixes
414 2003-11-20 Dick Porter <dick@ximian.com>
416 * io.c: Missed a little-endian UTF16 conversion. Patch from
417 Jeroen Zwartepoorte (Jeroen@xs4all.nl), fixes bug 51065.
419 2003-10-29 Dick Porter <dick@ximian.com>
421 * io.c (MoveFile): If the move crosses filesystems, try and fall
422 back to copy and delete. Patch from Jörg Rosenkranz
423 (JoergR@voelcker.com), fixes bug 50298.
425 2003-10-28 Dick Porter <dick@ximian.com>
427 * io.c: Use the new encoding conversion to cope with non-utf8
428 locales in filenames.
430 * processes.c: Ditto for process arguments.
432 Tue Oct 21 12:01:14 CEST 2003 Paolo Molaro <lupus@ximian.com>
434 * atomic.h: some ppc inline asm fixes (incorrect use of labels,
435 incorrect register constraints, incorrect clobber lists).
437 2003-10-13 Bernie Solomon <bernard@ugsolutions.com>
439 * Makefile.am hppa_atomic.s: add HP 64bit
440 implementation of atomic ops
442 2003-10-13 Zoltan Varga <vargaz@freemail.hu>
444 * threads.c (CreateThread): Wrap pthread_attr_setstacksize call in
445 a conditional for platforms that don't have it.
447 2003-10-09 Bernie Solomon <bernard@ugsolutions.com>
449 * threads.c: (CreateThread) use stacksize argument
450 if non-zero - change default for 64 bits to 4Mb
452 2003-09-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
454 * sockets.c: set last error when socket creation fails. This shed some
457 2003-09-28 Gonzalo Paniagua Javier <gonzalo@ximian.com>
459 * processes.c: fixed bug #48973: we only change \ by / for the argument
460 to be used as command.
461 When getting the program name from the args, don't let the space between
464 2003-09-24 Bernie Solomon <bernard@ugsolutions.com>
466 * atomic.h atomic.c: fix sparc so lock is
467 global, increment does so and it compiles under Sun compiler.
469 2003-09-22 Bernie Solomon <bernard@ugsolutions.com>
471 * handles.c: include <string.h> directly as may
472 not be nested in <sys/un.h> like Linux
474 2003-09-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
477 (DeleteFile): call SetLastError on failure. Fix by
478 richard.torkar@htu.se (Richard Torkar). Closes bug #48222.
480 2003-09-15 Lluis Sanchez Gual <lluis@ximian.com>
482 * daemon.c: In compare_process(), discard handles already signalled.
484 2003-09-02 Dick Porter <dick@ximian.com>
486 * io.c: Work around glib brain-dead assumptions about utf8-encoded
487 filenames. Fixes bug 30781.
489 2003-08-28 Dick Porter <dick@ximian.com>
491 * critical-sections.c: Patch from Bernie Solomon
492 <bernard@ugsolutions.com> to emit a warning if locking a critical
495 2003-07-23 Dick Porter <dick@ximian.com>
498 * daemon.c (maybe_exit): Avoid the race condition when the daemon is
499 closing but another client comes along when the shared data is still
500 visible. Should fix bugs 33671 and 35213.
502 2003-07-23 Dick Porter <dick@ximian.com>
504 * handles.c: Initialise handle mutex and cond. Fix by
505 Bernie Solomon <bernard@ugsolutions.com>
507 2003-07-15 Dick Porter <dick@ximian.com>
509 * timed-thread.c (timed_thread_start_routine): Fix virtual memory
510 leak when threads quit. Fixes bug 44067.
512 Wed Jun 18 19:08:40 CEST 2003 Paolo Molaro <lupus@ximian.com>
514 * io.c: never add write permission for group or others in
515 SetFileAttributes ().
517 2003-06-17 Dick Porter <dick@ximian.com>
519 * io.c (SetFileAttributes): Implement the ReadOnly attribute, and
520 ignore the unsupported ones ("fixes" bug 44977).
522 2003-06-17 Lluis Sanchez Gual <lluis@ximian.com>
524 * misc.c: fix bug in _wapi_calc_timeout. It gave wrong values for
525 high ms values (there was an overflow).
527 2003-06-17 Zoltan Varga <vargaz@freemail.hu>
529 * system.h (struct _WapiSystemInfo ): Fix warnings when using gcc-3.3.
531 2003-06-11 Dick Porter <dick@ximian.com>
533 * shared.c: Fix shared directory creation. Patch from
534 Pablo Baena <pbaena@uol.com.ar>
536 2003-06-10 Dick Porter <dick@ximian.com>
538 * atomic.c: Delete the useless compile warning
540 2003-06-09 Dick Porter <dick@ximian.com>
542 * daemon.c: Lookup env as a string array. Fixes bug 44289. Also
543 make setting the process handle value in the environment actually
546 * processes.c: Pretty up the process name, if it happens to be
547 "mono" such as when another mono process forks "mono foo.exe"
549 2003-06-05 Dick Porter <dick@ximian.com>
551 * processes.c (process_set_current): Don't do an expensive handle
552 search at application startup, check the environment to see if the
553 process handle has already been created.
555 * io.c: Don't do an expensive handle search when creating stdin,
556 stdout and stderr handles, just create them all the first time one
566 * daemon.c: Support for "unlimited" number of handles and scratch
569 Speed up application startup by passing process handle in the
570 environment, rather than let the app scan all handles (which gets
571 really slow when there are more than a few thousand to check.)
573 Initialise some structs passed to syscalls, noticed by valgrind.
576 2003-05-20 Dick Porter <dick@ximian.com>
578 * io.c (FindFirstFile): Include . files in the glob. Fixes bug
581 2003-05-19 Dick Porter <dick@ximian.com>
583 * threads.c: Set the new thread's stack size to 2M. Fix needed
584 for BSD, reported by Martin Dvorak <md@9ll.cz>
586 2003-05-16 Dick Porter <dick@ximian.com>
589 * io.c: Implement GetTempPath()
591 2003-05-16 Dick Porter <dick@ximian.com>
593 * processes.c (CreateProcess): Set some error codes
595 2003-05-12 Dick Porter <dick@ximian.com>
597 * misc.c (_wapi_calc_timeout): Cope with overflowing tv_nsec.
598 Patch from Martin Dvorak <mdvorak@ninell.cz>.
600 2003-05-10 Dick Porter <dick@ximian.com>
602 * io.c (CopyFile): Copy file mode as well as file data. Based on
603 suggestion by Giuseppe Greco <giuseppe.greco@agamura.com>, bug
606 2003-05-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
608 * handles.c: don't call GC_gcollect when creating new handles.
610 2003-05-05 Gonzalo Paniagua Javier <gonzalo@ximian.com>
612 * handles.c: added some debugging code. Call GC_gcollect
613 before creating a new handle. It makes Lupus' test run smoother and
614 faster (from 62 to 83 request per second). Notice that calling
615 GC_finalizer_notifier if needed (GC_should_invoke_finalizer ()) does
616 not improve nor degrade the performance, so i don't do it.
618 2003-05-02 Dick Porter <dick@ximian.com>
620 * sockets.c: Rearrange closesocket() and socket_close_private(),
621 and remember to unref the handle, so we don't leak socket handles.
622 Fix from Pelle Johnsen <pelle.johnsen@mail.dk>
624 2003-04-11 Dick Porter <dick@ximian.com>
626 * atomic.h: ARM atomic operations by Malte Hildingson
627 <tds00mahi@tellus.thn.htu.se>
629 Tue Apr 8 11:37:29 CEST 2003 Paolo Molaro <lupus@ximian.com>
631 * atomic.h: fix macosx build by "Urs C. Muff" <umuff@quark.com>.
633 2003-04-03 Martin Baulig <martin@ximian.com>
635 The following change is conditional to `WITH_INCLUDED_LIBGC'
636 which is not yet enabled by default.
638 * threads.c (SuspendThread, ResumeThread): Fully implemented this.
639 (gc_init): New static function; install a signal handler for
640 SIGPWR which is used to suspend threads. [FIXME: it SIGPWR
641 doesn't exist on all Unix systems, we need to find another
643 (mono_wapi_push_thread_stack): New public function. Tells the
644 garbage collector about the current stack pointer of a suspended
647 2003-04-03 Martin Baulig <martin@ximian.com>
649 * timed-thread.h (TimedThread): Added `suspended_sem',
650 `suspend_count' and `stack_ptr'.
652 2003-03-28 Dick Porter <dick@ximian.com>
654 * atomic.h: PPC support gratiously donated to the public domain
655 by John Duncan <jddst19@mac.com>
657 2003-03-20 Dick Porter <dick@ximian.com>
659 * sockets.c (_wapi_connect): If connect() fails with EACCES, try
660 setting SO_BROADCAST and connecting again. Fixes bug 39178.
662 2003-03-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
664 * processes.c: included Jerome Laban's patch and call SetLastError when
665 the executable is not found.
667 2003-03-03 Dick Porter <dick@ximian.com>
669 * io.c (CreateFile): Try opening directories readonly, so that
670 timestamps can be adjusted. Patch by Elan Feingold
671 <efeingold@mn.rr.com>.
673 2003-02-25 Dick Porter <dick@ximian.com>
675 * shared.c (_wapi_shm_attach): Return a failure code on system
676 call errors, rather than exiting.
678 2003-02-21 Dick Porter <dick@ximian.com>
680 * processes.c (GetCurrentProcessId): Use the current process
681 handle to return the process ID, as getpid() is unreliable
682 (linuxthreads gives each thread a different pid). Fixes bug
685 2003-02-21 Dick Porter <dick@ximian.com>
687 * io.c (FindNextFile): Skip over dangling symlinks. Fixes bug
690 2003-02-11 Dick Porter <dick@ximian.com>
693 * timefuncs.c: Added GetTickCount()
695 2003-02-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
697 * error.c: added WSA_EHOSTUNREACH mapping.
699 2003-01-26 Miguel de Icaza <miguel@ximian.com>
701 * io.c (SetFileAttributes): This routine is not currently
702 implemented for the general case, but I added a special case to
703 set the executable bit on Linux.
705 Wed Jan 15 15:55:40 CET 2003 Paolo Molaro <lupus@ximian.com>
707 * sockets.h, daemon.c, io.c: compilation fixes on MacOSX.
709 2003-01-08 Dick Porter <dick@ximian.com>
711 * sockets.c: Fixed setting blocking mode to true (fixes bug 36388)
713 2002-12-11 Juli Mallett <jmallett@FreeBSD.org>
715 * daemon.c, handles-private.h, handles.c, wapi-private.h:
716 Check for an implementation which says it supports
717 _POSIX_THREAD_PROCESS_SHARED, rather than just one that
718 defines the symbol. Defined but with a value of -1 still
719 means that it is unsupported.
721 2002-12-08 Martin Baulig <martin@ximian.com>
723 * handles.c (_wapi_handle_new): Create new non-shared handles with
724 an initial refcount of 1, not 0.
726 2002-11-22 Dietmar Maurer <dietmar@ximian.com>
728 * threads.c (TlsGetValue): removed unnecessary mutex
730 2002-11-20 Dick Porter <dick@ximian.com>
732 * timed-thread.c (_wapi_timed_thread_attach): Attached threads
733 need to store their data structure too.
735 * threads.c: Make sure the threading data is initialised wherever
738 2002-11-15 Dick Porter <dick@ximian.com>
740 * timed-thread.c: Removed unneeded parameters in
741 _wapi_timed_thread_attach().
743 * threads.c: Renamed AttachThread() to make it not look like
744 external API. Removed unneeded parameters.
746 2002-11-11 Gonzalo Paniagua Javier <gonzalo@ximian.com>
748 * error.[ch]: added errno_to_WSA (). It displays a warning and return
749 WSASYSCALLFAILURE if there is no error mapping for the given errno,
751 * sockets.c: use errno_to_WSA and fixed display of warning for h_errno.
753 2002-10-31 Dick Porter <dick@ximian.com>
756 * io.c: Define and use INVALID_FILE_ATTRIBUTES
758 2002-10-07 Dick Porter <dick@ximian.com>
761 * daemon.c: Use a more accurate time source for process start and
764 2002-10-03 Dick Porter <dick@ximian.com>
768 * threads.c: Fixes for freebsd. Make sure that mutex and condition
769 creation and deletion happen in the process that owns them, when
770 POSIX shared thread objects aren't supported. This breaks on
771 freebsd, as pthread_t is a pointer to data.
773 2002-10-02 Dick Porter <dick@ximian.com>
775 * shared.c: Use mmap() instead of sysv shm for the shared data.
777 * wapi-private.h (_WAPI_HANDLE_VERSION): Reset back to 0, for the
781 * daemon.c: mmap()ed regions survive fork, so just pass the
782 pointer to _wapi_daemon_main instead of mapping it again.
784 2002-10-01 Dick Porter <dick@ximian.com>
786 * timed-thread.c: Kludge for CREATE_SUSPENDED thread creation.
787 Unfortunately libgc uses the same thread suspend technique that I
788 want to, and the two don't mix: libgc will deadlock when it tries
789 to stop the world if a thread has already been suspended by
790 someone else. Just do the simple suspended create rather than the
791 general purpose thread suspension for now.
793 * threads.c: Pass create flags to the timed_thread create call, to
794 implement suspended thread creation. ResumeThread() partially
795 implemented, to cope with the case where a newly created but
796 suspended thread is launched.
798 2002-09-30 Dick Porter <dick@ximian.com>
800 * sockets.c (ioctlsocket): Set non-blocking mode in a better way,
803 2002-09-27 Dick Porter <dick@ximian.com>
805 * semaphores.c: Only include semaphore.h if it's present. Patch
806 for BSD from jmmv@hispabsd.org (Julio Merino).
808 2002-09-27 Dick Porter <dick@ximian.com>
810 * processes.c: Pass environment and working directory to the
811 daemon when forking. Don't let argv[0] be duplicated when looking
812 for the program name. Implement EnumProcessModules (simple
813 version for now, lsof-style later if needed), GetModuleBaseName,
814 {Get,Set}ProcessWorkingSetSize (just faked, because the vm hints
815 aren't available on Linux).
817 * process-private.h: Store the process name, and the working set
821 * handles-private.h: New functions to store and retrieve an array
822 of strings in the scratch space
824 * daemon.c: Don't miss deleting some handles when a client exits
825 (we used to rely on the client doing the final cleanup, but
826 obviously if the client is no longer there the daemon has to do
829 Process forking now sets the environment and the working
832 * io.c: Don't confuse fd 0 with an unassigned handle struct
834 * atomic.h: Add a google cache alternative to the msdn URL
836 2002-09-25 Gonzalo Paniagua Javier <gonzalo@ximian.com>
839 (_wapi_recvfrom): added ECONNRESET to the switch.
841 2002-09-24 Mark Crichton <crichton@gimp.org>
843 * atomic.h: Yea. On linux, sparc isn't sparc, it's __sparc__.
846 2002-09-19 Mark Crichton <crichton@gimp.org>
848 * daemon.c, shared.c: Added NEED_LINK_UNLINK for systems that
849 dont have Linux's abstract filesystem for sockets.
851 2002-09-19 Mark Crichton <crichton@gimp.org>
853 * atomic.h: Added SPARC atomic asm code.
854 * daemon.c, handles-private.h, handles.c, wapi-private.h:
855 undefined _POSIX_THREAD_PROCESS_SHARED. This actually exists on
856 Solaris 9, however, the code paths don't seem to work. More testing
857 on the shared case is *really* needed.
859 2002-09-03 Dick Porter <dick@ximian.com>
862 * threads.c: Removed PosixKillThread(), because it's not in the
865 2002-08-20 Dick Porter <dick@ximian.com>
867 * handles.c (_wapi_handle_scratch_store): Made stored byte lengths
868 multiples of 4 bytes, to keep header structures aligned. Needed
869 for sparc, at least. (Patch from crichton@gimp.org)
871 * handles.c: Removed 'disable_shm' variable (we've defaulted to
872 building with shm enabled for months now)
874 2002-08-19 Dick Porter <dick@ximian.com>
876 * daemon.c: Rewrote the poll() loop to use GIOChannels instead,
877 for legacy NeXT-based systems.
879 2002-08-12 Dick Porter <dick@ximian.com>
881 * atomic.h: Rename some parameters to avoid c++ keywords (Patch
882 from Joseph Wenninger <kde@jowenn.at>)
884 2002-08-05 Dietmar Maurer <dietmar@ximian.com>
886 * threads.c: use fast spinlocks by default
888 2002-08-02 Dick Porter <dick@ximian.com>
890 * io.c (GetStdHandle): Add a handle reference when returning a
891 duplicate console handle. This fixes the unref_handle errors in
894 2002-08-01 Dietmar Maurer <dietmar@ximian.com>
896 * threads.c (TLS_PTHREAD_MUTEX): define this because else some
899 2002-08-01 Dick Porter <dick@ximian.com>
901 * threads.c: Use atomic spinlocks in TLS functions
904 * Makefile.am: Added mono-spinlock.h
906 2002-07-21 Jeffrey Stedfast <fejj@ximian.com>
908 * daemon-messages.c: #include <sys/types.h> and <sys/sockets.h> -
909 these are needed for sendmsg() and also for struct msghdr (at
910 least on Solaris). Solaris still won't build because struct msghdr
911 doesn't have msg_flags, msg_control, or msg_controllen members.
912 (CMSG_SPACE): Define for systems that don't have it.
915 2002-07-20 Dick Porter <dick@ximian.com>
921 * handles.c: Implemented pipe handles
924 * daemon.c: Fixed bug in handle closing.
927 * daemon.c: Forked processes now close all open file descriptors.
929 Fri Jul 19 19:05:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
931 * sockets.h, io-layer.h, critical-sections.h: don't include config.h
934 2002-07-19 Martin Baulig <martin@gnome.org>
936 * threads.c (ExitThread): Call exit() if no threads has been
939 2002-07-17 Dick Porter <dick@ximian.com>
941 * daemon-messages.c: Freebsd fixes from Andreas Kohn
942 <andreas.kohn@gmx.net>
944 2002-07-15 Dick Porter <dick@ximian.com>
946 * io.c: Removed bogus console_flush() method, that was just cut
947 and pasted from file_flush when I separated the two handle types.
949 2002-07-12 Dick Porter <dick@ximian.com>
951 * io.c (convert_from_flags): Fixed misunderstanding wrt fcntl
952 flags. Fixes bug 27633.
954 2002-07-12 Dick Porter <dick@ximian.com>
958 * daemon.c: Use size of sockaddr_un.sun_path from config.h
960 2002-07-12 Dick Porter <dick@ximian.com>
962 * processes.c (CreateProcess): Send stdin, stdout and stderr
963 handles if the startup info doesnt specify new ones
965 * io.c (GetStdHandle): Return the same handle when the same
966 standard handle is requested
968 * handles.c: Pass file descriptors when forking
970 * daemon.c: Use supplied file descriptors when forking a new
974 * daemon-messages.c: Pass stdin, stdout and stderr file
975 descriptors to the daemon (used when forking)
977 2002-07-11 Miguel de Icaza <miguel@ximian.com>
979 * daemon.c (_wapi_daemon_main): Use sizeof
980 (main_socket_address.sun_path) instead of hardcoded 108 value.
982 * handles.c (shared_init): Use sizeof
983 (shared_socket_address.sun_path) instead of hardcoded 108 value.
985 2002-07-10 Dennis Haney <davh@davh.dk>
989 * daemon.c: Lots of documentation, some added error checking, and
990 code readability improvements.
992 * daemon-messages.h: Add the Error request type to improve error
995 * daemon-messages.c: Do a bit more error checking on send() and
996 recv(), and log errors with a higher severity level.
998 2002-07-04 Dick Porter <dick@ximian.com>
1000 * daemon.c (process_process_fork): Fix argument handling, due to
1001 buggy understanding of g_strsplit() behaviour.
1003 2002-07-03 Dick Porter <dick@ximian.com>
1006 * threads.c: Implement OpenThread(). Define access-control values
1012 * Makefile.am: Added access.h, to hold shared access-control
1015 2002-07-02 Dick Porter <dick@ximian.com>
1017 * wapi-private.h (_WAPI_HANDLE_VERSION): New protocol version
1019 2002-07-02 Dick Porter <dick@ximian.com>
1021 * handles.c (shared_init): Make a second attempt to contact the
1022 daemon if the shared memory attach succeeds, but the connect()
1023 fails. (This copes with the daemon crashing without cleaning up
1029 * shared.c (_wapi_shm_attach): Don't exec() anything when we fork
1030 the daemon, it's now built into the library.
1032 2002-06-25 Dick Porter <dick@ximian.com>
1035 * handles-private.h:
1036 * daemon-messages.h:
1037 * daemon.c: Process forking and handle data management
1040 * process-private.h:
1041 * processes.c: Process forking and other support functions
1043 2002-06-25 Dick Porter <dick@ximian.com>
1045 * versioninfo.h: PE resource decoding
1047 * unicode.c (_wapi_unicode_to_utf8): g_utf16_to_utf8 doesnt need
1048 to be told the string length
1050 * io.c: Removed the ACTUALLY_DO_UNICODE option. Fixed some leaks.
1051 Moved _wapi_time_t_to_filetime and the WapiFileTime typedef to
1054 2002-06-12 Dick Porter <dick@ximian.com>
1057 * daemon-messages.c: Handle SIGPIPE in a non-stupid way in the
1058 daemon, if MSG_NOSIGNAL isn't available. Thanks to Jaroslaw
1059 Kowalski <jarek@atm.com.pl> for pointing out the bogosity.
1061 2002-06-10 Jaroslaw Kowalski <jarek@atm.com.pl>
1063 * sockets.c, daemon-messages.c: Prevent SIGPIPE from being raised
1064 when writing to a closed socket.
1066 2002-06-08 Jeffrey Stedfast <fejj@ximian.com>
1068 * mono-mutex.c (mono_once): New convenience function for my
1073 * critical-sections.c:
1081 * atomic.c: Use mono_once() rather than pthread_once().
1083 2002-06-06 Jeffrey Stedfast <fejj@ximian.com>
1085 * handles.c (_wapi_handle_new): pthread_once() is not atomic, so
1086 if multiple threads all try to call _wapi_handle_new() before the
1087 shared data has been initialized, it is possible that we could get
1088 into a condition where shared_init() is being executed and later
1089 threads will pass by pthread_once() due to the fact that it has
1090 already been called and so therefor will attempt to use the shared
1091 data before it has been completely initialized. If we instead use
1092 a standard mutex locking mechanism around shared_init(), we can
1093 avoid the situation entirely. By wrapping the mutex locking in a
1094 check to see if we've already initialized the data, we can even
1095 avoid wasting resources by having to lock/unlock the mutex in any
1096 later calls (the only time we'd have to worry about
1097 locking/unlocking is the initial race to call shared_init() at
1100 Sat Jun 1 13:27:11 CEST 2002 Paolo Molaro <lupus@ximian.com>
1102 * atomic.h: inline asm fixes from Dennis Haney (davh@davh.dk).
1104 Fri May 31 16:21:54 CEST 2002 Paolo Molaro <lupus@ximian.com>
1106 * daemon.c, handles.c: rename "sun" local var since it's apparently
1107 a #define on Solaris.
1109 Fri May 31 15:40:14 CEST 2002 Paolo Molaro <lupus@ximian.com>
1111 * daemon-messages.c: work-around MSG_NOSIGNAL missing on some
1114 2002-05-15 Dick Porter <dick@ximian.com>
1116 * wait.c: Fix a deadlock in WaitForMultipleObjects
1118 2002-05-14 Dick Porter <dick@ximian.com>
1120 * io.c: Fix a cut&paste error, found by
1121 Jaroslaw Kowalski <jarek@atm.com.pl>
1123 2002-05-10 Dan Lewis <dihlewis@yahoo.co.uk>
1127 2002-05-09 Dick Porter <dick@ximian.com>
1133 * handles-private.h:
1135 * Makefile.am: Remove now-unused file wait-private.h
1137 2002-05-08 Dick Porter <dick@ximian.com>
1139 * shared.c: Better error messages, and report when daemon
1140 connection fails rather than blocking forever. Do some more
1141 shared memory sanity checking.
1143 * handles.c: Better error messages when connecting to shared
1144 memory and the handle daemon. Fall back to non-shared handles if
1145 an error occurs. Set the default back to 'shared handles'. Fix a
1146 crashing bug in scratch space allocation that mangled the block
1149 2002-05-07 Miguel de Icaza <miguel@ximian.com>
1151 * handles.c (shared_init): Disable SHM for now, people have too
1152 many problems with this, and the diagnostics are not helping.
1154 2002-05-06 Dan Lewis <dihlewis@yahoo.co.uk>
1156 * io.c: CreateFile sets win32 last error.
1158 2002-05-05 Dick Porter <dick@ximian.com>
1161 * handles-private.h:
1167 * process-private.h:
1169 * semaphore-private.h:
1173 * event-private.h: Simplify the WapiHandleOps struct: take out all
1174 the file-specific entries, leaving just the items that operate on
1175 handles themselves. Split the close operation into shared and
1176 private parts: shared close is called by the daemon.
1178 * handles.c: As above, but also pass handle allocation, ref and
1179 unref operations to the daemon. Populate the handle_ops array at
1180 compile time, because the daemon needs to call ops on handles too.
1181 Don't bother to track open handle counts any more, the daemon does
1185 * thread-private.h: As above, but also make the thread data
1188 * shared.c: Fork a handle daemon if the calling process created
1189 the shared memory segment.
1192 * daemon-messages.c:
1193 * daemon-messages.h:
1194 * Makefile.am: Build a daemon to manage handle allocation and
1195 destruction without needing to lock the shared memory
1197 2002-04-30 Jeffrey Stedfast <fejj@ximian.com>
1199 * atomic.c: Changed to use a normal mutex rather than a spinlock
1200 since a lot of platforms seem to not have them :\
1202 2002-04-30 Dick Porter <dick@ximian.com>
1204 * Completely rewrote the handle waiting code: removed the helper
1205 thread and its attendant complexity. All handle waiting is now
1206 abstracted into the WaitForSingleObject() and
1207 WaitForMultipleObjects() functions.
1209 * Implemented inter-process sharing of handles using sysv shared
1210 memory. This makes handles even more opaque, with a handle now
1211 just an index into an array.
1213 2002-04-25 Dan Lewis <dihlewis@yahoo.co.uk>
1215 * io.c: unitialized pointer in GetCurrentDirectory.
1217 Sat Apr 20 13:37:39 CEST 2002 Paolo Molaro <lupus@ximian.com>
1219 * threads.c: destroy the mutex at thread destruction
1220 (if/when thread destruction code will be actually called).
1221 When protecting a tls data pointer from the gc, use also the
1222 thread id in the key.
1224 Wed Apr 17 18:36:27 CEST 2002 Paolo Molaro <lupus@ximian.com>
1226 * timed-thread.c: avoid race condition when setting the thread to
1229 2002-04-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
1231 * jit.h: to more #include lines to avoid breaking compilation
1232 under windows when upgrading mingw and w32api to version
1235 2002-04-16 Dick Porter <dick@ximian.com>
1237 * atomic.h: Explanatory comment about lack of 80386 support
1239 2002-04-15 Dick Porter <dick@ximian.com>
1241 * atomic.h: use xaddl for InterlockedIncrement() and
1242 InterlockedDecrement(). Use cmpxchgl in a loop for
1243 InterlockedExchange() and InterlockedExchangePointer().
1245 Mon Apr 15 13:31:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
1247 * unicode.c: fix unicode_len() to not access uninitialized memory
1248 (and updated to conform to mono code style).
1250 Fri Mar 29 17:15:11 CET 2002 Paolo Molaro <lupus@ximian.com>
1252 * io.c: EEXISTS is ignored for directory creation.
1253 * mono-mutex.h: remove silly "pragma }" that emacs users insert
1254 because they use a broken editor:-)
1256 2002-03-28 Dick Porter <dick@ximian.com>
1262 * handles.c: Warning cleanups
1264 2002-03-27 Dan Lewis <dihlewis@yahoo.co.uk>
1266 * unicode.h, unicode.c: changed to gunichar2
1267 * io.h, io.c: changed strings to gunichar2*, added
1268 SetFileAttributes(), GetCurrentDirectory(), SetCurrentDirectory(),
1269 some fixes to FindFirstFile() and friends.
1271 2002-03-26 Dick Porter <dick@ximian.com>
1273 * types.h: Implement the large integer struct
1276 * timefuncs.c: Dummy functions that don't yet implement
1277 QueryPerformanceCounter() and QueryPerformanceFrequency()
1280 * threads.c: Implement SleepEx()
1283 * system.c: Beginnings of GetSystemInfo()
1285 * mono-mutex.c (pthread_mutex_timedlock): Fix a ms/ns conversion
1289 * context.c: Dummy function that doesnt yet implement
1293 * atomic.c: Interlocked functions
1295 Mon Mar 25 13:01:40 CET 2002 Paolo Molaro <lupus@ximian.com>
1297 * threads.c: use a gc-safe hash table to store tls pointers.
1299 2002-03-22 Dick Porter <dick@ximian.com>
1301 * threads.c: Fix a race condition where a thread can start and
1302 exit before the handle has been properly initialised (no reason
1303 why the handle couldn't be initialised beforehand, so do so)
1305 Fix a ms to ns conversion magnitude thinko.
1307 2002-03-21 Dick Porter <dick@ximian.com>
1309 * semaphores.c: Fix a problem when waiting for one or more
1310 semaphores, and another semaphore is Released (all waiting
1311 semaphores assumed they were signalled)
1313 2002-03-29 Dan Lewis <dihlewis@yahoo.co.uk>
1315 * io.h, io.c, uglify.h: added MoveFile, CopyFile, CreateDirectory,
1316 RemoveDirectory, GetFileAttributes, GetFileAttributesEx
1318 2002-03-19 Dietmar Maurer <dietmar@ximian.com>
1320 * threads.c (Sleep): bug fix: 1ms == 1000000ns
1322 2002-03-19 Dan Lewis <dihlewis@yahoo.co.uk>
1324 * io.h, io.c, events.c, mutexes.c, semaphores.c, sockets.c,
1325 threads.c, io.c: added flush method to handles.
1327 * io.c: FlushFileBuffers() and FindFirstFile() functions.
1329 Thu Mar 7 17:21:52 CET 2002 Paolo Molaro <lupus@ximian.com>
1331 * threads.c, timed-thread.c, wait.c: Boehm-GC anable.
1333 2002-02-20 Dick Porter <dick@ximian.com>
1335 * io-layer.h: Always build without cygwin support on windows
1337 Mon Feb 18 15:50:59 CET 2002 Paolo Molaro <lupus@ximian.com>
1339 * sockets.c: #undef DEBUG.
1341 2002-02-14 Jeffrey Stedfast <fejj@ximian.com>
1343 * io-layer.h: conditionally include sys/filio.h and sys/sockio.h
1344 for FIONBIO, FIONREAD, and SIOCATMARK.
1346 2002-02-14 Jeffrey Stedfast <fejj@ximian.com>
1348 * sockets.c: conditionally include sys/filio.h and sys/sockio.h
1349 for FIONBIO, FIONREAD, and SIOCATMARK.
1351 2002-02-13 Dick Porter <dick@ximian.com>
1353 * sockets.c: Implement shutdown and select
1355 2002-02-13 Jeffrey Stedfast <fejj@ximian.com>
1357 * mono-mutex.[c,h]: New source files that thinly wrap all pthread
1358 functions that take pthread_mutex_t and/or pthread_mutexattr_t
1359 arguments for the sake of portability. Implements recursive
1360 mutexes and pthread_mutex_timedlock.
1362 * critical-sections.c:
1369 * wait.c: Use the mono-mutex wrapper portability functions/macros.
1371 * pthread-compat.[c,h]: Replaced by mono-mutex.[c,h]
1373 2002-01-23 Dick Porter <dick@ximian.com>
1375 * sockets.c: Networking support, mostly wrapping BSD socket APIs
1376 with handle code, and translating errno into w32 error codes.
1378 * macros.h: Some w32 macros used with the socket support
1380 * error.c: Implemented GetLastError() and SetLastError()
1382 * Makefile.am: Added sockets, with kludge to override some symbols
1384 2001-12-17 Dietmar Maurer <dietmar@ximian.com>
1386 * unicode.c (_wapi_unicode_to_utf8): byteswap UTF16 strings before
1387 passing them to iconv
1388 (_wapi_unicode_to_utf8): only swap bytes on LE systems, remove bug
1389 from previous commit.
1391 2001-12-11 Dick Porter <dick@ximian.com>
1393 * io.c: Implement DeleteFile(), GetFileTime(), SetFileTime() and
1394 FileTimeToSystemTime().
1396 * unicode.c (unicode_len): Nasty way of finding length of unicode
1397 string with embedded NULLs (counts until two NULLs together).
1399 * mutexes.c (mutex_close):
1400 * events.c (event_close): Release the internal pthreads resources
1402 2001-11-26 Dick Porter <dick@ximian.com>
1404 * critical-sections.c:
1412 * wait.c: turn off DEBUG messages
1414 2001-11-22 Dick Porter <dick@ximian.com>
1416 * handles.c (SignalObjectAndWait): Implement
1418 * wait.c (WaitForSingleObject): Fix case where timeout == 0
1424 * events.c: Support for SignalObjectAndWait
1426 2001-11-21 Dick Porter <dick@ximian.com>
1433 * wait.c: Reliable method of returning which handle was signalled
1434 on return from WaitForMultipleObjects().
1436 2001-11-21 Dick Porter <dick@ximian.com>
1438 * events.c: Implement events
1440 2001-11-15 Dick Porter <dick@ximian.com>
1442 * mutexes.c: Implement mutexes
1446 * misc.c: Factor out some common code
1448 2001-11-13 Dick Porter <dick@ximian.com>
1450 * threads.c: Implement TLS. Implement GetCurrentThreadId(), and
1451 GetCurrentThread() by maintaining a hash of thread handles.
1453 * threads.h: Define thread and process creation flags
1455 2001-11-12 Dick Porter <dick@ximian.com>
1457 * critical-sections.c: Implement critical sections
1459 2001-11-12 Dick Porter <dick@ximian.com>
1461 * semaphores.c: Implement semaphores
1463 * wait.c (wait_for_item): Maintain a wait count rather than count
1466 * threads.c (thread_wait_multiple): Don't lock the wait item, that
1467 will block other wait threads
1469 2001-11-11 Dick Porter <dick@ximian.com>
1471 * Makefile.am: Rename some automake variables
1472 (from Nick Drochak <ndrochak@gol.com>)
1474 2001-11-10 Dick Porter <dick@ximian.com>
1476 * Makefile.am (libwapiincludedir): Fix include destination
1478 * .cvsignore: Ignore generated files
1480 2001-11-10 Dietmar Maurer <dietmar@ximian.com>
1482 * pthread-compat.c: added some include files to make it compile on
1485 2001-11-08 Dick Porter <dick@ximian.com>
1489 This is a library emulating the win32 threading and IO API.