1 2002-08-30 Corinna Vinschen <corinna@vinschen.de>
3 * cygwin.din: Add prototypes for new wchar functions in newlib.
4 * include/cygwin/version.h: Bump API minor number.
6 2002-08-29 Boris Schaeling <boriss@web.de>
7 Corinna Vinschen <corinna@vinschen.de>
9 * poll.cc (poll): Peek sockets ready for read to see if there's
12 2002-08-28 Christopher Faylor <cgf@redhat.com>
14 * cygthread.cc (hthreads): Remove unneeded global.
15 (cygthread::simplestub): New static member function.
16 (cygthread::runner): Don't set hthreads.
17 (cygthread::freerange): New member function.
18 (cygthread::operator new): Call freerange if all cygwin slots are used
20 (cygthread::exit_thread): Don't mess with event if freerange thread.
21 (cygthread::detach): Ditto.
22 * cygthread.h (class cygthread): Declare new member functions and
25 2002-08-28 Christopher Faylor <cgf@redhat.com>
27 * malloc.cc: Protect some definitions to avoid a compile time warning.
29 2002-08-27 Nicholas Wourms <nwourms@netscape.net>
31 * cygwin.din: Export getc_unlocked, getchar_unlocked,
32 putc_unlocked, putchar_unlocked functions.
33 * include/cygwin/version.h: Bump api minor.
35 2002-08-28 Corinna Vinschen <corinna@vinschen.de>
37 * fhandler_socket.cc (fhandler_socket::recvfrom): Eliminate flags
38 not understood by WinSock.
39 (fhandler_socket::sendto): Ditto. If WinSock sendto() returns
40 WSAESHUTDOWN, change errno to EPIPE and raise SIGPIPE if MSG_NOSIGNAL
42 * include/cygwin/socket.h: Define MSG_WINMASK and MSG_NOSIGNAL.
43 * include/cygwin/version.h: Bump API minor number.
45 2002-08-28 Corinna Vinschen <corinna@vinschen.de>
47 * poll.cc (poll): Eliminate erroneous POLLERR conditional.
49 2002-08-26 Conrad Scott <conrad.scott@dsl.pipex.com>
51 * fhandler_socket.cc (fhandler_socket::check_peer_secret_event):
53 (fhandler_socket::connect): Remove sigframe.
54 (fhandler_socket::accept): Ditto.
55 (fhandler_socket::getsockname): Ditto.
56 (fhandler_socket::getpeername): Ditto.
57 (fhandler_socket::recvfrom): Ditto.
58 (fhandler_socket::recvmsg): Ditto.
59 (fhandler_socket::sendto): Ditto.
60 (fhandler_socket::sendmsg): Ditto.
61 (fhandler_socket::close): Ditto.
62 (fhandler_socket::ioctl): Ditto.
63 * ioctl.cc (ioctl): Add sigframe.
64 *net.cc (cygwin_sendto): Ditto.
65 (cygwin_recvfrom): Ditto.
66 (cygwin_recvfrom): Ditto.
67 (cygwin_connect): Ditto.
68 (cygwin_shutdown): Ditto.
69 (cygwin_getpeername): Ditto.
70 (cygwin_accept): Ditto. Improve strace message.
71 (cygwin_getsockname): Ditto. Ditto.
72 (cygwin_recvmsg): Ditto. Ditto.
73 (cygwin_sendmsg): Fix strace message.
75 2002-08-27 Christopher Faylor <cgf@redhat.com>
77 * child_info.h: Add _PROC_WHOOPS enum value.
78 (CURR_CHILD_INFO_MAGIC): Update.
79 (child_info::magic): Make 'long'.
80 * cygheap.h: Export _cygheap_start.
81 * cygheap.cc: Don't declare _cygheap_start.
82 * cygmagic: Use cksum to produce checksums. Append 'U' to end of
84 * dcrt0.cc (initial_env): Calculate sleep ms before reusing buffer.
85 (_dll_crt0): Detect cygheap mismatch as indicative of different cygwin
86 version. Set child_proc_info to NULL when _PROC_WHOOPS.
87 (multiple_cygwin_problem): If child_info specific problem, then set
88 child_proc_info type to _PROC_WHOOPS.
89 * shared_info.h (CURR_MOUNT_MAGIC): Update.
90 (CURR_SHARED_MAGIC): Ditto.
92 2002-08-25 Conrad Scott <conrad.scott@dsl.pipex.com>
94 * fhandler.h (fhandler_socket::recvfrom): Fix prototype.
95 (fhandler_socket::sendto): Ditto.
96 * fhandler_socket.cc (fhandler_socket::recvfrom): Ditto.
97 (fhandler_socket::sendto): Ditto.
98 * include/sys/socket.h (recv): Fix prototype.
102 * net.cc (cygwin_sendto): Ditto. Improve strace message
103 (cygwin_recvfrom): Ditto. Ditto.
104 (cygwin_setsockopt): Improve strace message.
105 (cygwin_getsockopt): Ditto.
106 (cygwin_connect): Ditto.
107 (cygwin_accept): Ditto.
108 (cygwin_bind): Ditto.
109 (cygwin_getsockname): Ditto.
110 (cygwin_getpeername): Ditto.
111 (cygwin_recv): Fix prototype.
112 (cygwin_send): Ditto.
113 (cygwin_recvmsg): Improve strace message.
114 (cygwin_sendmsg): Ditto.
116 2002-08-25 Pierre Humblet <Pierre.Humblet@ieee.org>
118 * sec_acl.cc (getacl): Check ace_sid == well_known_world_sid
119 before owner_sid and group_sid so that well_known_world_sid
120 means "other" even when owner_sid and/or group_sid are Everyone.
121 * security.cc (get_attribute_from_acl): Created from code common
122 to get_nt_attribute() and get_nt_object_attribute(), with same
123 reordering as in getacl() above.
124 (get_nt_attribute): Call get_attribute_from_acl().
125 (get_nt_object_attribute): Ditto.
127 2002-08-26 Christopher Faylor <cgf@redhat.com>
129 * Makefile.in (cygcheck.exe): Make a -mno-cygwin program.
130 * cygrun.c (main): Export CYGWIN=ntsec unless otherwise set.
132 * shared.cc (shared_name): Only add build date to shared name when
135 2002-08-24 Christopher Faylor <cgf@redhat.com>
137 * Makefile.in (DLL_IMPORTS): Move libuuid.a and libshell32.a to list
138 rather than referring to them via -l. Add DLL imports last in link
139 line for new-cygwin.dll and cygrun.exe.
141 2002-08-19 Christopher Faylor <cgf@redhat.com>
143 * pinfo.h (pinfo::remember): Arrange for destructor call if
144 proc_subproc returns error.
145 * sigproc.cc (zombies): Store 1 + total zombies since proc_subproc uses
148 2002-08-19 Corinna Vinschen <corinna@vinschen.de>
150 * pwdgrp.h (pwdgrp_read::pwdgrp_read): Remove.
151 (pwdgrp_read::~pwdgrp_read): Ditto.
152 (pwdgrp_read::open): Reset fh to NULL instead of INVALID_HANDLE_VALUE.
153 (pwdgrp_read::close): Ditto.
155 2002-08-19 Christopher Faylor <cgf@redhat.com>
157 * fhandler.h (fhandler_console::send_winch_maybe): New method.
158 * fhandler_console.cc (set_console_state_for_spawn): Remove if 0'ed
160 (fhandler_console::send_winch_maybe): Define new method.
161 (fhandler_console::read): Use send_winch_maybe where appropriate.
162 (fhandler_console::init): Just call all tcsetattr rather than
164 * select.cc (peek_console): Reorganize so that send_winch_maybe is
165 called for everything but keyboard input.
167 2002-08-18 Christopher Faylor <cgf@redhat.com>
169 * perthread.h (vfork_save): Add ctty, sid, pgid, exitval fields.
170 (vfork_save::restore_pid): New method.
171 (vfork_save::restore_exit): New method.
172 * fork.cc (vfork): Save ctty, sid, pgid and restore them when returning
173 to "parent". Use exitval field if exiting but never created a new
175 * syscalls.cc (setsid): Detect when in "vfork" and force an actual fork
176 so that pid will be allocated (UGLY!).
177 (getsid): New function.
178 * dcrt0.cc (do_exit): Use vfork_save::restore_exit method for returning
180 * spawn.cc (spawnve): Use vfork_save::{restore_pid,restore_exit}
181 methods for returning from vfork.
182 * cygwin.din: Export getsid.
183 * include/cygwin/version.h: Bump api minor number.
185 * malloc.cc: #ifdef sYSTRIm for when MORECORE_CANNOT_TRIM is true.
187 2002-08-18 Christopher Faylor <cgf@redhat.com>
189 * cygmalloc.h (MORECORE_CANNOT_TRIM): Define.
191 2002-08-18 Christopher Faylor <cgf@redhat.com>
193 * sigproc.cc (sigCONT): Define.
194 * sigproc.h (sigCONT): Declare.
195 (wait_sig): Create sigCONT event here.
196 * exceptions.cc (sig_handle_tty_stop): Wait for sigCONT event rather
197 than stopping thread.
198 (sig_handle): Set sigCONT event as appropriate on SIGCONT rather than
199 calling ResumeThread.
201 2002-08-17 Christopher Faylor <cgf@redhat.com>
203 * malloc.cc: Update to 2.7.2.
204 * malloc_wrapper.cc (malloc_init): Call user level mallocs to determine
205 if the malloc routines have been overridden.
207 2002-08-16 Christopher Faylor <cgf@redhat.com>
209 * winsup.h: Remove malloc_*lock functions.
211 2002-08-16 Christopher Faylor <cgf@redhat.com>
213 * Makefile.in: Add support for new malloc.o and renamed
214 malloc_wrapper.o. Use -fomit-frame-pointer for malloc.o compilation.
215 * malloc_wrapper.cc: New file. Rename from malloc.cc. Add support for
216 more malloc functions. Eliminate export_* calls. Just use straight
217 malloc names. Remove unused argument from malloc lock functions.
218 * cygwin.din: Just export straight malloc names. Add malloc_stats,
219 malloc_trim, malloc_usable_size, mallopt, memalign, valloc.
220 * dcrt0.cc (__cygwin_user): Eliminate export_* malloc entries.
221 * fork.cc (fork_parent): Remove unused argument from malloc_lock
223 * malloc.cc: New file. Doug Lea's malloc v2.7.1.
224 * cygmalloc.h: New file.
225 * include/cygwin/version.h: Bump API_MINOR.
227 * sync.h (muto::acquire): Use appropriate number for regparm attribute.
228 (muto::reset): Ditto.
229 (muto::release): Ditto.
231 2002-08-16 Pavel Tsekov <ptsekov@gmx.net>
233 * exceptions.cc (interrupt_setup): Ensure that the previous signal mask
236 2002-08-15 Thomas Pfaff <tpfaff@gmx.net>
238 * dcrt0.cc: Modify define for CYGWIN_GUARD.
239 (alloc_stack_hard_way): Just use CYGWIN_GUARD in VirtualAlloc call.
241 2002-08-11 Conrad Scott <conrad.scott@dsl.pipex.com>
243 * fhandler.h (fhandler_socket::recv): Remove method.
244 (fhandler_socket::send): Ditto.
245 * fhandler_socket.cc (fhandler_socket::recv): Ditto.
246 (fhandler_socket::send): Ditto.
247 (fhandler_socket::read): Delegate to fhandler_socket::recvfrom.
248 (fhandler_socket::write): Delegate to fhandler_socket::sendto.
249 (fhandler_socket::sendto): Check for null `to' address.
250 * net.cc (cygwin_sendto): Check for zero request length.
251 (cygwin_recvfrom): Ditto. Fix signature, use void *buf.
252 (cygwin_recv): Delegate to cygwin_recvfrom.
253 (cygwin_send): Delegate to cygwin_sendto.
255 2002-08-11 Christopher Faylor <cgf@redhat.com>
257 * cygthread.cc (cygthread::cygthread): Close another race.
259 2002-08-11 Christopher Faylor <cgf@redhat.com>
261 * assert.cc (__assert): Call debugger on assertion failure if
263 * dcrt0.cc (dll_crt0_1): Just wait for signal thread to go live rather
264 than going through the overhead of invoking it.
265 * fork.cc (fork_child): Ditto.
266 * exceptions.cc (signal_fixup_after_fork): Call sigproc_init here.
267 * sigproc.cc (proc_can_be_signalled): Assume that the signal thread is
269 (sig_dispatch): Ditto.
271 (wait_for_sigthread): Rename from "wait_for_me". Assume that
272 wait_sig_inited has been set and that this function is only called from
274 * sigproc.h (wait_for_sigthread): Declare new function.
276 2002-08-08 Christopher Faylor <cgf@redhat.com>
278 * environ.cc (parse_options): Remember the "no" part of any options for
281 2002-08-07 Conrad Scott <conrad.scott@dsl.pipex.com>
283 * winsup.h (__check_null_invalid_struct): Make ptr argument non-const.
284 (__check_null_invalid_struct_errno): Ditto.
285 * miscfuncs.cc (__check_null_invalid_struct): Ditto.
286 (__check_null_invalid_struct_errno): Ditto.
287 (__check_invalid_read_ptr_errno): Remove superfluous cast.
288 * net.cc (get): Set appropriate errno if fd is not a socket.
289 (cygwin_sendto): Fix parameter checking.
290 (cygwin_recvfrom): Ditto.
291 (cygwin_setsockopt): Ditto.
292 (cygwin_getsockopt): Ditto.
293 (cygwin_connect): Ditto.
294 (cygwin_gethostbyaddr): Ditto.
295 (cygwin_accept): Ditto.
296 (cygwin_bind): Ditto.
297 (cygwin_getsockname): Ditto.
298 (cygwin_listen): Ditto.
299 (cygwin_getpeername): Ditto.
300 (cygwin_send): Ditto.
301 (cygwin_shutdown): Ditto. Move sigframe to fhandler_socket.
302 (cygwin_recvmsg): Fix parameter checking. Add tracing.
303 (cygwin_sendmsg): Ditto.
304 * fhandler_socket.cc (fhandler_socket::shutdown): Add sigframe.
305 * resource.cc (setrlimit): Fix parameter checking.
307 2002-08-08 Joe Buehler <jbuehler@hekimian.com
309 * sec_helper.cc (sec_acl): remove extraneous arg to debug_printf.
311 2002-08-07 Conrad Scott <conrad.scott@dsl.pipex.com>
313 * fhandler_socket.cc (fhandler_socket::accept): Fix FIONBIO call.
315 2002-08-06 Christopher Faylor <cgf@redhat.com>
317 * cygheap.cc (_csbrk): Avoid !cygheap considerations.
318 (cygheap_init): Deal with unintialized cygheap issues here.
319 (cheap_init): Move cygheap_max setting here.
321 2002-08-06 Christopher Faylor <cgf@redhat.com>
322 Conrad Scott <conrad.scott@dsl.pipex.com
324 * cygheap.cc (_csbrk): Allocate some slop initially. Don't erroneously
325 add sbrk amount to returned value in initial case.
327 2002-08-06 Christopher Faylor <cgf@redhat.com>
329 * spawn.cc (spawn_guts): Don't set mount_h here.
330 * sigproc.cc (init_child_info): Set it here instead.
331 * shared.cc (cygwin_mount_h): Make NO_COPY.
333 2002-08-06 Christopher Faylor <cgf@redhat.com>
335 * cygthread.cc (cygthread::stub): Accept flag to pass info structure to
337 (cygthread::operator new): Add defense debugging output.
338 (cygthread::cygthread): Add debugging output. Set name after thread
339 has been awakened to avoid a race.
340 (cygthread::exit_thread): Use handle operator rather than using ev
342 (cygthread::exit_thread): Reorganize to provide debugging. Set __name
344 * cygthread.h (cygself): Define.
345 * fhandler_tty.cc (fhandler_tty_master::init): Use cygself as argument
346 so that invoked thread can access its own info.
347 (process_output): Derive cygthread info of thread from thread argument.
348 * sigproc.cc (sigproc_init): Use cygself as argument so that invoked
349 thread can access its own info.
350 (wait_sig): Derive cygthread info of thread from thread argument.
352 2002-08-06 Conrad Scott <conrad.scott@dsl.pipex.com>
354 * debug.h (handle_list::allocated): Remove field.
355 * debug.cc (newh): Don't malloc extra entries.
356 (add_handle): Downgrade strace message level.
357 (delete_handle): Remove case for `allocated' entries.
359 2002-08-05 Christopher Faylor <cgf@redhat.com>
361 * cygthread.cc (cygthread::stub): Change event creation to manual
362 reset. Set __name after calling SetEvent to prevent races.
363 (cygthread::detach): Always reset event here to prevent races.
365 2002-08-03 Conrad Scott <conrad.scott@dsl.pipex.com>
367 * debug.h (WaitForMultipleObjects): Correct typo.
369 2002-08-01 Pierre Humblet <Pierre.Humblet@ieee.org>
371 * security.cc (verify_token): Do not reject a token just because
372 the supplementary group list is missing Everyone or a groupsid
373 equal to usersid, or because the primary group is not in the token,
374 as long as it is equal to the usersid.
375 * syscalls.cc (seteuid32): Use common code for all successful returns.
376 * grp.cc (getgroups32): Never includes Everyone in the output.
378 2002-08-01 Christopher Faylor <cgf@redhat.com>
380 * cygthread.cc (cygthread::exit_thread): Define new method.
381 * cygthread.h (cygthread::exit_thread): Declare new method.
382 * fhandler.h (fhandler_tty_master::hThread): Delete.
383 (fhandler_tty_master::output_thread): Define.
384 * fhandler_tty.cc (fhandler_tty_master::fhandler_tty_master): Adjust
386 (fhandler_tty_master::init): Use cygthread rather than handle.
387 (process_output): Use cygthread method to exit.
388 (fhandler_tty_master::fixup_after_fork): Set output_thread to NULL
390 (fhandler_tty_master::fixup_after_exec): Set output_thread to NULL
392 * tty.cc (tty_list::terminate): Detach from output_thread using
395 2002-08-01 Christopher Faylor <cgf@redhat.com>
397 * syscalls.cc (_link): Revert previous change and just always
398 dereference the oldpath.
400 2002-08-01 Christopher Faylor <cgf@redhat.com>
402 * syscalls.cc (link): Properly deal with a link to a symlink.
404 2002-08-01 Christopher Faylor <cgf@redhat.com>
406 * cygthread.cc: Remove cruft.
408 2002-08-01 Christopher Faylor <cgf@redhat.com>
410 * Makefile.in (DLL_OFILES): Add cygthread.o.
411 * dcrt0.cc (dll_crt0_1): Eliminate various thread initialization
412 functions in favor of new cygthread class.
413 * debug.cc: Remove thread manipulation functions.
415 * external.cc (cygwin_internal): Use cygthread method for determining
416 thread name. Remove capability for setting thread name.
417 * fhandler_console.cc (fhandler_console::read): Use cygthread method
418 rather than iscygthread function.
419 * fhandler_tty.cc (fhandler_tty_master::fhandler_tty_master): Use
420 cygthread methods to create threads.
421 (fhandler_tty_common::__acquire_output_mutex): Use cygthread method to
422 retrieve thread name.
423 * select.cc (pipeinf): Use cygthread pointer rather than handle.
424 (start_thread_pipe): Ditto.
425 (pipe_cleanup): Ditto.
427 (start_thread_serial): Ditto.
428 (serial_cleanup): Ditto.
430 (start_thread_socket): Ditto.
431 (socket_cleanup): Ditto.
432 * sigproc.cc (hwait_sig): Ditto.
433 (hwait_subproc): Ditto.
434 (proc_terminate): Ditto.
435 (sigproc_terminate): Ditto.
436 (sigproc_init): Initialize cygthread hwait_sig pointer.
437 (subproc_init): Initialize cygthread hwait_subproc pointer.
438 (wait_sig): Rely on cygthread HANDLE operator.
439 * strace.cc (strace::vsprntf): Use cygthread::name rather than threadname.
440 * window.cc (gethwnd): Use cygthread method to initialize thread.
442 2002-07-31 Conrad Scott <conrad.scott@dsl.pipex.com>
444 * fhandler.h (fhandler_base::get_r_no_interrupt): Make non-virtual.
445 * net.cc (fdsock): Call set_r_no_interrupt.
447 2002-07-30 Christopher Faylor <cgf@redhat.com>
449 * syscalls.cc (_read): Clarify debugging output.
451 2002-07-30 Christopher Faylor <cgf@redhat.com>
453 * fhandler.h (fhandler_base::get_r_no_interrupt): Make virtual.
455 2002-07-30 Christopher Faylor <cgf@redhat.com>
457 * fhandler_disk_file.cc (fhandler_cygdrive::set_drives): Incorporate .
458 and .. processing here.
459 (fhandler_cygdrive::readdir): Assume . and .. are already in pdrive.
460 (fhandler_cygdrive::seekdir): Ditto.
462 2002-07-29 Christopher Faylor <cgf@redhat.com>
464 * dcrt0.cc (dll_crt0_1): Move debug_fixup_after_fork_exec.
465 * cygheap.cc (cygheap_fixup_in_child): Call debug_fixup_after_fork_exec
466 immediately after cygheap has been set up.
468 2002-07-29 Corinna Vinschen <corinna@vinschen.de>
470 * security.cc: Change some formatting.
471 * include/cygwin/version.h: Bump API minor version.
473 2002-07-28 Pierre Humblet <Pierre.Humblet@ieee.org>
475 * cygheap.h (class cygheap_user): Add member groups.
476 * security.h (class cygsidlist): Add members type and maxcount, methods
477 position, addfromgr, alloc_sids and free_sids and operator+= (const
478 PSID psid). Modify contains () to call position () and optimize add ()
480 (class user_groups): Create. Update declarations of verify_token and
482 * security.cc (cygsidlist::alloc_sids): New.
483 (cygsidlist::free_sids): New.
484 (get_token_group_sidlist): Create from get_group_sidlist.
485 (get_initgroups_sidlist): Create from get_group_sidlist.
486 (get_group_sidlist): Suppress.
487 (get_setgroups_sidlist): Create.
488 (verify_token): Modify arguments. Add setgroups case.
489 (create_token): Modify arguments. Call get_initgroups_sidlist and
490 get_setgroups_sidlist as needed. Set SE_GROUP_LOGON_ID from auth_pos
491 outside of the loop. Rename the various group sid lists consistently.
492 * syscalls.cc (seteuid32): Modify to use cygheap->user.groups.
493 (setegid32): Call cygheap->user.groups.update_pgrp.
494 * grp.cc (setgroups): Create.
495 (setgroups32): Create.
496 * uinfo.cc (internal_getlogin): Initialize and update
498 * cygwin.din: Add setgroups and setgroups32.
500 2002-07-28 Christopher Faylor <cgf@redhat.com>
502 * fhandler_console.cc (fhandler_console::read): Use appropriate
504 * select.cc (peek_console): Ditto.
505 * fhandler_termios.cc (fhandler_termios::bg_check): Send "stopped"
506 signal to entire process group as dictated by SUSv3.
507 * termios.cc (tcsetattr): Detect when stopped signal sent and force a
508 stop before setting anything.
510 2002-07-26 Christopher Faylor <cgf@redhat.com>
512 * include/cygwin/version.h: Bump API version to indicate that ntsec is
515 2002-07-26 Conrad Scott <conrad.scott@dsl.pipex.com>
517 * fhandler_registry.cc (fhandler_registry::close): Return any error
518 result to the caller.
519 * syscalls.cc (_close): Return result of fhandler::close to the caller.
521 2002-07-25 Christopher Faylor <cgf@redhat.com>
523 * security.cc (allow_ntsec): Default to on.
524 (allow_smbntsec): Default to off.
526 2002-07-24 David MacMahon <davidm@smartsc.com>
528 * times.cc (to_time_t): Always round time_t down to nearest second.
530 2002-07-25 Egor Duda <deo@logos-m.ru>
532 * Makefile.in: Check if API version is updated when exports are
533 changed and stop if not so.
535 2002-07-24 Egor Duda <deo@logos-m.ru>
537 * include/cygwin/version.h: Bump minor API version.
539 2002-07-24 Corinna Vinschen <corinna@vinschen.de>
541 * fhandler_serial.cc: Change 'must_init_serial_line capability'
542 to 'supports_reading_modem_output_lines' throughout (negated meaning).
546 2002-07-23 Nicholas Wourms <nwourms@netscape.net>
548 * cygwin.din (fcloseall): Add symbol for export.
549 (fcloseall_r): Ditto.
551 2002-07-24 Christopher Faylor <cgf@redhat.com>
553 * path.cc (path_conv::check): Always set fileattr when component == 0.
554 (readlink): Use path_conv method rather than field.
555 * fhandler_disk_file.cc (fhandler_disk_file::fstat_helper): Ditto,
557 * path.h (path_conv): Make fileattr private.
558 * exceptions.cc (try_to_debug): Default to idle priority when looping.
560 2002-07-23 Corinna Vinschen <corinna@vinschen.de>
562 * fhandler_serial.cc: Use must_init_serial_line capability throughout.
563 * wincap.cc: Set flag must_init_serial_line appropriately.
564 * wincap.h: Add flag must_init_serial_line.
566 2002-07-23 Corinna Vinschen <corinna@vinschen.de>
568 * security.cc (get_group_sidlist): Create group list from /etc files
569 even if DC is available but access fails.
571 2002-07-22 Christopher Faylor <cgf@redhat.com>
573 * fhandler_serial.cc: Fix formatting problems introduced by below
576 2002-07-22 Jacek Trzcinski <jacek@certum.pl>
578 * fhandler.h (class fhandler_serial): Add new members of the class -
579 rts,dtr and method ioctl(). Variables rts and dtr important for Win 9x
581 * fhandler_serial.cc (fhandler_serial::open): Add initial setting of
582 dtr and rts. Important for Win 9x only.
583 (fhandler_serial::ioctl): New function. Implements commands TIOCMGET,
584 TIOCMSET and TIOCINQ.
585 (fhandler_serial::tcflush): Fix found error.
586 (fhandler_serial::tcsetattr): Add settings of rts and dtr. Important
588 * termios.h: Add new defines as a support for ioctl() function on
591 2002-07-20 Christopher Faylor <cgf@redhat.com>
593 * autoload.cc (LoadDLLprime): Add jmp call to allow streamlining of
595 (doit): Avoid use of cx register. Just change one word to avoid races.
597 2002-07-18 Pierre Humblet <pierre.humblet@ieee.org>
599 * security.cc (get_unix_group_sidlist): Create.
600 (get_supplementary_group_sidlist): Evolve into get_unix_group_sidlist.
601 (get_user_local_groups): Add check for duplicates.
602 (get_user_primary_group): Suppress.
603 (get_group_sidlist): Silently ignore PDC unavailability.
604 Call get_unix_group_sidlist() before get_user_local_groups().
605 Remove call to get_supplementary_group_sidlist(). Never call
606 get_user_primary_group() as the passwd group is always included.
607 Add well_known_authenticated_users_sid in only one statement.
609 2002-07-19 Christopher Faylor <cgf@redhat.com>
611 * fhandler_serial.cc (fhandler_serial::tcflush): Fix typo.
613 2002-07-15 Corinna Vinschen <corinna@vinschen.de>
615 * security.cc (get_group_sidlist): Fix formatting.
617 2002-07-14 Christopher Faylor <cgf@redhat.com>
619 * dcrt0.cc (initial_env): Force path and CYGWIN_DEBUG contents to lower
621 * exceptions.cc (error_start_init): Use the name derived from
622 GetModuleName rather than myself->progname.
624 2002-07-14 Christopher Faylor <cgf@redhat.com>
626 * dcrt0.cc (dll_crt0_1): Move debug_init call back to here. Avoid a
628 * shared.cc (memory_init): Remove debug_init call.
629 * debug.h (handle_list): Change "clexec" to "inherited".
630 * debug.cc: Remove a spurious declaration.
631 (setclexec): Conditionalize away since it is currently unused.
632 (add_handle): Use inherited field rather than clexec.
633 (debug_fixup_after_fork_exec): Ditto. Move debugging output to
635 (delete_handle): Add debugging output.
636 * fhandler.cc (fhandler_base::set_inheritance): Don't bother setting
637 inheritance in debugging table since the handle was never protected
639 (fhandler_base::fork_fixup): Ditto.
641 * exceptions.cc (debugger_command): Revert.
643 2002-07-14 Conrad Scott <conrad.scott@dsl.pipex.com>
645 * debug.cc (clexec): Add missing `hl = hl->next'.
647 2002-07-14 Christopher Faylor <cgf@redhat.com>
649 * Makefile.in (cygrun.exe): Add a -lcygwin on the end.
651 2002-07-14 Christopher Faylor <cgf@redhat.com>
653 * Makefile.in (cygserver.exe): Add -lstdc++.
654 (cygrun.exe): Move -lgcc last.
656 2002-07-13 Christopher Faylor <cgf@redhat.com>
658 * dcrt0.cc (dll_crt0_1): Delay closing of some handles until cygheap
660 (break_here): New function, for debugging.
661 (initial_env): Add program name to "Sleeping" message. Implement new
662 "CYGWIN_DEBUG" environment variable option.
663 * exceptions.cc (debugger_command): Add argument to dumper call.
664 * strace.cc (strace::hello): Use winpid if cygwin pid is unavailable.
665 (strace::vsprntf): Ditto.
667 2002-07-13 Christopher Faylor <cgf@redhat.com>
669 * debug.h (handle_list): Move here from debug.cc. Add "inherit" flag
671 * cygheap.cc (init_cheap): Move cygheap_max calculation to _csbrk.
672 (_csbrk): Reorganize to not assume first allocation is <= 1 page.
673 (cygheap_setup_for_child): Mark protected handle as inheritable.
674 * cygheap.h (cygheap_debug): New struct.
675 (init_cygheap): Add new structure when debugging.
676 * dcrt0.cc (dll_crt0_1): Remove call to debug_init. Close ppid_handle
677 here, if appropriate. Don't protect subproc_ready, since it is already
678 protected in the parent. Call memory_init prior to ProtectHandle to
679 ensure that cygheap is set up. Call debug_fixup_after_fork_exec when
681 (_dll_crt0): Don't close ppid_handle here.
682 * debug.cc: Use cygheap debug structure rather than static elements
684 (add_handle): Don't issue a warning if attempt to protect handle in
685 exactly the same way from exactly the same place. Add pid info to
686 warning output. Accept additional argument controlling whether handle
687 is to be inherited. Add pid to stored information.
688 (debug_fixup_after_fork_exec): Renamed from debug_fixup_after_fork.
689 Reorganize to avoid erroneously skipping handles.
690 (mark_closed): Add pid info to warning output.
691 (setclexec): Rename from setclexec_pid.
692 * fhandler.cc (fhandler_base::get_default_fmode): Minor reorg.
693 (fhandler_base::fstat): Add debugging output.
694 (fhandler_base::set_inheritance): Call setclexec rather than
696 (fhandler_base::fork_fixup): Ditto.
697 * fhandler_console.cc (get_tty_stuff): Mark protected handle as
699 * fhandler_tty.cc (fhandler_tty_slave::open): Ditto.
700 * tty.cc (tty::make_pipes): Ditto.
701 (tty::common_init): Ditto.
702 * fork.cc (fork_parent): Ditto.
703 (fork_child): Close protected handles with correct name. Remove
704 debug_fixup_after_fork call.
705 * fhandler_socket.cc (fhandler_socket::create_secret_event): Mark
706 protected handle as inheritable/non-inheritable, as appropriate.
707 * shared.cc (memory_init): Mark protected handle as inheritable.
708 Call debug_init here.
709 * sigproc.cc (wait_sig): Close protected handle with correct name.
710 * spawn.cc (spawn_guts): Rename spr to subproc_ready and mark it as
713 * exceptions.cc (debugger_command): Try to run dumper.exe, if found.
715 * syscalls.cc (fstat64): Don't follow symlinks for path_conv lookup
716 since path is already resolved.
718 2002-07-12 Christopher Faylor <cgf@redhat.com>
720 * cygwin.din: Change erroneous entries.
722 2002-07-11 Pavel Tsekov <ptsekov@gmx.net>
724 * fhandler_disk_file.cc (fhandler_disk_file::open): Don't
725 move the file pointer to the end of file if O_APPEND is
726 specified in the open flags.
728 2002-07-09 Christopher Faylor <cgf@redhat.com>
730 * debug.cc: Avoid explicit zeroing of globals.
731 (lock_debug): Make locker a static member. Avoid unlocking when
732 already unlocked (from Conrad Scott).
733 (debug_init): Initialize lock_debug::locker here.
734 * fork.cc (fork_child): Fix up fdtab earlier to avoid some (but not
735 all) confusion with close-on-exec craziness.
737 2002-07-05 Corinna Vinschen <corinna@vinschen.de>
739 * fhandler.h (fhandler_socket::is_unconnected): Constify.
740 (fhandler_socket::is_connect_pending): Ditto.
741 (fhandler_socket::is_connected): Ditto.
742 (fhandler_socket::set_connect_state): New method.
743 (struct select_record): Add member `except_on_write'.
744 (select_record::select_record): Initialize all bool values to `false'.
745 * fhandler_socket.cc: Use set_connect_state() method throughout.
746 (fhandler_socket::connect): Set state always to connected if connection
748 * net.cc (cygwin_getsockopt): Revert erroneous previous patch.
749 * select.cc (set_bits): Check for `except_on_write'. Set fd in
750 write_fds if set. Set connect state to connected if fd has been
751 returned by WINSOCK_SELECT.
752 (peek_socket): Check for `except_on_write'.
753 (start_thread_socket): Ditto.
754 (fhandler_socket::select_write): Don't set `write_ready' if connect
755 is pending. Set `except_on_write' if connect is pending.
757 2002-07-05 Christopher Faylor <cgf@redhat.com>
759 * ntdll.h (_SYSTEM_PROCESSOR_TIMES): Force eight byte alignment.
760 (_SYSTEM_TIME_OF_DAY_INFORMATION): Ditto.
762 * path.cc (suffix_scan::has): Reorganize to eliminate double scanning
763 for for .exe (in the typical case).
765 2002-07-05 Corinna Vinschen <corinna@vinschen.de>
767 * fhandler.h (UNCONNECTED): New define.
768 (CONNECT_PENDING): Ditto.
770 (class fhandler_socket): Add member `had_connect_or_listen'.
771 Add member functions `is_unconnected', `is_connect_pending' and
773 * fhandler_socket.cc (fhandler_socket::connect): Set member
774 `had_connect_or_listen' according to return code of WinSock
776 (fhandler_socket::listen): Ditto.
777 * net.cc (cygwin_getsockopt): Modify SO_ERROR return value in
778 case of socket with pending connect().
779 * select.cc (peek_socket): Only add socket to matching fd_set
780 if it's not "ready". Call WINSOCK_SELECT only if at least one
781 socket is in one of the fd_sets.
782 (start_thread_socket): Only add socket to matching fd_set
784 (fhandler_socket::select_write): Set write_ready to true also
785 if socket isn't connected or listening.
787 2002-07-04 Corinna Vinschen <corinna@vinschen.de>
789 * fhandler_socket.cc (fhandler_socket::set_sun_path): Don't free
790 memory here. Allow NULL parameter.
792 2002-07-04 Corinna Vinschen <corinna@vinschen.de>
794 * fhandler_socket.cc (fhandler_socket::dup): Add missing copy operation
797 2002-07-03 Christopher Faylor <cgf@redhat.com>
799 * include/cygwin/version.h: Bump DLL minor number.
801 2002-07-03 Christopher Faylor <cgf@redhat.com>
803 * include/sys/statfs.h: New header file.
805 2002-07-03 Christopher Faylor <cgf@redhat.com>
807 * dtable.cc (cygwin_attach_handle_to_fd): Default to implicit bin mode
809 * fhandler.cc (fhandler_base::init): Make bin argument a guarantee
810 rather than a suggestion.
811 * path.cc (path_conv::check): Load flag returned from
812 cygwin_conv_to_win32_path into path_flags.
814 2002-07-03 Conrad Scott <conrad.scott@dsl.pipex.com>
816 * tty.cc (tty::common_init): Reverse logic of cygserver check in
817 call to SetKernelObjectSecurity.
819 2002-07-03 Thomas Pfaff <tpfaff@gmx.net>
821 * autoload.cc (WSAEventSelect): Define new autoload function.
822 (WSAEnumNetworkEvents): Ditto.
823 * fhandler_socket.cc (fhandler_socket::accept): If socket is
824 in blocking mode wait for incoming connection and signal.
826 2002-07-02 Christopher Faylor <cgf@redhat.com>
828 * cygheap.cc (init_cheap): Rearrange error message.
829 (cygheap_fixup_in_child): Ditto.
830 * dtable.cc: Remove if 0'ed code.
831 * fhandler_dsp.cc (fhandler_dev_dsp::open): Force binmode.
832 * sec_helper.cc (cygsid::get_id): Use system_printf for error message.
833 * tty.cc (tty::common_init): Ditto.
835 2002-07-02 Christopher Faylor <cgf@redhat.com>
837 * net.cc (cygwin_getpeername): Defend against NULL pointer dereference.
839 2002-07-02 Egor Duda <deo@logos-m.ru>
841 * include/cygwin/version.h: Bump API minor version.
843 2002-07-01 Pierre Humblet <pierre.humblet@ieee.org>
845 * security.cc (get_logon_server): Interpret a zero length
846 domain as the local domain.
847 (get_group_sidlist): Add authenticated users SID to SYSTEM's group
848 list instead of SYSTEM itself.
849 (verify_token): Accept the primary group sid if it equals
852 2002-07-02 Corinna Vinschen <corinna@vinschen.de>
854 * cygwin.din (__fpclassifyd): Add symbol.
855 (__fpclassifyf): Ditto.
859 2002-07-02 Corinna Vinschen <corinna@vinschen.de>
861 * security.h (DONT_INHERIT): Eliminate definition.
862 (INHERIT_ALL): Ditto.
863 (INHERIT_ONLY): Ditto.
864 * sec_acl.cc: Use appropriate defines from accctrl.h instead of the
866 * security.cc: Ditto.
868 2002-07-01 Pierre Humblet <pierre.humblet@ieee.org>
870 * syscalls.c (seteuid32): Return immediately if the program is not
871 impersonated and both uid and gid are original.
872 (setegid32): Return immediately if the new gid is the current egid.
874 2002-07-01 Christopher Faylor <cgf@redhat.com>
876 * syscalls.cc (seteuid32): Fix incorrect placement of Pierre's patch
879 2002-07-01 Christopher Faylor <cgf@redhat.com>
881 * syscalls.cc (seteuid32): Fix incorrect use of system_printf.
883 2002-07-02 Christopher January <chris@atomice.net>
885 * autoload.cc (GetSecurityInfo): Define new autoload function.
886 (RegQueryInfoKeyA): Ditto.
887 * fhandler.h (fhandler_virtual::fill_filebuf): Change return type to
889 (fhandler_proc::fill_filebuf): Ditto.
890 (fhandler_registry::fill_filebuf): Ditto.
891 (fhandler_process::fill_filebuf): Ditto.
892 (fhandler_registry::value_name): Add new member.
893 (fhandler_registry::close): Add new method.
894 (fhandler_process::p): Remove member.
895 * fhandler_proc.cc (fhandler_proc::open): Add set_nohandle after
896 calling superclass method. Check return value of fill_filebuf.
897 (fhandler_proc::fill_filebuf): Change return type to bool. Add return
899 * fhandler_process.cc (fhandler_process::open): Add set_nohandle after
900 calling superclass method. Remove references to p. Check return value
902 (fhandler_process::fill_filebuf): Change return type to bool. Don't
903 use dereference operator on p. Add return statement.
904 (fhandler_process::format_process_stat): Fix typo.
905 * fhandler_registry.cc: Add static open_key declaration.
906 (fhandler_registry::exists): Assume path is already normalised. Try
907 opening the path as a key in its own right first, before reverting to
908 enumerating subkeys and values of the parent key.
909 (fhandler_registry::fstat): Add additional code to return more relevant
910 information about the registry key/value.
911 (fhandler_registry::readdir): Explicitly set desired access when
912 opening registry key. Remove output of buf from debug_printf format
914 (fhandler_registry::open): Use set_io_handle to store registry key
915 handle. Set value_name member. Move code to read a value from the
916 registry to fill_filebuf. Add call to fill_filebuf.
917 (fhandler_registry::close): New method.
918 (fhandler_registry::fill_filebuf): Change return type to bool. Add
919 code to read a value from registry.
920 (fhandler_registry::open_key): Make function static. Use KEY_READ as
921 desired access unless this is the last path component. Check the
922 return value of RegOpenKeyEx for an error instead of hKey.
923 * fhandler_virtual.cc (fhandler_virtual::lseek): Check the return value
925 (fhandler_virtual::open): Remove call to set_nohandle.
926 (fhandler_virtual::fill_filebuf): Change return type to bool. Add
928 * security.cc (get_nt_object_attribute): New function.
929 (get_object_attribute): New function.
930 * security.h (get_object_attribute): New function declaration.
932 2002-07-01 Pierre Humblet <pierre.humblet@ieee.org>
934 * syscalls.c (seteuid32): Do not return an error when the token cannot
935 be created only because of a problem with the gid.
937 2002-07-01 Christopher Faylor <cgf@redhat.com>
939 * fhandler_clipboard.c (fhandler_dev_clipboard::open): Force text mode.
940 * fhandler_console.cc (fhandler_console::open): *Really* force binary
941 mode rather than make it optional.
942 * fhandler_proc.cc (fhandler_proc::open): Ditto.
943 * fhandler_process.cc (fhandler_process::open): Ditto.
944 * fhandler_random.cc (fhandler_dev_random::fhandler_dev_random): Ditto.
945 * fhandler_raw.cc (fhandler_dev_raw::open): Ditto.
946 * fhandler_registry.cc (fhandler_registry::open): Ditto.
947 * fhandler_tty.cc (fhandler_tty_slave::open): Ditto.
948 * fhandler_virtual.cc (fhandler_virtual::open): Ditto.
949 * fhandler_windows.cc (fhandler_windows::open): Ditto.
950 * fhandler_zero.cc (fhandler_dev_zero::open): Ditto.
951 * net.cc (fdsock): Ditto.
952 * path.cc (set_flags): Add more debugging.
954 2002-07-01 Christopher Faylor <cgf@redhat.com>
956 * debug.cc (threads): Avoid initialization.
957 * uinfo.cc (cygheap_user::ontherange): (from Corinna Vinschen) Actually
958 make below changes work.
960 2002-07-01 Christopher Faylor <cgf@redhat.com>
962 * uinfo.cc (cygheap_user::ontherange): Make cygwin root the last resort
963 for HOMEPATH/HOMEDRIVE for consistency with HOME.
965 2002-07-01 Corinna Vinschen <corinna@vinschen.de>
967 * shared.cc (sec_none): Move to sec_helper.cc.
968 (sec_none_nih): Ditto.
970 (sec_all_nih): Ditto.
971 (get_null_sd): Ditto.
974 * sec_helper.cc (sec_none): Move from shared.cc to here.
975 (sec_none_nih): Ditto.
977 (sec_all_nih): Ditto.
978 (get_null_sd): Ditto.
982 2002-06-30 Christopher Faylor <cgf@redhat.com>
984 * uinfo.cc (cygheap_user::ontherange): Potentially set HOME from
985 existing homepath and homedrive cygheap_user fields (not currently used
986 yet). Set HOME to / if no other alternative.
987 (cygheap_user::test_uid): Simplify.
989 2002-06-30 Christopher Faylor <cgf@redhat.com>
991 * environ.cc (parse_options): Use setenv to potentially replace CYGWIN
992 value on export. Fixes broken behavior since November 2000 changes.
993 (regopt): Return indication of whether or not something has been parsed
995 (environ_init): Only attempt to export CYGWIN variable when values were
996 set from the registry. It is exported automatically otherwise.
998 2002-06-30 Christopher Faylor <cgf@redhat.com>
1000 * fhandler.h (fhandler_process::pid): New field.
1001 (fhandler_process::fstat): Remove unneeded array. Set pid element.
1002 (fhandler_process::open): Ditto.
1003 (fhandler_process::fill_filebuf): Handle case where 'p' field is NULL.
1005 2002-06-30 Christopher Faylor <cgf@redhat.com>
1007 * fhandler.h (fhandler_process::p): New field.
1008 (fhandler_process:fill_filebuf): Revert to same definition as virtual
1010 (fhandler_process::open): Fill out p field rather than passing as an
1012 (fhandler_process::fill_filebuf): Use p pointer rather than argument.
1014 2002-06-29 Pierre Humblet <pierre.humblet@ieee.org>
1016 * security.cc (extract_nt_dom_user): Check for all buffer overflows.
1017 Call LookupAccountSid after trying to get domain & user from passwd.
1018 (get_group_sidlist): Obtain the domain and user by calling
1019 extract_nt_dom_user instead of LookupAccountSid.
1021 2002-06-29 Christopher Faylor <cgf@redhat.com>
1023 * uinfo.cc (cygheap_user::test_uid): Use standard issetuid test.
1025 2002-06-29 Christopher Faylor <cgf@redhat.com>
1027 * autoload.cc (NetGetDCName): Change to make this an optional load
1029 * cygheap.h (cygheap_user::logsrv): Return NULL when operation fails.
1030 (cygheap_user::winname): Ditto.
1031 (cygheap_user::domain): Ditto.
1032 * uinfo.cc (cygheap_user::env_logsrv): Save results in temp variable.
1033 (cygheap_user::env_userprofile): Ditto.
1035 2002-06-29 Christopher Faylor <cgf@redhat.com>
1037 * environ.cc (spenv::retrieve): Detect return of env_dontadd from
1038 cygheap_user methods.
1039 (build_env): Avoid incrementing environment pointer if not actually
1040 adding to the environment. That could result in garbage in the
1041 environment table. Be more defensive when reallocing envblock.
1043 2002-06-29 Christopher Faylor <cgf@redhat.com>
1045 * uinfo.cc (cygheap_user::test_uid): Return NULL or further tests are
1047 (cygheap_user::env_domain): Recalculate if name is missing.
1049 2002-06-29 Christopher Faylor <cgf@redhat.com>
1051 * environ.cc (spenv::from_cygheap): Still need to take setuid into
1054 2002-06-28 Christopher Faylor <cgf@redhat.com>
1056 * uinfo.cc (cygheap_user::env_logsrv): Return "almost_null" in case
1057 where no domain or username is "SYSTEM".
1059 2002-06-28 Christopher Faylor <cgf@redhat.com>
1061 * cygheap.h (cygheap_user): Reorg to accommodate environment caching.
1062 (cygheap_user::logsrv): New method.
1063 (cygheap_user::winname): Ditto.
1064 (cygheap_user::domain): Ditto.
1065 (cygheap_user::test_uid): Ditto.
1066 * cygheap.cc (cygheap_user::set_name): Reflect name "pwinname" name
1068 * environ.cc (getwinenveq): New function.
1069 (penv::from_cygheap): penv::from_cygheap): Change arguments.
1070 (spenv::retrieve): Ditto for call. Use getwinenveq to retrieve info
1071 from environment. Always return value from cygwin environment, if it
1073 * environ.h (getwinenveq): Declare.
1074 * uinfo.cc (cygheap_user::ontherange): Use logsrv() rather than
1076 (cygheap_user::test_uid): Define new method.
1077 (cygheap_user::env_logsrv): Accept environment arguments. Use test_uid
1079 (cygheap_user::env_domain): Ditto.
1080 (cygheap_user::env_userprofile): Ditto.
1081 (cygheap_user::env_homepath): Ditto.
1082 (cygheap_user::env_homedrive): Ditto.
1083 (cygheap_user::env_name): Ditto.
1085 2002-06-27 Christopher Faylor <cgf@redhat.com>
1087 * cygheap.cc (cfree_and_set): New function.
1088 (cygheap_user::set_name): Use cfree_and_set to reset members.
1089 * cygheap.h (cygheap_user): Delete static members.
1090 (cygheap_user::puserprof): New member.
1091 (cfree_and_set): Declare.
1092 * dcrt0.cc (almost_null): Define.
1093 * environ.cc (env_dontadd): Redefine as "almost_null".
1094 * winsup.h (almost_null): Declare.
1095 * syscalls.cc (cfree_and_set): Remove unused variable.
1096 * uinfo.cc (cygheap_user::homepath_env_buf): Eliminate.
1097 (cygheap_user::homedrive_env_buf): Ditto.
1098 (cygheap_user::userprofile_env_buf): Ditto.
1099 (cygheap_user::ontherange): YA change to try to preserve existing
1100 HOMEPATH and HOMEDRIVE. Return almost_null values when variables
1101 should not actually exist.
1102 (cygheap_user::env_logsrv): Ditto.
1103 (cygheap_user::env_domain): Ditto.
1104 (cygheap_user::env_userprofile): Ditto.
1106 2002-06-27 Corinna Vinschen <corinna@vinschen.de>
1108 * dcrt0.cc (dll_crt0_1): Let __progname point to the applications
1109 basename. Move eliminating ".exe" suffix from argv[0] so that it
1110 always also affects __progname.
1112 2002-06-27 Thomas Pfaff <tpfaff@gmx.net>
1114 * thread.cc (pthread::create): Add trace printf to get CreateThread
1117 2002-06-27 Corinna Vinschen <corinna@vinschen.de>
1119 * mmap.cc (list::match): Check using pagesize aligned size.
1121 2002-06-26 Christopher Faylor <cgf@redhat.com>
1123 * fhandler_disk_file.cc (fhandler_disk_file::fstat_by_name): Force
1124 FindFirstFile on first file of directory when asking for x:\ .
1126 2002-06-26 Christopher Faylor <cgf@redhat.com>
1128 * cygheap.cc (cygheap_user::set_name): Correct thinko in below change.
1130 2002-06-26 Christopher Faylor <cgf@redhat.com>
1132 * cygheap.cc (cygheap_user::set_name): Avoid clearing things when just
1133 setting name to itself or during first time initialization.
1135 * environ.cc (check_case_init): Make case insensitive.
1137 2002-06-26 Corinna Vinschen <corinna@vinschen.de>
1139 * fhandler.h (fhandler_socket::bind): Add method definition.
1140 (fhandler_socket::connect): Ditto.
1141 (fhandler_socket::listen): Ditto.
1142 (fhandler_socket::accept): Ditto.
1143 (fhandler_socket::getsockname): Ditto.
1144 (fhandler_socket::getpeername): Ditto.
1145 (fhandler_socket::recvfrom): Ditto.
1146 (fhandler_socket::recvmsg): Ditto.
1147 (fhandler_socket::sendto): Ditto.
1148 (fhandler_socket::sendmsg): Ditto.
1149 (fhandler_socket::shutdown): Ditto.
1150 * fhandler_socket.cc (get_inet_addr): Move here from net.cc.
1151 (fhandler_socket::bind): New method.
1152 (fhandler_socket::connect): Ditto.
1153 (fhandler_socket::listen): Ditto.
1154 (fhandler_socket::accept): Ditto.
1155 (fhandler_socket::getsockname): Ditto.
1156 (fhandler_socket::getpeername): Ditto.
1157 (fhandler_socket::recvfrom): Ditto.
1158 (fhandler_socket::recvmsg): Ditto.
1159 (fhandler_socket::sendto): Ditto.
1160 (fhandler_socket::sendmsg): Ditto.
1161 (fhandler_socket::shutdown): Ditto.
1162 * net.cc: Various formatting cleanups throughout.
1163 (get_inet_addr): Move to fhandler_socket.cc.
1164 (cygwin_bind): Move base functionality to appropriate fhandler_socket
1166 (cygwin_connect): Ditto.
1167 (cygwin_listen): Ditto.
1168 (cygwin_accept): Ditto.
1169 (cygwin_getsockname): Ditto.
1170 (cygwin_getpeername): Ditto.
1171 (cygwin_recvfrom): Ditto.
1172 (cygwin_recvmsg): Ditto.
1173 (cygwin_sendto): Ditto.
1174 (cygwin_sendmsg): Ditto.
1175 (cygwin_shutdown): Ditto.
1177 2002-06-26 Corinna Vinschen <corinna@vinschen.de>
1179 * pwdgrp.h (pwdgrp_read::~pwdgrp_read): Avoid compiler warning.
1181 2002-06-26 Christopher Faylor <cgf@redhat.com>
1183 * dcrt0.cc (_dcrt0): Be more defensive when reserved block is used and
1184 it's not cygwin info.
1186 2002-06-26 Christopher Faylor <cgf@redhat.com>
1188 * autoload (noload): Avoid clobbering bx register.
1190 * environ.cc (codepage_init): Use case insensitive match.
1192 * fhandler_console.cc (cp_get_internal): Delete.
1193 (con_to_str): Use get_cp to derive code page.
1194 (str_to_con): Ditto.
1195 * miscfuncs.cc (get_cp): New function.
1196 (sys_wcstombs): New function. Converted from macro.
1197 (sys_mbstowcs): Ditto.
1198 * winsup.h: Reflect above changes.
1200 2002-06-26 Christopher Faylor <cgf@redhat.com>
1202 * winsup.h: Minor cleanup.
1203 * path.h (path_conv::[]): New operator.
1204 * syscalls.cc (_link): Use path_conv operators rather than methods,
1205 where appropriate. Minor white space cleanup.
1207 2002-06-26 Christopher Faylor <cgf@redhat.com>
1209 * include/cygwin/version.h: Bump DLL minor number.
1211 2002-06-25 Thomas Pfaff <tpfaff@gmx.net>
1213 * include/pthread.h (PTHREAD_CANCELED): Define a reasonable value.
1214 * pthread.cc (pthread_exit): Call method instead of function.
1215 (pthread_setcancelstate): Ditto.
1216 (pthread_setcanceltype): Ditto.
1217 (pthread_testcancel): Ditto.
1218 * thread.h (pthread::cancel_event): New member.
1219 (__pthread_cancel_self): New prototype.
1220 (pthread::exit): New Method.
1221 (pthread::cancel): Ditto.
1222 (pthread::testcancel): Ditto.
1223 (pthread::cancel_self): Ditto.
1224 (pthread::static_cancel_self): Ditto.
1225 (pthread::setcancelstate): Ditto.
1226 (pthread::setcanceltype): Ditto.
1227 (__pthread_cancel): Give c++ linkage.
1228 (__pthread_exit): Remove.
1229 (__pthread_setcancelstate): Ditto.
1230 (__pthread_setcanceltype): Ditto.
1231 (__pthread_testcancel): Ditto.
1232 * thread.cc (pthread::pthread): Inititialize cancel_event.
1233 (pthread::~pthread): Close cancel_event if needed.
1234 (pthread::create): Create cancel_event.
1235 (pthread::exit): New method. Replacement for __pthread_exit.
1236 (pthread::cancel): New method.
1237 (pthread::testcancel): Ditto.
1238 (pthread::static_cancel_self); New static method.
1239 (pthread::setcancelstate): New method. Replacement for
1240 __pthread_setcancelstate.
1241 (pthread::setcanceltype): New method. Replacement for
1242 __pthread_setcanceltype.
1243 (pthread::pop_cleanup_handler): Add lock for async cancel safe
1245 (pthread::thread_init_wrapper): Change __pthread_exit to
1247 (__pthread_cancel): Call method thread->cancel().
1248 (__pthread_exit): Remove.
1249 (__pthread_setcancelstate): Ditto.
1250 (__pthread_setcanceltype): Ditto.
1251 (__pthread_testcancel): Ditto.
1253 2002-06-25 Christopher Faylor <cgf@redhat.com>
1255 * dcrt0.cc (sm): Make NO_COPY.
1257 2002-06-25 Corinna Vinschen <corinna@vinschen.de>
1259 * syscalls.cc (chown): Convert uid to 32 bit.
1263 2002-06-24 Christopher Faylor <cgf@redhat.com>
1265 * dtable.cc (dtable::find_unused_handle): Avoid coercion.
1267 2002-06-24 Christopher Faylor <cgf@redhat.com>
1269 * dtable.cc (fhandler_base::dup2): Cleanup. Ensure that lock is turned
1270 off in error condition.
1272 2002-06-24 Corinna Vinschen <corinna@vinschen.de>
1274 * uinfo.cc (internal_getlogin): Set myself->uid and myself->gid instead
1275 of user.real_uid and user.real_gid.
1276 (uinfo_init): Evaluate orig_uid and real_uid from myself->uid. Ditto
1279 2002-06-23 Pierre Humblet <pierre.humblet@ieee.org>
1281 * security.cc (get_group_sidlist): Add pw argument and use pw->pw_name
1282 in call to get_supplementary_group_sidlist.
1283 (create_token): Add pw argument and use it in call to
1285 * security.h: Add pw argument in declaration of create_token.
1286 * syscalls.cc (seteuid32): Add pw argument in call to create_token.
1288 2002-06-23 Conrad Scott <conrad.scott@dsl.pipex.com>
1290 * fhandler.cc (fhandler_base::fstat): Set S_IFIFO for pipes.
1291 * fhandler_socket.cc (fhandler_socket.cc::fstat): Set S_IFSOCK.
1293 2002-06-23 Christopher Faylor <cgf@redhat.com>
1295 * lib/_cygwin_S_IEXEC.cc: Remove obsolete file.
1297 2002-06-23 Christopher Faylor <cgf@redhat.com>
1299 Use cygwin_{shm,ipc}.h instead of /sys/{shm,ipc}.h throughout.
1300 * sys/ipc.h: Remove.
1301 * sys/shm.h: Remove.
1302 * cygwin_ipc.h: New file.
1303 * cygwin_shm.h: New file.
1305 2002-06-23 Christopher Faylor <cgf@redhat.com>
1307 * cygwin.sc: Add recent changes from ld sources.
1309 2002-06-23 Conrad Scott <conrad.scott@dsl.pipex.com>
1311 * winsup.h: Move #ifdef EXPCGF code into "winbase.h".
1312 * winbase.h: #ifdef EXPCGF code moved here from "winsup.h".
1314 2002-06-12 Thomas Pfaff <tpfaff@gmx.net>
1316 * thread.h (pthread::cleanup_stack): Rename cleanup_handlers to
1318 * thread.cc (pthread::pthread): Ditto.
1319 (pthread::create): Fix mutex verification.
1320 (pthread::push_cleanup_handler): Renam cleanup_handlers to
1321 cleanup_stack. Remvoe Mutex calls, use InterlockedExchangePointer
1323 (pthread::pop_cleanup_handler): Rename cleanup_handlers to
1325 (pthread::pop_all_cleanup_handlers): Ditto.
1326 (__pthread_once): Check state first and return if already done.
1327 (__pthread_join): Revert DEADLOCK test to __pthread_equal call.
1328 (__pthread_detach): Unlock mutex before deletion.
1330 2002-06-21 Christopher Faylor <cgf@redhat.com>
1332 * Makefile.in (cygrun.exe): Move -lgcc where it will do some good.
1334 2002-06-21 Corinna Vinschen <corinna@vinschen.de>
1336 * syscalls.cc (stat64_to_stat32): Correctly evaluate st_rdev.
1337 (fstat64): Set st_rdev to same value as st_dev.
1338 (stat_worker): Ditto.
1340 2002-06-21 Corinna Vinschen <corinna@vinschen.de>
1342 * security.cc (alloc_sd): Carefully check owner_sid again after trying
1345 2002-06-21 Corinna Vinschen <corinna@vinschen.de>
1347 * security.cc (alloc_sd): Remove unnecessary retrieval of owner name.
1348 Check uid for current user first and use SIDs from cygheap if so.
1349 Set errno to EINVAL if user SID isn't retrievable. Just print user SID
1351 Don't bail out if group SID isn't retrievable. Change debug output
1354 2002-06-21 Christopher Faylor <cgf@redhat.com>
1356 * errno.cc: Change text description for EBADF throughout.
1358 2002-06-20 Pierre Humblet <pierre.humblet@ieee.org>
1360 * uinfo.cc (cygheap_user::ontherange): Use env_name for NetUserGetInfo.
1361 (cygheap_user::env_logsrv): Verify env_domain is valid.
1362 * environ.cc: Include child_info.h and keep spenvs[] sorted.
1363 (environ_init): Check child_proc_info instead of myself->ppid_handle.
1365 2002-06-19 Christopher Faylor <cgf@redhat.com>
1367 * fhandler.cc (fhandler_base::set_flags): Change priority of "linked
1368 in" default binmode setting so that it has priority over optional
1371 2002-06-19 Christopher Faylor <cgf@redhat.com>
1373 Use hMainProc where appropriate, throughout.
1374 * environ.cc (spenv::retrieve): Add debugging statements.
1376 * pinfo.cc (set_myself): Don't call strace.hello if already stracing.
1377 * strace.cc (strace): Move NO_COPY keyword so that it will actually
1380 2002-06-19 Corinna Vinschen <corinna@vinschen.de>
1382 * uinfo.cc (cygheap_user::ontherange): Call NetUserGetInfo() only with
1383 non-NULL logserver parameter.
1385 2002-06-16 Christopher Faylor <cgf@redhat.com>
1387 * cygheap.h (cygheap_user::issetuid): New method.
1388 * dtable.cc (dtable::vfork_child_dup): Use new method to determine if
1389 we are in "setuid mode."
1390 * fork.cc (fork_parent): Ditto.
1391 * spawn.cc (spawn_guts): Ditto.
1392 * syscalls.cc (seteuid32): Ditto.
1394 * environ.cc (spenv::retrieve): (Suggested by Pierre Humblet) Do
1395 potential recalculation of cygheap_user stuff when in setuid mode.
1396 Return special value when environment variable should be calculated but
1398 (build_env): Don't add retrieved value to dstp if it is 'dont_add'.
1400 2002-06-16 Christopher Faylor <cgf@redhat.com>
1402 Changes suggested by Pierre Humblet.
1403 * environ.cc (NL): New macro.
1404 (conv_envvars): Use NL macro to fill in name and namelen.
1405 (spenv::namelen): New field.
1406 (spenvs): Use NL to fill in name and namelen.
1407 (spenv::retrieve): Eliminate length argument. Instead, use namelen
1409 (build_env): Don't calculate length of initial FOO= part of
1410 environment. Accommodate spenv::retrive argument change.
1412 2002-06-16 Christopher Faylor <cgf@redhat.com>
1414 * cygheap.h (cygheap_user::winname): New field.
1415 * cygheap.cc (cygheap_user::set_name): Clear winname when name changes.
1416 * uinfo.cc (cygheap_user::env_logsrv): Avoid calculating server when
1417 Windows user == SYSTEM.
1418 (cygheap_user::env_domain): Set winname here too.
1419 (cygheap_user::env_userprofile): Eliminate superfluous tests.
1420 (cygheap_user::env_name): Seed winname by calling env_domain().
1422 2002-06-12 Pierre Humblet <pierre.humblet@ieee.org>
1424 * spawn.cc (spawn_guts): Revert removal of ciresrv.moreinfo->uid =
1427 2002-06-15 Christopher Faylor <cgf@redhat.com>
1429 * child_info.h (child_proc_info): Declare as base class.
1430 (spawn_info): Declare as alias of child_proc_info to aid debugging.
1432 * cygheap.cc (cygheap_fixup_in_child): Use child_proc_info global
1433 rather than parameter.
1434 * cygheap.h (cygheap_fixup_in_child): Reflect above change in
1436 * dcrt0.cc (_dll_crt0): Move 'si' definition here. Assign
1438 (dll_crt0_1): Accommodate cygheap_fixup_in_child and *_info changes.
1439 * environ.cc (spenv::retrieve): Make regparm.
1440 * environ.h (environ_init): Ditto.
1441 (win_env::add_cache): Ditto.
1444 * fork.cc (sync_with_parent): Use fork_info global.
1445 (fork_child): Ditto.
1447 2002-06-14 Christopher Faylor <cgf@redhat.com>
1449 * uinfo.cc (cygheap_user::ontherange): Don't set HOMEDRIVE or HOMEPATH
1450 unless one or the other is specified.
1452 2002-06-14 Christopher Faylor <cgf@redhat.com>
1454 * cygheap.h (cygheap_user::userprofile_env_buf): New static member.
1455 * environ.cc (build_env): Add debugging statement.
1456 (spenvs): Switch functions for USERDOMAIN and USERNAME.
1457 * spawn.cc (spawn_guts): Move environment initialization prior to
1458 cygheap_setup_for_child or environment info will never be copied to
1461 2002-06-14 Christopher Faylor <cgf@redhat.com>
1463 * cygheap.h (cygheap_user): Add static members to hold home{drive,path}
1465 * uinfo.cc (cygheap_user::ontherange): Use static class members for
1466 local HOME* storage.
1468 2002-06-14 Christopher Faylor <cgf@redhat.com>
1470 * cygheap.cc (cygheap_user::set_logsrv): Remove.
1471 (cygheap_user::set_domain): Ditto.
1472 * cygheap.h (cygheap_user::set_logsrv): Remove declaration.
1473 (cygheap_user::set_domain): Ditto.
1474 (cygheap_user::env_domain): Declare new method.
1475 (cygheap_user::env_name): Ditto.
1476 * environ.cc (spenvs): Add two environment variables.
1477 * spawn.cc (spawn_guts): Call build_env after RevertToSelf. Always set
1479 (cygheap_user::ontherange): Recalculate homedrive/homepath if they are
1480 empty. Use env_logsrv to get logon server.
1481 (cygheap_user::env_logsrv): Calculate server name here rather than
1482 relying on it having been previously calculated.
1483 (cygheap_user::env_domain): Ditto for domain name.
1484 (cygheap-user::env_name): New method.
1486 2002-06-12 Pierre Humblet <pierre.humblet@ieee.org>
1488 * syscalls.cc (seteuid32): Do not get or set the environment. Do not
1489 call LookupAccountSid nor internal_getlogin. Set cygheap->user name
1490 and sid from the passwd entry.
1491 * uinfo.cc (uinfo_init): Only call internal_getlogin when starting from
1492 a non Cygwin process and use the values returned in user.
1493 (internal_getlogin): Simplify to case where starting from a non Cygwin
1494 process. Store return values in user and return void. Do not set the
1495 Windows default environment.
1496 * dcrt0.cc (dll_crt0_1): Call uinfo_init only when needed. Do not set
1497 myself->uid nor reset user.sid.
1498 * spawn.cc (spawn_guts): Get the sid from cygheap->user. Always
1499 RevertToSelf(). Don't set uid in impersonated case.
1500 * cygheap.cc (cygheap_user::set_sid): Do not set orig_sig.
1501 (cygheap_user::set_orig_sid): New.
1502 * cygheap.h: Declare cygheap_user::set_sid.
1503 * winsup.h: Add argument to uinfo_init().
1505 2002-06-14 Corinna Vinschen <corinna@vinschen.de>
1507 * environ.cc (build_env): If realloc moves envblock, move s with it.
1509 2002-06-13 Nicholas S. Wourms <nwourms@netscape.net>
1511 * winver.rc: Add more words to copyright.
1513 2002-06-13 Corinna Vinschen <corinna@vinschen.de>
1515 * cygheap.cc (cygheap_user::set_name): Revert previous change.
1516 * environ.cc (spenv::retrieve): Check return value of call to
1517 cygheap->user.*from_cygheap().
1519 2002-06-13 Corinna Vinschen <corinna@vinschen.de>
1521 * cygheap.cc (cygheap_user::set_name): Remove setting homedrive and
1523 (cygheap_user::set_logsrv): Fix free'ing of plogsrv.
1524 * cygheap.h (cygheap_user::cygheap_user): Initialize homedrive and
1527 2002-06-13 Christopher Faylor <cgf@redhat.com>
1529 * security.cc (get_logon_server): Use strcasematch rather than
1532 2002-06-12 Christopher Faylor <cgf@redhat.com>
1534 * path.cc (chdir): Minor cleanup.
1536 2002-06-12 Christopher Faylor <cgf@redhat.com>
1538 * environ.cc (build_env): Correctly fill out windows environment block
1539 with win32 paths rather than posix paths.
1541 2002-06-12 Christopher Faylor <cgf@redhat.com>
1543 * cygheap.cc (cygheap_user::set_name): Set homedrive and homepath to
1544 NULL on user name change.
1545 (cygheap_user::set_logsrv): Allocate enough space for leading \\ so
1546 that we can put this in the environment, if needed.
1547 * cygheap.h (homebodies): New enum.
1548 (cygheap_user::homedrive): New field.
1549 (cygheap_user::homepath): Ditto.
1550 (cygheap_user::env_logsrv): New method.
1551 (cygheap_user::env_homepath): New method.
1552 (cygheap_user::env_homedrive): New method.
1553 (cygheap_user::env_userprofile): New method.
1554 (cygheap_user::ontherange): New method.
1555 * environ.cc (envsize): Eliminate debugging argument.
1556 (environ_init): Assume that envc counts number of elments not total
1559 (spenvs): New array, rename from forced_winenv_vars, using spenv.
1560 (spenv::retrieve): New method.
1561 (build_env): Rename from 'winenv' -- one stop shopping for building new
1562 environment blocks for both windows and "unix".
1563 * environ.h (build_env: Declare.
1564 (winenv): Delete declaration.
1566 * spawn.cc (spawn_guts): Use build_env to build windows and cygwin
1568 * uinfo.cc (internal_getlogin): Eliminate environment manipulation.
1569 Default to info from GetUserName if it exists. Move HOMEPATH and
1570 HOMEDRIVE stuff elsewhere. Move HOME setting elsewhere. Only set HOME
1571 environment variable in processes that are not parented by a cygwin
1573 (cygheap_user::ontherange): Define new method.
1574 (cygheap_user::env_logsrv): Ditto.
1575 (cygheap_user::env_homepath): Ditto.
1576 (cygheap_user::env_homedrive): Ditto.
1577 (cygheap_user::env_userprofile): Ditto.
1579 2002-06-11 Christopher Faylor <cgf@redhat.com>
1581 * spawn.cc (spawn_guts): More hToken removal cleanup.
1583 2002-06-09 Pierre Humblet <pierre.humblet@ieee.org>
1585 * spawn.cc (spawn_guts): Define sec_attribs and call sec_user_nih()
1588 2002-06-10 Christopher Faylor <cgf@redhat.com>
1590 * Makefile.in: Ensure that -MD gets added to CFLAGS regardless of
1591 CFLAGS command-line setting.
1593 * cygwin.din: Export sexec* functions as function which returns ENOSYS
1594 (i.e., sexec* is deprecated).
1595 * dtable.cc (dtable::vfork_child_dup): Ensure that impersonation is
1596 restored even on failure.
1597 * exec.cc: Throughout, remove references to sexec* and _spawnve.
1598 * pinfo.h: Remove _spawnve declaration.
1599 * spawn.cc: Rename _spawnve to spawnve and use throughout.
1600 (spawn_guts): Eliminate hToken argument and processing of same. Just
1601 perform special actions if impersonating.
1602 (spawnve): Rename from _spawnve.
1604 2002-06-10 Christopher Faylor <cgf@redhat.com>
1606 * include/sys/strace.h (strace): Avoid use of constructor.
1608 2002-06-10 Christopher Faylor <cgf@redhat.com>
1610 * dcrt0.cc (dll_crt0_1): Initialize wincap and check for sanity before
1611 running global ctors.
1612 * wincap.h (wincap): Eliminate constructor. Default is to zero memory,
1614 * wincap.cc (wincap): Copy this on fork to avoid initialization in
1617 2002-06-10 Corinna Vinschen <corinna@vinschen.de>
1619 * fhandler.h (fhandler_socket::fixup_after_fork): Revert patch from
1621 * fhandler_socket.cc (fhandler_socket::fixup_after_fork): Ditto.
1622 (fhandler_socket::dup): Ditto.
1623 * net.cc (fdsock): Make sockets explicitely noninheritable on NT.
1625 2002-06-09 Christopher Faylor <cgf@redhat.com>
1627 * fhandler_disk_file.cc (fhandler_disk_file::fstat_helper): Correctly
1628 set number of links for directory, if appropriate.
1630 2002-06-10 Robert Collins <rbtcollins@hotmail.com>
1632 * thread.cc: Variation of a patch from Thomas Pffaf.
1633 (__pthread_detach): Cleanup thread object if the thread has terminated.
1634 (__pthread_join): Change order of error checks, and lock against
1635 join/detach/exit races.
1636 (__pthread_exit): Lock object against join/detach/exit races.
1637 (pthread::thread_init_wrapper): Ditto.
1638 (thread_init_wrapper): Rename to pthread::thread_init_wrapper.
1639 (pthread::create): Check that the mutex initialized correctly.
1640 (pthread::push_cleanup_handler): Lock against potential cancellation
1641 race. NB: this may not be required if pthread_cleanup_push is non-
1643 * thread.h (pthread::mutex): New member.
1644 (thread_init_wrapper): Rename to pthread::thread_init_wrapper.
1645 (pthread::thread_init_wrapper_: New static member.
1647 2002-06-10 Robert Collins <rbtcollins@hotmail.com>
1649 * cygwin.din: Add _pthread_cleanup_push and _pthread_cleanup_pop.
1650 * pthread.cc: Change __pthread_self to pthread::self() thruoghout.
1651 (_pthread_cleanup_push): New function.
1652 (_pthread_cleanup_pop): Ditto.
1653 * thread.cc: Thanks to Thomas Pfaff for the pthread cleanup_push,_pop
1654 patch, this work is derived from that.
1655 Change __pthread_self to pthread::self() thruoghout.
1656 (__pthread_self): Rename to pthread::self.
1657 (pthread::self): New method.
1658 (pthread::pthread): Initialize new member.
1659 (pthread::push_cleanup_handler): New method.
1660 (pthread::pop_cleanup_handler): New method.
1661 (pthread::pop_all_cleanup_handlers): New method.
1662 (__pthread_exit): Pop all cleanup handlers.
1663 * thread.h (pthread::push_cleanup_handler): Declare.
1664 (pthread::pop_cleanup_handler): Ditto.
1665 (pthread::pop_all_cleanup_handlers): Ditto.
1666 (pthread::self): New static method.
1667 (__pthread_exit): Give C++ linkage.
1668 (__pthread_join): Ditto.
1669 (__pthread_detach): Ditto.
1670 (__pthread_self): Remove.
1672 2002-04-24 Thomas Pfaff <tpfaff@gmx.net>
1674 * include/pthread.h (__pthread_cleanup_handler): New structure.
1675 (pthread_cleanup_push): Rewritten.
1676 (pthread_cleanup_pop): Ditto.
1677 (_pthread_cleanup_push): New prototype.
1678 (_pthread_cleanup_pop): Ditto.
1680 2002-04-24 Thomas Pfaff <tpfaff@gmx.net>
1682 * thread.cc (thread_init_wrapper): Check if thread is already joined.
1683 (__pthread_join): Set joiner first.
1684 (__pthread_detach): Ditto.
1686 2002-06-10 Robert Collins <rbtcollins@hotmail.com>
1688 * cygserver_transport.cc (create_server_transport): Finish the split
1689 out of sockets code from transport_layer_base. Thanks to Nicholas
1690 Wourms and Conrad Scott for catching this.
1692 2002-06-08 Christopher Faylor <cgf@redhat.com>
1694 * pinfo.cc (pinfo_dummy): Initialize to correct size.
1696 2002-06-08 Christopher Faylor <cgf@redhat.com>
1698 * path.cc: Change MOUNT_AUTO to MOUNT_CYGDRIVE throughout.
1699 * shared_info.h (CURR_MOUNT_MAGIC): Update.
1701 2002-06-08 Christopher Faylor <cgf@redhat.com>
1703 * external.cc (cygwin_internal): Make v1 mount table access invalid.
1704 * path.cc (mount_info::init): Remove had_to_create_mount_areas initialization.
1705 (mount_info::from_registry): Remove v1 table import.
1706 (mount_info::read_v1_mounts): Eliminate.
1707 (mount_info::import_v1_mounts): Ditto.
1708 * shared_info.h (mount_info): Ditto for both of above.
1709 * sys/mount.h (MOUNT_DEVFS): New enum.
1710 (MOUNT_PROC): Ditto.
1712 2002-06-08 Christopher Faylor <cgf@redhat.com>
1714 * include/wchar.h: Define __need_size_t.
1716 2002-06-07 Christopher Faylor <cgf@redhat.com>
1718 * fhandler_socket.cc (fhandler_socket::fstat): Don't assume that socket
1719 is unix-domain socket.
1721 2002-06-07 Christopher Faylor <cgf@redhat.com>
1723 * times.cc (hires_ms::prime): Set init flag.
1725 2002-06-07 Conrad Scott <conrad.scott@dsl.pipex.com>
1727 * times.cc (hires_ms::prime): Adjust epoch of initime_us from 1601 to
1730 2002-06-06 Christopher Faylor <cgf@redhat.com>
1732 * autoload.cc (timeGetDevCaps): Define new autoload function.
1733 (timeGetTime): Ditto.
1734 (timeBeginPeriod): Ditto.
1735 (timeEndPeriod): Ditto.
1736 * hires.h (hires_base): New class. Rename from hires.
1737 (hires_us): New class.
1738 (hires_ms): New class.
1739 * strace.cc (strace::microseconds): Use hires_us class.
1740 * times.cc (gettimeofday): Use hires-ms class.
1741 (hires_us::prime): Rename from hires::prime.
1742 (hires_us::usecs): Rename from hires:usecs.
1743 (hires_ms::prime): New method.
1744 (hires_ms::usecs): New method.
1745 (hires_ms::~hires_ms): New destructor.
1747 2002-06-06 Christopher Faylor <cgf@redhat.com>
1749 * autoload.cc (noload): Correctly save argument count register.
1751 2002-06-05 Conrad Scott <conrad.scott@dsl.pipex.com>
1753 * fhandler.cc (fhandler_base::fstat): Initialise tv_nsec member of
1754 st_atim, st_mtim, and st_ctim fields.
1755 * fhandler_disk_file.cc (fhandler_disk_file::fstat_helper): Ditto.
1756 * fhandler_process.cc (fhandler_process::fstat): Ditto.
1757 * glob.c (stat32_to_STAT): Copy across the whole st_atim, st_mtime, and
1759 * syscalls.cc (stat64_to_stat32): Ditto.
1760 * times.cc (to_timestruc_t): New function.
1761 (time_as_timestruc_t): New function.
1762 * winsup.h: Add to_timestruc_t and time_as_timestruc_t functions.
1763 * include/cygwin/stat.h: Replace time_t with timestruc_t throughout for
1764 all file times, removing the st_spare1, st_spare2, and st_spare3 fields
1765 in the process. Add macros to access tv_sec fields by old names.
1766 * include/cygwin/types.h: Typedef timespec_t and timestruc_t as struct
1769 2002-06-03 Pierre Humblet <pierre.humblet@ieee.org>
1771 * sec_helper.cc (lookup_name): Suppress.
1772 * security.cc (alloc_sd): Remove logsrv argument.
1773 Remove two calls to lookup_name.
1774 (set_security_attribute): Remove logsrv argument.
1775 Remove logsrv argument in call to alloc_sd.
1776 (set_nt_attribute): Remove logsrv argument.
1777 Remove logsrv argument in call to set_security_attribute.
1778 (set_file_attribute): Remove logsrv argument.
1779 Remove logsrv argument in call to set_nt_attribute.
1780 (set_file_attribute): Remove logsrv argument.
1781 Remove logsrv argument in call to set_file_attribute.
1782 * syscalls.cc (chown_worker): Remove logserver argument in
1783 call to set_file_attribute.
1785 * shm.cc (shmget): Remove logsrv argument in call to alloc_sd.
1786 * uinfo.cc (internal_getlogin): Replace calls to
1787 lookup_name by call to LookupAccountName.
1788 * security.h: Remove logsrv in declarations of set_file_attribute
1789 and alloc_sd. Remove declaration of lookup_name.
1791 2002-06-05 Christopher Faylor <cgf@redhat.com>
1793 * child_info.h (CHILD_INFO_MAGIC): Oops. Revert previous change. gcc
1796 2002-06-05 Christopher Faylor <cgf@redhat.com>
1798 * child_info.h (CHILD_INFO_MAGIC): Update.
1800 2002-06-05 Christopher Faylor <cgf@redhat.com>
1802 * strace.cc (strace::hello): Set inited, when appropriate.
1804 2002-06-05 Christopher Faylor <cgf@redhat.com>
1806 * cygwin.din: Eliminate some newlib wrappers.
1807 * path.cc (get_devn): Only consider first 99 potential com devices.
1808 (get_device_number): Ditto.
1809 * times.cc (_times): Eliminate.
1810 (_times): Rename from times().
1812 2002-06-05 Christopher Faylor <cgf@redhat.com>
1814 * dir.cc (rmdir): Streamline. Detect attempts to remove directories
1815 from "read-only" virtual devices. (Suggested by Pavel Tsekov)
1816 * syscalls.cc (unlink): Detect attempts to remove directories from
1817 "read-only" virtual devices. (From Pavel Tsekov)
1819 2002-06-05 Christopher Faylor <cgf@redhat.com>
1821 * dtable.cc (handle_to_fn): Check error return value from NtQueryObject
1822 first before seeing if name buffer is NULL.
1824 * grp.cc (read_etc_group): Fix gcc warning regarding snprintf format.
1825 * passwd.cc (read_etc_passwd): Ditto.
1827 2002-04-18 Thomas Pfaff <tpfaff@gmx.net>
1829 * thread.h (pthread::joiner): New member.
1830 * thread.cc (pthread::pthread): Initialize joiner to NULL
1831 (pthread::create): Increment of thread counter moved from
1832 __pthread_create to this location.
1833 (__pthread_create): Increment thread counter removed.
1834 (thread_init_wrapper): Set joiner to self when thread was created
1836 (__pthread_exit): delete thread when it is detached and not
1838 (__pthread_join): Check for deadlock and delete thread when it has
1840 (__pthread_detach): Set joiner to self when thread state
1841 changed to detached.
1843 2002-06-05 Corinna Vinschen <corinna@vinschen.de>
1845 * grp.cc (read_etc_group): When emulating nonexisting group file on
1846 NT systems, read primary group SID from process token. Use that info
1847 to create correct group entry. On error or on 9x systems fallback
1848 to emulating Administrators group as before.
1849 * passwd.cc (read_etc_passwd): When emulating nonexisting passwd file
1850 on NT systems, read user and primary group SID from process token.
1851 Use that info to create correct passwd entry. On error or on 9x
1852 systems fallback to emulating user with Administrator user id and
1853 Administrators group as before.
1855 2002-06-05 Corinna Vinschen <corinna@vinschen.de>
1857 * grp.cc (etc_group): Removed.
1858 (parse_grp): Make line parameter nonconst. Don't copy data into new
1859 allocated memory. Check for CR instead of LF to accomodate new
1861 (add_grp_line): Make line parameter nonconst.
1862 (read_etc_group): Rearrange using new pwdgrp_read class.
1863 * passwd.cc (parse_pwd): Don't copy data into new allocated memory.
1864 Check for CR instead of LF to accomodate new read method.
1865 (read_etc_passwd): Rearrange using new pwdgrp_read class.
1866 * pwdgrp.h (pwdgrp_check::set_last_modified): Use different
1868 (class pwdgrp_read): New class for opening and reading passwd and
1871 2002-06-04 Christopher Faylor <cgf@redhat.com>
1873 * dtable.cc (handle_to_fn): Attempt to handle "raw" accesses to remote
1875 * path.cc (mount_info::conv_to_win32_path): Set flags to binary when
1876 mount entry is not found.
1877 (mount_info::set_flags_from_win32_path): Ditto.
1879 2002-06-04 Christopher Faylor <cgf@redhat.com>
1881 * dtable.cc (handle_to_fn): Correct placement and length of name
1882 buffer. (Suggested by Pavel Tsekov)
1884 2002-06-04 Christopher Faylor <cgf@redhat.com>
1886 Remove fcntl.h includes throughout.
1887 * fhandler.h: Move fcntl.h include here.
1888 (fhandler_base::set_flags): Accept supplied_bin argument. Make
1890 * dtable.cc (dtable::init_std_file_from_handle): Just use binmode from
1892 (reset_to_open_binmode): Use set_flags.
1893 * cygwin.din (open): Avoid newlib wrapper.
1897 * fhandler.cc (fhandler_base::set_flags): Accept supplied_bin argument.
1898 Make binmode decisions here.
1899 (fhandler_base::open): Avoid using pc if it is NULL. Eliminate binmode
1900 logic. Just call set_flags with binmode argument.
1901 (fhandler_base::init): Call set_flags with binmode argument.
1902 * fhandler_clipboard.cc (fhandler_dev_clipboard::open): Ditto.
1903 * fhandler_console.cc (fhandler_console::open): Ditto.
1904 (fhandler_console::init): Force binary on open.
1905 * fhandler_disk_file.cc (fhandler_disk_file::open): Don't set binmode
1906 here. Let it happen in base class.
1907 * fhandler_dsp.cc (fhandler_dev_dsp::open): Force binmode open. Set
1908 return value appropriately if unable to open.
1909 * fhandler_proc.cc (fhandler_proc::open): Make sure flags are set
1911 * fhandler_process.cc (fhandler_process::open): Ditto.
1912 * fhandler_registry.cc (fhandler_registry::open): Ditto.
1913 * fhandler_random.cc (fhandler_dev_random::fhandler_dev_random): Ditto.
1914 * fhandler_raw.cc (fhandler_dev_raw::open): Force O_BINARY by default.
1915 * fhandler_serial.cc (fhandler_serial::init): Ditto.
1916 * fhandler_tty.cc (fhandler_tty_slave::open): Ditto.
1917 (fhandler_pty_master::open): Ditto.
1918 * fhandler_virtual.cc (fhandler_virtual::open): Ditto.
1919 * fhandler_windows.cc (fhandler_windows::open): Ditto.
1920 * fhandler_zero.cc (fhandler_dev_zero::open): Ditto.
1921 * net.cc (fdsock): Ditto.
1922 * path.cc (path_conv::check): Avoid checking for executable extension
1923 when directory. (Suggested by Pavel Tsekov)
1924 (set_flags): Set PATH_TEXT explicitly, when appropriate.
1925 (mount_info::conv_to_win32_path): Use set_flags() to set path flags.
1926 * path.h (PATH_TEXT): New enum.
1927 (path_conv::binmode): Return appropriate constant based on binmode.
1928 * pipe.cc (make_pipe): Set binmode to O_TEXT xor O_BINARY.
1929 * syscalls.cc (setmode_helper): Make debugging message a little
1931 (setmode): Set binmode via set_flags.
1933 2002-06-04 Corinna Vinschen <corinna@vinschen.de>
1935 * fhandler.h (class fhandler_socket): Add private method
1936 fixup_after_fork (bool, HANDLE).
1937 * fhandler_socket.cc (fhandler_socket::fixup_after_fork): Move
1938 functionality to new private method. Add closing parent socket
1939 if not called from dup(). Create method new calling private method
1940 with appropriate parameter.
1941 (fhandler_socket::fixup_after_exec): Call private method
1942 fixup_after_fork with appropriate parameter.
1943 (fhandler_socket::dup): Ditto.
1945 2002-06-04 Corinna Vinschen <corinna@vinschen.de>
1947 * fhandler_dsp.cc (fhandler_dev_dsp::open): Set errno to EACCES if
1948 requested mode isn't supported.
1950 2002-06-03 Christopher Faylor <cgf@redhat.com>
1952 * fhandler.cc (fhandler_base::open): Don't set binmode if already set.
1953 Don't check for file. Files should already be set. Report on binary
1955 (fhandler_base::fhandler_base): Don't set default binmode here. That's
1957 * fhandler_console.cc (fhandler_console::output_tcsetattr): Don't set
1958 binmode, ever, for console.
1959 * fhandler_disk_file.cc (fhandler_disk_file::open): Always set the
1960 binary mode to the value derived from mount table.
1961 * path.cc (mount_info::conv_to_win32_path): Default to binmode if path
1962 does not translate into anything in the mount table.
1964 2002-06-03 Corinna Vinschen <corinna@vinschen.de>
1966 * external.cc (cygwin_internal): Add CW_EXTRACT_DOMAIN_AND_USER
1967 handling to call extract_nt_dom_user() from applications.
1968 * include/sys/cygwin.h (cygwin_getinfo_types): Add
1969 CW_EXTRACT_DOMAIN_AND_USER.
1971 2002-06-03 Corinna Vinschen <corinna@vinschen.de>
1973 * syscalls.cc (stat64_to_stat32): Transform st_dev correctly.
1974 (fstat64): Add evaluating st_ino and st_dev.
1975 (stat_worker): Evaluate st_dev as 32 bit value.
1976 * include/cygwin/stat.h: Use new dev_t definition throughout.
1977 * include/cygwin/types.h: Define __dev16_t and __dev32_t. Define
1978 dev_t according to __CYGWIN_USE_BIG_TYPES__ setting.
1979 * include/sys/sysmacros.h: Define major, minor and makedev
1980 according to __CYGWIN_USE_BIG_TYPES__ setting.
1982 2002-06-03 Pierre Humblet <pierre.humblet@ieee.org>
1984 * syscalls.cc (setegid32): Verify the correctness of the gid
1985 of the group returned by getgrgid32.
1987 2002-06-03 Pierre Humblet <pierre.humblet@ieee.org>
1989 * security.cc (lsa2wchar): Suppressed.
1990 (get_lsa_srv_inf): Suppressed.
1991 (get_logon_server_and_user_domain): Suppressed.
1992 (get_logon_server): Essentially new.
1993 (get_user_groups): Add "domain" argument. Only lookup the
1994 designated server and use "domain" in LookupAccountName.
1995 (is_group_member): Simplify the arguments.
1996 (get_user_local_groups): Simplify the arguments. Do only a
1997 local lookup. Use "BUILTIN" and local domain in LookupAccountName.
1998 (get_user_primary_group). Only lookup the designated server.
1999 (get_group_sidlist): Remove logonserver argument. Do not lookup
2000 any server for the SYSTEM account.
2001 (create_token): Delete logonserver and call to get_logon_server.
2002 Adjust arguments of get_group_sidlist, see above.
2003 * security.h: Delete declaration of get_logon_server_and_user_domain
2004 and add declaration of get_logon_server.
2005 * uinfo.cc (internal_get_login): Call get_logon_server instead of
2006 get_logon_server_and_user_domain.
2008 2002-06-02 Christopher Faylor <cgf@redhat.com>
2010 * dtable.cc (handle_to_fn): Use largest match for device. Correctly
2011 (?) deal with remote drive weirdness.
2013 2002-06-02 Christopher Faylor <cgf@redhat.com>
2015 * fhandler_disk_file.cc (fhandler_disk_file::fstat_by_name): Check
2016 specifically for non-existent file, first.
2017 (fhandler_disk_file::fstat): Perform fd open on files with funny
2020 2002-06-02 Christopher January <chris@atomice.net>
2022 * fhandler_process.cc (fhandler_process::open): Set fileid.
2024 2002-06-02 Christopher Faylor <cgf@redhat.com>
2026 Remove unneeded sigproc.h includes throughout.
2027 * fhandler.h (fhandler_proc::fill_filebuf): Take a pinfo argument.
2028 * fhandler_proc.cc (fhandler_proc::get_proc_fhandler): Simplify search
2030 (fhandler_proc::readdir): Assume that pid exists if it shows up in the
2032 * fhandler_process.cc (fhandler_process::open): Simplify search for
2033 given pid. Call fill_filebuf with pinfo argument.
2034 (fhandler_process::fill_filebuf): Pass pinfo here and assume that it
2036 * pinfo.h (pinfo::remember): Define differently if sigproc.h is not
2039 2002-06-02 Christopher Faylor <cgf@redhat.com>
2041 * dll_init.cc (dll_list::detach): Don't run destructor on exit.
2043 2002-06-01 Christopher Faylor <cgf@redhat.com>
2045 * fhandler.cc (fhandler_base::fstat): Move dev and ino calculation into
2047 * syscalls.cc (stat_worker): Calculate dev and ino calculation here, if
2049 * fhandler_proc.cc (fhandler_proc::fhandler_proc): Minor reorg for
2051 * fhandler_process.cc (fhandler_process::exists): Return 0 on
2053 (fhandler_process::fstat): Simplify pid logic.
2054 * fhandler_tape.cc (fhandler_dev_tape::fstat): Minor reformatting.
2056 2002-06-01 Christopher Faylor <cgf@redhat.com>
2058 * path.cc (chdir): Don't allow cd'ing to a non-directory virtual path.
2060 2002-05-31 Christopher Faylor <cgf@redhat.com>
2062 * fhandler_disk_file.cc (readdir): Move inode calculation into caller.
2063 (fhandler_cygdrive::readdir): Add "." and "..".
2064 * dir.cc (readdir): Move inode calculation here so that fhandler
2065 readdirs can benefit.
2067 2002-05-31 Christopher Faylor <cgf@redhat.com>
2069 * fhandler_console.cc (fhandler_console::open): Reinstate setting of
2072 * dtable.cc (dtable::init_std_file_from_handle): Default to using
2073 binmode derived from path_conv, when required.
2074 * fhandler.h (fhandler_base::get_w_binary): Default to binmode if
2075 nothing else is specified.
2076 * fhandler.h (fhandler_base::get_r_binary): Ditto.
2078 * fhandler_disk_file.cc (fhandler_disk_file::fstat_by_handle): Work
2081 * path.cc (path_conv::check): Remove a debugging statement.
2083 2002-05-31 Christopher Faylor <cgf@redhat.com>
2085 * fhandler_console.cc (fhandler_console::open): Always default to
2087 (fhandler_console::write_normal): Don't honor binmode setting. There
2088 is already a termios setting for this.
2089 (fhandler_console::init): Correct argument order in init call.
2091 2002-05-31 Christopher Faylor <cgf@redhat.com>
2093 * fhandler.cc (fhandler_base::open): Make default open mode == binmode.
2094 (fhandler_base::init): Set open flags based on derived binmode argument.
2096 2002-05-31 Christopher Faylor <cgf@redhat.com>
2098 * dll_init.cc (dll_list::init): Eliminate unneeded debugging statement.
2100 2002-05-31 Christopher Faylor <cgf@redhat.com>
2102 * fhandler_proc.cc (fhandler_proc::readdir): Set errno when no more
2104 * fhandler_process.cc (fhandler_process::readdir): Ditto.
2105 * fhandler_registry.cc (fhandler_registry::readdir): Ditto.
2107 2002-05-30 Christopher Faylor <cgf@redhat.com>
2109 * path.cc (path_conv::check): Set fileattr to INVALID_FILE_ATTRIBUTES
2110 for nonexistent virtual device path.
2111 (chdir): Set correct errno when attempt is made to cd to nonexistent
2112 virtual device path.
2114 2002-05-30 Christopher Faylor <cgf@redhat.com>
2116 * fhandler_disk_file.cc (fhandler_disk_file::fstat): Always call
2117 fstat_by_name if fd is not opened to allow fstat_by_name to properly
2120 2002-05-30 Corinna Vinschen <corinna@vinschen.de>
2122 * autoload.cc: Replace autoload statments for ZwXXX by NtXXX.
2123 Drop ZwQuerySystemInformation since NtQuerySystemInformation was
2125 * fhandler_proc.cc (format_proc_uptime): Replace call to
2126 ZwQuerySystemInformation by call to NtQuerySystemInformation.
2127 (format_proc_stat): Ditto.
2128 * fhandler_process.cc (format_process_stat): Replace call to
2129 ZwQueryInformationProcess by call to NtQueryInformationProcess.
2130 (get_process_state): Ditto.
2131 (get_mem_values): Ditto. Replace call to ZwQueryVirtualMemory by
2132 call to NtQueryVirtualMemory.
2133 * ntdll.h: Cleanup. Drop ZwQuerySystemInformation since
2134 NtQuerySystemInformation was already available. Replace declarations
2135 of ZwXXX functions by declarations of NtXXX.
2136 * pinfo.cc (winpids::enumNT): Replace call to ZwQuerySystemInformation
2137 by call to NtQuerySystemInformation.
2139 2002-05-29 Christopher Faylor <cgf@redhat.com>
2141 * fhandler.cc (binmode): Default to binmode when mode is not known.
2143 2002-05-29 Christopher Faylor <cgf@redhat.com>
2145 * include/sys/cygwin.h (EXTERNAL_PINFO_VERSION): Reinstate.
2146 * external.cc (fillout_pinfo): Use it.
2148 2002-05-29 Corinna Vinschen <corinna@vinschen.de>
2150 * external.cc (fillout_pinfo): Use new version define.
2151 * include/sys/cygwin.h (external_pinfo): Define
2152 EXTERNAL_PINFO_VERSION_16_BIT and EXTERNAL_PINFO_VERSION_32_BIT
2153 instead of just EXTERNAL_PINFO_VERSION.
2155 2002-05-29 Christopher Faylor <cgf@redhat.com>
2157 * external.cc (fillout_pinfo): Set new version field in external_pinfo
2159 * include/sys/cygwin.h (external_pinfo): Replace strace_file with
2162 2002-05-29 Corinna Vinschen <corinna@vinschen.de>
2164 Change internal uid datatype from __uid16_t to __uid32_t
2166 * cygwin.din: Export new symbols getpwuid32, getpwuid_r32, getuid32,
2167 geteuid32, setuid32, seteuid32.
2168 * passwd.cc (getpwuid32): New function.
2169 (getpwuid_r32): Ditto.
2170 * syscalls.cc (seteuid32): Ditto.
2172 * uinfo.cc (getuid32): Ditto.
2174 * winsup.h (uid16touid32): New macro, correct casting from __uid16_t
2176 (gid16togid32): Ditto fir gids.
2177 (getuid32): Declare.
2179 (getpwuid32): Ditto.
2180 * include/sys/cygwin.h (struct external_pinfo): Add members uid32 and
2183 2002-05-29 Corinna Vinschen <corinna@vinschen.de>
2185 * include/cygwin/socket.h: Protect some symbols against multiple
2187 * include/netinet/ip.h: Ditto.
2188 * include/netinet/tcp.h: Ditto.
2190 2002-05-29 Wu Yongwei <adah@netstd.com>
2192 * include/netinet/ip.h: Replace by BSD derived version of the file.
2193 * include/netinet/tcp.h: Ditto.
2194 * include/netinet/udp.h: New file.
2195 * include/cygwin/ip.h: Remove.
2197 2002-05-29 Christopher Faylor <cgf@redhat.com>
2199 * dtable.cc (dtable::init_std_file_from_handle): Attempt stronger
2200 detection of invalid handle.
2201 (handle_to_fn): Detect pathological condition where NT resets the
2202 buffer pointer to NULL on an invalid handle.
2204 2002-05-28 Christopher Faylor <cgf@redhat.com>
2206 * fhandler_disk_file.cc (fhandler_disk_file::fstat_helper): Properly
2207 check for whether we should be opening the file to search for #!
2208 characters. Set path_conv structure execability, too, when
2211 2002-05-28 Corinna Vinschen <corinna@vinschen.de>
2213 * security.cc (set_security_attribute): Call getegid32() instead of
2215 * include/cygwin/grp.h: Declare getegid32().
2217 2002-05-28 Corinna Vinschen <corinna@vinschen.de>
2219 Change internal gid datatype from __gid16_t to __gid32_t
2221 * cygwin.din: Export new symbols chown32, fchown32, getegid32,
2222 getgid32, getgrgid32, getgrnam32, getgroups32, initgroups32, lchown32,
2223 setgid32, setegid32, getgrent32.
2224 * grp.cc (grp32togrp16): New static function.
2225 (getgrgid32): New function.
2226 (getgrnam32): Ditto.
2227 (getgrent32): Ditto.
2228 (getgroups32): Change name of internal function from getgroups.
2229 (getgroups32): New function.
2230 (initgroups32): Ditto.
2231 * syscalls.cc (chown32): Ditto.
2236 * uinfo.cc (getgid32): Ditto.
2238 * include/cygwin/grp.h: Remove declaration of getgrgid() and getgrnam().
2239 Declare getgrgid32() and getgrnam32() instead. Declare getgid32().
2241 2002-05-27 Christopher Faylor <cgf@redhat.com>
2243 * autoload.cc (noload): Properly mask low order word for determining
2244 number of bytes to pop.
2246 2002-05-27 Christopher Faylor <cgf@redhat.com>
2248 * fhandler_disk_file.cc (fhandler_disk_file::fstat): Minor logic
2251 2002-05-27 Christopher Faylor <cgf@redhat.com>
2253 * autoload.cc (LoadFuncEx): Define via new LoadFuncEx2 macro.
2254 (LoadFuncEx2): Adapt from LoadFuncEx. Provides control of return
2255 value for nonexistent function.
2256 (NtQueryObject): Declare.
2257 (IsDebuggerPresent): Declare via LoadFuncEx2 and always return true if
2259 * debug.h (being_debugged): Just rely on IsDebuggerPresent return
2261 * dtable.cc (handle_to_fn): New function.
2262 (dtable::init_std_file_from_handle): Attempt to derive std handle's
2263 name via handle_to_fn.
2264 (dtable::build_fhandler_from_name): Fill in what we can in path_conv
2265 structure when given a handle and path doesn't exist.
2266 * fhandler.cc (fhandler_base::open): Don't set the file pointer here.
2267 Use pc->exists () to determine if file exists rather than calling
2268 GetFileAttributes again.
2269 * fhandler.h (fhandler_base::exec_state_isknown): New method.
2270 (fhandler_base::fstat_helper): Add extra arguments to declaration.
2271 (fhandler_base::fstat_by_handle): Declare new method.
2272 (fhandler_base::fstat_by_name): Declare new method.
2273 * fhandler_disk_file (num_entries): Make __stdcall.
2274 (fhandler_base::fstat_by_handle): Define new method.
2275 (fhandler_base::fstat_by_name): Define new method.
2276 (fhandler_base:fstat): Call fstat_by_{handle,name} as appropriate.
2277 (fhandler_disk_file::fstat_helper): Accept extra arguments for filling
2278 out stat structure. Move handle or name specific stuff to new methods
2280 (fhandler_disk_file::open): Use real_path->exists rather than calling
2281 GetFileAttributes again.
2282 * ntdll.h (FILE_NAME_INFORMATION): Define new structure.
2283 (OBJECT_INFORMATION_CLASS): Partially define new enum.
2284 (OBJECT_NAME_INFORMATION): Define new structure.
2285 (NtQueryInformationFile): New declaration.
2286 (NtQueryObject): New declaration.
2287 * path.cc (path_conv::fillin): Define new method.
2288 * path.h (path_conv::fillin): Declare new method.
2289 (path_conv::drive_thpe): Rename from 'get_drive_type'.
2290 (path_conv::volser): Declare new method.
2291 (path_conv::volname): Declare new method.
2292 (path_conv::root_dir): Declare new method.
2293 * syscalls.cc (fstat64): Send real path_conv to fstat as second
2296 2002-05-24 Pierre Humblet <pierre.humblet@ieee.org>
2298 * security.cc (lsa2str): New function.
2299 (get_priv_list): Call lsa2str instead of sys_wcstombs.
2301 2002-05-22 Pierre Humblet <pierre.humblet@ieee.org>
2303 * syscalls.cc (seteuid): Do not take allow_ntsec into account.
2304 Attempt to use an existing or new token even when the uid
2305 matches orig_uid, but the gid is not in the process token.
2306 Major reorganization after several incremental changes.
2307 (setegid): Do not take allow_ntsec into account. Minor
2308 reorganization after several incremental changes.
2310 2002-05-26 Christopher Faylor <cgf@redhat.com>
2312 * debug.h (being_debugged): New macro.
2313 * dtable.cc (dtable::extend): Use new macro.
2314 * exceptions.cc (try_to_debug): Ditto.
2315 * strace.cc (strace::hello): Only output debugging info when we think
2316 we're being debugged.
2318 2002-05-25 Robert Collins <rbtcollins@hotmail.com>
2320 * winsup.h: Remove duplicate declarations of malloc_lock and
2323 2002-05-24 Christopher Faylor <cgf@redhat.com>
2325 Remove unneeded sync.h, where appropriate, throughout.
2326 Remove unneeded heap.h, where appropriate, throughout.
2327 Remove unneeded exceptions.h, where appropriate, throughout.
2328 Remove unneeded perprocess.h, where appropriate, throughout.
2330 2002-05-22 Pierre Humblet <pierre.humblet@ieee.org>
2332 * security.cc (create_token): Call __sec_user() instead of
2333 sec_user() to remove dependence on allow_ntsec. Verify that
2334 the returned sd is non-null.
2336 2002-05-25 Robert Collins <rbtcollins@hotmail.com>
2338 * gmon.c (fake_sbrk): Correctly return -1 on failed malloc's.
2340 2002-05-24 Christopher Faylor <cgf@redhat.com>
2342 * dtable.cc (dtable::build_fhandler_from_name): Just pass posix path
2343 along to set_name via return_and_clear_normalized_path.
2344 (dtable::build_fhandler): New method with const char * argument.
2345 (dtable::reset_unix_path_name): Eliminate.
2346 (dtable::dup_worker): Use correct build_fhandler method.
2347 * mmap.cc (mmap_record::alloc_fh): Ditto.
2348 * dtable.h (dtable::build_fhandler): New method.
2349 (dtable::reset_unix_path_name): Eliminate.
2350 * fhandler.cc (fhandler_base::set_name): Assume that unix_name has
2351 already been cmalloced.
2352 (fhandler_base::reset_unix_path_name): Eliminate.
2353 (fhandler_base::~fhandler_base): Coercion for cfree.
2354 * fhandler.h (fhandler_base::unix_path_name): Make const char *.
2355 (fhandler_base::win32_path_name): Ditto.
2356 (fhandler_base::reset_unix_path_name): Eliminate.
2357 * fhandler_disk_file.cc (fhandler_cygdrive::set_drives): Accommodate
2358 const char *ness of win32_path_name.
2359 * fhandler_socket.cc (fhandler_socket::fstat): Accommodate new set_name
2361 * path.cc (path_conv::return_and_clear_normalized_path): New method.
2362 (path_conv::clear_normalized_path): Eliminate.
2363 (path_conv::~path_conv): Ditto.
2364 (path_conv::check): Accommodate new build_fhandler method.
2365 * path.h (path_conv::~path_conv): Eliminate.
2366 (path_conv::clear_normalized_path): Ditto.
2367 (path_conv::return_and_clear_normalized_path): Declare new method.
2369 2002-05-23 Christopher Faylor <cgf@redhat.com>
2371 * path.cc (path_conv::check): Make sure any trailing path component is
2372 part of potential normalized posix path.
2374 2002-05-23 Christopher Faylor <cgf@redhat.com>
2376 * smallprint.c (__small_vsprintf): Implement '%o' after all these
2379 2002-05-22 Christopher Faylor <cgf@redhat.com>
2381 * fhandler.h (fhandler_virtual::exists): Eliminate path argument.
2382 (fhandler_proc::exists): Ditto.
2383 (fhandler_registry::exists): Ditto.
2384 (fhandler_process::exists): Ditto.
2385 * fhandler_proc.cc (fhandler_proc::exists): Ditto. Use built-in name.
2386 * fhandler_process.cc (fhandler_process::exists): Ditto.
2388 * fhandler_registry.cc (fhandler_registry::exists): Ditto.
2389 (fhandler_registry::fstat): Ditto.
2390 * fhandler_virtual.cc (fhandler_virtual::opendir): Ditto.
2391 * path.cc (path_conv::check): Ditto. Add debugging.
2393 2002-05-22 Christopher Faylor <cgf@redhat.com>
2395 * syscalls.cc (dup): Always call dup2 for error handling.
2397 2002-05-22 Corinna Vinschen <corinna@vinschen.de>
2399 * include/cygwin/types.h: Revert previous patch.
2401 2002-05-22 Corinna Vinschen <corinna@vinschen.de>
2403 * include/cygwin/types.h: Define pthread stuff only if _POSIX_THREADS
2406 2002-05-19 Pierre Humblet <pierre.humblet@ieee.org>
2408 * security.cc (open_local_policy): Initialize lsa to
2409 INVALID_HANDLE_VALUE instead of NULL.
2410 (get_logon_server_and_user_domain): Test for INVALID_HANDLE_VALUE
2412 (create_token): Both of the above.
2414 2002-05-18 Christopher Faylor <cgf@redhat.com>
2416 * fhandler_disk_file.cc (fhandler_disk_file::fstat): Make handling of
2417 nlink consistent for remote files.
2419 2002-05-18 Christopher Faylor <cgf@redhat.com>
2421 * path.cc (path_conv::check): Always set executable bit for executable
2424 2002-05-17 Christopher Faylor <cgf@redhat.com>
2426 * fhandler.cc (fhandler_base::lseek): Avoid calling SetFilePointer with
2427 high order part of 64 bit address on OS's which do not support that
2428 kind of operation. Otherwise Windows 95 will become confused.
2430 2002-05-16 Pierre Humblet <pierre.humblet@ieee.org>
2432 * fhandler_raw.cc (fhandler_dev_raw::open): Replace set_errno()
2433 by __seterrno_from_win_error().
2434 * security.cc (open_local_policy): Ditto.
2435 (get_lsa_srv_inf): Ditto.
2436 (get_user_groups): Ditto.
2437 (get_user_primary_group): Ditto.
2438 (create_token): Ditto.
2441 2002-05-17 Corinna Vinschen <corinna@vinschen.de>
2443 * times.cc (utimes): Use FILE_WRITE_ATTRIBUTES even on 9x/Me when
2444 opening file for writing timestamp.
2445 * wincap.cc: Remove flag has_specific_access_rights.
2448 2002-05-13 Pierre Humblet <pierre.humblet@ieee.org>
2450 * syscalls.cc (seteuid): Set default dacl in process token.
2451 Replace in-line code by call to verify_token().
2452 (setegid): Reverse change from 2002-01-21. Add call to
2453 RevertToSelf and set primary group in impersonation token.
2454 * security.cc (create_token): Store pgrpsid in token security
2455 descriptor, except if it already appears in my_grps.
2456 Use sec_acl() in place of get_dacl().
2457 (verify_token): Create from code in seteuid(), with tighter checks.
2458 (get_dacl): Deleted.
2459 (get_group_sidlist): Add argument to indicate if pgrpsid is already
2461 * security.h: Define verify_token().
2462 * autoload.cc: Load GetKernelObjectSecurity().
2464 2002-05-13 Mark Bradshaw <bradshaw@staff.crosswalk.com>
2466 * cygwin.din: Add strlcat and strlcpy.
2467 * include/cygwin/version.h: Increment API minor version number.
2469 2002-05-09 Pierre Humblet <pierre.humblet@ieee.org>
2471 * shared.cc (__sec_user): Split into sec_acl() and call orig_sid().
2472 (sec_acl): Create from part of __sec_user(), except creator/owner.
2473 * security.h: Define sec_acl() and MAX_DACL_LEN.
2475 2002-05-12 Christopher Faylor <cgf@redhat.com>
2477 * fhandler_disk_file.cc (fhandler_disk_file::open): Avoid using
2478 O_DIROPEN when OS doesn't support it. Return proper errno in that
2481 2002-05-12 Christopher Faylor <cgf@redhat.com>
2483 * syscalls.cc (_read): Change error to EBADF if attempt to read from a
2486 2002-05-11 Christopher Faylor <cgf@redhat.com>
2488 * fhandler.h (executable_states): For now, make dont_care_if_executable
2489 equivalent to not_executable.
2490 * sys/mount.h: Define MOUNT_NOTEXEC.
2491 * path.h (fs_info): New class.
2492 (path_conv): Move fs-specific fields to new 'fs' structure.
2493 (path_conv::update_fs_info): Move to fs_info and rename to just 'update'.
2494 * path.cc (fs_info::update): Ditto. Return 'true' if successful.
2495 (fillout_mntent): Add ',noexec' to list of reported options.
2497 2002-05-11 Christopher Faylor <cgf@redhat.com>
2499 * fhandler_virtual.cc (fhandler_virtual::close): Quiet a compiler
2502 2002-05-10 Christopher January <chris@atomice.net>
2504 * autoload.cc: Add dynamic load statements for
2505 'ZwQueryInformationProcess' and 'ZwQueryVirtualMemory'.
2506 * fhandler.h: Change type of bufalloc and filesize members of
2507 fhandler_virtual from int to size_t. Change type of position member
2508 from __off32_t to __off64_t. Add new fileid member to fhandler_virtual
2509 class. Make seekdir take an __off64_t argument. Make lseek take an
2510 __off64_t argument. Add fill_filebuf method to fhandler_virtual. Add
2511 fill_filebuf method to fhandler_proc. Add fill_filebuf method to
2512 fhandler_registry. Add fill_filebuf method to fhandler_process. Add
2513 saved_pid and saved_p members to fhandler_process.
2514 * fhandler_proc.cc (proc_listing_array): Add 'loadavg', 'meminfo', and 'stat'.
2515 (proc_fhandlers array): Ditto.
2516 (fhandler_proc::open): Use fill_filebuf to flesh out the file contents.
2517 (fhandler_proc::fill_filebuf): New method.
2518 (fhandler_proc::format_proc_meminfo): Ditto.
2519 (fhandler_proc::format_proc_stat): Ditto.
2520 (fhandler_proc::format_proc_uptime): Ditto.
2521 * fhandler_process.cc (process_listing): Add 'stat' and 'statm'.
2522 (fhandler_process::fstat): Find the _pinfo structure for the process
2523 named in the filename. Return ENOENT if the process is no longer
2524 around. Set the gid and uid fields of the stat structure.
2525 (fhandler_process::open): Store pid and pointer to _pinfo structure in
2526 saved_pid and saved_p respectively. Use fill_filebuf to flesh out file
2528 (fhandler_proc::fill_filebuf): New method.
2529 (format_process_stat): New function.
2530 (format_process_status): Ditto.
2531 (format_process_statm): Ditto.
2532 (get_process_state): Ditto.
2533 (get_mem_values): Ditto.
2534 * fhandler_registry.cc (fhandler_registry::seekdir): Change argument
2535 type from __off32_t to __off64_t.
2536 (fhandler_registry::fill_filebuf): New method.
2537 * fhandler_virtual.cc (fhandler_virtual::seekdir): Change argument type
2538 from __off32_t to __off64_t.
2539 (fhandler_virtual::lseek): Ditto.
2540 (fhandler_virtual::fill_filebuf): New method.
2541 (fhandler_virtual::fhandler_virtual): Initialise fileid to -1.
2542 * wincap.cc: Set flag has_process_io_counters appropriately.
2543 * wincap.h: Add flag has_process_io_counters.
2545 2002-05-09 Christopher Faylor <cgf@redhat.com>
2547 * syscalls.cc (_write): Change error to EBADF if attempt to write to a
2550 2002-05-08 Corinna Vinschen <corinna@vinschen.de>
2552 * cygheap.h (class cygheap_user): Add member `orig_psid'.
2553 Add method `orig_sid()'.
2554 * cygheap.cc (cygheap_user::set_sid): Maintain orig_psid.
2556 2002-04-28 Norbert Schulze <norbert.schulze@web.de>
2558 * localtime.cc (tzsetwall): Use wildabbr if generated timezone name
2561 2002-05-05 Pierre Humblet <pierre.humblet@ieee.org>
2563 * spawn.cc (spawn_guts): Move call to set_process_privilege()
2564 to load_registry_hive().
2565 * registry.cc (load_registry_hive): ditto.
2566 * fork.cc (fork_parent): Call sec_user_nih() only once.
2568 2002-05-04 Christopher January <chris@atomice.net>
2570 * path.h (path_conv::path_conv): Initialise normalized_path to NULL.
2572 2002-05-03 Christopher Faylor <cgf@redhat.com>
2574 * net.cc (getdomainname): Change second argument of getdomainname to
2577 2002-05-03 Christopher January <chris@atomice.net>
2579 * fhandler_proc.cc (proc_listing): Add '.' and '..' to directory
2581 (fhandler_proc::open): Change use of mode to flags. If the file does
2582 not exist already, fail with EROFS if O_CREAT flag is set. Change
2583 EROFS error to EACCES error when writing to a file. Use cmalloc to
2584 allocate memory for filebuf.
2585 (fhandler_proc::close): Use cfree to free filebuf.
2586 (fhandler_proc::get_proc_fhandler): Properly detect attempts to access
2588 * fhandler_process.cc (process_listing): Add '.' and '..' to directory
2590 (fhandler_process::open): Use cmalloc to allocate memory for filebuf.
2591 (fhandler_process::close): Use cfree to free filebuf.
2592 * fhandler_registry.cc (registry_listing): Add . and '..' to directory
2594 (fhandler_registry::open): Move check for open for writing before
2595 open_key. Use cmalloc to allocate memory for filebuf.
2596 (fhandler_registry::close): Use cfree to free filebuf.
2597 (fhandler_registry::telldir): Use lower 16 bits of __d_position as
2598 position in directory.
2599 (fhandler_registry::seekdir): Ditto.
2600 * fhandler_virtual.cc (fhandler_virtual::write): Change EROFS error to
2602 (fhandler_virtual::open): Set the NOHANDLE flag.
2603 (fhandler_virtual::dup): Add call to fhandler_base::dup. Allocate
2604 child's filebuf using cmalloc. Copy filebuf from parent to child.
2605 (fhandler_virtual::close): Use cfree to free filebuf.
2606 (fhandler_virtual::~fhandler_virtual): Ditto.
2607 (from Chris Faylor <cgf@redhat.com>).
2608 (fhandler_registry::readdir): Add support for '.' and '..' files in
2609 subdirectories of /proc/registry.
2610 * path.cc (path_conv::check): Do not return ENOENT if a file is not
2613 2002-05-02 Christopher Faylor <cgf@redhat.com>
2615 * fhandler_proc.cc (fhandler_proc::fstat): Use fhandler name rather
2616 than path_conv name.
2617 (fhandler_proc::open): Ditto.
2618 * fhandler_process.cc (fhandler_process::fstat): Use fhandler name
2619 rather than path_conv name.
2620 (fhandler_process::open): Ditto.
2621 * fhandler_registry.cc (fhandler_registry::fstat): Use fhandler name
2622 rather than path_conv name.
2623 (fhandler_registry::open): Ditto.
2624 * path.cc (path_conv::check): Don't copy posix path when virtual.
2625 (mount_info::conv_to_win32_path): Don't zero string when isproc. Just
2626 derive normal windows path.
2628 * path.h (path_conv::clear_normalized_path): Declare new method.
2629 * path.cc (path_conv::clear_normalized_path): Define new method.
2630 * dtable.cc (build_fhandler_from_name): Clear normalized path when
2631 finished to conserve space.
2633 2002-05-02 Christopher Faylor <cgf@redhat.com>
2635 * fhandler_proc.cc (fhandler_proc::fstat): Prime with information from
2636 fhandler_base::fstat. Use defines rather than constants for permission
2639 2002-04-30 Eric Blake <ebb9@email.byu.edu>
2641 * path.cc (hash_path_name): Improve hash function strength.
2643 2002-05-02 Robert Collins <rbtcollins@hotmail.com>
2645 * thread.cc (__pthread_cond_dowait): Fix a race on signalling from a
2646 thread woken by the same condition variable it's signalling on. Thanks
2647 to Michael Beach for the report and test case.
2649 2002-05-02 Christopher Faylor <cgf@redhat.com>
2651 * path.h (pathconv_arg): Add PC_POSIX.
2652 (path_conv): Add normalized_path field.
2653 * path.cc (path_conv::~path_conv): New destructor.
2654 (path_conv::check): Set normalized_path, where appropriate.
2655 * dtable.cc (build_fhandler_from_name): Use normalized path from
2657 * syscalls.cc (chroot): Ditto.
2659 * cygheap.h: Remove path_prefix_p declaration.
2661 2002-02-26 Christopher January <chris@atomice.net>
2662 Christopher Faylor <cgf@redhat.com> (minor fixups)
2664 * Makefile.in: Add fhandler_proc.o, fhandler_registry.o,
2665 fhandler_process.o and fhandler_virtual.o.
2666 * dtable.cc (dtable::build_fhandler): Add entries for FH_PROC,
2667 FH_REGISTRY and FH_PROCESS. Set unix_name to the normalized posix
2669 * fhandler.h: Add constants for FH_PROC, FH_REGISTRY and FH_PROCESS.
2670 Add class declarations for fhandler_virtual, fhandler_proc,
2671 fhandler_registry and fhandler_virtual. Update fhandler_union
2673 * fhandler_proc.cc: New file. Add implementation for fhandler_proc.
2674 * fhandler_virtual.cc: New file. Add implementation for
2676 * fhandler_process.cc: New file. Add implementation for
2678 * fhandler_registry.cc: New file. Add implementation for
2680 * path.cc (isproc): New macro.
2681 (isvirtual_dev): Ditto.
2682 * path.cc (path_conv::check): Add check for virtual devices.
2683 * path.cc (mount_info::conv_to_win32_path): Convert paths in /proc to
2685 * path.cc (chdir): Replace check for FH_CYGDRIVE with more generic
2686 isvirtual_dev macro. Force setting of posix path for virtual
2688 * path.h (path_prefix_p): Declare.
2691 Wed May 1 16:06:02 2002 Jason Tishler <jason@tishler.net>
2693 * include/cygwin/types.h: Include <sys/sysmacros.h>.
2695 Wed Apr 17 11:27:04 2002 Jason Tishler <jason@tishler.net>
2697 * security.cc (get_lsa_srv_inf): Prevent extraneous backslashes for
2700 2002-04-12 Corinna Vinschen <corinna@vinschen.de>
2702 * net.cc (cygwin_accept): Set socket type for accepted socket.
2703 (socketpair): Set socket type for both sockets.
2705 2002-04-12 Egor Duda <deo@logos-m.ru>
2707 * fhandler.h (class fhandler_socket): New member to store socket type.
2708 (fhandler_socket::get_socket_type): Access it.
2709 (fhandler_socket::set_socket_type): Ditto.
2710 * net.cc (cygwin_socket): Store socket type.
2711 (cygwin_connect): Disable security checks for connectionless sockets.
2712 (cygwin_accept): Ditto.
2714 2002-04-09 Mark Bradshaw <bradshaw@staff.crosswalk.com>
2716 * cygwin.din: Add strptime.
2717 * include/cygwin/version.h: Increment API version number.
2719 2002-04-09 Corinna Vinschen <corinna@vinschen.de>
2721 * fork.cc (fork_child): Call fixup_mmaps_after_fork() somewhat earlier.
2723 2002-04-09 Corinna Vinschen <corinna@vinschen.de>
2725 * fhandler.cc (fhandler_base::open): Set read-only bit in
2726 file_attributes when adequate.
2728 2002-03-28 Christopher Faylor <cgf@redhat.com>
2730 * times.cc (gettimeofday): Fix typo in previous patch.
2732 2002-03-27 Wu Yongwei <adah@netstd.com>
2734 * times.cc (gettimeofday): Revert to setting timezone info if tz !=
2737 2002-03-21 Christopher Faylor <cgf@redhat.com>
2739 * fhandler_disk_file.cc (fhandler_disk_file::fstat_helper): Always set
2740 st_[ug]id to value derived from get_file_attributes.
2742 2002-03-21 Christopher Faylor <cgf@redhat.com>
2744 * spawn.cc (find_exec): Return input if file not found.
2746 2002-03-19 Boris Schaeling <boriss@web.de>
2748 * poll.cc (poll): Add support for invalid descriptors.
2750 2002-03-15 Robert Collins <rbtcollins@hotmail.com>
2752 * fhandler.h (fhandler_termios::lseek): Override lseek.
2753 * fhandler_termios.cc (fhandler_termios::lseek): Implement this.
2755 2002-03-15 Christopher Faylor <cgf@redhat.com>
2757 * cygserver.cc: Include stdlib.h for exit declaration.
2758 * threaded_queue.cc: Ditto.
2760 2002-03-15 Christopher Faylor <cgf@redhat.com>
2762 * pinfo.cc (pinfo::init): Use PID_ALLPIDS flag to control when a
2763 redirected block should be marked as nonexistent.
2764 (winpids::add): Use PID_ALLPIDS when looking for all pids.
2765 * cygwin.h (PID_ALLPIDS): New enum element.
2767 2002-03-15 Corinna Vinschen <corinna@vinschen.de>
2769 * glob.c (stat32_to_STAT): New function.
2770 (g_lstat): Call user space functions always with 32 bit struct stat
2773 * include/glob.h (struct glob): Don't prototype function pointers
2774 when compiling Cygwin.
2776 2002-03-14 Christopher Faylor <cgf@redhat.com>
2778 * pinfo.cc (pinfo::init): Properly handle execed process stub when
2779 PID_NOREDIR is specified.
2781 2002-03-13 Boris Schaeling <boriss@web.de>
2783 * poll.cc (poll): Remove variable open_fds. Rearrange and add code to
2784 fix settings of revents.
2786 2002-03-13 Corinna Vinschen <corinna@vinschen.de>
2788 * mmap.cc (mmap_record::map_map): Return -1 if VirtualProtect fails.
2789 (list::erase): New method with no argument. Erase latest record
2791 (mmap64): Fail if map_map() fails.
2793 2002-03-12 Corinna Vinschen <corinna@vinschen.de>
2795 * sysconf.cc (sysconf): Fix condition.
2797 2002-03-11 Corinna Vinschen <corinna@vinschen.de>
2799 * mmap.cc (msync): Check area given by addr and len for being a
2800 contigeous mmap'd region.
2802 2002-03-11 Corinna Vinschen <corinna@vinschen.de>
2804 * fork.cc (fork_child): Call fixup_mmaps_after_fork() before
2805 closing parent process handle. Call fixup_mmaps_after_fork()
2806 with parent process handle as parameter.
2807 * mmap.cc (mmap_record::access): New method.
2808 (fixup_mmaps_after_fork): Take process handle as parameter.
2809 In case of FILE_MAP_COPY access, copy valid memory regions to child.
2810 * pinfo.h (fixup_mmaps_after_fork): Change prototype accordingly.
2812 2002-03-07 Corinna Vinschen <corinna@vinschen.de>
2814 * autoload.cc (NetGetDCName): Add symbol.
2815 (NetServerEnum): Remove symbol.
2816 * security.cc (get_lsa_srv_inf): Call NetGetDCName() instead of
2817 NetServerEnum() since it's faster. Don't call it at all if machine
2818 is not a domain member.
2820 2002-03-06 Christopher Faylor <cgf@redhat.com>
2822 * path.cc (normalize_posix_path): Avoid runs of '.'s > 2.
2824 2002-03-05 Christopher Faylor <cgf@redhat.com>
2826 * errno.cc: Change EPERM associated text to "Operation not permitted"
2829 2002-03-05 Christopher Faylor <cgf@redhat.com>
2831 * fhandler_socket.cc (fhandler_socket::close): Respond to signals while
2832 looping, waiting for socket to close. Superstitiously clear last error
2833 when WSAEWOULDBLOCK.
2835 2002-03-05 Robert Collins <rbtcollins@hotmail.com>
2837 * cygserver_transport_pipes.cc (transport_layer_pipes::transport_layer_pipes):
2838 Always init - until static members work correctly.
2839 * shm.cc (shmget): Initialize the security descriptor - thanks Corinna!
2840 * include/sys/ipc.h: Make the ipc control constants partitioned off from the sem
2843 2002-03-04 Christian Lestrade <christian.lestrade@free.fr>
2845 * include/sys/termios.h: Define _POSIX_VDISABLE. Define CCEQ macro.
2846 * fhandler_termios.cc: Include <sys/termios.h>.
2847 (line_edit): Recognize disabled c_cc[] chars. Ignore VDISCARD when
2850 2002-03-04 Dmitry Timoshkov <dmitry@baikal.ru>
2852 * syscalls.cc (truncate64): Use ftruncate64 directly to not lose
2855 2002-03-04 Robert Collins <rbtcollins@hotmail.com>
2857 * cygserver_shm.cc (delete_shmnode): New function.
2858 (client_request_shm::serve): Use it.
2860 2002-03-04 Robert Collins <rbtcollins@hotmail.com>
2862 * cygserver_shm.cc (client_request_shm::serve): Implement SHM_DETACH.
2863 * shm.cc (shmdt): Implement.
2865 2002-03-04 Robert Collins <rbtcollins@hotmail.com>
2867 * cygserver_shm.cc: Run indent.
2868 (deleted_head): New global for storing shm id's pending deletion.
2869 (client_request_shm::serve): Return ENOSYS for invalid request types.
2870 Implement SHM_DEL - delete a shm id.
2871 * cygserver_shm.h (SHM_DEL): New type value.
2872 * shm.cc (delete_inprocess_shmds): New function, does what it's name implies.
2873 (shmctl): Implement shm_rmid control type.
2875 2002-03-04 Robert Collins <rbtcollins@hotmail.com>
2877 * Makefile.in (install): Remove install-bin to allow make install to work.
2879 2002-03-03 Robert Collins <rbtcollins@hotmail.com>
2881 * shm.cc (shmat): Prevent a compile error.
2882 (shmdt): Set errno as this function is incomplete.
2884 2002-02-28 Christopher Faylor <cgf@redhat.com>
2886 * times.cc: Remove if 0'd code. Clean up slightly.
2888 2002-02-28 Robert Collins <rbtcollins@hotmail.com>
2890 * Merge cygwin_daemon into head minus the new shm and ipc exports.
2892 2002-02-28 Robert Collins <rbtcollins@hotmail.com>
2894 * fhandler_tty.cc (fhandler_tty_slave::open): More debugging.
2895 (fhandler_tty_slave::read): Fix printf type for the handle.
2896 * tty.cc (tty::common_init): Add a FIXME for security.
2898 2002-01-29 Robert Collins <rbtcollins@hotmail.com>
2900 * Makefile.in (OBJS): Remove duplicate localtime.o.
2902 2002-01-17 Robert Collins <rbtcollins@hotmail.com>
2904 * cygserver.cc (check_and_dup_handle): Consolidate the two variants for
2906 Add Some basic debug output.
2907 (client_request_attach_tty::serve): Use the new debug_printf for clarity.
2908 Mark the duplicated handles as inheritable - fixup_after_fork() doesn't reopen
2911 2002-01-16 Robert Collins <rbtcollins@hotmail.com>
2913 * cygserver.cc (transport): Correct scope.
2914 (client_request_attach_tty::serve): Add more debug information.
2915 Fix erroneous use of transport instead of conn.
2916 * cygserver_transport_pipes.cc (transport_layer_pipes::close): More debug.
2917 (transport_layer_pipes::read): Ditto.
2918 (transport_layer_pipes::write): Ditto.
2919 (transport_layer_pipes::impersonate_client): Ditto.
2921 Mon Oct 8 7:41:00 2001 Robert Collins <rbtcollins@hotmail.com>
2923 * cygserver.cc (server_request::process): Rename client_request_shm_get to
2925 * cygserver_process.cc (process_cache::add): Rename to add_task.
2926 Use process_cleanup instead of process_request.
2927 (process_cache::remove_process): New method.
2928 (process::process): Initialize new members.
2929 (process::~process): New member.
2930 (process::cleanup): New method.
2931 (process::add_cleanup_routine): New method.
2932 (process_request::process): Rename to process_cleanup.
2933 Call the process object's cleanup method and then delete it.
2934 (process_process_param::request_loop): Remove the signalling process.
2935 * cygserver_shm.cc: Globally rename client_request_shm_get to client_request_shm.
2936 (client_request_shm_get::serve): Handle attach request counting.
2937 * cygserver_shm.h: Globally rename client_request_shm_get to client_request_shm.
2938 (class shm_cleanup): New class.
2939 * shm.cc: Globally rename client_request_shm_get to client_request_shm.
2940 (client_request_shm::client_request_shm): New constructor for attach requests.
2942 * include/cygwin/cygserver_process.h (class process_request): Rename to
2944 (class cleanup_routine): New class.
2945 (class process): New members and methods to allow calling back when the process
2948 Thu Oct 4 14:12:00 2001 Robert Collins <rbtcollins@hotmail.com>
2949 * cygserver.cc (request_loop): Make static.
2950 (main): Use new cache constructor syntax.
2951 Start cache worker threads.
2952 Cleanup the cache at shutdown.
2953 * cygserver_process.cc: Run indent.
2954 (process_cache::process_cache): Add a trigger to use when adding a process.
2955 (process_cache::process): Move process_entry to process.
2956 Insert at the end of the list.
2957 Trigger the request loop when new process's inserted.
2958 (process_cache::process_requests): Do it.
2959 (process_cache::add): New method.
2960 (process_cache::handle_snapshot): New method.
2961 (process::process): Merge in the process_entry fields.
2962 (process::handle): Make a stub function.
2963 (process::exit_code): New method.
2964 (process_request::process): New method.
2965 (process_process_param::request_loop): New method.
2966 * cygserver_shm.cc: New header dependency - threaded_queue.h.
2967 * threaded_queue.cc (threaded_queue::cleanup): Clearer messages.
2968 (queue_process_param::stop): Short spinlock on interruptible threads.
2969 * threaded_queue.h (class threaded_queue): New constructor.
2970 * include/cygwin/cygserver_process.h (process_request): New class.
2971 (process_entry): Remove.
2972 (process): Merge in process_entry.
2973 (process_cache): Inherit from threaded_queue.
2975 Tue Oct 2 23:24:00 2001 Robert Collins <rbtcollins@hotmail.com>
2977 * cygserver.cc (class server_process_param): Use new constructor syntax.
2978 * cygserver_process.cc (process_cache::~process_cache): New function.
2979 * threaded_queue.cc: Define condition debug_printf.
2981 (threaded_queue::cleanup): Move queue_process_param guts to a method.
2982 (threaded_queue::process_requests): Ditto.
2983 (queue_process_param::queue_process_param): New method.
2984 (queue_process_param::~queue_process_param): Ditto.
2985 (queue_process_param::start): Ditto.
2986 (queue_process_param::stop): Ditto.
2987 * threaded_queue.h (class queue_process_param): Add support for
2988 interruptible request loops.
2989 * cygwin/include/cygwin/cygserver_process.h (class process_cache): Add
2992 Tue Oct 2 23:24:00 2001 Robert Collins <rbtcollins@hotmail.com>
2994 * cygserver_client.cc: New flag allow_daemon to disable the daemon completely.
2995 (cygserver_request): Check it.
2996 (cygserver_init): Ditto.
2997 * environ.cc (parse_thing): Add (no)daemon option.
2999 Tue Oct 2 23:00:00 2001 Robert Collins <rbtcollins@hotmail.com>
3001 * shm.cc: Update to handle include changes from HEAD.
3003 Tue Oct 2 16:06:00 2001 Robert Collins <rbtcollins@hotmail.com>
3005 * Makefile.in: Remove cygserver_shm.o from cygwin1.dll.
3006 Rename cygserver_shm_outside.o to cygserver_shm.o.
3007 * cygserver.cc (server_request::process): Use the new client_request
3009 * cygserver_client.cc: Remove the #ifdef's stubs for the server method
3011 (client_request_attach_tty::client_request_attach_tty): Use the new
3012 client_request constructor.
3013 (client_request_shutdown::client_request_shutdown): Ditto.
3014 (client_request::client_request): Ditto.
3015 * cygserver_shm.cc (client_request_shm_get::serve): Remove the
3016 #ifdef'd stub for in-cygwin builds.
3017 (client_request_shm_get::client_request_shm_get): Use the new
3018 client_request constructor, and remove the in-cygwin variants.
3019 * cygserver_shm.h (class client_request_shm_get): #ifndef test the
3020 serve method - it's only used in cygserver.
3021 * shm.cc (client_request_shm_get::client_request_shm_get): New function.
3022 * include/cygwin/cygserver.h (request_header): New constructor.
3023 (class client_request): Use it.
3024 New constructor accepting the header size.
3025 #ifndef test the server method - it's only used within cygserver.
3026 (client_request_get_version): #ifdef test the server method.
3027 (client_request_shutdown): Ditto.
3028 (client_request_attach_tty): Ditto.
3030 Tue Oct 2 9:57:00 2001 Robert Collins <rbtcollins@hotmail.com>
3032 * Makefile.in: add threaded_queue.o to cygserver.exe.
3033 * cygserver.cc: Include threaded_queue.h
3034 (class server_request): Inherit from queue_request.
3035 (class server_process_param): Inherit from queue_process_param.
3036 (class server_request_queue): Inherit from threaded_queue.
3037 (request_loop): Adjust for new types.
3038 (server_request_queue::process_requests): Remove guts to
3039 threaded_queue::process_requests.
3040 (server_request::server_request): Adjust for new types.
3041 (worker_function): Delete.
3042 (server_request_queue::create_workers): Delete.
3043 (server_request_queue::cleanup): Delete.
3044 (server_request_queue::add): Move guts to threaded_queue::add.
3045 * threaded_queue.cc: New file.
3046 * threaded_queue.h: New file.
3048 Mon Oct 1 12:38:00 2001 Robert Collins <rbtcollins@hotmail.com>
3050 * cygserver.cc (client_request::serve): New function.
3051 * cygserver_process.cc: Inlude <pthread.h> for pthread_once.
3052 (process_cache::process_cache): Initialise a crtiical section for write access.
3053 (process_cache::process): Use the critical section. Also add missing entries to
3055 (do_process_init): New function to initalise class process static variables.
3056 (process::process): Ensure that the process access critical section is
3058 (process::handle): Close the handle of old process's when they have terminated
3059 and we are returning the handle for a process with the same pid.
3060 * cygserver_shm.cc: Run indent.
3061 Include cygserver_process.h to allow process cache functionality.
3062 (client_request_shm_get::serve): New parameter for process cache support.
3063 Use the process cache, not OpenProcess to get a handle to the originating process.
3064 Fix a handle leak with token_handle.
3065 * cygserver_shm.h (class client_request_shm_get): Update ::serve for process
3067 * cygserver_transport_pipes.cc: Redefine debug_printf to be conditional on DEBUG.
3068 * include/cygwin/cygserver.h: Do not implement client_request::serve in the
3070 * include/cygwin/cygserver_process.h (class process_cache): Add a write access
3071 critical section to prevent races when requests from a multithreaded
3074 Sun Sep 30 23:41:00 2001 Robert Collins <rbtcollins@hotmail.com>
3076 * Makefile.in: Add cygserver_process.o to cygserver.exe.
3077 * cygserver.cc: Include signal.h and cygwin_version.h.
3078 Define debug_printf as a macro.
3079 Define DEBUG to a value.
3080 (client_request_attach_tty::serve): Add beginning of process cache support.
3081 Change from #ifdef DEBUG to work with new DEBUG style.
3082 (client_request_get_version::serve): Add beginning of process cache support.
3083 (class server_request): New prototype for support of process cache.
3084 (class queue_process_param): New class to allow request loop threading.
3085 (class server_request_queue): Add beginning of process cache support.
3086 Allow request loop threading.
3087 (request_loop): Thread function for request loops.
3088 (server_request_queue::process_requests): Initiator for threaded request loops.
3089 (client_request_shutdown::serve): Add beginning of process cache support.
3090 (server_request::server_request): Ditto.
3091 (server_request::process): Use debug_printf. Add beginning of process cache
3093 (server_request_queue::cleanup): Kill off any request loop threads.
3094 (server_request_queue::add): Add beginning of process cache support.
3095 (handle_signal): Trigger a shutdown.
3096 (main): Print out some useful info at startup - version, date time.
3097 Add process cache support.
3098 Spawn a separate thread for the transport request loop, thus allowing concurrent
3099 support for multiple transports.
3100 * cygserver_client.cc (client_request_get_version::serve): Add process cache
3102 (client_request_attach_tty::serve): Add process cache support.
3103 (client_request_shutdown::serve): Add process cache support.
3104 * cygsserver_process.cc: New file with the process cache support.
3105 * cygserver_shm.cc: Redefine debug_printf to allow conditional output.
3106 * cygwin.din: Export shmdt().
3107 * shm.cc: Run indent.
3109 (shmdt): New function.
3110 * include/cygwin/cygserver.h (class client_request): Add process cache support.
3111 (class client_request_get_version): Ditto.
3112 (class client_request_shutdown): Ditto.
3113 (class client_request_attach_tty): Ditto.
3114 * include/cygwin/cygserver_process.h: New header for process cache support.
3116 Sun Sep 30 8:52:00 2001 Robert Collins <rbtcollins@hotmail.com>
3118 * include/cygwin/cygserver_transport.h: Add copyright header.
3119 * include/cygwin/cygserver_transport_pipes.h: Ditto.
3120 * include/cygwin/cygserver_transport_sockets.h: Ditto.
3122 Sat Sep 29 20:40:00 2001 Robert Collins <rbtcollins@hotmail.com>
3124 * Makefile.in: Add cygserver_transport_sockets.o to DLL_OFILES.
3125 Add cygserver_transport_sockets_outside.o to cygserver.exe.
3126 * cygserver.cc: Include new include files.
3127 * cygserver_client.cc: Ditto.
3128 * cygserver_shm.h: No need to include <sys/socket.h> now.
3129 * cygerver_transport.cc: Include new include files.
3130 (transport_layer_base::transport_layer_base): Strip back to a stub.
3131 (transport_layer_base::listen): Ditto.
3132 (transport_layer_base::accept): Ditto.
3133 (transport_layer_base::close): Ditto.
3134 (transport_layer_base::read): Ditto.
3135 (transport_layer_base::write): Ditto.
3136 (transport_layer_base::connect): Ditto.
3137 * cygserver_transport_pipes.cc: Include new header
3138 "cygwin/cygserver_transport_pipes.h".
3139 * cygserver_transport_sockets.cc: New file.
3140 * dcrt0.cc: No need to include <sys/socket.h> now.
3141 * fhandler_tty.cc: Ditto.
3143 * include/cygwin/cygserver_transport.h: Strip the base class to a stub.
3144 Remove the cygserver_transport_pipes class.
3145 * include/cygwin/cygserver_transport_pipes.h: New file.
3146 * include/cygwin/cygserver_transport_sockets.h: New file.
3148 Tue Sep 25 16:22:00 2001 Robert Collins <rbtcollins@hotmail.com>
3150 * autoload.cc: Add dynamic load statement for 'ImpersonateNamedPipeClient'.
3151 * Makefile.in: Add new object files, and build instructions for cygserver.exe.
3152 * cygwin.din: Export ftok, shmat, shmctl and shmget.
3153 * dcrt0.cc: Additional includes for cygserver support.
3154 (dll_crt0_1): Initialise the cygserver client.
3155 * fhandler.h (fhandler_tty): New method cygserver_attach_tty.
3156 * fhandler_tty.cc: Additional includes for cygserver support.
3157 (fhandler_tty_slave::open): Attempt to use the cygserver when obtaining
3158 handles from the parent process. On failure or 9x use the current method.
3159 (fhandler_tty_slave::cygserver_attach_tty): New function.
3160 * fork.cc (fork_child): Fixup shm memory mapped areas.
3161 * pinfo.h: Declare fixup_shms_after_fork().
3162 * security.h: Declare alloc_sd().
3163 * tty.cc: Additonal includes to support cygserver.
3164 (tty::common_init): Don't allow others to open us if the cygserver is running.
3165 * winsup.h: Declare cygserver_running.
3166 * cygserver.cc: New file.
3167 * cygserver_client.cc: New file.
3168 * cygserver_shm.cc: New file.
3169 * cygserver_shm.h: New file.
3170 * cygserver_transport.cc: New file.
3171 * cygserver_transport_pipes.cc: New file.
3174 * include/cygwin/cygserver.h: New file.
3175 * include/cygwin/cygserver_transport.h: New file.
3176 * include/sys/ipc.h: New file.
3177 * include/sys/shm.h: New file.
3179 2002-02-28 Robert Collins <rbtcollins@hotmail.com>
3181 * thread.cc (semaphore::TryWait): Set errno as required by posix 1003.1.
3182 (__sem_wait): Ditto.
3183 (__sem_trywait): Ditto.
3185 2002-02-27 Christopher Faylor <cgf@redhat.com>
3187 * include/cygwin/version.h: Bump DLL minor number.
3189 2002-02-23 Corinna Vinschen <corinna@vinschen.de>
3191 * cygwin.din (fstat64): New symbol.
3192 (ftruncate64): Ditto.
3199 (truncate64): Ditto.
3200 * dir.cc (telldir64): New function.
3201 (telldir): Call telldir64().
3202 (seekdir64): New function.
3203 (seekdir): Call seekdir64().
3204 * fhandler.h: Redefine all methods using __off32_t to use __off64_t.
3205 * fhandler.cc: Use __off64_t and struct __stat64 throughout.
3206 * fhandler_clipboard.cc: Ditto.
3207 * fhandler_disk_file.cc: Ditto.
3208 * fhandler_dsp.cc: Ditto.
3209 * fhandler_floppy.cc: Ditto.
3210 * fhandler_mem.cc: Ditto.
3211 * fhandler_random.cc: Ditto.
3212 * fhandler_socket.cc: Ditto.
3213 * fhandler_tape.cc: Ditto.
3214 * fhandler_zero.cc: Ditto.
3216 * glob.c: Ditto, call lstat64 and stat64 in Cygwin.
3217 * mmap.cc: Use __off64_t throughout.
3218 (mmap64): New function.
3219 * sec_acl.cc (acl_worker): Use struct __stat64, call stat64 and lstat64.
3220 * syscalls.cc (lseek64): New function.
3221 (stat64_to_stat32): Ditto.
3225 (ftruncate64): Ditto.
3226 (truncate64): Ditto.
3227 (_fstat): Call fstat64.
3228 (_stat): Call stat64.
3229 (cygwin_lstat): Rename to avoid declaration problem. Call lstat64.
3230 (stat_worker): Use struct __stat64.
3232 (ftruncate): Call ftruncate64.
3233 (truncate): Call truncate64.
3234 * wincap.cc: Set flag has_64bit_file_access appropriately.
3235 * wincap.h: Add flag has_64bit_file_access.
3236 * winsup.h (ILLEGAL_SEEK): Define as __off64_t.
3237 (stat_dev): Declare using struct __stat64.
3238 (stat_worker): Ditto.
3239 * include/cygwin/stat.h (struct __stat32): Define if compiling Cygwin.
3240 (struct __stat64): Ditto.
3241 (struct stat): Revert definition with explicitly sized datatypes.
3242 Eliminate sized field names.
3243 * include/cygwin/types.h (blksize_t): New type.
3244 (__blkcnt32_t): Ditto.
3245 (__blkcnt64_t): Ditto.
3248 2002-02-22 Christopher Faylor <cgf@redhat.com>
3250 * sync.h (new_muto): Just accept an argument which denotes the name of
3251 the muto. Use this argument to construct static storage.
3252 * cygheap.cc (cygheap_init): Reflect above change.
3253 * exceptions.cc (events_init): Ditto.
3254 * malloc.cc (malloc_init): Ditto.
3255 * path.cc (cwdstuff::init): Ditto.
3256 * cygheap.h (cwdstuff): Change name of lock element to make it less
3258 * path.cc (cwdstuff::get_hash): Ditto.
3259 (cwdstuff::get_initial): Ditto.
3260 (cwdstuff::set): Ditto.
3261 (cwdstuff::get): Ditto.
3262 * sigproc.cc (proc_subproc): Ditto.
3264 * debug.cc (lock_debug): Change to method. Use method rather than
3267 * tty.h (tty_min::kill_pgrp): Declare new method.
3268 * fhandler_termios.cc (tty_min::kill_pgrp): New method.
3269 (fhandler_termios::line_edit): Use new method for killing process.
3270 * dcrt0.cc (do_exit): Ditto.
3272 * dtable.cc (dtable::get_debugger_info): New method for inheriting
3273 dtable info from a debugger.
3274 * tty.cc (tty_init): Attempt to grab file handle info from parent
3275 debugger, if appropriate.
3277 # dtable.cc (dtable::stdio_init): Make this a method.
3278 (dtable::init_std_file_from_handle): Don't set fd unless it's not open.
3279 (dtable::build_fhandler_from_name): Move name setting to
3280 dtable::build_fhandler.
3281 (dtable::build_fhandler): Add win32 name parameter.
3282 * dcrt0.cc (dll_crt0_1): Change to use dtable stdio_init.
3283 * dtable.h (dtable): Reflect build_fhandler parameter change.
3284 * mmap.cc (mmap_record::alloc_fh): Don't set name parameter in
3286 * net.cc (fdsock): Remove set_name call since it is now handled by
3289 * sigproc.cc (proc_subproc): Release muto as early as possible.
3291 2001-02-22 Corinna Vinschen <corinna@vinschen.de>
3293 * smallprint.c (rn): Allow long long values.
3294 (__small_vsprintf): Add 'D', 'U' and 'X' formats for long long
3297 2002-02-19 Christopher Faylor <cgf@redhat.com>
3299 * fhandler.cc (fhandler_base::puts_readahead): Remove default parameter
3300 setting. Newer gcc's complain about this.
3301 (fhandler_base::set_readahead_valid): Ditto.
3302 * fhandler_dsp.cc (Audio::open): Ditto.
3303 (fhandler_dev_dsp::open): Ditto.
3305 2002-02-19 Christopher Faylor <cgf@redhat.com>
3307 * fork.cc (fork_parent): Use sec_user_nih to control process/thread
3308 inheritance/permission.
3309 * spawn.cc (spawn_guts): Ditto.
3310 * security.cc (create_token): Initialize token so that it is not tested
3311 for bogus value later. Use sec_user to control process/thread
3313 * security.h (__sec_user): Rename declaration from sec_user.
3314 (sec_user_nih): Declare here as inline function wrapper for __sec_user.
3316 * sigproc.cc (czombies): Allocate a character array for zombies to
3317 avoid constructor overhead
3318 (extremely hackish, I know).
3319 (cpchildren): Ditto.
3320 (pchildren): New define.
3322 (getsem): Use sec_user_nih to control semaphore inheritance/permission.
3324 2002-02-16 Christopher Faylor <cgf@redhat.com>
3326 * times.cc (hires::prime): Restore thread priority on failure
3329 * uinfo.cc (uinfo_init): Use more robust method for determining if
3330 process was invoked from a non-cygwin process.
3332 * sync.h (muto::init): Eliminate "inheritance" parameter.
3333 (new_muto): Reflect removal of parameter.
3334 * sync.cc (muto::init): Ditto.
3335 * cygheap.cc (cygheap_init): Ditto.
3336 * debug.cc (threadname_init): Ditto.
3337 * exceptions.cc (events_init): Ditto.
3338 * malloc.cc (malloc_init): Ditto.
3339 * path.cc (cwdstuff::init): Ditto.
3340 * sigproc.cc (sigproc_init): Ditto.
3342 * grp.cc (group_lock): Use different method for locking with static
3344 (read_etc_group): REALLY ensure that read lock mutex is released.
3345 * passwd.cc (passwd_lock): Use different method for locking with static
3347 (read_etc_passwd): REALLY ensure that read lock mutex is released.
3349 * shared.cc (sec_user): Correct reversed inheritance test.
3351 2002-02-15 Christopher Faylor <cgf@redhat.com>
3353 * hires.h (hires::usecs): Rename from utime. Accept an argument.
3354 * strace.cc (strace::microseconds): Use hires class for calculating
3356 * sync.h (new_muto): Use NO_COPY explicitly in declaration.
3357 * times.cc (gettimeofday): Reflect change in usecs argument.
3358 (hires::usecs): Ditto. Changed name from utime.
3359 * winsup.h (NO_COPY): Add nocommon attribute to force setting aside
3361 * regcomp.c (REQUIRE): Add a void cast to bypass a warning.
3363 2002-02-15 Christopher Faylor <cgf@redhat.com>
3365 * hires.h: New file.
3366 * times.cc (gettimeofday): Use hires class for calculating current time.
3367 (hires::prime): New method.
3368 (hires::utime): Ditto.
3370 2002-02-14 Christopher Faylor <cgf@redhat.com>
3372 * include/sys/cygwin.h (cygwin_getinfo_types): New CW_STRACE_ACTIVE.
3373 * external.cc (cygwin_internal): Handle CW_STRACE_ACTIVE.
3375 2002-02-14 Christopher Faylor <cgf@redhat.com>
3377 * exceptions.cc (unused_sig_wrapper): Eliminate unused parameter to
3379 * external.cc (cygwin_internal): Change CW_STRACE_ON to
3381 * strace.cc (strace::hello): Toggle strace on and off.
3382 * sync.cc (muto::init): Rename from constructor.
3383 * sync.h (muto::new): Delete.
3384 (muto::delete): Ditto.
3385 (new_muto): Simplify. Use muto.init for nearly everything.
3386 * uinfo.cc (uinfo_init): Avoid closing a NULL handle.
3387 * include/sys/cygwin.h (cygwin_getinfo_types): Rename CW_STRACE_OFF to
3388 CW_STRACE_TOGGLE. Delete CW_STRACE_OFF.
3389 * include/sys/strace.h (strace): Add "inited" field.
3391 2001-02-12 Corinna Vinschen <corinna@vinschen.de>
3393 * include/cygwin/acl.h: Fix definition of aclent_t.
3395 2002-02-10 Christopher Faylor <cgf@redhat.com>
3397 * Makefile.in (DLL_OFILES): Consolidate object files.
3399 2002-02-10 Corinna Vinschen <corinna@vinschen.de>
3401 * child_info.h, cygheap.h, fhandler_clipboard.cc, fhandler_dsp.cc,
3402 fhandler_floppy.cc, fhandler_mem.cc, fhandler_random.cc,
3403 fhandler_tape.cc, fhandler_zero.cc, grp.cc, mmap.cc, passwd.cc,
3404 pinfo.cc, pinfo.h, pipe.cc, sec_acl.cc, sec_helper.cc, security.cc,
3405 security.h, thread.h, uinfo.cc, include/cygwin/acl.h: Fix copyright.
3407 2002-02-10 Corinna Vinschen <corinna@vinschen.de>
3409 * child_info.h, cygheap.h, dcrt0.cc, dir.cc, fhandler.cc, fhandler.h,
3410 fhandler_clipboard.cc, fhandler_disk_file.cc, fhandler_dsp.cc,
3411 fhandler_floppy.cc, fhandler_mem.cc, fhandler_random.cc,
3412 fhandler_tape.cc, fhandler_zero.cc, grp.cc, mmap.cc, passwd.cc,
3413 pinfo.cc, pinfo.h, pipe.cc, sec_acl.cc, sec_helper.cc, security.cc,
3414 security.h, spawn.cc, syscalls.cc, thread.h, uinfo.cc, winsup.h:
3415 Change usage of uid_t to __uid16_t, gid_t to __gid16_t and
3416 off_t to __off32_t throughout. Use INVALID_UID, INVALID_GID and
3417 INVALID_SEEK instead casting -1 to the appropriate type.
3418 * winsup.h: Define INVALID_UID, INVALID_GID and INVALID_SEEK.
3419 * include/cygwin/acl.h: Define internal __aclent16_t and __aclent32_t
3420 types. Don't declare acl functions when compiling Cygwin.
3421 * include/cygwin/grp.h: Declare getgrgid() and getgrnam() with
3422 correct types for internal usage.
3424 2002-02-10 Corinna Vinschen <corinna@vinschen.de>
3426 Patch suggested by Pierre A. Humblet <Pierre.Humblet@ieee.org>:
3427 * uinfo.cc (internal_getlogin): Try evaluating user by SID even if
3429 (uinfo_init): Set primary group even if ntsec is off.
3431 2002-02-09 Corinna Vinschen <corinna@vinschen.de>
3433 * include/cygwin/grp.h: New file.
3434 * include/cygwin/stat.h: Ditto.
3435 * include/cygwin/types.h: Add definitions for __off32_t,
3436 __off64_t, off_t, __uid16_t, __uid32_t, uid_t, __gid16_t,
3437 __gid32_t and gid_t.
3438 * include/sys/cygwin.h: Use correct uid and gid types.
3440 2002-02-09 Corinna Vinschen <corinna@vinschen.de>
3442 * dtable.cc (dtable::dup2): Revert previous patch.
3443 * fhandler.h: Ditto.
3444 (fhandler_socket::recv): Define new method.
3445 (fhandler_socket::send): Ditto.
3446 * fhandler_socket.cc (fhandler_socket::recv): New method.
3447 (fhandler_socket::send): Ditto.
3448 (fhandler_socket::read): Call fhandler_socket::recv() now.
3449 (fhandler_socket::write): Call fhandler_socket::send() now.
3450 * net.cc (class wsock_event): Move definition to wsock_event.h.
3451 (fdsock): Revert previous patch.
3452 (cygwin_recv): Move implementation to fhandler_socket::recv().
3453 (cygwin_send): Move implementation to fhandler_socket::send().
3454 * wsock_event.h: New file.
3456 2002-02-06 Alexander Gottwald <Alexander.Gottwald@s1999.tuchemnitz.de>
3458 * net.cc (get_2k_ifconf): Create interface entries for tokenring cards.
3460 2002-02-08 Corinna Vinschen <corinna@vinschen.de>
3462 * dtable.cc (dtable::dup2): Store fd for fhandler_socket.
3463 * fhandler.h (fhandler_base::set_fd): New virtual method.
3464 (fhandler_base::get_fd): Ditto.
3465 (fhandler_socket::set_fd): Ditto.
3466 (fhandler_socket::get_fd): Ditto.
3467 * fhandler_socket.cc (fhandler_socket::read): Call cygwin_recv instead
3468 of native Winsock recv.
3469 (fhandler_socket::write): Call cygwin_send instead of native Winsock
3471 * net.cc (fdsock): Store fd in fhandler_socket.
3473 2002-02-07 Corinna Vinschen <corinna@vinschen.de>
3475 * net.cc (cygwin_getsockname): Fix handling of NULL sun_path.
3477 2002-01-29 Corinna Vinschen <corinna@vinschen.de>
3479 * net.cc (getdomainname): Fix registry key for 9x systems, too.
3481 2002-01-29 Corinna Vinschen <corinna@vinschen.de>
3483 * net.cc (getdomainname): Fix registry key for NT systems.
3485 2002-01-28 Christopher Faylor <cgf@redhat.com>
3487 * external.cc (cygwin_internal): Initialize various internal settings
3488 if required to allow use of some things from user loaded DLL.
3489 (CW_STRACE_ON): Add new feature.
3490 (CW_CYGWIN_PID_TO_WINPID): Ditto.
3491 * pinfo.cc (set_myself): Call "strace.hello" to initiate possible
3493 (pinfo::init): Guard against dereferencing uninitialized myself.
3494 * sigproc.cc (wait_sig): Call strace.hello() when __SIGTRACE "signal"
3496 * strace.cc (strace::hello): New method.
3497 * wincap.cc (wincapc::init): Avoid initializing if already initialized.
3498 * wincap.h (wincapc::wincapc): New method.
3499 * include/sys/cygwin.h: Add new CW_ enums. Kludge typedefs of
3500 {g,u}id_t if required.
3501 * strace.h (strace::hello): Declare new method.
3503 2002-01-28 Earnie Boyd <earnie@users.sf.net>
3505 * include/sys/strace.h (_STRACE_ON): Define.
3506 (_STRACE_OFF): Ditto.
3508 2002-01-24 Christopher Faylor <cgf@redhat.com>
3510 * speclib: Ensure that temporary def file is removed.
3512 2002-01-23 Christopher Faylor <cgf@redhat.com>
3514 * speclib: Use rm -f to remove temp file just to quiet any potential
3517 2002-01-23 Corinna Vinschen <corinna@vinschen.de>
3519 * security.cc (create_token): Use sec_user() to create
3520 SECURITY_ATTRIBUTES structure for primary token. Use
3521 MAXIMUM_ALLOWED access rights instead of TOKEN_ALL_ACCESS.
3523 2002-01-23 Corinna Vinschen <corinna@vinschen.de>
3525 * path.cc (symlink): Fix check for already existing file.
3527 2002-01-21 Christopher Faylor <cgf@redhat.com>
3529 * cygmagic: Suppress error output when figuring out if sum takes an
3532 2002-01-21 Christopher Faylor <cgf@redhat.com>
3534 * cygmagic: Attempt to figure out if sum takes an option.
3536 2002-01-21 DJ Delorie <dj@redhat.com>
3538 * Makefile.in (libpthread.a): Pass the assembler also.
3541 * speclib: Specify the assembler to dlltool.
3543 2002-01-21 Christopher Faylor <cgf@redhat.com>
3545 * include/cygwin/version.h: Bump DLL minor number.
3547 2002-01-21 Corinna Vinschen <corinna@vinschen.de>
3549 * grp.cc (getgrgid): Don't return default gid entry when ntsec is on.
3550 * syscalls.cc (setegid): Don't set primary group in process token.
3552 2002-01-21 Christopher Faylor <cgf@redhat.com>
3554 * speclib: Don't use /dev/null as DLL name. Just default to what's
3555 already in .def file.
3557 2002-01-21 Christopher Faylor <cgf@redhat.com>
3559 * exceptions.cc (sig_handle): Remove last vestiges of SA_NOCLDSTOP code
3560 which caused SIGCHLD to be ignored.
3562 2002-01-20 Christopher Faylor <cgf@redhat.com>
3564 * include/cygwin/version.h: Bump DLL minor number.
3566 2002-01-20 Christopher Faylor <cgf@redhat.com>
3568 * syscalls.cc (regfree): Make dll_export.
3570 2002-01-20 Christopher Faylor <cgf@redhat.com>
3572 * exceptions.cc (ctrl_c_handler): Convert windows pid to cygwin pid
3573 when detecting if we should actually handle CTRL-C.
3575 2002-01-19 Christopher Faylor <cgf@redhat.com>
3577 * Makefile.in (new-cygwin1.dll): Revert previous change. libsupc++.a
3578 is only available in libstdc++-v3.
3580 2002-01-19 Christopher Faylor <cgf@redhat.com>
3582 * exceptions.cc (sig_handle_tty_stop): Don't send SIGCHLD if parent
3584 (sig_handle): Don't check for SA_NOCLDSTOP here. We don't have enough
3587 2002-01-19 Christopher Faylor <cgf@redhat.com>
3589 * include/cygwin/version.h: Bump DLL minor number.
3591 2002-01-19 Christopher Faylor <cgf@redhat.com>
3593 * Makefile.in (new-cygwin1.dll): Just use -lsupc++ for link.
3594 * sigproc.cc (proc_exists): Change existence criteria.
3595 * sync.h (new_muto): Add volatile to definition to avoid gcc
3596 optimization problems.
3598 2002-01-19 Corinna Vinschen <corinna@vinschen.de>
3600 * include/cygwin/version.h: Bump API minor version to 51.
3602 2002-01-19 Mark Bradshaw <bradshaw@staff.crosswalk.com>
3604 * cygwin.din: Add recvmsg and sendmsg.
3605 * net.cc: Add cygwin_recvmsg and cygwin_sendmsg.
3606 * /usr/include/sys/socket.h: Add recvmsg and sendmsg.
3608 2002-01-19 Corinna Vinschen <corinna@vinschen.de>
3610 * security.cc (create_token): Close processes token handle as soon
3611 as it's not used anymore.
3613 2002-01-17 Corinna Vinschen <corinna@vinschen.de>
3615 * Makefile.in: Add fnmatch.o to DLL_OFILES.
3616 * cygwin.din: Add fnmatch export symbol.
3617 * fnmatch.c: New file.
3618 * include/fnmatch.h: Ditto.
3619 * include/cygwin/version.h: Bump API minor version to 50.
3621 2002-01-15 Corinna Vinschen <corinna@vinschen.de>
3623 * path.cc (fchdir): Call chdir with full windows path.
3625 2002-01-14 Corinna Vinschen <corinna@vinschen.de>
3627 * dir.cc: Use INVALID_FILE_ATTRIBUTES instead of "(DWORD) -1"
3628 for file attributes throughout.
3629 * fhandler.cc: Ditto.
3630 * fhandler_disk_file.cc: Ditto.
3633 * syscalls.cc: Ditto.
3634 * times.cc (utimes): Use path_conv::isdir() instead of explicit
3635 GetFileAttributes() call.
3637 2002-01-13 Christopher Faylor <cgf@redhat.com>
3639 * dcrt0.cc (multiple_cygwin_problem): Clarify logic and make
3640 CYGWIN_MISMATCH_OK more powerful.
3642 2002-01-10 Christopher Faylor <cgf@redhat.com>
3644 * exceptions.cc (sig_handle): Accept a second argument indicating
3645 whether the signal came from this process or not.
3646 * sigproc.h: Reflect sig_handle arg change.
3647 * signal.cc (kill_pgrp): Add sigframe info.
3648 (abort): New function. Eliminates newlib function of same name.
3649 * sigproc.cc (wait_sig): Pass "signal from this process" value as arg
3652 2002-01-10 Corinna Vinschen <corinna@vinschen.de>
3654 * syscalls.cc (pathconf): Guard _PC_PATH_MAX branch against invalid
3657 2002-01-09 Christopher Faylor <cgf@redhat.com>
3658 Robert Collins <rbtcollins@hotmail.com>
3660 * exceptions.cc (early_stuff_init): Rename from misnamed
3661 set_console_handler.
3662 (ctrl_c_handler): Attempt to work around potential signal duplication
3663 during process startup.
3664 (sig_handle): Ignore SIGINT when we're just an "exec stub".
3665 * spawn.cc (spawn_guts): Store pid of spawned process in global for use
3667 * dcrt0.cc (dll_crt0_1): Call renamed initialization function.
3668 * winsup.h: Reflect function name change.
3670 2002-01-08 Corinna Vinschen <corinna@vinschen.de>
3672 * net.cc (cygwin_accept): Set sun_path for newly connected socket.
3674 2002-01-07 Ralf Habacker <Ralf.Habacker@freenet.de>
3676 * Makefile.in: Add uninstall target.
3678 2002-01-07 Christopher Faylor <cgf@redhat.com>
3680 * sigproc.cc (getsem): Clean up debugging output.
3682 2002-01-07 Christopher Faylor <cgf@redhat.com>
3684 * sigproc.cc (getsem): Set errno when unable to create own semaphore.
3685 Reorganize to make clearer that error should only come from initial
3686 creation of process semaphore.
3688 2002-01-06 Christopher Faylor <cgf@redhat.com>
3690 * dtable.cc (dtable::init_std_file_from_handle): Add some defensive
3691 code to invalid handle case.
3693 2002-01-06 Corinna Vinschen <corinna@vinschen.de>
3695 * ioctl.cc (ioctl): Make third argument optional.
3696 * include/sys/ioctl.h: Ditto in declaration.
3697 * dtable.cc (dtable::init_std_file_from_handle): Revert previous
3699 * window.cc (WndProc): Raise SIGURG instead of SIGIO in case of FD_OOB
3702 2002-01-05 Christopher Faylor <cgf@redhat.com>
3704 * dir.cc (opendir): Guarantee release of alloced fhandler structure on
3707 2002-01-05 Corinna Vinschen <corinna@vinschen.de>
3709 * exceptions.cc (sig_handle): Set default action for SIGURG to SIG_IGN.
3711 2002-01-05 Corinna Vinschen <corinna@vinschen.de>
3713 * dtable.cc (dtable::init_std_file_from_handle): Don't treat NULL
3714 handle as errorneous.
3716 2002-01-04 Christopher Faylor <cgf@redhat.com>
3718 * cygmagic: Change logic for equality test.
3720 2002-01-04 Christopher Faylor <cgf@redhat.com>
3722 * dir.cc (opendir): Don't attempt to call sub-opendir if ENOENT.
3724 2002-01-04 Corinna Vinschen <corinna@vinschen.de>
3726 * net.cc: Replace usage of AF_UNIX by Posix compliant AF_LOCAL
3728 (socketpair): Explicitly allow SOCK_STREAM and SOCK_DGRAM socket types
3729 in families AF_UNIX and AF_LOCAL. Explicitly allow PF_UNSPEC, PF_LOCAL
3730 and PF_INET protocols. Return error otherwise. Implement datagram
3733 2002-01-01 Christopher Faylor <cgf@redhat.com>
3735 * speclib: Remove temp files automatically.
3737 2002-01-01 Corinna Vinschen <corinna@vinschen.de>
3738 * fhandler.h (fhandler_socket::sun_path): New private member.
3739 (fhandler_socket::set_sun_path): New method.
3740 (fhandler_socket::get_sun_path): Ditto.
3741 * fhandler_socket.cc (fhandler_socket::fhandler_socket): Initialize
3743 (fhandler_socket::~fhandler_socket): Free sun_path if needed.
3744 (fhandler_socket::set_sun_path): New method.
3745 * net.cc (cygwin_bind): Set sun_path to path of local socket file.
3746 (cygwin_getsockname): Add code to return correct sockaddr for unix