]> sourceware.org Git - newlib-cygwin.git/blame - winsup/cygwin/ChangeLog
2004-10-28 Pierre Humblet <pierre.humblet@ieee.org>
[newlib-cygwin.git] / winsup / cygwin / ChangeLog
CommitLineData
53197923
PH
12004-10-28 Pierre Humblet <pierre.humblet@ieee.org>
2
3 * path.cc (mount_info::from_registry): Deimpersonate while
4 accessing HKLM.
5 (mount_info::read_cygdrive_info_from_registry): Ditto.
6 * cygheap.h: Define NO_IMPERSONATION.
7 (cygheap_user::issetuid): Replace INVALID_HANDLE_VALUE by
8 NO_IMPERSONATION.
9 (cygheap_user::has_impersonation_tokens): Ditto.
10 (cygheap_user::close_impersonation_tokens): Ditto.
11 * uinfo.cc (uinfo_init): Ditto.
12 * syscalls.cc (seteuid32): Ditto.
13 * security.cc (set_impersonation_token): Ditto.
14
5957d504
CF
152004-10-26 Christopher Faylor <cgf@timesys.com>
16
17 * cygtls.cc (_cygtls::fixup_after_fork): Wipe out exitsock local since
18 it should not be used by the child.
19 * select.cc (start_thread_socket): Turn off inheritance for exitsock.
20 Don't add exitsock to exception mask since it should never get an
21 exception.
22 (socket_cleanup): Change some debug messages for consistency.
23 * fhandler_socket.cc (fhandler_socket::dup): Change comment wording
24 slightly.
25
fdf4ad73
PH
262004-10-26 Pierre Humblet <pierre.humblet@ieee.org>
27
28 * registry.cc (get_registry_hive_path): Simplify and add a
29 debug_printf in case of failure.
30 (load_registry_hive): Revert the 2004-04-19 change.
31
4082a9eb
CF
322004-10-20 Christopher Faylor <cgf@timesys.com>
33
34 * select.cc (start_thread_socket): Remove attempt to delay reading of
35 exitsock or suffer occasional mysterious 60 second hangs.
36 (socket_cleanup): Empty the exitsock here after the thread has
37 terminated.
38
f054a20f
CF
392004-10-19 Christopher Faylor <cgf@timesys.com>
40
41 * fhandler_console.cc (fhandler_console::fixup_after_exec): Fix error
42 message.
43
96536b50
CF
442004-10-12 Christopher Faylor <cgf@timesys.com>
45
46 * select.cc (start_thread_socket): Remove unused code.
47
cbec131f
CF
482004-10-11 Christopher Faylor <cgf@timesys.com>
49
50 * fhandler_termios.cc (fhandler_termios::tcsetpgrp): Revert previous checkin.
51
1cda1322
CF
522004-10-10 Christopher Faylor <cgf@timesys.com>
53
54 * cygtls.h (exitsock): New element.
55 (exitsock_sin): Ditto.
56 * cygtls.cc (_cygtls::init_thread): Initialize exitsock to invalid handle.
57 (_cygtls::call2): Close exitsock if it is valid.
58 * select.cc (struct socketinf): Remove sin element.
59 (start_thread_socket): Initialize one SOCK_DGRAM socket per thread
60 instead of (apparently) expensive opening and closing of socket with
61 each select call.
62 (socket_cleanup): Send a byte to the exitsock socket as a way to
63 potentially signal a waiting-for-socket thread to exit.
64 * tlsoffsets.h: Regenerate.
65
60cb120f
CV
662004-10-07 Corinna Vinschen <corinna@vinschen.de>
67
68 * cygheap.h (class cygheap_user): Add psystemroot member and
69 env_systemroot method.
70 * environ.cc (struct spenv): Add add_always member.
1cda1322 71 (spenvs): Accommodate new add_always member. Add
60cb120f
CV
72 cygheap_user::env_systemroot method to SYSTEMROOT entry.
73 (build_env): Check add_always member when adding missing environment
74 variables from spenvs.
75 * uinfo.cc (cygheap_user::env_systemroot): New method.
76
9286b553
CV
772004-10-07 Corinna Vinschen <corinna@vinschen.de>
78
79 * dcrt0.cc (dll_crt0_0): Drop duplicated line.
80
859d85de
CF
812004-10-07 Christopher Faylor <cgf@timesys.com>
82
83 * spawn.cc (pthread_cleanup::oldmask): Default to invalid signal mask.
84 (do_cleanup): Test for invalid signal mask to decide whether to restore
85 the mask rather than assuming zero mask indicates that there is nothing
86 to do.
87
b9cd8fb5
CV
882004-10-07 Mark Paulus <mark.paulus@mci.com>
89
90 * fhandler_tty.cc (fhandler_tty_slave::read): Use previously
91 evaluated time_to_wait value.
92
b0637a51
PH
932004-10-05 Pierre Humblet <pierre.humblet@ieee.org>
94
95 * external.cc (check_ntsec): Do not call wincap.has_security.
96 * path.cc (path_conv::check): Ditto.
97 * security.cc (get_object_attribute): Ditto.
98 (get_file_attribute): Ditto.
99
01903046
CF
1002004-10-05 Bas van Gompel <cygwin-patch.buzz@bavag.tmfweb.nl>
101
102 * pinfo.cc (_pinfo::commune_send): Correct debugging output.
103
34421ac3
CF
1042004-10-04 Christopher Faylor <cgf@timesys.com>
105
106 * include/cygwin/signal.h: Add siginterrupt definition.
107
e49bc789
PH
1082004-10-02 Pierre Humblet <pierre.humblet@ieee.org>
109
110 * path.h (enum path_types): Delete PATH_ISDISK.
111 (path_conv::isdisk): Delete method.
112 (path_conv::set_isdisk): Ditto.
113 * path.cc (path_conv::check): Do not call set_isdisk.
1cda1322 114 * uinfo.cc(pwdgrp::load): Do not call pc.isdisk.
e49bc789 115
e3e443e4
CF
1162004-09-28 Christopher Faylor <cgf@timesys.com>
117
118 * fhandler_termios.cc (fhandler_termios::tcsetpgrp): Disallow attempts
119 to set the process group to a nonexistent process group.
120
2b94cfce
CV
1212004-09-27 Corinna Vinschen <corinna@vinschen.de>
122
123 * lib/_cygwin_crt0_common.cc: Revert patch from 2004-09-16. Brakes
124 newly built DLLs.
125
98fc1a6d
CF
1262004-09-24 Christopher Faylor <cgf@timesys.com>
127 Sergey Ivanov <seriv@parkheights.dyndns.org>
128
129 * path.cc (mount_info::read_cygdrive_info_from_registry): Default
130 /cygdrive to binary mode.
131
20e474d7
PH
1322004-09-22 Pierre Humblet <pierre.humblet@ieee.org>
133
134 * path.cc (normalize_win32_path): Only look for : in second position.
135 Avoid infinite loop with names starting in double dots.
98fc1a6d 136 (mount_info::conv_to_win32_path): Do not worry about a trailing dot.
20e474d7
PH
137 (hash_path_name): Ditto.
138
0ae97cf7
CF
1392004-09-20 Christopher Faylor <cgf@timesys.com>
140
141 * exceptions.cc (sig_handle_tty_stop): Set flag earlier.
142
e58412a2
CF
1432004-09-20 Christopher Faylor <cgf@timesys.com>
144
145 * exceptions.cc (sig_handle_tty_stop): Set flag that we are in a cygwin
146 function to avoid a probably erroneous stack walk.
147
af444ab7
CV
1482004-09-17 Corinna Vinschen <corinna@vinschen.de>
149
150 * syscalls.cc (unlink): Don't use "delete on close" on remote shares.
151
95a12a85
CV
1522004-09-17 Corinna Vinschen <corinna@vinschen.de>
153
ac652b50 154 * cygwin.din (_impure_ptr): Add export again. There are libs out there.
95a12a85 155
368ffbe3
CV
1562004-09-16 Corinna Vinschen <corinna@vinschen.de>
157
158 * cygwin.din (_impure_ptr): Don't export.
159 (reent_data): Export.
160 * lib/_cygwin_crt0_common.cc (_impure_ptr): Drop entirely. Don't
161 initialize _impure_ptr or u->impure_ptr_ptr.
162
22a1a24f
CF
1632004-09-15 Corinna Vinschen <corinna@vinschen.de>
164
165 * cygwin.din (_impure_ptr): Export.
166 (reent_data): Don't export.
167 * dcrt0.cc (reent_data): Drop.
168 (__cygwin_user_data): Initialize impure_ptr as GLOBAL_REENT.
169 (_dll_crt0): Initialize _impure_ptr as GLOBAL_REENT.
170 * lib/_cygwin_crt0_common.cc (_impure_ptr): Drop. Declare extern as
171 dllimport instead.
172
a9f36d28
CF
1732004-09-14 Christopher Faylor <cgf@timesys.com>
174
175 * cygtls.h: Add alignment kludge to fix disparity between compilers.
176 * tlsoffsets.h: Regenerate.
177
178 * fork.cc (slow_pid_reuse): Use define to control number of pids held
179 to prevent pid reuse.
180
599b41c4
CV
1812004-09-14 Sam Steingold <sds@gnu.org>
182
183 * autoload.cc (EnumProcessModules): Add.
184 * dlfcn.cc (dlsym): Handle RTLD_DEFAULT using EnumProcessModules().
185 * include/dlfcn.h (RTLD_DEFAULT): Define to NULL.
186
fc3a4274
CF
1872004-09-13 Christopher Faylor <cgf@timesys.com>
188
189 * fork.cc (slow_pid_reuse): Temporarily double the number of pids held
190 to prevent pid reuse.
191
a5eb75d6
CF
1922004-09-12 Christopher Faylor <cgf@timesys.com>
193
194 * sigproc.cc (wait_sig): Ensure that waiting threads are awoken after
195 returning from a hold condition.
196
3d65bb97
CF
1972004-09-12 Christopher Faylor <cgf@timesys.com>
198
199 * child_info.h (CURR_CHILD_INFO_MAGIC): Update.
200
d584454c
CF
2012004-09-11 Pierre Humblet <pierre.humblet@ieee.org>
202 Christopher Faylor <cgf@timesys.com>
203
204 * exceptions.cc: (ctrl_c_handler): Do nothing while a Cygwin subprocess
205 is starting.
206
2072004-09-10 Christopher Faylor <cgf@timesys.com>
208
209 * child_info.h (init_child_info): Remove pid argument from declaration.
210 * cygheap.h (init_cygheap::pid): New element.
211 * dcrt0.cc (dll_crt0_0): Eliminate handling of now-noexistent cygpid
de4e88a8
CF
212 parameter in child_info struct. Set forkee to 'true' rather than
213 cygpid since the pid value was never used.
d584454c
CF
214 (dll_crt0_1): Ditto.
215 (_dll_crt0): Ditto.
216 * fork.cc (fork_child): Don't wait for sigthread. This is handled in
217 the fork call now.
de4e88a8
CF
218 (fork_parent): Remove obsolete pid argument from init_child_info call.
219 Don't do anything special with cygpid when DEBUGGING.
d584454c
CF
220 (fork): Delay all signals during fork.
221 (fork_init): Don't do anything special when DEBUGGING.
222 * pinfo.cc (set_myself): Remove pid parameter. Use new pid field in
223 cygheap.
224 (pinfo_init): Don't pass pid argument to set_myself.
225 * sigproc.cc (sig_send): Wait for dwProcessId to be non-zero as well as
226 sendsig.
227 (init_child_info): Eliminate handling of pid.
228 (wait_sig): Implement method to temporarily hold off sending signals.
229 * sigproc.h (__SIGHOLD): New enum.
230 (__SIGNOHOLD): Ditto.
231 * spawn.cc (spawn_guts): Remove obsolete pid argument from
232 init_child_info call.
233
d495ee9f
CV
2342004-09-10 Corinna Vinschen <corinna@vinschen.de>
235
236 * fhandler.cc (fhandler_base::dup): Use debug_printf.
237
4875a4b6
CV
2382004-09-10 Corinna Vinschen <corinna@vinschen.de>
239
240 * Makefile.in: Create libutil.a from bsdlib.o exports.
241 * bsdlib.cc (logwtmp): Move from syscalls.cc to here.
242 (login): Ditto.
243 (logout): Ditto.
244
245 * winsup.h (EXPORT_ALIAS): New macro.
246 * exec.cc: Define alias symbols using EXPORT_ALIAS macro.
247 * syscalls.cc: Ditto.
248 * times.cc: Ditto.
249
1f97020a
CV
2502004-09-09 Corinna Vinschen <corinna@vinschen.de>
251
252 * fhandler_tape.cc (fhandler_dev_tape::open): Fix typo.
253
64232968
CV
2542004-09-09 Bas van Gompel <cygwin-patch.buzz@bavag.tmfweb.nl>
255
256 * pipe.cc (create_selectable_pipe): Work around bug in Windows 95
257 where CreateNamedPipe returns NULL.
258
a4563209
PH
2592004-09-08 Pierre Humblet <pierre.humblet@ieee.org>
260
261 * cygheap.h (cwdstuff::drive_length): New member.
262 (cwdstuff::get_drive): New method.
263 * path.cc (normalize_win32_path): Simplify by using cwdstuff::get_drive.
264 (mount_info::conv_to_win32_path): Use cwdstuff::get_drive as default for /.
265 (cwdstuff::set): Initialize drive_length.
266
6f7a746c
CF
2672004-09-07 Christopher Faylor <cgf@timesys.com>
268
269 * cygtls.cc (_cygtls::init_thread): Set __sdidinit to negative value to
270 indicate that it is "special".
271 * thread.cc (pthread::exit): If __sdidinit is < 0, it was never really
272 initialized so reset it to 0 before calling _reclaim_reent.
273
dda37cd2
CF
2742004-09-05 Christopher Faylor <cgf@timesys.com>
275
276 * include/cygwin/version.h: Bump DLL minor number to 12.
277
eea5dd97
CV
2782004-09-03 Corinna Vinschen <corinna@vinschen.de>
279
280 * security.cc: Fix a few more strace_prints.
281
0cd9f74f
CF
2822004-09-02 Christopher Faylor <cgf@timesys.com>
283
284 Regularize most strace_prints throughout so that %E is always preceded
285 by a comma and elminate most uses of "foo = %s" to "foo %s".
286
6644c628
CF
2872004-09-02 Bob Byrnes <byrnes@curl.com>
288 Christopher Faylor <cgf@timesys.com>
289
290 * autoload.cc (NtQueryInformationFile): Return nonzero on error.
291 * ntdll.h (FILE_PIPE_LOCAL_INFORMATION): Add.
292 (NtQueryInformationFile): Fix types for last two arguments.
293 * pipe.cc: Include stdlib.h, limits.h, and ntdll.h.
294 (create_selectable_pipe): New function to create a pipe that can be
295 used with NtQueryInformationFile for select.
296 (fhandler_pipe::create): Call create_selectable_pipe instead of
297 CreatePipe.
298 (pipe): Use DEFAULT_PIPEBUFSIZE as argument to create_pipe.
299 * select.cc: Include limits.h and ntdll.h.
300 (peek_pipe): Add select_printf output. Call NtQueryInformationFile to
301 implement select for write on pipes.
302 (fhandler_pipe::select_read): Reorder field assignments to be
303 consistent with fhandler_pipe::select_write.
304 (fhandler_pipe::select_write): Initialize startup, verify, cleanup, and
305 write_ready fields for select_record.
306 (fhandler_pipe::select_except): Tweak indentation to be consistent with
307 fhandler_pipe::select_write.
308
72067cca
CF
3092004-08-30 Pierre Humblet <pierre.humblet@ieee.org>
310
311 * fork.cc (fork_parent): Return the cygpid directly derived from the
312 winpid.
313
1af912ce
CF
3142004-08-30 Christopher Faylor <cgf@timesys.com>
315
316 * fork.cc (fork_parent): Record child's pid when we're sure that it has
317 been filled out by the child.
318 * pinfo.cc (pinfo::init): Trivial change.
319
c01edcda
CV
3202004-08-29 Corinna Vinschen <corinna@vinschen.de>
321
322 * fhandler_disk_file.cc (fhandler_disk_file::fchmod): Allow to report
323 success on systems with ntsec and ntea set.
324
ddea76a6
CV
3252004-08-28 Pierre Humblet <pierre.humblet@ieee.org>
326
72067cca 327 * fhandler.cc (fhandler_base::write): In the lseek_bug case, set EOF
ddea76a6
CV
328 before zero filling. Combine similar error handling statements.
329
2e41976b
PH
3302004-08-28 Pierre Humblet <pierre.humblet@ieee.org>
331
332 * syscalls.cc (ftruncate64): On 9x, call write with a zero length
333 to zero fill when the file is extended.
334
bb647ab6
CV
3352004-08-24 Corinna Vinschen <corinna@vinschen.de>
336
337 * syscalls.cc (link): Avoid compiler warning.
338
12618f5f
CV
3392004-08-21 Corinna Vinschen <corinna@vinschen.de>
340
341 * environ.cc (set_ntea): New function.
342 (set_ntsec): Ditto.
343 (set_smbntsec): Ditto.
344 (parse_thing): Change ntea, ntsec and smbntsec settings to call
345 appropriate functions.
346
7c481712
CV
3472004-08-20 Corinna Vinschen <corinna@vinschen.de>
348
349 * fhandler_tape.cc (fhandler_dev_tape::raw_read): Use ?: instead of
350 if/else.
351 (fhandler_dev_tape::raw_write): Return -1 in case of error.
352
b9188d6c
CV
3532004-08-19 Corinna Vinschen <corinna@vinschen.de>
354
355 * errno.cc (_sys_errlist): Change various text to their english Linux
356 counterparts. Unify layout.
357 (strerror): Remove switch statement.
358
8cb783ba
CV
3592004-08-19 Corinna Vinschen <corinna@vinschen.de>
360
361 * fhandler.cc (fhandler_base::open): Set shared flags to 0 when
362 opening a tape device.
363
82b30180
CV
3642004-08-19 Corinna Vinschen <corinna@vinschen.de>
365
f0eeb667 366 * fhandler_socket.cc (fhandler_socket::dup): Increment dtable's
82b30180
CV
367 need_fixup_before counter on successful dup.
368 * net.cc (cygwin_getpeername): Add file descriptor to debug output.
369
8f663bd6
CV
3702004-08-17 Pierre Humblet <pierre.humblet@ieee.org>
371
372 * fhandler.h (fhandler_dev_dsp:~fhandler_dev_dsp): Delete.
373 (fhandler_dev_dsp::open_count): Delete.
374 (fhandler_dev_dsp::close_audio_in): New method declaration.
375 (fhandler_dev_dsp::close_audio_in): Ditto.
376 * fhandler_dsp.cc: Add and edit debug_printf throughout.
377 (fhandler_dev_dsp::Audio::denyAccess): Delete.
378 (fhandler_dev_dsp::Audio::fork_fixup): Ditto.
379 (fhandler_dev_dsp::Audio::getOwner): Ditto.
380 (fhandler_dev_dsp::Audio::clearOwner): Ditto.
381 (fhandler_dev_dsp::Audio::owner_): Ditto.
382 (fhandler_dev_dsp::Audio::setformat): Ditto, rename to setconvert.
383 (fhandler_dev_dsp::Audio::lock): Ditto, move to queue.
384 (fhandler_dev_dsp::Audio::unlock): Ditto.
385 (fhandler_dev_dsp::Audio::lock_): Ditto.
386 (fhandler_dev_dsp::Audio::bufferIndex_): New member, from Audio_out
387 and Audio_in.
388 (fhandler_dev_dsp::Audio::pHdr_): Ditto.
389 (fhandler_dev_dsp::Audio::wavehdr_): Ditto.
390 (fhandler_dev_dsp::Audio::bigwavebuffer_): ditto.
391 (fhandler_dev_dsp::Audio::Qisr2app_): Ditto.
392 (fhandler_dev_dsp::Audio::setconvert): New method, from old setformat.
393 (fhandler_dev_dsp::Audio::queue::lock): New method.
394 (fhandler_dev_dsp::Audio::queue::unlock): Ditto.
395 (fhandler_dev_dsp::Audio::queue::dellock): Ditto.
396 (fhandler_dev_dsp::Audio::queue::isvalid): Ditto.
397 (fhandler_dev_dsp::Audio::queue::lock_): New member.
398 (fhandler_dev_dsp::Audio::queue::depth1_): Delete.
399 (fhandler_dev_dsp::Audio_out::fork_fixup): New method.
400 (fhandler_dev_dsp::Audio_out::isvalid): New method.
401 (fhandler_dev_dsp::Audio_out::start): Remove arguments.
402 (fhandler_dev_dsp::Audio_out::parsewav): Change arguments and set
403 internal state.
404 (fhandler_dev_dsp::Audio_out::emptyblocks): Delete.
405 (fhandler_dev_dsp::Audio_out::Qapp2app_): Ditto.
406 (fhandler_dev_dsp::Audio_out::Qisr2app_): Ditto, move to Audio.
407 (fhandler_dev_dsp::Audio_out::bufferIndex_): Ditto.
408 (fhandler_dev_dsp::Audio_out::pHdr_): Ditto.
409 (fhandler_dev_dsp::Audio_out::wavehdr_): Ditto.
410 (fhandler_dev_dsp::Audio_out::bigwavefuffer_): Ditto.
411 (fhandler_dev_dsp::Audio_out::freq_): New member.
412 (fhandler_dev_dsp::Audio_out::bits_): New member.
413 (fhandler_dev_dsp::Audio_out::channels_): New member.
414 (fhandler_dev_dsp::Audio_in::fork_fixup): New method.
415 (fhandler_dev_dsp::Audio_in::isvalid): New method.
416 (fhandler_dev_dsp::Audio_in::Qapp2app_): Delete.
417 (fhandler_dev_dsp::Audio_in::Qisr2app_): Ditto, move to Audio.
418 (fhandler_dev_dsp::Audio_in::bufferIndex_): Ditto.
419 (fhandler_dev_dsp::Audio_in::pHdr_): Ditto.
420 (fhandler_dev_dsp::Audio_in::wavehdr_): Ditto.
421 (fhandler_dev_dsp::Audio_in::bigwavefuffer_): Ditto.
422 (fhandler_dev_dsp::Audio::queue::queue): Simplify.
423 (fhandler_dev_dsp::Audio::queue::send): Use lock.
424 (fhandler_dev_dsp::Audio::queue::query): Do not use depth1_.
425 (fhandler_dev_dsp::Audio::queue::recv): Ditto.
426 (fhandler_dev_dsp::Audio::Audio): Adapt to new class members.
427 (fhandler_dev_dsp::Audio::~Audio): Ditto
428 (fhandler_dev_dsp::Audio_out::start): Reorganize.
429 (fhandler_dev_dsp::Audio_out::stop): Simplify.
430 (fhandler_dev_dsp::Audio_out::init): Reset the queue and clear flag.
431 (fhandler_dev_dsp::Audio_out::write): Reorganize to allocate audio_out.
432 (fhandler_dev_dsp::Audio_out::buf_info): Use appropriate block size.
433 (fhandler_dev_dsp::Audio_out::callback_sampledone): Do not use lock.
434 (fhandler_dev_dsp::Audio_out::waitforspace): Simplify.
435 (fhandler_dev_dsp::Audio_out::waitforallsent):Ditto.
436 (fhandler_dev_dsp::Audio_out::sendcurrent): Reorganize.
437 Clear flag before requeuing.
438 (fhandler_dev_dsp::Audio_out::parsewav):
439 (fhandler_dev_dsp::Audio_in::start): Reorganize.
440 (fhandler_dev_dsp::Audio_in::stop): Simplify.
441 (fhandler_dev_dsp::Audio_in::queueblock): Ditto.
442 Requeue header in case of error.
443 (fhandler_dev_dsp::Audio_in::init): Reset the queue and clear flag.
444 (fhandler_dev_dsp::Audio_in::waitfordata): Simplify.
445 Do not UnprepareHeader if the flag is zero.
446 (fhandler_dev_dsp::Audio_in::buf_info): Ditto.
447 (fhandler_dev_dsp::Audio_in::callback_blockfull): Do not use lock.
448 (fhandler_dev_dsp::open_count): Delete.
449 (fhandler_dev_dsp::open): Only check existence, do not allocate
450 anything. Set flags appropriately. Create archetype.
451 (fhandler_dev_dsp::write): Call archetype as needed. Create audio_out.
452 (fhandler_dev_dsp::read): Call archetype as needed. Create audio_in.
453 (fhandler_dev_dsp::close): Call archetype as needed.
454 Call close_audio_in and close_audio_out.
455 (fhandler_dev_dsp::close_audio_in): New function.
456 (fhandler_dev_dsp::close_audio_out): New function.
457 (fhandler_dev_dsp::dup): Use archetypes.
458 (fhandler_dev_dsp::ioctl): Call archetype as needed. Reorganize for
459 new structures.
460 (fhandler_dev_dsp::fixup_after_fork): Call archetype as needed.
461 (fhandler_dev_dsp::fixup_after_exec): Call archetype as needed.
462 Clear audio_in and audio_out.
463
252dd881
PH
4642004-08-14 Pierre Humblet <pierre.humblet@ieee.org>
465
466 * fhandler.cc (fhandler_base::open_9x): Set file attributes
467 for new files.
468
cb3f750c
CF
4692004-08-11 Christopher Faylor <cgf@timesys.com>
470
471 * net.cc (cygwin_gethostbyname): Show failing host name on error.
472
fe3db6cc
CF
4732004-08-10 Christopher Faylor <cgf@redhat.com>
474
475 * select.cc (select_stuff::wait): Correctly check for w4 array bounds.
476
3410b5be
CV
4772004-08-03 Corinna Vinschen <corinna@vinschen.de>
478
479 * errno.cc (errmap): Add ERROR_TOO_MANY_LINKS -> EMLINK mapping.
480 * syscalls.cc (link): Only copy files if FS doesn't support hard links.
481
26462985
CV
4822004-07-26 Christopher January <chris@atomice.net>
483
484 * fhandler_proc.cc (format_proc_cpuinfo): Remove Intel-specific flags
485 from /proc/cpuinfo on non-Intel processors. Added new AMD-specific
486 flags. Changed Intel flag names to match Linux.
487
634d51d9
CF
4882004-07-24 Christopher Faylor <cgf@timesys.com>
489
490 * dcrt0.cc (dll_crt0_0): Use proper boolean arguments.
491 * pinfo.cc (pinfo::init): Don't consider MapViewOfFileEx error to be
492 fatal if exiting.
493 * pinfo.h (pinfo::init): Eliminate default argument and supply the
494 argument in the one case that needed it.
495
65c5aa77
CV
4962004-07-24 Corinna Vinschen <corinna@vinschen.de>
497 Christopher Faylor <cgf@timesys.com>
498
499 * autoload.cc (GetNativeSystemInfo): Add.
500 (IsWow64Process): Add.
501 * init.cc (respawn_wow64_process): New function.
502 (dll_entry): If process has been started from a 64 bit
503 process, call respawn_wow64_process.
34b14e0b 504 * uname.cc (uname): On 64 bit systems, use GetNativeSystemInfo.
65c5aa77
CV
505 Show actual CPU type.
506
061095b5
CV
5072004-07-23 Corinna Vinschen <corinna@vinschen.de>
508
509 * dtable.cc (dtable::get_debugger_info): Make stderr r/w according
510 to SUSv3.
511
0544d116
CV
5122004-07-22 Corinna Vinschen <corinna@vinschen.de>
513
514 * fhandler_tty.cc (fhandler_tty_slave::open): Use requested flag
515 values also when copying fhandler from archetype.
516
5b7534fe
CF
5172004-07-22 Christopher Faylor <cgf@timesys.com>
518
519 * pinfo.cc (pinfo::init): Print handle in hex when MapViewOfFile fails.
520
7d9c458d
CV
5212004-07-20 Corinna Vinschen <corinna@vinschen.de>
522
523 * shm.cc: Whitespace fixes.
524
894c6777
CF
5252004-07-20 Christopher Faylor <cgf@timesys.com>
526
527 * Makefile.in (clean): Remove cygwin.def since it is autogenerated.
528
bc2c5114
CV
5292004-07-19 Corinna Vinschen <corinna@vinschen.de>
530
531 * fhandler_dsp.cc (fhandler_dev_dsp::Audio_out::init): Fix non-ISO
532 expression.
533 * fhandler_floppy.cc (fhandler_dev_floppy::open): Remove unused
534 variable.
535 * fhandler_proc.cc (format_proc_meminfo): Fix compiler warning.
536
1d2fd388
CF
5372004-07-16 Christopher Faylor <cgf@timesys.com>
538
539 * pinfo.cc (pinfo::init): Guard against MapViewOfFileEx failure.
540
e348b39a
CV
5412004-07-15 Corinna Vinschen <corinna@vinschen.de>
542
543 * mmap.cc (mmap_record::alloc_page_map): Mark pages as allocated even
544 on Windows 9x, FWIW.
545
0c0ad23a
CV
5462004-07-15 Corinna Vinschen <corinna@vinschen.de>
547
548 * mmap.cc (mprotect): When MAP_WRITE protection is requested, use
549 READWRITE or WRITECOPY protection, whatever has been used when the
550 page has been allocated initially.
551
4243412a
CV
5522004-07-15 Corinna Vinschen <corinna@vinschen.de>
553
554 * fhandler.h (class fhandler_dev_raw): Remove is_writing flag.
555 Remove declaration of writebuf.
556 (class fhandler_dev_floppy): Remove declaration of close.
557 * fhandler_floppy.cc (fhandler_dev_floppy::close): Delete.
558 (fhandler_dev_floppy::lseek): Remove calls to writebuf. Set
559 eom_detected to false after successful seek.
560 * fhandler_raw.cc (fhandler_dev_raw::writebuf): Delete.
561 (fhandler_dev_raw::raw_read): Remove calls to writebuf.
562 (fhandler_dev_raw::raw_write): Always invalidate buffer.
563
5ba42c7f
CV
5642004-07-15 Corinna Vinschen <corinna@vinschen.de>
565
566 * mmap.cc (class mmap_record): Fix return type of get_offset.
567 (mmap_record::fixup_page_map): Fix off by one error.
568 (list::search_record): Use long as type of "start" argument in both,
569 declaration and definition. Use long as type for local variable "i".
570
83967714
CF
5712004-07-14 Dave Korn <dk@artimi.com>
572
573 * fhandler_registry.cc (registry_listing): Correct typo.
574 (fhandler_registry::fill_filebuf): Set size of newly expanded buffer
575 prior to calling RegQueryValueEx.
576
dd3a7a20
CV
5772004-07-14 Corinna Vinschen <corinna@vinschen.de>
578
579 * fhandler_raw.cc (fhandler_dev_raw::raw_write): Remove buffered
580 write entirely.
581
1d470711
CV
5822004-07-07 Corinna Vinschen <corinna@vinschen.de>
583
584 * spawn.cc (spawn_guts): Check if script is executable.
585
78c6a5b5
CV
5862004-06-30 Corinna Vinschen <corinna@vinschen.de>
587
588 * times.cc (hires_ms::usecs): Don't overreact.
589
fbd5a0b8
CV
5902004-06-30 Corinna Vinschen <corinna@vinschen.de>
591
592 * times.cc (hires_ms::usecs): Reinit timer when system time overflows.
593
76a3f968
CF
5942004-06-27 Christopher Faylor <me@cgf.cx>
595
596 * thread.cc (__cygwin_lock_lock): Don't bother locking when there is
597 only one known thread.
598 (__cygwin_lock_unlock): Ditto for unlocking.
599
c624912e
CV
6002004-06-23 Tomas Ukkonen <tomas.ukkonen@iki.fi>
601
602 * fhandler_proc.cc (format_proc_cpuinfo): Test CPU vendor and print
603 AMD specific 3dnow capabilities.
604
f0d14ca9
CV
6052004-06-23 Pierre Humblet <pierre.humblet@ieee.org>
606
607 * fhandler_socket.cc (fhandler_socket::release): Call
608 WSASetLastError last.
609
c0508da2
CF
6102004-06-21 Christopher Faylor <cgf@alum.bu.edu>
611
612 * autoload.cc (wsock_init): Keep lock while modifying return address.
613
456afc5d
CV
6142004-06-17 Corinna Vinschen <corinna@vinschen.de>
615
616 * fhandler.cc (fhandler_base::open): Remove 9x specific code.
617
bd0e9c7a 6182004-06-17 Pierre Humblet <pierre.humblet@ieee.org>
f0d14ca9 619
bd0e9c7a
PH
620 * fhandler.cc (fhandler_base::open_9x): Do not check for null name.
621 Move debug_printf to common code line.
622 (fhandler_base::open): Ditto. Initialize upath. Remove second argument
623 of pc.get_nt_native_path.
624 * path.h (path_conv::get_nt_native_path): Remove second argument.
625 * path.cc (path_conv::get_nt_native_path): Ditto. Call str2uni_cat.
626 * security.h (str2buf2uni_cat): Delete declaration.
627 (str2uni_cat): New declaration.
628 * security.cc (str2buf2uni): Get length from sys_mbstowcs call.
629 (str2buf2uni_cat): Delete function.
630 (str2uni_cat): New function.
631 * miscfuncs.cc (sys_mbstowcs): Add debug_printf.
632
f6d9664b
CV
6332004-06-17 Corinna Vinschen <corinna@vinschen.de>
634
635 * fhandler.cc (fhandler_base::open): Substitute FILE_SUPERSEDE with
636 FILE_OVERWRITE_IF.
637
cc24f9b6
CF
6382004-06-09 Christopher Faylor <cgf@alum.bu.edu>
639
640 * include/cygwin/version.h: REALLY bump dll minor version to 11.
641
35fe2c08
CV
6422004-06-08 Egor Duda <deo@corpit.ru>
643
644 * include/cygwin/ipc.h: Make IPC_INFO visible only for ipc system
645 utilities, to make it consistent with declaration of struct seminfo.
646
694a67c4
CV
6472004-06-08 Pierre Humblet <pierre.humblet@ieee.org>
648
649 * path.cc (fchdir): Pass the Posix path to chdir.
650
beffbc5e
CF
6512004-06-07 Christopher Faylor <cgf@alum.bu.edu>
652
653 * dtable.cc (dtable::find_fifo): Release lock after fifo found (still
654 racy).
655 * fhandler.h (fhandler_fifo::get_io_handle): New fifo-specific method.
656 * fhandler_fifo.cc (fhandler_fifo::close): Close output_handle only if
657 it is open.
658 (fhandler_fifo::open_not_mine): Reorganize slightly. Don't call _pinfo
659 methods when the fifo is owned by me or suffer dtable lock_cs deadlock.
660 (fhandler_fifo::open): Call open_not_mine first, otherwise open myself
661 (racy).
662 * pinfo.cc (_pinfo::commune_recv): Duplicate fifo handles here in
663 requesting processes arena to avoid one potential race (of many).
664 (_pinfo::commune_send): Move all PICOM_FIFO code under one case
665 statement.
666
667 * thread.cc (pthread::init_mainthread) Use existing hMainProc handle
668 rather than calling GetCurrentProcess.
669
cf4bfdb2
CF
6702004-06-04 Christopher Faylor <cgf@alum.bu.edu>
671
672 * winbase.h (ilockincr): Add more neverending changes from the
673 inexplicable world of gcc asm constraint magic. Should stop random
674 crashes.
675 (ilockdecr): Ditto.
676
04612c69
CF
6772004-06-03 Christopher Faylor <cgf@alum.bu.edu>
678
679 * autoload.cc (IsDosDeviceName_U): Define.
680 * ntdll.h (IsDosDeviceName_U): Declare.
681 * fhandler.cc (fhandler_base::open): Check to see if win32_name is a
682 dos device and just call the 9x open if so.
683
604ca5fa
CF
6842004-06-03 Christopher Faylor <cgf@alum.bu.edu>
685
686 * winbase.h (ilockincr): More changes from the inexplicable world of
687 gcc asm magic.
688 (ilockdecr): Ditto.
689
ee94df3e
CF
6902004-06-03 Christopher Faylor <me@cgf.cx>
691
692 * winbase.h (ilockincr): YA correction to ensure correct operation with
693 no optimization.
694 (ilockdecr): Ditto.
695
414bfc10
CV
6962004-06-03 Corinna Vinschen <corinna@vinschen.de>
697
698 * cygserver.h (CYGWIN_SERVER_VERSION_API): Bump.
699
378e5a02
CV
7002004-06-03 Corinna Vinschen <corinna@vinschen.de>
701
702 * include/cygwin/ipc.h (IPC_KEY_IS_SHMID): Redefine to a more sensible
703 value.
704
e847fe13
CF
7052004-06-02 Christopher Faylor <cgf@alum.bu.edu>
706
707 * cygheap.cc (cmalloc): Add debugging hook.
708
1a21f331
CF
7092004-06-02 Christophe Jaillet <christophe.jaillet@wanadoo.fr>
710
711 * spawn.cc (find_exec): Use has_slash to determine if path has a slash
712 rather than calculating this twice.
713
2d5afa98
PH
7142004-05-30 Pierre Humblet <pierre.humblet@ieee.org>
715
1a21f331 716 * path.cc (mount_info::add_item): Make sure native path has drive
2d5afa98 717 or UNC form. Call normalize_xxx_path instead of [back]slashify.
1a21f331 718 Remove test for double slashes. Reorganize to always debug_print.
2d5afa98 719
c4c9eb5f
CF
7202004-05-28 Pierre Humblet <Pierre.Humblet@ieee.org>
721
722 * fhandler_disk_file.cc (fhandler_disk_file::fchmod): Only try to open
723 the file if it uses an acl.
724
e3778517
CF
7252004-05-28 Pierre Humblet <Pierre.Humblet@ieee.org>
726
727 * path.cc (chdir): Always use the normalized_path as posix_cwd, except
728 if it starts with a drive.
729
37eadb6f
CF
7302004-05-25 Christopher Faylor <cgf@alum.bu.edu>
731
732 * winbase.h: Semi-revert previous patch as it caused strange behavior.
733 Use syntax similar to that recommended in mingw-dvlpr.
734
9a17d61b
CF
7352004-05-25 Christopher Faylor <cgf@alum.bu.edu>
736
737 * include/cygwin/version.h: Bump DLL minor number to 11.
738
1b1f85fa
CF
7392004-05-25 Christopher Faylor <cgf@alum.bu.edu>
740
741 * winbase.h: Add proper attributions for memory operands throughout.
742
41bba72e
CF
7432004-05-24 Christopher Faylor <cgf@alum.bu.edu>
744
745 * include/cygwin/version.h: Bump api minor version number.
746
7472004-05-24 Christopher Faylor <cgf@alum.bu.edu>
748
749 * cygwin.din: Export atoll.
750
bfa76897
CF
7512004-05-20 Christopher Faylor <cgf@alum.bu.edu>
752
753 * tty.cc (tty_list::allocate_tty): Leave tty_mutex armed on successful
754 return from !with_console
755 * fhandler_tty.cc (fhandler_pty_master::open): Release tty_mutex here
756 after all initialization is done.
757
aac9c88c
CV
7582004-05-17 Corinna Vinschen <corinna@vinschen.de>
759
760 * grp.cc (getgrgid_r): Replace struct group by struct __group32 in
761 argument definition.
762 (getgrnam_r): Ditto.
763
68509b30
CV
7642004-05-17 Corinna Vinschen <corinna@vinschen.de>
765
766 * cygwin.din: Add symbols flockfile, ftrylockfile, funlockfile,
767 getgrgid_r, getgrnam_r and getlogin_r.
768 * grp.cc (getgrgid_r): New function.
769 (getgrnam_r): Ditto.
770 * syscalls.cc (flockfile): Ditto.
771 (ftrylockfile): Ditto.
772 (funlockfile): Ditto.
773 * sysconf.cc (sysconf): Return LOGIN_NAME_MAX in case of
774 _SC_LOGIN_NAME_MAX.
775 * thread.cc (__cygwin_lock_trylock): Define int. Return value from
776 call to pthread_mutex_trylock.
777 * uinfo.cc (getlogin_r): New function.
778 * include/limits.h: Define LOGIN_NAME_MAX.
779 * include/cygwin/version.h: Bump API minor number.
780 * include/sys/lock.h: Add declarations for __cygwin_lock_xxx functions.
781 * include/sys/stdio.h: Add define for _ftrylockfile.
782
3271e9f9
CF
7832004-05-17 Christopher Faylor <cgf@alum.bu.edu>
784
785 * tty.cc (tty_list::init): Move hmaster initialization earlier to
786 prevent compilation error.
787
641654f7
CF
7882004-05-17 Christopher Faylor <cgf@alum.bu.edu>
789
790 Change the name "title_mutex" to "tty_mutex" throughout.
791 * tty.h (tty_list::allocate_tty): Turn argument into a boolean.
792 * tty.cc (tty_list::init): Protect entire allocation operation with
793 tty_mutex (formerly title_mutex) to protect against allocation races.
794
32880f1e
CV
7952004-05-16 Corinna Vinschen <corinna@vinschen.de>
796
797 * fhandler_socket.cc (fhandler_socket::recvfrom): Use original flags
798 value in each WSARecvFrom call.
799 (fhandler_socket::recvmsg): Ditto. Reformat slightly.
800
0c565ab3
CF
8012004-05-15 Christopher Faylor <cgf@alum.bu.edu>
802
803 * cygthread.cc (cygthread::is): Eliminate.
804 * cygthread.h (cygthread::is): Eliminate declaratin.
805 * fhandler_console.cc (fhandler_console::read): Only wait for
806 signal_arrived in the main thread.
807 * fhandler_socket.cc: Include new "wininfo.h".
808 (fhandler_socket::ioctl): Use 'winmsg' rather than 'gethwnd()'.
809 * sync.cc (muto::grab): Define new function.
810 (muto::acquire): Use tls pointer rather than tid.
811 (muto::acquired): Ditto.
812 (muto::reset): Delete.
813 (muto::release): Ditto. Also implement "close on last release".
814 * sync.h (muto::tid): Delete.
815 (muto::tls): New field.
816 (muto::ismine): Delete.
817 (muto::owner): Delete.
818 (muto::unstable): Delete.
819 (muto::reset): Delete.
820 (muto::upforgrabs): New method.
821 (muto::grab): Ditto.
822 (new_muto_name): New define.
823 * wininfo.h: New file.
824 (wininfo): New class.
825 * window.cc: Rework throughout to use winfo class for controlling
826 invisible window operation.
827 (gethwnd): Delete definition.
828 * winsup.h (gethwnd): Delete declaration.
829
71af2ed3
CF
8302004-05-15 Christopher Faylor <cgf@alum.bu.edu>
831
832 * cygheap.h: Remove some parameter names from declarations throughout.
833 (cygheap::set): Reflect changes in declaration for arguments and return
834 value from previous checkin.
835
982c8ecd
CF
8362004-05-15 Pierre Humblet <pierre.humblet@ieee.org>
837
838 * cygheap.h (cwdstuff::set): Modify return value and arguments.
839 * path.cc (chdir): Specify PC_POSIX. Do not call SetCurrentDirectory.
840 Set posix_cwd in a way that does not break find.exe. Change call to
841 cwd.set.
842 (cwdstuff::get_initial): Do not call GetCurrentDirectory here.
843 (cwdstuff::set): Call SetCurrentDirectory and GetCurrentDirectory as
844 needed.
845
8d8bc1e1
CV
8462004-05-12 Corinna Vinschen <corinna@vinschen.de>
847
848 * path.cc (path_conv::check): Don't bail out with error if path is "//".
849
191ea07a
CV
8502004-05-12 Corinna Vinschen <corinna@vinschen.de>
851
852 * cygheap.h (struct init_cygheap): Add mt_h member.
853 * fhandler_tape.cc (mt_h): Drop in favor of cygheap based handle.
854 (mtinfo_init): Use cygheap->mt_h handle. Protect it.
855
982c8ecd 8562004-05-12 Pierre Humblet <pierre.humblet@ieee.org>
8bdfa78a
PH
857
858 * tty.h: Remove the %d or %x from all cygtty strings.
859 (tty::open_output_mutex): Only declare.
860 (tty::open_input_mutex): Ditto.
861 (tty::open_mutex): New definition.
862 * fhandler_tty.cc (fhandler_tty_slave::open): Declare buf with
863 size CYG_MAX_PATH and replace __small_printf calls by shared_name.
864 * tty.cc (tty::create_inuse): Ditto.
865 (tty::get_event): Ditto.
866 (tty::common_init): Ditto.
867 (tty::open_output_mutex): New method definition.
868 (tty::open_input_mutex): Ditto.
869 (tty::open_mutex): New method.
870
191ea07a 8712004-05-11 Corinna Vinschen <corinna@vinschen.de>
0175b531
CV
872
873 * fhandler.cc (fhandler_base::open): Set file attributes to correct
874 value when creating files.
875 * path.h (class path_conv): Add write accessor for file_attributes.
876
75b5f30f
CV
8772004-05-10 Corinna Vinschen <corinna@vinschen.de>
878
879 * fhandler.h (class fhandler_socket): Add "owner" status flag.
880 * fhandler_socket.cc (wait): Take flag parameter to take FD_OOB into
881 account. Don't wait infinitely.
882 (fhandler_socket::recvfrom): Also wait for FD_OOB if socket owner.
883 (fhandler_socket::recvmsg): Ditto.
884 (fhandler_socket::sendto): Ditto.
885 (fhandler_socket::sendmsg): Ditto.
886 (fhandler_socket::fcntl): Set owner status flag if F_SETOWN with own
887 pid is called.
888
94f29ccd
PH
8892004-05-09 Pierre Humblet <pierre.humblet@ieee.org>
890
891 * environ.cc (build_env): Only try to construct required-but-missing
892 variables while issetuid.
893
ac300315 8942004-05-08 Pierre Humblet <pierre.humblet@ieee.org>
71af2ed3 895 Christopher Faylor <cgf@timesys.com>
ac300315
CF
896
897 * syscalls.cc: Include environ.h.
898 (chroot): Set errno in case of path error. Call getwinenv.
899 * environ.cc: Remove the NO_COPY attribute of conv_envvars.
900
f8aae275
CV
9012004-05-07 Corinna Vinschen <corinna@vinschen.de>
902
903 * fhandler_mem.cc (fhandler_dev_mem::fhandler_dev_mem): Move
904 initialization of "mem_size" from here...
905 (fhandler_dev_mem::open): ...to here. Fix typo in FH_PORT case.
906
367ff06e
CV
9072004-05-07 Gerd Spalink <Gerd.Spalink@t-online.de>
908
909 * fhandler_dsp.cc (fhandler_dev_dsp::Audio_out::stop): Move delete of
910 bigwavebuffer_ so that it is always cleaned, also in child processes.
911 (fhandler_dev_dsp::Audio_in::stop): Ditto.
912 (fhandler_dev_dsp::close): Stop audio play immediately in case of
913 abnormal exit.
914
3e101fb2 9152004-05-07 Corinna Vinschen <corinna@vinschen.de>
dab22ff6 916
3e101fb2
CV
917 Revert code reversion from 2004-04-03. So, revert to async I/O again.
918 * fhandler.h (status): Add "closed" flag.
919 (prepare): New method declaration.
920 (wait): Ditto.
921 (release): Ditto.
922 * fhandler_socket.cc: Don't include wsock_event.h.
923 (fhandler_socket::prepare): New method, moved from wsock_event.
924 (fhandler_socket::wait): Ditto.
925 (fhandler_socket::release): New method.
926 (fhandler_socket::recvfrom): Simplify loop.
927 (fhandler_socket::recvmsg): Ditto.
928 (fhandler_socket::sendto): Ditto.
929 (fhandler_socket::sendmsg): Ditto.
930 * net.cc: Don't include wsock_event.h.
931 (wsock_event::prepare): Remove.
932 (wsock_event::wait): Ditto.
933 * wsock_event.h: Remove.
dab22ff6 934
9b0b76ba
CF
9352004-05-06 Christopher Faylor <cgf@alum.bu.edu>
936
937 * thread.cc (pthread::create): Move postcreate call to avoid a
938 potential race.
939 (pthread::cancelable_wait): Don't allow signal interrupt unless main
940 thread.
941
1940656a
CF
9422004-05-07 Pierre Humblet <pierre.humblet@ieee.org>
943 Christopher Faylor <cgf@timesys.com>
944
dab22ff6
CF
945 * path.cc (mount_info::conv_to_posix_path): Return proper status when
946 chrooted.
1940656a 947
14017d53
PH
9482004-05-06 Pierre Humblet <pierre.humblet@ieee.org>
949
950 * path.cc (path_conv::check): Strip trailing dots and spaces and
951 return error if the final component had only dots and spaces.
952 (normalize_posix_path): Revert 2004-04-30.
71af2ed3 953 (chdir): Do not check for trailing spaces. Do not set native_dir
14017d53
PH
954 to c:\ for virtual devices. Pass only native_dir to cwd.set.
955 (cwdstuff::set): Assume posix_cwd is already normalized.
956
6767691f 9572004-05-04 Christopher Faylor <cgf@alum.bu.edu>
5cc2189c
CF
958
959 * path.cc (normalize_win32_path): Detect components with only dots.
960 Remove a final . if it follows '\\'.
961 (mount_info::conv_to_win32_path): Only backslashify the path when no
962 mount is found.
963 (chdir): Do not look for components with only dots.
964
6767691f 9652004-05-04 Pierre Humblet <pierre.humblet@ieee.org>
3dcb399b
CF
966 Christopher Faylor <cgf@alum.bu.edu>
967
968 * path.cc (is_unc_share): Remove redundant tests.
969
423ea473
CV
9702004-05-04 Corinna Vinschen <corinna@vinschen.de>
971
972 * crt0.o (mainCRTStartup): 16 byte align stack for main function.
973
ad7ba32b
CV
9742004-05-04 Corinna Vinschen <corinna@vinschen.de>
975
976 * path.cc (check_sysfile): Don't scan string twice.
977
1e98729b
CV
9782004-05-03 Corinna Vinschen <corinna@vinschen.de>
979
980 * dir.cc (writable_directory): Remove.
981 (mkdir): Remove call to writable_directory.
982 * syscalls.cc (unlink): Ditto.
983 (rename): Ditto.
984 * winsup.h (writable_directory): Remove declaration.
985
43b2d5ba
CV
9862004-04-30 Corinna Vinschen <corinna@vinschen.de>
987
988 * fhandler.cc (fhandler_base::open): Call path_conv::get_nt_native_path
989 for evaluating NT path.
990 * path.cc (normalize_posix_path): Remove trailing dots and spaces.
991 (path_conv::get_nt_native_path): New function.
992 * path.h (class path_conv): Declare get_nt_native_path method.
993
e6b21daf
CV
9942004-04-30 Corinna Vinschen <corinna@vinschen.de>
995
996 * fhandler.cc (fhandler_base::open): Fix NT native path evaluation
997 to allow opening serial ports.
998
72f3756e
CV
9992004-04-30 DJ Delorie <dj@redhat.com>
1000
1001 * init.cc (threadfunc_fe): Hack to make thread stacks always 16
1002 byte aligned.
1003
b7ede86c
CV
10042004-04-21 Yitzchak Scott-Thoennes <sthoenna@efn.org>
1005
1006 * syscalls.cc (lseek64): Fix debug_printf format string.
1007 (truncate64): Ditto.
1008
10092004-04-21 Corinna Vinschen <corinna@vinschen.de>
1010
1011 * fhandler.cc (fhandler_base::lseek): Force res to -1 on error.
1012
9f9231b3
CF
10132004-04-20 Christopher Faylor <cgf@alum.bu.edu>
1014
1015 * path.cc (is_unc_share): Rename from slash_unc_prefix_p throughout.
1016
10172004-04-20 Pierre Humblet <pierre.humblet@ieee.org>
1018
1019 * path.cc (normalize_posix_path): Process all Posix paths and map three
1020 or more initial slashes to a single one. Simplify processing following
1021 two initial slashes.
1022 (normalize_win32_path): Make last argument non-optional and do not
1023 check for NULL value.
1024
c8daf998
CV
10252004-04-20 Pierre Humblet <pierre.humblet@ieee.org>
1026
1027 * fhandler_disk_file.cc (fhandler_base::open_fs): Change
1028 set_file_attribute call to indicate that NT security isn't used.
1029 (fhandler_disk_file::fchmod): Rearrange to isolate 9x related
1030 statements.
1031 Do not set FILE_ATTRIBUTE_SYSTEM.
1032 (fhandler_disk_file::fchown): Check noop case first.
1033 * fhandler.cc (fhandler_base::open9x): Remove ntsec related statements.
1034 (fhandler_base::set_name): Do not set namehash.
1035 * fhandler.h (fhandler_base::get_namehash): Compute and set namehash if
1036 needed.
1037 * syscalls.cc (access): Verify that fh is not NULL. Do not set PC_FULL.
1038 (chmod): Ditto.
1039 (chown_worker): Ditto.
1040 (stat_worker): Ditto. Verify if the path exists.
1041
1b557b43
CV
10422004-04-20 Corinna Vinschen <corinna@vinschen.de>
1043
1044 * fhandler.cc (fhandler_base::open): Remove special DEV_FLOPPY_MAJOR
1045 treatment.
1046 * fhandler_raw.cc (fhandler_dev_raw::open): Simplify write-only case.
1047 * fhandler_tape.cc (fhandler_dev_tape::raw_write): Add accidentally
1048 dropped condition.
1049
fc0ac9df
CV
10502004-04-20 Corinna Vinschen <corinna@vinschen.de>
1051
1052 * fhandler.cc (fhandler_base::open): Add FILE_READ_ATTRIBUTES when
1053 only GENERIC_WRITE access is requested.
1054
f9e8db24
CV
10552004-04-19 Corinna Vinschen <corinna@vinschen.de>
1056
1057 * include/cygwin/mtio.h (GMT_ASYNC): New define.
1058 (MT_ST_ASYNC_WRITES): Remove "Not supported" comment.
1059
0c8731b8
CV
10602004-04-19 Corinna Vinschen <corinna@vinschen.de>
1061
1062 * errno.cc (errmap): Handle ERROR_IO_PENDING.
1063 * fhandler.cc (fhandler_base::open): Make tape I/O asynchronous.
1064 * fhandler.h (class fhandler_dev_tape): Add mt_evt member.
1065 * fhandler_tape.cc (mtinfo_drive::initialize): Initialize async_writes.
1066 (mtinfo_drive::close): Handle async writes.
1067 (mtinfo_drive::read): Add mt_evt parameter. Use overlapped I/O.
1068 (mtinfo_drive::async_wait): New function.
1069 (mtinfo_drive::write): Add mt_evt parameter. Use overlapped I/O.
1070 Handle async writes.
1071 (mtinfo_drive::_set_pos): Handle async writes.
1072 (mtinfo_drive::set_partition): Ditto.
1073 (mtinfo_drive::prepare): Ditto.
1074 (mtinfo_drive::get_status): Drop useless "else". Handle async_writes
1075 flag.
1076 (mtinfo_drive::set_options): Handle async_writes flags.
1077 (fhandler_dev_tape::close): Close mt_evt handle.
1078 (fhandler_dev_tape::raw_read): Create mt_evt handle and use in call
1079 to mtinfo_drive::read.
1080 (fhandler_dev_tape::raw_write): Create mt_evt handle and use in call
1081 to mtinfo_drive::write.
1082 * mtinfo.h (MTINFO_VERSION): Bump.
1083 (enum dirty_state): Add async_write_pending state.
1084 (class mtinfo_drive): Add OVERLAPPED struct "ov". Add async_writes
1085 flag.
1086 (mtinfo_drive::async_wait): Add declaration.
1087 (mtinfo_drive::read): Add mt_evt parameter.
1088 (mtinfo_drive::write): Ditto.
1089
1090 * registry.cc (load_registry_hive): Call enable_restore_privilege
1091 instead of set_process_privilege.
1092
1facc71a
CV
10932004-04-19 Corinna Vinschen <corinna@vinschen.de>
1094
1095 * fhandler_tape.cc (mtinfo_drive::_set_pos): Take additional dont_wait
1096 parameter. Use in call to SetTapePosition.
1cda1322 1097 (mtinfo_drive::set_pos): Accommodate _set_pos calls to above change.
1facc71a
CV
1098 (mtinfo_drive::set_partition): Ditto.
1099 * mtinfo.h (mtinfo_drive::_set_pos): Change declaration accordingly.
1100
e8597065
CV
11012004-04-16 Corinna Vinschen <corinna@vinschen.de>
1102
1103 * autoload.cc (NtCreateFile): Add.
1104 * dir.cc (mkdir): Change set_file_attribute call to indicate that
1105 NT security isn't used.
1106 * fhandler.cc (fhandler_base::open_9x): New method, created from
1107 fhandler_base::open.
1108 (fhandler_base::open): Rearrange to use NtCreateFile instead of
1109 CreateFile.
1110 * fhandler.h (enum query_state): Redefine query_null_access to
1111 query_stat_control. query_null_access isn't allowed in NtCreateFile.
1112 (fhandler_base::open_9x): Declare.
1113 * fhandler_disk_file.cc (fhandler_base::fstat_fs): Use
1114 query_stat_control first, query_read_control if that fails.
1115 (fhandler_disk_file::fchmod): Call enable_restore_privilege before
1116 trying to open for query_write_control. Don't fall back to
1117 opening for query_read_control.
1118 (fhandler_disk_file::fchown): Ditto.
1119 (fhandler_disk_file::facl): Only request restore privilege and query
1120 access necessary for given cmd.
1121 * fhandler_raw.cc (fhandler_dev_raw::open): Call fhandler_base::open
1122 instead of opening device here.
1123 * ntdll.h (NtCreateFile): Declare.
1124 * path.cc (symlink_worker): Change set_file_attribute call to indicate
1125 that NT security isn't used.
1126 * sec_acl.cc (getacl): Fix bracketing.
1127 * sec_helper.cc (enable_restore_privilege): New function.
1128 * security.cc (str2buf2uni_cat): New function.
1129 (write_sd): Don't request restore permission here.
1130 * security.h (set_process_privileges): Drop stale declaration.
1131 (str2buf2uni): Declare.
1132 (str2buf2uni_cat): Declare.
1133 (enable_restore_privilege): Declare.
1134 * syscalls.cc (fchown32): Return immediate success on 9x.
1135
ee0afa42
CF
11362004-04-15 Christopher Faylor <cgf@alum.bu.edu>
1137
1138 * autoload.cc (dll_chain1): Rename to dll_chain. Remove old dll_chain
1139 code.
1140 (wsock_init): Avoid unneeded winsock_active tests.
1141 * winsup.h (winsock_active): Delete.
1142
703b16e3
CV
11432004-04-15 Corinna Vinschen <corinna@vinschen.de>
1144
4be0ce32 1145 * fhandler_disk_file.cc (fhandler_disk_file::fchmod): Try opening
703b16e3
CV
1146 in query_read mode if query_write fails.
1147 * fhandler_disk_file.cc (fhandler_disk_file::fchown): Ditto.
1148 * fhandler_disk_file.cc (fhandler_disk_file::facl): Ditto.
1149
e84c7766
CV
11502004-04-14 Corinna Vinschen <corinna@vinschen.de>
1151
1152 * ntdll.h: Fix copyright date.
ca1b76b8 1153 * sec_acl.cc (acl_worker): Delete allocated fhandler.
e84c7766
CV
1154 * syscalls.cc (chown_worker): Ditto.
1155 (chmod): Ditto.
1156 (stat_worker): Use get_namehash instead of hash_path_name.
1157
a653f600
CV
11582004-04-14 Corinna Vinschen <corinna@vinschen.de>
1159
1160 * sec_acl.cc (getacl): Avoid compiler warning.
1161 * security.cc (write_sd): Ditto. Fix error handling.
1162
0c5f00f9
CV
11632004-04-14 Corinna Vinschen <corinna@vinschen.de>
1164
1165 * syscalls.cc (fstat64): Use get_namehash instead of hash_path_name.
1166
e3d1d515
CV
11672004-04-14 Corinna Vinschen <corinna@vinschen.de>
1168
1169 * fhandler.cc (fhandler_base::open): Simplify access evaluation
1170 expression.
1171 (fhandler_base::facl): New method.
1172 * fhandler.h: Declare facl method in fhandler_base,
1173 fhandler_disk_file and fhandler_virtual.
1174 * fhandler_disk_file.cc (fhandler_disk_file::facl): New method.
1175 * fhandler_virtual.cc (fhandler_virtual::facl): New method.
1176 * sec_acl.cc: Remove forward declaration for aclsort32 and acl32.
1177 (setacl): Remove static. Add and use handle parameter.
1178 (getacl): Ditto.
1179 (acl_worker): Reorganize to call fhandler's facl method eventually.
1180 (facl32): Ditto.
1181 * security.cc (get_nt_object_security): Remove static.
1182 * security.h: Add extern declarations for get_nt_object_security,
1183 aclsort32, acl32, getacl and setacl.
1184
ddf9c4a7
CV
11852004-04-14 Corinna Vinschen <corinna@vinschen.de>
1186
1cda1322 1187 * fhandler.cc (fhandler_base::open): Accommodate query_write_control
ddf9c4a7
CV
1188 query_state.
1189 (fhandler_base::fchown): New method.
1190 * fhandler.h: Declare fchown method in fhandler_base,
1191 fhandler_disk_file and fhandler_virtual.
1192 (enum query_state): Add query_write_control.
1193 * fhandler_disk_file.cc (fhandler_disk_file::fchmod): Set query_state
1194 to query_write_control. Only remove FILE_ATTRIBUTE_READONLY if not
1195 setting security descriptor.
1196 (fhandler_disk_file::fchown): New method.
1197 * fhandler_virtual.cc (fhandler_virtual::fchown): New method.
1198 * sec_acl.cc (setacl): Call write_sd with additional handle attribute.
1199 * security.cc (write_sd): Take handle argument. Only request owner
1200 if getting SE_RESTORE_NAME privilege failed. Only open file if
1201 NtSetSecurityObject failed or handle is NULL.
1202 (set_nt_attribute): Call write_sd with additional handle attribute.
1203 * security.h (write_sd): Declare with additional handle argument.
e3d1d515
CV
1204 * syscalls.cc (chown_worker): Reorganize to call fhandler's fchown
1205 method eventually.
1206 (fchown): Ditto.
ddf9c4a7 1207
f4ae6dc6
CV
12082004-04-14 Corinna Vinschen <corinna@vinschen.de>
1209
1210 * autoload.cc (NtSetSecurityObject): Add.
1211 * fhandler_disk_file.cc (fhandler_disk_file::fchmod): Only request
1212 READ_CONTROL rights when opening the file.
1213 * ntdll.h (NtSetSecurityObject): Add declaration.
1214 * security.cc (write_sd): Call NtSetSecurityObject instead of
1215 BackupWrite.
1216 (get_nt_object_security): Don't free security descriptor here.
1217
12182004-04-14 Corinna Vinschen <corinna@vinschen.de>
1219
1220 * syscalls.cc (ttyname): Use buffer of length TTY_NAME_MAX + 1.
1221 * sysconf.cc (sysconf): Handle _SC_TTY_NAME_MAX request.
1222 * include/limits.h: Define TTY_NAME_MAX and _POSIX_TTY_NAME_MAX.
1223
93d66ddc
CV
12242004-04-14 Corinna Vinschen <corinna@vinschen.de>
1225
1226 * cygwin.din: Export rand_r and ttyname_r.
1227 * syscalls.cc (ttyname_r): New function.
1228 (ttyname): Move functionality to ttyname_r. Call it from here.
1229 * include/cygwin/version.h: Bump API minor number.
1230
b923181e
PH
12312004-04-14 Pierre Humblet <pierre.humblet@ieee.org>
1232
93d66ddc 1233 * path.h (path_conv::set_symlink): Add argument.
4be0ce32 1234 (path_conv::get_symlink_length): New method.
93d66ddc
CV
1235 (path_conv::symlink_length): New member.
1236 * path.cc (path_conv::check): Pass symlen to set_symlink.
1237 * fhandler_disk_file.cc (fhandler_base::fstat_helper): For symlinks
4be0ce32 1238 set st_size from get_symlink_length.
b923181e 1239
29b6b8ca
CV
12402004-04-13 Corinna Vinschen <corinna@vinschen.de>
1241
1242 * security.cc (set_nt_attribute): Only call get_nt_object_security
1243 if handle is NULL.
1244
854c8700
CV
12452004-04-13 Corinna Vinschen <corinna@vinschen.de>
1246
1247 * dir.cc (mkdir): Call set_file_attribute with additional handle
1248 argument.
1249 * fhandler.cc (fhandler_base::fchmod): New method.
1250 * fhandler.h: Declare fchmod method in fhandler_base,
1251 fhandler_disk_file and fhandler_virtual.
1252 * fhandler_disk_file.cc (fhandler_disk_file::fchmod): New method.
1253 (fhandler_base::open_fs): Call set_file_attribute with additional
1254 handle argument.
1255 * fhandler_virtual.cc (fhandler_virtual::fchmod): New method.
1256 * path.cc (symlink_worker): Call set_file_attribute with additional
1257 handle argument.
1258 * security.cc (get_nt_object_security): New function.
1259 (get_nt_object_attribute): Call get_nt_object_security.
1260 (set_nt_attribute): Add handle argument. Call get_nt_object_security
1261 first, read_sd only if that fails.
1262 (set_file_attribute): Add handle argument.
1263 * security.h (set_file_attribute): Declare with additional handle
1264 argument.
1265 * syscalls.cc (stat_suffixes): Move to beginning of file.
1266 (chown_worker): Call set_file_attribute with additional handle argument.
1267 (chmod): Reorganize to call fhandler's fchmod method eventually.
1268 (fchmod): Ditto.
1269
71ffba49
CV
12702004-04-13 Corinna Vinschen <corinna@vinschen.de>
1271
1272 * autoload.cc (NtQuerySecurityObject): Add.
1273 * ntdll.h (STATUS_BUFFER_TOO_SMALL): Add definition.
1274 (NtQuerySecurityObject): Add declaration.
1275 * security.cc (get_nt_object_attribute): Always use
1276 NtQuerySecurityObject to retrieve security descriptor.
1277
37194b25
CV
12782004-04-13 Gerd Spalink <Gerd.Spalink@t-online.de>
1279
1280 * fhandler_dsp.cc (fhandler_dev_dsp::Audio_out::stop): Add optional
1281 boolean argument so that playing can be stopped without playing
1282 pending buffers.
1283 (fhandler_dev_dsp::ioctl): Stop playback immediately for
1284 SNDCTL_DSP_RESET. Do not reset audio parameters in this case.
1285 Add support for ioctl SNDCTL_DSP_GETISPACE.
1286 (fhandler_dev_dsp::Audio_out::emptyblocks): Now returns the number of
1287 completely empty blocks.
1288 (fhandler_dev_dsp::Audio_out::buf_info): p->fragments is now the number
1289 of completely empty blocks. This conforms with the OSS specification.
1290 (fhandler_dev_dsp::Audio_out::parsewav): Ignore wave headers that are
1291 not aligned on four byte boundary.
1292 (fhandler_dev_dsp::Audio_in::buf_info): New, needed for
1293 SNDCTL_DSP_GETISPACE.
1294
825b3882
CV
12952004-04-13 Corinna Vinschen <corinna@vinschen.de>
1296
1297 * winsup.h (IMPLEMENT_STATUS_FLAG): New macro to define status flag
1298 accessor methods unambiguously.
1299 * fhandler.h: Use IMPLEMENT_STATUS_FLAG throughout where possible.
1300 * fhandler_termios.cc (fhandler_termios::tcinit): Call corrected
1301 accessor for initialized status flag.
1302 * mtinfo.h (class mtinfo_drive): Use IMPLEMENT_STATUS_FLAG throughout.
1303 * path.cc (fs_info::update): Remove duplicate call to flags().
1304 * path.h (struct fs_info): Use IMPLEMENT_STATUS_FLAG where possible.
1305 (path_conv::is_auto_device): Fix spacing.
1306 * tty.h (class tty_min): Use IMPLEMENT_STATUS_FLAG throughout.
1307
d84a4e2e
CF
13082004-04-12 Christopher Faylor <cgf@alum.bu.edu>
1309
1310 * thread.cc (pthread::thread_init_wrapper): Wait later to get more
1311 parallel behavior.
1312
3e78b5d7
CF
13132004-04-12 Christopher Faylor <cgf@alum.bu.edu>
1314
1315 * thread.cc (pthread::create): Use thread mutex to control
1316 synchronization rather than creating a suspended thread. Wait for
1317 "cancellation event" to indicate that started thread has been properly
1318 initialized.
1319 (pthread::thread_init_wrapper): Use set_tls_self_pointer() to set tid
1320 and cygtls. Signal with cancel_event when done.
1321
b96dbd20
PH
13222004-04-12 Pierre Humblet <pierre.humblet@ieee.org>
1323
3e78b5d7 1324 * path.cc (path_conv::check): Fix "tail filling" logic.
b96dbd20 1325
1ed8d187
CF
13262004-04-11 Christopher Faylor <cgf@alum.bu.edu>
1327
1328 * cygheap.h: Replace inexplicably removed closing brace.
1329
0cb38eb5
CF
13302004-04-11 Christopher Faylor <cgf@alum.bu.edu>
1331
1332 * cygheap.h (CYGHEAP_SLOP): Reduce drastically to avoid collisions.
1333
3301015b
CF
13342004-04-11 Pierre Humblet <pierre.humblet@ieee.org>
1335
1336 * dtable.cc (dtable::extend): Change order of memcpy and cfree.
1337
66d9ac39
CV
13382004-04-10 Corinna Vinschen <corinna@vinschen.de>
1339
1340 * syscalls.cc (sync): Define void according to SUSv3.
1341
bb090650
CV
13422004-04-10 Corinna Vinschen <corinna@vinschen.de>
1343
1344 * sec_acl.cc (setacl): Use correct offset when trying to combine
1345 standard and default entry of same type.
1346
7224437c
CV
13472004-04-10 Pierre Humblet <pierre.humblet@ieee.org>
1348
1349 * fhandler.cc (rootdir): Add and use second argument.
1350 * winsup.h (rootdir): Add second argument in declaration.
1351 * path.cc (fs_info::update): Modify call to rootdir.
1352 * syscalls.cc (check_posix_perm): Ditto.
1353 (statfs): Ditto. Move syscall_printf near top.
1354
56551a9b
CV
13552004-04-10 Corinna Vinschen <corinna@vinschen.de>
1356
1357 * Use new unified status_flag accessor methods from classes fhandler_*,
1358 tty_min, mtinfo and fs_info thoroughout.
1359 * fhandler.h: Redefine all set_close_on_exec methods to take a bool
1360 argument.
1361 (enum conn_state): Rename from connect_state.
1362 (class fhandler_base): Rename some status flags to align with
1363 accessor method names. Drop encoded flag entirely. Unify status
1364 accessor methods. Const'ify all read accessor methods.
1365 (class fhandler_socket): Ditto.
1366 (class fhandler_dev_raw): Ditto.
1367 * fhandler_disk_file.cc (fhandler_base::fstat_fs): Use fs.fs_is_fat()
1368 instead of evaluating FATness of file system here.
1369 (fhandler_disk_file::opendir): Drop call to set_encoded().
1370 (fhandler_disk_file::readdir): Use pc.isencoded() directly.
1371 * mtinfo.h (class mtinfo_drive): Const'ify all read accessor methods.
1372 * path.cc (fsinfo_cnt): Add.
1cda1322 1373 (fs_info::update): Accommodate class changes. Evaluate file system
56551a9b
CV
1374 name specific flags right here. Add thread safety for reading and
1375 writing global fsinfo array.
1376 * path.h (enum path_types): Drop values for flags kept in fs already.
1377 (struct fs_info): Move status informatin into private struct type
1378 status_flags. Add accessor methods. Remove path and file system
1379 name string arrays in favor of status bits.
1380 (class path_conv): Use new fs_info status information where
1381 appropriate.
1382 (path_conf::fs_has_ea): Rename from fs_fast_ea.
1383 (path_conf::fs_has_acls): New method.
1384 (path_conf::root_dir): Remove.
1385 (path_conf::volname): Remove.
1386 * syscalls (statfs): Evaluate root dir locally.
1387 * tty.h (class tty_min): Unify status accessor methods. Const'ify
1388 all read accessor methods.
1389
56a188d1
CF
13902004-04-09 Thomas Pfaff <tpfaff@gmx.net>
1391
1392 * thread.h (pthread::init_mainthread): Remove parameter forked.
1393 (pthread::set_tls_self_pointer): New static function.
1394 * thread.cc (MTinterface::fixup_after_fork): Change call to
1395 pthread::init_mainthread.
1396 (pthread::init_mainthread): Remove parameter forked. Simplify thread
1397 self pointer handling.
1398 (pthread::self): Set thread self pointer to null_pthread if thread has
1399 not been initialized.
1400 (pthread::set_tls_self_pointer): New static function.
1401
60210cc7
CF
14022004-04-05 Pierre Humblet <pierre.humblet@ieee.org>
1403
1404 * path.cc (path_conv::check): Optimize symlink replacements.
1405
14062004-04-09 Pierre Humblet <pierre.humblet@ieee.org>
1407
1408 * path.cc (normalize_posix_path): Add "tail" argument and set it.
1409 Always have a final slash for directories. Pass 3rd argument to
1410 normalize_win32_path.
1411 (path_conv::check): Pass tail to normalize_posix_path. Set
1412 need_directory and remove final slash after that call. Remove last
1413 argument to mount_table->conv_to_win32_path(). Remove noop dostail
1414 check. Remove fs.update() from inner loop. Improve tail finding
1415 search.
1416 (normalize_win32_path): Add and set tail argument.
1417 (mount_item::build_win32): Avoid calling strcpy.
1418 (mount_info::conv_to_win32_path): Remove third argument and simplify
1419 because the source is normalized. Keep /proc path in Posix form. Call
1420 win32_device_name() only once.
1421 (mount_info::conv_to_posix_path): Add and use 3rd argument to
1422 normalize_win32_path to avoid calling strlen.
1423 (cwdstuff::set): Add 3rd argument to normalize_posix_path and remove
1424 final slash if any.
1425 * shared_info.h (mount_info::conv_to_win32_path): Remove last argument
1426 in declaration.
1427
ff084343
CV
14282004-04-09 Corinna Vinschen <corinna@vinschen.de>
1429
1430 * fhandler.h (class fhandler_dev_raw): Move status bits into protected
1431 bitfield struct type status_flags. Drop unused has_written bit.
1432 Add accessor methods.
1433 (fhandler_dev_raw::clear): Remove.
1434 (fhandler_dev_raw::reset_devbuf): Remove.
1435 * fhandler_floppy.cc (fhandler_dev_floppy::lseek): Use accessor method
1436 for is_writing.
1437 * fhandler_raw.cc: Use status accessor methods throughout.
1438 (fhandler_dev_raw::clear): Remove.
1439 (fhandler_dev_raw::fhandler_dev_raw): Drop clear call.
1440 (fhandler_dev_raw::~fhandler_dev_raw): Ditto.
1441 * fhandler_tape.cc: Use mtinfo::status accessor methods throughout.
1442 (mtinfo_drive::close): Fix conditional to enable BSD semantics
1443 correctly.
1444 (mtinfo_drive::get_status): Rename from mtinfo_drive::status.
1445 * mtinfo.h (class mtinfo_drive): Move status bits into private bitfield
1446 struct type status_flags. Add accessor methods.
1447 Rename status method to get_status.
1448
535309a6
CV
14492004-04-09 Corinna Vinschen <corinna@vinschen.de>
1450
1451 * path.cc (fsinfo): Global storage for file system information.
1452 (fs_info::update): Store file system information also in fsinfo and
1453 short circuit GetVolumeInformation by using alredy stored file system
1454 information.
1455
7aa88267
CV
14562004-04-09 Corinna Vinschen <corinna@vinschen.de>
1457
1458 * fhandler.h (fhandler_base::status): Declare private.
1459 (fhandler_base::open_status): Ditto.
1460 (class fhandler_socket): Move status bits into private bitfield struct
1461 type status_flags. Change accessor methods appropriately.
1cda1322 1462 * fhandler_socket.cc (fhandler_socket::fhandler_socket): Accommodate
7aa88267
CV
1463 above status bit changes.
1464 * tty.h: Remove status bit enumerator.
1465 (TTYISSETF): Remove.
1466 (TTYSETF): Remove.
1467 (TTYCLEARF): Remove.
1468 (TTYCONDSETF): Remove.
1469 (tty_min::status): Define as private bitfield struct type status_flags.
1470 Add appropriate accessor methods.
1471 * fhandler_console.cc: Use tty_min::status accessor methods throughout.
1472 * fhandler_termios.cc: Ditto.
1473 * winsup.h (__ISSETF): Remove.
1474 (__SETF): Remove.
1475 (__CLEARF): Remove.
1476 (__CONDSETF): Remove.
1477
b79f85c2
CV
14782004-04-09 Corinna Vinschen <corinna@vinschen.de>
1479
1480 * fhandler.cc (fhandler_base::write): Use bool parameter in calls to
1481 set_did_lseek.
1cda1322 1482 (fhandler_base::fhandler_base): Accommodate new status and open_status
b79f85c2
CV
1483 constructor.
1484 * fhandler.h: Remove status bit enumerator.
1485 (FHDEVN): Remove.
1486 (FHISSETF): Remove.
1487 (FHSETF): Remove.
1488 (FHCLEARF): Remove.
1489 (FHCONDSETF): Remove.
1490 (FHSTATOFF): Remove.
1491 (UNCONNECTED, CONNECT_PENDING, CONNECTED): Substitute by enum
1492 connect_state.
3e78b5d7 1493 (fhandler_base::status): Define as bitfield struct type status_flags.
1cda1322 1494 Remove unused flags entirely. Accommodate all status access methods.
b79f85c2
CV
1495 (open_status): Define as bitfield struct type status_flags.
1496 (fhandler_socket): Move socket related status bits to here. Redefine
1cda1322 1497 had_connect_or_listen to be part of these status bits. Accommodate
b79f85c2
CV
1498 related access methods.
1499 * fhandler_disk_file.cc (fhandler_base::fstat_helper): Use pc.issymlink
3e78b5d7 1500 instead of dropped method get_symlink_p.
b79f85c2
CV
1501 (fhandler_base::open_fs): Remove setting dropped status flags.
1502 * fhandler_socket.cc: Use values from enum connect_state throughout.
1503 (fhandler_socket::fhandler_socket): Initialize status bits.
1504 * fhandler_virtual.cc (fhandler_virtual::open): Remove setting dropped
1505 status flags.
1506 * net.cc: Use values from enum connect_state throughout.
1507 * select.cc: Ditto.
1508 * shared_info.h: Protect struct console_state using _FHANDLER_H_
1509 instead of FHDEVN.
1510
00dd058f
CV
15112004-04-09 Corinna Vinschen <corinna@vinschen.de>
1512
1513 * security.cc (get_file_attribute): Fix conditional.
1514
6ea87bc1
CF
15152004-04-08 Christopher Faylor <cgf@bosbc.com>
1516
1517 * child_info.h: Update CHILD_INFO_MAGIC after 2004-04-03 change.
1518
6eee18ea
CV
15192004-04-08 Corinna Vinschen <corinna@vinschen.de>
1520
1521 * path.cc (hash_path_name): Replace hash algorithm with SDBM.
1522
15232004-04-08 Corinna Vinschen <corinna@vinschen.de>
a9a5b2ea
CV
1524
1525 * fhandler.cc (fhandler_base::open): Set query access mode according
1526 to query_open setting.
1527 (fhandler_base::fhandler_base): Initialize query_open.
1528 * fhandler.h (FH_QUERYOPEN): Drop.
1529 (enum query_state): Add.
1530 (class fhandler_base): Add query_open member.
1531 (fhandler_base::get_query_open): Redefine to use query_open.
1532 (fhandler_base::set_query_open): Ditto.
1533 * fhandler_disk_file.cc (fhandler_base::fstat_fs): Remove O_DIROPEN
1534 from open_flags since it's added in open_fs anyway. Remove
1535 query_open_already. Use new query_open settings. Rearrange slightly.
1536 (fhandler_base::fstat_helper): Add get_io_handle as parameter to
1537 get_file_attribute.
1538 * security.cc (get_nt_object_attribute): Make returning an int.
1539 Return -1 on error, 0 otherwise.
1540 (get_file_attribute): Take an object handle as argument. Move down
1541 to allow calling get_nt_object_attribute in case a non-NULL handle
1542 is given.
1543 * security.h (get_file_attribute): Add handle to argument list.
1cda1322 1544 * syscalls.cc (chown_worker): Accommodate new definition of
a9a5b2ea
CV
1545 get_file_attribute.
1546
284a55c3
CF
15472004-04-07 Pierre Humblet <pierre.humblet@ieee.org>
1548
1549 * path.cc (path_prefix_p): Optimize test order.
1550
49294f00
CV
15512004-04-06 Corinna Vinschen <corinna@vinschen.de>
1552
1553 * Makefile.in (EXTRALIBS): Add libtextreadmode.a.
1554 (INSTOBJS): Add textreadmode.o.
1555 * textreadmode.c: New file.
1556
15572004-04-06 Corinna Vinschen <corinna@vinschen.de>
b8eac1de
CV
1558
1559 * fhandler_disk_file.cc (fhandler_base::fstat_helper): Request
1560 compressed size only if the matching attributes are set. Use
1561 NtQueryInformationFile instead of GetCompressedFileSize.
1562 (fhandler_base::fstat_by_handle): Remove NT 3.5 cruft since
1563 local.dwVolumeSerialNumber isn't used subsequently.
1564 * ntdll.h: Add typedefs for FILE_COMPRESSION_INFORMATION and
1565 FILE_INFORMATION_CLASS.
1566
49294f00 15672004-04-06 Corinna Vinschen <corinna@vinschen.de>
cffd8968
CV
1568
1569 * fhandler_raw.cc (fhandler_dev_raw::open): Actually use "options".
1570
7e57d6d2
CV
15712004-04-04 Gerd Spalink <Gerd.Spalink@t-online.de>
1572
1573 * fhandler_dsp.cc (fhandler_dev_dsp::ioctl): Add implementation
1574 for ioctl codes SNDCTL_DSP_CHANNELS and SNDCTL_DSP_GETCAPS.
1575
1b957b1c 15762004-04-03 Christopher Faylor <cgf@bosbc.com>
129c8a0e 1577
7e57d6d2
CV
1578 * child_info.h (child_info::cygheap_reserve_sz): Rename from
1579 cygheap_alloc_sz.
129c8a0e
CF
1580 * cygheap.cc: Rename alloc_sz to reserve_sz throughout.
1581
321ddf24
CV
15822004-04-03 Corinna Vinschen <corinna@vinschen.de>
1583
1584 * fhandler.h (class fhandler_socket): Remove has_been_closed member.
1585 * fhandler_socket.cc (fhandler_socket::recvfrom): Revert to
1586 overlapped I/O.
1587 (fhandler_socket::recvmsg): Ditto.
1588 (fhandler_socket::sendto): Ditto.
1589 (fhandler_socket::sendmsg): Ditto.
1590 * net.cc (wsock_event::prepare): Ditto.
1591 (wsock_event::wait): Ditto. Evaluate overlapped result also after
1592 calling CancelIo (thanks to Patrick Samson <p_samson@yahoo.com>).
1593 (wsock_event::release): Remove.
1594 * wsock_event.h: Revert to overlapped I/O.
1595
f5da8224
CV
15962004-04-02 Corinna Vinschen <corinna@vinschen.de>
1597
1598 * net.cc (wsock_event::release): Use NULL handle in call to
1599 WSAEventSelect to resolve KB 168349.
1600
b6edea61
CV
16012004-04-01 Corinna Vinschen <corinna@vinschen.de>
1602
1603 * fhandler_socket.cc (fhandler_socket::recvfrom): Rearrange loop
1604 so that WSARecvFrom is always called before waiting.
1605 (fhandler_socket::recvmsg): Ditto.
1606
4cfacffa
CV
16072004-04-01 Corinna Vinschen <corinna@vinschen.de>
1608
1609 * net.cc (wsock_event::wait): Make wsa_err an int. Don't set
1610 ret to 0 if any error has happened.
1611
54aefcc6
CV
16122004-04-01 Corinna Vinschen <corinna@vinschen.de>
1613
1614 * fhandler_socket.cc (fhandler_socket::sendto): Drop out of loop if
1615 has_been_closed gets set.
1616 (fhandler_socket::sendmsg): Ditto.
1617 * net.cc (wsock_event::wait): Don't initialize evts. Don't try to
1618 evaluate network events if WSAEnumNetworkEvents fails.
1619 (wsock_event::release): Save last WSA error and set it again unless
1620 resetting to blocking socket fails.
1621 * wsock_event.h (class wsock_event): Remove destructor.
1622
fbba4780
CV
16232004-03-31 Corinna Vinschen <corinna@vinschen.de>
1624
1625 * fhandler_tape.cc (mtinfo::initialize): Fix fatal error message.
1626
455bbeae
CV
16272004-03-31 Corinna Vinschen <corinna@vinschen.de>
1628
1629 * fhandler_socket.cc (fhandler_socket::recvfrom): Always initialize
1630 ret to 0 when using in Winsock call.
1631 (fhandler_socket::recvmsg): Ditto.
1632 (fhandler_socket::sendto): Ditto.
1633 (fhandler_socket::sendmsg): Ditto.
1634
decd3e5d
CV
16352004-03-31 Corinna Vinschen <corinna@vinschen.de>
1636
1637 * fhandler_tape.cc (mtinfo_drive::get_pos): Only set partition if
1638 GetTapePosition returned a non-zero partition number.
1639 (mtinfo_drive::create_partitions): Reinitialize to partition 0.
1640 Support TAPE_DRIVE_INITIATOR and TAPE_DRIVE_FIXED partitioning.
1641 (mtinfo_drive::set_partition): Initialize new partition.
1642 (mtinfo_drive::status): Readd accidentally dropped setting of mt_resid.
1643
1644 * net.cc (wsock_event::prepare): Always print debug output in case
1645 of error.
1646
93ba1204
CV
16472004-03-31 Corinna Vinschen <corinna@vinschen.de>
1648
1649 * fhandler_socket.cc (fhandler_socket::sendmsg): Add SIGPIPE handling.
1650
4450172a
CV
16512004-03-31 Corinna Vinschen <corinna@vinschen.de>
1652
1653 * fhandler_socket.cc (fhandler_socket::recvfrom): Initialize res to
1654 SOCKET_ERROR. Use SOCKET_ERROR instead of -1 throughout.
1655 (fhandler_socket::recvmsg): Ditto.
1656 (fhandler_socket::sendto): Ditto.
1657 (fhandler_socket::sendmsg): Ditto.
1658 * net.cc (wsock_event::prepare): Call WSASetLastError instead of
1659 SetLastError.
1660 (wsock_event::wait): Use SOCKET_ERROR instead of -1.
1661
c83bdbf6
CF
16622004-03-30 Thomas Pfaff <tpfaff@gmx.net>
1663
1664 * thread.h (pthread::init_mainthread): Add parameter forked. Set
1665 forked default to false..
1666 * thread.cc (MTinterface::fixup_after_fork): Call
1667 pthread::init_mainthread with forked = true.
1668 (pthread::init_mainthread): Add parameter forked. Do not change thread
1669 self pointer when forked.
1670
5c7b73ed
CV
16712004-03-30 Corinna Vinschen <corinna@vinschen.de>
1672
1673 * shm.cc (shmat): If shmid is unknown, call a special variation
1674 of shmget to retrieve the shared memory segment from Cygserver
1675 instead of failing immediately.
3e78b5d7 1676 * include/cygwin/ipc.h (IPC_KEY_IS_SHMID): New internal flag for
5c7b73ed
CV
1677 shmget when called from shmat.
1678
81f5200b
CV
16792004-03-29 Corinna Vinschen <corinna@vinschen.de>
1680
1681 * fhandler.h (class fhandler_socket): Add has_been_closed member.
1682 * fhandler_socket.cc (fhandler_socket::fhandler_socket): Initialize
1683 has_been_closed to 0.
1684 (fhandler_socket::recvfrom): Use new asynchronous I/O driven
1685 wsock_event methods.
1686 (fhandler_socket::recvmsg): Ditto.
1687 (fhandler_socket::sendto): Ditto.
1688 (fhandler_socket::sendmsg): Ditto.
1689 * net.cc (wsock_event::prepare): Reimplement using asynchronous I/O.
1690 (wsock_event::wait): Ditto.
1691 (wsock_event::release): New method.
1cda1322 1692 * wsock_event.h (class wsock_event): Remove ovr member. Accommodate
81f5200b
CV
1693 new implementation of prepare and wait methods. Add release method.
1694
c7f060d0
CF
16952004-03-29 Thomas Pfaff <tpfaff@gmx.net>
1696
1697 * thread.cc (pthread::atforkprepare): Call
1698 MT_INTERFACE->fixup_before_fork at the end of atforkprepare.
1699
2b2cc75f
CV
17002004-03-29 Corinna Vinschen <corinna@vinschen.de>
1701
1702 * net.cc (wsock_event::wait): Change scope of local "len" variable.
1703
83216c72
CV
17042004-03-28 Corinna Vinschen <corinna@vinschen.de>
1705
1706 * shm.cc (shmat): Return (void *) -1 on error instead of NULL.
1707
f19da5f7
CF
17082004-03-27 Christopher Faylor <cgf@redhat.com>
1709
1710 * fhandler_nodevice.cc (fhandler_nodevice::open): Assume that errno has
1711 already been set if pc.error is nonzero.
1712
58ea4db2
CF
17132004-03-26 Christopher Faylor <cgf@redhat.com>
1714
1715 * cygheap.cc (cygheap_fixup_in_child): Improve strace output.
1716
dee56309
CV
17172004-03-26 Corinna Vinschen <corinna@vinschen.de>
1718
1719 * errno.cc (errmap): Map ERROR_SHARING_VIOLATION to EBUSY,
1720 ERROR_EOM_OVERFLOW and ERROR_NO_DATA_DETECTED to EIO. Add mappings
1721 for ERROR_NO_MEDIA_IN_DRIVE, ERROR_DEVICE_REQUIRES_CLEANING and
1722 ERROR_DEVICE_DOOR_OPEN.
1723 * fhandler.h (class fhandler_dev_raw): Drop varblkop member.
1724 (fhandler_dev_raw::is_eom): De-virtualize.
1725 (fhandler_dev_raw::is_eof): Ditto.
1726 (class fhandler_dev_tape): Drop lasterr and dp member. Add mt_mtx
1727 member. Drop all private methods formerly used by ioctl.
1728 (fhandler_dev_tape::is_rewind_device): Use get_minor for clarity.
1729 (fhandler_dev_tape::driveno): New method.
1730 (fhandler_dev_tape::drive_init): New method.
1731 (fhandler_dev_tape::clear): Remove method.
1732 (fhandler_dev_tape::is_eom): Ditto.
1733 (fhandler_dev_tape::is_eof): Ditto.
1734 (fhandler_dev_tape::write_file): Ditto.
1735 (fhandler_dev_tape::read_file): Ditto.
1736 (fhandler_dev_tape::_lock): New method.
1737 (fhandler_dev_tape::unlock): New method.
1738 (fhandler_dev_tape::raw_read): New method.
1739 (fhandler_dev_tape::raw_write): New method.
1740 * fhandler_raw.cc (fhandler_dev_raw::is_eom): New method.
1741 (fhandler_dev_raw::is_eof): New method.
1742 (fhandler_dev_raw::open): Allow setting write through option by
1743 using the O_TEXT flag as ... flag.
1744 (fhandler_dev_raw::writebuf): Remove usage of varblkop and other
1745 tape specific code.
1746 (fhandler_dev_raw::raw_read): Ditto.
1747 (fhandler_dev_raw::dup): Ditto.
1748 * fhandler_tape.cc: Rewrite tape operations entirely. Implement
1749 new tape driver classes mtinfo, mtinfo_drive and mtinfo_part.
1750 Reduce fhandler_dev_tape methods to mostly just calling appropriate
1751 mtinfo_drive methods.
1752 (mtinfo_init): New function adding the mtinfo shared memory area.
1753 * mtinfo.h: New file, containing the definition of the new tape
1754 driver classes.
1755 * shared.cc: Include mtinfo.h.
1756 (offsets): Add entry for mtinfo shared memory area.
1757 (memory_init): Call mtinfo_init.
1758 * shared_info.h (shared_locations): Add SH_MTINFO shared location.
1759 * include/cygwin/mtio.h: Change and add various comments. Add GMT_xxx
1760 macros for new generic flags. Add MT_ST_xxx bitfield definitions
1761 for MTSETDRVBUFFER ioctl.
1762 * include/cygwin/version.h: Bump API minor version number.
1763
11a9a1cf
CF
17642004-03-26 Christopher Faylor <cgf@redhat.com>
1765
1766 * path.cc (path_conv::check): Use 'strchr' rather than 'strrchr' to
1767 find end of string, for efficiency.
1768
17692004-03-26 Thomas Pfaff <tpfaff@gmx.net>
1770
1771 * include/cygwin/_types.h: New file.
1772 * include/sys/lock.h: Ditto.
1773 * include/sys/stdio.h: Ditto.
1774 * thread.cc: Include sys/lock.h
1775 (__cygwin_lock_init): New function.
1776 (__cygwin_lock_init_recursive): Ditto.
1777 (__cygwin_lock_fini): Ditto.
1778 (__cygwin_lock_lock): Ditto.
1779 (__cygwin_lock_trylock): Ditto.
1780 (__cygwin_lock_unlock): Ditto.
1781 (pthread::atforkprepare): Lock file pointer before fork.
1782 (pthread::atforkparent): Unlock file pointer after fork.
1783 (pthread::atforkchild): Ditto.
1784
6b0d86c5
CV
17852004-03-26 Corinna Vinschen <corinna@vinschen.de>
1786
1787 * sem.cc (semget): Fix debug string.
1788 (semop): Ditto.
1789 * shm.cc (fixup_shms_after_fork): Ditto.
1790 (shmat): Ditto.
1791 (shmdt): Ditto.
1792 (shmget): Ditto.
1793
85427a94
CF
17942004-03-26 Christopher Faylor <cgf@redhat.com>
1795
1796 * sigproc.cc (wait_sig): Make sure that SIGCHLD is handled regardless
1797 of whether a signal is queued.
1798
27ec638b
CF
17992004-03-26 Christopher Faylor <cgf@redhat.com>
1800
1801 * sigproc.cc (wait_sig): Report if not trying to send signal due to
1802 queued signal.
1803
474048c2
CF
18042004-03-25 Christopher Faylor <cgf@redhat.com>
1805
1806 * path.cc (normalize_posix_path): Reorganize to short circuit to DOS
1807 path handling whenever a '\' is detected.
1808
1809 * signal.cc (sigaction): Make strace output more informative.
1810 * sigproc.cc (pending_signals::add): Just index directly into signal
1811 array rather than treating the array as a heap.
1812 (pending_signals::del): Ditto.
1813 (wait_sig): Don't send signal if we already have a similar signal
1814 queued.
1815 * sigproc.h (call_signal_handler_now): Remove obsolete declaration.
1816
a65cfe3c
CV
18172004-03-23 Gerd Spalink <Gerd.Spalink@t-online.de>
1818
1819 * fhandler_dsp.cc (fhandler_dev_dsp::write): Remove type
1820 cast from argument to audio_out_->parsewav() to make reference
1821 work properly. Now .wav file headers are properly discarded.
1822
88506c67
CV
18232004-03-23 Corinna Vinschen <corinna@vinschen.de>
1824
1825 * fhandler_disk_file.cc (fhandler_base::fstat_fs): Use created
1826 handle regardless of nohandle state. Clean up afterwards.
1827
6653af6c
CV
18282004-03-23 Gerd Spalink <Gerd.Spalink@t-online.de>
1829
1830 * autoload.cc: Load eight more functions for waveIn support.
1831 * fhandler.h (class fhandler_dev_dsp): Add class Audio, class Audio_in
1832 and class Audio_out members and audio_in_, audio_out_ pointers so
3e78b5d7 1833 that future changes are restricted to file fhandler_dsp.cc.
6653af6c
CV
1834 * fhandler_dsp.cc (fhandler_dev_dsp::Audio): Add this class to treat
1835 things common to audio recording and playback.
1836 Add more format conversions.
1837 (fhandler_dev_dsp::Audio::queue): New queues for buffer management
1838 to fix incomplete cleanup of buffers passed to the wave device.
1839 (fhandler_dev_dsp::Audio_in): New, added class to implement audio
1840 recording.
1841 (fhandler_dev_dsp::Audio_out): Rework to use functionality provided
1842 by fhandler_dev_dsp::Audio. Allocate memory audio buffers late,
1843 just before write.
1844 (fhandler_dev_dsp::Audio_out::start): Size of wave buffer allocated
1845 here depends on audio rate/bits/channels.
1846 (fhandler_dev_dsp::Audio_in::start): Ditto.
1847 (fhandler_dev_dsp::setupwav): Replaced by following function.
1848 (fhandler_dev_dsp::Audio_out::parsewav): Does not setup wave device
1849 any more. Discard wave header properly.
1850 (fhandler_dev_dsp::open): Add O_RDONLY and_RDWR as legal modes.
1851 Protect against re-open. Activate fork_fixup.
1852 (fhandler_dev_dsp::ioctl): Protect against actions when audio is
1853 active. SNDCTL_DSP_GETFMTS only returns formats supported by
1854 mmsystem wave API, not all supported formats. SNDCTL_DSP_GETBLKSIZE
1855 result now depends on current audio format.
1856 (fhandler_dev_dsp::fixup_after_fork): Call fork_fixup for the Audio
1857 classes to let them duplicate the CRITICAL_SECTION.
1858
6b89a541
CF
18592004-03-19 Pierre Humblet <pierre.humblet@ieee.org>
1860 Christopher Faylor <cgf@redhat.com>
1861
1862 * init.cc (munge_threadfunc): Handle all instances of search_for.
1863 (prime_threads): Test threadfunc_ix[0].
1864
c7c7492a
CF
18652004-03-21 Christopher Faylor <cgf@redhat.com>
1866
1867 * cygheap.cc (init_cheap): Set initial_sz to something or suffer
1868 spurious output.
1869 (cygheap_fixup_in_child): Set alloc_sz to passed in size to ensure that
1870 children will have the right size heap.
1871 (_csbrk): Make output conditional on DEBUGGING.
1872
e362f67f
CF
18732004-03-21 Christopher Faylor <cgf@redhat.com>
1874
1875 * cygheap.cc (init_cheap): Conditionalize debugging code.
1876
c795774c
CF
18772004-03-21 Christopher Faylor <cgf@redhat.com>
1878
1879 * cygheap.cc (init_cheap): Add ability to specify minimal cygwin heap
1880 size when debugging.
1881 (_csbrk): Report error in allocation to stderr.
1882 (ccalloc): Ditto.
1883 * dtable.cc (dtable::find_fifo): Remove use of atoms.
1884 * dtable.h (dtable::find_fifo): Ditto.
1885 * fhandler.h (fhandler_fifo): Ditto.
1886 * fhandler_fifo.cc (fhandler_fifo::fhandler_fifo): Ditto.
1887 (fhandler_fifo::set_use): Ditto.
1888 (fhandler_fifo::open_not_mine): Ditto.
1889 (fhandler_fifo::open): Ditto.
1890 * pinfo.cc (_pinfo::commune_recv): Ditto.
1891 (_pinfo::commune_send): Ditto.
1892
83f96e3f
PH
18932004-03-19 Pierre Humblet <pierre.humblet@ieee.org>
1894
3e78b5d7
CF
1895 * dir.cc (rmdir): Reorganize error handling to reduce indentation.
1896
61f50f94
CF
18972004-03-19 Christopher Faylor <cgf@redhat.com>
1898
1899 * include/cygwin/version.h: Bump DLL minor number to 10.
1900
d8f87fba
CF
19012004-03-18 Christopher Faylor <cgf@redhat.com>
1902
1903 * child_info.h (CURR_CHILD_INFO_MAGIC): Reset to new value.
1904 (child_info::cygheap_alloc_sz): New field.
1905 * cygheap.cc (init_cheap): Reduce size of cygwin stack until minimal
1906 hit when attempting initial allocation.
1907 (cygheap_setup_for_child): Use alloc_sz to create secondary memory
1908 mapped entry. Store alloc_sz in cygheap_alloc_sz.
1909 (cygheap_fixup_in_child): Use cygheap_alloc_sz to map parent's cygheap.
1910 * cygheap.h (_CYGHEAPSIZE_SLOP): New define.
1911 (CYGHEAPSIZE): Use _CYGHEAPSIZE_SLOP.
1912
891d1990
CV
19132004-03-18 Corinna Vinschen <corinna@vinschen.de>
1914
1915 * fhandler_proc.cc (format_proc_meminfo): On NT, try to figure out
1916 real swap file usage by requesting SystemPagefileInformation. Use
1917 GlobalMemoryStatus as fallback.
1918 * ntdll.h (_SYSTEM_INFORMATION_CLASS): Add SystemPagefileInformation.
1919 (struct _SYSTEM_PAGEFILE_INFORMATION): Define.
1920
12d545fb
CF
19212004-03-17 Christopher Faylor <cgf@redhat.com>
1922
1923 * pipe.cc (fhandler_pipe::dup): Fix debugging message.
1924
7faaacbb
CF
19252004-03-17 Christopher Faylor <cgf@redhat.com>
1926
1927 * include/cygwin/version.h: Bump DLL minor number to 9.
1928
fbdfd5f8
CF
19292004-03-16 Christopher Faylor <cgf@redhat.com>
1930
1931 * sigproc.cc (proc_terminate): Release sync_proc_subproc when done
1932 terminating or suffer potential hangs.
1933 (get_proc_lock): Reorganize debugging output slightly.
1934
e867f8f1
CF
19352004-03-15 Christopher Faylor <cgf@redhat.com>
1936
1937 * cygtls.cc (_cygtls::fixup_after_fork): Just manipulate the signal
1938 stack if a signal occurred during the parent's fork. Otherwise leave
1939 it alone.
1940
c25695bb
CF
19412004-03-15 Christopher Faylor <cgf@redhat.com>
1942
1943 * exceptions.cc (try_to_debug): Report on tid of caller.
1944
1945 * sync.cc (muto::acquire): Fix some races.
1946 * sync.h (muto): Expose some fields for easier debugging.
1947
80c74a5f
CV
19482004-03-15 Corinna Vinschen <corinna@vinschen.de>
1949
1950 * fhandler.h (fhandler_dev_tape::tape_get_pos): Declare with extra
1951 parameter for partition number.
1952 (fhandler_dev_tape::_tape_set_pos): Ditto.
1953 (fhandler_dev_tape::tape_partition): New method.
1954 (fhandler_dev_tape::tape_set_partition): New method.
1955 * fhandler_tape.cc (fhandler_dev_tape::open): Call private methods
1956 directly instead of ioctl.
1957 (fhandler_dev_tape::ioctl): Use long erase on MTERASE by default.
1958 Don't use absolute positioning on MTSEEK. Call tape_set_partition
1959 on MTSETPART, tape_partition on MTMKPART.
1960 (fhandler_dev_tape::tape_get_pos): Add partition number parameter.
1961 Prefer logical position information over absolute position information.
1962 Return partition number.
1963 (fhandler_dev_tape::_tape_set_pos): Add partition number parameter.
1964 Use in SetTapePosition.
1965 (fhandler_dev_tape::tape_set_pos): Remove special TAPE_ABSOLUTE_BLOCK
1966 handling.
1967 (fhandler_dev_tape::tape_erase): Rewind before erasing.
1968 (fhandler_dev_tape::tape_status): Rearrange slightly. Try to get a
1969 MediaType even if no tape is loaded. Store active partition in
1970 mt_resid as on Linux.
1971 (fhandler_dev_tape::tape_partition): New method.
1972 (fhandler_dev_tape::tape_set_partition): New method.
1973 * include/cygwin/mtio.h: Fix copyright. Add comment to explain
1974 mt_resid content.
1975 * include/cygwin/version.h: Bump API minor number.
1976
168d7785
CF
19772004-03-14 Christopher Faylor <cgf@redhat.com>
1978
1979 * cygtls.cc (_cygtls::remove): Call remove_wq even when we can't
1980 necessarily get the cygtls table lock.
1981 * cygtls.h (_cygtls::remove_wq): Add wait argument.
1982 * sigproc.cc (_cygtls::remove_wq): Honor wait argument when acquiring
1983 lock.
1984 (proc_terminate): Don't NULL sync_proc_subproc since other threads may
1985 still try to access it.
1986
80c74a5f 19872004-03-14 Corinna Vinschen <corinna@vinschen.de>
6644f509
CV
1988
1989 * errno.cc (errmap): Map ERROR_BEGINNING_OF_MEDIA and
1990 ERROR_SETMARK_DETECTED to EIO instead of ESPIPE.
1991 Handle ERROR_FILEMARK_DETECTED.
1992 * fhandler_tape.cc (TAPE_FUNC): Add comment that ERROR_BUS_RESET
1993 has still to be handled correctly.
1cda1322 1994 (fhandler_dev_tape::open): Accommodate fact that get.mt_dsreg
6644f509
CV
1995 also contains density code.
1996 (fhandler_dev_tape::ioctl): Rearrange slightly. Reset devbuf also on
1997 MTNOP, MTWSM, MTSETBLK, MTSETDRVBUFFER, MTSETPART and MTMKPART.
1998 (fhandler_dev_tape::tape_set_pos): Rearrange. Match behaviour to
1999 the Linux tape driver.
2000 (fhandler_dev_tape::tape_status): Call IOCTL_STORAGE_GET_MEDIA_TYPES_EX
2001 if available. Return device type and density code in appropriate
2002 mtget members.
2003 * wincap.h (wincaps::has_ioctl_storage_get_media_types_ex): New element.
2004 * wincap.cc: Implement above element throughout.
2005 * include/cygwin/mtio.h: Add tape device types as returned by
2006 IOCTL_STORAGE_GET_MEDIA_TYPES_EX.
2007 (MT_TAPE_INFO): Use above type codes.
2008 (struct mtget): Change mt_dsreg comment.
2009
83a74ea2
PH
20102004-03-14 Pierre Humblet <pierre.humblet@ieee.org>
2011
6644f509
CV
2012 * dir.cc (rmdir): Construct real_dir with flag PC_FULL.
2013 Use a loop instead of recursion to handle the current directory.
83a74ea2 2014
f8a8e7a1
CF
20152004-03-14 Christopher Faylor <cgf@redhat.com>
2016
2017 * cygtls.cc (_cygtls::remove): Call remove_wq to ensure that wait stuff
2018 is removed from proc_subproc linked list.
2019 * cygtls.h (_cygtls::remove_wq): Declare.
2020 * sigproc.cc (_cygtls::remove_wq): Define.
2021 (proc_subproc): Label event handle appropriately.
2022 * spawn.cc (spawn_guts): Return -1 when wait() fails for spawn types
2023 that require waiting.
2024
80c74a5f 20252004-03-13 Corinna Vinschen <corinna@vinschen.de>
09f36ed0
CV
2026
2027 * errno.cc (errmap): Handle ERROR_BUS_RESET.
2028 * fhandler.h (fhandler_dev_raw::write_file): New method, created
2029 from former static function.
2030 (fhandler_dev_raw::read_file): Ditto.
2031 (reset_devbuf): New inline method.
2032 (class fhandler_dev_tape): Add TAPE_GET_DRIVE_PARAMETERS
2033 member `dp'.
2034 (fhandler_dev_tape::write_file): New method.
2035 (fhandler_dev_tape::read_file): Ditto.
2036 (fhandler_dev_tape::tape_get_feature): Convert to inline method.
2037 (fhandler_dev_tape::tape_error): New method, created from former
3e78b5d7 2038 static function.
09f36ed0
CV
2039 (fhandler_dev_tape::tape_get_blocksize): Remove declaration.
2040 * fhandler_raw.cc (fhandler_dev_raw::write_file): New method, created
2041 from former static function.
2042 (fhandler_dev_raw::read_file): Ditto.
1cda1322 2043 (fhandler_dev_raw::writebuf): Accommodate the fact that no devbuf
09f36ed0
CV
2044 exists under variable block size condition.
2045 (fhandler_dev_raw::raw_read): Ditto. Add local p pointer to simplify
2046 pointer arithmetic.
2047 (fhandler_dev_raw::raw_write): Always set devbufend to 0 when starting
1cda1322 2048 with writing. Accommodate the fact that no devbuf exists under
09f36ed0
CV
2049 variable block size condition.
2050 * fhandler_tape.cc: Various formatting changes.
2051 (TAPE_FUNC): New macro. Use throughout as tape function loop.
2052 (get_ll): Convert into macro.
2053 (IS_EOM): New macro.
2054 (IS_EOF): New macro.
2055 (fhandler_dev_tape::is_eom): Use IS_EOM macro.
2056 (fhandler_dev_tape::is_eof): Use IS_EOF macro.
2057 (fhandler_dev_tape::write_file): New method.
2058 (fhandler_dev_tape::read_file): New method.
2059 (fhandler_dev_tape::open): Get drive information block here once.
2060 (fhandler_dev_tape::lseek): Remove unneeded duplicate code.
2061 (fhandler_dev_tape::dup): Duplicate drive information block.
2062 (fhandler_dev_tape::ioctl): Remove drvbuf in variable block size mode.
2063 Return ERROR_INVALID_BLOCK_LENGTH instead of ERROR_MORE_DATA if
2064 buffer contains data which would get lost on buffer size changing.
2065 Use absolute tape positioning also if drive only supports logical
2066 block positioning.
2067 (fhandler_dev_tape::tape_error): New method, created from former
2068 static function.
2069 (fhandler_dev_tape::tape_get_pos): Allow logical block reporting.
2070 Workaround tape driver bug.
2071 (fhandler_dev_tape::_tape_set_pos): Reset device buffer and flags
2072 after successful repositioning.
2073 (fhandler_dev_tape::tape_set_pos): Allow logical block positioning.
2074 Workaround tape driver bug.
2075 (fhandler_dev_tape::tape_erase): Use dp instead of calling
2076 GetTapeParameters.
2077 (fhandler_dev_tape::tape_prepare): Ditto.
2078 (fhandler_dev_tape::tape_get_blocksize): Remove.
2079 (fhandler_dev_tape::tape_set_blocksize): Don't call tape_get_blocksize.
2080 Error handling already done in fhandler_dev_tape::ioctl.
2081 (fhandler_dev_tape::tape_status): Remove local `dp' variable.
1cda1322 2082 Accommodate logical tape reporting. Call tape_get_feature instead
09f36ed0
CV
2083 of accessing feature words directly.
2084 (fhandler_dev_tape::tape_compression): Use dp instead of calling
2085 GetTapeParameters. Fix resetting datcompression.
2086
183f4d80
CF
20872004-03-12 Christopher Faylor <cgf@redhat.com>
2088
2089 * wait.cc (wait4): Initialize pointer on entry. Avoid calling
2090 call_signal_handler twice since that guarantees exiting with errno set
2091 to EINTR.
2092
3c5f8ea4
CV
20932004-03-12 Corinna Vinschen <corinna@vinschen.de>
2094
2095 * exceptions.cc (sigpacket::process): Simplify code slightly.
2096
9863b78e
CF
20972004-03-11 Christopher Faylor <cgf@redhat.com>
2098
2099 * cygtls.h (waitq): Declare structure here.
2100 (_cygtls::wq): Declare.
2101 * cygtls.cc (_cygtls::fixup_after_fork): Clear wq.thread_ev to avoid
2102 using an invalid event handle in forked process.
2103 * dcrt0.cc (waitq_storage): Delete.
2104 (threadstuff): Remove waitq_storage.
2105 * perthread.h (per_thread_waitq): Delete.
2106 (waitq_storage): Delete declaration.
2107 * sigproc.cc (sigproc_init): Remove perthread waitq consideration.
2108 * sigproc.h (waitq): Delete declaration.
2109 * wait.cc (wait4): Use _my_tls waitq structure rather than per_thread.
2110
83a74ea2 21112004-03-11 Pierre Humblet <pierre.humblet@ieee.org>
9863b78e
CF
2112
2113 * cygtls.h (_cygtls::newmask): Delete member.
2114 (_cygtls::deltamask): New member.
2115 * gendef (_sigdelayed): Replace the call to set_process_mask by a call
2116 to set_process_mask_delta.
2117 * exceptions.cc (handle_sigsuspend): Do not filter tempmask. Or
2118 SIG_NONMASKABLE in deltamask as a flag.
2119 (_cygtls::interrupt_setup): Set deltamask only.
2120 (set_process_mask_delta): New function.
2121 (_cygtls::call_signal_handler): Replace the first call to
2122 set_process_mask by a call to set_process_mask_delta.
2123 * tlsoffsets.h: Regenerate.
2124
7ea8e226
CF
21252004-03-11 Christopher Faylor <cgf@redhat.com>
2126
2127 * cygtls.cc (_cygtls::fixup_after_fork): Remove unneeded setting of
2128 oldmask.
2129 * exceptions.cc: Remove some __I386__ conditionals.
2130 (handle_exceptions): Move ppid test to outside of a loop for
2131 efficiency.
2132 (setup_handler): Make debugging output more wordy.
2133 (_cygtls::call_signal_handler): To avoid a race, use lock/unlock to
2134 synchronize with signal thread and ensure that signal_arrived event has
2135 actually been set.
2136 * gendef (_sigfe): Use ebx for all sigstack manipulations to ensure
2137 that the register is saved. Move setting of incyg to within stack lock
2138 to avoid setup_handler confusion.
2139 (_sigbe): Use ebx for all sigstack manipulations to ensure that the
2140 register is saved.
2141 (_cygtls::pop): Ditto.
2142 (_cygtls::lock): Ditto.
2143 (stabilize_sig_stack): Ditto.
2144 (setjmp): Ditto.
2145 (longjmp): Ditto.
2146
58e9df0f
CF
21472004-03-08 Jaakko Hyvatti <jaakko.hyvatti@iki.fi>
2148
2149 * fhandler_serial.cc (fhandler_serial::ioctl): Implement TIOCSBRK and
2150 TIOCCBRK.
2151 * include/sys/termios.h: Define TIOCSBRK and TIOCCBRK.
2152
5fb0fe79
CF
21532004-03-08 Christopher Faylor <cgf@redhat.com>
2154
ad22734a
CF
2155 * exceptions.cc (setup_handler): Avoid suspending a thread if it is in
2156 a cygwin function, in an exception, spinning, or locked.
5fb0fe79
CF
2157 * gendef (_sigfe): Move incyg setting earlier.
2158 (sigreturn): Set incyg flag to avoid interrupting called cygwin
2159 functions.
2160 (sigdelayed): Ditto.
2161 (stabilize_sig_stack): Ditto.
2162
2163 * sigproc.cc (proc_subproc): Don't restore process lock early in exec
2164 case.
2165
2166 * cygtls.h: Reorganize fields in _cygtls slightly.
2167 * tlsoffsets.h: Regenerate.
2168
3a1ccfc8
CF
21692004-03-06 Christopher Faylor <cgf@redhat.com>
2170
2171 * fork.cc (fork_parent): Save parent pid in a temporary variable since
2172 child could conceivably exit before function returns, rendering the
2173 child's shared memory area invalid.
2174
2175 * cygtls.h (_cygtls::incyg): Declare new field.
2176 (_cygtls::in_exception): Define new function.
2177 * exceptions.cc (setup_handler): Remove locked flag. Use 'incyg' flag
2178 and in_exception function to determine when we're in a cygwin function.
2179 (_cygtls::call_signal_handler): Decrement incyg flag prior to calling a
2180 handler. Increment it on return.
2181 * gendef (_sigfe): Increment incyg flag. Use testl for zero testing
2182 rather than orl, for consistency.
2183 (_sigbe): Decrement incyg flag. Use testl for zero testing rather than
2184 orl, for consistency.
2185 (_cygtls::pop): Use testl for zero testing rather than orl, for
2186 consistency.
2187 (stabilize_sig_stack): Ditto.
2188
0c378b64
CF
2189 * tlsoffsets.h: Regenerate.
2190
f2afcfa6
CF
21912004-03-05 Christopher Faylor <cgf@redhat.com>
2192
2193 * gendef (sigdelayed): Handle return here rather than going through
2194 sigbe to ensure that flags are properly restored.
2195
b95ae504
TP
21962004-03-04 Thomas Pfaff <tpfaff@gmx.net>
2197
f2afcfa6
CF
2198 * include/pthread.h (PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP): New
2199 define.
b95ae504
TP
2200 (PTHREAD_NORMAL_MUTEX_INITIALIZER_NP): Ditto.
2201 (PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP): Ditto.
f2afcfa6
CF
2202 * thread.cc (pthread_mutex::is_good_initializer): Check for all
2203 posssible initializers
b95ae504
TP
2204 (pthread_mutex::is_good_initializer_or_object): Ditto.
2205 (pthread_mutex::is_good_initializer_or_bad_object): Ditto.
f2afcfa6 2206 (verifyable_object_isvalid): Support up to three static initializers.
b95ae504 2207 (verifyable_object_isvalid (void const *,long)): Remove.
f2afcfa6
CF
2208 (pthread_cond::is_good_initializer_or_bad_object): Remove unneeded
2209 objectState var.
2210 (pthread_cond::init): Condition remains unchanged when creation has
2211 failed.
2212 (pthread_rwlock::is_good_initializer_or_bad_object): Remove unneeded
2213 objectState var.
2214 (pthread_rwlock::init): Rwlock remains unchanged when creation has
2215 failed.
2216 (pthread_mutex::init): Remove obsolete comment. Mutex remains
2217 unchanged when creation has failed. Add support for new initializers.
2218 (pthread_mutex_getprioceiling): Do not create mutex, just return
2219 ENOSYS.
b95ae504
TP
2220 (pthread_mutex_lock): Simplify.
2221 (pthread_mutex_trylock): Remove unneeded local themutex.
f2afcfa6
CF
2222 (pthread_mutex_unlock): Just return EPERM if mutex is not initialized.
2223 (pthread_mutex_setprioceiling): Do not create mutex, just return
2224 ENOSYS.
2225 * thread.h (verifyable_object_isvalid): Support up to three static
2226 initializers.
2227 (verifyable_object_isvalid (void const *,long)): Remove prototype.
2228 (pthread_mutex::init): Add optional initializer to parameter list.
b95ae504 2229
08b0a057
CF
22302004-03-03 Christopher Faylor <cgf@redhat.com>
2231
2232 * gendef (sigreturn): Call stabilize_sig_stack to ensure that there are
2233 no pending signals. Restore edx later.
2234 (sigdelayed): Save edx earlier.
2235
2236 * malloc_wrapper.cc (malloc_init): Add some more debugging output.
2237
7cdd0293
CV
22382004-03-02 Corinna Vinschen <corinna@vinschen.de>
2239
2240 * fhandler_raw.cc (fhandler_dev_raw::raw_read): When reading with
2241 variable block size, read only one block, read directly into user
2242 supplied buffer, return ENOMEM if user supplied buffer is smaller
2243 than size of next block to read. Use read2 instead of bytes_to_read
2244 to count number of bytes read.
2245 * fhandler_tape.cc (fhandler_dev_tape::open): Add debug output.
2246
4e23c181
CV
22472004-02-26 Brian Ford <ford@vss.fsi.com>
2248
2249 * miscfuncs.cc (check_invalid_virtual_addr): Assure the last page
2250 in the range is always tested. Add appropriate const.
0f898946 2251 * mmap.cc (mmap_record::alloc_fh): Remove unused static path_conf object.
4e23c181 2252
ca713cfa
CF
22532004-02-25 Christopher Faylor <cgf@redhat.com>
2254
74c9d43c
CF
2255 * exceptions.cc (setup_handler): Signal event for any sigwaitinfo, if it
2256 exists, to force signal to be handled. Zero event here to prevent
ca713cfa
CF
2257 races.
2258 * signal.cc (sigwaitinfo): Use local handle value for everything since
2259 signal thread could zero event element at any time. Detect when
2260 awaking due to thread not in mask and set return value and errno
2261 accordingly. Don't set signal number to zero unless we've recognized
2262 the signal.
2263 * sigproc.cc (sigq): Rename from sigqueue throughout.
2264
2265 * thread.cc (pthread::join): Handle signals received while waiting for
2266 thread to terminate.
2267
22682004-02-25 Christopher Faylor <cgf@redhat.com>
2269
2270 * cygwin.din: Export sighold, sigqueue.
2271 * exceptions.cc (sighold): Define new function.
2272 * signal.cc (handle_sigprocmask): Set correct errno for invalid signal.
2273 Simplify debugging output.
2274 (sigqueue): Define new function.
2275 * include/cygwin/signal.h (sighold): Declare new function.
2276 (sigqueue): Ditto.
2277 * include/cygwin/version.h: Bump API minor version number.
2278 * include/limits.h (TIMER_MAX): Define.
2279 (_POSIX_TIMER_MAX): Ditto.
2280
f9e19c09
CV
22812004-02-25 Brian Ford <ford@vss.fsi.com>,
2282 Corinna Vinschen <corinna@vinschen.de>
2283
2284 * miscfuncs.cc (check_invalid_virtual_addr): New function.
2285 * winsup.h (check_invalid_virtual_addr): Declare.
2286 * mmap.cc (munmap): Call check_invalid_virtual_addr instead of
2287 IsBadReadPtr.
2288
241f503c
CF
22892004-02-24 Christopher Faylor <cgf@redhat.com>
2290
2291 * gendef (stabilize_sig_stack): Correctly align this pointer for call
2292 to _cygtls::call_signal_handler.
2293 * gentls_offsets: Output sizeof field.
2294 * tlsoffsets.h: Regenerate.
2295
5ef9bbc8
CF
22962004-02-24 Christopher Faylor <cgf@redhat.com>
2297
2298 * dcrt0.cc (_dll_crt0): Don't check sync_startup if threadfunc_ix is set.
2299
2300 * external.cc (cygwin_internal): Implement CW_GET_BINMODE.
2301 * include/sys/cygwin.h: Declare CW_GET_BINMODE.
2302
5dbaca16
CF
23032004-02-24 Christopher Faylor <cgf@redhat.com>
2304
2305 * dcrt0.cc (_dll_crt0): Add some stern internal errors.
2306
c9a76075
CV
23072004-02-24 Corinna Vinschen <corinna@vinschen.de>
2308
2309 * thread.cc (pthread::cancelable_wait): Rearrange slightly.
2310 Add do_sig_wait parameter. Wait for signal_arrived if set to true.
2311 Return WAIT_SIGNALED if signal arrived.
1cda1322 2312 (pthread_cond::wait): Accommodate change to pthread::cancelable_wait.
c9a76075
CV
2313 (pthread::join): Ditto.
2314 (semaphore::_timedwait): Ditto.
2315 (semaphore::_wait): Ditto. Change to return int to allow status
2316 feedback.
2317 (semaphore::wait): Return return value from semaphore::_wait.
2318 * thread.h (WAIT_SIGNALED): New definition.
5fb0fe79 2319 (pthread::cancelable_wait): Change declaration. Define do_sig_wait
c9a76075
CV
2320 as false by default to not interfere with existing calls accidentally.
2321 (semaphore::_wait): Declare int.
2322
4d5d7a2c
CF
23232004-02-21 Christopher Faylor <cgf@redhat.com>
2324
2325 * exceptions.cc (sigpacket::process): Make sure that tls is filled in
2326 for SIGSTOP condition.
2327 (_cygtls::call_signal_handler): Restore signal mask using saved oldmask
2328 rather than current oldmask.
2329
3a0f12b5
CF
23302004-02-20 Christopher Faylor <cgf@redhat.com>
2331
2332 * path.cc (conv_path_list): Return error condition.
2333 (copy1): New function.
2334 (copyenc): New function.
2335 (mount_item::fnmunge): Return error condition. Use new functions to
2336 copy strings.
2337 (mount_item::build_win32): Ditto.
2338 (mount_info::conv_to_win32_path): Return error condition.
2339 (cygwin_conv_to_posix_path): Return result of path conversion.
2340 (cygwin_conv_to_full_posix_path): Ditto.
2341 (return_with_errno): New macro.
2342 (cygwin_win32_to_posix_path_list): Use new macro to potentially set
2343 errno.
2344 (cygwin_posix_to_win32_path_list): Ditto.
2345 * path.h (mount_item::fnmunge): Add size argument.
2346 (mount_item::build_win32): Ditto.
2347
12afe445
CV
23482004-02-20 Corinna Vinschen <corinna@vinschen.de>
2349
2350 * getopt.c: Avoid useless compiler warnings.
2351
1a57b229
CV
23522004-02-20 Corinna Vinschen <corinna@vinschen.de>
2353
2354 * getopt.c: Replace with latest vanilla(!) OpenBSD version 1.16.
2355
0e061ecf
CF
23562004-02-18 Christopher Faylor <cgf@redhat.com>
2357
2358 * fork.cc (fork_child): Invert sense of test which defeated correct
2359 handling in a fork from a non-main thread.
2360
2361 * dcrt0.cc (initial_env): Eliminate parameter and just send DebugBreak
2362 when appropriate.
2363 (dll_crt0_0): Reflect parameter change to initial_env.
2364 (dll_crt0_1): Don't call initial_env.
2365
2d6c4a1a
CF
23662004-02-18 Christopher Faylor <cgf@redhat.com>
2367
2368 * gendef (stabilize_sig_stack): New function.
2369 (setjmp): Import, add sig stack handling. Store sig stack info.
2370 (longjmp): Call stabilize_sig_stack. Restore sig stack info.
2371 * config/i386/setjmp.c: Remove.
2372
a682de34
CV
23732004-02-17 Corinna Vinschen <corinna@vinschen.de>
2374
2375 * fork.cc (fork_child): Move fixup_shms_after_fork so that
2376 signal_arrived is initialized when calling it.
2377
720c33ae
CF
23782004-02-17 Christopher Faylor <cgf@redhat.com>
2379
2380 * Makefile.in (clean): Clean libserver, too.
2381
2382 * fhandler.cc (fhandler_base::~fhandler_base): Remove path_conv cleanup.
2383 * syscalls.cc (chroot): Ditto.
2384 * path.cc (path_conv::~path_conv): Define new destructor.
2385 (conv_path_list_buf_size): Remove explicit path_conv cleanup.
2386 * path.h (path_conv::~path_conv): Declare new destructor.
2387
88e584bf
CF
23882004-02-16 Christopher Faylor <cgf@redhat.com>
2389
2390 * Makefile.in: Compile flock.o with -fomit-frame-pointer.
2391
f6cd9c35
CF
23922004-02-16 Christopher Faylor <cgf@redhat.com>
2393
2394 * Makefile.in: Compile dlfcn.o with -fomit-frame-pointer.
2395
2c29523e
CF
23962004-02-16 Christopher Faylor <cgf@redhat.com>
2397
2398 * Makefile.in: Compile delqueue.o with -fomit-frame-pointer.
2399
212592dc
CV
24002004-02-16 Pierre Humblet <pierre.humblet@ieee.org>
2401
2402 * syscalls.cc (rename): Do not test the MoveFile error code
2403 where MoveFileEx exists.
2404
b4f0009f
CF
24052004-02-15 Christopher Faylor <cgf@redhat.com>
2406
04dbc76e
CF
2407 * cygheap.cc (_csbrk): Report more debugging details on failing
2408 condition.
b4f0009f 2409
955bf2ee
CF
24102004-02-14 Christopher Faylor <cgf@redhat.com>
2411
2412 * Makefile.in: Compile syscalls.o with -fomit-frame-pointer.
2413
2414 * sigproc.cc: Eliminate unused variable.
2415
968bdf96
CV
24162004-02-14 Corinna Vinschen <corinna@vinschen.de>
2417
2418 * getopt.c: Replace with latest NetBSD version 1.16. Keep Cygwin
2419 specific changes as minimal as possible.
2420
cf2b4018
CF
24212004-02-13 Christopher Faylor <cgf@redhat.com>
2422
2423 * sigproc.cc (proc_subproc): Change warning back to silent debug
2424 output.
2425
c21e74cc
CF
24262004-02-13 Christopher Faylor <cgf@redhat.com>
2427
2428 * dcrt0.cc (alloc_stack_hard_way): Revert to previous implementation.
2429 (alloc_stack): Ditto.
2430 * exceptions.cc (ctrl_c_handler): Add debugging output.
2431
edc4f86a
CF
24322004-02-13 Christopher Faylor <cgf@redhat.com>
2433
2434 * Makefile.in (clean): Remove sigfe.s.
2435 (sigfe.s): Ensure that sigfe.s will be regenerated if it does not exist.
2436 * dll_init.cc (dll_dllcrt0): Simplify initializing tests.
2437
2438 * exceptions.cc (setup_handler): Detect when stub caller is either
2439 spinning or has acquired the lock after being suspended to avoid
2440 windows problems with suspending a win32 API call.
2441
2442 * cygtls.h (_cygtls::spinning): Declare new element.
2443 * gendef: Remove unused _siglist_index and _siglist declaration.
2444 (_sigfe): Set spinning element when potentially looping, waiting for lock.
2445 (_sigbe): Ditto.
2446 (_cygtls::lock): Ditto.
2447 (_longjmp): Ditto.
2448 * tlsoffsets.h: Regenerate.
2449 * pinfo.cc (_pinfo::exit): Set final exit state here. Call sigproc_terminate if
2450 invoked with 'norecord'. Clear any residual _cygtls stuff.
2451 * winsup.h (exit_states): Define ES_FINAL.
2452 * spawn.cc (spawn_guts): Don't call proc_terminate specifically when
2453 execing. Let _pinfo::exit handle that case.
2454
2455 * sigproc.cc (wait_subproc): Always exit loop early when proc_loop_wait.
2456
2457 * init.cc (munge_threadfunc): Eliminate unused argument.
2458 (dll_entry): Reflect above change in call to munge_threadfunc.
2459
b3535c27
CF
24602004-02-11 Christopher Faylor <cgf@redhat.com>
2461
2462 * gendef (_sigbe): Zero location on pop.
2463 (_cygtls::pop): Ditto.
2464
b91faaab
CF
24652004-02-11 Christopher Faylor <cgf@redhat.com>
2466
2467 * dcrt0.cc (alloc_stack_hard_way): Eliminate second argument.
2468 (alloc_stack): Remove use of 'b' throughout.
2469
e431827c
CF
24702004-02-11 Christopher Faylor <cgf@redhat.com>
2471
2472 Rename _threadinfo to _cygtls, throughout.
2473 * cygtls.h (_cygtls::call_signal_handler): Rename from
2474 call_signal_handler_now.
2475 (_cygtls::push): Make second argument mandatory.
2476 (_cygtls::fixup_after_fork): Declare new function.
2477 (_cygtls::lock): Ditto.
2478 * cygtls.cc (_cygtls::fixup_after_fork): Define new function.
2479 * dcrt0.cc (cygwin_finished_initializing): Define as bool.
2480 (alloc_stack): Use _tlstop rather than arbitrary variable in probably
2481 vain attempt to avoid strange fork problem on CTRL-C.
2482 (dll_crt0_0): Remove obsolete winpids::init call.
2483 * dll_init.cc (dll_dllcrt0): Detect forkee condition as equivalent to
2484 initializing.
2485 * winsup.h (cygwin_finished_initializing): Declare as bool.
2486 * exceptions.cc (handle_exceptions): Rely on
2487 cygwin_finished_initializing to determine how to handle exception
2488 during process startup.
2489 (_cygtls::call_signal_handler): Rename from call_signal_handler_now.
2490 (_cygtls::interrupt_now): Fill in second argument to push.
2491 (signal_fixup_after_fork): Eliminate.
2492 (setup_handler): Initialize locked to avoid potential inappropriate
2493 unlock. Resume thread if it has acquired the stack lock.
2494 (ctrl_c_handler): Just exit if ctrl-c is hit before cygiwn has finished
2495 initializing.
2496 * fork.cc (sync_with_child): Don't call abort since it can cause exit
2497 deadlocks.
2498 (sync_with_child): Change debugging output slightly.
2499 (fork_child): Set cygwin_finished_initializing here. Call _cygtls fork
2500 fixup and explicitly call sigproc_init.
2501 (fork_parent): Release malloc lock on fork failure.
2502 (vfork): Call signal handler via _my_tls.
2503 * sigproc.cc (sig_send): Ditto.
2504 * syscalls.cc (readv): Ditto.
2505 * termios.cc (tcsetattr): Ditto.
2506 * wait.cc (wait4): Ditto.
2507 * signal.cc (nanosleep): Ditto.
2508 (abort): Ditto.
2509 (kill_pgrp): Avoid killing self if exiting.
2510 * sync.cc (muto::acquire): Remove (temporarily?) ill-advised
2511 exiting_thread check.
2512 * gendef (_sigfe): Be more agressive in protecting stack pointer from
2513 other access by signal thread.
2514 (_cygtls::locked): Define new function.
2515 (_sigbe): Ditto.
2516 (_cygtls::pop): Protect edx.
2517 (_cygtls::lock): Use guaranteed method to set eax to 1.
2518 (longjmp): Aggressively protect signal stack.
2519 * miscfuncs.cc (low_priority_sleep): Reduce "sleep time" for secs == 0.
2520 * pinfo.cc (winpids::set): Counterintuitively use malloc's lock to
2521 protect simultaneous access to the pids list since there are
2522 pathological conditions which can cause malloc to call winpid.
2523 (winpids::init): Eliminate.
2524 * pinfo.h (winpids::cs): Eliminate declaration.
2525 * pinfo.h (winpids::init): Eliminate definition.
2526
897c7856
CV
25272004-02-11 Corinna Vinschen <corinna@vinschen.de>
2528
2529 * security.cc (get_nt_object_attribute): Fix error handling.
2530
9ec70d20
CV
25312004-02-09 Ralf Habacker <ralf.habacker@freenet.de>
2532
2533 * fhandler_socket.cc (fhandler_socket::ioctl): Add FIONREAD handling.
2534
cec48792
CF
25352004-02-08 Christopher Faylor <cgf@redhat.com>
2536
2537 * debug.h (console_printf): Define for non-debugging condition.
2538
2539 * cygtls.h (_threadinfo::lock): Remove wait argument.
2540 (_threadinfo::interrupt_setup): Remove retaddr argument.
2541 * exceptions.cc (_threadinfo::interrupt_setup): Ditto.
2542 (_threadinfo::interrupt_now): Accommodate change to interrupt_setup
2543 argument.
2544 (setup_handler): Ditto. Always lock sig stack prior to determining
2545 interrupt method.
2546 * gendef (_sigfe): Correct thinko regarding cmpxchg.
2547 (_sigbe): Ditto.
2548 (_threadinfo::lock): Ditto.
2549 (_threadinfo::pop): Eliminate left-over stack unlock.
edc4f86a 2550 * sigproc.cc (proc_subproc): Change debugging output to printed
cec48792
CF
2551 warning.
2552
6946073e
CF
25532004-02-08 Christopher Faylor <cgf@redhat.com>
2554
2555 * localtime.cc (localtime_r): Call tzset.
2556
2557 * Makefile.in: Make version.h/cygwin.din version check a warning since
2558 it is not foolproof.
2559
2560 * cygheap.h (CYGHEAPSIZE): Bump size down.
2561
2562 * cygtls.h (_threadinfo::stacklock): New element.
2563 (_threadinfo::pop): Make regparm.
2564 (_threadinfo::lock): New function.
2565 (_threadinfo::unlock): New function.
2566 * cygtls.cc (_threadinfo::push): Wait for a lock on the stack before
2567 performing the operation.
2568 (_threadinfo::pop): Move to another file.
2569 * cygwin.din: More SIGFE changes.
2570 * exceptions.cc (try_to_debug): Always display messages on console.
2571 (handle_exceptions): Unwind stack only when actually about to call
2572 sig_send.
2573 (setup_handler): Lock stack prior to performing any operations.
2574 * gendef (_sigfe): Ditto.
2575 (_sigbe): Ditto.
2576 (_threadinfo::pop): Ditto. Move here.
2577 * gen_tlsoffsets: Generate positive offsets.
2578 * tlsoffsets.h: Regenerate.
2579
2a566ac3
CV
25802004-02-06 Corinna Vinschen <corinna@vinschen.de>
2581
2582 * cygserver.h (CYGWIN_SERVER_VERSION_API): Bump.
2583 * cygserver_ipc.h (struct proc): Add signal_arrived member.
2584 (ipc_set_proc_info): Inititalize blk.signal_arrived.
2585
043878df
CV
25862004-02-06 Pierre Humblet <pierre.humblet@ieee.org>
2587
2588 * uinfo.cc (cygheap_user::init): Use sec_user_nih to build a
2589 security descriptor. Set both the process and the default DACLs.
2590 * fork.cc (fork_parent): Use sec_none_nih security attributes.
2591 * spawn.cc (spawn_guts): Ditto.
2592
656a999a
CF
25932004-02-05 Christopher Faylor <cgf@redhat.com>
2594
2595 * cygwin.din: Make many more functions SIGFE.
2596 * include/cygwin/version.h (CYGWIN_VERSION_SHARED_DATA): Bump.
2597
d82c6f47
CV
25982004-02-05 Pierre Humblet <pierre.humblet@ieee.org>
2599
2600 * security.h (SID): New macro.
2601 (well_known_*_sid): Change type to cygpsid.
2602 (cygsid::init): Delete declaration.
2603 * sec_helper.cc (well_known_*_sid): Define using above SID macro.
2604 (cygsid::init): Delete.
2605 * dcrt0.cc (dll_crt0_0): Do not call cygsid::init.
2606 * security.cc (get_user_local_groups): Change the second argument type
2607 to cygpsid.
2608
06615351
CF
26092004-02-03 Christopher Faylor <cgf@redhat.com>
2610
2611 * cygtls.h (_local_storage::signamebuf): Increase size to prevent
2612 overflow on really odd values.
9e8c2fad 2613 * tlsoffsets.h: Regenerate.
06615351 2614
c571716c
CF
26152004-02-03 Christopher Faylor <cgf@redhat.com>
2616
2617 * Makefile.in (DLL_OFILES): Add strsig.o.
06615351 2618 * cygtls.h (_local_storage::signamebuf): New element.
c571716c 2619 * sysconf.cc (sysconf): Implement _SC_RTSIG_MAX.
9e8c2fad 2620 * tlsoffsets.h: Regenerate.
c571716c
CF
2621 * include/limits.h (_POSIX_RTSIG_MAX): New define.
2622 (RTSIG_MAX): Ditto.
2623 * include/cygwin/signal.h (SIGRTMIN): New define.
2624 (SIGRTMAX): Ditto.
2625 (NSIG): Bump.
2626 * strsig.cc: New file.
2627
50be1d78
CF
26282004-02-03 Jason Tishler <jason@tishler.net>
2629
2630 * window.cc (Winmain): Show windows error code in error output when
2631 RegisterClass fails.
2632
52806019
CF
26332004-02-02 Christopher Faylor <cgf@redhat.com>
2634
2635 * fhandler.h (*::fixup_after_exec): Eliminate unused handle argument.
2636 * fhandler.h (dtable::fixup_after_exec): Eliminate unused handle
2637 argument.
2638 * dcrt0.cc (dll_crt0_1): Reflect elimination of unused handle argument
2639 to fixup_after_exec.
2640 * dtable.cc (dtable::fixup_after_exec): Ditto.
2641 * fhandler_console.cc (fhandler_console::fixup_after_exec): Ditto.
2642 * fhandler_dsp.cc (fhandler_dsp::fixup_after_exec): Ditto.
2643 * fhandler_raw.cc (fhandler_raw::fixup_after_exec): Ditto.
2644 * fhandler_socket.cc (fhandler_socket::fixup_after_exec): Ditto.
2645 * fhandler_virtual.cc (fhandler_virtual::fixup_after_exec): Ditto.
2646 * pipe.cc (fhandler_pipe::fixup_after_exec): Ditto.
2647
26482004-02-02 Pierre Humblet <pierre.humblet@ieee.org>
2649
2650 * spawn.cc (spawn_guts): Do not set ciresrv.parent.
2651 * child_info.h (child_info_spawn::~child_info_spawn): Do not close
2652 parent. Update CURR_CHILD_INFO_MAGIC.
2653 * dcrt0.cc (dll_crt0_0): Do not close spawn_info->parent. Pass NULL to
2654 cygheap->fdtab.fixup_after_exec().
2655
6027d26d
CF
26562004-02-02 Christopher Faylor <cgf@redhat.com>
2657
2658 Throughout, change name from set_inheritance to set_no_inheritance to
2659 better reflect input arguments of this function.
2660
2661 * cygheap.h (CYGHEAPSIZE): Increase size of cygheap to something closer
2662 to the 21st century.
2663
8d9bbb50
CV
26642004-02-02 Corinna Vinschen <corinna@vinschen.de>
2665
2666 * cygerrno.h (set_errno): Replace semicolon with comma in non-DEBUGGING
2667 version to avoid compile time error.
2668
9e1ad59d
CF
26692004-02-01 Christopher Faylor <cgf@redhat.com>
2670
2671 * cygerrno.h (set_errno): Set global errno whenever setting thread
2672 specific version.
2673 * debug.cc (__set_errno): Ditto.
2674
2675 * exceptions.cc (handle_sigsuspend): Remove spurious
2676 sig_dispatch_pending call.
2677 (set_signal_mask): When there seem to be pending signals to dispatch,
2678 tell signal_dispatch_pending/sig_send not to specifically call any
2679 handlers.
2680 * sigproc.h (sig_dispatch_pending): Change declaration to void.
2681 * sigproc.cc (sig_dispatch_pending): Change definition to void. Take
2682 an argument to determine whether to tell sig_send to wait for handler
2683 to be called.
2684 * sigproc.cc (sig_send): Don't call signal handler when sig ==
2685 __SIGFLUSHFAST.
2686 (wait_sig): Honor __SIGFLUSHFAST. Guard against sigpacket::process
2687 nuking si_signo.
2688 * sigproc.h (__SIGFLUSHFAST): Define new special signal.
2689 (sig_dispatch_pending): Change declaration to void. Take optional
2690 boolean argument.
2691
2692 * fork.cc (vfork): Add debugging output.
2693
ef33379b
CF
26942004-01-26 Christopher Faylor <cgf@redhat.com>
2695
2696 * exceptions.cc (sig_handle_tty_stop): Avoid races by waiting for both
2697 signal_arrived and for sigCONT.
2698 (sigpacket::process): Enforce sending of both signal_arrived and
2699 sigCONT, where appropriate.
2700 * gendef (sigreturn): Save tls pointer in ebx so that it can jump into
2701 sigdelayed and use the same register.
2702
5e0f482f
CF
27032004-01-26 Christopher Faylor <cgf@redhat.com>
2704
2705 * cygtls.cc (_threadinfo::init_thread): Add more local reent stdio
2706 initialization.
2707 * dcrt0.cc (initial_env): Can it really be true that XP doesn't allow
2708 attaching a debugger during DLL attach? Add temporary workaround.
2709 (dll_crt0_0): Ensure that _impure_ptr stdio is initialized before any
2710 threads.
2711 (dll_crt0_1): Move _impure_ptr initialization to dll_crt0_0.
2712 * exceptions.cc (try_to_debug): Reinstate old method for looping while
2713 debugging.
2714 * syscalls.cc (_cygwin_istext_for_stdio): Regularize debugging output.
2715 Remove hopefully extraneous check.
2716 (setmode_helper): Add debugging output for improbable case. Use
2717 "binary" rather "raw" for consistency.
2718
d7231d72
CF
27192004-01-25 Christopher Faylor <cgf@redhat.com>
2720
2721 * fhandler.cc (fhandler_base::fhaccess): Avoid always setting errno to
2722 EACCESS when return value is < 0. Rely on errno being set properly.
2723
6bc774fc
CF
27242004-01-25 Christopher Faylor <cgf@redhat.com>
2725
2726 * sigproc.cc (proc_subproc): Don't protect *child's* handle.
2727
9157f0f3
CF
27282004-01-24 Christopher Faylor <cgf@redhat.com>
2729
2730 * fhandler.h (fhandler_base::fhaccess): Return int for compatibility
2731 with access.
2732 * fhandler.cc (fhandler_base::fhaccess): Return int. Use consistent
2733 variable name for exit value. Exit at bottom, printing debugging
2734 information, like other cygwin functions.
2735
f4e815bc
CF
27362004-01-23 Christopher Faylor <cgf@redhat.com>
2737
2738 * cygheap.cc (init_cygheap::close_ctty): Protect YA vforkism.
2739 * fhandler.h (fhandler_base::has_acls): Make pass through for path_conv
2740 method.
2741 (fhandler_base::isremote): Ditto.
2742 (fhandler_base::is_fs_special): Ditto.
2743 (fhandler_base::has_attribute): Ditto. Define new function.
2744 (fhandler_base::fhaccess): Declare new function based on access_worker.
2745 (fhandler_base::set_has_acls): Eliminate obsolete function.
2746 (fhandler_base::set_isremote): Ditto.
2747 * fhandler.cc (fhandler_base::fhaccess): Move from syscalls.cc and into
2748 fhandler_base class. Use fhandler methods to access data rather than
2749 path_conv stuff.
2750 (fhandler_base::device_access_denied): Use fhaccess method.
2751 * fhandler_disk_file.cc (fhandler_disk_file::opendir): Ditto.
2752 (fhandler_base::open_fs): Remove calls to obsolete functions.
2753 * fhandler_virtual.cc (fhandler_virtual::open): Ditto.
2754 * winsup.h (access_worker): Remove obsolete access_worker declaration.
2755 *syscalls.cc (access_worker): Move function to fhandler.cc.
2756 (access): Use fhaccess method.
2757
2758 * pinfo.cc (_pinfo::set_ctty): Clarify debugging output.
2759 * sigproc.cc (sig_dispatch_pending): Ditto.
2760 * syscalls.cc (setsid): Perform minor rearrangement.
2761
b9a76642
PH
27622004-01-23 Pierre Humblet <pierre.humblet@ieee.org>
2763
c571716c
CF
2764 * fhandler_socket.cc (fhandler_socket::create_secret_event): Avoid
2765 creating multiple handles. Always allow event inheritance but set the
2766 handle inheritance appropriately. Improve error handling.
2767 (fhandler_socket::check_peer_secret_event): Improve error handling.
2768 (fhandler_socket::close_secret_event): Simply call CloseHandle.
2769 (fhandler_socket::set_close_on_exec): Set secret event inheritance.
b9a76642 2770
f7239090
CF
27712004-01-23 Christopher Faylor <cgf@redhat.com>
2772
2773 * configure.in: Remove NEWVFORK default.
2774 * configure: Regenerate.
2775 * dcrt0.cc: Conditionalize vfork stuff throughout.
2776 * dtable.cc: Ditto.
2777 * perthread.h: Ditto.
2778 * pipe.cc (fhandler_pipe::close): Ditto.
2779 * spawn.cc (spawnve): Ditto.
2780 * syscalls.cc (setsid): Ditto.
2781 * exceptions.cc (sigpacket::process): Use macro to refer to vfork pid.
2782
2783 * debug.cc (verify_handle): Define new function.
2784 * debug.h (VerifyHandle): Define new macro.
2785 (verify_handle): Declare new function
2786 * fhandler.cc (fhandler_base::dup): Verify that dup'ed handle is not
2787 supposed to be in use.
2788 (fhandler_base::set_inheritance): Ditto.
2789 (fhandler_base::fork_fixup): Ditto.
2790 * fhandler_socket.cc (fhandler_socket::dup): Ditto.
2791 * fhandler_tty.cc (fhandler_tty_slave::open): Ditto.
2792 * net.cc (set_socket_inheritance): Ditto.
2793 * pinfo.cc (pinfo_fixup_after_exec): Ditto.
2794 * sigproc.cc (proc_subproc): Ditto.
2795 (sig_send): Ditto.
2796 * spawn.cc (spawn_guts): Ditto.
2797 * thread.cc (pthread::init_mainthread): Ditto.
2798 * pipe.cc (fhandler_pipe::close): Close read_state with
2799 ForceCloseHandle since it was protected.
2800 (fhandler_pipe::fixup_after_exec): Protect read_state handle.
2801 (fhandler_pipe::dup): Correctly close open handles on error condition.
2802 Verify that dup'ed handle is not supposed to be in use.
2803 (fhandler_pipe::create): Protect read_state.
2804
35b7fc6c
CF
28052004-01-23 Christopher Faylor <cgf@redhat.com>
2806
2807 * exceptions.cc (sig_handle_tty_stop): Fix boneheaded mistake by using
2808 correct check for parent state rather than inverted check mistakenly
2809 introduced on 2003-09-15.
2810
a33df422
CF
28112004-01-22 Brian Ford <ford@vss.fsi.com>
2812
2813 * fhandler_serial.cc (fhandler_serial::raw_write): Prevent a deadlock
2814 when the input buffer overflows.
2815 (fhandler_serial::raw_read): Correct to print the actual error and only
2816 call PurgeComm when necessary.
2817
35711de7
CF
28182004-01-22 Christopher Faylor <cgf@redhat.com>
2819
2820 * dcrt0.cc (reent_data): Make global.
2821 * cygwin.din: Reexport reent_data.
2822
39d06d71
CF
28232004-01-22 Christopher Faylor <cgf@redhat.com>
2824
2825 * cygtls.cc (_threadinfo::remove): Don't assume that we are removing
2826 _my_tls.
2827 * exceptions.cc (setup_handler): Improve debugging output.
2828 (call_signal_handler_now): Remove ill-advised debugger call.
2829 * sigproc.cc (sigcomplete_main): Delete.
2830 (sig_send): Honor FIXME and avoid using main thread's completion event
2831 for everything or suffer races.
2832 (pending_signals::add): Default stored mask to current process mask
2833 rather than mask at time of signal send.
2834 (wait_sig): Add debugging output.
2835 * sigproc.h (sigpacket::mask_storage): Delete.
2836
537ca63f
CF
28372004-01-22 Christopher Faylor <cgf@redhat.com>
2838
2839 * fhandler.cc (fhandler_base::open): Revert isfs change.
2840
a1dcf5d8
CF
28412004-01-21 Christopher Faylor <cgf@redhat.com>
2842
2843 * devices.in: Change raw com device to more correct form.
2844
918f634f
CF
28452004-01-21 Christopher Faylor <cgf@redhat.com>
2846
2847 * fhandler.cc (fhandler_base::open): Use major numbers rather than
2848 device numbers to control special behavior for devices which take
2849 units.
2850 * fhandler_raw.cc (fhandler_dev_raw::writebuf): Ditto.
2851 (fhandler_dev_raw::fstat): Ditto.
2852 (fhandler_dev_raw::open): Ditto.
2853 (fhandler_dev_raw::ioctl): Ditto.
2854
0a0c89ef
CF
28552004-01-21 Nicholas Wourms <nwourms@netscape.net>
2856
2857 * signal.cc (sigaction): Fix if-statement typo.
2858
be14b608
CF
28592004-01-21 Christopher Faylor <cgf@redhat.com>
2860
2861 * cygtls.cc (handle_threadlist_exception): Change logic, improve
2862 debugging output.
2863
bcb4223c
CF
28642004-01-21 Christopher Faylor <cgf@redhat.com>
2865
2866 * fhandler_tty.cc (fhandler_tty::ioctl): Semi-revert 2003-09-26 change
2867 for TIOCSWINSZ. It is not an error for ioctl_request_event to be
2868 missing.
2869
28702004-01-20 Christopher Faylor <cgf@redhat.com>
2871
2872 * sigproc.cc (pending_signals::save): New function.
2873 (pending_signals::restore): Ditto.
2874 (sig_clear): Save/restore current queue pointer.
2875 (wait_sig): Delete signals marked as such.
2876 * sigproc.h (__SIGDELETE): New enum.
2877
67fcf127
CF
28782004-01-20 Christopher Faylor <cgf@redhat.com>
2879
2880 * include/cygwin/version.h: Bump DLL minor number to 8.
2881
2882 * cygmalloc.h: Make more concessions to attempts to get debugging
2883 malloc working.
2884 * debug.h: Ditto.
2885 * dlmalloc.cc: Ditto.
2886 * dlmalloc.h: Ditto.
2887 * malloc_wrapper.cc: Ditto.
2888
2889 * perthread.h (perthread::create): Use calloc to ensure zeroed memory.
2890
fb69e3ed
CV
28912004-01-20 Christopher Faylor <cgf@redhat.com>
2892
2893 * sec_acl.cc (setacl): Make sure sd_ret is large enough.
2894
d795119c
CF
28952004-01-19 Christopher Faylor <cgf@redhat.com>
2896
2897 * sigproc.cc (sigproc_terminate): Don't close sendsig handle when
2898 execing since we're not closing what we think we're closing.
2899 (sig_send): Improve debugging when exiting due to no_signals_available.
2900
2901 * wincap.h (wincaps::cant_debug_dll_entry): New element.
2902 * wincap.cc: Implement above element throughout.
2903 * dcrt0.cc (initial_env): Accommodate changes necessary to allow
2904 initial debugging for systems which do not allow debugging in
2905 dll_entry.
2906 (dll_crt0_0): Add initial_env call back here.
2907
2908 * Makefile.in (install-man): Use mandir as target for installation.
2909
29102004-01-19 Christopher Faylor <cgf@redhat.com>
2911
2912 * include/cygwin/version.h: Bump DLL minor number to 7 (should have been
2913 done earlier).
2914
f6936c48
CF
29152004-01-19 Christopher Faylor <cgf@redhat.com>
2916
2917 * cygwin/include/signal.h: Add copyright notice.
2918
2919 * cygwin.din: Make clock SIGFE. Add clock_gettime, sigwaitinfo,
2920 timer_create, timer_delete, timer_settime.
2921 * include/cygwin/version.h: Reflect above additions.
2922 * fork.cc (fork_child): Call fixup_timers_after_fork.
2923 * signal.cc (sigwait): Remove unused variable.
2924 * timer.cc: New file.
2925 (clock_gettime): Define new function.
2926 (timer_tracker): Define new struct used by timer functions.
2927 (timer_tracker::timer_tracker): New function.
2928 (to_us): New function.
2929 (timer_thread): New function.
2930 (timer_tracker::settime): New function.
2931 (timer_create): New function.
2932 (timer_settime): New function.
2933 (timer_delete): New function.
2934 (fixup_timers_after_fork): New function.
2935 * cygthread.cc: Bump thread count.
2936
29372004-01-17 Christopher Faylor <cgf@redhat.com>
2938
2939 * signal.cc (sigwaitinfo): Define new function.
2940 (sigwait): Redefine based on sigwaitinfo.
2941 * include/cygwin/signal.h (sigwaitinfo): Declare.
2942 (sigwait): Ditto.
2943
29442004-01-17 Christopher Faylor <cgf@redhat.com>
2945
2946 * dtable.cc (dtable::vfork_parent_restore): Avoid double close of ctty
2947 when ctty == ctty_on_hold.
2948
29492004-01-16 Christopher Faylor <cgf@redhat.com>
2950
2951 * cygtls.h (_threadinfo::threadkill): New element.
2952 (_threadinfo::set_threadkill): Declare new function.
2953 (_threadinfo::reset_threadkill): Declare new function.
2954 * dcrt0.cc (dcrt0_1): Call here so that it will be possible to attach
2955 to running process with #(*& Windows Me/9x.
2956 (initial_env): Try to initialize strace if uninitialized.
2957 * gendef: Don't zero signal if threadkill is set since that will happen
2958 in the called function.
2959 * signal.cc (sigwait): Ensure cleanup in error conditions.
2960 * sigproc.cc (sig_send): Clear packet mask storage.
2961 (wait_subproc): Fill in child exit code in siginfo_t structure.
2962 * thread.cc (pthread_kill): Set threadkill flag.
2963 * tlsoffsets.h: Regenerate.
2964
29652004-01-16 Christopher Faylor <cgf@redhat.com>
2966
2967 Throughout, use siginfo_t to fill out all signal information for
2968 "kernel" signals.
2969 * cygtls.h (_threadinfo::set_siginfo): Declare new function.
2970 * cygtls.cc (_threadinfo::set_siginfo): Define new function.
2971 * dcrt0.cc (do_exit): Accommodate siginfo_t considerations.
2972 * exceptions.cc (handle_exceptions): Ditto.
2973 (sig_handle_tty_stop): Ditto.
2974 (ctrl_c_handler): Use killsys() to send signal.
2975 (sigpacket::process): Rename from sig_handle. Use siginfo_t field from
2976 sigpacket for everything.
2977 (tty_min::kill_pgrp): Accommodate siginfo_t considerations.
2978 (fhandler_termios::bg_check): Ditto.
2979 * fhandler_tty.cc (fhandler_tty_slave::ioctl): Use killsys() to send signal.
2980 * signal.cc (kill_worker): Rewrite to use siginfo_t second argument.
2981 (kill_pgrp): Ditto.
2982 (kill0): Define new function pulled from kill().
2983 (kill): Rewrite as frontend to kill0.
2984 (killsys): Define new function.
2985 * sigproc.cc (sigelem): Eliminate.
2986 (sigpacket): Move to sigproc.h. Subsume sigelem.
2987 (pending_signals): Use sigpacket rather than sigelem for everything.
2988 (sig_clear): Ditto.
2989 (wait_sig): Ditto.
2990 (sig_send): Rewrite to use siginfo_t argument.
2991 (sig_send): New function wratpper to sig_send with siginfo_t argument.
2992 (wait_subproc): Accommodate siginfo_t considerations.
2993 * thread.cc (pthread_kill): Ditto.
2994 * sigproc.h (sigpacket): Move here.
2995 (sigpacket::process): Declare "new" function.
2996 (sig_handle): Eliminate declaration.
2997 (sig_send): Declare with new paramaters.
2998 (killsys): Declare new function.
2999 (kill_pgrp): Declare.
3000 * winsup.h: Move some signal-specific stuff to sigproc.h.
3001 * include/cygwin/signal.h: Tweak some siginfo_t stuff.
3002
46ee5422
CF
30032004-01-16 Christopher Faylor <cgf@redhat.com>
3004
3005 * fhandler_console.cc (fhandler_console::close): Remove obsolete test
3006 for vfork_cleanup.
3007 * pipe.cc (fhandler_pipe::close): Add comment.
3008
49d0c042
CF
30092004-01-16 Christopher Faylor <cgf@redhat.com>
3010
3011 * cygheap.cc (init_cygheap::close_ctty): Don't NULL ctty if it is still
3012 active.
3013
001197ae
CF
30142004-01-16 Christopher Faylor <cgf@redhat.com>
3015
3016 * dtable.cc (dtable::vfork_parent_restore): Store ctty_on_hold prior to
3017 calling close_all_files since it will be zeroed.
3018
ac02533e
CF
30192004-01-15 Christopher Faylor <cgf@redhat.com>
3020
3021 * gentls_offsets: Reinstate unlink of temp files.
3022
30232004-01-14 Christopher Faylor <cgf@redhat.com>
3024
3025 * fhandler_console.cc (fhandler_console::close): Fix debugging output.
3026 (fhandler_console::fixup_after_fork): Decrement open_fhs prior to call
3027 to fhandler_console::open since this would cause incrementing too much
3028 incrementing in child processes. (Probably needs to be handled more
3029 elegantly someday)
3030 (fhandler_console::fixup_after_exec): Ditto.
3031
2d1d1eb1
CF
30322004-01-14 Christopher Faylor <cgf@redhat.com>
3033
3034 * cygtls.h (_threadinfo::call): Remove regparm declaration to work
3035 around compiler bug.
3036
30372004-01-13 Christopher Faylor <cgf@redhat.com>
3038
3039 * autoload.cc (TryEnterCriticalSection): Remove.
3040 * dcrt0.cc (dll_crt0_0): Delete inappropriate setting of
3041 _my_tls.stackptr to NULL since it has really bad consequences. Make
3042 'si' an automatic variable.
3043
30442004-01-13 Christopher Faylor <cgf@redhat.com>
3045
3046 * cygtls.cc (_threadinfo::init_thread): Correct thinko which caused
3047 thread list to be allocated every time.
3048 * cygtls.h (CYGTLS_PADSIZE): Define as const int.
3049 * sync.h: Make multiple inclusion safe.
3050 (muto::next): Eliminate.
3051 (muto::exiting_thread): New variable.
3052 (muto::set_exiting_thread): New function.
3053 (new_muto): Change to use different section for mutos since c++ give
3054 inexplicable warning in some cases otherwise.
3055 (new_muto1): Ditto.
3056 * dcrt0.cc (do_exit): Call muto::set_exiting_thread here.
3057 * sync.cc (muto_start): Eliminate.
3058 (muto::acquire): Always give exiting thread a lock. Never give thread
3059 a lock if exiting.
3060 (muto::release): Ditto for releasing.
3061 * dtable.cc (dtable::init_lock): Unline function and define here.
3062 * dtable.h (lock_cs): Define as a muto since critical sections seem to
3063 work oddly on Windows Me.
3064 (lock): Accommodate switch to muto.
3065 (unlock): Ditto.
3066 * exceptions.cc (setup_handler): Don't worry about acquiring mutos
3067 since that hasn't mattered for a long time.
3068 (signal_exit): Ditto: muto stuff will be handled automatically on exit
3069 now.
3070
30712004-01-12 Christopher Faylor <cgf@redhat.com>
3072
3073 * Makefile.in (DLL_IMPORTS): Link advapi32 to ensure proper DLL
3074 initialization.
3075 * autoload.cc (RegCloseKey): Arbitrarily choose this function as a
3076 "seed" to pull the advapi32 link library in. So, comment out the
3077 autoloading.
3078 * cygtls.cc (_threadinfo::init_thread): Just clear CYGTLS_PADSIZE.
3079 (_threadinfo::remove): Add debugging.
3080 (_threadinfo::find_tls): Ditto.
3081 * cygtls.h (_threadinfo::padding): Make zero length (for now?).
3082 * dcrt0.cc (dll_crt0_0): Move more initialization here from dll_crt0_1.
3083 (dll_crt0_1): See above.
3084 * dtable.h (dtable::lock): Remove commented out critical section
3085 locking.
3086 * dtable.h (dtable::init_lock): Remove commented out critical section
3087 locking.
3088 * dtable.h (dtable::unlock): Remove commented out critical section
3089 locking.
3090 * exceptions.cc (interruptible): bool'ize.
3091 * init.cc (threadfunc_fe): Revert to storing threadfunc at stack
3092 bottom.
3093 (munge_threadfunc): Ditto. Avoid adding overhead to
3094 calibration_thread.
3095 (prime_threads): Don't initialize tls stuff.
3096 (dll_entry): Make minor change to initialization order.
3097 * tlsoffsets.h: Regenerate.
3098
3099 * sigproc.cc (wait_sig): Add sanity check for end of process thread
3100 exit.
3101
3102 * select.h: Make minor formatting change.
3103
31042004-01-10 Christopher Faylor <cgf@redhat.com>
3105
3106 * Makefile.in: Add still more -fomit-frame-pointer functions.
3107 * dtable.h (dtable::lock): New function.
3108 (dtable::unlock): New function.
3109 (dtable::init_lock): New function.
3110 * cygheap.h (HEAP_TLS): Declare new enum value.
3111 (init_cygheap::threadlist): Declare new array.
3112 (init_cygheap::sthreads): Declare new variable.
3113 (cygheap_fdmanip::~cygheap_fdmanip): Use new dtable lock/unlock
3114 functions.
3115 (cygheap_fdnew::cygheap_fdnew): Ditto.
3116 (cygheap_fdget::cygheap_fdget): Ditto.
3117 * dtable.cc (dtable_init): Initialize fdtab critical section.
3118 (dtable::fixup_after_fork): Ditto.
3119 (dtable::fixup_after_exec): Ditto.
3120 (dtable::dup2): Use lock/unlock calls to protect access to fdtab.
3121 (dtable::find_fifo): Ditto.
3122 (dtable::fixup_before_fork): Ditto.
3123 (dtable::fixup_before_exec): Ditto.
3124 (dtable::set_file_pointers_for_exec): Ditto.
3125 (dtable::vfork_child_dup): Ditto.
3126 (dtable::vfork_parent_restore): Ditto.
3127 * syscalls.cc (close_all_files): Ditto.
3128 * sync.h (muto::acquired): Declare new function.
3129 (new_muto1): Declare new macro used to specify name of muto storage.
3130 * sync.cc (muto::acquired): Define new function.
3131
3132 * cygthread.cc (cygthread::stub): Remove signal chain removal call
3133 since it is handled during initialization now.
3134 * cygthread.cc (cygthread::simplestub): Remove signal chain removal
3135 call since it is handled during initialization now.
3136 * cygtls.cc (sentry): New class used for locking. Use throughout.
3137 (_threadinfo::reset_exception): Don't pop stack.
3138 (_threadinfo::find_tls): Move from exceptions.cc.
3139 (_threadinfo::init_thread): Initialize array of threads rather than
3140 linked list. Take second argument indicating thread function for this
3141 thread.
3142 (_threadinfo::remove): Search thread array rather than linked list.
3143 Use sentry to lock. Only unlock if we got the lock.
3144 (_threadinfo::find_tls): Ditto for first two.
3145 (handle_threadlist_exception): Handle exceptions when manipulating the
3146 thread list in case of premature thread termination.
3147 (_threadinfo::init_threadlist_exceptions): Ditto.
3148 * cygtls.h (TLS_STACK_SIZE): Decrease size.
3149 (_threadinfo::padding): Add element to avoid overwriting lower part of
3150 stack.
3151 (_threadinfo::remove): Add a "wait" argument to control how long we
3152 wait for a lock before removing.
3153 * exceptions.cc (init_exception_handler): Make global. Take argument
3154 to control exception handler being set.
3155 (ctrl_c_handler): Wait forever when removing self from signal chain.
3156 (_threadinfo::find_tls): Move to cygtls.cc.
3157 (sig_handle): Reorganize detection for thread-specific signals.
3158 * heap.cc (heap_init): Rework slightly. Make fatal error more verbose.
3159 Remove malloc initialization since it can't happen during dll attach.
3160 * init.cc (search_for): Move address to search for on stack here.
3161 (threadfunc_ix): Ditto for stack offset. Make shared so that stack
3162 walk potentially only has to be done once when cygwin processes are
3163 running.
3164 (threadfunc_fe): Use standard tls to store thread function (may change
3165 back later).
3166 (calibration_thread): New function. Potentially called to find
3167 threadfunc_ix.
3168 (munge_threadfunc): Search for "search_for" value on stack. Output
3169 warning when thread func not found on stack. Use standard tls to store
3170 thread function.
3171 (prime_threads): New function. Called to prime thread front end.
3172 (dll_entry): Call dll_crt0_0 here when DLL_PROCESS_ATTACH. Call
3173 prime_threads here. Try to remove thread from signal list here.
3174 * sigproc.cc (wait_sig): Initialize threadlist exception stuff here.
3175 * thread.cc (pthread::exit): Pass argument to signal list remove
3176 function.
3177 * thread.h: Remove obsolete *ResourceLock defines.
3178
3179 * tlsoffsets.h: Regenerate.
3180
3181 * winsup.h (spf): Define temporary debug macro to be deleted later.
3182
3183 * dcrt0.cc (dll_crt0_0): New function, called during DLL
3184 initialization. Mainly consists of code pulled from dll_crt0_1.
3185 (dll_crt0_1): See above.
3186 (_dll_crt0): Wait for initial calibration thread to complete, if
3187 appropriate. Move some stuff to dll_crt0_0.
3188 (initialize_main_tls): Accommodate argument change to
3189 _thread_info::init_thread.
3190 * fork.cc (fork_child): Ditto.
3191 (sync_with_child): Fix debug message.
3192 * external.cc (cygwin_internal): Remove special considerations for
3193 uninitialized dll since initialization happens during dll attach now.
3194
3195 * dlfcn.cc (dlopen): Remove obsolete *ResourceLock calls.
3196 (dlclose): Ditto.
3197
31982004-01-05 Christopher Faylor <cgf@redhat.com>
3199
3200 * cygheap.h (init_cygheap::close_ctty): Declare new function.
3201 * cygheap.cc (init_cygheap::close_ctty): Define new function.
3202 * syscalls.cc (close_all_files): Use close_ctty.
3203 (setsid): Ditto.
3204
3205 * cygthread.cc (cygthread::stub): Remove exception initialization.
3206 * cygthread.cc (cygthread::stub): Remove exception initialization.
3207 (cygthread::simplestub): Ditto.
3208 * thread.cc (pthread::thread_init_wrapper): Ditto.
3209 * cygtls.cc (_last_thread): Make static.
3210 (_threadinfo::call2): Initialize exception handler here.
3211 (_threadinfo::find_tls): Move here.
3212 * exceptions.cc (_threadinfo::find_tls): Move.
3213
3214 * dcrt0.cc (__api_fatal): Add prefix info to message here rather than
3215 including it in every call to function.
3216 * winsup.h (api_fatal): Accommodate above change.
3217 * debug.cc (add_handle): Don't do anything if cygheap not around.
3218 (mark_closed): Ditto.
3219
3220 * dll_init.cc (dll_list::detach): Fix debug output.
3221 * fork.cc (sync_with_child): Ditto.
3222 (vfork): Improve debug output.
3223 * heap.cc (heap_init): Ditto.
3224
3225 * exceptions.cc (try_to_debug): Clarify message when debugger attaches.
3226
0efff769
CF
32272004-01-03 Christopher Faylor <cgf@redhat.com>
3228
3229 * exceptions.cc (_threadinfo::interrupt_now): Avoid double call to
3230 sigdelayed.
3231 * pinfo.cc (_pinfo::commune_send): Avoid inexplicable test which caused
3232 most pids to be shown as "<defunct>" on Win9x.
3233
e80cbe3e
CF
32342004-01-02 Christopher Faylor <cgf@redhat.com>
3235
3236 * cygheap.h (init_cygheap): Play more vfork shell games and move
3237 ctty_on_hold and open_fhs_on_hold (back) here.
3238 * dcrt0.cc (_dll_crt0): Just set impure_ptr_ptr here and let later
3239 initialization deal with tls.
3240 * dtable.cc (dtable::vfork_child_fixup): Move ctty considerations here.
3241 (dtable:vfork_parent_restore): And here.
3242 * fork.cc (vfork): Reflect change to ctty handling.
3243 * perthread.h (vfork_save::fhctty): Eliminate.
3244
3245 * cygwin.din: Make more exports NOSIGFE that will never be interrupted
3246 by a signal.
3247
3248 * init.cc (dll_entry): Set stackptr to NULL to catch problems earlier.
This page took 1.216178 seconds and 5 git commands to generate.