1 2002-12-08 Martin Baulig <martin@ximian.com>
3 * handles.c (_wapi_handle_new): Create new non-shared handles with
4 an initial refcount of 1, not 0.
6 2002-11-22 Dietmar Maurer <dietmar@ximian.com>
8 * threads.c (TlsGetValue): removed unnecessary mutex
10 2002-11-20 Dick Porter <dick@ximian.com>
12 * timed-thread.c (_wapi_timed_thread_attach): Attached threads
13 need to store their data structure too.
15 * threads.c: Make sure the threading data is initialised wherever
18 2002-11-15 Dick Porter <dick@ximian.com>
20 * timed-thread.c: Removed unneeded parameters in
21 _wapi_timed_thread_attach().
23 * threads.c: Renamed AttachThread() to make it not look like
24 external API. Removed unneeded parameters.
26 2002-11-11 Gonzalo Paniagua Javier <gonzalo@ximian.com>
28 * error.[ch]: added errno_to_WSA (). It displays a warning and return
29 WSASYSCALLFAILURE if there is no error mapping for the given errno,
31 * sockets.c: use errno_to_WSA and fixed display of warning for h_errno.
33 2002-10-31 Dick Porter <dick@ximian.com>
36 * io.c: Define and use INVALID_FILE_ATTRIBUTES
38 2002-10-07 Dick Porter <dick@ximian.com>
41 * daemon.c: Use a more accurate time source for process start and
44 2002-10-03 Dick Porter <dick@ximian.com>
48 * threads.c: Fixes for freebsd. Make sure that mutex and condition
49 creation and deletion happen in the process that owns them, when
50 POSIX shared thread objects aren't supported. This breaks on
51 freebsd, as pthread_t is a pointer to data.
53 2002-10-02 Dick Porter <dick@ximian.com>
55 * shared.c: Use mmap() instead of sysv shm for the shared data.
57 * wapi-private.h (_WAPI_HANDLE_VERSION): Reset back to 0, for the
61 * daemon.c: mmap()ed regions survive fork, so just pass the
62 pointer to _wapi_daemon_main instead of mapping it again.
64 2002-10-01 Dick Porter <dick@ximian.com>
66 * timed-thread.c: Kludge for CREATE_SUSPENDED thread creation.
67 Unfortunately libgc uses the same thread suspend technique that I
68 want to, and the two don't mix: libgc will deadlock when it tries
69 to stop the world if a thread has already been suspended by
70 someone else. Just do the simple suspended create rather than the
71 general purpose thread suspension for now.
73 * threads.c: Pass create flags to the timed_thread create call, to
74 implement suspended thread creation. ResumeThread() partially
75 implemented, to cope with the case where a newly created but
76 suspended thread is launched.
78 2002-09-30 Dick Porter <dick@ximian.com>
80 * sockets.c (ioctlsocket): Set non-blocking mode in a better way,
83 2002-09-27 Dick Porter <dick@ximian.com>
85 * semaphores.c: Only include semaphore.h if it's present. Patch
86 for BSD from jmmv@hispabsd.org (Julio Merino).
88 2002-09-27 Dick Porter <dick@ximian.com>
90 * processes.c: Pass environment and working directory to the
91 daemon when forking. Don't let argv[0] be duplicated when looking
92 for the program name. Implement EnumProcessModules (simple
93 version for now, lsof-style later if needed), GetModuleBaseName,
94 {Get,Set}ProcessWorkingSetSize (just faked, because the vm hints
95 aren't available on Linux).
97 * process-private.h: Store the process name, and the working set
101 * handles-private.h: New functions to store and retrieve an array
102 of strings in the scratch space
104 * daemon.c: Don't miss deleting some handles when a client exits
105 (we used to rely on the client doing the final cleanup, but
106 obviously if the client is no longer there the daemon has to do
109 Process forking now sets the environment and the working
112 * io.c: Don't confuse fd 0 with an unassigned handle struct
114 * atomic.h: Add a google cache alternative to the msdn URL
116 2002-09-25 Gonzalo Paniagua Javier <gonzalo@ximian.com>
119 (_wapi_recvfrom): added ECONNRESET to the switch.
121 2002-09-24 Mark Crichton <crichton@gimp.org>
123 * atomic.h: Yea. On linux, sparc isn't sparc, it's __sparc__.
126 2002-09-19 Mark Crichton <crichton@gimp.org>
128 * daemon.c, shared.c: Added NEED_LINK_UNLINK for systems that
129 dont have Linux's abstract filesystem for sockets.
131 2002-09-19 Mark Crichton <crichton@gimp.org>
133 * atomic.h: Added SPARC atomic asm code.
134 * daemon.c, handles-private.h, handles.c, wapi-private.h:
135 undefined _POSIX_THREAD_PROCESS_SHARED. This actually exists on
136 Solaris 9, however, the code paths don't seem to work. More testing
137 on the shared case is *really* needed.
139 2002-09-03 Dick Porter <dick@ximian.com>
142 * threads.c: Removed PosixKillThread(), because it's not in the
145 2002-08-20 Dick Porter <dick@ximian.com>
147 * handles.c (_wapi_handle_scratch_store): Made stored byte lengths
148 multiples of 4 bytes, to keep header structures aligned. Needed
149 for sparc, at least. (Patch from crichton@gimp.org)
151 * handles.c: Removed 'disable_shm' variable (we've defaulted to
152 building with shm enabled for months now)
154 2002-08-19 Dick Porter <dick@ximian.com>
156 * daemon.c: Rewrote the poll() loop to use GIOChannels instead,
157 for legacy NeXT-based systems.
159 2002-08-12 Dick Porter <dick@ximian.com>
161 * atomic.h: Rename some parameters to avoid c++ keywords (Patch
162 from Joseph Wenninger <kde@jowenn.at>)
164 2002-08-05 Dietmar Maurer <dietmar@ximian.com>
166 * threads.c: use fast spinlocks by default
168 2002-08-02 Dick Porter <dick@ximian.com>
170 * io.c (GetStdHandle): Add a handle reference when returning a
171 duplicate console handle. This fixes the unref_handle errors in
174 2002-08-01 Dietmar Maurer <dietmar@ximian.com>
176 * threads.c (TLS_PTHREAD_MUTEX): define this because else some
179 2002-08-01 Dick Porter <dick@ximian.com>
181 * threads.c: Use atomic spinlocks in TLS functions
184 * Makefile.am: Added mono-spinlock.h
186 2002-07-21 Jeffrey Stedfast <fejj@ximian.com>
188 * daemon-messages.c: #include <sys/types.h> and <sys/sockets.h> -
189 these are needed for sendmsg() and also for struct msghdr (at
190 least on Solaris). Solaris still won't build because struct msghdr
191 doesn't have msg_flags, msg_control, or msg_controllen members.
192 (CMSG_SPACE): Define for systems that don't have it.
195 2002-07-20 Dick Porter <dick@ximian.com>
201 * handles.c: Implemented pipe handles
204 * daemon.c: Fixed bug in handle closing.
207 * daemon.c: Forked processes now close all open file descriptors.
209 Fri Jul 19 19:05:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
211 * sockets.h, io-layer.h, critical-sections.h: don't include config.h
214 2002-07-19 Martin Baulig <martin@gnome.org>
216 * threads.c (ExitThread): Call exit() if no threads has been
219 2002-07-17 Dick Porter <dick@ximian.com>
221 * daemon-messages.c: Freebsd fixes from Andreas Kohn
222 <andreas.kohn@gmx.net>
224 2002-07-15 Dick Porter <dick@ximian.com>
226 * io.c: Removed bogus console_flush() method, that was just cut
227 and pasted from file_flush when I separated the two handle types.
229 2002-07-12 Dick Porter <dick@ximian.com>
231 * io.c (convert_from_flags): Fixed misunderstanding wrt fcntl
232 flags. Fixes bug 27633.
234 2002-07-12 Dick Porter <dick@ximian.com>
238 * daemon.c: Use size of sockaddr_un.sun_path from config.h
240 2002-07-12 Dick Porter <dick@ximian.com>
242 * processes.c (CreateProcess): Send stdin, stdout and stderr
243 handles if the startup info doesnt specify new ones
245 * io.c (GetStdHandle): Return the same handle when the same
246 standard handle is requested
248 * handles.c: Pass file descriptors when forking
250 * daemon.c: Use supplied file descriptors when forking a new
254 * daemon-messages.c: Pass stdin, stdout and stderr file
255 descriptors to the daemon (used when forking)
257 2002-07-11 Miguel de Icaza <miguel@ximian.com>
259 * daemon.c (_wapi_daemon_main): Use sizeof
260 (main_socket_address.sun_path) instead of hardcoded 108 value.
262 * handles.c (shared_init): Use sizeof
263 (shared_socket_address.sun_path) instead of hardcoded 108 value.
265 2002-07-10 Dennis Haney <davh@davh.dk>
269 * daemon.c: Lots of documentation, some added error checking, and
270 code readability improvements.
272 * daemon-messages.h: Add the Error request type to improve error
275 * daemon-messages.c: Do a bit more error checking on send() and
276 recv(), and log errors with a higher severity level.
278 2002-07-04 Dick Porter <dick@ximian.com>
280 * daemon.c (process_process_fork): Fix argument handling, due to
281 buggy understanding of g_strsplit() behaviour.
283 2002-07-03 Dick Porter <dick@ximian.com>
286 * threads.c: Implement OpenThread(). Define access-control values
292 * Makefile.am: Added access.h, to hold shared access-control
295 2002-07-02 Dick Porter <dick@ximian.com>
297 * wapi-private.h (_WAPI_HANDLE_VERSION): New protocol version
299 2002-07-02 Dick Porter <dick@ximian.com>
301 * handles.c (shared_init): Make a second attempt to contact the
302 daemon if the shared memory attach succeeds, but the connect()
303 fails. (This copes with the daemon crashing without cleaning up
309 * shared.c (_wapi_shm_attach): Don't exec() anything when we fork
310 the daemon, it's now built into the library.
312 2002-06-25 Dick Porter <dick@ximian.com>
317 * daemon.c: Process forking and handle data management
321 * processes.c: Process forking and other support functions
323 2002-06-25 Dick Porter <dick@ximian.com>
325 * versioninfo.h: PE resource decoding
327 * unicode.c (_wapi_unicode_to_utf8): g_utf16_to_utf8 doesnt need
328 to be told the string length
330 * io.c: Removed the ACTUALLY_DO_UNICODE option. Fixed some leaks.
331 Moved _wapi_time_t_to_filetime and the WapiFileTime typedef to
334 2002-06-12 Dick Porter <dick@ximian.com>
337 * daemon-messages.c: Handle SIGPIPE in a non-stupid way in the
338 daemon, if MSG_NOSIGNAL isn't available. Thanks to Jaroslaw
339 Kowalski <jarek@atm.com.pl> for pointing out the bogosity.
341 2002-06-10 Jaroslaw Kowalski <jarek@atm.com.pl>
343 * sockets.c, daemon-messages.c: Prevent SIGPIPE from being raised
344 when writing to a closed socket.
346 2002-06-08 Jeffrey Stedfast <fejj@ximian.com>
348 * mono-mutex.c (mono_once): New convenience function for my
353 * critical-sections.c:
361 * atomic.c: Use mono_once() rather than pthread_once().
363 2002-06-06 Jeffrey Stedfast <fejj@ximian.com>
365 * handles.c (_wapi_handle_new): pthread_once() is not atomic, so
366 if multiple threads all try to call _wapi_handle_new() before the
367 shared data has been initialized, it is possible that we could get
368 into a condition where shared_init() is being executed and later
369 threads will pass by pthread_once() due to the fact that it has
370 already been called and so therefor will attempt to use the shared
371 data before it has been completely initialized. If we instead use
372 a standard mutex locking mechanism around shared_init(), we can
373 avoid the situation entirely. By wrapping the mutex locking in a
374 check to see if we've already initialized the data, we can even
375 avoid wasting resources by having to lock/unlock the mutex in any
376 later calls (the only time we'd have to worry about
377 locking/unlocking is the initial race to call shared_init() at
380 Sat Jun 1 13:27:11 CEST 2002 Paolo Molaro <lupus@ximian.com>
382 * atomic.h: inline asm fixes from Dennis Haney (davh@davh.dk).
384 Fri May 31 16:21:54 CEST 2002 Paolo Molaro <lupus@ximian.com>
386 * daemon.c, handles.c: rename "sun" local var since it's apparently
387 a #define on Solaris.
389 Fri May 31 15:40:14 CEST 2002 Paolo Molaro <lupus@ximian.com>
391 * daemon-messages.c: work-around MSG_NOSIGNAL missing on some
394 2002-05-15 Dick Porter <dick@ximian.com>
396 * wait.c: Fix a deadlock in WaitForMultipleObjects
398 2002-05-14 Dick Porter <dick@ximian.com>
400 * io.c: Fix a cut&paste error, found by
401 Jaroslaw Kowalski <jarek@atm.com.pl>
403 2002-05-10 Dan Lewis <dihlewis@yahoo.co.uk>
407 2002-05-09 Dick Porter <dick@ximian.com>
415 * Makefile.am: Remove now-unused file wait-private.h
417 2002-05-08 Dick Porter <dick@ximian.com>
419 * shared.c: Better error messages, and report when daemon
420 connection fails rather than blocking forever. Do some more
421 shared memory sanity checking.
423 * handles.c: Better error messages when connecting to shared
424 memory and the handle daemon. Fall back to non-shared handles if
425 an error occurs. Set the default back to 'shared handles'. Fix a
426 crashing bug in scratch space allocation that mangled the block
429 2002-05-07 Miguel de Icaza <miguel@ximian.com>
431 * handles.c (shared_init): Disable SHM for now, people have too
432 many problems with this, and the diagnostics are not helping.
434 2002-05-06 Dan Lewis <dihlewis@yahoo.co.uk>
436 * io.c: CreateFile sets win32 last error.
438 2002-05-05 Dick Porter <dick@ximian.com>
449 * semaphore-private.h:
453 * event-private.h: Simplify the WapiHandleOps struct: take out all
454 the file-specific entries, leaving just the items that operate on
455 handles themselves. Split the close operation into shared and
456 private parts: shared close is called by the daemon.
458 * handles.c: As above, but also pass handle allocation, ref and
459 unref operations to the daemon. Populate the handle_ops array at
460 compile time, because the daemon needs to call ops on handles too.
461 Don't bother to track open handle counts any more, the daemon does
465 * thread-private.h: As above, but also make the thread data
468 * shared.c: Fork a handle daemon if the calling process created
469 the shared memory segment.
474 * Makefile.am: Build a daemon to manage handle allocation and
475 destruction without needing to lock the shared memory
477 2002-04-30 Jeffrey Stedfast <fejj@ximian.com>
479 * atomic.c: Changed to use a normal mutex rather than a spinlock
480 since a lot of platforms seem to not have them :\
482 2002-04-30 Dick Porter <dick@ximian.com>
484 * Completely rewrote the handle waiting code: removed the helper
485 thread and its attendant complexity. All handle waiting is now
486 abstracted into the WaitForSingleObject() and
487 WaitForMultipleObjects() functions.
489 * Implemented inter-process sharing of handles using sysv shared
490 memory. This makes handles even more opaque, with a handle now
491 just an index into an array.
493 2002-04-25 Dan Lewis <dihlewis@yahoo.co.uk>
495 * io.c: unitialized pointer in GetCurrentDirectory.
497 Sat Apr 20 13:37:39 CEST 2002 Paolo Molaro <lupus@ximian.com>
499 * threads.c: destroy the mutex at thread destruction
500 (if/when thread destruction code will be actually called).
501 When protecting a tls data pointer from the gc, use also the
502 thread id in the key.
504 Wed Apr 17 18:36:27 CEST 2002 Paolo Molaro <lupus@ximian.com>
506 * timed-thread.c: avoid race condition when setting the thread to
509 2002-04-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
511 * jit.h: to more #include lines to avoid breaking compilation
512 under windows when upgrading mingw and w32api to version
515 2002-04-16 Dick Porter <dick@ximian.com>
517 * atomic.h: Explanatory comment about lack of 80386 support
519 2002-04-15 Dick Porter <dick@ximian.com>
521 * atomic.h: use xaddl for InterlockedIncrement() and
522 InterlockedDecrement(). Use cmpxchgl in a loop for
523 InterlockedExchange() and InterlockedExchangePointer().
525 Mon Apr 15 13:31:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
527 * unicode.c: fix unicode_len() to not access uninitialized memory
528 (and updated to conform to mono code style).
530 Fri Mar 29 17:15:11 CET 2002 Paolo Molaro <lupus@ximian.com>
532 * io.c: EEXISTS is ignored for directory creation.
533 * mono-mutex.h: remove silly "pragma }" that emacs users insert
534 because they use a broken editor:-)
536 2002-03-28 Dick Porter <dick@ximian.com>
542 * handles.c: Warning cleanups
544 2002-03-27 Dan Lewis <dihlewis@yahoo.co.uk>
546 * unicode.h, unicode.c: changed to gunichar2
547 * io.h, io.c: changed strings to gunichar2*, added
548 SetFileAttributes(), GetCurrentDirectory(), SetCurrentDirectory(),
549 some fixes to FindFirstFile() and friends.
551 2002-03-26 Dick Porter <dick@ximian.com>
553 * types.h: Implement the large integer struct
556 * timefuncs.c: Dummy functions that don't yet implement
557 QueryPerformanceCounter() and QueryPerformanceFrequency()
560 * threads.c: Implement SleepEx()
563 * system.c: Beginnings of GetSystemInfo()
565 * mono-mutex.c (pthread_mutex_timedlock): Fix a ms/ns conversion
569 * context.c: Dummy function that doesnt yet implement
573 * atomic.c: Interlocked functions
575 Mon Mar 25 13:01:40 CET 2002 Paolo Molaro <lupus@ximian.com>
577 * threads.c: use a gc-safe hash table to store tls pointers.
579 2002-03-22 Dick Porter <dick@ximian.com>
581 * threads.c: Fix a race condition where a thread can start and
582 exit before the handle has been properly initialised (no reason
583 why the handle couldn't be initialised beforehand, so do so)
585 Fix a ms to ns conversion magnitude thinko.
587 2002-03-21 Dick Porter <dick@ximian.com>
589 * semaphores.c: Fix a problem when waiting for one or more
590 semaphores, and another semaphore is Released (all waiting
591 semaphores assumed they were signalled)
593 2002-03-29 Dan Lewis <dihlewis@yahoo.co.uk>
595 * io.h, io.c, uglify.h: added MoveFile, CopyFile, CreateDirectory,
596 RemoveDirectory, GetFileAttributes, GetFileAttributesEx
598 2002-03-19 Dietmar Maurer <dietmar@ximian.com>
600 * threads.c (Sleep): bug fix: 1ms == 1000000ns
602 2002-03-19 Dan Lewis <dihlewis@yahoo.co.uk>
604 * io.h, io.c, events.c, mutexes.c, semaphores.c, sockets.c,
605 threads.c, io.c: added flush method to handles.
607 * io.c: FlushFileBuffers() and FindFirstFile() functions.
609 Thu Mar 7 17:21:52 CET 2002 Paolo Molaro <lupus@ximian.com>
611 * threads.c, timed-thread.c, wait.c: Boehm-GC anable.
613 2002-02-20 Dick Porter <dick@ximian.com>
615 * io-layer.h: Always build without cygwin support on windows
617 Mon Feb 18 15:50:59 CET 2002 Paolo Molaro <lupus@ximian.com>
619 * sockets.c: #undef DEBUG.
621 2002-02-14 Jeffrey Stedfast <fejj@ximian.com>
623 * io-layer.h: conditionally include sys/filio.h and sys/sockio.h
624 for FIONBIO, FIONREAD, and SIOCATMARK.
626 2002-02-14 Jeffrey Stedfast <fejj@ximian.com>
628 * sockets.c: conditionally include sys/filio.h and sys/sockio.h
629 for FIONBIO, FIONREAD, and SIOCATMARK.
631 2002-02-13 Dick Porter <dick@ximian.com>
633 * sockets.c: Implement shutdown and select
635 2002-02-13 Jeffrey Stedfast <fejj@ximian.com>
637 * mono-mutex.[c,h]: New source files that thinly wrap all pthread
638 functions that take pthread_mutex_t and/or pthread_mutexattr_t
639 arguments for the sake of portability. Implements recursive
640 mutexes and pthread_mutex_timedlock.
642 * critical-sections.c:
649 * wait.c: Use the mono-mutex wrapper portability functions/macros.
651 * pthread-compat.[c,h]: Replaced by mono-mutex.[c,h]
653 2002-01-23 Dick Porter <dick@ximian.com>
655 * sockets.c: Networking support, mostly wrapping BSD socket APIs
656 with handle code, and translating errno into w32 error codes.
658 * macros.h: Some w32 macros used with the socket support
660 * error.c: Implemented GetLastError() and SetLastError()
662 * Makefile.am: Added sockets, with kludge to override some symbols
664 2001-12-17 Dietmar Maurer <dietmar@ximian.com>
666 * unicode.c (_wapi_unicode_to_utf8): byteswap UTF16 strings before
667 passing them to iconv
668 (_wapi_unicode_to_utf8): only swap bytes on LE systems, remove bug
669 from previous commit.
671 2001-12-11 Dick Porter <dick@ximian.com>
673 * io.c: Implement DeleteFile(), GetFileTime(), SetFileTime() and
674 FileTimeToSystemTime().
676 * unicode.c (unicode_len): Nasty way of finding length of unicode
677 string with embedded NULLs (counts until two NULLs together).
679 * mutexes.c (mutex_close):
680 * events.c (event_close): Release the internal pthreads resources
682 2001-11-26 Dick Porter <dick@ximian.com>
684 * critical-sections.c:
692 * wait.c: turn off DEBUG messages
694 2001-11-22 Dick Porter <dick@ximian.com>
696 * handles.c (SignalObjectAndWait): Implement
698 * wait.c (WaitForSingleObject): Fix case where timeout == 0
704 * events.c: Support for SignalObjectAndWait
706 2001-11-21 Dick Porter <dick@ximian.com>
713 * wait.c: Reliable method of returning which handle was signalled
714 on return from WaitForMultipleObjects().
716 2001-11-21 Dick Porter <dick@ximian.com>
718 * events.c: Implement events
720 2001-11-15 Dick Porter <dick@ximian.com>
722 * mutexes.c: Implement mutexes
726 * misc.c: Factor out some common code
728 2001-11-13 Dick Porter <dick@ximian.com>
730 * threads.c: Implement TLS. Implement GetCurrentThreadId(), and
731 GetCurrentThread() by maintaining a hash of thread handles.
733 * threads.h: Define thread and process creation flags
735 2001-11-12 Dick Porter <dick@ximian.com>
737 * critical-sections.c: Implement critical sections
739 2001-11-12 Dick Porter <dick@ximian.com>
741 * semaphores.c: Implement semaphores
743 * wait.c (wait_for_item): Maintain a wait count rather than count
746 * threads.c (thread_wait_multiple): Don't lock the wait item, that
747 will block other wait threads
749 2001-11-11 Dick Porter <dick@ximian.com>
751 * Makefile.am: Rename some automake variables
752 (from Nick Drochak <ndrochak@gol.com>)
754 2001-11-10 Dick Porter <dick@ximian.com>
756 * Makefile.am (libwapiincludedir): Fix include destination
758 * .cvsignore: Ignore generated files
760 2001-11-10 Dietmar Maurer <dietmar@ximian.com>
762 * pthread-compat.c: added some include files to make it compile on
765 2001-11-08 Dick Porter <dick@ximian.com>
769 This is a library emulating the win32 threading and IO API.