1 2002-12-11 Juli Mallett <jmallett@FreeBSD.org>
3 * daemon.c, handles-private.h, handles.c, wapi-private.h:
4 Check for an implementation which says it supports
5 _POSIX_THREAD_PROCESS_SHARED, rather than just one that
6 defines the symbol. Defined but with a value of -1 still
7 means that it is unsupported.
9 2002-12-08 Martin Baulig <martin@ximian.com>
11 * handles.c (_wapi_handle_new): Create new non-shared handles with
12 an initial refcount of 1, not 0.
14 2002-11-22 Dietmar Maurer <dietmar@ximian.com>
16 * threads.c (TlsGetValue): removed unnecessary mutex
18 2002-11-20 Dick Porter <dick@ximian.com>
20 * timed-thread.c (_wapi_timed_thread_attach): Attached threads
21 need to store their data structure too.
23 * threads.c: Make sure the threading data is initialised wherever
26 2002-11-15 Dick Porter <dick@ximian.com>
28 * timed-thread.c: Removed unneeded parameters in
29 _wapi_timed_thread_attach().
31 * threads.c: Renamed AttachThread() to make it not look like
32 external API. Removed unneeded parameters.
34 2002-11-11 Gonzalo Paniagua Javier <gonzalo@ximian.com>
36 * error.[ch]: added errno_to_WSA (). It displays a warning and return
37 WSASYSCALLFAILURE if there is no error mapping for the given errno,
39 * sockets.c: use errno_to_WSA and fixed display of warning for h_errno.
41 2002-10-31 Dick Porter <dick@ximian.com>
44 * io.c: Define and use INVALID_FILE_ATTRIBUTES
46 2002-10-07 Dick Porter <dick@ximian.com>
49 * daemon.c: Use a more accurate time source for process start and
52 2002-10-03 Dick Porter <dick@ximian.com>
56 * threads.c: Fixes for freebsd. Make sure that mutex and condition
57 creation and deletion happen in the process that owns them, when
58 POSIX shared thread objects aren't supported. This breaks on
59 freebsd, as pthread_t is a pointer to data.
61 2002-10-02 Dick Porter <dick@ximian.com>
63 * shared.c: Use mmap() instead of sysv shm for the shared data.
65 * wapi-private.h (_WAPI_HANDLE_VERSION): Reset back to 0, for the
69 * daemon.c: mmap()ed regions survive fork, so just pass the
70 pointer to _wapi_daemon_main instead of mapping it again.
72 2002-10-01 Dick Porter <dick@ximian.com>
74 * timed-thread.c: Kludge for CREATE_SUSPENDED thread creation.
75 Unfortunately libgc uses the same thread suspend technique that I
76 want to, and the two don't mix: libgc will deadlock when it tries
77 to stop the world if a thread has already been suspended by
78 someone else. Just do the simple suspended create rather than the
79 general purpose thread suspension for now.
81 * threads.c: Pass create flags to the timed_thread create call, to
82 implement suspended thread creation. ResumeThread() partially
83 implemented, to cope with the case where a newly created but
84 suspended thread is launched.
86 2002-09-30 Dick Porter <dick@ximian.com>
88 * sockets.c (ioctlsocket): Set non-blocking mode in a better way,
91 2002-09-27 Dick Porter <dick@ximian.com>
93 * semaphores.c: Only include semaphore.h if it's present. Patch
94 for BSD from jmmv@hispabsd.org (Julio Merino).
96 2002-09-27 Dick Porter <dick@ximian.com>
98 * processes.c: Pass environment and working directory to the
99 daemon when forking. Don't let argv[0] be duplicated when looking
100 for the program name. Implement EnumProcessModules (simple
101 version for now, lsof-style later if needed), GetModuleBaseName,
102 {Get,Set}ProcessWorkingSetSize (just faked, because the vm hints
103 aren't available on Linux).
105 * process-private.h: Store the process name, and the working set
109 * handles-private.h: New functions to store and retrieve an array
110 of strings in the scratch space
112 * daemon.c: Don't miss deleting some handles when a client exits
113 (we used to rely on the client doing the final cleanup, but
114 obviously if the client is no longer there the daemon has to do
117 Process forking now sets the environment and the working
120 * io.c: Don't confuse fd 0 with an unassigned handle struct
122 * atomic.h: Add a google cache alternative to the msdn URL
124 2002-09-25 Gonzalo Paniagua Javier <gonzalo@ximian.com>
127 (_wapi_recvfrom): added ECONNRESET to the switch.
129 2002-09-24 Mark Crichton <crichton@gimp.org>
131 * atomic.h: Yea. On linux, sparc isn't sparc, it's __sparc__.
134 2002-09-19 Mark Crichton <crichton@gimp.org>
136 * daemon.c, shared.c: Added NEED_LINK_UNLINK for systems that
137 dont have Linux's abstract filesystem for sockets.
139 2002-09-19 Mark Crichton <crichton@gimp.org>
141 * atomic.h: Added SPARC atomic asm code.
142 * daemon.c, handles-private.h, handles.c, wapi-private.h:
143 undefined _POSIX_THREAD_PROCESS_SHARED. This actually exists on
144 Solaris 9, however, the code paths don't seem to work. More testing
145 on the shared case is *really* needed.
147 2002-09-03 Dick Porter <dick@ximian.com>
150 * threads.c: Removed PosixKillThread(), because it's not in the
153 2002-08-20 Dick Porter <dick@ximian.com>
155 * handles.c (_wapi_handle_scratch_store): Made stored byte lengths
156 multiples of 4 bytes, to keep header structures aligned. Needed
157 for sparc, at least. (Patch from crichton@gimp.org)
159 * handles.c: Removed 'disable_shm' variable (we've defaulted to
160 building with shm enabled for months now)
162 2002-08-19 Dick Porter <dick@ximian.com>
164 * daemon.c: Rewrote the poll() loop to use GIOChannels instead,
165 for legacy NeXT-based systems.
167 2002-08-12 Dick Porter <dick@ximian.com>
169 * atomic.h: Rename some parameters to avoid c++ keywords (Patch
170 from Joseph Wenninger <kde@jowenn.at>)
172 2002-08-05 Dietmar Maurer <dietmar@ximian.com>
174 * threads.c: use fast spinlocks by default
176 2002-08-02 Dick Porter <dick@ximian.com>
178 * io.c (GetStdHandle): Add a handle reference when returning a
179 duplicate console handle. This fixes the unref_handle errors in
182 2002-08-01 Dietmar Maurer <dietmar@ximian.com>
184 * threads.c (TLS_PTHREAD_MUTEX): define this because else some
187 2002-08-01 Dick Porter <dick@ximian.com>
189 * threads.c: Use atomic spinlocks in TLS functions
192 * Makefile.am: Added mono-spinlock.h
194 2002-07-21 Jeffrey Stedfast <fejj@ximian.com>
196 * daemon-messages.c: #include <sys/types.h> and <sys/sockets.h> -
197 these are needed for sendmsg() and also for struct msghdr (at
198 least on Solaris). Solaris still won't build because struct msghdr
199 doesn't have msg_flags, msg_control, or msg_controllen members.
200 (CMSG_SPACE): Define for systems that don't have it.
203 2002-07-20 Dick Porter <dick@ximian.com>
209 * handles.c: Implemented pipe handles
212 * daemon.c: Fixed bug in handle closing.
215 * daemon.c: Forked processes now close all open file descriptors.
217 Fri Jul 19 19:05:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
219 * sockets.h, io-layer.h, critical-sections.h: don't include config.h
222 2002-07-19 Martin Baulig <martin@gnome.org>
224 * threads.c (ExitThread): Call exit() if no threads has been
227 2002-07-17 Dick Porter <dick@ximian.com>
229 * daemon-messages.c: Freebsd fixes from Andreas Kohn
230 <andreas.kohn@gmx.net>
232 2002-07-15 Dick Porter <dick@ximian.com>
234 * io.c: Removed bogus console_flush() method, that was just cut
235 and pasted from file_flush when I separated the two handle types.
237 2002-07-12 Dick Porter <dick@ximian.com>
239 * io.c (convert_from_flags): Fixed misunderstanding wrt fcntl
240 flags. Fixes bug 27633.
242 2002-07-12 Dick Porter <dick@ximian.com>
246 * daemon.c: Use size of sockaddr_un.sun_path from config.h
248 2002-07-12 Dick Porter <dick@ximian.com>
250 * processes.c (CreateProcess): Send stdin, stdout and stderr
251 handles if the startup info doesnt specify new ones
253 * io.c (GetStdHandle): Return the same handle when the same
254 standard handle is requested
256 * handles.c: Pass file descriptors when forking
258 * daemon.c: Use supplied file descriptors when forking a new
262 * daemon-messages.c: Pass stdin, stdout and stderr file
263 descriptors to the daemon (used when forking)
265 2002-07-11 Miguel de Icaza <miguel@ximian.com>
267 * daemon.c (_wapi_daemon_main): Use sizeof
268 (main_socket_address.sun_path) instead of hardcoded 108 value.
270 * handles.c (shared_init): Use sizeof
271 (shared_socket_address.sun_path) instead of hardcoded 108 value.
273 2002-07-10 Dennis Haney <davh@davh.dk>
277 * daemon.c: Lots of documentation, some added error checking, and
278 code readability improvements.
280 * daemon-messages.h: Add the Error request type to improve error
283 * daemon-messages.c: Do a bit more error checking on send() and
284 recv(), and log errors with a higher severity level.
286 2002-07-04 Dick Porter <dick@ximian.com>
288 * daemon.c (process_process_fork): Fix argument handling, due to
289 buggy understanding of g_strsplit() behaviour.
291 2002-07-03 Dick Porter <dick@ximian.com>
294 * threads.c: Implement OpenThread(). Define access-control values
300 * Makefile.am: Added access.h, to hold shared access-control
303 2002-07-02 Dick Porter <dick@ximian.com>
305 * wapi-private.h (_WAPI_HANDLE_VERSION): New protocol version
307 2002-07-02 Dick Porter <dick@ximian.com>
309 * handles.c (shared_init): Make a second attempt to contact the
310 daemon if the shared memory attach succeeds, but the connect()
311 fails. (This copes with the daemon crashing without cleaning up
317 * shared.c (_wapi_shm_attach): Don't exec() anything when we fork
318 the daemon, it's now built into the library.
320 2002-06-25 Dick Porter <dick@ximian.com>
325 * daemon.c: Process forking and handle data management
329 * processes.c: Process forking and other support functions
331 2002-06-25 Dick Porter <dick@ximian.com>
333 * versioninfo.h: PE resource decoding
335 * unicode.c (_wapi_unicode_to_utf8): g_utf16_to_utf8 doesnt need
336 to be told the string length
338 * io.c: Removed the ACTUALLY_DO_UNICODE option. Fixed some leaks.
339 Moved _wapi_time_t_to_filetime and the WapiFileTime typedef to
342 2002-06-12 Dick Porter <dick@ximian.com>
345 * daemon-messages.c: Handle SIGPIPE in a non-stupid way in the
346 daemon, if MSG_NOSIGNAL isn't available. Thanks to Jaroslaw
347 Kowalski <jarek@atm.com.pl> for pointing out the bogosity.
349 2002-06-10 Jaroslaw Kowalski <jarek@atm.com.pl>
351 * sockets.c, daemon-messages.c: Prevent SIGPIPE from being raised
352 when writing to a closed socket.
354 2002-06-08 Jeffrey Stedfast <fejj@ximian.com>
356 * mono-mutex.c (mono_once): New convenience function for my
361 * critical-sections.c:
369 * atomic.c: Use mono_once() rather than pthread_once().
371 2002-06-06 Jeffrey Stedfast <fejj@ximian.com>
373 * handles.c (_wapi_handle_new): pthread_once() is not atomic, so
374 if multiple threads all try to call _wapi_handle_new() before the
375 shared data has been initialized, it is possible that we could get
376 into a condition where shared_init() is being executed and later
377 threads will pass by pthread_once() due to the fact that it has
378 already been called and so therefor will attempt to use the shared
379 data before it has been completely initialized. If we instead use
380 a standard mutex locking mechanism around shared_init(), we can
381 avoid the situation entirely. By wrapping the mutex locking in a
382 check to see if we've already initialized the data, we can even
383 avoid wasting resources by having to lock/unlock the mutex in any
384 later calls (the only time we'd have to worry about
385 locking/unlocking is the initial race to call shared_init() at
388 Sat Jun 1 13:27:11 CEST 2002 Paolo Molaro <lupus@ximian.com>
390 * atomic.h: inline asm fixes from Dennis Haney (davh@davh.dk).
392 Fri May 31 16:21:54 CEST 2002 Paolo Molaro <lupus@ximian.com>
394 * daemon.c, handles.c: rename "sun" local var since it's apparently
395 a #define on Solaris.
397 Fri May 31 15:40:14 CEST 2002 Paolo Molaro <lupus@ximian.com>
399 * daemon-messages.c: work-around MSG_NOSIGNAL missing on some
402 2002-05-15 Dick Porter <dick@ximian.com>
404 * wait.c: Fix a deadlock in WaitForMultipleObjects
406 2002-05-14 Dick Porter <dick@ximian.com>
408 * io.c: Fix a cut&paste error, found by
409 Jaroslaw Kowalski <jarek@atm.com.pl>
411 2002-05-10 Dan Lewis <dihlewis@yahoo.co.uk>
415 2002-05-09 Dick Porter <dick@ximian.com>
423 * Makefile.am: Remove now-unused file wait-private.h
425 2002-05-08 Dick Porter <dick@ximian.com>
427 * shared.c: Better error messages, and report when daemon
428 connection fails rather than blocking forever. Do some more
429 shared memory sanity checking.
431 * handles.c: Better error messages when connecting to shared
432 memory and the handle daemon. Fall back to non-shared handles if
433 an error occurs. Set the default back to 'shared handles'. Fix a
434 crashing bug in scratch space allocation that mangled the block
437 2002-05-07 Miguel de Icaza <miguel@ximian.com>
439 * handles.c (shared_init): Disable SHM for now, people have too
440 many problems with this, and the diagnostics are not helping.
442 2002-05-06 Dan Lewis <dihlewis@yahoo.co.uk>
444 * io.c: CreateFile sets win32 last error.
446 2002-05-05 Dick Porter <dick@ximian.com>
457 * semaphore-private.h:
461 * event-private.h: Simplify the WapiHandleOps struct: take out all
462 the file-specific entries, leaving just the items that operate on
463 handles themselves. Split the close operation into shared and
464 private parts: shared close is called by the daemon.
466 * handles.c: As above, but also pass handle allocation, ref and
467 unref operations to the daemon. Populate the handle_ops array at
468 compile time, because the daemon needs to call ops on handles too.
469 Don't bother to track open handle counts any more, the daemon does
473 * thread-private.h: As above, but also make the thread data
476 * shared.c: Fork a handle daemon if the calling process created
477 the shared memory segment.
482 * Makefile.am: Build a daemon to manage handle allocation and
483 destruction without needing to lock the shared memory
485 2002-04-30 Jeffrey Stedfast <fejj@ximian.com>
487 * atomic.c: Changed to use a normal mutex rather than a spinlock
488 since a lot of platforms seem to not have them :\
490 2002-04-30 Dick Porter <dick@ximian.com>
492 * Completely rewrote the handle waiting code: removed the helper
493 thread and its attendant complexity. All handle waiting is now
494 abstracted into the WaitForSingleObject() and
495 WaitForMultipleObjects() functions.
497 * Implemented inter-process sharing of handles using sysv shared
498 memory. This makes handles even more opaque, with a handle now
499 just an index into an array.
501 2002-04-25 Dan Lewis <dihlewis@yahoo.co.uk>
503 * io.c: unitialized pointer in GetCurrentDirectory.
505 Sat Apr 20 13:37:39 CEST 2002 Paolo Molaro <lupus@ximian.com>
507 * threads.c: destroy the mutex at thread destruction
508 (if/when thread destruction code will be actually called).
509 When protecting a tls data pointer from the gc, use also the
510 thread id in the key.
512 Wed Apr 17 18:36:27 CEST 2002 Paolo Molaro <lupus@ximian.com>
514 * timed-thread.c: avoid race condition when setting the thread to
517 2002-04-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
519 * jit.h: to more #include lines to avoid breaking compilation
520 under windows when upgrading mingw and w32api to version
523 2002-04-16 Dick Porter <dick@ximian.com>
525 * atomic.h: Explanatory comment about lack of 80386 support
527 2002-04-15 Dick Porter <dick@ximian.com>
529 * atomic.h: use xaddl for InterlockedIncrement() and
530 InterlockedDecrement(). Use cmpxchgl in a loop for
531 InterlockedExchange() and InterlockedExchangePointer().
533 Mon Apr 15 13:31:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
535 * unicode.c: fix unicode_len() to not access uninitialized memory
536 (and updated to conform to mono code style).
538 Fri Mar 29 17:15:11 CET 2002 Paolo Molaro <lupus@ximian.com>
540 * io.c: EEXISTS is ignored for directory creation.
541 * mono-mutex.h: remove silly "pragma }" that emacs users insert
542 because they use a broken editor:-)
544 2002-03-28 Dick Porter <dick@ximian.com>
550 * handles.c: Warning cleanups
552 2002-03-27 Dan Lewis <dihlewis@yahoo.co.uk>
554 * unicode.h, unicode.c: changed to gunichar2
555 * io.h, io.c: changed strings to gunichar2*, added
556 SetFileAttributes(), GetCurrentDirectory(), SetCurrentDirectory(),
557 some fixes to FindFirstFile() and friends.
559 2002-03-26 Dick Porter <dick@ximian.com>
561 * types.h: Implement the large integer struct
564 * timefuncs.c: Dummy functions that don't yet implement
565 QueryPerformanceCounter() and QueryPerformanceFrequency()
568 * threads.c: Implement SleepEx()
571 * system.c: Beginnings of GetSystemInfo()
573 * mono-mutex.c (pthread_mutex_timedlock): Fix a ms/ns conversion
577 * context.c: Dummy function that doesnt yet implement
581 * atomic.c: Interlocked functions
583 Mon Mar 25 13:01:40 CET 2002 Paolo Molaro <lupus@ximian.com>
585 * threads.c: use a gc-safe hash table to store tls pointers.
587 2002-03-22 Dick Porter <dick@ximian.com>
589 * threads.c: Fix a race condition where a thread can start and
590 exit before the handle has been properly initialised (no reason
591 why the handle couldn't be initialised beforehand, so do so)
593 Fix a ms to ns conversion magnitude thinko.
595 2002-03-21 Dick Porter <dick@ximian.com>
597 * semaphores.c: Fix a problem when waiting for one or more
598 semaphores, and another semaphore is Released (all waiting
599 semaphores assumed they were signalled)
601 2002-03-29 Dan Lewis <dihlewis@yahoo.co.uk>
603 * io.h, io.c, uglify.h: added MoveFile, CopyFile, CreateDirectory,
604 RemoveDirectory, GetFileAttributes, GetFileAttributesEx
606 2002-03-19 Dietmar Maurer <dietmar@ximian.com>
608 * threads.c (Sleep): bug fix: 1ms == 1000000ns
610 2002-03-19 Dan Lewis <dihlewis@yahoo.co.uk>
612 * io.h, io.c, events.c, mutexes.c, semaphores.c, sockets.c,
613 threads.c, io.c: added flush method to handles.
615 * io.c: FlushFileBuffers() and FindFirstFile() functions.
617 Thu Mar 7 17:21:52 CET 2002 Paolo Molaro <lupus@ximian.com>
619 * threads.c, timed-thread.c, wait.c: Boehm-GC anable.
621 2002-02-20 Dick Porter <dick@ximian.com>
623 * io-layer.h: Always build without cygwin support on windows
625 Mon Feb 18 15:50:59 CET 2002 Paolo Molaro <lupus@ximian.com>
627 * sockets.c: #undef DEBUG.
629 2002-02-14 Jeffrey Stedfast <fejj@ximian.com>
631 * io-layer.h: conditionally include sys/filio.h and sys/sockio.h
632 for FIONBIO, FIONREAD, and SIOCATMARK.
634 2002-02-14 Jeffrey Stedfast <fejj@ximian.com>
636 * sockets.c: conditionally include sys/filio.h and sys/sockio.h
637 for FIONBIO, FIONREAD, and SIOCATMARK.
639 2002-02-13 Dick Porter <dick@ximian.com>
641 * sockets.c: Implement shutdown and select
643 2002-02-13 Jeffrey Stedfast <fejj@ximian.com>
645 * mono-mutex.[c,h]: New source files that thinly wrap all pthread
646 functions that take pthread_mutex_t and/or pthread_mutexattr_t
647 arguments for the sake of portability. Implements recursive
648 mutexes and pthread_mutex_timedlock.
650 * critical-sections.c:
657 * wait.c: Use the mono-mutex wrapper portability functions/macros.
659 * pthread-compat.[c,h]: Replaced by mono-mutex.[c,h]
661 2002-01-23 Dick Porter <dick@ximian.com>
663 * sockets.c: Networking support, mostly wrapping BSD socket APIs
664 with handle code, and translating errno into w32 error codes.
666 * macros.h: Some w32 macros used with the socket support
668 * error.c: Implemented GetLastError() and SetLastError()
670 * Makefile.am: Added sockets, with kludge to override some symbols
672 2001-12-17 Dietmar Maurer <dietmar@ximian.com>
674 * unicode.c (_wapi_unicode_to_utf8): byteswap UTF16 strings before
675 passing them to iconv
676 (_wapi_unicode_to_utf8): only swap bytes on LE systems, remove bug
677 from previous commit.
679 2001-12-11 Dick Porter <dick@ximian.com>
681 * io.c: Implement DeleteFile(), GetFileTime(), SetFileTime() and
682 FileTimeToSystemTime().
684 * unicode.c (unicode_len): Nasty way of finding length of unicode
685 string with embedded NULLs (counts until two NULLs together).
687 * mutexes.c (mutex_close):
688 * events.c (event_close): Release the internal pthreads resources
690 2001-11-26 Dick Porter <dick@ximian.com>
692 * critical-sections.c:
700 * wait.c: turn off DEBUG messages
702 2001-11-22 Dick Porter <dick@ximian.com>
704 * handles.c (SignalObjectAndWait): Implement
706 * wait.c (WaitForSingleObject): Fix case where timeout == 0
712 * events.c: Support for SignalObjectAndWait
714 2001-11-21 Dick Porter <dick@ximian.com>
721 * wait.c: Reliable method of returning which handle was signalled
722 on return from WaitForMultipleObjects().
724 2001-11-21 Dick Porter <dick@ximian.com>
726 * events.c: Implement events
728 2001-11-15 Dick Porter <dick@ximian.com>
730 * mutexes.c: Implement mutexes
734 * misc.c: Factor out some common code
736 2001-11-13 Dick Porter <dick@ximian.com>
738 * threads.c: Implement TLS. Implement GetCurrentThreadId(), and
739 GetCurrentThread() by maintaining a hash of thread handles.
741 * threads.h: Define thread and process creation flags
743 2001-11-12 Dick Porter <dick@ximian.com>
745 * critical-sections.c: Implement critical sections
747 2001-11-12 Dick Porter <dick@ximian.com>
749 * semaphores.c: Implement semaphores
751 * wait.c (wait_for_item): Maintain a wait count rather than count
754 * threads.c (thread_wait_multiple): Don't lock the wait item, that
755 will block other wait threads
757 2001-11-11 Dick Porter <dick@ximian.com>
759 * Makefile.am: Rename some automake variables
760 (from Nick Drochak <ndrochak@gol.com>)
762 2001-11-10 Dick Porter <dick@ximian.com>
764 * Makefile.am (libwapiincludedir): Fix include destination
766 * .cvsignore: Ignore generated files
768 2001-11-10 Dietmar Maurer <dietmar@ximian.com>
770 * pthread-compat.c: added some include files to make it compile on
773 2001-11-08 Dick Porter <dick@ximian.com>
777 This is a library emulating the win32 threading and IO API.