2002-09-25 Gonzalo Paniagua Javier <gonzalo@ximian.com>
[mono.git] / mono / io-layer / ChangeLog
1 2002-09-25  Gonzalo Paniagua Javier <gonzalo@ximian.com>
2
3         * sockets.c:
4         (_wapi_recvfrom): added ECONNRESET to the switch.
5
6 2002-09-24  Mark Crichton  <crichton@gimp.org>
7
8         * atomic.h: Yea.  On linux, sparc isn't sparc, it's __sparc__.
9         Added to ifdef.
10
11 2002-09-19  Mark Crichton  <crichton@gimp.org>
12
13         * daemon.c, shared.c: Added NEED_LINK_UNLINK for systems that
14         dont have Linux's abstract filesystem for sockets.
15
16 2002-09-19  Mark Crichton  <crichton@gimp.org>
17
18         * atomic.h: Added SPARC atomic asm code.
19         * daemon.c, handles-private.h, handles.c, wapi-private.h:
20         undefined _POSIX_THREAD_PROCESS_SHARED.  This actually exists on
21         Solaris 9, however, the code paths don't seem to work.  More testing
22         on the shared case is *really* needed.
23
24 2002-09-03  Dick Porter  <dick@ximian.com>
25
26         * threads.h: 
27         * threads.c: Removed PosixKillThread(), because it's not in the
28         w32 api
29
30 2002-08-20  Dick Porter  <dick@ximian.com>
31
32         * handles.c (_wapi_handle_scratch_store): Made stored byte lengths
33         multiples of 4 bytes, to keep header structures aligned.  Needed
34         for sparc, at least. (Patch from crichton@gimp.org)
35
36         * handles.c: Removed 'disable_shm' variable (we've defaulted to
37         building with shm enabled for months now)
38
39 2002-08-19  Dick Porter  <dick@ximian.com>
40
41         * daemon.c: Rewrote the poll() loop to use GIOChannels instead,
42         for legacy NeXT-based systems.
43
44 2002-08-12  Dick Porter  <dick@ximian.com>
45
46         * atomic.h: Rename some parameters to avoid c++ keywords (Patch
47         from Joseph Wenninger <kde@jowenn.at>)
48
49 2002-08-05  Dietmar Maurer  <dietmar@ximian.com>
50
51         * threads.c: use fast spinlocks by default
52
53 2002-08-02  Dick Porter  <dick@ximian.com>
54
55         * io.c (GetStdHandle): Add a handle reference when returning a
56         duplicate console handle.  This fixes the unref_handle errors in
57         NUnit.
58
59 2002-08-01  Dietmar Maurer  <dietmar@ximian.com>
60
61         * threads.c (TLS_PTHREAD_MUTEX): define this because else some
62         tests does not work
63
64 2002-08-01  Dick Porter  <dick@ximian.com>
65
66         * threads.c: Use atomic spinlocks in TLS functions
67
68         * mono-spinlock.h:
69         * Makefile.am: Added mono-spinlock.h
70
71 2002-07-21  Jeffrey Stedfast  <fejj@ximian.com>
72
73         * daemon-messages.c: #include <sys/types.h> and <sys/sockets.h> -
74         these are needed for sendmsg() and also for struct msghdr (at
75         least on Solaris). Solaris still won't build because struct msghdr
76         doesn't have msg_flags, msg_control, or msg_controllen members.
77         (CMSG_SPACE): Define for systems that don't have it.
78         (CMSG_LEN): Same.
79
80 2002-07-20  Dick Porter  <dick@ximian.com>
81
82         * wapi-private.h:
83         * io-private.h:
84         * io.h:
85         * io.c:
86         * handles.c: Implemented pipe handles
87         
88         * handles.c:
89         * daemon.c: Fixed bug in handle closing.
90
91         * shared.c:
92         * daemon.c: Forked processes now close all open file descriptors.
93
94 Fri Jul 19 19:05:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
95
96         * sockets.h, io-layer.h, critical-sections.h: don't include config.h
97         in header files.
98
99 2002-07-19  Martin Baulig  <martin@gnome.org>
100
101         * threads.c (ExitThread): Call exit() if no threads has been
102         created yet.
103
104 2002-07-17  Dick Porter  <dick@ximian.com>
105
106         * daemon-messages.c: Freebsd fixes from Andreas Kohn
107         <andreas.kohn@gmx.net>
108
109 2002-07-15  Dick Porter  <dick@ximian.com>
110
111         * io.c: Removed bogus console_flush() method, that was just cut
112         and pasted from file_flush when I separated the two handle types.
113
114 2002-07-12  Dick Porter  <dick@ximian.com>
115
116         * io.c (convert_from_flags): Fixed misunderstanding wrt fcntl
117         flags.  Fixes bug 27633.
118
119 2002-07-12  Dick Porter  <dick@ximian.com>
120
121         * wapi-private.h:
122         * handles.c:
123         * daemon.c: Use size of sockaddr_un.sun_path from config.h
124
125 2002-07-12  Dick Porter  <dick@ximian.com>
126
127         * processes.c (CreateProcess): Send stdin, stdout and stderr
128         handles if the startup info doesnt specify new ones
129
130         * io.c (GetStdHandle): Return the same handle when the same
131         standard handle is requested
132
133         * handles.c: Pass file descriptors when forking
134
135         * daemon.c: Use supplied file descriptors when forking a new
136         process
137
138         * daemon-messages.h: 
139         * daemon-messages.c: Pass stdin, stdout and stderr file
140         descriptors to the daemon (used when forking)
141
142 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
143
144         * daemon.c (_wapi_daemon_main): Use sizeof
145         (main_socket_address.sun_path) instead of hardcoded 108 value.
146
147         * handles.c (shared_init): Use sizeof
148         (shared_socket_address.sun_path) instead of hardcoded 108 value.
149
150 2002-07-10  Dennis Haney  <davh@davh.dk>
151
152         * shared.c:
153         * handles.c:
154         * daemon.c: Lots of documentation, some added error checking, and
155         code readability improvements.
156
157         * daemon-messages.h: Add the Error request type to improve error
158         checking.
159
160         * daemon-messages.c: Do a bit more error checking on send() and
161         recv(), and log errors with a higher severity level.
162
163 2002-07-04  Dick Porter  <dick@ximian.com>
164
165         * daemon.c (process_process_fork): Fix argument handling, due to
166         buggy understanding of g_strsplit() behaviour.
167
168 2002-07-03  Dick Porter  <dick@ximian.com>
169
170         * threads.h:
171         * threads.c: Implement OpenThread().  Define access-control values
172         for thread handles.
173
174         * wapi.h:
175         * processes.h:
176         * access.h:
177         * Makefile.am: Added access.h, to hold shared access-control
178         definitions
179
180 2002-07-02  Dick Porter  <dick@ximian.com>
181
182         * wapi-private.h (_WAPI_HANDLE_VERSION): New protocol version
183         
184 2002-07-02  Dick Porter  <dick@ximian.com>
185
186         * handles.c (shared_init): Make a second attempt to contact the
187         daemon if the shared memory attach succeeds, but the connect()
188         fails. (This copes with the daemon crashing without cleaning up
189         the shared memory.)
190
191         * Makefile.am: 
192         * daemon-private.h:
193         * daemon.c:
194         * shared.c (_wapi_shm_attach): Don't exec() anything when we fork
195         the daemon, it's now built into the library.
196
197 2002-06-25  Dick Porter  <dick@ximian.com>
198
199         * handles.c:
200         * handles-private.h:
201         * daemon-messages.h:
202         * daemon.c: Process forking and handle data management
203
204         * processes.h:
205         * process-private.h:
206         * processes.c: Process forking and other support functions
207
208 2002-06-25  Dick Porter  <dick@ximian.com>
209
210         * versioninfo.h: PE resource decoding
211
212         * unicode.c (_wapi_unicode_to_utf8): g_utf16_to_utf8 doesnt need
213         to be told the string length
214
215         * io.c: Removed the ACTUALLY_DO_UNICODE option.  Fixed some leaks.
216         Moved _wapi_time_t_to_filetime and the WapiFileTime typedef to
217         timefuncs.c
218
219 2002-06-12  Dick Porter  <dick@ximian.com>
220
221         * daemon.c: 
222         * daemon-messages.c: Handle SIGPIPE in a non-stupid way in the
223         daemon, if MSG_NOSIGNAL isn't available.  Thanks to Jaroslaw
224         Kowalski <jarek@atm.com.pl> for pointing out the bogosity.
225
226 2002-06-10  Jaroslaw Kowalski <jarek@atm.com.pl>
227
228         * sockets.c, daemon-messages.c: Prevent SIGPIPE from being raised
229         when writing to a closed socket.
230
231 2002-06-08  Jeffrey Stedfast  <fejj@ximian.com>
232
233         * mono-mutex.c (mono_once): New convenience function for my
234         previous fix.
235
236         * handles.c:
237         * error.c: 
238         * critical-sections.c: 
239         * threads.c: 
240         * sockets.c: 
241         * semaphores.c: 
242         * processes.c: 
243         * mutexes.c: 
244         * io.c: 
245         * events.c: 
246         * atomic.c: Use mono_once() rather than pthread_once().
247
248 2002-06-06  Jeffrey Stedfast  <fejj@ximian.com>
249
250         * handles.c (_wapi_handle_new): pthread_once() is not atomic, so
251         if multiple threads all try to call _wapi_handle_new() before the
252         shared data has been initialized, it is possible that we could get
253         into a condition where shared_init() is being executed and later
254         threads will pass by pthread_once() due to the fact that it has
255         already been called and so therefor will attempt to use the shared
256         data before it has been completely initialized. If we instead use
257         a standard mutex locking mechanism around shared_init(), we can
258         avoid the situation entirely. By wrapping the mutex locking in a
259         check to see if we've already initialized the data, we can even
260         avoid wasting resources by having to lock/unlock the mutex in any
261         later calls (the only time we'd have to worry about
262         locking/unlocking is the initial race to call shared_init() at
263         startup).
264
265 Sat Jun 1 13:27:11 CEST 2002 Paolo Molaro <lupus@ximian.com>
266
267         * atomic.h: inline asm fixes from Dennis Haney (davh@davh.dk).
268
269 Fri May 31 16:21:54 CEST 2002 Paolo Molaro <lupus@ximian.com>
270
271         * daemon.c, handles.c: rename "sun" local var since it's apparently
272         a #define on Solaris.
273
274 Fri May 31 15:40:14 CEST 2002 Paolo Molaro <lupus@ximian.com>
275
276         * daemon-messages.c: work-around MSG_NOSIGNAL missing on some
277         platforms.
278
279 2002-05-15  Dick Porter  <dick@ximian.com>
280
281         * wait.c: Fix a deadlock in WaitForMultipleObjects
282
283 2002-05-14  Dick Porter  <dick@ximian.com>
284
285         * io.c: Fix a cut&paste error, found by
286         Jaroslaw Kowalski <jarek@atm.com.pl>
287
288 2002-05-10  Dan Lewis  <dihlewis@yahoo.co.uk>
289
290         * io.c: Nasty typo.
291
292 2002-05-09  Dick Porter  <dick@ximian.com>
293
294         * threads.c: 
295         * semaphores.c: 
296         * processes.c: 
297         * mutexes.c: 
298         * handles-private.h: 
299         * events.c: 
300         * Makefile.am: Remove now-unused file wait-private.h
301
302 2002-05-08  Dick Porter  <dick@ximian.com>
303
304         * shared.c: Better error messages, and report when daemon
305         connection fails rather than blocking forever.  Do some more
306         shared memory sanity checking.
307
308         * handles.c: Better error messages when connecting to shared
309         memory and the handle daemon.  Fall back to non-shared handles if
310         an error occurs.  Set the default back to 'shared handles'.  Fix a
311         crashing bug in scratch space allocation that mangled the block
312         headers.
313
314 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
315
316         * handles.c (shared_init): Disable SHM for now, people have too
317         many problems with this, and the diagnostics are not helping.
318
319 2002-05-06  Dan Lewis  <dihlewis@yahoo.co.uk>
320
321         * io.c: CreateFile sets win32 last error.
322
323 2002-05-05  Dick Porter  <dick@ximian.com>
324
325         * wapi-private.h: 
326         * handles-private.h:
327         * io.c: 
328         * io-private.h:
329         * mutexes.c: 
330         * mutex-private.h: 
331         * processes.c: 
332         * process-private.h: 
333         * semaphores.c: 
334         * semaphore-private.h: 
335         * sockets.c: 
336         * socket-private.h: 
337         * events.c: 
338         * event-private.h: Simplify the WapiHandleOps struct: take out all
339         the file-specific entries, leaving just the items that operate on
340         handles themselves.  Split the close operation into shared and
341         private parts: shared close is called by the daemon.
342
343         * handles.c: As above, but also pass handle allocation, ref and
344         unref operations to the daemon.  Populate the handle_ops array at
345         compile time, because the daemon needs to call ops on handles too.
346         Don't bother to track open handle counts any more, the daemon does
347         that.
348         
349         * threads.c: 
350         * thread-private.h: As above, but also make the thread data
351         handle-private.
352
353         * shared.c: Fork a handle daemon if the calling process created
354         the shared memory segment.
355
356         * daemon.c:
357         * daemon-messages.c:
358         * daemon-messages.h:
359         * Makefile.am: Build a daemon to manage handle allocation and
360         destruction without needing to lock the shared memory
361
362 2002-04-30  Jeffrey Stedfast  <fejj@ximian.com>
363
364         * atomic.c: Changed to use a normal mutex rather than a spinlock
365         since a lot of platforms seem to not have them :\
366
367 2002-04-30  Dick Porter  <dick@ximian.com>
368
369         * Completely rewrote the handle waiting code: removed the helper
370         thread and its attendant complexity.  All handle waiting is now
371         abstracted into the WaitForSingleObject() and
372         WaitForMultipleObjects() functions.
373
374         * Implemented inter-process sharing of handles using sysv shared
375         memory.  This makes handles even more opaque, with a handle now
376         just an index into an array.
377         
378 2002-04-25  Dan Lewis  <dihlewis@yahoo.co.uk>
379
380         * io.c: unitialized pointer in GetCurrentDirectory.
381
382 Sat Apr 20 13:37:39 CEST 2002 Paolo Molaro <lupus@ximian.com>
383
384         * threads.c: destroy the mutex at thread destruction
385         (if/when thread destruction code will be actually called).
386         When protecting a tls data pointer from the gc, use also the 
387         thread id in the key.
388         
389 Wed Apr 17 18:36:27 CEST 2002 Paolo Molaro <lupus@ximian.com>
390
391         * timed-thread.c: avoid race condition when setting the thread to
392         detached.
393
394 2002-04-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
395
396         * jit.h: to more #include lines to avoid breaking compilation
397         under windows when upgrading mingw and w32api to version
398         1.3 (thanks Dick!).
399
400 2002-04-16  Dick Porter  <dick@ximian.com>
401
402         * atomic.h: Explanatory comment about lack of 80386 support
403
404 2002-04-15  Dick Porter  <dick@ximian.com>
405
406         * atomic.h: use xaddl for InterlockedIncrement() and
407         InterlockedDecrement().  Use cmpxchgl in a loop for
408         InterlockedExchange() and InterlockedExchangePointer().
409
410 Mon Apr 15 13:31:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
411
412         * unicode.c: fix unicode_len() to not access uninitialized memory
413         (and updated to conform to mono code style).
414
415 Fri Mar 29 17:15:11 CET 2002 Paolo Molaro <lupus@ximian.com>
416
417         * io.c: EEXISTS is ignored for directory creation.
418         * mono-mutex.h: remove silly "pragma }" that emacs users insert
419         because they use a broken editor:-)
420
421 2002-03-28  Dick Porter  <dick@ximian.com>
422
423         * sockets.h: 
424         * sockets.c: 
425         * io.c: 
426         * handles.h: 
427         * handles.c: Warning cleanups
428
429 2002-03-27  Dan Lewis <dihlewis@yahoo.co.uk>
430
431         * unicode.h, unicode.c: changed to gunichar2
432         * io.h, io.c: changed strings to gunichar2*, added
433         SetFileAttributes(), GetCurrentDirectory(), SetCurrentDirectory(),
434         some fixes to FindFirstFile() and friends.
435
436 2002-03-26  Dick Porter  <dick@ximian.com>
437
438         * types.h: Implement the large integer struct
439
440         * timefuncs.h:
441         * timefuncs.c: Dummy functions that don't yet implement
442         QueryPerformanceCounter() and QueryPerformanceFrequency()
443
444         * threads.h:
445         * threads.c: Implement SleepEx()
446
447         * system.h:
448         * system.c: Beginnings of GetSystemInfo()
449
450         * mono-mutex.c (pthread_mutex_timedlock): Fix a ms/ns conversion
451         thinko
452
453         * context.h:
454         * context.c: Dummy function that doesnt yet implement
455         GetThreadContext()
456
457         * atomic.h: 
458         * atomic.c: Interlocked functions
459
460 Mon Mar 25 13:01:40 CET 2002 Paolo Molaro <lupus@ximian.com>
461
462         * threads.c: use a gc-safe hash table to store tls pointers.
463
464 2002-03-22  Dick Porter  <dick@ximian.com>
465
466         * threads.c: Fix a race condition where a thread can start and
467         exit before the handle has been properly initialised (no reason
468         why the handle couldn't be initialised beforehand, so do so)
469
470         Fix a ms to ns conversion magnitude thinko.
471
472 2002-03-21  Dick Porter  <dick@ximian.com>
473
474         * semaphores.c: Fix a problem when waiting for one or more
475         semaphores, and another semaphore is Released (all waiting
476         semaphores assumed they were signalled)
477
478 2002-03-29  Dan Lewis <dihlewis@yahoo.co.uk>
479
480         * io.h, io.c, uglify.h: added MoveFile, CopyFile, CreateDirectory,
481         RemoveDirectory, GetFileAttributes, GetFileAttributesEx
482
483 2002-03-19  Dietmar Maurer  <dietmar@ximian.com>
484
485         * threads.c (Sleep): bug fix: 1ms == 1000000ns
486
487 2002-03-19  Dan Lewis <dihlewis@yahoo.co.uk>
488
489         * io.h, io.c, events.c, mutexes.c, semaphores.c, sockets.c,
490         threads.c, io.c: added flush method to handles.
491
492         * io.c: FlushFileBuffers() and FindFirstFile() functions.
493
494 Thu Mar 7 17:21:52 CET 2002 Paolo Molaro <lupus@ximian.com>
495
496         * threads.c, timed-thread.c, wait.c: Boehm-GC anable.
497
498 2002-02-20  Dick Porter  <dick@ximian.com>
499
500         * io-layer.h: Always build without cygwin support on windows
501
502 Mon Feb 18 15:50:59 CET 2002 Paolo Molaro <lupus@ximian.com>
503
504         * sockets.c: #undef DEBUG.
505
506 2002-02-14  Jeffrey Stedfast  <fejj@ximian.com>
507
508         * io-layer.h: conditionally include sys/filio.h and sys/sockio.h
509         for FIONBIO, FIONREAD, and SIOCATMARK.
510
511 2002-02-14  Jeffrey Stedfast  <fejj@ximian.com>
512
513         * sockets.c: conditionally include sys/filio.h and sys/sockio.h
514         for FIONBIO, FIONREAD, and SIOCATMARK.
515
516 2002-02-13  Dick Porter  <dick@ximian.com>
517
518         * sockets.c: Implement shutdown and select
519
520 2002-02-13  Jeffrey Stedfast  <fejj@ximian.com>
521
522         * mono-mutex.[c,h]: New source files that thinly wrap all pthread
523         functions that take pthread_mutex_t and/or pthread_mutexattr_t
524         arguments for the sake of portability. Implements recursive
525         mutexes and pthread_mutex_timedlock.
526
527         * critical-sections.c:
528         * events.c:
529         * handles.c:
530         * mutexes.c:
531         * semaphores.c:
532         * threads.c:
533         * timed-thread.c:
534         * wait.c: Use the mono-mutex wrapper portability functions/macros.
535
536         * pthread-compat.[c,h]: Replaced by mono-mutex.[c,h]
537
538 2002-01-23  Dick Porter  <dick@ximian.com>
539
540         * sockets.c: Networking support, mostly wrapping BSD socket APIs
541         with handle code, and translating errno into w32 error codes.
542
543         * macros.h: Some w32 macros used with the socket support
544
545         * error.c: Implemented GetLastError() and SetLastError()
546
547         * Makefile.am: Added sockets, with kludge to override some symbols
548
549 2001-12-17  Dietmar Maurer  <dietmar@ximian.com>
550
551         * unicode.c (_wapi_unicode_to_utf8): byteswap UTF16 strings before
552         passing them to iconv
553         (_wapi_unicode_to_utf8): only swap bytes on LE systems, remove bug
554         from previous commit.
555
556 2001-12-11  Dick Porter  <dick@ximian.com>
557
558         * io.c: Implement DeleteFile(), GetFileTime(), SetFileTime() and
559         FileTimeToSystemTime().
560
561         * unicode.c (unicode_len): Nasty way of finding length of unicode
562         string with embedded NULLs (counts until two NULLs together).
563
564         * mutexes.c (mutex_close): 
565         * events.c (event_close): Release the internal pthreads resources
566
567 2001-11-26  Dick Porter  <dick@ximian.com>
568
569         * critical-sections.c:
570         * events.c:
571         * handles.c:
572         * io.c:
573         * mutexes.c:
574         * semaphores.c:
575         * threads.c:
576         * timed-thread.c:
577         * wait.c: turn off DEBUG messages
578
579 2001-11-22  Dick Porter  <dick@ximian.com>
580
581         * handles.c (SignalObjectAndWait): Implement
582
583         * wait.c (WaitForSingleObject): Fix case where timeout == 0
584
585         * threads.c:
586         * semaphores.c:
587         * mutexes.c:
588         * io.c:
589         * events.c: Support for SignalObjectAndWait
590         
591 2001-11-21  Dick Porter  <dick@ximian.com>
592
593         * events.c:
594         * handles.c:
595         * mutexes.c:
596         * semaphores.c:
597         * threads.c:
598         * wait.c: Reliable method of returning which handle was signalled
599         on return from WaitForMultipleObjects().
600
601 2001-11-21  Dick Porter  <dick@ximian.com>
602
603         * events.c: Implement events
604
605 2001-11-15  Dick Porter  <dick@ximian.com>
606
607         * mutexes.c: Implement mutexes
608
609         * threads.c: 
610         * semaphores.c: 
611         * misc.c: Factor out some common code
612
613 2001-11-13  Dick Porter  <dick@ximian.com>
614
615         * threads.c: Implement TLS.  Implement GetCurrentThreadId(), and
616         GetCurrentThread() by maintaining a hash of thread handles.
617
618         * threads.h: Define thread and process creation flags
619
620 2001-11-12  Dick Porter  <dick@ximian.com>
621
622         * critical-sections.c: Implement critical sections
623
624 2001-11-12  Dick Porter  <dick@ximian.com>
625
626         * semaphores.c: Implement semaphores
627
628         * wait.c (wait_for_item): Maintain a wait count rather than count
629         signalled booleans.
630
631         * threads.c (thread_wait_multiple): Don't lock the wait item, that
632         will block other wait threads
633
634 2001-11-11  Dick Porter  <dick@ximian.com>
635
636         * Makefile.am: Rename some automake variables
637         (from Nick Drochak <ndrochak@gol.com>)
638
639 2001-11-10  Dick Porter  <dick@ximian.com>
640
641         * Makefile.am (libwapiincludedir): Fix include destination
642
643         * .cvsignore: Ignore generated files
644
645 2001-11-10  Dietmar Maurer  <dietmar@ximian.com>
646
647         * pthread-compat.c: added some include files to make it compile on
648         linux.
649
650 2001-11-08  Dick Porter  <dick@ximian.com>
651
652         * Initial checkin.
653
654         This is a library emulating the win32 threading and IO API.
655
656