1 2002-12-30 Christopher Faylor <cgf@redhat.com>
3 * windows.cc (setitimer): Return ENOSYS on invalid argument.
5 2002-12-28 Christopher Faylor <cgf@redhat.com>
7 * fhandler_termios.cc (fhandler_termios::line_edit): Perform echo
8 before input is accepted or suffer a "race".
10 2002-12-27 Christopher Faylor <cgf@redhat.com>
12 * fhandler.h (fhandler_tty_master::set_winsize): Declare new function.
13 * fhandler_console.cc (fhandler_console::send_winch_maybe): If
14 appropriate, call tty master function to handle screen size change.
15 * fhandler_tty.cc (fhandler_tty_master::set_winsize): New function.
16 (fhandler_tty_master::init): Call set_winsize to set initial screen
19 2002-12-26 Christopher Faylor <cgf@redhat.com>
21 * fhandler_tty.cc (fhandler_tty_master::init): Set initial size of tty
22 to that of console in which tty is operating.
23 (process_input): Semi-revert previous change. Need to just use current
24 terminfo settings since this function is running in a thread, blocked
25 when the terminfo changes.
27 2002-12-26 Christopher Faylor <cgf@redhat.com>
29 * fhandler.h (fhandler_termios::line_edit): Replace third argument with
30 passed-in termios struct.
31 * fhandler_console.cc (fhandler_console::read): Prior to loop, make a
32 copy of current termios for passing to line_edit prior so that all
33 characters are processed consistently.
34 * fhandler_tty.cc (fhandler_pty_master::write): Ditto.
35 (process_input): Make a copy of curent termios prior to read for use in
37 * fhandler_termios.cc (fhandler_termios::line_edit): Replace third
38 parameter with passed-in termios struct and use it throughout rather
39 than the data from the current fhandler_termios class.
41 2002-12-25 Christopher Faylor <cgf@redhat.com>
43 * include/cygwin/version.h: Bump DLL minor number.
45 2002-12-25 Christopher Faylor <cgf@redhat.com>
47 * exceptions.cc (events_init): Initialize critical section to control
49 (signal_exit): Enter critical section early to avoid exit races with
51 * dcrt0.cc (do_exit): Use exit_lock critical section to avoid races.
53 2002-12-25 Christopher Faylor <cgf@redhat.com>
55 * cygthread.cc (cygthread::detach): Set errno with set_sig_errno so
56 that EINTR is properly restored after signal.
58 2002-12-21 Christopher Faylor <cgf@redhat.com>
60 * Makefile.in: Default fhandler objects to -fomit-frame-pointer.
61 Eliminate redundant CFLAGS settings.
63 2002-12-20 Christopher Faylor <cgf@redhat.com>
65 * fhandler.h (line_edit_status): Reorganize so that tests for error
66 condition can be < or >.
67 * fhandler_tty.cc (fhandler_pty_master::write): Don't return after
70 * fhandler_termios.cc (fhandler_termios::line_edit): Trivial change to
71 use built-in bool types.
73 2002-12-19 Pierre Humblet <pierre.humblet@ieee.org>
75 * localtime.cc (tzsetwall): Set lcl_is_set and lcl_TZname
76 in the Cygwin specific part of the routine.
78 2002-12-19 Pierre Humblet <pierre.humblet@ieee.org>
80 * fhandler.cc (fhandler_base::open): Use "flags" rather than "mode"
81 in Win9X directory code.
83 2002-12-19 Steve Osborn <bub@io.com>
85 * fhandler.h (line_edit_status): Add a new element.
86 * fhandler_termios.cc (fhandler_termios::line_edit): After
87 accept_input, handle both potential error condition and pipe full
89 * fhandler_tty.cc (fhandler_pty_master::accept_input): Return -1 on
91 (fhandler_pty_master::write): Handle pipe full condition.
93 2002-12-16 Steve Osborn <bub@io.com>
94 Christopher Faylor <cgf@redhat.com>
96 * fhandler_termios.cc (fhandler_termios::line_edit): Return
97 line_edit_error and remove last char from readahead buffer if
99 * fhandler_tty.cc (fhandler_pty_master::accept_input): Return 0 and
100 restore readahead buffer when tty slave pipe is full.
102 2002-12-16 Christopher Faylor <cgf@redhat.com>
104 * pinfo.cc (_pinfo::cmdline): Allocate sufficient space for myself
107 2002-12-14 Steve Osborn <bub@io.com>
109 * fhandler_termios.cc (fhandler_termios::line_edit): Call
110 accept_input() in character processing loop. Set return value
111 independently of input_done.
113 2002-12-14 Christopher Faylor <cgf@redhat.com>
115 * fhandler.cc (fhandler_base::read): Signal event, if necessary, and
116 raw_read hasn't done so.
118 2002-12-14 Christopher Faylor <cgf@redhat.com>
120 * fhandler.cc (fhandler_base::raw_read): Reset priorities to minimize
121 window where thread termination may cause data loss.
122 (fhandler_base::read): Always return at end of function. Just set len
123 to copied_chars when len is zero. Return immediately after raw_read if
124 len <= 0. Remove in_len setting and just check end instead. Fix CRLF
125 handling at end of buffer.
127 2002-12-14 Corinna Vinschen <corinna@vinschen.de>
129 * dcrt0.cc (dll_crt0_1): Call well known SID initializer function.
130 * security.h (cygsid::init): Declare new static method.
131 * sec_helper.cc (cygsid::init): New method for initializing well
134 2002-12-14 Pierre Humblet <pierre.humblet@ieee.org>
136 * security.h: Declare well_known_creator_group_sid.
137 * sec_helper.cc: Define and initialize well_known_creator_group_sid.
139 2002-12-14 Corinna Vinschen <corinna@vinschen.de>
141 * netdb.cc: Remove strtok_r comment.
143 2002-12-14 Pierre Humblet <pierre.humblet@ieee.org>
145 * security.cc (get_user_local_groups): Use LookupAccountSid to find the
146 local equivalent of BUILTIN.
148 2002-12-14 Christopher Faylor <cgf@redhat.com>
150 * pipe.cc (make_pipe): Set fork fixup flag for read pipe.
152 2002-12-14 Christopher Faylor <cgf@redhat.com>
154 * winbase.h: Turn on inline versions of Interlocked* by default.
156 2002-12-14 Gary R. Van Sickle <g.r.vansickle@worldnet.att.net>
158 * winbase.h: Fixup inline asm functions. Add ilockcmpexch.
160 2002-12-13 Christopher Faylor <cgf@redhat.com>
162 Throughout, change fhandler_*::read and fhandler_*::raw_read to void
163 functions whose second arguments are both the length and the return
165 * fhandler.cc (fhandler_base::read): Rework slightly to use second
166 argument as input/output. Tweak CRLF stuff.
167 (fhandler_base::readv): Accommodate fhandler_*::read changes.
168 * cygthread.h (cygthread::detach): Declare as taking optional handle
170 (cygthread::detach): When given a handle argument, wait for the handle
171 to be signalled before waiting for thread to detach. Return true when
174 2002-12-12 Corinna Vinschen <corinna@vinschen.de>
176 * Makefile.in: Add MINGW_LDFLAGS when linking cygrun.exe.
178 2002-12-10 Christopher Faylor <cgf@redhat.com>
180 * cygthread.h (cygthread::stack_ptr): New element.
181 (cygthread::detach): Accept a "wait_for_signal" argument.
182 (cygthread::terminate_thread): New function.
183 * cygthread.cc (cygthread::stub): Set stack pointer argument.
184 (cygthread::terminate_thread): New function. Forcibly terminate
186 (cygthread::detach): Optionally wait for signals and kill thread when
188 * exceptions.cc (signal_exit): Set signal_arrived prior to exiting to
189 wake up anything blocking on signals.
190 * fhandler.h (fhandler_base::set_r_no_interrupt): Change to accept bool
192 (fhandler_pipe::ready_for_read): Declare.
193 * pipe.cc (pipeargs): New structure.
194 (read_pipe): New thread stub wrapper for normal pipe read.
195 (fhandler_pipe::read): Modify to call reader in a cygthread,
196 terminating on signal, as appropriate.
197 * select.cc (fhandler_pipe::ready_for_read): Define new function.
199 2002-12-10 Corinna Vinschen <corinna@vinschen.de>
201 * net.cc (free_protoent_ptr): Add missing free() for base structure.
202 (free_servent_pt): Ditto.
203 (free_hostent_pt): Ditto.
205 2002-12-10 Craig McGeachie <slapdau@yahoo.com.au>
207 * netdb.cc (parse_alias_list): Change strtok calls to strtok_r.
208 (parse_services_line): Ditto.
209 (parse_protocol_line): Ditto.
211 2002-12-10 Pierre Humblet <pierre.humblet@ieee.org>
213 * pwdgrp.h (pwdgrp_check::pwdgrp_state): Replace by
214 pwdgrp_check::isinitializing ().
215 (pwdgrp_check::isinitializing): Create.
216 * passwd.cc (grab_int): Change type to unsigned, use strtoul and set
217 the pointer content to 0 if the field is invalid.
218 (parse_pwd): Move validity test after getting pw_gid.
219 (read_etc_passwd): Replace "passwd_state <= " by
220 passwd_state::isinitializing ().
221 (internal_getpwuid): Ditto.
222 (internal_getpwnam): Ditto.
225 * grp.cc (parse_grp): Use strtoul for gr_gid and verify the validity.
226 (read_etc_group): Replace "group_state <= " by
227 group_state::isinitializing ().
228 (internal_getgrgid): Ditto.
230 (internal_getgrent): Ditto.
232 2002-12-10 Pierre Humblet <pierre.humblet@ieee.org>
234 * security.h: Move declarations of internal_getgrent,
235 internal_getpwsid and internal_getgrsid to pwdgrp.h.
236 * pwdgrp.h: Declare internal_getpwsid, internal_getpwnam,
237 internal_getpwuid, internal_getgrsid, internal_getgrgid,
238 internal_getgrnam, internal_getgrent and internal_getgroups.
239 Delete "emulated" from enum pwdgrp_state.
240 (pwdgrp_check::isuninitialized): Create.
241 (pwdgrp_check::pwdgrp_state): Change state to initializing
242 rather than to uninitialized.
243 (pwdgrp_read::gets): Remove trailing CRs.
244 * passwd.cc (grab_string): Don't look for NLs.
246 (parse_pwd): Don't look for CRs. Return 0 if entry is too short.
247 (search_for): Delete.
248 (read_etc_passwd): Simplify tests to actually read the file.
249 Set state to loaded before making internal_getpwXX calls.
250 Replace search_for calls by equivalent internal_pwgetXX calls.
251 (internal_getpwsid): Use passwd_state.isuninitialized to decide
252 to call read_etc_passwd.
253 (internal_getpwuid): Create.
254 (internal_getpwnam): Create.
255 (getpwuid32): Simply call internal_getpwuid.
256 (getpwuid_r32): Call internal_getpwuid.
257 (getpwnam): Simply call internal_getpwnam.
258 (getpwnam_r): Call internal_getpwnam.
259 * grp.cc (parse_grp): Don't look for CRs. Adjust blank space.
260 (add_grp_line): Adjust blank space.
261 (class group_lock): Ditto.
262 (read_etc_group): Simplify tests to actually read the file.
263 Set state to loaded before making internal_getgrXX calls.
264 Replace getgrXX calls by equivalent internal calls.
265 (internal_getgrsid): Use group_state.isuninitialized to decide
266 to call read_etc_group.
267 (internal_getgrgid): Create.
268 (internal_getgrnam): Create.
269 (getgroups32): Simply call internal_getgrgid.
270 (getgrnam32): Simply call internal_getgrnam.
271 (internal_getgrent): Call group_state.isuninitialized.
272 (internal_getgroups): Create from the former getgroups32, using
273 two of the four arguments. Set gid to myself->gid and username
274 to cygheap->user.name ().
275 (getgroups32): Simply call internal_getgroup.
276 (getgroups): Call internal_getgroup instead of getgroups32.
277 (setgroups32): Call internal versions of get{pw,gr}XX.
278 * sec_helper.cc: Include pwdgrp.h.
279 (is_grp_member): Call internal versions of get{pw,gr}XX.
280 * security.cc: Include pwdgrp.h.
281 (alloc_sd): Call internal versions of get{pw,gr}XX.
282 * syscalls.cc: Include pwdgrp.h.
283 (seteuid32): Call internal versions of get{pw,gr}XX.
285 * uinfo.cc: Include pwdgrp.h.
286 (internal_getlogin): Call internal versions of get{pw,gr}XX.
287 (cygheap_user::ontherange): Ditto.
288 * sec_acl.cc: Include pwdgrp.h.
289 (setacl): Call internal versions of get{pw,gr}XX.
290 (acl_access): Ditto and simplify logic.
291 (aclfromtext): Ditto.
293 2002-12-09 2002-12-02 Egor Duda <deo@logos-m.ru>
295 * lib/pseudo-reloc.c: New file.
296 * lib/_cygwin_crt0_common.cc: Perform pseudo-relocs during
297 initialization of cygwin binary (.exe or .dll).
299 2002-12-06 Christopher Faylor <cgf@redhat.com>
301 * cygwin.din: Reflect name change from strtodf to strtof. Export
303 * include/cygwin/version.h: Bump API minor number.
305 2002-12-04 Steve Osborn <bub@io.com>
307 * fhandler.h (fhandler_termios::line_edit): Change return from an int
308 to an enum to allow the function to return an error.
309 * fhandler_console.cc (fhandler_console::read): Update the line_edit
310 call to use the new enum.
311 * fhandler_termios.cc (fhandler_termios::line_edit): Change return from
312 an int to an enum to allow the function to return an error. Put
313 put_readahead call before doecho for future patch.
314 * fhandler_tty.cc (fhandler_pty_master::write): Change to call
315 line_edit one character at a time, and stop if an error occurs.
317 2002-12-04 Craig McGeachie <slapdau@yahoo.com.au>
319 * netdb.cc: New file.
320 * Makeile.in (DLL_OFILES): Add reference to the new netdb.cc file.
321 * cygwin.din : Add new aliased exports for service and protocol
322 enumerations in netdb.cc.
324 2002-12-04 Thomas Pfaff <tpfaff@gmx.net>
326 * cxx.cc: New file. Implement new, new[], delete and delete[]
327 operators and __cxa_pure_virtual if compiled by gcc >=3.
328 * Makefile.in (DLL_OFILES): Add cxx.o.
329 Remove libstdc++.a from cygwin1.dll link step.
331 2002-11-29 Steve Osborn <bub@io.com>
333 * fhandler_tty.cc (fhandler_pty_master::accept_input): Move
334 read_retval assignment to prevent race condition. Remove read_retval
335 from return statement.
337 2002-11-29 Christopher Faylor <cgf@redhat.com>
339 * pinfo.h (winpids::set): Renamed from init.
340 (winpids::init): New declaration.
341 (winpids::cs): Ditto.
342 (winpids::winpids): Use set rather than init.
343 * external.cc (fillout_pinfo): Ditto.
344 * dcrt0.cc (dll_crt0_1): Call winpids::init.
345 * pinfo.cc (winpids::set): Renamed from init. Wrap calls in critical
347 (winpids::init): New function.
348 (winpids::cs): Define.
350 2002-11-28 Christopher Faylor <cgf@redhat.com>
352 * sigproc.cc (sig_dispatch_pending): Remove assertion.
354 2002-11-27 Christopher Faylor <cgf@redhat.com>
356 * include/cygwin/version.h: Bump DLL minor number.
358 2002-11-27 Mikael Ylikoski <my@post.utfors.se>
360 * fhandler_socket.cc (fhandler_socket::sendto): Fix potential
361 unitialized value return.
363 2002-11-27 Christopher Faylor <cgf@redhat.com>
365 * cygwin.din: Export pthread_getsequence_np.
366 * include/cygwin/version.h: Bump API minor version.
368 2002-11-26 Jason Tishler <jason@tishler.net>
370 * cygwin.din: Export nl_langinfo().
371 * include/cygwin/version.h: Bump API minor version.
373 2002-11-26 Christopher Faylor <cgf@redhat.com>
375 * fhandler_tty.cc (fhandler_pty_master::accept_input): Just use a
376 normal Sleep or suffer amazing pauses when other tty apps are running.
377 (fhandler_pty_master::process_slave_output): Ditto.
379 2002-11-25 Pierre Humblet <pierre.humblet@ieee.org>
381 * passwd.cc (read_etc_passwd): Never add an entry when starting
382 on Win95/98/ME if a default entry is present.
383 * uinfo.cc (internal_getlogin): Look for the default uid if needed.
384 Always call user.set_name ().
386 2002-11-25 Corinna Vinschen <corinna@vinschen.de>
388 * sec_acl.cc (getacl): Set errno to ENOSPC if command is GETACL and
389 nentries is less than the number of entries in the file's ACL.
391 2002-11-24 Corinna Vinschen <corinna@vinschen.de>
393 * sec_acl.cc: Fix some formatting. Only set and check `other' bits in
394 a_perm throughout. Use ILLEGAL_GID id for all entries having no id.
395 (setacl): Fix inheritance condition.
396 (getacl): Set all permission bits in CLASS_OBJ and DEF_CLASS_OBJ
397 entries. Remove DENY bits before returning to calling function.
398 (acltomode): Fix usage of searchace(). If available, use CLASS_OBJ
399 to mask GROUP_OBJ permissions.
400 (aclfrommode): Fix usage of searchace(). If available, set CLASS_OBJ
401 permissions to same value as GROUP_OBJ permissions.
403 2002-11-24 Pierre Humblet <pierre.humblet@ieee.org>
405 * sec_acl.cc (getace): Fix the behavior when allow and
406 deny entries are present in arbitrary order.
407 (getacl): Report the actual number of entries when
408 aclbufp is NULL, even if nentries is zero. Fix the mask
409 reporting, handle the case where the owner and group sids
410 are equal and streamline the code.
411 (acl_worker): Take allow_ntsec into account.
413 2002-11-05 Thomas Pfaff <tpfaff@gmx.net>
415 * dcrt0.cc (dll_crt0_1): Add call to pthread::initMainThread to
416 initialize mainthread when it is safe to call new.
417 * init.cc (dll_entry): Change call to store reents in tls key.
418 * thread.cc (_reent_clib) : Change call to get reents from tls
420 (_reent_winsup): Ditto.
421 (MTinterface::Init): Key handling changed. Remove initialization
423 (MTinterface::fixup_after_fork): Reinitialize mainthread object
424 after fork. Reset threadount to 1.
425 (pthread::initMainThread): Create mainthread object dynamically.
426 and initialize with valid handles.
427 (pthread::self): Remove calls to create thread objects.
428 (pthread::setTlsSelfPointer): Change call to store thread self
430 (pthread::getTlsSelfPointer): New static method.
431 (pthread::exit): Remove setTlsSelfPointer call.
432 (pthread::initCurrentThread): New method.
433 (pthread::thread_init_wrapper): Change call to store thread self
435 (pthread::join): Check for a valid joiner.
436 (pthreadNull::pthreadNull): Mark Null object as detached.
437 (pthreadNull::exit): Terminate thread via ExitThread.
438 * thread.h (pthread::initMainThread): Change parameter in function
440 (pthread::getTlsSelfPointer): New static method.
441 (pthread::initCurrentThread): New method.
442 (MTinterface::reent_key): Remove.
443 (MTinterface::thread_self_dwTlsIndex): Ditto..
444 (MTinterface::indexallocated): Ditto.
445 (MTinterface::mainthread): Ditto.
446 (MTinterface::reent_key): New member.
447 (MTinterface::thread_self_key): Ditto.
448 (MTinterface::MTinterface): Initialize all members.
450 2002-11-23 Christopher Faylor <cgf@redhat.com>
452 * wait.cc (wait4): Force pending signal delivery before waiting for
455 2002-11-23 Christopher Faylor <cgf@redhat.com>
457 * include/cygwin/version.h: Bump DLL minor number.
459 2002-11-22 Christopher Faylor <cgf@redhat.com>
461 * exceptions.cc (handle_sigsuspend): Force pending signal delivery
462 before waiting for signals to happen.
463 * signal.cc (sleep): Force pending signal delivery before sleeping.
465 (signal): Force pending signal delivery before manipulating signal
467 (sigprocmask): Ditto.
468 (kill_worker): Ditto.
471 * syscalls.cc (readv): Force pending signal delivery before I/O.
474 * net.cc: Ditto, throughout.
475 * sigproc.cc (sig_dispatch_pending): Deliver any pending signals prior
478 * tty.cc (tty::make_pipes): Increase pipe buffer size.
480 2002-11-22 Christopher Faylor <cgf@redhat.com>
482 * include/cygwin/version.h: Fix comment.
484 2002-11-21 Igor Pechtchanski <pechtcha@cs.nyu.edu>
486 * external.cc (cygwin_internal): Fix va_arg references.
488 2002-11-21 Christopher Faylor <cgf@redhat.com>
490 * exceptions.cc (sigthread::get_winapi_lock): Just do standard 'give up
492 (setup_handler): Revamp YA to attempt to deliver signal multiple times
493 on failure rather than punting to wait_sig.
494 * miscfuncs.cc (low_priority_sleep): Accept INFINITE sleep to mean
495 "don't reset the priority after setting it to idle". Return previous
497 * winsup.h (SLEEP_0_STAY_LOW): Define.
498 (low_priority_sleep): Return an int.
499 * sigproc.h: Define WAIT_SIG_PRIORITY here.
500 * sigproc.cc: Remove WAIT_SIG_PRIORITY definition.
502 2002-11-20 Pierre Humblet <pierre.humblet@ieee.org>
504 * security.h: Declare internal_getpwsid and internal_getgrsid.
505 Undeclare internal_getpwent. Define DEFAULT_UID_NT. Change
507 * passwd.cc (internal_getpwsid): New function.
508 (internal_getpwent): Suppress.
509 (read_etc_passwd): Make static. Rewrite the code for the completion
510 line. Set curr_lines to 0.
511 (parse_pwd): Change type to static int. Return 0 for short lines.
512 (add_pwd_line): Pay attention to the value of parse_pwd.
513 (search_for): Do not look for nor return the DEFAULT_UID.
514 * grp.cc (read_etc_group): Make static. Free gr_mem and set
515 curr_lines to 0. Always call add_pwd_line. Rewrite the code for the
517 (internal_getgrsid): New function.
518 (parse_grp): If grp.gr_mem is empty, set it to &null_ptr.
519 Never NULL gr_passwd.
520 (getgrgid32): Only return the default if ntsec is off and the gid is
522 * sec_helper.cc (cygsid::get_id): Use getpwsid and getgrsid.
523 (cygsid_getfrompw): Clean up last line.
524 (cygsid_getfromgr): Ditto.
525 (is_grp_member): Use getpwuid32 and getgrgid32.
526 * uinfo.cc (internal_getlogin): Set DEFAULT_GID at start.
527 Use getpwsid. Move the read of /etc/group after the second access
528 to /etc/passwd. Change some debug_printf.
530 2002-11-20 Steven O'Brien <steven.obrien2@ntlworld.com>
532 * poll.cc (poll): ...but set POLLIN instead.
534 2002-11-20 Pierre Humblet <pierre.humblet@ieee.org>
536 * security.cc (get_attribute_from_acl): Always test "anti",
537 just in case an access_denied ACE follows an access_allowed.
538 Handle the case owner_sid == group_sid, with a FIXME.
539 Remove unnecessary tests for non-NULL PSIDs.
540 (alloc_sd): Use existing owner and group sids if {ug}id == -1.
541 Handle case where owner_sid == group_sid.
542 Do not call is_grp_member. Try to preserve canonical ACE order.
543 Remove unnecessary tests for non-NULL PSIDs. Reorganize
545 (get_initgroups_sidlist): Put well_known_system_sid on left
547 (add_access_denied_ace): Only call GetAce if inherit != 0.
548 (add_access_allowed_ace): Ditto. Use appropriate sizeof.
549 * syscalls.cc (chown_worker): Pass {ug}id equal to -1 to
550 alloc_sd, which removes the need to obtain old_{ug}id.
551 (chmod): Remove call to get_file_attribute (), simply pass
552 {ug}id equal to -1 to alloc_sd.
554 2002-11-20 Corinna Vinschen <corinna@vinschen.de>
556 * poll.cc (poll): Don't set POLLERR if a listening socket has a
557 pending connect. Don't use errno value from call to
558 fhandler_socket::recvfrom().
560 2002-11-19 Christopher Faylor <cgf@redhat.com>
562 * net.cc: Sprinkle sigframes throughout.
564 2002-11-16 Christopher Faylor <cgf@redhat.com>
566 * tty.cc (tty::make_pipes): Make pipe buffer larger.
568 2002-11-15 Pierre Humblet <pierre.humblet@ieee.org>
570 * grp.cc (getgroups32): Protect against closing cygheap->user.token.
572 2002-11-15 Christopher Faylor <cgf@redhat.com>
574 * include/cygwin/version.h: Bump API_MINOR to accommodate below
577 002-11-14 Sergey Okhapkin <sos@prospect.com.ru>
579 * cygwin.din (siginterrupt): New export.
580 * signal.cc (siginterrupt): New.
582 2002-11-15 Sergey Okhapkin <sos@prospect.com.ru>
584 * select.cc (peek_serial): Don't call PurgeComm() to avoid characters
587 2002-11-14 Christopher Faylor <cgf@redhat.com>
589 * exceptions.cc (setup_handler): Add debugging output. Set thread
590 priority to idle if pending signals to allow other threads to get into
592 * miscfuncs.cc (sys_mbstowcs): Save current thread in variable to avoid
594 * wait.cc (wait_sig): Reset thread priority each time through loop
595 since the priority may have been set down to deal with pending signals.
597 2002-11-14 Christopher Faylor <cgf@redhat.com>
599 * fhandler_serial.cc (fhandler_serial::tcgetattr): Don't take any
600 special action when vmin_ == 0.
602 2002-11-14 Corinna Vinschen <corinna@vinschen.de>
604 * grp.cc (getgroups32): Revert previous patch. Use impersonation
605 token if process is in impersonated state.
606 * sec_helper.cc (is_grp_member): Rewrite. Call getgroups32 only
607 for current user. Scan passwd and group info otherwise.
609 2002-11-14 Christopher Faylor <cgf@redhat.com>
611 * fhandler_console.cc (fhandler_console::write): Allow characters >=
612 0177 to be displayed in the title bar.
614 2002-11-14 Corinna Vinschen <corinna@vinschen.de>
616 * grp.cc (getgroups32): Don't use access token of current user when
617 retrieving group info for another user.
619 2002-11-13 Christopher Faylor <cgf@redhat.com>
621 * dll_init.cc (dll_list::detach): Eliminate reliance on passed in dll
622 address. Infer from module of caller instead.
623 (cygwin_detach_dll): Ignore dll_index argument.
624 * dll_init.h (dll_list::detach): Reflect argument change above.
626 2002-11-13 Christopher Faylor <cgf@redhat.com>
628 * ioctl.cc (ioctl): Always print ioctl results, even when it's a tty.
630 2002-11-13 Christopher Faylor <cgf@redhat.com>
632 * winsup.h (low_priority_sleep): Declare.
634 2002-11-13 Christopher Faylor <cgf@redhat.com>
636 * miscfuncs.cc (low_priority_sleep): New function. Use throughout
637 where code is supposed to be giving up time slice.
639 * fhandler_console.cc (fhandler_console::read): Switch button 2/3
640 output escape sequences to be consistent with xterm.
642 2002-11-12 Pierre Humblet <pierre.humblet@ieee.org>
644 * syscalls.cc (chmod): Simplify conditional.
645 * sec_helper (cygsid::getfromstr): Reorganize to remove
646 calls to strcpy and strtok_r.
647 (cygsid::getfromgr): Change type to __uid32_t instead of int.
648 Keep only the allow_ntsec branch. Never call LookupAccountSid
649 which calls PDCs, simply return -1 in case of failure.
650 Use cygsid == instead of calling EqualSid and remove test
652 * security.h: Declare cygsid::getfromgr as __uid32_t.
654 2002-11-10 Corinna Vinschen <corinna@vinschen.de>
656 * net.cc: Run indent.
658 2002-11-10 Alexander Gottwald <Alexander.Gottwald@s1999.tu-chemnitz.de>
660 * autoload.cc (GetIfEntry): Add symbol.
661 * net.cc (get_2k_ifconf): Get the interface entries with the GetIfEntry
662 call intead of the GetIfTable call. Clean-up multiple IP address naming.
664 2002-11-09 Sergey Okhapkin <sos@prospect.com.ru>
666 * fhandler.h (class fhandler_pipe): New ioctl() method.
667 * pipe.cc (fhandler_pipe::ioctl): New.
669 2002-11-07 Christopher Faylor <cgf@redhat.com>
671 * fhandler_serial.cc (fhandler_serial::ioctl): Fix typo.
673 2002-11-07 Christopher January <chris@atomice.net>
675 * include/cygwin/fs.h: New file.
676 * include/cygwin/hdreg.h: New file.
677 * fhandler_floppy.cc (fhandler_floppy::ioctl): Add implementation for
678 HDIO_GETGEO, BLKGETSIZE, BLKGETSIZE64, BLKRRPART and BLKSSZGET ioctls.
680 2002-11-07 Gilles Courcoux <Gilles.Courcoux@col.bsf.alcatel.fr>
682 * fhandler_socket.cc (fhandler_socket::ioctl): Return correct flags
683 for loopback interface when name is given on input instead of address.
685 2002-11-07 Jason Tishler <jason@tishler.net>
687 * cygwin.din: Export fseeko() and ftello().
688 * include/cygwin/version.h: Bump API minor version.
690 2002-11-06 Christopher Faylor <cgf@redhat.com>
692 * fhandler_console.cc (keytable[]): Revert previous change. It would
693 break too many things.
695 2002-11-06 Christopher Faylor <cgf@redhat.com>
697 * fhandler_console.cc (keytable[]): Redefine F1 - F5 to something a
698 little more sensical.
700 2002-11-06 Sergey Okhapkin <sos@prospect.com.ru>
702 * syscalls.cc (getutid): Use UT_IDLEN where appropriate.
704 2002-11-06 Christopher Faylor <cgf@redhat.com>
706 * include/cygwin/version.h: Bump API minor number for below export.
708 2002-11-06 Sergey Okhapkin <sos@prospect.com.ru>
710 * cygwin.din (pututline): New exported function.
711 * syscalls.cc (login): Use pututiline().
712 (setutent): Open utmp as read/write.
713 (endutent): Check if utmp file is open.
714 (utmpname): call endutent() to close current utmp file.
715 (getutid): Enable all cases, use strncmp() to compare ut_id fields.
717 * tty.cc (create_tty_master): Set ut_pid to current pid.
719 2002-11-05 Christopher Faylor <cgf@redhat.com>
721 * fhandler_serial.cc (fhandler_serial::ioctl): Don't try to figure out
722 if OS has the capability to retrieve RTS/CTS. Just set default values
723 if DeviceIoControl fails. (suggested by Sergey Okhapkin)
725 2002-11-05 Sergey Okhapkin <sos@prospect.com.ru>
727 * fhandler_serial.cc (fhandler_serial::raw_read): Use correct type for
729 (fhandler_serial::ioctl): Set errno if the ClearCommError fails.
730 (fhandler_serial::tcsetattr): Use correct value for vmin_.
731 (fhandler_serial::tcgetattr): Ditto.
733 2002-11-05 Thomas Pfaff <tpfaff@gmx.net>
735 * fhandler_socket.cc (fhandler_socket::recvmsg): Call if from == NULL
736 WSARecvFrom with fromlen = NULL.
738 2002-11-04 Christopher Faylor <cgf@redhat.com>
740 * pinfo.cc (_pinfo::commune_send): Fix thinko in previous checkin.
742 2002-11-04 Christopher Faylor <cgf@redhat.com>
744 * pinfo.cc (_pinfo::commune_send): Set priority low when sleeping,
745 waiting for commune completion so that we don't spin waiting for lower
748 2002-11-04 Christopher Faylor <cgf@redhat.com>
750 * sigproc.cc (WAIT_SIG_PRIORITY): Bump to THREAD_PRIORITY_TIME_CRITICAL.
752 2002-11-04 Christopher Faylor <cgf@redhat.com>
754 * pinfo.cc (_pinfo::commune_send): Initialize buffer or suffer random
757 2002-11-04 Christopher Faylor <cgf@redhat.com>
759 * fhandler_process.cc (fhandler_process::fill_filebuf): Deal with error
760 condition from cmdline retrieval.
762 2002-11-04 Christopher Faylor <cgf@redhat.com>
764 * sigproc.cc (WAIT_SIG_PRIORITY): Bump to highest priority.
766 2002-11-04 Christopher Faylor <cgf@redhat.com>
768 * include/cygwin/version.h: Bump DLL minor number.
770 2002-11-03 Christopher Faylor <cgf@redhat.com>
772 * fhandler_serial.cc (fhandler_serial::ioctl): Reformat. Set errno
773 appropriately. Exit from the bottom. Correctly deal with third
774 argument for TCFLSH. (Suggested by Sergey Okhapkin)
776 2003-11-03 Sergey Okhapkin <sos@prospect.com.ru>
778 * fhandler_tty.cc (fhandler_tty_slave::ioctl): Do nothing if the new
779 window size is equal to the old one. Send SIGWINCH if slave connected
781 (fhandler_pty_master::ioctl): Do nothing if the new window size is
782 equal to the old one.
784 2002-10-31 Pierre Humblet <pierre.humblet@ieee.org>
786 * fhandler.cc (fhandler_base::open): Verify pc isn't NULL.
788 2002-10-30 Christopher Faylor <cgf@redhat.com>
790 * include/cygwin/version.h: Bump DLL minor number.
792 2002-10-30 Christopher Faylor <cgf@redhat.com>
794 * external.cc (cygwin_internal): Implement CW_CMDLINE.
795 * pinfo.h (SIGCOMMUNE): New signal type.
796 (commune_result): New structure for commune functions.
797 (picom): New enum for commune functions.
798 (_pinfo::hello_pid): New. Pid who's communicating with me.
799 (_pinfo::tothem): New. Handle of communicating pipe.
800 (_pinfo::fromthem): Ditto.
801 (_pinfo::commune_recv): Declare.
802 (_pinfo::commune_send): Declare.
803 (_pinfo::alive): Declare.
804 (_pinfo::cmdline): Declare.
805 (_pinfo::lock): Declare.
806 * pinfo.cc (set_myself): Initialize new _pinfo lock.
807 (_pinfo::alive): Define. Determines if process still exists.
808 (_pinfo::commune_recv): Define. Receive info from another cooperating process.
809 (_pinfo::commune_send): Define. Send info to another cooperating process.
810 (_pinfo::cmdline): Define. Determine command line of a given process.
811 * include/sys/cygwin.h (CW_CMDLINE): Define.
813 *sigproc.cc (talktome): Communicate with any processes who want to talk
815 (wait_sig): Honor __SIGCOMMUNE.
817 * fhandler.cc (fhandler_virtual::fixup_after_exec): Declare.
818 * fhandler_proc.cc: Use malloc/free/realloc throughout rather than
819 cmalloc since buffers don't need to be propagated to subprocesses.
820 * fhandler_registry.cc: Ditto.
821 * fhandler_virtual.cc: Ditto.
822 (fhandler_virtual::fixup_after_exec): Define.
823 * fhandler_process.cc: Ditto for malloc/free/realloc.
824 (process_listin): Add "cmdline".
825 (fhandler_process::fill_filebuf): Implement PROCESS_CMDLINE.
827 * miscfuncs.cc (isalpha_array): New array populated with xor values for
828 alpha characters to switch from one case to another.
829 * string.h (cygwin_strcasematch): New asm implementation of case match.
830 * string.h (cygwin_nstrcasematch): New asm implementation of counted
833 2002-10-24 Pierre Humblet <pierre.humblet@ieee.org>
835 * pwdgrp.h (pwdgrp_read::open): Compare fh to INVALID_HANDLE_VALUE.
837 2002-10-22 Christopher Faylor <cgf@redhat.com>
839 * fhandler_disk_file.cc (fhandler_disk_file::fstat_helper): Nevermind.
840 Revert everything to previous state wrt ntsec and exec bits.
842 2002-10-22 Christopher Faylor <cgf@redhat.com>
844 * shared.cc (shared_info::initialize): Use correct value for version
846 * include/cygwin/version.h (CYGWIN_VERSION_MAGIC): Use all of a DWORD
847 for magic calculation.
849 2002-10-22 Christopher Faylor <cgf@redhat.com>
851 * fhandler_disk_file.cc (fhandler_disk_file::fstat_helper): Oops. Only
852 do the executable thing for #! scripts since .exe files wouldn't be
853 executable in ntsec case regardless.
855 2002-10-22 Christopher Faylor <cgf@redhat.com>
857 * fhandler_disk_file.cc (fhandler_disk_file::fstat_helper): Always
858 consider .exe files and '#!' shell scripts to be executable.
860 2002-10-22 Christopher Faylor <cgf@redhat.com>
862 * cygthread.cc (cygthread::exiting): New variable.
863 (cygthread::initialized): Delete.
864 (cygthread::stub): Use exiting variable to determine when to exit.
865 (cygthread::runner): Delete.
866 (cygthread_protect): New variable.
867 (cygthread::init): Don't start runner thread. Initialize muto for list
869 (cygthread::freerange): Return pointer to cygthread.
870 (cygthread::operator new): Change logic to start threads on an
872 (cygthread::detach): Don't zero id.
873 (cygthread::terminate): Don't kill any executing threads. Just set
875 * cygthread.h (cygthread): Reflect above changes.
876 * dcrt0.cc (dll_crt0_1): Move cygthread initialization later.
878 * fork.cc (fork_child): Do fdtab fixup after dll fixup or (apparently)
879 winsock may allocate memory in dll load address.
881 2002-10-22 Pierre Humblet <pierre.humblet@ieee.org>
883 * sec_helper.cc (cygsid::get_id): If the sid matches a sid stored in
884 cygheap->user, return the uid or gid from myself.
885 * security.cc (alloc_sd): If gid == myself->gid, return the group sid
886 from cygheap->user. Remove the test for uid == original_uid, which is
889 2002-10-22 Christopher Faylor <cgf@redhat.com>
891 * cygheap.cc (cygheap_fixup_in_child): Use user_heap element in
893 (init_cheap): Ditto for declaration.
894 * fork.cc (fork_parent): Use user_heap element in cygheap.
895 * heap.h (inheap): Ditto.
896 * heap.cc (sbrk): Ditto.
897 (heap_init): Ditto. Reorganize to shrink heap chunk as required and
898 record new value in cygheap.
899 * dcrt0.cc (dll_crt0_1): More "move the cygthread init" games.
900 * shared.cc (open_shared): Rework memory protection to properly deal
901 with relocated shared segment.
902 (shared_info::heap_chunk_size): Rename element to 'heap_chunk'.
903 * shared_info.h (shared_info): Ditto for declaration.
904 * strace.cc (strace::hello): Report on heap chunk size from cygheap
907 2002-10-20 Christopher Faylor <cgf@redhat.com>
909 Change _function() to function() throughout.
910 * cygwin.din: Remove last vestiges (?) of newlib wrappers.
912 2002-10-20 Christopher Faylor <cgf@redhat.com>
914 * cygthread.cc (cygthread::detach): Always wait for event or suffer an
915 apparently inavoidable race.
916 * dcrt0.cc (dll_crt0_1): Allocate threads after stack has been
918 * debub.cc (lock_debug): Don't acquire lock on exit.
919 * fork.cc (fork_child): Recreate mmaps before doing anything else since
920 Windows has a habit of using blocks of memory in the child that could
921 previously have been occupied by shared memory in the parent.
922 * mmap.cc (fhandler_disk_file::fixup_mmap_after_fork): Issue error here
923 and provide some details about what went wrong.
924 (fixup_mmaps_after_fork): Remove error message.
925 * shared.cc (open_shared): Move warning message so that more detail is
927 * sigproc.cc (sigproc_init): Initialize sync_proc_subproc to avoid a
929 (sigproc_terminate): Specifically wait for process thread to terminate.
931 2002-10-20 Christopher Faylor <cgf@redhat.com>
933 * cygthread.cc (cygthread::stub): Fix typo.
934 (cygthread::terminate): Don't zero thread handle prior to using it.
936 2002-10-20 Christopher Faylor <cgf@redhat.com>
938 * sigproc.cc (wait_sig): Remove obsolete sigchld logic.
940 2002-10-20 Christopher Faylor <cgf@redhat.com>
942 Rename _kill() to kill() throughout. Rename _raise() to raise()
943 throughout. Rename _pid() to pid() throughout.
944 * Makefile.in: Compile some objects with -fomit-frame-pointer.
945 * cygwin.din: Reverse aliasing for _kill.
946 * syscalls.cc (_getpid_r): New function, implemented for newlib
949 * shared.cc (open_shared): Remove reserving of memory since previous
950 change eliminate the need for this hack.
952 2002-10-19 Christopher Faylor <cgf@redhat.com>
954 * fork.cc (fork_child): Move pinfo fixup later to attempt some minor
955 gains from concurrency with cythread::init.
957 2002-10-18 Christopher Faylor <cgf@redhat.com>
959 * dcrt0.cc (dll_crt0_1): Initialize cygwin threads here only when not
961 * fork.cc (fork_child): Initialize cygwin thread later in process to
962 avoid allocating memory for thread stacks.
963 * shared.cc (open_shared): Issue warning if NT and shared segment is
966 2002-10-18 Christopher Faylor <cgf@redhat.com>
968 * cygthread.cc: Bump number of cygthreads up to accommodate
969 applications which use ttys.
971 2002-10-18 Christopher Faylor <cgf@redhat.com>
973 * fork.cc (fork_child): Move mmap initialization.
974 * shared.cc (shared_info::heap_chunk_size): Store info as megabytes.
975 Search HKEY_LOCAL_MACHINE as well as HKEY_CURRENT_USER.
976 * shared_info.h (shared_info::initial_heap_size): Change element name
977 to reflect new functionality.
978 * strace.cc (strace::hello): Report on initial heap size.
980 2002-10-18 Thomas Pfaff <tpfaff@gmx.net>
982 * thread.cc (verifyable_object_isvalid): Test for a valid object
983 pointer before testing for static ptr.
985 2002-10-17 Christopher Faylor <cgf@redhat.com>
987 * dtable.cc (dtable::init_std_file_from_handle): Force "devices" to
988 always be in binary mode. Temporary fix until ssh is rebuilt?
990 2002-10-17 Christopher Faylor <cgf@redhat.com>
992 * dtable.cc (dtable::set_file_pointers_for_exec): New function.
993 * dtable.h (dtable::set_file_pointers_for_exec): Declare new function.
994 * spawn.cc (spawn_guts): Call dtable::set_file_pointers_for_exec to set
995 pointers to EOF when execing non-cygwin applications.
997 2002-10-17 Robert Collins <rbtcollins@hotmail.com>
999 * thread.h (pthread_mutex::isGoodInitializerOrBadObject): Declare.
1000 * thread.cc (pthread_mutex::isGoodInitializerOrBadObject): Implement.
1001 (pthread_mutex::init): Use isGoodInitializerOrBadObject to avoid
1002 unneeded SEGV's during debugging.
1004 2002-10-17 Thomas Pfaff <tpfaff@gmx.net>
1006 * thread.cc (verifyable_object_isvalid): Test for static object first.
1008 2002-10-16 Christopher Faylor <cgf@redhat.com>
1010 * fhandler_tty.cc (fhandler_tty_slave::read): Attempt #527 to properly
1011 implement VMIN/VTIME.
1013 2002-10-15 Christopher Faylor <cgf@redhat.com>
1015 * shared.cc (open_shared): Revert to "old" method for shared memory
1016 location if !wincap.needs_memory_protection.
1017 * wincap.cc: Implement needs_memory_protection throughout.
1020 2002-10-15 Christopher Faylor <cgf@redhat.com>
1022 * child_info.h (CURR_CHILD_INFO_MAGIC): Reset.
1023 (child_info_fork::mount_table): Remove.
1024 (child_info_fork::myself_addr): Remove.
1025 * fork.cc (fork_child): Don't set either of the above.
1026 * dcrt0.cc (dll_crt0_1): Call memory_init as early as possible.
1027 * fhandler_console.cc (console_state): Move to shared_info.h.
1028 (fhandler_console::get_tty_stuff): Reflect open_shared arg change.
1029 * pinfo.cc (myself_addr): Remove definition.
1030 (pinfo::init): Get myself address from open_shared.
1031 * pinfo.h (myself_addr): Remove declaration.
1032 * shared.cc (open_shared): Rework so that known shared memory locations
1033 are protected. Take shared memory type as fifth argument.
1034 (memory_init): Reflect open_shared arg change.
1035 * shared_info.h (shared_locations): New enum.
1036 (console_state): Move here.
1037 (open_shared): Reflect open_shared arg change in declaration.
1039 2002-10-14 Christopher Faylor <cgf@redhat.com>
1041 * child_info.h (CURR_CHILD_INFO_MAGIC): Reset.
1042 (child_info_fork::heaptop): Remove obsolete element.
1043 (child_info_fork::heabbase): Ditto.
1044 (child_info_fork::heapptr): Ditto.
1045 (child_info_fork::mount_table): New element.
1046 (child_info_fork::myself_addr): Ditto.
1047 * dcrt0.cc (dll_crt0_1): Set mount_table and myself_addr when forking.
1048 (initial_env): Add newline to "sleeping" message.
1049 * dll_init.cc (reserve_upto): Accommodate cygwin heap when freeing
1050 memory. Make debugging output a little more descriptive.
1051 * fork.cc (fork_parent): Save mount_table and myself_addr.
1052 * pinfo.cc (myself_addr): New variable.
1053 (set_myself): Pass PID_MYSELF flag to init.
1054 (pinfo::init): Honor PID_MYSELF. Save address where myself shared
1055 memory resides in myself_addr, for fork.
1056 * pinfo.h (myself_addr): Declare.
1057 * shared.cc (memory_init): On fork, use previously saved address for
1058 location of mount table.
1059 * include/sys/cygwin.h (PID_MYSELF): New value.
1061 * dtable.cc (dtable::stdio_init): Don't pass access type to
1062 init_std_file_from_handle. It's always the same.
1063 (dtable::init_std_file_from_handle): Remove access type argument.
1065 * dtable.h (dtable::init_std_file_from_handle): Ditto for declaration.
1067 * exceptions.cc (try_to_debug): Don't try to debug if already being
1070 * fhandler_console.cc (shared_console_info_save): New variable.
1071 (fhandler_console::get_tty_stuff): Save address of shared console stuff
1074 2002-10-13 Christopher Faylor <cgf@redhat.com>
1076 * cygthread.cc (cygthread::stub): Reintroduce clearing of __name but do
1077 it before SetEvent to eliminate a race.
1078 (cygthread::terminate): Accumulate list of threads to check for
1079 termination and call WaitForMultipleObjects on list rather than waiting
1080 for each thread individually.
1081 * sigproc.cc (subproc_init): Zap hwait_subproc thread handle since it
1084 2002-10-13 Christopher Faylor <cgf@redhat.com>
1086 * spawn.cc (spawn_guts): Fix so that cygthread::terminate is *really*
1087 called only for exec.
1089 2002-10-13 Christopher Faylor <cgf@redhat.com>
1091 * cygthread.cc (cygthread::stub): Don't zero __name here. That
1094 2002-10-13 Christopher Faylor <cgf@redhat.com>
1096 * include/cygwin/version.h: Bump DLL minor number.
1098 2002-10-13 Christopher Faylor <cgf@redhat.com>
1100 * cygthread.cc (cygthread::stub): Don't create event for long-running
1101 threads. Initialize thread_sync event here which is used to Suspend
1102 using an event rather than relying on SuspendThread/ResumeThread.
1103 (cygthread::init): Save handle to runner thread for future termination.
1104 (cygthread::cygthread): Only resume thread when it is actually
1105 suspended. Otherwise signal thread completion event.
1106 (cygthread::terminate): Forcibly terminate runner thread and any helper
1107 threads. Call DisableThreadLibrary calls if execing.
1108 * cygthread.h (cygthread::thread_sync): Declare.
1109 * dcrt0.cc (do_exit): Eliminate calls to obsolete window_terminate and
1111 * exceptions.cc (events_terminate): Don't bother closing title_mutex
1112 since it is going away anyway.
1113 * pinfo.cc (_pinfo::exit): Call cygthread::terminate to ensure that
1114 threads are shut down before process exit or otherwise strange races
1116 * shared.cc (shared_terminate): Eliminate.
1117 * shared.h (shared_terminate): Eliminate declaration.
1118 * winsup.h (window_terminate): Eliminate declaration.
1119 * spawn.cc (spawn_guts): Call cygthread::terminate early in process if
1120 execing. Call DisableThreadLibrary calls if execing.
1121 * window.cc (Winmain): Call ExitThread to force exit.
1122 (window_terminate): Eliminate.
1124 * dcrt0.cc (do_exit): Track exit state more closely.
1126 2002-10-10 Christopher Faylor <cgf@redhat.com>
1128 * window.cc (gethwnd): Use SetThreadPriority method.
1130 2002-10-10 Christopher Faylor <cgf@redhat.com>
1132 * Makefile.in (new-cygwin1.dll): Reorganize library order.
1134 * dcrt0.cc (do_exit): Move thread stuff after vfork stuff or threads
1135 are terminated during vfork.
1136 * sigproc.cc (proc_terminate): Grab proc lock prior to signalling
1137 subproc thread exit to avoid an extra "wait-for-thread-to-exit".
1139 2002-10-09 Christopher Faylor <cgf@redhat.com>
1141 * cygthread.cc (cygthread::stub): Don't create an event for "cygself"
1142 threads. Assume that they exit via an ExitThread call.
1143 * cygthread.h (cygthread::SetThreadPriority): New function.
1144 (cygthread::zap_h): New function.
1145 * dcrt0.cc (do_exit): Move cygthread::terminate earlier and establish
1147 * fhandler.h (fhandler_tty_master::output_thread): Delete.
1148 * fhandler_tty.cc (fhandler_tty_master::init): Set priority for threads
1149 via method. Zap handles when done. Don't treat process_output
1151 (process_output): Call ExitThread directly.
1152 (fhandler_tty_master::fixup_after_fork): Don't worry about
1154 (fhandler_tty_master::fixup_after_exec): Ditto.
1155 * sigproc.cc (proc_terminate): Don't detach from hwait_subproc. Just
1157 (sigproc_init): Close thread handle after initialization.
1158 (wait_sig): Use GetCurrentThread() as SetThreadPriority call rather
1159 than *event* handle. Call ExitThread directly on termination.
1160 (wait_subproc): Call ExitThread directly on termination.
1161 * tty.cc (tty_list::terminate): Don't attempt to detach from
1164 2002-10-08 Christopher Faylor <cgf@redhat.com>
1166 * cygheap.cc (dup_now): Make fatal error a little more informative.
1167 (cygheap_setup_for_child): Detect when default size of shared region is
1168 less than the current size and allocate that much.
1169 (_cbrk): Just return NULL on inability to allocate.
1171 * cygheap.h (CYGHEAPSIZE): Change size to reflect newer, tinier
1173 * spawn.cc (av::error): New element, reflects potential errno from cmalloc.
1174 (av::~av): Don't free NULL pointers.
1175 (av::replace0_maybe): Detect out-of-memory conditions.
1176 (av::dup_maybe): Ditto.
1177 (av::dup_all): Ditto.
1178 (av::unshift): Ditto.
1179 (spawn_guts): Set errno and return if argv creation ran into problems.
1181 * fhandler.h (fhandler_union): Change member names to something safer.
1183 * fhandler_console.cc (fhandler_console::get_tty_stuff): Always set
1184 fhandler_console::dev_state regardless of whether shared region is
1187 * cygthread.cc (cygthread::runner): Use ExitThread rather than return
1188 (planning for future).
1190 2002-10-08 Christopher Faylor <cgf@redhat.com>
1192 * fhandler.h (dev_console): New class.
1193 (fhandler_console::dev_state): New class element.
1194 (fhandler_console::mouse_aware): Use dev_state element.
1195 (fhandler_console::get_tty_stuff): Declare new function.
1196 * fhandler_console.cc: Use dev_state fhandler_console element,
1198 (fhandler_console::get_tty_stuff): Move to fhandler_console class.
1199 Incorporate dev_console information. Move constructor stuff here.
1201 2002-10-07 Christopher Faylor <cgf@redhat.com>
1203 * dtable.cc (dtable::init_std_file_from_handle): Try to mimic standard
1204 open behavior with files redirected from stdin/stdout/stderr, i.e.,
1205 fmode settings take precedence over mount settings.
1207 2002-10-07 Christopher Faylor <cgf@redhat.com>
1209 * dtable.cc (unknown_file): New variable.
1210 (dtable::init_std_file_from_handle): Don't set binmode if we couldn't
1211 determine the actual file name on stdin/stdout/stderr.
1212 (handle_to_fn): Return unknown_file when can't determine filename.
1214 2002-10-07 Christopher Faylor <cgf@redhat.com>
1216 * dcrt0.cc (do_exit): Call DisableThreadLibraryCalls since we don't
1217 need to track thread detaches.
1218 * init.cc (dll_entry): Reorganize slightly. Fix api_fatal message.
1220 2002-10-05 Christopher Faylor <cgf@redhat.com>
1222 * cygthread.cc (cygthread::stub): Very minor cleanup.
1223 (cygthread::stub): Report overflows in cygwin thread pool when
1224 DEBUGGING is on and special environment variable is not set.
1225 (cygthread::terminate): Set event only when event actually exists.
1226 * exceptions.cc (signal_exit): Set priority of main thread to low
1227 before setting current thread to high.
1229 2002-10-01 Robert Collins <rbtcollins@hotmail.com>
1231 * thread.cc (pthread_key::keys): Copy on fork. Add a comment explaining
1233 (pthreadNull::_instance): Copy on fork. Absolutely no state exists
1236 2002-09-30 Conrad Scott <conrad.scott@dsl.pipex.com>
1238 * cygserver_transport_pipes.cc (transport_layer_pipes::accept):
1239 Remove trailing \n from debug_printf.
1241 2002-09-30 Christopher Faylor <cgf@redhat.com>
1243 * thread.cc (pthread_mutex::initMutex): Remove \n from api_fatal.
1245 2002-09-30 Christopher Faylor <cgf@redhat.com>
1247 * thread.cc (pthread::precreate): Use explicit "no inherit" option when
1249 (pthread_mutex::nativeMutex::init): Ditto.
1251 2002-09-30 Christopher Faylor <cgf@redhat.com>
1253 * thread.cc (pthread_key::keys): Do not copy on fork.
1254 (pthread_mutex::mutexInitializationLock): Ditto.
1255 (pthreadNull::_instance): Ditto.
1257 2002-09-30 Christopher Faylor <cgf@redhat.com>
1259 * exceptions.cc (unused_sig_wrapper): Still need additional level of
1260 indirection when setting errno.
1262 2002-09-30 Robert Collins <rbtcollins@hotmail.com>
1264 * thread.cc (pthread_mutex::initMutex): Use the wrapper init call.
1265 (pthread_mutex::nativeMutex::init): Implement.
1266 (pthread_mutex::nativeMutex::lock): Ditto.
1267 (pthread_mutex::nativeMutex::unlock): Ditto.
1268 (pthread_mutex::init): Use the wrapper lock and unlockcalls.
1269 * thread.h (pthread_mutex): Move mutexInitializationLock into a
1270 nativeMutex wrapper class.
1272 2002-09-30 Christopher Faylor <cgf@redhat.com>
1274 Remove \n from calls to strace class printfs throughout.
1276 2002-09-30 Christopher Faylor <cgf@redhat.com>
1278 * exceptions.cc (unused_sig_wrapper): Accommodate newer compilers.
1280 2002-09-29 Christopher Faylor <cgf@redhat.com>
1282 * security.cc (allow_ntsec): Default to zero.
1283 * environ.cc (environ_init): Set allow_ntsec to TRUE by default,
1284 assuming OS allows it.
1286 2002-09-29 Christopher Faylor <cgf@redhat.com>
1288 * environ.cc (environ_init): Avoid a compiler warning.
1289 * path.cc (path_conv::check): Ditto.
1290 * path.h (path_conv::operator int): Ditto.
1291 * regex/engine.c: Ditto throughout.
1292 * regex/regcomp.c: Ditto throughout.
1293 * regex/regexec.c: Ditto throughout.
1295 2002-09-29 Christopher Faylor <cgf@redhat.com>
1297 * thread.cc: Use "%E" in *_printf throughout rather than calling
1298 GetLastError. GNUify comments.
1299 (__pthread_mutex_lock): Don't return error on EBUSY since that just
1300 means that the mutex has already been initialized.
1302 2002-09-30 Robert Collins <rbtcollins@hotmail.com>
1304 * pthread.cc (pthread_mutex_init): Use new pthread_mutex::init.
1305 * thread.cc: Change __pthread_mutex_init to pthread_mutex::init
1307 (MTinterface::Init): Initialise pthread_mutex support.
1308 (pthread_mutex::mutexInitializationLock): Instantiate.
1309 (pthread_mutex::initMutex): New method.
1310 (__pthread_cond_dowait): Don't dereference untrusted pointers.
1311 Use the new pthread_mutex::init method.
1312 (__pthread_condattr_init): Don't dereference untrusted pointers.
1313 (__pthread_mutex_init): Rename to pthread_mutex::init.
1314 Lock and release mutexInitializationLock to prevent races on
1315 mutex initialisation.
1316 * thread.h (pthread_mutex::initMutex): New method, initialise
1317 pthread_mutex supporting state on process initialisation.
1318 (pthread_mutex::init): Initialise a single mutex.
1319 (pthread_mutex::mutexInitializationLock): A win32 mutex for
1320 syncronising pthread mutex initialisation.
1321 (__pthread_mutex_init): Remove this.
1323 2002-09-28 Christopher Faylor <cgf@redhat.com>
1325 * thread.h (verifyable_object:~verifyable_object): Make virtual.
1327 2002-09-28 Christopher Faylor <cgf@redhat.com>
1329 * cygthread.h (cygthread::terminate): Declare new function.
1330 (cygthread::initialized): Change to 'int'.
1331 * cygthread.cc (cygthread::stub): Exit thread if initialized < 0.
1332 (cygthread::new): Ditto.
1333 (cygthread::runner): Ditto. Set initialized using xor to preserve
1335 (cygthread::terminate): New function.
1336 * dcrt0.cc (do_exit): Call cygthread::terminate.
1338 2002-09-27 Robert Collins <rbtcollins@hotmail.com>
1340 * thread.cc (pthread_key::run_destructor): Run_destructor is not
1341 const as it needs to set the key value.
1342 * thread.h (pthread_key::run_destructor): Ditto.
1344 2002-09-27 Robert Collins <rbtcollins@hotmail.com>
1346 * thread.cc (pthread_key::run_destructor): Follow opengroup algorithm.
1347 I.e. only run the destructor NON-NULL key values, and reset the key
1348 to NULL before running the destructor. Reported by Thomas Pfaff.
1350 2002-09-25 Christopher Faylor <cgf@redhat.com>
1352 * cygrun.c (main): Fix setting of CYGWIN environment variable.
1354 * Makefile.in: Remove linking of unnecessary libraries.
1356 2002-09-24 Christopher January <chris@atomice.net>
1358 * fhandler_proc.cc (format_process_stat): make ctty a real device
1360 (format_process_status): use effective uid/gid as real and saved
1363 2002-09-24 Corinna Vinschen <corinna@vinschen.de>
1365 * errno.cc (errmap): Map ERROR_INVALID_ADDRESS to new errno code
1367 (_sys_errlist): Add entries for EILSEQ and EOVERFLOW.
1369 * mmap.cc (map_map): Set errno in case of error.
1370 (mmap64): Remove setting errno explicitely to ENOMEM.
1372 2002-09-24 Corinna Vinschen <corinna@vinschen.de>
1374 * mmap.cc (map_map): Add debug output.
1375 (mmap64): Evaluate gran_len correctly even if offset isn't 0.
1377 2002-09-22 Christopher Faylor <cgf@redhat.com>
1379 More GNUify non-GNU formatted functions calls throughout.
1381 2002-09-22 Christopher Faylor <cgf@redhat.com>
1383 * Makefile.in (DLL_O_FILES): Restore formatting.
1385 2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com>
1387 GNUify non-GNU formatted functions calls throughout.
1389 2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com>
1391 * cygserver_shm.cc (with_strerr): Remove macro.
1392 (server_shmmgr::segment_t::~segment_t): Remove calls to with_strerr.
1393 (server_shmmgr::segment_t::attach): Ditto.
1394 (server_shmmgr::new_segment): Ditto.
1395 * shm.cc (with_strerr): Remove macro.
1396 (client_shmmgr::shmdt): Remove calls to with_strerr.
1397 (client_shmmgr::attach): Ditto.
1399 2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com>
1401 * include/sys/ipc.h: Move to "include/cygwin/ipc.h".
1402 * include/sys/msg.h: Move to "include/cygwin/msg.h".
1403 * include/sys/sem.h: Move to "include/cygwin/sem.h".
1404 * include/sys/shm.h: Move to "include/cygwin/shm.h".
1405 * include/cygwin/ipc.h: New file.
1406 * include/cygwin/msg.h: Ditto.
1407 * include/cygwin/sem.h: Ditto.
1408 * include/cygwin/shm.h: Ditto.
1409 * cygserver_shm.h: Update includes.
1413 2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com>
1415 * safe_memory.h (safe_delete): Make a templated function.
1416 * cygserver.cc (~server_request): Update use of safe_delete.
1418 * cygserver_client.cc (client_request::handle_request): Ditto.
1419 (client_request::make_request): Ditto.
1420 * cygserver_process.cc (~process_cleanup): Ditto.
1421 (process::remove): Ditto.
1422 (process::cleanup): Ditto.
1423 (process_cache::process): Ditto.
1424 * cygserver_shm.cc (server_shmmgr::segment_t::detach): Ditto.
1425 (server_shmmgr::delete_segment): Ditto.
1426 * shm.cc (client_shmmgr::shmdt): Ditto.
1427 * threaded_queue.cc (~threaded_queue): Ditto.
1428 (threaded_queue::worker_loop): Ditto.
1430 2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com>
1432 * safe_memory.h: Replace #include <new> with an explicit
1433 definition of the placement new operator.
1434 (safe_delete): Remove unnecessary ## operator.
1436 2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com>
1438 * cygserver_shm.cc (class server_shmmgr): Remove `cleanup_t'
1440 (cleanup_t::cleanup_t): Use the segment's shmid as the key rather
1441 than the segment pointer itself.
1442 (cleanup_t::segptr): Remove method.
1443 (cleanup_t::shmid): New method.
1444 (cleanup_t::cleanup): Update for new key value.
1445 (server_shmmgr::find (segment_t *)): Remove method.
1446 * include/cygwin/cygserver_process.h (cleanup_routine::key): Make
1449 2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com>
1451 * include/cygwin/cygserver_process.h
1452 (cleanup_routine::_key): New field.
1453 (cleanup_routine::cleanup_routine): Initialise new field with new
1455 (cleanup_routine::operator==): New method.
1456 (cleanup_routine::key): New method.
1457 (cleanup_routine::cleanup): Make argument non-const.
1458 (process::is_active): New method.
1459 (process::remove): Ditto.
1460 (process::check_exit_code): Rename method.
1461 * cygserver_process.cc (process::add): Reorganize code.
1462 (process::remove): New method.
1463 (process::check_exit_code): Rename method.
1464 (process::cleanup): Use new `process::is_active' method.
1465 (process_cache::process): Ditto.
1466 (process_cache::sync_wait_array): Ditto.
1467 (process_cache::check_and_remove_process): Ditto.
1468 * cygserver_shm.cc (server_shmmgr): Make `cleanup_t' a friend.
1469 (segment_t::detach): Make argument non-const. Remove cleanup
1470 object from client if appropriate.
1471 (cleanup_t::_segptr): Remove field.
1472 (cleanup_t::cleanup_t): Initialise parent explicitly. Remove
1474 (cleanup_t::segptr): New method.
1475 (cleanup_t::cleanup): Add error checking and reporting.
1476 (server_shmmgr::shmdt): Make argument non-const.
1477 (server_shmmgr::find (segment_t *)): New method.
1479 2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com>
1481 * cygserver.cc (client_request_shutdown::client_request_shutdown):
1482 Comment out verbose tracing statement.
1483 * cygserver_client.cc
1484 (client_request_get_version::client_request_get_version): Ditto.
1485 (client_request_attach_tty::client_request_attach_tty): Ditto.
1486 * cygserver_shm.cc (client_request_shm::client_request_shm):
1489 2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com>
1491 * cygserver_transport_pipes.cc (transport_layer_pipes::listen):
1492 Set `_is_listening_endpoint' appropriately.
1494 2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com>
1496 * include/cygwin/cygserver_transport.h
1497 (transport_layer_base::listen): Change return type.
1498 (transport_layer_base::connect): Ditto.
1499 * include/cygwin/cygserver_transport_pipes.h
1500 (transport_layer_pipes::listen): Change return type.
1501 (transport_layer_pipes::connect): Ditto.
1502 (transport_layer_pipes::_sec_none_nih): Remove unused field.
1503 (transport_layer_pipes::_is_listening_endpoint): New field.
1504 * cygserver_transport_pipes.cc: Synchronize with sockets code.
1505 (transport_layer_pipes::transport_layer_pipes): Initialise new
1506 field. Separate out asserts.
1507 (transport_layer_pipes::listen): Change return type. Add asserts.
1508 (transport_layer_pipes::accept): Add asserts.
1509 (transport_layer_pipes::read): Change conditional to an assert.
1511 (transport_layer_pipes::write): Ditto.
1512 (transport_layer_pipes::connect): Change return type. Change
1513 conditional to an assert. Add asserts. Rationalize error code
1515 (transport_layer_pipes::impersonate_client): Add asserts.
1516 * include/cygwin/cygserver_transport_sockets.h
1517 (transport_layer_sockets::listen): Change return type.
1518 (transport_layer_sockets::connect): Ditto.
1519 (transport_layer_sockets::_addr): Change type of field.
1520 (transport_layer_sockets::_addr_len): Ditto.
1521 (transport_layer_sockets::_is_accepted_endpoint): New field.
1522 (transport_layer_sockets::_is_listening_endpoint): Ditto.
1523 * cygserver_transport_sockets.cc
1524 (MAX_CONNECT_RETRY): New constant.
1525 (transport_layer_sockets::transport_layer_sockets): Initialise new
1526 fields. Only initialise the socket address where necessary.
1527 (transport_layer_sockets::listen): Change return type. Rewrite.
1528 (transport_layer_sockets::accept): Add asserts. Add tracing
1529 statements. Use a local variable to hold the accepted address.
1530 (transport_layer_sockets::close): Add tracing statements. Unlink
1531 the UNIX domain socket file as appropriate. Close the socket
1533 (transport_layer_sockets::read): Rewrite method.
1534 (transport_layer_sockets::write): Ditto.
1535 (transport_layer_sockets::connect): Change return type. Rewrite.
1536 * cygserver.cc (server_submission_loop::request_loop): Run the
1537 listening thread at high priority with special handling for
1539 (main): Print the request error code rather than errno in shutdown
1540 request code. Install signal handlers with sigaction(2) to avoid
1541 setting SA_RESTART. Check value of the listen method call, now it
1543 * cygserver_client.cc (client_request::make_request): Check new
1544 return value on connect method call.
1546 2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com>
1548 * include/cygwin/cygserver_transport_pipes.h
1549 (cygserver_transport_pipes::_sd): Rename field.
1550 (cygserver_transport_pipes::_sec_none_nih): Ditto.
1551 (cygserver_transport_pipes::_sec_all_nih): Ditto.
1552 (cygserver_transport_pipes::_pipe_name): Ditto.
1553 (cygserver_transport_pipes::_hPipe): Ditto.
1554 (cygserver_transport_pipes::_is_accepted_endpoint): Ditto.
1555 * cygserver_transport_pipes.cc
1556 (transport_layer_pipes::transport_layer_pipes): Rename fields.
1557 (transport_layer_pipes::init_security): Ditto.
1558 (transport_layer_pipes::listen): Ditto.
1559 (transport_layer_pipes::accept): Ditto.
1560 (transport_layer_pipes::close): Ditto.
1561 (transport_layer_pipes::read): Ditto.
1562 (transport_layer_pipes::write): Ditto.
1563 (transport_layer_pipes::connect): Ditto.
1564 (transport_layer_pipes::impersonate_client): Ditto.
1565 (transport_layer_pipes::revert_to_self): Ditto.
1566 * include/cygwin/cygserver_transport_sockets.h
1567 (cygserver_transport_sockets::_fd): Rename field.
1568 (cygserver_transport_sockets::_addr): Ditto.
1569 (cygserver_transport_sockets::_addr_len): Ditto.
1570 * cygserver_transport_sockets.cc
1571 (transport_layer_sockets::transport_layer_sockets): Rename fields.
1572 (transport_layer_sockets::listen): Ditto.
1573 (transport_layer_sockets::accept): Ditto.
1574 (transport_layer_sockets::close): Ditto.
1575 (transport_layer_sockets::read): Ditto.
1576 (transport_layer_sockets::write): Ditto.
1577 (transport_layer_sockets::connect): Ditto.
1579 2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com>
1581 * cygserver_shm.cc (with_strerr): Fix use of %p format.
1582 * shm.cc (client_shmmgr::shmat): Ditto.
1583 (client_shmmgr::shmctl): Ditto.
1584 (client_shmmgr::shmdt): Ditto.
1585 (client_shmmgr::attach): Ditto.
1587 2002-09-22 Christopher Faylor <cgf@redhat.com>
1589 * woutsup.h (system_printf): Remove extraneous semicolon from macro
1592 2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com>
1594 * cygserver_transport_pipes.cc
1595 (transport_layer_pipes::connect): Use ProtectHandle in DLL code.
1596 (transport_layer_pipes::close): Use ForceCloseHandle in DLL code.
1598 2002-09-22 Nicholas Wourms <nwourms@netscape.com>
1600 * threaded_queue.h (class queue_submission_loop): Correct friend
1601 declaration for GCC 3.1.1.
1602 * include/cygwin/cygserver_process.h (class process): Ditto.
1603 (class process_cache): Ditto.
1605 2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com>
1607 * cygserver_shm.cc (server_shmmgr::shmdt): Only call
1608 delete_segment if the segment exists [sic].
1610 2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com>
1612 * safe_memory.h: Include <new> rather than <new.h> for gcc 3.
1614 2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com>
1616 * safe_memory.h: New file extracted from "woutsup.h".
1617 * woutsup.h: Move the "safe" new/delete macros into the new
1618 "safe_memory.h" header file and include that here.
1619 * cygserver_client.cc: Explicitly include "safe_memory.h" for
1621 (client_request::make_request): Use the "safe" new/delete macros
1622 unconditionally, i.e. use them on the client side as well as on
1624 * cygserver_transport.cc: Explicitly include "safe_memory.h" for
1626 (create_server_transport): Use the "safe" new/delete macros
1627 unconditionally, i.e. use them on the client side as well as on
1629 * shm.cc: Include "safe_memory.h".
1630 (client_shmmgr::instance): Use the "safe" new/delete macros.
1631 (client_shmmgr::shmdt): Ditto.
1632 (client_shmmgr::new_segment): Ditto.
1634 2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com>
1636 * cygserver_process (process::process): Add the client's cygpid
1637 and winpid to all tracing statements as appropriate.
1638 (process::exit_code): Ditto.
1639 (process_cache::check_and_remove_process): Ditto.
1640 * cygserver_shm.cc (server_shmmgr::shmat): Ditto.
1641 (server_shmmgr::shmdt): Ditto.
1642 (server_shmmgr::shmctl): Add a process object argument and remove
1643 the explicit cygpid argument. Add the client's cygpid and winpid
1644 to all tracing statements as appropriate.
1645 (server_shmmgr::shmget): Ditto.
1646 (client_request_shm::serve): Update for the new signature of the
1647 shmctl and shmget methods.
1649 2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com>
1651 * cygserver.cc (client_request_shutdown::serve): Don't set the
1652 shutdown flag directly, but send a SIGINT, as the signal handler
1653 sets the flag and the signal breaks the pause(2) in the main loop.
1654 (print_usage): Add new options.
1655 (main): Add new --cleanup-threads and --request-threads options to
1656 set the number of threads used by the daemon. Use pause(2) rather
1657 the win32 Sleep in the main loop.
1658 * shm.cc (shmat): Add sigframe.
1663 2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com>
1665 * cygserver_shm.cc: Automatically detach processes from any
1666 segments they are attached to at exit.
1667 (class server_shmmgr::attach_t): New class.
1668 (server_shmmgr::segment_t::IS_DELETED): Rename and make private.
1669 (server_shmmgr::segment_t::_sequence): Make private.
1670 (server_shmmgr::segment_t::_flg): Ditto.
1671 (server_shmmgr::segment_t::_hFileMap): Ditto.
1672 (server_shmmgr::segment_t::_attach_head): New private field.
1673 (server_shmmgr::segment_t::segment_t): Initialise new fields.
1675 (server_shmmgr::segment_t::~segment_t): New method.
1676 (server_shmmgr::segment_t::is_deleted): Ditto.
1677 (server_shmmgr::segment_t::is_pending_delete): Ditto.
1678 (server_shmmgr::segment_t::mark_deleted): Ditto.
1679 (server_shmmgr::segment_t::attach): Ditto.
1680 (server_shmmgr::segment_t::detach): Ditto.
1681 (server_shmmgr::segment_t::find): Ditto.
1682 (class server_shmmgr::cleanup_t): New class.
1683 (server_shmmgr::_shm_atts): New private field.
1684 (server_shmmgr::shmat): Add a process object argument to replace
1685 the removed process_cache, cygpid and winpid arguments. Remove
1686 the process_cache manipulations. Move body of code to the
1687 segment_t::attach method. Increment _shm_atts when required.
1688 Update tracing statements.
1689 (server_shmmgr::shmdt): Add a process object argument to replace
1690 the removed cygpid argument. Move body of code to the
1691 segment_t::detach method. Decrement _shm_atts when required.
1692 Update tracing statements.
1693 (server_shmmgr::shmget): Use the new segment_t::is_deleted method.
1694 (server_shmmgr::server_shmmgr): Initialise the new _shm_atts
1696 (server_shmmgr::delete_segment): Remove the CloseHandle code, as
1697 this is now done in the segment_t destructor.
1698 (client_request_shm::serve): Look up the client's process object
1699 and pass to the server_shmmgr::shmat and server_shmmgr::shmdt
1700 methods rather than passing the cache, winpid and cygpid.
1701 * cygserver_process.h: Add a cygpid to the process object to make
1702 it more useful and then pass process objects rather than winpids
1704 (cleanup_routine::cleanup): Change argument to be a pointer to a
1706 (class process): Re-order fields for no discernible reason.
1707 (process::_cygpid): New field.
1708 (process::process): Add a cygpid argument.
1709 (process::winpid): New method.
1710 (process::cygpid): Ditto.
1711 (process::add): Make public, as it always should have been.
1712 (process_cache::process): Add a cygpid argument.
1713 * cygserver_process.cc (process::process): Add a cygpid argument
1714 and use it to initialise the `_cygpid' field. Re-order
1715 initialisers to match new field order.
1716 (process::cleanup): Pass `this' rather than just the winpid to
1717 cleanup_routine::cleanup.
1718 (process_cache::process): Add a cygpid argument and pass it to the
1719 process object constructor.
1720 * include/sys/shm.h (shmatt_t): Make unsigned as per SUSv3.
1721 (shm_info::shm_atts): New field.
1723 2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com>
1725 * cygserver_shm.cc (class server_shmmgr::segment_t): Add `_'
1726 prefix to the names of all fields.
1728 2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com>
1730 * msg.cc: New file of stub functions, no functionality.
1732 * shm.cc (client_shmmgr::shmctl): Add support for an out shm_info
1733 buffer for the SHM_INFO command.
1734 (client_shmmgr::shmget): Use %X to print keys.
1735 * include/sys/ipc.h: Comment all fields and values.
1736 (IPC_PRIVATE): Change to be non-negative.
1737 * include/sys/msg.h: New file with SUSv3 and ipcs(8) interfaces.
1738 * include/sys/sem.h: Ditto.
1739 * include/sys/shm.h: Comment all fields and values.
1740 (struct shm_info): New struct.
1741 * cygserver_shm.h (client_request_shm::shminfo): Rename.
1742 (client_request_shm::shm_info): New method.
1743 (client_request_shm::_parameters.out.hFileMap): Move into union.
1744 (client_request_shm::_parameters.out.shminfo): Rename.
1745 (client_request_shm::_parameters.out.shm_info): New field.
1746 * cygserver_shm.cc (server_shmmgr::_shm_ids): Rename.
1747 (server_shmmgr::_shm_tot): New field.
1748 (server_shmmgr::shmctl): Rename `out_shminfo' argument. Add
1749 `out_shm_info' argument. Fill in the `out_shm_info' argument in
1750 the SHM_INFO command.
1751 (server_shmmgr::shmget): Check `shmflg' against the mode of
1752 existing segments as per Stevens 1990, p. 123.
1753 (server_shmmgr::server_shmmgr): Initialise the new `_shm_tot'
1755 (server_shmmgr::new_segment): Set ENOMEM if CreateFileMapping
1756 fails. Pass `size' to new_segment.
1757 (server_shmmgr::new_segment): Add size argument and use it to
1758 check against and update the new `_shm_tot' field.
1759 (server_shmmgr::delete_segment): Update the new `_shm_tot' field.
1760 * Makefile.in (DLL_OFILES): Add new DLL object files.
1762 2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com>
1764 * cygserver_transport_pipes.cc: The main change is to make the
1765 client try harder to connect to the server if it's previously
1766 connected, and so has good grounds for believing that the server
1768 (MAX_WAIT_NAMED_PIPE_RETRY): Change to be an enumerator.
1769 (WAIT_NAMED_PIPE_TIMEOUT): Ditto.
1770 (transport_layer_pipes::accept): Use interlocked operators on
1772 (transport_layer_pipes::close): Rearrange so that FlushFileBuffers
1773 and DisconnectNamedPipe are only called for accepted endpoints.
1774 Use interlocked operators on `pipe_instance'.
1775 (transport_layer_pipes::read): Use set_errno where required.
1776 (transport_layer_pipes::write): Ditto.
1777 (transport_layer_pipes::connect): Add local static variable
1778 `assume_cygserver'. Set it if a connection is made to cygserver,
1779 clear it if a connection is not made even after retrying. If set,
1780 ignore all errors from CreateFile and retry the connection. Catch
1781 the situation where WaitNamedPipe fails to wait [sic] and add a
1782 `Sleep (0)' so that the server gets a chance to run.
1784 2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com>
1786 * dcrt0.cc: Only check for cygserver if and when required.
1787 (dll_crt0_1): Remove call to `cygserver_init ()'.
1788 * fhandler_tty.cc (fhandler_tty_slave::open): Change the cygserver
1789 logic to allow for the fact that `cygserver_init ()' may not yet
1791 (fhandler_tty_slave::cygserver_attach_tty): Tweak the cygserver
1792 request logic to conform to the practice elsewhere in the code.
1793 * tty.cc (tty::common_init): Add an explicit call to
1794 `cygserver_init ()' if it hasn't already been called.
1795 * include/cygwin/cygserver.h (CYGSERVER_UNAVAIL): Rename from
1797 (client_request_get_version::check_version): Make available in
1798 cygserver as well the DLL.
1799 (check_cygserver_available): Ditto. Remove `check_version_too'
1801 (cygserver_init): Ditto. And likewise.
1802 * cygserver_client.cc (client_request_get_version::check_version):
1803 Make available in cygserver as well the DLL.
1804 (client_request::make_request): This may now be called without
1805 `cygserver_init ()' having been called first. Detect this and
1806 call it as required. Add tracing.
1807 (check_cygserver_available): Make available in cygserver as well
1808 the DLL. Remove `check_version_too' argument and always check the
1809 version information. And since this is called from within
1810 `cygserver_init ()', force `cygserver_running' before calling
1811 `client_request::make_request ()'.
1812 (cygserver_init): Make available in cygserver as well the DLL.
1813 Remove `check_version_too' argument.
1815 2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com>
1817 * cygserver_shm.cc: Implement the ipcs(8) interfaces, IPC_INFO,
1818 SHM_STAT and SHM_INFO.
1819 (server_shmmgr::segment_t::sequence): New static field.
1820 (server_shmmgr::segment_t::key): Remove field, use the new
1821 ds.shm_perm.key field instead.
1822 (server_shmmgr::segment_t::shmid): Remove field.
1823 (server_shmmgr::segment_t::intid): New field.
1824 (server_shmmgr::segment_t::segment_t): Use the `key' argument to
1825 initialise `ds.shm_perm.key'. Change from using `shmid' to
1827 (server_shmmgr::_shmseg_cnt): Renamed from `_shmid_cnt'.
1828 (server_shmmgr::_intid_max): Renamed from `_shmid_max.
1829 (server_shmmgr::shmat): Move the out arguments to the start of the
1830 argument list. Rename the `pid' argument as `cygpid'. Add
1831 tracing. Pass an intid to `find ()', not a shmid.
1832 (server_shmmgr::shmctl): Add separate out arguments. Rename the
1833 `pid' argument as `cygpid'. Add support for the ipcs(8)
1834 interfaces. Add tracing. Pass an intid to `find ()', not a
1836 (server_shmmgr::shmdt): Rename the `pid' argument as `cygpid'.
1837 Add tracing. Pass an intid to `find ()', not a shmid.
1838 (server_shmmgr::shmget): Add a separate out arguments. Rename the
1839 `pid' argument as `cygpid'. Add tracing.
1840 (server_shmmgr::server_shmmgr): Update for new field names.
1841 (server_shmmgr::find_by_key): Update for the new `ds.shm_perm.key'
1843 (server_shmmgr::find): Update to use the new `segment_t::intid'
1845 (server_shmmgr::new_segment): Rename the `pid' argument as
1846 `cygpid'. Check that the requested size is within bounds. Handle
1847 new error result from `new_segment (key, HANDLE)'.
1848 (server_shmmgr::new_segment): Work with intids, not shmids. Check
1849 that the new intid is within bounds. Update for new field names.
1850 (server_shmmgr::delete_segment): Pass an intid to `find ()', not a
1851 shmid. Update for new field names.
1852 (client_request_shm::serve): Check that the incoming message
1853 length is the size of the `_parameters.in' struct, not of the
1854 whole in/out parameter union. Likewise, set the outgoing message
1855 length to the size of the `_parameters.out' struct. Update for
1856 the new server_shmmgr interfaces.
1857 * include/sys/ipc.h (ipc_perm::key): New field.
1858 * include/sys/shm.h (SHM_INFO): New constant.
1859 * cygserver_ipc.h (IPCMNI): New constant.
1860 (ipc_int2ext): Add `sequence' argument and munge this into the
1862 (ipc_ext2int_subsys): Unmunge the sequence number from the
1864 (ipc_ext2int): Ditto.
1865 (ipc_inc_id): Remove.
1866 (ipc_dec_id): Remove.
1867 * cygserver_shm.h (SHMMAX): New constant.
1872 (client_request_shm::_parameters): Re-arrange as a union of two
1873 separate structs, one for in arguments, the other for out.
1874 (client_request_shm::shmid): Update for the new parameter layout.
1875 (client_request_shm::ds): Ditto.
1876 (client_request_shm::info): New method.
1877 * shm.cc (client_shmmgr::_shmat_cnt): New static field.
1878 (client_shmmgr::shmat): Add locking. Add tracing.
1879 (client_shmmgr::shmctl): Update for ipcs(8) commands. Add
1880 tracing. Add more argument checking.
1881 (client_shmmgr::shmdt): Add locking. Add tracing. Update the new
1883 (client_shmmgr::shmget): Add tracing.
1884 (client_shmmgr::fixup_shms_after_fork): Add tracing. Add
1885 consistency checking.
1886 (client_shmmgr::attach): Add more tracing.
1887 (client_shmmgr::new_segment): Update the new `_shmat_cnt' field.
1888 (client_request_shm::client_request_shm): Update for the new
1889 parameter layout. Set the outgoing message length to the size of
1890 the `_parameters.in' struct, not of the whole in/out parameter
1893 2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com>
1895 * shm.cc: Remove the use of a static client_shmmgr object.
1896 (client_shmmgr::_instance): New static variable.
1897 (client_shmmgr::instance): Allocate a new shmmgr on the heap,
1898 rather than using a local static object.
1900 2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com>
1902 * cygserver_transport.cc (create_server_transport): Fix
1903 cut-and-paste error.
1905 2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com>
1907 * cygserver_client.cc (client_request::handle_request): Don't
1908 bother with the client request activity marker when compiled with
1911 2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com>
1913 * cygserver_transport_pipes.cc
1914 (MAX_WAIT_NAMED_PIPE_RETRY): New constant.
1915 (WAIT_NAMED_PIPE_TIMEOUT): Ditto.
1916 (transport_layer_pipes::close): The `pipe' field is now either
1917 NULL or a valid handle, and it should never have the value
1918 `INVALID_HANDLE_VALUE'.
1919 (transport_layer_pipes::read): Ditto.
1920 (transport_layer_pipes::write): Ditto.
1921 (transport_layer_pipes::connect): Ditto.
1922 (transport_layer_pipes::impersonate_client): Ditto.
1923 (transport_layer_pipes::connect): Ditto. New, but still bogus,
1926 2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com>
1928 * cygserver_shm.cc (server_shmmgr::server_shmmgr): All fields have
1929 to be initialized now that the singleton is no longer static.
1931 2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com>
1933 * cygserver_shm.cc (server_shmmgr::_instance): New static field.
1934 (server_shmmgr::_instance_once): Ditto.
1935 (server_shmmgr::initialise_instance): New static method.
1936 (server_shmmgr::instance): Use a pthread_once_t rather than
1937 relying on a local static variable.
1939 2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com>
1941 * woutsup.h: Remove all uses of the C++ new and delete operators
1942 throughout cygserver until they are fully thread-safe.
1943 (safe_new0): New macro to replace the C++ new operator.
1945 (safe_delete): New macro to replace the C++ delete operator.
1946 * cygserver_client.cc (client_request::handle_request): Replace
1947 all uses of the C++ new and delete operators with the new macros
1949 (client_request::make_request): Ditto.
1950 * cygserver_process.cc (~process_cleanup): Ditto.
1951 (process::cleanup): Ditto.
1952 (process_cache::process): Ditto.
1953 (process_cache::check_and_remove_process): Ditto.
1954 * cygserver_shm.cc (server_shmmgr::new_segment): Ditto.
1955 (server_shmmgr::delete_segment): Ditto.
1956 * cygserver_transport.cc (create_server_transport): Ditto.
1957 * cygserver_transport_pipes.cc
1958 (transport_layer_pipes::accept): Ditto.
1959 * cygserver_transport_sockets.cc
1960 (transport_layer_sockets::accept): Ditto.
1961 * threaded_queue.cc (~threaded_queue): Ditto.
1962 (threaded_queue::worker_loop): Ditto.
1963 (threaded_queue::stop): Replace sleep(3) with win32 Sleep.
1964 * cygserver.cc (~server_request): Replace all uses of the C++ new
1965 and delete operators with the new macros from "woutsup.h".
1966 (server_submission_loop::request_loop): Ditto.
1967 (main): Ditto. Replace sleep(3) with win32 Sleep. Replace
1968 iostreams with FILEs.
1969 (print_usage): Replace iostreams with FILEs.
1970 (print_version): Ditto.
1972 2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com>
1974 * cygserver_transport_sockets.cc
1975 (transport_layer_sockets::accept): Rename local variable
1976 `accept_fd' to avoid shadowing the `fd' field.
1978 2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com>
1980 * cygwin_ipc.h: Moved (back) to "include/sys/ipc.h".
1981 * cygwin_shm.h: Moved (back) to "include/sys/shm.h".
1982 * include/sys/ipc.h: New file.
1983 * include/sys/shm.h: New file.
1984 * cygserver_shm.h: Update for new header file locations.
1987 2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com>
1989 * cygserver_client.cc (client_request::make_request): Comment out
1990 a verbose tracing statement.
1991 * cygserver_process.cc (process_cache::sync_wait_array): Fix
1993 * include/cygwin/cygserver.h (class client_request): Remove excess
1994 use of `class' qualifier in declarations.
1995 (class client_request_get_version): Ditto.
1996 (class client_request_shutdown): Ditto.
1997 (class client_request_attach_tty): Ditto.
1999 2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com>
2001 * cygserver_ipc.h: New file.
2002 * cygserver_shm.h: Re-written from scratch.
2003 * cygserver_shm.cc: Ditto.
2006 2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com>
2008 * threaded_queue.h (class queue_request): Re-write.
2009 (threaded_queue_thread_function): Remove.
2010 (class queue_process_param): Remove.
2011 (class threaded_queue): Re-write.
2012 (class queue_submission_loop): New version of the old
2013 `queue_process_param' class.
2014 (TInterlockedExchangePointer): New templated function.
2015 (TInterlockedCompareExchangePointer): Ditto.
2016 * threaded_queue.cc (worker_function): Remove.
2017 (class threaded_queue): Re-write.
2018 (class queue_process_param): Remove.
2019 (class queue_submission_loop): New version of the old
2020 `queue_process_param' class.
2021 * include/cygwin/cygserver_process.h (process_cleanup): Re-write.
2022 (class process_process_param): Remove.
2023 (class cleanup_routine): Re-write.
2024 (class process): Re-write.
2025 (class process_cache): Re-write.
2026 * cygserver_process.cc (process_cleanup): Re-write.
2027 (class process_process_param): Remove.
2028 (class cleanup_routine): Re-write.
2029 (class process): Re-write.
2030 (class process_cache): Re-write.
2031 * cygserver.cc (request_count): Remove unused variable.
2032 (class server_request): Move methods inline.
2033 (class server_process_param): Remove.
2034 (class server_request_queue): Remove.
2035 (request_queue): Move into `main ()' and change type to
2037 (request_loop): Remove.
2038 (class server_submission_loop): New version of the old
2039 `server_process_param' class.
2040 (shutdown_server): New variable.
2041 (client_request_shutdown::serve): Set `shutdown_server' to trigger
2043 (handle_signal): Ditto.
2044 (main): Install signal handler for SIGINT rather than SIGQUIT.
2045 Use new interfaces for the `request_queue' and the `cache'.
2046 Create a `server_submission_loop' and add to the `request_queue'.
2047 Add check for the `shutdown_server' variable to the main loop.
2048 * cygserver_shm.cc (client_request_shm::serve): Release the
2049 process object after use.
2051 2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com>
2053 * cygserver_client.cc (client_request::handle_request): Correct
2055 * cygserver_transport_pipes.cc: Remove local definition of
2056 FILE_FLAG_FIRST_PIPE_INSTANCE constant.
2057 * cygwin_ipc.h: Update copyright notice.
2058 * cygwin_shm.h: Ditto.
2059 * woutsup.h: Add definition of _WIN32_WINNT.
2061 2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com>
2063 * cygserver_client (client_request::make_request): Replace my
2064 inappropriate use of set_errno () with error_code () throughout.
2066 2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com>
2068 * include/cygwin/cygserver.h: Add forward declarations of class
2069 transport_layer_base and class process_cache to reduce
2070 dependencies between header files.
2071 * include/cygwin/cygserver_process.h: Add include of
2073 * cygserver.cc: Remove unnecessary cygserver header files.
2074 * cygserver_client.cc: Ditto.
2075 * cygserver_process.cc: Ditto.
2076 * cygserver_shm.cc: Ditto.
2077 * cygserver_shm.h: Ditto.
2078 * cygserver_transport_pipes.cc: Ditto.
2080 * fhandler_tty.cc: Ditto.
2083 2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com>
2085 * cygserver_shm.h: Replace <sys/shm.h> with "cygwin_shm.h" after
2087 * cygwin_ipc.h: Update with changes to include/sys/ipc.h lost in
2089 * cygwin_shm.h: Ditto.
2091 2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com>
2093 * cygserver.cc: The tests for a duplicate server instance are now
2094 the responsibility of the transport layer.
2095 (request_loop): Use new `recoverable' flag in call to
2096 `cygserver_transport::accept ()' and shutdown on an unrecoverable
2098 (main): Never call `cygserver_init ()'. Fake `cygserver_running'
2099 just for sending a shutdown request.
2100 * cygserver_client.cc (client_request::send): Comment out
2101 message-size tracing statements as verbose.
2102 (client_request::handle): Ditto.
2103 (client_request_get_version::check_version): #ifdef as DLL-only.
2104 (check_cygserver_available): Ditto.
2105 (cygserver_init): Ditto.
2106 * include/cygwin/cygserver.h
2107 (client_request_get_version::check_version): #ifdef as DLL-only.
2108 (check_cygserver_available): Ditto.
2109 (cygserver_init): Ditto.
2110 * include/cygwin/cygserver_transport.h
2111 (transport_layer_base::impersonate_client): #ifdef as
2113 (transport_layer_base::revert_to_self): Ditto.
2114 (transport_layer_base::listen): Ditto.
2115 (transport_layer_base::accept): Ditto. Add a `recoverable' out
2116 flag for error handling.
2117 * include/cygwin/cygserver_transport_sockets.h: Ditto.
2118 * include/cygwin/cygserver_transport_pipes.h: Ditto.
2119 (transport_layer_pipes): Change type of the `pipe_name' field.
2120 Remove the `inited' field, as unnecessary. Add new
2121 `is_accepted_endpoint' field.
2122 * include/cygwin/cygserver_transport.cc
2123 (transport_layer_base::impersonate_client): #ifdef as
2125 (transport_layer_base::revert_to_self): Ditto.
2126 * include/cygwin/cygserver_transport_sockets.cc
2127 (transport_layer_sockets::listen): #ifdef as cygserver-only.
2128 (transport_layer_sockets::accept): #ifdef as cygserver-only.
2129 Analyse any errno from `accept ()' and set `recoverable' as
2131 * cygserver_transport_pipes.cc: Add local #define of
2132 `FILE_FLAG_FIRST_PIPE_INSTANCE'.
2133 (pipe_instance_lock_once): New variable.
2134 (pipe_instance_lock): Ditto.
2135 (pipe_instance): Ditto.
2136 (initialise_pipe_instance_lock): New function.
2137 (transport_layer_pipes::transport_layer_pipes): Change
2138 initialization of `pipe_name'. Initialize `is_accepted_endpoint'
2139 as appropriate. Remove use of `inited'.
2140 (transport_layer_pipes::impersonate_client): #ifdef as
2142 (transport_layer_pipes::revert_to_self): Ditto.
2143 (transport_layer_pipes::listen): Ditto.
2144 (transport_layer_pipes::accept): Ditto. Keep track of how often
2145 many named pipes have been created, in the `pipe_instance'
2146 variable, and pass the `FILE_FLAG_FIRST_PIPE_INSTANCE' flag on the
2147 open of the first instance. Analyse the error code from
2148 `CreateNamedPipe ()' and set the `recoverable' flag as
2150 (transport_layer_pipes::close): Update the `pipe_instance' count.
2152 2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com>
2154 * woutsup.h (cygserver_running): Add declaration.
2155 (api_fatal): Eliminate.
2156 * include/cygwin/cygserver.h
2157 (client_request_get_version::check_version): Change return type to
2159 (check_cygserver_available): New function.
2160 (cygserver_init): Add check_version_too argument.
2161 * cygserver_client.cc (allow_daemon): Make a bool.
2162 (client_request_get_version::make_request): See errno on error.
2163 Remove special case for CYGSERVER_REQUEST_GET_VERSION; this is now
2164 handled in cygserver_init().
2165 (client_request_get_version::check_version): Use syscall_printf()
2166 instead of api_fatal(). Return true if cygserver version is
2168 (check_cygserver_available): New function; code moved here from
2170 (cygserver_init): Move some code into check_cygserver_available().
2171 * cygserver.cc (__set_errno): Copy from debug.cc so that
2172 set_errno() can be used when __OUTSIDE_CYGWIN__.
2173 (main): Call cygserver_init() to set up cygserver_running and add
2174 checks against this to (try and) prevent multiple copies of
2175 cygserver running simultaneously. Remember to delete all
2176 transport connections so that (one day) the transport classes can
2177 tidy up on cygserver shutdown.
2179 2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com>
2181 * cygserver.cc (main): Adjust tracing output for a cleaner display
2182 when compiled without --enable-debugging.
2183 * threaded_queue.cc (threaded_queue::cleanup): Ditto.
2184 (queue_process_param::stop): Ditto.
2185 * include/cygwin/cygserver.h
2186 (client_request::make_request): Make non-virtual.
2187 (client_request::send): Make virtual and protected, not private.
2188 (client_request_attach_tty::send): New virtual method.
2189 * cygserver_client.cc: Use the `msglen()' accessor rather than
2190 `_header.msglen' throughout.
2191 (client_request_attach_tty::send): New method.
2192 (client_request::make_request): Remove the explicit close of
2193 `transport' as it is closed on deletion.
2195 2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com>
2197 * include/cygwin/cygserver.h: Change the client_request classes to
2198 give greater encapsulation and to allow variable length requests
2200 (enum cygserver_request_code): Now client_request::request_code_t.
2201 (class request_header): Now client_request::header_t. Make a
2202 union of the request_code and the error_code. The `cb' field,
2203 which was the buffer length, is now the `size_t msglen' field.
2204 (struct request_get_version): Now
2205 client_request_get_version::request_get_version.
2206 (struct request_shutdown): Remove unused type.
2207 (struct request_attach_tty): Now
2208 client_request_attach_tty::request_attach_tty.
2209 (client_request::_buf): Make field const.
2210 (client_request::_buflen): New const private field.
2211 (client_request::request_code): New accessor.
2212 (client_request::error_code): Ditto.
2213 (client_request::msglen): Ditto.
2214 (client_request::handle_request): New static method.
2215 (client_request::make_request): New virtual method.
2216 (client_request::handle): New method.
2217 (client_request::send): Make private.
2218 (client_request_get_version::check_version): New method.
2219 (client_request_get_version::serve): Make private.
2220 (client_request_get_version::version): Ditto.
2221 (client_request_shutdown::serve): Ditto.
2222 (client_request_attach_tty::req): Ditto.
2223 (client_request_attach_tty::serve): Ditto.
2224 (client_request_attach_tty::from_master): Make method const.
2225 (client_request_attach_tty::from_master): Ditto.
2226 * cygserver_client.cc
2227 (client_request_get_version::client_request_get_version): Track
2228 changes to the client_request classes.
2229 (client_request_attach_tty::client_request_attach_tty): Ditto.
2230 (client_request_get_version::check_version): New method to
2231 encapsulate code from cygserver_init().
2232 (client_request_shutdown::client_request_shutdown): Move into
2234 (client_request::send): Track changes to the client_request
2235 classes. Add more error checking.
2236 (client_request::handle_request): New static method containing the
2237 first half of the old server_request::process() code.
2238 (client_request::make_request): New method to replace the old
2239 cygserver_request() function.
2240 (client_request::handle): New method containing the second half of
2241 the old server_request::process() code.
2242 (cygserver_init): Track changes to the client_request classes. In
2243 particular, some code moved into the
2244 client_request_get_version::check_version() method.
2245 * cygserver.cc (client_request_attach_tty::serve): Track changes
2246 to the client_request classes. In particular, only return a reply
2247 body if some handles are successfully duplicated for the client.
2249 (client_request_get_version::serve): Track changes to the
2250 client_request classes.
2251 (client_request_shutdown::serve): Ditto.
2252 (class client_request_invalid): Dead, and so young too.
2253 (server_request::request_buffer): Remove unnecessary field.
2254 (client_request_shutdown::client_request_shutdown): Moved here
2255 from "cygserver_client.cc".
2256 (server_request::process): Implementation moved into the new
2257 client_request::handle_request() and client_request::handle()
2259 * cygserver_shm.h (class client_request_shm): Put client- and
2260 server-specific interfaces inside #ifdef/#ifndef __INSIDE_CYGWIN__
2262 (client_request_shm::serve): Make private.
2264 (client_request_shm::client_request_shm): Track changes to the
2265 client_request classes.
2266 (client_request_shm::serve): Ditto
2267 * shm.cc (client_request_shm::client_request_shm): Ditto. Use
2268 alloc_sd() rather than set_security_attribute() to get access to
2269 the SECURITY_DESCRIPTOR length, so that we can use it to set the
2270 request body length.
2271 (shmat): Track changes to the client_request classes. In
2272 particular, allocate client_request objects on the stack rather
2273 than on the heap, and use the client_request::make_request()
2274 method rather than the old cygserver_request() function.
2278 * fhandler_tty.cc (fhandler_tty_slave::cygserver_attach_tty): Ditto.
2280 2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com>
2282 * include/cygwin/cygserver_transport.h
2283 (cygserver_transport::read): Change buffer type to void *.
2284 (cygserver_transport::write): Ditto.
2285 * include/cygwin/cygserver_transport_sockets.h
2286 (cygserver_transport_sockets::read): Ditto.
2287 (cygserver_transport_sockets::write): Ditto.
2288 * include/cygwin/cygserver_transport_pipes.h
2289 (cygserver_transport_pipes::read): Ditto.
2290 (cygserver_transport_pipes::write): Ditto.
2291 * cygserver_transport_sockets.cc
2292 (cygserver_transport_sockets::read): Ditto.
2293 (cygserver_transport_sockets::write): Ditto.
2294 * cygserver_transport_pipes.cc
2295 (cygserver_transport_pipes::read): Ditto. Set errno on error, to
2296 match behaviour of cygserver_transport_sockets class.
2297 (cygserver_transport_pipes::write): Ditto.
2299 2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com>
2301 * cygserver.cc (version): New static variable.
2302 (server_request_queue::add_connection): Remove my gratuitous use
2304 (setup_privileges): Declare static.
2305 (handle_signal): Ditto.
2306 (longopts): Make a local variable of main().
2308 (print_usage): New function.
2309 (print_version): Ditto (tip of the hat to Joshua Daniel Franklin
2310 for inspiration here).
2311 (main): More argument checking. Add --help and --version options.
2313 2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com>
2315 * include/cygwin/cygserver.h (client_request::serve): Make pure
2317 * cygserver.cc (client_request::serve): Remove definition of pure
2319 (class client_request_invalid): New class.
2320 (server_request::process): Use new client_request_invalid
2321 class. And remove goto's.
2323 2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com>
2325 * cygserver.cc (class server_request): Add virtual destructor.
2326 (server_request_queue::addConnection): New method to replace bad
2327 virtual add() method.
2328 (request_loop): Replace call to queue->add() with call to
2329 queue->addConnection().
2330 (server_request::server_request): Use field initialization.
2331 (server_request::~server_request): New virtual destructor.
2332 (server_request::process): Remove close and delete of
2333 transport_layer_base object. It is deleted by the server_request's
2334 own destructor and closed by its own destructor.
2335 * include/cygwin/cygserver.h
2336 (client_request::operator request_header): Remove unused method.
2337 * cygserver_client.cc: Ditto.
2338 * include/cygwin/cygserver_process.h
2339 (class cleanup_routine): Add virtual destructor.
2340 (cleanup_routine::cleanup): Make pure virtual.
2341 (class process_cache): Make destructor non-virtual.
2342 (process_cache::add): Ditto.
2343 * cygserver_process.cc
2344 (cleanup_routine::~cleanup_routine): New virtual destructor.
2345 * include/cygwin/cygserver_transport.h
2346 (class transport_layer_base): Add virtual destructor.
2347 * cygserver_transport.cc
2348 (transport_layer_base::~transport_layer_base): New virtual
2350 * include/cygwin/cygserver_transport_pipes.h
2351 (class transport_layer_pipes): Add virtual destructor.
2352 * cygserver_transport_pipes.cc
2353 (transport_layer_pipes::~transport_layer_pipes): New virtual
2355 (transport_layer_pipes::close): Null out handle after closing.
2356 * include/cygwin/cygserver_transport_sockets.h
2357 (class transport_layer_sockets): Add virtual destructor.
2358 * cygserver_transport_sockets.cc
2359 (transport_layer_sockets::~transport_layer_sockets): New virtual
2361 (transport_layer_sockets::close): Null out fd after closing.
2362 * threaded_queue.h (class queue_request): Add virtual destructor.
2363 (queue_request::process): Make pure virtual.
2364 * threaded_queue.cc (~queue_request): New virtual destructor.
2365 (queue_request::process): Remove definition of pure virtual
2368 2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com>
2370 * include/cygwin/cygserver.h (client_request::send): Make
2372 (class client_request_attach_tty): Put client- and server-specific
2373 interfaces inside #ifdef/#ifndef __INSIDE_CYGWIN__ guards.
2374 * cygserver_client.cc: Ditto.
2375 (cygserver_init): Fix error handling.
2377 2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com>
2379 * cygserver.cc: Throughout the code, check and correct level of
2380 the XXX_printf() functions used. Comment out several of the
2381 debug_printf() calls with "// verbose:". Reformat and correct
2382 typos of some of the XXX_printf() formats.
2383 * cygserver_process.cc: Ditto.
2384 * cygserver_shm.cc: Ditto.
2385 * cygserver_transport_pipes.cc: Ditto.
2386 * cygserver_transport_sockets.cc: Ditto.
2387 * shm.cc (hi_ulong): New function to allow printing of a 64-bit
2388 key with current small_printf implementation.
2390 (client_request_shm::client_request_shm): Use hi_ulong() and
2391 lo_ulong() in call to debug_printf().
2393 2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com>
2395 * cygserver_shm.cc: Remove #define __INSIDE_CYGWIN__ from around
2396 <sys/shm.h> as it no longer contains any internal code.
2398 2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com>
2400 * include/sys/ipc.h (IPC_PRIVATE): Add cast to key_t.
2401 (IPC_INFO): New flag for ipcs(8).
2402 (IPC_RMID IPC_SET IPC_STAT): Renumber.
2403 * include/sys/shm.h (SHM_RDONLY SHM_RND): Renumber with distinct
2405 (class _shmattach): Internal type moved to "cygserver_shm.h".
2406 (class shmnode): Ditto.
2407 (class shmid_ds): Ditto.
2408 (struct shmid_ds): Add spare fields.
2409 (struct shminfo): New type for IPC_INFO interface.
2410 * cygserver_shm.h: Remove obsolete #if 0 ... #endif block.
2411 (class shm_cleanup): Remove unused class.
2412 (struct _shmattach): Internal type moved from <sys/shm.h>.
2413 (struct shmnode): Ditto.
2414 (struct int_shmid_ds): Ditto. Renamed to avoid name clash with
2415 public interface struct shmid_ds. Use the shmid_bs structure as a
2417 * cygserver_shm.cc: Remove obsolete #if 0 ... #endif block.
2418 (client_request_shm::serve): Update for redefinition of
2419 int_shmid_ds structure.
2420 * shm.cc (build_inprocess_shmds): Ditto.
2421 (fixup_shms_after_fork): Ditto.
2423 (shmget): Ditto. Remove obsolete #if 0 ... #endif code.
2425 2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com>
2427 * include/cygwin/cygserver_transport.h
2428 (transport_layer_base::transport_layer_base): Remove since it is
2430 (transport_layer_base::listen): Make a pure virtual method.
2431 (transport_layer_base::accept): Ditto.
2432 (transport_layer_base::close): Ditto.
2433 (transport_layer_base::read): Ditto.
2434 (transport_layer_base::write): Ditto.
2435 (transport_layer_base::connect): Ditto.
2436 * cygserver_transport.cc
2437 (transport_layer_base::transport_layer_base): Remove since it is
2439 (transport_layer_base::listen): Remove since it is now a pure
2441 (transport_layer_base::accept): Ditto.
2442 (transport_layer_base::close): Ditto.
2443 (transport_layer_base::read): Ditto.
2444 (transport_layer_base::write): Ditto.
2445 (transport_layer_base::connect): Ditto.
2447 2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com>
2449 * cygserver.cc (check_and_dup_handle): Only use security code if
2450 running on NT, i.e. if wincap.has_security().
2451 (client_request_attach_tty::serve): Add check for has_security().
2452 * cygserver_process.cc (process_cache::process): Use DWORD winpid
2453 throughout to avoid win32 vs. cygwin pid confusion.
2454 (process::process): Ditto.
2455 * cygserver_shm.cc (client_request_shm::serve): Only use security
2456 code if running on NT, i.e. if wincap.has_security().
2457 * cygserver_shm.h (client_request_shm::parameters.in): Replace the
2458 ambiguous pid field with cygpid and winpid fields.
2459 (client_request_shm::client_request_shm): Reduce to only two
2460 client-side constructors: one for SHM_CREATE, another for all the
2462 * shm.cc (client_request_shm::client_request_shm):
2463 Ditto. Initialize cygpid and winpid fields here. On NT initialize
2464 sd_buf here using set_security_attribute() to make use of the euid
2466 (shmat): Use new client_request_shm constructor.
2469 (shmget): Ditto. Remove security code, now performed in the
2470 relevant client_request_shm constructor.
2471 * include/cygwin/cygserver_process.h: (class cleanup_routine):
2472 Change winpid type to DWORD.
2473 (class process): Ditto.
2475 2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com>
2477 * woutsup.h: New file.
2478 * cygserver.cc: Use "woutsup.h" and new XXX_printf macros.
2479 (getfunc): New function, copied verbatim from "strace.cc".
2480 (__cygserver__printf): New function.
2481 * cygserver_client.cc: Use "woutsup.h" and new XXX_printf macros.
2482 * cygserver_process.cc: Ditto.
2483 * cygserver_shm.cc: Ditto.
2484 * cygserver_transport.cc: Ditto.
2485 * cygserver_transport_pipes.cc: Ditto.
2486 * cygserver_transport_sockets.cc: Ditto.
2487 * threaded_queue.cc: Ditto.
2488 * shm.cc: Remove trailing \n from XXX_printf format strings.
2489 * Makefile.in: Remove special __OUTSIDE_CYGWIN__ case for
2492 2002-09-21 Christopher Faylor <cgf@redhat.com>
2494 * init.cc (dll_entry): Temporarily disable thread detach code.
2496 2002-09-21 Christopher Faylor <cgf@redhat.com>
2498 * fhandler.cc (fhandler_base::dup): Don't set handle on failure.
2499 Caller has already taken care of that.
2500 * fhandler_console.cc (fhandler_console::open): Initialize handles to
2502 (fhandler_console::close): Ditto.
2504 2002-09-21 Christopher Faylor <cgf@redhat.com>
2506 GNUify non-GNU formatted functions calls throughout.
2508 2002-09-21 Conrad Scott <conrad.scott@dsl.pipex.com>
2510 * cygwin_ipc.h: Move to "include/cygwin/ipc.h".
2511 * cygwin_shm.h: Move to "include/cygwin/shm.h".
2512 * include/cygwin/ipc.h: New file.
2513 * include/cygwin/shm.h: New file.
2514 * ipc.c:c Update <cygwin/ipc.h> include.
2515 * cygserver_shm.cc: Update <cygwin/shm.h> include.
2518 2002-09-21 Robert Collins <rbtcollins@hotmail.com>
2520 * pthread.cc: Use class::call for converted pthread and semaphore
2522 * thread.cc: Convert various __pthread_call and __sem_call to
2523 pthread::call and sem::call throughout.
2524 * pthread.h (__pthread_cancel): Convert to pthread::cancel.
2525 (__pthread_join): Convert to pthread::join.
2526 (__pthread_detach): Convert to pthread::detach.
2527 (__pthread_create): Convert to pthread::create.
2528 (__pthread_once): Convert to pthread::once.
2529 (__pthread_atfork): Convert to pthread::atfork.
2530 (__pthread_suspend): Convert to pthread::suspend.
2531 (__pthread_continue): Convert to pthread::resume.
2532 (__sem_init): Convert to semaphore::init.
2533 (__sem_destroy): Convert to semaphore::destroy.
2534 (__sem_wait): Convert to semaphore::wait.
2535 (__sem_trywait): Convert to semaphore::trywait.
2536 (__sem_post): Convert to semaphore::post.
2538 2002-09-21 Robert Collins <rbtcollins@hotmail.com>
2540 * thread.cc: Finish the removal of the separate pthread_key
2542 Remove all pthread_key_destructor and pthread_key_destructor_list
2543 references throughout.
2544 (pthread::exit): Call the new pthread_key interface to activate
2546 (pthread_key::keys): Change into a list.
2547 (pthread_key::saveAKey): New method, used via forEach.
2548 (pthread_key::restoreAKey): Ditto.
2549 (pthread_key::destroyAKey): Ditto.
2550 (pthread_key::fixup_before_fork): Use the List::forEach functionality.
2551 (pthread_key::fixup_after_fork): Ditto.
2552 (pthread_key::runAllDestructors): New method implementation.
2553 (pthread_key::pthread_key): Use List::Insert rather than custom list
2555 (pthread_key::~pthread_key): Use List::Remove for the same reason.
2556 * thread.h: Remove all pthread_key_destructor and
2557 pthread_key_destructor_list references throughout.
2558 (List): Move the interface above pthread_key in the header.
2559 Use atomic operations during insert and delete.
2560 (List::forEach): A generic interface for doing something on each node.
2561 (pthread_key::runAllDestructors): New method, run all destructors.
2562 (pthread_key::fork_buf): Make private.
2563 (pthread_key::run_destructor): Ditto.
2564 (pthread_key::saveAKey): New method for clearer source.
2565 (pthread_key::restoreAKey): Ditto.
2566 (pthread_key::destroyAKey): Ditto.
2567 (MTinterface::destructors): Remove.
2569 2002-09-21 Robert Collins <rbtcollins@hotmail.com>
2571 * thread.cc: Partial refactoring of pthread_key destructor
2572 handling. Loosely based on Thomas Pfaff's work.
2573 (pthread_key_destructor_list::Insert): Remove.
2574 (pthread_key_destructor_list::Pop): Remove.
2575 (pthread_key_destructor_list::IterateNull): Call the key's
2576 run_destructor method.
2577 (pthread_key::pthread_key): Initialize new member.
2578 (pthread_key::get): Mark as const for correctness.
2579 (pthread_key::run_destructor): Implement.
2580 * thread.h (pthread_key::get): Mark as const for correctness.
2581 (pthread_key::run_destructor): Declare.
2582 (List): New template class that implements a generic list.
2583 (pthread_key_destructor_list): Inherit from List, and remove
2584 now duplicate functions.
2586 2002-09-21 Robert Collins <rbtcollins@hotmail.com>
2588 * thread.cc: Change verifyable_object_isvalid calls with
2589 PTHREAD_CONDATTR_MAGIC, PTHREAD_MUTEXATTR_MAGIC, PTHREAD_COND_MAGIC,
2590 SEM_MAGIC to objecttype::isGoodObject() calls throughout.
2591 (pthread_condattr::isGoodObject): Implement.
2592 (pthread_mutex::isGoodInitializer): Implement.
2593 (pthread_mutex::isGoodInitializerOrObject): Minor bugfix in the
2594 check for verifyable_object_isvalid result.
2595 (pthread_mutexattr::isGoodObject): Implement.
2596 (pthread_cond::isGoodObject): Ditto.
2597 (pthread_cond::isGoodInitializer): Ditto.
2598 (pthread_cond::isGoodInitializerOrObject): Ditto.
2599 (semaphore::isGoodObject): Ditto.
2600 * thread.h (pthread_mutex::isGoodInitializer): Declare.
2601 (pthread_condattr::isGoodObject): Ditto.
2602 (pthread_cond::isGoodObject): Const correctness.
2603 (pthread_cond::isGoodInitializer): Declare.
2604 (pthread_cond::isGoodInitializerOrObject): Ditto.
2605 (semaphore::isGoodObject): Const correctness.
2607 2002-09-21 Robert Collins <rbtcollins@hotmail.com>
2609 * thread.cc: Change verifyable_object_isvalid calls with
2610 PTHREAD_MUTEX_MAGIC and PTHREAD_KEY_MAGIC and PTHREAD_ATTR_MAGIC to
2611 ::isGoodObject() calls throughout.
2612 (MTinterface::Init): Remove dead code.
2613 (pthread_attr::isGoodObject): Implement.
2614 (pthread_key::isGoodObject): Implement.
2615 (pthread_mutex::isGoodObject): Implement.
2616 (pthread_mutex::isGoodInitializerOrObject): Implement.
2617 (pthread::isGoodObject): Update signature.
2618 * thread.h (pthread_key::isGoodObject): Declare.
2619 (pthread_attr::isGoodObject): Ditto.
2620 (pthread_mutex::isGoodObject): Ditto.
2621 (pthread_mutex::isGoodInitializerOrObject): Ditto.
2622 (pthread::isGoodObject): Change to a const parameter for const
2624 (pthread_mutexattr::isGoodObject): Declare.
2625 (pthread_condattr::isGoodObject): Ditto.
2626 (pthread_cond::isGoodObject): Ditto.
2627 (semaphore::isGoodObject): Ditto.
2629 2002-09-19 Christopher Faylor <cgf@redhat.com>
2631 Cleanup calls to CreateFile throughout.
2632 * dcrt0.cc (__api_fatal): Correctly check for failing return from CreateFile.
2633 * assert.cc (__assert): Don't check return value from CreateFile for NULL.
2634 * fhandler_console.cc (set_console_state_for_spawn): Ditto.
2635 * fork.cc (fork_parent): Ditto.
2637 2002-09-18 Christopher Faylor <cgf@redhat.com>
2639 * cygthread.cc (cygthread::initialized): Avoid copying on fork or some
2640 threads may not end up in the pool.
2641 (cygthread::new): Avoid race when checking for initialized. Add
2644 2002-09-18 Pierre Humblet <pierre.humblet@ieee.org>
2646 * fhandler.cc (fhandler_base::raw_read): Add case for
2647 ERROR_INVALID_HANDLE due to Win95 directories.
2648 (fhandler_base::open): Handle errors due to Win95 directories.
2649 (fhandler_base::close): Add get_nohandle () test.
2650 (fhandler_base::set_close_on_exec): Ditto.
2651 (fhandler_base::fork_fixup): Ditto.
2652 (fhandler_base::lock): Change error code to Posix EINVAL.
2653 (fhandler_base::dup): If get_nohandle (), set new value to
2654 INVALID_HANDLE_VALUE instead of NULL.
2655 * fhandler_disk_file.cc (fhandler_disk_file::fstat): Call fstat_by_name
2656 if get_nohandle (). Remove extraneous element from strpbrk.
2657 (fhandler_disk_file::open): Remove test for Win95 directory.
2659 * fhandler_random.cc (fhandler_dev_random::open): Add set_nohandle ().
2660 * fhandler_clipboard.cc (fhandler_dev_clipboard::open): Ditto.
2661 * fhandler_zero.cc (fhandler_dev_zero::open): Ditto.
2662 (fhandler_dev_zero::close): Delete.
2663 * fhandler.h (class fhandler_dev_zero): Ditto.
2665 2002-09-17 Robert Collins <rbtcollins@hotmail.com>
2667 * thread.cc (pthread_key::set): Preserve GetLastError(). Reported
2670 2002-09-17 Robert Collins <rbtcollins@hotmail.com>
2672 This work inspires by Thomas Pfaff's pthread_fork patch (1).
2673 * fork.cc (fork_child): Remove MTinterface fixup call, it's
2674 adsorbed by pthread::atforkchild.
2675 Rename __pthread_atforkchild to pthread::atforkchild to give
2676 access to private members.
2677 (fork_parent): Rename __pthread_atforkparent to
2678 pthread::atforkparent to give it access to private members.
2679 Ditto for __pthread_atforkprepare.
2680 * thread.cc: Fix some formatting problems throughout.
2681 (MTinterface::fixup_before_fork): Implement.
2682 (MTinterface::fixup_after_fork): Fix pthread_keys.
2683 (pthread_key::keys): Implement.
2684 (pthread_key::fixup_before_fork): Ditto.
2685 (pthread_key::fixup_after_fork): Ditto.
2686 (pthread_key::pthread_key): Add to pthread_key::keys.
2687 (pthread_key::~pthread_key): Remove from pthread_key::keys.
2688 (pthread_key::saveKeyToBuffer): Implement.
2689 (pthread_key::recreateKeyFromBuffer): Ditto.
2690 (pthread::atforkprepare): Prepare all MT classes for fork.
2691 (pthread::atforkchild): And fix them up afterwards.
2692 * thread.h (pthread_key): Buffer the key value during
2694 List the keys needing to be fixed up in a linked list with
2695 head pthread_key::keys.
2696 (pthread): Move atfork cygwin internal calls into the class.
2697 (MTInterface): Provide a fixup_before_fork for objecst that
2699 (__pthread_atforkprepare): Remove.
2700 (__pthread_atforkparent): Remove.
2701 (__pthread_atforkchild): Remove.
2703 2002-09-16 Christopher Faylor <cgf@redhat.com>
2705 * init.cc: Cleanup slightly and remove obsolete code.
2707 2002-09-11 Robert Collins <rbtcollins@hotmail.com>
2709 * init.cc (dll_entry): On thread detach, if the thread hasn't
2711 * pthread.cc (pthread_getsequence_np): Remove the
2712 __pthread_getsequence_np wrapper. This requires errno.h.
2713 * thread.cc (pthread::self): Instantiate a new pthread object
2714 when called and none exists. return a NULL object if instantiation
2716 (pthread::precreate): Factor out common code.
2717 (pthread::postcreate): Ditto.
2718 (pthread::create): Ditto.
2719 (pthread::exit): Remove the TLS value when we exit to prevent
2721 (MTinterface::Init): Bugfix - don't mark the TLS index as created
2722 if one was not allocated.
2723 Apply Extract Method to move pthread specific initialisation into
2725 (pthread::initMainThread): Extracted method from MTinterface::Init.
2726 (pthread::setTlsSelfPointer): Extracted method from various pthread
2727 calls, to make reading those functions easier.
2728 (pthread::setThreadIdtoCurrent): Ditto.
2729 (pthread::cancel_self): Bring into the .cc file, it's only used
2731 (pthread::getThreadId): Ditto.
2732 (pthread::thread_init_wrapper): Apply Extract Method to the TLS
2734 (pthread::isGoodObject): Extracted method from various pthread
2735 wrapper calls, for clarity of reading.
2736 (pthread::getsequence_np): Converted from __pthread_getsquence_np.
2737 (__pthread_create): Apply Extract Method to the object validation.
2738 (__pthread_cancel): Ditto.
2739 (__pthread_join): Ditto.
2740 (__pthread_detach): Ditto.
2741 (__pthread_suspend): Ditto.
2742 (__pthread_continue): Ditto.
2743 (__pthread_getschedparam): Ditto.
2744 (__pthread_getsequence_np): Remove.
2745 (__pthread_setschedparam): Apply Extract Method to the object
2747 (pthreadNull::getNullpthread): New method, return the pthreadNull
2749 (pthreadNull::pthreadNull): Private constructor to prevent accidental
2751 (pthreadNull::~pthreadNull): Prevent compile warnings.
2752 (pthreadNull::create): Override pthread behaviour.
2753 (pthreadNull::exit): Ditto.
2754 (pthreadNull::cancel): Ditto.
2755 (pthreadNull::testcancel): Ditto.
2756 (pthreadNull::setcancelstate): Ditto.
2757 (pthreadNull::setcanceltype): Ditto.
2758 (pthreadNull::push_cleanup_handler): Ditto.
2759 (pthreadNull::pop_cleanup_handler): Ditto.
2760 (pthreadNull::getsequence_np): Ditto.
2761 (pthreadNull::_instance): Ditto.
2762 * thread.h (pthread): Declare pre- and post-create.
2763 Move GetThreadId to private scope and rename to getThreadId.
2764 Move setThreadIdtoCurrent to private scope.
2765 Make create virtual.
2766 Make ~pthread virtual.
2767 Declare initMainThread.
2768 Declare isGoodObject.
2770 Make cancel virtual.
2771 Make testcancel virtual.
2772 Make setcancelstate virtual.
2773 Make setcanceltype virtual.
2774 Make push_cleanup_handler virtual.
2775 Make pop_cleanup_handler virtual.
2776 Declare getsequence_np.
2777 Declare setTlsSelfPointer.
2778 (pthreadNull): New null object class for pthread.
2779 (__pthread_getsequence_np): Remove.
2781 2002-09-13 Corinna Vinschen <corinna@vinschen.de>
2783 * syscalls.cc (seteuid32): Treat ILLEGAL_UID invalid.
2784 (setegid32): Treat ILLEGAL_GID invalid.
2786 2002-09-10 Pierre Humblet <pierre.humblet@ieee.org>
2788 * grp.cc (initgroups): Call groups::clear_supp to free the
2789 supplementary group sids that may have been set by setgroups.
2790 * security.cc (cygsidlist::free_sids): Also zero the class members.
2791 * security.h (groups::clear_supp): New.
2792 Rename cygsidlist_unknown to cygsidlist_empty.
2794 2002-09-08 Christopher Faylor <cgf@redhat.com>
2796 * fhandler_tty.cc (fhandler_tty_slave::open): Don't protect
2797 input/output handles since they are not properly manipulated later.
2798 * tty.cc (tty::make_pipes): Ditto.
2800 2002-09-06 Christopher Faylor <cgf@redhat.com>
2802 * winsup.h (_WIN32_WINNT): Protect.
2804 2002-09-06 Christopher Faylor <cgf@redhat.com>
2806 * winsup.h (_WIN32_WINNT): Define.
2808 2002-09-03 Corinna Vinschen <corinna@vinschen.de>
2810 * Makefile.in (DLL_OFILES): Drop shortcut.o.
2811 * path.cc: Move all shortcut functions from shortcut.c to here.
2812 (check_shortcut): Implement without using COM interface.
2813 * path.h: Move definition of SHORTCUT_HDR_SIZE to here.
2814 * shortcut.c: Remove.
2815 * shortcut.h: Ditto.
2817 2002-09-03 Conrad Scott <conrad.scott@dsl.pipex.com>
2819 * fhandler.h (fhandler_socket::read): Remove method.
2820 (fhandler_socket::write): Ditto.
2821 (fhandler_socket::readv): New method.
2822 (fhandler_socket::writev): Ditto.
2823 (fhandler_socket::recvmsg): Add new optional argument.
2824 (fhandler_socket::sendmsg): Ditto.
2825 * fhandler.cc (fhandler_socket::read): Remove method.
2826 (fhandler_socket::write): Ditto.
2827 (fhandler_socket::readv): New method.
2828 (fhandler_socket::writev): Ditto.
2829 (fhandler_socket::recvmsg): Use win32's scatter/gather IO where
2831 (fhandler_socket::sendmsg): Ditto.
2832 * net.cc (cygwin_recvmsg): Check the msghdr's iovec fields.
2833 (cygwin_sendmsg): Ditto. Add omitted sigframe.
2835 2002-09-02 Kazuhiro Fujieda <fujieda@jaist.ac.jp>
2837 * cygwin.din: Revert exporting new wchar functions.
2838 * include/cygwin/version.h: Change comment for API minor 62.
2840 2002-09-02 Christopher Faylor <cgf@redhat.com>
2842 * dcrt0.cc (dll_crt0_1): Remove getpagesize() call.
2843 * shared.cc (memory_init): Move it here.
2845 2002-08-31 Christopher January <chris@atomice.net>
2847 * fhandler_proc.cc: Add <sys/param.h> include.
2848 (format_proc_uptime): Use KernelTime and UserTime only as they include
2850 (format_proc_stat): KernelTime includes IdleTime, so subtract IdleTime
2851 from KernelTime. Make number of 'jiffies' per second same as HZ define.
2852 * fhandler_process.cc: Add <sys/param.h> include.
2853 (format_process_stat): Make number of 'jiffies' per second same as
2854 HZ define. Use KernelTime and UserTime only to calculate start_time.
2856 2002-08-30 Christopher Faylor <cgf@redhat.com>
2858 (inspired by a patch from Egor Duda)
2859 * select.cc (fhandler_tty_slave::ready_for_read): Remove.
2860 * fhandler.h (fhandler_tty_slave::ready_for_read): Remove declaration.
2861 * fhandler_tty.cc (fhandler_tty_slave::fhandler_tty_slave): Set "don't
2862 need ready for read" flag.
2863 (fhandler_tty_slave::read): Don't do anything special with vtime when
2866 2002-08-30 Egor Duda <deo@logos-m.ru>
2868 * autoload.cc (GetConsoleWindow): Correct parameter count.
2870 2002-08-30 Christopher January <chris@atomice.net>
2871 Christopher Faylor <cgf@redhat.com>
2873 * tty.cc (tty_list::allocate_tty): Use GetConsoleWindow, if available.
2874 Call FindWindow in a loop.
2875 * autoload.cc (GetConsoleWindow): Export
2877 2002-08-30 Christopher Faylor <cgf@redhat.com>
2879 * miscfuncs.cc (check_iovec_for_read): Don't check buffer when zero
2881 (check_iovec_for_write): Ditto.
2883 2002-08-27 Conrad Scott <conrad.scott@dsl.pipex.com>
2885 * fhandler.h (fhandler_base::readv): New method.
2886 (fhandler_base::writev): Ditto.
2887 * fhandler.cc (fhandler_base::readv): New method.
2888 (fhandler_base::writev): Ditto.
2889 * syscalls.cc (_read): Delegate to readv(2).
2890 (_write): Ditto, mutatis mutandi.
2891 (readv): Rewrite, based on the old _read code, to use the new
2892 fhandler_base::readv method. Improve access mode handling and ensure
2893 all calls reach the final strace statement.
2894 (writev): Ditto, mutatis mutandi.
2895 * include/sys/uio.h (struct iovec): Change field types to match SUSv3.
2896 * winsup.h (check_iovec_for_read): New function.
2897 (check_iovec_for_write): Ditto.
2898 * miscfuncs.cc (check_iovec_for_read): Ditto.
2899 (check_iovec_for_write): Ditto.
2901 2002-08-30 Corinna Vinschen <corinna@vinschen.de>
2903 * cygwin.din: Add more prototypes for new wchar functions in newlib.
2905 2002-08-30 Corinna Vinschen <corinna@vinschen.de>
2907 * cygwin.din: Add prototypes for new wchar functions in newlib.
2908 * include/cygwin/version.h: Bump API minor number.
2910 2002-08-29 Boris Schaeling <boriss@web.de>
2911 Corinna Vinschen <corinna@vinschen.de>
2913 * poll.cc (poll): Peek sockets ready for read to see if there's
2916 2002-08-28 Christopher Faylor <cgf@redhat.com>
2918 * cygthread.cc (hthreads): Remove unneeded global.
2919 (cygthread::simplestub): New static member function.
2920 (cygthread::runner): Don't set hthreads.
2921 (cygthread::freerange): New member function.
2922 (cygthread::operator new): Call freerange if all cygwin slots are used
2924 (cygthread::exit_thread): Don't mess with event if freerange thread.
2925 (cygthread::detach): Ditto.
2926 * cygthread.h (class cygthread): Declare new member functions and
2929 2002-08-28 Christopher Faylor <cgf@redhat.com>
2931 * malloc.cc: Protect some definitions to avoid a compile time warning.
2933 2002-08-27 Nicholas Wourms <nwourms@netscape.net>
2935 * cygwin.din: Export getc_unlocked, getchar_unlocked,
2936 putc_unlocked, putchar_unlocked functions.
2937 * include/cygwin/version.h: Bump api minor.
2939 2002-08-28 Corinna Vinschen <corinna@vinschen.de>
2941 * fhandler_socket.cc (fhandler_socket::recvfrom): Eliminate flags
2942 not understood by WinSock.
2943 (fhandler_socket::sendto): Ditto. If WinSock sendto() returns
2944 WSAESHUTDOWN, change errno to EPIPE and raise SIGPIPE if MSG_NOSIGNAL
2946 * include/cygwin/socket.h: Define MSG_WINMASK and MSG_NOSIGNAL.
2947 * include/cygwin/version.h: Bump API minor number.
2949 2002-08-28 Corinna Vinschen <corinna@vinschen.de>
2951 * poll.cc (poll): Eliminate erroneous POLLERR conditional.
2953 2002-08-26 Conrad Scott <conrad.scott@dsl.pipex.com>
2955 * fhandler_socket.cc (fhandler_socket::check_peer_secret_event):
2957 (fhandler_socket::connect): Remove sigframe.
2958 (fhandler_socket::accept): Ditto.
2959 (fhandler_socket::getsockname): Ditto.
2960 (fhandler_socket::getpeername): Ditto.
2961 (fhandler_socket::recvfrom): Ditto.
2962 (fhandler_socket::recvmsg): Ditto.
2963 (fhandler_socket::sendto): Ditto.
2964 (fhandler_socket::sendmsg): Ditto.
2965 (fhandler_socket::close): Ditto.
2966 (fhandler_socket::ioctl): Ditto.
2967 * ioctl.cc (ioctl): Add sigframe.
2968 * net.cc (cygwin_sendto): Ditto.
2969 (cygwin_recvfrom): Ditto.
2970 (cygwin_recvfrom): Ditto.
2971 (cygwin_connect): Ditto.
2972 (cygwin_shutdown): Ditto.
2973 (cygwin_getpeername): Ditto.
2974 (cygwin_accept): Ditto. Improve strace message.
2975 (cygwin_getsockname): Ditto. Ditto.
2976 (cygwin_recvmsg): Ditto. Ditto.
2977 (cygwin_sendmsg): Fix strace message.
2979 2002-08-27 Christopher Faylor <cgf@redhat.com>
2981 * child_info.h: Add _PROC_WHOOPS enum value.
2982 (CURR_CHILD_INFO_MAGIC): Update.
2983 (child_info::magic): Make 'long'.
2984 * cygheap.h: Export _cygheap_start.
2985 * cygheap.cc: Don't declare _cygheap_start.
2986 * cygmagic: Use cksum to produce checksums. Append 'U' to end of
2988 * dcrt0.cc (initial_env): Calculate sleep ms before reusing buffer.
2989 (_dll_crt0): Detect cygheap mismatch as indicative of different cygwin
2990 version. Set child_proc_info to NULL when _PROC_WHOOPS.
2991 (multiple_cygwin_problem): If child_info specific problem, then set
2992 child_proc_info type to _PROC_WHOOPS.
2993 * shared_info.h (CURR_MOUNT_MAGIC): Update.
2994 (CURR_SHARED_MAGIC): Ditto.
2996 2002-08-25 Conrad Scott <conrad.scott@dsl.pipex.com>
2998 * fhandler.h (fhandler_socket::recvfrom): Fix prototype.
2999 (fhandler_socket::sendto): Ditto.
3000 * fhandler_socket.cc (fhandler_socket::recvfrom): Ditto.
3001 (fhandler_socket::sendto): Ditto.
3002 * include/sys/socket.h (recv): Fix prototype.
3006 * net.cc (cygwin_sendto): Ditto. Improve strace message
3007 (cygwin_recvfrom): Ditto. Ditto.
3008 (cygwin_setsockopt): Improve strace message.
3009 (cygwin_getsockopt): Ditto.
3010 (cygwin_connect): Ditto.
3011 (cygwin_accept): Ditto.
3012 (cygwin_bind): Ditto.
3013 (cygwin_getsockname): Ditto.
3014 (cygwin_getpeername): Ditto.
3015 (cygwin_recv): Fix prototype.
3016 (cygwin_send): Ditto.
3017 (cygwin_recvmsg): Improve strace message.
3018 (cygwin_sendmsg): Ditto.
3020 2002-08-25 Pierre Humblet <Pierre.Humblet@ieee.org>
3022 * sec_acl.cc (getacl): Check ace_sid == well_known_world_sid
3023 before owner_sid and group_sid so that well_known_world_sid
3024 means "other" even when owner_sid and/or group_sid are Everyone.
3025 * security.cc (get_attribute_from_acl): Created from code common
3026 to get_nt_attribute() and get_nt_object_attribute(), with same
3027 reordering as in getacl() above.
3028 (get_nt_attribute): Call get_attribute_from_acl().
3029 (get_nt_object_attribute): Ditto.
3031 2002-08-26 Christopher Faylor <cgf@redhat.com>
3033 * Makefile.in (cygrunk.exe): Make a -mno-cygwin program.
3034 * cygrun.c (main): Export CYGWIN=ntsec unless otherwise set.
3036 * shared.cc (shared_name): Only add build date to shared name when
3039 2002-08-24 Christopher Faylor <cgf@redhat.com>
3041 * Makefile.in (DLL_IMPORTS): Move libuuid.a and libshell32.a to list
3042 rather than referring to them via -l. Add DLL imports last in link
3043 line for new-cygwin.dll and cygrun.exe.
3045 2002-08-19 Christopher Faylor <cgf@redhat.com>
3047 * pinfo.h (pinfo::remember): Arrange for destructor call if
3048 proc_subproc returns error.
3049 * sigproc.cc (zombies): Store 1 + total zombies since proc_subproc uses
3052 2002-08-19 Corinna Vinschen <corinna@vinschen.de>
3054 * pwdgrp.h (pwdgrp_read::pwdgrp_read): Remove.
3055 (pwdgrp_read::~pwdgrp_read): Ditto.
3056 (pwdgrp_read::open): Reset fh to NULL instead of INVALID_HANDLE_VALUE.
3057 (pwdgrp_read::close): Ditto.
3059 2002-08-19 Christopher Faylor <cgf@redhat.com>
3061 * fhandler.h (fhandler_console::send_winch_maybe): New method.
3062 * fhandler_console.cc (set_console_state_for_spawn): Remove if 0'ed
3064 (fhandler_console::send_winch_maybe): Define new method.
3065 (fhandler_console::read): Use send_winch_maybe where appropriate.
3066 (fhandler_console::init): Just call all tcsetattr rather than
3068 * select.cc (peek_console): Reorganize so that send_winch_maybe is
3069 called for everything but keyboard input.
3071 2002-08-18 Christopher Faylor <cgf@redhat.com>
3073 * perthread.h (vfork_save): Add ctty, sid, pgid, exitval fields.
3074 (vfork_save::restore_pid): New method.
3075 (vfork_save::restore_exit): New method.
3076 * fork.cc (vfork): Save ctty, sid, pgid and restore them when returning
3077 to "parent". Use exitval field if exiting but never created a new
3079 * syscalls.cc (setsid): Detect when in "vfork" and force an actual fork
3080 so that pid will be allocated (UGLY!).
3081 (getsid): New function.
3082 * dcrt0.cc (do_exit): Use vfork_save::restore_exit method for returning
3084 * spawn.cc (spawnve): Use vfork_save::{restore_pid,restore_exit}
3085 methods for returning from vfork.
3086 * cygwin.din: Export getsid.
3087 * include/cygwin/version.h: Bump api minor number.
3089 * malloc.cc: #ifdef sYSTRIm for when MORECORE_CANNOT_TRIM is true.
3091 2002-08-18 Christopher Faylor <cgf@redhat.com>
3093 * cygmalloc.h (MORECORE_CANNOT_TRIM): Define.
3095 2002-08-18 Christopher Faylor <cgf@redhat.com>
3097 * sigproc.cc (sigCONT): Define.
3098 * sigproc.h (sigCONT): Declare.
3099 (wait_sig): Create sigCONT event here.
3100 * exceptions.cc (sig_handle_tty_stop): Wait for sigCONT event rather
3101 than stopping thread.
3102 (sig_handle): Set sigCONT event as appropriate on SIGCONT rather than
3103 calling ResumeThread.
3105 2002-08-17 Christopher Faylor <cgf@redhat.com>
3107 * malloc.cc: Update to 2.7.2.
3108 * malloc_wrapper.cc (malloc_init): Call user level mallocs to determine
3109 if the malloc routines have been overridden.
3111 2002-08-16 Christopher Faylor <cgf@redhat.com>
3113 * winsup.h: Remove malloc_*lock functions.
3115 2002-08-16 Christopher Faylor <cgf@redhat.com>
3117 * Makefile.in: Add support for new malloc.o and renamed
3118 malloc_wrapper.o. Use -fomit-frame-pointer for malloc.o compilation.
3119 * malloc_wrapper.cc: New file. Rename from malloc.cc. Add support for
3120 more malloc functions. Eliminate export_* calls. Just use straight
3121 malloc names. Remove unused argument from malloc lock functions.
3122 * cygwin.din: Just export straight malloc names. Add malloc_stats,
3123 malloc_trim, malloc_usable_size, mallopt, memalign, valloc.
3124 * dcrt0.cc (__cygwin_user): Eliminate export_* malloc entries.
3125 * fork.cc (fork_parent): Remove unused argument from malloc_lock
3127 * malloc.cc: New file. Doug Lea's malloc v2.7.1.
3128 * cygmalloc.h: New file.
3129 * include/cygwin/version.h: Bump API_MINOR.
3131 * sync.h (muto::acquire): Use appropriate number for regparm attribute.
3132 (muto::reset): Ditto.
3133 (muto::release): Ditto.
3135 2002-08-16 Pavel Tsekov <ptsekov@gmx.net>
3137 * exceptions.cc (interrupt_setup): Ensure that the previous signal mask
3140 2002-08-15 Thomas Pfaff <tpfaff@gmx.net>
3142 * dcrt0.cc: Modify define for CYGWIN_GUARD.
3143 (alloc_stack_hard_way): Just use CYGWIN_GUARD in VirtualAlloc call.
3145 2002-08-11 Conrad Scott <conrad.scott@dsl.pipex.com>
3147 * fhandler.h (fhandler_socket::recv): Remove method.
3148 (fhandler_socket::send): Ditto.
3149 * fhandler_socket.cc (fhandler_socket::recv): Ditto.
3150 (fhandler_socket::send): Ditto.
3151 (fhandler_socket::read): Delegate to fhandler_socket::recvfrom.
3152 (fhandler_socket::write): Delegate to fhandler_socket::sendto.
3153 (fhandler_socket::sendto): Check for null `to' address.
3154 * net.cc (cygwin_sendto): Check for zero request length.
3155 (cygwin_recvfrom): Ditto. Fix signature, use void *buf.
3156 (cygwin_recv): Delegate to cygwin_recvfrom.
3157 (cygwin_send): Delegate to cygwin_sendto.
3159 2002-08-11 Christopher Faylor <cgf@redhat.com>
3161 * cygthread.cc (cygthread::cygthread): Close another race.
3163 2002-08-11 Christopher Faylor <cgf@redhat.com>
3165 * assert.cc (__assert): Call debugger on assertion failure if
3167 * dcrt0.cc (dll_crt0_1): Just wait for signal thread to go live rather
3168 than going through the overhead of invoking it.
3169 * fork.cc (fork_child): Ditto.
3170 * exceptions.cc (signal_fixup_after_fork): Call sigproc_init here.
3171 * sigproc.cc (proc_can_be_signalled): Assume that the signal thread is
3173 (sig_dispatch): Ditto.
3175 (wait_for_sigthread): Rename from "wait_for_me". Assume that
3176 wait_sig_inited has been set and that this function is only called from
3178 * sigproc.h (wait_for_sigthread): Declare new function.
3180 2002-08-08 Christopher Faylor <cgf@redhat.com>
3182 * environ.cc (parse_options): Remember the "no" part of any options for
3185 2002-08-07 Conrad Scott <conrad.scott@dsl.pipex.com>
3187 * winsup.h (__check_null_invalid_struct): Make ptr argument non-const.
3188 (__check_null_invalid_struct_errno): Ditto.
3189 * miscfuncs.cc (__check_null_invalid_struct): Ditto.
3190 (__check_null_invalid_struct_errno): Ditto.
3191 (__check_invalid_read_ptr_errno): Remove superfluous cast.
3192 * net.cc (get): Set appropriate errno if fd is not a socket.
3193 (cygwin_sendto): Fix parameter checking.
3194 (cygwin_recvfrom): Ditto.
3195 (cygwin_setsockopt): Ditto.
3196 (cygwin_getsockopt): Ditto.
3197 (cygwin_connect): Ditto.
3198 (cygwin_gethostbyaddr): Ditto.
3199 (cygwin_accept): Ditto.
3200 (cygwin_bind): Ditto.
3201 (cygwin_getsockname): Ditto.
3202 (cygwin_listen): Ditto.
3203 (cygwin_getpeername): Ditto.
3204 (cygwin_send): Ditto.
3205 (cygwin_shutdown): Ditto. Move sigframe to fhandler_socket.
3206 (cygwin_recvmsg): Fix parameter checking. Add tracing.
3207 (cygwin_sendmsg): Ditto.
3208 * fhandler_socket.cc (fhandler_socket::shutdown): Add sigframe.
3209 * resource.cc (setrlimit): Fix parameter checking.
3211 2002-08-08 Joe Buehler <jbuehler@hekimian.com
3213 * sec_helper.cc (sec_acl): remove extraneous arg to debug_printf.
3215 2002-08-07 Conrad Scott <conrad.scott@dsl.pipex.com>
3217 * fhandler_socket.cc (fhandler_socket::accept): Fix FIONBIO call.
3219 2002-08-06 Christopher Faylor <cgf@redhat.com>
3221 * cygheap.cc (_csbrk): Avoid !cygheap considerations.
3222 (cygheap_init): Deal with unintialized cygheap issues here.
3223 (cheap_init): Move cygheap_max setting here.
3225 2002-08-06 Christopher Faylor <cgf@redhat.com>
3226 Conrad Scott <conrad.scott@dsl.pipex.com
3228 * cygheap.cc (_csbrk): Allocate some slop initially. Don't erroneously
3229 add sbrk amount to returned value in initial case.
3231 2002-08-06 Christopher Faylor <cgf@redhat.com>
3233 * spawn.cc (spawn_guts): Don't set mount_h here.
3234 * sigproc.cc (init_child_info): Set it here instead.
3235 * shared.cc (cygwin_mount_h): Make NO_COPY.
3237 2002-08-06 Christopher Faylor <cgf@redhat.com>
3239 * cygthread.cc (cygthread::stub): Accept flag to pass info structure to
3241 (cygthread::operator new): Add defensive debugging output.
3242 (cygthread::cygthread): Add debugging output. Set name after thread
3243 has been awakened to avoid a race.
3244 (cygthread::exit_thread): Use handle operator rather than using ev
3246 (cygthread::exit_thread): Reorganize to provide debugging. Set __name
3248 * cygthread.h (cygself): Define.
3249 * fhandler_tty.cc (fhandler_tty_master::init): Use cygself as argument
3250 so that invoked thread can access its own info.
3251 (process_output): Derive cygthread info of thread from thread argument.
3252 * sigproc.cc (sigproc_init): Use cygself as argument so that invoked
3253 thread can access its own info.
3254 (wait_sig): Derive cygthread info of thread from thread argument.
3256 2002-08-06 Conrad Scott <conrad.scott@dsl.pipex.com>
3258 * debug.h (handle_list::allocated): Remove field.
3259 * debug.cc (newh): Don't malloc extra entries.
3260 (add_handle): Downgrade strace message level.
3261 (delete_handle): Remove case for `allocated' entries.
3263 2002-08-05 Christopher Faylor <cgf@redhat.com>
3265 * cygthread.cc (cygthread::stub): Change event creation to manual
3266 reset. Set __name after calling SetEvent to prevent races.
3267 (cygthread::detach): Always reset event here to prevent races.
3269 2002-08-03 Conrad Scott <conrad.scott@dsl.pipex.com>
3271 * debug.h (WaitForMultipleObjects): Correct typo.
3273 2002-08-01 Pierre Humblet <Pierre.Humblet@ieee.org>
3275 * security.cc (verify_token): Do not reject a token just because
3276 the supplementary group list is missing Everyone or a groupsid
3277 equal to usersid, or because the primary group is not in the token,
3278 as long as it is equal to the usersid.
3279 * syscalls.cc (seteuid32): Use common code for all successful returns.
3280 * grp.cc (getgroups32): Never includes Everyone in the output.
3282 2002-08-01 Christopher Faylor <cgf@redhat.com>
3284 * cygthread.cc (cygthread::exit_thread): Define new method.
3285 * cygthread.h (cygthread::exit_thread): Declare new method.
3286 * fhandler.h (fhandler_tty_master::hThread): Delete.
3287 (fhandler_tty_master::output_thread): Define.
3288 * fhandler_tty.cc (fhandler_tty_master::fhandler_tty_master): Adjust
3290 (fhandler_tty_master::init): Use cygthread rather than handle.
3291 (process_output): Use cygthread method to exit.
3292 (fhandler_tty_master::fixup_after_fork): Set output_thread to NULL
3294 (fhandler_tty_master::fixup_after_exec): Set output_thread to NULL
3296 * tty.cc (tty_list::terminate): Detach from output_thread using
3299 2002-08-01 Christopher Faylor <cgf@redhat.com>
3301 * syscalls.cc (_link): Revert previous change and just always
3302 dereference the oldpath.
3304 2002-08-01 Christopher Faylor <cgf@redhat.com>
3306 * syscalls.cc (link): Properly deal with a link to a symlink.
3308 2002-08-01 Christopher Faylor <cgf@redhat.com>
3310 * cygthread.cc: Remove cruft.
3312 2002-08-01 Christopher Faylor <cgf@redhat.com>
3314 * Makefile.in (DLL_OFILES): Add cygthread.o.
3315 * dcrt0.cc (dll_crt0_1): Eliminate various thread initialization
3316 functions in favor of new cygthread class.
3317 * debug.cc: Remove thread manipulation functions.
3319 * external.cc (cygwin_internal): Use cygthread method for determining
3320 thread name. Remove capability for setting thread name.
3321 * fhandler_console.cc (fhandler_console::read): Use cygthread method
3322 rather than iscygthread function.
3323 * fhandler_tty.cc (fhandler_tty_master::fhandler_tty_master): Use
3324 cygthread methods to create threads.
3325 (fhandler_tty_common::__acquire_output_mutex): Use cygthread method to
3326 retrieve thread name.
3327 * select.cc (pipeinf): Use cygthread pointer rather than handle.
3328 (start_thread_pipe): Ditto.
3329 (pipe_cleanup): Ditto.
3331 (start_thread_serial): Ditto.
3332 (serial_cleanup): Ditto.
3334 (start_thread_socket): Ditto.
3335 (socket_cleanup): Ditto.
3336 * sigproc.cc (hwait_sig): Ditto.
3337 (hwait_subproc): Ditto.
3338 (proc_terminate): Ditto.
3339 (sigproc_terminate): Ditto.
3340 (sigproc_init): Initialize cygthread hwait_sig pointer.
3341 (subproc_init): Initialize cygthread hwait_subproc pointer.
3342 (wait_sig): Rely on cygthread HANDLE operator.
3343 * strace.cc (strace::vsprntf): Use cygthread::name rather than threadname.
3344 * window.cc (gethwnd): Use cygthread method to initialize thread.
3346 2002-07-31 Conrad Scott <conrad.scott@dsl.pipex.com>
3348 * fhandler.h (fhandler_base::get_r_no_interrupt): Make non-virtual.
3349 * net.cc (fdsock): Call set_r_no_interrupt.
3351 2002-07-30 Christopher Faylor <cgf@redhat.com>
3353 * syscalls.cc (_read): Clarify debugging output.
3355 2002-07-30 Christopher Faylor <cgf@redhat.com>
3357 * fhandler.h (fhandler_base::get_r_no_interrupt): Make virtual.
3359 2002-07-30 Christopher Faylor <cgf@redhat.com>
3361 * fhandler_disk_file.cc (fhandler_cygdrive::set_drives): Incorporate .
3362 and .. processing here.
3363 (fhandler_cygdrive::readdir): Assume . and .. are already in pdrive.
3364 (fhandler_cygdrive::seekdir): Ditto.
3366 2002-07-29 Christopher Faylor <cgf@redhat.com>
3368 * dcrt0.cc (dll_crt0_1): Move debug_fixup_after_fork_exec.
3369 * cygheap.cc (cygheap_fixup_in_child): Call debug_fixup_after_fork_exec
3370 immediately after cygheap has been set up.
3372 2002-07-29 Corinna Vinschen <corinna@vinschen.de>
3374 * security.cc: Change some formatting.
3375 * include/cygwin/version.h: Bump API minor version.
3377 2002-07-28 Pierre Humblet <Pierre.Humblet@ieee.org>
3379 * cygheap.h (class cygheap_user): Add member groups.
3380 * security.h (class cygsidlist): Add members type and maxcount, methods
3381 position, addfromgr, alloc_sids and free_sids and operator+= (const
3382 PSID psid). Modify contains () to call position () and optimize add ()
3384 (class user_groups): Create. Update declarations of verify_token and
3386 * security.cc (cygsidlist::alloc_sids): New.
3387 (cygsidlist::free_sids): New.
3388 (get_token_group_sidlist): Create from get_group_sidlist.
3389 (get_initgroups_sidlist): Create from get_group_sidlist.
3390 (get_group_sidlist): Suppress.
3391 (get_setgroups_sidlist): Create.
3392 (verify_token): Modify arguments. Add setgroups case.
3393 (create_token): Modify arguments. Call get_initgroups_sidlist and
3394 get_setgroups_sidlist as needed. Set SE_GROUP_LOGON_ID from auth_pos
3395 outside of the loop. Rename the various group sid lists consistently.
3396 * syscalls.cc (seteuid32): Modify to use cygheap->user.groups.
3397 (setegid32): Call cygheap->user.groups.update_pgrp.
3398 * grp.cc (setgroups): Create.
3399 (setgroups32): Create.
3400 * uinfo.cc (internal_getlogin): Initialize and update
3402 * cygwin.din: Add setgroups and setgroups32.
3404 2002-07-28 Christopher Faylor <cgf@redhat.com>
3406 * fhandler_console.cc (fhandler_console::read): Use appropriate
3408 * select.cc (peek_console): Ditto.
3409 * fhandler_termios.cc (fhandler_termios::bg_check): Send "stopped"
3410 signal to entire process group as dictated by SUSv3.
3411 * termios.cc (tcsetattr): Detect when stopped signal sent and force a
3412 stop before setting anything.
3414 2002-07-26 Christopher Faylor <cgf@redhat.com>
3416 * include/cygwin/version.h: Bump API version to indicate that ntsec is
3419 2002-07-26 Conrad Scott <conrad.scott@dsl.pipex.com>
3421 * fhandler_registry.cc (fhandler_registry::close): Return any error
3422 result to the caller.
3423 * syscalls.cc (_close): Return result of fhandler::close to the caller.
3425 2002-07-25 Christopher Faylor <cgf@redhat.com>
3427 * security.cc (allow_ntsec): Default to on.
3428 (allow_smbntsec): Default to off.
3430 2002-07-24 David MacMahon <davidm@smartsc.com>
3432 * times.cc (to_time_t): Always round time_t down to nearest second.
3434 2002-07-25 Egor Duda <deo@logos-m.ru>
3436 * Makefile.in: Check if API version is updated when exports are
3437 changed and stop if not so.
3439 2002-07-24 Egor Duda <deo@logos-m.ru>
3441 * include/cygwin/version.h: Bump minor API version.
3443 2002-07-24 Corinna Vinschen <corinna@vinschen.de>
3445 * fhandler_serial.cc: Change 'must_init_serial_line capability'
3446 to 'supports_reading_modem_output_lines' throughout (negated meaning).
3450 2002-07-23 Nicholas Wourms <nwourms@netscape.net>
3452 * cygwin.din (fcloseall): Add symbol for export.
3453 (fcloseall_r): Ditto.
3455 2002-07-24 Christopher Faylor <cgf@redhat.com>
3457 * path.cc (path_conv::check): Always set fileattr when component == 0.
3458 (readlink): Use path_conv method rather than field.
3459 * fhandler_disk_file.cc (fhandler_disk_file::fstat_helper): Ditto,
3461 * path.h (path_conv): Make fileattr private.
3462 * exceptions.cc (try_to_debug): Default to idle priority when looping.
3464 2002-07-23 Corinna Vinschen <corinna@vinschen.de>
3466 * fhandler_serial.cc: Use must_init_serial_line capability throughout.
3467 * wincap.cc: Set flag must_init_serial_line appropriately.
3468 * wincap.h: Add flag must_init_serial_line.
3470 2002-07-23 Corinna Vinschen <corinna@vinschen.de>
3472 * security.cc (get_group_sidlist): Create group list from /etc files
3473 even if DC is available but access fails.
3475 2002-07-22 Christopher Faylor <cgf@redhat.com>
3477 * fhandler_serial.cc: Fix formatting problems introduced by below
3480 2002-07-22 Jacek Trzcinski <jacek@certum.pl>
3482 * fhandler.h (class fhandler_serial): Add new members of the class -
3483 rts,dtr and method ioctl(). Variables rts and dtr important for Win 9x
3485 * fhandler_serial.cc (fhandler_serial::open): Add initial setting of
3486 dtr and rts. Important for Win 9x only.
3487 (fhandler_serial::ioctl): New function. Implements commands TIOCMGET,
3488 TIOCMSET and TIOCINQ.
3489 (fhandler_serial::tcflush): Fix found error.
3490 (fhandler_serial::tcsetattr): Add settings of rts and dtr. Important
3492 * termios.h: Add new defines as a support for ioctl() function on
3495 2002-07-20 Christopher Faylor <cgf@redhat.com>
3497 * autoload.cc (LoadDLLprime): Add jmp call to allow streamlining of
3499 (doit): Avoid use of cx register. Just change one word to avoid races.
3501 2002-07-18 Pierre Humblet <pierre.humblet@ieee.org>
3503 * security.cc (get_unix_group_sidlist): Create.
3504 (get_supplementary_group_sidlist): Evolve into get_unix_group_sidlist.
3505 (get_user_local_groups): Add check for duplicates.
3506 (get_user_primary_group): Suppress.
3507 (get_group_sidlist): Silently ignore PDC unavailability.
3508 Call get_unix_group_sidlist() before get_user_local_groups().
3509 Remove call to get_supplementary_group_sidlist(). Never call
3510 get_user_primary_group() as the passwd group is always included.
3511 Add well_known_authenticated_users_sid in only one statement.
3513 2002-07-19 Christopher Faylor <cgf@redhat.com>
3515 * fhandler_serial.cc (fhandler_serial::tcflush): Fix typo.
3517 2002-07-15 Corinna Vinschen <corinna@vinschen.de>
3519 * security.cc (get_group_sidlist): Fix formatting.
3521 2002-07-14 Christopher Faylor <cgf@redhat.com>
3523 * dcrt0.cc (initial_env): Force path and CYGWIN_DEBUG contents to lower
3525 * exceptions.cc (error_start_init): Use the name derived from
3526 GetModuleName rather than myself->progname.
3528 2002-07-14 Christopher Faylor <cgf@redhat.com>
3530 * dcrt0.cc (dll_crt0_1): Move debug_init call back to here. Avoid a
3532 * shared.cc (memory_init): Remove debug_init call.
3533 * debug.h (handle_list): Change "clexec" to "inherited".
3534 * debug.cc: Remove a spurious declaration.
3535 (setclexec): Conditionalize away since it is currently unused.
3536 (add_handle): Use inherited field rather than clexec.
3537 (debug_fixup_after_fork_exec): Ditto. Move debugging output to
3539 (delete_handle): Add debugging output.
3540 * fhandler.cc (fhandler_base::set_inheritance): Don't bother setting
3541 inheritance in debugging table since the handle was never protected
3543 (fhandler_base::fork_fixup): Ditto.
3545 * exceptions.cc (debugger_command): Revert.
3547 2002-07-14 Conrad Scott <conrad.scott@dsl.pipex.com>
3549 * debug.cc (clexec): Add missing `hl = hl->next'.
3551 2002-07-14 Christopher Faylor <cgf@redhat.com>
3553 * Makefile.in (cygrun.exe): Add a -lcygwin on the end.
3555 2002-07-14 Christopher Faylor <cgf@redhat.com>
3557 * Makefile.in (cygserver.exe): Add -lstdc++.
3558 (cygrun.exe): Move -lgcc last.
3560 2002-07-13 Christopher Faylor <cgf@redhat.com>
3562 * dcrt0.cc (dll_crt0_1): Delay closing of some handles until cygheap
3564 (break_here): New function, for debugging.
3565 (initial_env): Add program name to "Sleeping" message. Implement new
3566 "CYGWIN_DEBUG" environment variable option.
3567 * exceptions.cc (debugger_command): Add argument to dumper call.
3568 * strace.cc (strace::hello): Use winpid if cygwin pid is unavailable.
3569 (strace::vsprntf): Ditto.
3571 2002-07-13 Christopher Faylor <cgf@redhat.com>
3573 * debug.h (handle_list): Move here from debug.cc. Add "inherit" flag
3575 * cygheap.cc (init_cheap): Move cygheap_max calculation to _csbrk.
3576 (_csbrk): Reorganize to not assume first allocation is <= 1 page.
3577 (cygheap_setup_for_child): Mark protected handle as inheritable.
3578 * cygheap.h (cygheap_debug): New struct.
3579 (init_cygheap): Add new structure when debugging.
3580 * dcrt0.cc (dll_crt0_1): Remove call to debug_init. Close ppid_handle
3581 here, if appropriate. Don't protect subproc_ready, since it is already
3582 protected in the parent. Call memory_init prior to ProtectHandle to
3583 ensure that cygheap is set up. Call debug_fixup_after_fork_exec when
3585 (_dll_crt0): Don't close ppid_handle here.
3586 * debug.cc: Use cygheap debug structure rather than static elements
3588 (add_handle): Don't issue a warning if attempt to protect handle in
3589 exactly the same way from exactly the same place. Add pid info to
3590 warning output. Accept additional argument controlling whether handle
3591 is to be inherited. Add pid to stored information.
3592 (debug_fixup_after_fork_exec): Renamed from debug_fixup_after_fork.
3593 Reorganize to avoid erroneously skipping handles.
3594 (mark_closed): Add pid info to warning output.
3595 (setclexec): Rename from setclexec_pid.
3596 * fhandler.cc (fhandler_base::get_default_fmode): Minor reorg.
3597 (fhandler_base::fstat): Add debugging output.
3598 (fhandler_base::set_inheritance): Call setclexec rather than
3600 (fhandler_base::fork_fixup): Ditto.
3601 * fhandler_console.cc (get_tty_stuff): Mark protected handle as
3603 * fhandler_tty.cc (fhandler_tty_slave::open): Ditto.
3604 * tty.cc (tty::make_pipes): Ditto.
3605 (tty::common_init): Ditto.
3606 * fork.cc (fork_parent): Ditto.
3607 (fork_child): Close protected handles with correct name. Remove
3608 debug_fixup_after_fork call.
3609 * fhandler_socket.cc (fhandler_socket::create_secret_event): Mark
3610 protected handle as inheritable/non-inheritable, as appropriate.
3611 * shared.cc (memory_init): Mark protected handle as inheritable.
3612 Call debug_init here.
3613 * sigproc.cc (wait_sig): Close protected handle with correct name.
3614 * spawn.cc (spawn_guts): Rename spr to subproc_ready and mark it as
3617 * exceptions.cc (debugger_command): Try to run dumper.exe, if found.
3619 * syscalls.cc (fstat64): Don't follow symlinks for path_conv lookup
3620 since path is already resolved.
3622 2002-07-12 Christopher Faylor <cgf@redhat.com>
3624 * cygwin.din: Change erroneous entries.
3626 2002-07-11 Pavel Tsekov <ptsekov@gmx.net>
3628 * fhandler_disk_file.cc (fhandler_disk_file::open): Don't
3629 move the file pointer to the end of file if O_APPEND is
3630 specified in the open flags.
3632 2002-07-09 Christopher Faylor <cgf@redhat.com>
3634 * debug.cc: Avoid explicit zeroing of globals.
3635 (lock_debug): Make locker a static member. Avoid unlocking when
3636 already unlocked (from Conrad Scott).
3637 (debug_init): Initialize lock_debug::locker here.
3638 * fork.cc (fork_child): Fix up fdtab earlier to avoid some (but not
3639 all) confusion with close-on-exec craziness.
3641 2002-07-05 Corinna Vinschen <corinna@vinschen.de>
3643 * fhandler.h (fhandler_socket::is_unconnected): Constify.
3644 (fhandler_socket::is_connect_pending): Ditto.
3645 (fhandler_socket::is_connected): Ditto.
3646 (fhandler_socket::set_connect_state): New method.
3647 (struct select_record): Add member `except_on_write'.
3648 (select_record::select_record): Initialize all bool values to `false'.
3649 * fhandler_socket.cc: Use set_connect_state() method throughout.
3650 (fhandler_socket::connect): Set state always to connected if connection
3652 * net.cc (cygwin_getsockopt): Revert erroneous previous patch.
3653 * select.cc (set_bits): Check for `except_on_write'. Set fd in
3654 write_fds if set. Set connect state to connected if fd has been
3655 returned by WINSOCK_SELECT.
3656 (peek_socket): Check for `except_on_write'.
3657 (start_thread_socket): Ditto.
3658 (fhandler_socket::select_write): Don't set `write_ready' if connect
3659 is pending. Set `except_on_write' if connect is pending.
3661 2002-07-05 Christopher Faylor <cgf@redhat.com>
3663 * ntdll.h (_SYSTEM_PROCESSOR_TIMES): Force eight byte alignment.
3664 (_SYSTEM_TIME_OF_DAY_INFORMATION): Ditto.
3666 * path.cc (suffix_scan::has): Reorganize to eliminate double scanning
3667 for for .exe (in the typical case).
3669 2002-07-05 Corinna Vinschen <corinna@vinschen.de>
3671 * fhandler.h (UNCONNECTED): New define.
3672 (CONNECT_PENDING): Ditto.
3674 (class fhandler_socket): Add member `had_connect_or_listen'.
3675 Add member functions `is_unconnected', `is_connect_pending' and
3677 * fhandler_socket.cc (fhandler_socket::connect): Set member
3678 `had_connect_or_listen' according to return code of WinSock
3680 (fhandler_socket::listen): Ditto.
3681 * net.cc (cygwin_getsockopt): Modify SO_ERROR return value in
3682 case of socket with pending connect().
3683 * select.cc (peek_socket): Only add socket to matching fd_set
3684 if it's not "ready". Call WINSOCK_SELECT only if at least one
3685 socket is in one of the fd_sets.
3686 (start_thread_socket): Only add socket to matching fd_set
3687 if it's not "ready".
3688 (fhandler_socket::select_write): Set write_ready to true also
3689 if socket isn't connected or listening.
3691 2002-07-04 Corinna Vinschen <corinna@vinschen.de>
3693 * fhandler_socket.cc (fhandler_socket::set_sun_path): Don't free
3694 memory here. Allow NULL parameter.
3696 2002-07-04 Corinna Vinschen <corinna@vinschen.de>
3698 * fhandler_socket.cc (fhandler_socket::dup): Add missing copy operation
3701 2002-07-03 Christopher Faylor <cgf@redhat.com>
3703 * include/cygwin/version.h: Bump DLL minor number.
3705 2002-07-03 Christopher Faylor <cgf@redhat.com>
3707 * include/sys/statfs.h: New header file.
3709 2002-07-03 Christopher Faylor <cgf@redhat.com>
3711 * dtable.cc (cygwin_attach_handle_to_fd): Default to implicit bin mode
3713 * fhandler.cc (fhandler_base::init): Make bin argument a guarantee
3714 rather than a suggestion.
3715 * path.cc (path_conv::check): Load flag returned from
3716 cygwin_conv_to_win32_path into path_flags.
3718 2002-07-03 Conrad Scott <conrad.scott@dsl.pipex.com>
3720 * tty.cc (tty::common_init): Reverse logic of cygserver check in
3721 call to SetKernelObjectSecurity.
3723 2002-07-03 Thomas Pfaff <tpfaff@gmx.net>
3725 * autoload.cc (WSAEventSelect): Define new autoload function.
3726 (WSAEnumNetworkEvents): Ditto.
3727 * fhandler_socket.cc (fhandler_socket::accept): If socket is
3728 in blocking mode wait for incoming connection and signal.
3730 2002-07-02 Christopher Faylor <cgf@redhat.com>
3732 * cygheap.cc (init_cheap): Rearrange error message.
3733 (cygheap_fixup_in_child): Ditto.
3734 * dtable.cc: Remove if 0'ed code.
3735 * fhandler_dsp.cc (fhandler_dev_dsp::open): Force binmode.
3736 * sec_helper.cc (cygsid::get_id): Use system_printf for error message.
3737 * tty.cc (tty::common_init): Ditto.
3739 2002-07-02 Christopher Faylor <cgf@redhat.com>
3741 * net.cc (cygwin_getpeername): Defend against NULL pointer dereference.
3743 2002-07-02 Egor Duda <deo@logos-m.ru>
3745 * include/cygwin/version.h: Bump API minor version.
3747 2002-07-01 Pierre Humblet <pierre.humblet@ieee.org>
3749 * security.cc (get_logon_server): Interpret a zero length
3750 domain as the local domain.
3751 (get_group_sidlist): Add authenticated users SID to SYSTEM's group
3752 list instead of SYSTEM itself.
3753 (verify_token): Accept the primary group sid if it equals
3756 2002-07-02 Corinna Vinschen <corinna@vinschen.de>
3758 * cygwin.din (__fpclassifyd): Add symbol.
3759 (__fpclassifyf): Ditto.
3760 (__signbitd): Ditto.
3761 (__signbitf): Ditto.
3763 2002-07-02 Corinna Vinschen <corinna@vinschen.de>
3765 * security.h (DONT_INHERIT): Eliminate definition.
3766 (INHERIT_ALL): Ditto.
3767 (INHERIT_ONLY): Ditto.
3768 * sec_acl.cc: Use appropriate defines from accctrl.h instead of the
3770 * security.cc: Ditto.
3772 2002-07-01 Pierre Humblet <pierre.humblet@ieee.org>
3774 * syscalls.c (seteuid32): Return immediately if the program is not
3775 impersonated and both uid and gid are original.
3776 (setegid32): Return immediately if the new gid is the current egid.
3778 2002-07-01 Christopher Faylor <cgf@redhat.com>
3780 * syscalls.cc (seteuid32): Fix incorrect placement of Pierre's patch
3783 2002-07-01 Christopher Faylor <cgf@redhat.com>
3785 * syscalls.cc (seteuid32): Fix incorrect use of system_printf.
3787 2002-07-02 Christopher January <chris@atomice.net>
3789 * autoload.cc (GetSecurityInfo): Define new autoload function.
3790 (RegQueryInfoKeyA): Ditto.
3791 * fhandler.h (fhandler_virtual::fill_filebuf): Change return type to
3793 (fhandler_proc::fill_filebuf): Ditto.
3794 (fhandler_registry::fill_filebuf): Ditto.
3795 (fhandler_process::fill_filebuf): Ditto.
3796 (fhandler_registry::value_name): Add new member.
3797 (fhandler_registry::close): Add new method.
3798 (fhandler_process::p): Remove member.
3799 * fhandler_proc.cc (fhandler_proc::open): Add set_nohandle after
3800 calling superclass method. Check return value of fill_filebuf.
3801 (fhandler_proc::fill_filebuf): Change return type to bool. Add return
3803 * fhandler_process.cc (fhandler_process::open): Add set_nohandle after
3804 calling superclass method. Remove references to p. Check return value
3806 (fhandler_process::fill_filebuf): Change return type to bool. Don't
3807 use dereference operator on p. Add return statement.
3808 (fhandler_process::format_process_stat): Fix typo.
3809 * fhandler_registry.cc: Add static open_key declaration.
3810 (fhandler_registry::exists): Assume path is already normalised. Try
3811 opening the path as a key in its own right first, before reverting to
3812 enumerating subkeys and values of the parent key.
3813 (fhandler_registry::fstat): Add additional code to return more relevant
3814 information about the registry key/value.
3815 (fhandler_registry::readdir): Explicitly set desired access when
3816 opening registry key. Remove output of buf from debug_printf format
3818 (fhandler_registry::open): Use set_io_handle to store registry key
3819 handle. Set value_name member. Move code to read a value from the
3820 registry to fill_filebuf. Add call to fill_filebuf.
3821 (fhandler_registry::close): New method.
3822 (fhandler_registry::fill_filebuf): Change return type to bool. Add
3823 code to read a value from registry.
3824 (fhandler_registry::open_key): Make function static. Use KEY_READ as
3825 desired access unless this is the last path component. Check the
3826 return value of RegOpenKeyEx for an error instead of hKey.
3827 * fhandler_virtual.cc (fhandler_virtual::lseek): Check the return value
3829 (fhandler_virtual::open): Remove call to set_nohandle.
3830 (fhandler_virtual::fill_filebuf): Change return type to bool. Add
3832 * security.cc (get_nt_object_attribute): New function.
3833 (get_object_attribute): New function.
3834 * security.h (get_object_attribute): New function declaration.
3836 2002-07-01 Pierre Humblet <pierre.humblet@ieee.org>
3838 * syscalls.c (seteuid32): Do not return an error when the token cannot
3839 be created only because of a problem with the gid.
3841 2002-07-01 Christopher Faylor <cgf@redhat.com>
3843 * fhandler_clipboard.c (fhandler_dev_clipboard::open): Force text mode.
3844 * fhandler_console.cc (fhandler_console::open): *Really* force binary
3845 mode rather than make it optional.
3846 * fhandler_proc.cc (fhandler_proc::open): Ditto.
3847 * fhandler_process.cc (fhandler_process::open): Ditto.
3848 * fhandler_random.cc (fhandler_dev_random::fhandler_dev_random): Ditto.
3849 * fhandler_raw.cc (fhandler_dev_raw::open): Ditto.
3850 * fhandler_registry.cc (fhandler_registry::open): Ditto.
3851 * fhandler_tty.cc (fhandler_tty_slave::open): Ditto.
3852 * fhandler_virtual.cc (fhandler_virtual::open): Ditto.
3853 * fhandler_windows.cc (fhandler_windows::open): Ditto.
3854 * fhandler_zero.cc (fhandler_dev_zero::open): Ditto.
3855 * net.cc (fdsock): Ditto.
3856 * path.cc (set_flags): Add more debugging.
3858 2002-07-01 Christopher Faylor <cgf@redhat.com>
3860 * debug.cc (threads): Avoid initialization.
3861 * uinfo.cc (cygheap_user::ontherange): (from Corinna Vinschen) Actually
3862 make below changes work.
3864 2002-07-01 Christopher Faylor <cgf@redhat.com>
3866 * uinfo.cc (cygheap_user::ontherange): Make cygwin root the last resort
3867 for HOMEPATH/HOMEDRIVE for consistency with HOME.
3869 2002-07-01 Corinna Vinschen <corinna@vinschen.de>
3871 * shared.cc (sec_none): Move to sec_helper.cc.
3872 (sec_none_nih): Ditto.
3874 (sec_all_nih): Ditto.
3875 (get_null_sd): Ditto.
3877 (__sec_user): Ditto.
3878 * sec_helper.cc (sec_none): Move from shared.cc to here.
3879 (sec_none_nih): Ditto.
3881 (sec_all_nih): Ditto.
3882 (get_null_sd): Ditto.
3884 (__sec_user): Ditto.
3886 2002-06-30 Christopher Faylor <cgf@redhat.com>
3888 * uinfo.cc (cygheap_user::ontherange): Potentially set HOME from
3889 existing homepath and homedrive cygheap_user fields (not currently used
3890 yet). Set HOME to / if no other alternative.
3891 (cygheap_user::test_uid): Simplify.
3893 2002-06-30 Christopher Faylor <cgf@redhat.com>
3895 * environ.cc (parse_options): Use setenv to potentially replace CYGWIN
3896 value on export. Fixes broken behavior since November 2000 changes.
3897 (regopt): Return indication of whether or not something has been parsed
3899 (environ_init): Only attempt to export CYGWIN variable when values were
3900 set from the registry. It is exported automatically otherwise.
3902 2002-06-30 Christopher Faylor <cgf@redhat.com>
3904 * fhandler.h (fhandler_process::pid): New field.
3905 (fhandler_process::fstat): Remove unneeded array. Set pid element.
3906 (fhandler_process::open): Ditto.
3907 (fhandler_process::fill_filebuf): Handle case where 'p' field is NULL.
3909 2002-06-30 Christopher Faylor <cgf@redhat.com>
3911 * fhandler.h (fhandler_process::p): New field.
3912 (fhandler_process:fill_filebuf): Revert to same definition as virtual
3914 (fhandler_process::open): Fill out p field rather than passing as an
3916 (fhandler_process::fill_filebuf): Use p pointer rather than argument.
3918 2002-06-29 Pierre Humblet <pierre.humblet@ieee.org>
3920 * security.cc (extract_nt_dom_user): Check for all buffer overflows.
3921 Call LookupAccountSid after trying to get domain & user from passwd.
3922 (get_group_sidlist): Obtain the domain and user by calling
3923 extract_nt_dom_user instead of LookupAccountSid.
3925 2002-06-29 Christopher Faylor <cgf@redhat.com>
3927 * uinfo.cc (cygheap_user::test_uid): Use standard issetuid test.
3929 2002-06-29 Christopher Faylor <cgf@redhat.com>
3931 * autoload.cc (NetGetDCName): Change to make this an optional load
3933 * cygheap.h (cygheap_user::logsrv): Return NULL when operation fails.
3934 (cygheap_user::winname): Ditto.
3935 (cygheap_user::domain): Ditto.
3936 * uinfo.cc (cygheap_user::env_logsrv): Save results in temp variable.
3937 (cygheap_user::env_userprofile): Ditto.
3939 2002-06-29 Christopher Faylor <cgf@redhat.com>
3941 * environ.cc (spenv::retrieve): Detect return of env_dontadd from
3942 cygheap_user methods.
3943 (build_env): Avoid incrementing environment pointer if not actually
3944 adding to the environment. That could result in garbage in the
3945 environment table. Be more defensive when reallocing envblock.
3947 2002-06-29 Christopher Faylor <cgf@redhat.com>
3949 * uinfo.cc (cygheap_user::test_uid): Return NULL or further tests are
3951 (cygheap_user::env_domain): Recalculate if name is missing.
3953 2002-06-29 Christopher Faylor <cgf@redhat.com>
3955 * environ.cc (spenv::from_cygheap): Still need to take setuid into
3958 2002-06-28 Christopher Faylor <cgf@redhat.com>
3960 * uinfo.cc (cygheap_user::env_logsrv): Return "almost_null" in case
3961 where no domain or username is "SYSTEM".
3963 2002-06-28 Christopher Faylor <cgf@redhat.com>
3965 * cygheap.h (cygheap_user): Reorg to accommodate environment caching.
3966 (cygheap_user::logsrv): New method.
3967 (cygheap_user::winname): Ditto.
3968 (cygheap_user::domain): Ditto.
3969 (cygheap_user::test_uid): Ditto.
3970 * cygheap.cc (cygheap_user::set_name): Reflect name "pwinname" name
3972 * environ.cc (getwinenveq): New function.
3973 (penv::from_cygheap): penv::from_cygheap): Change arguments.
3974 (spenv::retrieve): Ditto for call. Use getwinenveq to retrieve info
3975 from environment. Always return value from cygwin environment, if it
3977 * environ.h (getwinenveq): Declare.
3978 * uinfo.cc (cygheap_user::ontherange): Use logsrv() rather than
3980 (cygheap_user::test_uid): Define new method.
3981 (cygheap_user::env_logsrv): Accept environment arguments. Use test_uid
3983 (cygheap_user::env_domain): Ditto.
3984 (cygheap_user::env_userprofile): Ditto.
3985 (cygheap_user::env_homepath): Ditto.
3986 (cygheap_user::env_homedrive): Ditto.
3987 (cygheap_user::env_name): Ditto.
3989 2002-06-27 Christopher Faylor <cgf@redhat.com>
3991 * cygheap.cc (cfree_and_set): New function.
3992 (cygheap_user::set_name): Use cfree_and_set to reset members.
3993 * cygheap.h (cygheap_user): Delete static members.
3994 (cygheap_user::puserprof): New member.
3995 (cfree_and_set): Declare.
3996 * dcrt0.cc (almost_null): Define.
3997 * environ.cc (env_dontadd): Redefine as "almost_null".
3998 * winsup.h (almost_null): Declare.
3999 * syscalls.cc (cfree_and_set): Remove unused variable.
4000 * uinfo.cc (cygheap_user::homepath_env_buf): Eliminate.
4001 (cygheap_user::homedrive_env_buf): Ditto.
4002 (cygheap_user::userprofile_env_buf): Ditto.
4003 (cygheap_user::ontherange): YA change to try to preserve existing
4004 HOMEPATH and HOMEDRIVE. Return almost_null values when variables
4005 should not actually exist.
4006 (cygheap_user::env_logsrv): Ditto.
4007 (cygheap_user::env_domain): Ditto.
4008 (cygheap_user::env_userprofile): Ditto.
4010 2002-06-27 Corinna Vinschen <corinna@vinschen.de>
4012 * dcrt0.cc (dll_crt0_1): Let __progname point to the applications
4013 basename. Move eliminating ".exe" suffix from argv[0] so that it
4014 always also affects __progname.
4016 2002-06-27 Thomas Pfaff <tpfaff@gmx.net>
4018 * thread.cc (pthread::create): Add trace printf to get CreateThread
4021 2002-06-27 Corinna Vinschen <corinna@vinschen.de>
4023 * mmap.cc (list::match): Check using pagesize aligned size.
4025 2002-06-26 Christopher Faylor <cgf@redhat.com>
4027 * fhandler_disk_file.cc (fhandler_disk_file::fstat_by_name): Force
4028 FindFirstFile on first file of directory when asking for x:\ .
4030 2002-06-26 Christopher Faylor <cgf@redhat.com>
4032 * cygheap.cc (cygheap_user::set_name): Correct thinko in below change.
4034 2002-06-26 Christopher Faylor <cgf@redhat.com>
4036 * cygheap.cc (cygheap_user::set_name): Avoid clearing things when just
4037 setting name to itself or during first time initialization.
4039 * environ.cc (check_case_init): Make case insensitive.
4041 2002-06-26 Corinna Vinschen <corinna@vinschen.de>
4043 * fhandler.h (fhandler_socket::bind): Add method definition.
4044 (fhandler_socket::connect): Ditto.
4045 (fhandler_socket::listen): Ditto.
4046 (fhandler_socket::accept): Ditto.
4047 (fhandler_socket::getsockname): Ditto.
4048 (fhandler_socket::getpeername): Ditto.
4049 (fhandler_socket::recvfrom): Ditto.
4050 (fhandler_socket::recvmsg): Ditto.
4051 (fhandler_socket::sendto): Ditto.
4052 (fhandler_socket::sendmsg): Ditto.
4053 (fhandler_socket::shutdown): Ditto.
4054 * fhandler_socket.cc (get_inet_addr): Move here from net.cc.
4055 (fhandler_socket::bind): New method.
4056 (fhandler_socket::connect): Ditto.
4057 (fhandler_socket::listen): Ditto.
4058 (fhandler_socket::accept): Ditto.
4059 (fhandler_socket::getsockname): Ditto.
4060 (fhandler_socket::getpeername): Ditto.
4061 (fhandler_socket::recvfrom): Ditto.
4062 (fhandler_socket::recvmsg): Ditto.
4063 (fhandler_socket::sendto): Ditto.
4064 (fhandler_socket::sendmsg): Ditto.
4065 (fhandler_socket::shutdown): Ditto.
4066 * net.cc: Various formatting cleanups throughout.
4067 (get_inet_addr): Move to fhandler_socket.cc.
4068 (cygwin_bind): Move base functionality to appropriate fhandler_socket
4070 (cygwin_connect): Ditto.
4071 (cygwin_listen): Ditto.
4072 (cygwin_accept): Ditto.
4073 (cygwin_getsockname): Ditto.
4074 (cygwin_getpeername): Ditto.
4075 (cygwin_recvfrom): Ditto.
4076 (cygwin_recvmsg): Ditto.
4077 (cygwin_sendto): Ditto.
4078 (cygwin_sendmsg): Ditto.
4079 (cygwin_shutdown): Ditto.
4081 2002-06-26 Corinna Vinschen <corinna@vinschen.de>
4083 * pwdgrp.h (pwdgrp_read::~pwdgrp_read): Avoid compiler warning.
4085 2002-06-26 Christopher Faylor <cgf@redhat.com>
4087 * dcrt0.cc (_dcrt0): Be more defensive when reserved block is used and
4088 it's not cygwin info.
4090 2002-06-26 Christopher Faylor <cgf@redhat.com>
4092 * autoload (noload): Avoid clobbering bx register.
4094 * environ.cc (codepage_init): Use case insensitive match.
4096 * fhandler_console.cc (cp_get_internal): Delete.
4097 (con_to_str): Use get_cp to derive code page.
4098 (str_to_con): Ditto.
4099 * miscfuncs.cc (get_cp): New function.
4100 (sys_wcstombs): New function. Converted from macro.
4101 (sys_mbstowcs): Ditto.
4102 * winsup.h: Reflect above changes.
4104 2002-06-26 Christopher Faylor <cgf@redhat.com>
4106 * winsup.h: Minor cleanup.
4107 * path.h (path_conv::[]): New operator.
4108 * syscalls.cc (_link): Use path_conv operators rather than methods,
4109 where appropriate. Minor white space cleanup.
4111 2002-06-26 Christopher Faylor <cgf@redhat.com>
4113 * include/cygwin/version.h: Bump DLL minor number.
4115 2002-06-25 Thomas Pfaff <tpfaff@gmx.net>
4117 * include/pthread.h (PTHREAD_CANCELED): Define a reasonable value.
4118 * pthread.cc (pthread_exit): Call method instead of function.
4119 (pthread_setcancelstate): Ditto.
4120 (pthread_setcanceltype): Ditto.
4121 (pthread_testcancel): Ditto.
4122 * thread.h (pthread::cancel_event): New member.
4123 (__pthread_cancel_self): New prototype.
4124 (pthread::exit): New Method.
4125 (pthread::cancel): Ditto.
4126 (pthread::testcancel): Ditto.
4127 (pthread::cancel_self): Ditto.
4128 (pthread::static_cancel_self): Ditto.
4129 (pthread::setcancelstate): Ditto.
4130 (pthread::setcanceltype): Ditto.
4131 (__pthread_cancel): Give c++ linkage.
4132 (__pthread_exit): Remove.
4133 (__pthread_setcancelstate): Ditto.
4134 (__pthread_setcanceltype): Ditto.
4135 (__pthread_testcancel): Ditto.
4136 * thread.cc (pthread::pthread): Inititialize cancel_event.
4137 (pthread::~pthread): Close cancel_event if needed.
4138 (pthread::create): Create cancel_event.
4139 (pthread::exit): New method. Replacement for __pthread_exit.
4140 (pthread::cancel): New method.
4141 (pthread::testcancel): Ditto.
4142 (pthread::static_cancel_self); New static method.
4143 (pthread::setcancelstate): New method. Replacement for
4144 __pthread_setcancelstate.
4145 (pthread::setcanceltype): New method. Replacement for
4146 __pthread_setcanceltype.
4147 (pthread::pop_cleanup_handler): Add lock for async cancel safe
4149 (pthread::thread_init_wrapper): Change __pthread_exit to
4151 (__pthread_cancel): Call method thread->cancel().
4152 (__pthread_exit): Remove.
4153 (__pthread_setcancelstate): Ditto.
4154 (__pthread_setcanceltype): Ditto.
4155 (__pthread_testcancel): Ditto.
4157 2002-06-25 Christopher Faylor <cgf@redhat.com>
4159 * dcrt0.cc (sm): Make NO_COPY.
4161 2002-06-25 Corinna Vinschen <corinna@vinschen.de>
4163 * syscalls.cc (chown): Convert uid to 32 bit.
4167 2002-06-24 Christopher Faylor <cgf@redhat.com>
4169 * dtable.cc (dtable::find_unused_handle): Avoid coercion.
4171 2002-06-24 Christopher Faylor <cgf@redhat.com>
4173 * dtable.cc (fhandler_base::dup2): Cleanup. Ensure that lock is turned
4174 off in error condition.
4176 2002-06-24 Corinna Vinschen <corinna@vinschen.de>
4178 * uinfo.cc (internal_getlogin): Set myself->uid and myself->gid instead
4179 of user.real_uid and user.real_gid.
4180 (uinfo_init): Evaluate orig_uid and real_uid from myself->uid. Ditto
4183 2002-06-23 Pierre Humblet <pierre.humblet@ieee.org>
4185 * security.cc (get_group_sidlist): Add pw argument and use pw->pw_name
4186 in call to get_supplementary_group_sidlist.
4187 (create_token): Add pw argument and use it in call to
4189 * security.h: Add pw argument in declaration of create_token.
4190 * syscalls.cc (seteuid32): Add pw argument in call to create_token.
4192 2002-06-23 Conrad Scott <conrad.scott@dsl.pipex.com>
4194 * fhandler.cc (fhandler_base::fstat): Set S_IFIFO for pipes.
4195 * fhandler_socket.cc (fhandler_socket.cc::fstat): Set S_IFSOCK.
4197 2002-06-23 Christopher Faylor <cgf@redhat.com>
4199 * lib/_cygwin_S_IEXEC.cc: Remove obsolete file.
4201 2002-06-23 Christopher Faylor <cgf@redhat.com>
4203 Use cygwin_{shm,ipc}.h instead of /sys/{shm,ipc}.h throughout.
4204 * sys/ipc.h: Remove.
4205 * sys/shm.h: Remove.
4206 * cygwin_ipc.h: New file.
4207 * cygwin_shm.h: New file.
4209 2002-06-23 Christopher Faylor <cgf@redhat.com>
4211 * cygwin.sc: Add recent changes from ld sources.
4213 2002-06-23 Conrad Scott <conrad.scott@dsl.pipex.com>
4215 * winsup.h: Move #ifdef EXPCGF code into "winbase.h".
4216 * winbase.h: #ifdef EXPCGF code moved here from "winsup.h".
4218 2002-06-12 Thomas Pfaff <tpfaff@gmx.net>
4220 * thread.h (pthread::cleanup_stack): Rename cleanup_handlers to
4222 * thread.cc (pthread::pthread): Ditto.
4223 (pthread::create): Fix mutex verification.
4224 (pthread::push_cleanup_handler): Renam cleanup_handlers to
4225 cleanup_stack. Remvoe Mutex calls, use InterlockedExchangePointer
4227 (pthread::pop_cleanup_handler): Rename cleanup_handlers to
4229 (pthread::pop_all_cleanup_handlers): Ditto.
4230 (__pthread_once): Check state first and return if already done.
4231 (__pthread_join): Revert DEADLOCK test to __pthread_equal call.
4232 (__pthread_detach): Unlock mutex before deletion.
4234 2002-06-21 Christopher Faylor <cgf@redhat.com>
4236 * Makefile.in (cygrun.exe): Move -lgcc where it will do some good.
4238 2002-06-21 Corinna Vinschen <corinna@vinschen.de>
4240 * syscalls.cc (stat64_to_stat32): Correctly evaluate st_rdev.
4241 (fstat64): Set st_rdev to same value as st_dev.
4242 (stat_worker): Ditto.
4244 2002-06-21 Corinna Vinschen <corinna@vinschen.de>
4246 * security.cc (alloc_sd): Carefully check owner_sid again after trying
4249 2002-06-21 Corinna Vinschen <corinna@vinschen.de>
4251 * security.cc (alloc_sd): Remove unnecessary retrieval of owner name.
4252 Check uid for current user first and use SIDs from cygheap if so.
4253 Set errno to EINVAL if user SID isn't retrievable. Just print user SID
4255 Don't bail out if group SID isn't retrievable. Change debug output
4258 2002-06-21 Christopher Faylor <cgf@redhat.com>
4260 * errno.cc: Change text description for EBADF throughout.
4262 2002-06-20 Pierre Humblet <pierre.humblet@ieee.org>
4264 * uinfo.cc (cygheap_user::ontherange): Use env_name for NetUserGetInfo.
4265 (cygheap_user::env_logsrv): Verify env_domain is valid.
4266 * environ.cc: Include child_info.h and keep spenvs[] sorted.
4267 (environ_init): Check child_proc_info instead of myself->ppid_handle.
4269 2002-06-19 Christopher Faylor <cgf@redhat.com>
4271 * fhandler.cc (fhandler_base::set_flags): Change priority of "linked
4272 in" default binmode setting so that it has priority over optional
4275 2002-06-19 Christopher Faylor <cgf@redhat.com>
4277 Use hMainProc where appropriate, throughout.
4278 * environ.cc (spenv::retrieve): Add debugging statements.
4280 * pinfo.cc (set_myself): Don't call strace.hello if already stracing.
4281 * strace.cc (strace): Move NO_COPY keyword so that it will actually
4284 2002-06-19 Corinna Vinschen <corinna@vinschen.de>
4286 * uinfo.cc (cygheap_user::ontherange): Call NetUserGetInfo() only with
4287 non-NULL logserver parameter.
4289 2002-06-16 Christopher Faylor <cgf@redhat.com>
4291 * cygheap.h (cygheap_user::issetuid): New method.
4292 * dtable.cc (dtable::vfork_child_dup): Use new method to determine if
4293 we are in "setuid mode."
4294 * fork.cc (fork_parent): Ditto.
4295 * spawn.cc (spawn_guts): Ditto.
4296 * syscalls.cc (seteuid32): Ditto.
4298 * environ.cc (spenv::retrieve): (Suggested by Pierre Humblet) Do
4299 potential recalculation of cygheap_user stuff when in setuid mode.
4300 Return special value when environment variable should be calculated but
4302 (build_env): Don't add retrieved value to dstp if it is 'dont_add'.
4304 2002-06-16 Christopher Faylor <cgf@redhat.com>
4306 Changes suggested by Pierre Humblet.
4307 * environ.cc (NL): New macro.
4308 (conv_envvars): Use NL macro to fill in name and namelen.
4309 (spenv::namelen): New field.
4310 (spenvs): Use NL to fill in name and namelen.
4311 (spenv::retrieve): Eliminate length argument. Instead, use namelen
4313 (build_env): Don't calculate length of initial FOO= part of
4314 environment. Accommodate spenv::retrive argument change.
4316 2002-06-16 Christopher Faylor <cgf@redhat.com>
4318 * cygheap.h (cygheap_user::winname): New field.
4319 * cygheap.cc (cygheap_user::set_name): Clear winname when name changes.
4320 * uinfo.cc (cygheap_user::env_logsrv): Avoid calculating server when
4321 Windows user == SYSTEM.
4322 (cygheap_user::env_domain): Set winname here too.
4323 (cygheap_user::env_userprofile): Eliminate superfluous tests.
4324 (cygheap_user::env_name): Seed winname by calling env_domain().
4326 2002-06-12 Pierre Humblet <pierre.humblet@ieee.org>
4328 * spawn.cc (spawn_guts): Revert removal of ciresrv.moreinfo->uid =
4331 2002-06-15 Christopher Faylor <cgf@redhat.com>
4333 * child_info.h (child_proc_info): Declare as base class.
4334 (spawn_info): Declare as alias of child_proc_info to aid debugging.
4336 * cygheap.cc (cygheap_fixup_in_child): Use child_proc_info global
4337 rather than parameter.
4338 * cygheap.h (cygheap_fixup_in_child): Reflect above change in
4340 * dcrt0.cc (_dll_crt0): Move 'si' definition here. Assign
4342 (dll_crt0_1): Accommodate cygheap_fixup_in_child and *_info changes.
4343 * environ.cc (spenv::retrieve): Make regparm.
4344 * environ.h (environ_init): Ditto.
4345 (win_env::add_cache): Ditto.
4348 * fork.cc (sync_with_parent): Use fork_info global.
4349 (fork_child): Ditto.
4351 2002-06-14 Christopher Faylor <cgf@redhat.com>
4353 * uinfo.cc (cygheap_user::ontherange): Don't set HOMEDRIVE or HOMEPATH
4354 unless one or the other is specified.
4356 2002-06-14 Christopher Faylor <cgf@redhat.com>
4358 * cygheap.h (cygheap_user::userprofile_env_buf): New static member.
4359 * environ.cc (build_env): Add debugging statement.
4360 (spenvs): Switch functions for USERDOMAIN and USERNAME.
4361 * spawn.cc (spawn_guts): Move environment initialization prior to
4362 cygheap_setup_for_child or environment info will never be copied to
4365 2002-06-14 Christopher Faylor <cgf@redhat.com>
4367 * cygheap.h (cygheap_user): Add static members to hold home{drive,path}
4369 * uinfo.cc (cygheap_user::ontherange): Use static class members for
4370 local HOME* storage.
4372 2002-06-14 Christopher Faylor <cgf@redhat.com>
4374 * cygheap.cc (cygheap_user::set_logsrv): Remove.
4375 (cygheap_user::set_domain): Ditto.
4376 * cygheap.h (cygheap_user::set_logsrv): Remove declaration.
4377 (cygheap_user::set_domain): Ditto.
4378 (cygheap_user::env_domain): Declare new method.
4379 (cygheap_user::env_name): Ditto.
4380 * environ.cc (spenvs): Add two environment variables.
4381 * spawn.cc (spawn_guts): Call build_env after RevertToSelf. Always set
4383 (cygheap_user::ontherange): Recalculate homedrive/homepath if they are
4384 empty. Use env_logsrv to get logon server.
4385 (cygheap_user::env_logsrv): Calculate server name here rather than
4386 relying on it having been previously calculated.
4387 (cygheap_user::env_domain): Ditto for domain name.
4388 (cygheap-user::env_name): New method.
4390 2002-06-12 Pierre Humblet <pierre.humblet@ieee.org>
4392 * syscalls.cc (seteuid32): Do not get or set the environment. Do not
4393 call LookupAccountSid nor internal_getlogin. Set cygheap->user name
4394 and sid from the passwd entry.
4395 * uinfo.cc (uinfo_init): Only call internal_getlogin when starting from
4396 a non Cygwin process and use the values returned in user.
4397 (internal_getlogin): Simplify to case where starting from a non Cygwin
4398 process. Store return values in user and return void. Do not set the
4399 Windows default environment.
4400 * dcrt0.cc (dll_crt0_1): Call uinfo_init only when needed. Do not set
4401 myself->uid nor reset user.sid.
4402 * spawn.cc (spawn_guts): Get the sid from cygheap->user. Always
4403 RevertToSelf(). Don't set uid in impersonated case.
4404 * cygheap.cc (cygheap_user::set_sid): Do not set orig_sig.
4405 (cygheap_user::set_orig_sid): New.
4406 * cygheap.h: Declare cygheap_user::set_sid.
4407 * winsup.h: Add argument to uinfo_init().
4409 2002-06-14 Corinna Vinschen <corinna@vinschen.de>
4411 * environ.cc (build_env): If realloc moves envblock, move s with it.
4413 2002-06-13 Nicholas S. Wourms <nwourms@netscape.net>
4415 * winver.rc: Add more words to copyright.
4417 2002-06-13 Corinna Vinschen <corinna@vinschen.de>
4419 * cygheap.cc (cygheap_user::set_name): Revert previous change.
4420 * environ.cc (spenv::retrieve): Check return value of call to
4421 cygheap->user.*from_cygheap().
4423 2002-06-13 Corinna Vinschen <corinna@vinschen.de>
4425 * cygheap.cc (cygheap_user::set_name): Remove setting homedrive and
4427 (cygheap_user::set_logsrv): Fix free'ing of plogsrv.
4428 * cygheap.h (cygheap_user::cygheap_user): Initialize homedrive and
4431 2002-06-13 Christopher Faylor <cgf@redhat.com>
4433 * security.cc (get_logon_server): Use strcasematch rather than
4436 2002-06-12 Christopher Faylor <cgf@redhat.com>
4438 * path.cc (chdir): Minor cleanup.
4440 2002-06-12 Christopher Faylor <cgf@redhat.com>
4442 * environ.cc (build_env): Correctly fill out windows environment block
4443 with win32 paths rather than posix paths.
4445 2002-06-12 Christopher Faylor <cgf@redhat.com>
4447 * cygheap.cc (cygheap_user::set_name): Set homedrive and homepath to
4448 NULL on user name change.
4449 (cygheap_user::set_logsrv): Allocate enough space for leading \\ so
4450 that we can put this in the environment, if needed.
4451 * cygheap.h (homebodies): New enum.
4452 (cygheap_user::homedrive): New field.
4453 (cygheap_user::homepath): Ditto.
4454 (cygheap_user::env_logsrv): New method.
4455 (cygheap_user::env_homepath): New method.
4456 (cygheap_user::env_homedrive): New method.
4457 (cygheap_user::env_userprofile): New method.
4458 (cygheap_user::ontherange): New method.
4459 * environ.cc (envsize): Eliminate debugging argument.
4460 (environ_init): Assume that envc counts number of elments not total
4463 (spenvs): New array, rename from forced_winenv_vars, using spenv.
4464 (spenv::retrieve): New method.
4465 (build_env): Rename from 'winenv' -- one stop shopping for building new
4466 environment blocks for both windows and "unix".
4467 * environ.h (build_env: Declare.
4468 (winenv): Delete declaration.
4470 * spawn.cc (spawn_guts): Use build_env to build windows and cygwin
4472 * uinfo.cc (internal_getlogin): Eliminate environment manipulation.
4473 Default to info from GetUserName if it exists. Move HOMEPATH and
4474 HOMEDRIVE stuff elsewhere. Move HOME setting elsewhere. Only set HOME
4475 environment variable in processes that are not parented by a cygwin
4477 (cygheap_user::ontherange): Define new method.
4478 (cygheap_user::env_logsrv): Ditto.
4479 (cygheap_user::env_homepath): Ditto.
4480 (cygheap_user::env_homedrive): Ditto.
4481 (cygheap_user::env_userprofile): Ditto.
4483 2002-06-11 Christopher Faylor <cgf@redhat.com>
4485 * spawn.cc (spawn_guts): More hToken removal cleanup.
4487 2002-06-09 Pierre Humblet <pierre.humblet@ieee.org>
4489 * spawn.cc (spawn_guts): Define sec_attribs and call sec_user_nih()
4492 2002-06-10 Christopher Faylor <cgf@redhat.com>
4494 * Makefile.in: Ensure that -MD gets added to CFLAGS regardless of
4495 CFLAGS command-line setting.
4497 * cygwin.din: Export sexec* functions as function which returns ENOSYS
4498 (i.e., sexec* is deprecated).
4499 * dtable.cc (dtable::vfork_child_dup): Ensure that impersonation is
4500 restored even on failure.
4501 * exec.cc: Throughout, remove references to sexec* and _spawnve.
4502 * pinfo.h: Remove _spawnve declaration.
4503 * spawn.cc: Rename _spawnve to spawnve and use throughout.
4504 (spawn_guts): Eliminate hToken argument and processing of same. Just
4505 perform special actions if impersonating.
4506 (spawnve): Rename from _spawnve.
4508 2002-06-10 Christopher Faylor <cgf@redhat.com>
4510 * include/sys/strace.h (strace): Avoid use of constructor.
4512 2002-06-10 Christopher Faylor <cgf@redhat.com>
4514 * dcrt0.cc (dll_crt0_1): Initialize wincap and check for sanity before
4515 running global ctors.
4516 * wincap.h (wincap): Eliminate constructor. Default is to zero memory,
4518 * wincap.cc (wincap): Copy this on fork to avoid initialization in
4521 2002-06-10 Corinna Vinschen <corinna@vinschen.de>
4523 * fhandler.h (fhandler_socket::fixup_after_fork): Revert patch from
4525 * fhandler_socket.cc (fhandler_socket::fixup_after_fork): Ditto.
4526 (fhandler_socket::dup): Ditto.
4527 * net.cc (fdsock): Make sockets explicitely noninheritable on NT.
4529 2002-06-09 Christopher Faylor <cgf@redhat.com>
4531 * fhandler_disk_file.cc (fhandler_disk_file::fstat_helper): Correctly
4532 set number of links for directory, if appropriate.
4534 2002-06-10 Robert Collins <rbtcollins@hotmail.com>
4536 * thread.cc: Variation of a patch from Thomas Pffaf.
4537 (__pthread_detach): Cleanup thread object if the thread has terminated.
4538 (__pthread_join): Change order of error checks, and lock against
4539 join/detach/exit races.
4540 (__pthread_exit): Lock object against join/detach/exit races.
4541 (pthread::thread_init_wrapper): Ditto.
4542 (thread_init_wrapper): Rename to pthread::thread_init_wrapper.
4543 (pthread::create): Check that the mutex initialized correctly.
4544 (pthread::push_cleanup_handler): Lock against potential cancellation
4545 race. NB: this may not be required if pthread_cleanup_push is non-
4547 * thread.h (pthread::mutex): New member.
4548 (thread_init_wrapper): Rename to pthread::thread_init_wrapper.
4549 (pthread::thread_init_wrapper_: New static member.
4551 2002-06-10 Robert Collins <rbtcollins@hotmail.com>
4553 * cygwin.din: Add _pthread_cleanup_push and _pthread_cleanup_pop.
4554 * pthread.cc: Change __pthread_self to pthread::self() thruoghout.
4555 (_pthread_cleanup_push): New function.
4556 (_pthread_cleanup_pop): Ditto.
4557 * thread.cc: Thanks to Thomas Pfaff for the pthread cleanup_push,_pop
4558 patch, this work is derived from that.
4559 Change __pthread_self to pthread::self() thruoghout.
4560 (__pthread_self): Rename to pthread::self.
4561 (pthread::self): New method.
4562 (pthread::pthread): Initialize new member.
4563 (pthread::push_cleanup_handler): New method.
4564 (pthread::pop_cleanup_handler): New method.
4565 (pthread::pop_all_cleanup_handlers): New method.
4566 (__pthread_exit): Pop all cleanup handlers.
4567 * thread.h (pthread::push_cleanup_handler): Declare.
4568 (pthread::pop_cleanup_handler): Ditto.
4569 (pthread::pop_all_cleanup_handlers): Ditto.
4570 (pthread::self): New static method.
4571 (__pthread_exit): Give C++ linkage.
4572 (__pthread_join): Ditto.
4573 (__pthread_detach): Ditto.
4574 (__pthread_self): Remove.
4576 2002-04-24 Thomas Pfaff <tpfaff@gmx.net>
4578 * include/pthread.h (__pthread_cleanup_handler): New structure.
4579 (pthread_cleanup_push): Rewritten.
4580 (pthread_cleanup_pop): Ditto.
4581 (_pthread_cleanup_push): New prototype.
4582 (_pthread_cleanup_pop): Ditto.
4584 2002-04-24 Thomas Pfaff <tpfaff@gmx.net>
4586 * thread.cc (thread_init_wrapper): Check if thread is already joined.
4587 (__pthread_join): Set joiner first.
4588 (__pthread_detach): Ditto.
4590 2002-06-10 Robert Collins <rbtcollins@hotmail.com>
4592 * cygserver_transport.cc (create_server_transport): Finish the split
4593 out of sockets code from transport_layer_base. Thanks to Nicholas
4594 Wourms and Conrad Scott for catching this.
4596 2002-06-08 Christopher Faylor <cgf@redhat.com>
4598 * pinfo.cc (pinfo_dummy): Initialize to correct size.
4600 2002-06-08 Christopher Faylor <cgf@redhat.com>
4602 * path.cc: Change MOUNT_AUTO to MOUNT_CYGDRIVE throughout.
4603 * shared_info.h (CURR_MOUNT_MAGIC): Update.
4605 2002-06-08 Christopher Faylor <cgf@redhat.com>
4607 * external.cc (cygwin_internal): Make v1 mount table access invalid.
4608 * path.cc (mount_info::init): Remove had_to_create_mount_areas initialization.
4609 (mount_info::from_registry): Remove v1 table import.
4610 (mount_info::read_v1_mounts): Eliminate.
4611 (mount_info::import_v1_mounts): Ditto.
4612 * shared_info.h (mount_info): Ditto for both of above.
4613 * sys/mount.h (MOUNT_DEVFS): New enum.
4614 (MOUNT_PROC): Ditto.
4616 2002-06-08 Christopher Faylor <cgf@redhat.com>
4618 * include/wchar.h: Define __need_size_t.
4620 2002-06-07 Christopher Faylor <cgf@redhat.com>
4622 * fhandler_socket.cc (fhandler_socket::fstat): Don't assume that socket
4623 is unix-domain socket.
4625 2002-06-07 Christopher Faylor <cgf@redhat.com>
4627 * times.cc (hires_ms::prime): Set init flag.
4629 2002-06-07 Conrad Scott <conrad.scott@dsl.pipex.com>
4631 * times.cc (hires_ms::prime): Adjust epoch of initime_us from 1601 to
4634 2002-06-06 Christopher Faylor <cgf@redhat.com>
4636 * autoload.cc (timeGetDevCaps): Define new autoload function.
4637 (timeGetTime): Ditto.
4638 (timeBeginPeriod): Ditto.
4639 (timeEndPeriod): Ditto.
4640 * hires.h (hires_base): New class. Rename from hires.
4641 (hires_us): New class.
4642 (hires_ms): New class.
4643 * strace.cc (strace::microseconds): Use hires_us class.
4644 * times.cc (gettimeofday): Use hires-ms class.
4645 (hires_us::prime): Rename from hires::prime.
4646 (hires_us::usecs): Rename from hires:usecs.
4647 (hires_ms::prime): New method.
4648 (hires_ms::usecs): New method.
4649 (hires_ms::~hires_ms): New destructor.
4651 2002-06-06 Christopher Faylor <cgf@redhat.com>
4653 * autoload.cc (noload): Correctly save argument count register.
4655 2002-06-05 Conrad Scott <conrad.scott@dsl.pipex.com>
4657 * fhandler.cc (fhandler_base::fstat): Initialise tv_nsec member of
4658 st_atim, st_mtim, and st_ctim fields.
4659 * fhandler_disk_file.cc (fhandler_disk_file::fstat_helper): Ditto.
4660 * fhandler_process.cc (fhandler_process::fstat): Ditto.
4661 * glob.c (stat32_to_STAT): Copy across the whole st_atim, st_mtime, and
4663 * syscalls.cc (stat64_to_stat32): Ditto.
4664 * times.cc (to_timestruc_t): New function.
4665 (time_as_timestruc_t): New function.
4666 * winsup.h: Add to_timestruc_t and time_as_timestruc_t functions.
4667 * include/cygwin/stat.h: Replace time_t with timestruc_t throughout for
4668 all file times, removing the st_spare1, st_spare2, and st_spare3 fields
4669 in the process. Add macros to access tv_sec fields by old names.
4670 * include/cygwin/types.h: Typedef timespec_t and timestruc_t as struct
4673 2002-06-03 Pierre Humblet <pierre.humblet@ieee.org>
4675 * sec_helper.cc (lookup_name): Suppress.
4676 * security.cc (alloc_sd): Remove logsrv argument.
4677 Remove two calls to lookup_name.
4678 (set_security_attribute): Remove logsrv argument.
4679 Remove logsrv argument in call to alloc_sd.
4680 (set_nt_attribute): Remove logsrv argument.
4681 Remove logsrv argument in call to set_security_attribute.
4682 (set_file_attribute): Remove logsrv argument.
4683 Remove logsrv argument in call to set_nt_attribute.
4684 (set_file_attribute): Remove logsrv argument.
4685 Remove logsrv argument in call to set_file_attribute.
4686 * syscalls.cc (chown_worker): Remove logserver argument in
4687 call to set_file_attribute.
4689 * shm.cc (shmget): Remove logsrv argument in call to alloc_sd.
4690 * uinfo.cc (internal_getlogin): Replace calls to
4691 lookup_name by call to LookupAccountName.
4692 * security.h: Remove logsrv in declarations of set_file_attribute
4693 and alloc_sd. Remove declaration of lookup_name.
4695 2002-06-05 Christopher Faylor <cgf@redhat.com>
4697 * child_info.h (CHILD_INFO_MAGIC): Oops. Revert previous change. gcc
4700 2002-06-05 Christopher Faylor <cgf@redhat.com>
4702 * child_info.h (CHILD_INFO_MAGIC): Update.
4704 2002-06-05 Christopher Faylor <cgf@redhat.com>
4706 * strace.cc (strace::hello): Set inited, when appropriate.
4708 2002-06-05 Christopher Faylor <cgf@redhat.com>
4710 * cygwin.din: Eliminate some newlib wrappers.
4711 * path.cc (get_devn): Only consider first 99 potential com devices.
4712 (get_device_number): Ditto.
4713 * times.cc (_times): Eliminate.
4714 (_times): Rename from times().
4716 2002-06-05 Christopher Faylor <cgf@redhat.com>
4718 * dir.cc (rmdir): Streamline. Detect attempts to remove directories
4719 from "read-only" virtual devices. (Suggested by Pavel Tsekov)
4720 * syscalls.cc (unlink): Detect attempts to remove directories from
4721 "read-only" virtual devices. (From Pavel Tsekov)
4723 2002-06-05 Christopher Faylor <cgf@redhat.com>
4725 * dtable.cc (handle_to_fn): Check error return value from NtQueryObject
4726 first before seeing if name buffer is NULL.
4728 * grp.cc (read_etc_group): Fix gcc warning regarding snprintf format.
4729 * passwd.cc (read_etc_passwd): Ditto.
4731 2002-04-18 Thomas Pfaff <tpfaff@gmx.net>
4733 * thread.h (pthread::joiner): New member.
4734 * thread.cc (pthread::pthread): Initialize joiner to NULL
4735 (pthread::create): Increment of thread counter moved from
4736 __pthread_create to this location.
4737 (__pthread_create): Increment thread counter removed.
4738 (thread_init_wrapper): Set joiner to self when thread was created
4740 (__pthread_exit): delete thread when it is detached and not
4742 (__pthread_join): Check for deadlock and delete thread when it has
4744 (__pthread_detach): Set joiner to self when thread state
4745 changed to detached.
4747 2002-06-05 Corinna Vinschen <corinna@vinschen.de>
4749 * grp.cc (read_etc_group): When emulating nonexisting group file on
4750 NT systems, read primary group SID from process token. Use that info
4751 to create correct group entry. On error or on 9x systems fallback
4752 to emulating Administrators group as before.
4753 * passwd.cc (read_etc_passwd): When emulating nonexisting passwd file
4754 on NT systems, read user and primary group SID from process token.
4755 Use that info to create correct passwd entry. On error or on 9x
4756 systems fallback to emulating user with Administrator user id and
4757 Administrators group as before.
4759 2002-06-05 Corinna Vinschen <corinna@vinschen.de>
4761 * grp.cc (etc_group): Removed.
4762 (parse_grp): Make line parameter nonconst. Don't copy data into new
4763 allocated memory. Check for CR instead of LF to accomodate new
4765 (add_grp_line): Make line parameter nonconst.
4766 (read_etc_group): Rearrange using new pwdgrp_read class.
4767 * passwd.cc (parse_pwd): Don't copy data into new allocated memory.
4768 Check for CR instead of LF to accomodate new read method.
4769 (read_etc_passwd): Rearrange using new pwdgrp_read class.
4770 * pwdgrp.h (pwdgrp_check::set_last_modified): Use different
4772 (class pwdgrp_read): New class for opening and reading passwd and
4775 2002-06-04 Christopher Faylor <cgf@redhat.com>
4777 * dtable.cc (handle_to_fn): Attempt to handle "raw" accesses to remote
4779 * path.cc (mount_info::conv_to_win32_path): Set flags to binary when
4780 mount entry is not found.
4781 (mount_info::set_flags_from_win32_path): Ditto.
4783 2002-06-04 Christopher Faylor <cgf@redhat.com>
4785 * dtable.cc (handle_to_fn): Correct placement and length of name
4786 buffer. (Suggested by Pavel Tsekov)
4788 2002-06-04 Christopher Faylor <cgf@redhat.com>
4790 Remove fcntl.h includes throughout.
4791 * fhandler.h: Move fcntl.h include here.
4792 (fhandler_base::set_flags): Accept supplied_bin argument. Make
4794 * dtable.cc (dtable::init_std_file_from_handle): Just use binmode from
4796 (reset_to_open_binmode): Use set_flags.
4797 * cygwin.din (open): Avoid newlib wrapper.
4801 * fhandler.cc (fhandler_base::set_flags): Accept supplied_bin argument.
4802 Make binmode decisions here.
4803 (fhandler_base::open): Avoid using pc if it is NULL. Eliminate binmode
4804 logic. Just call set_flags with binmode argument.
4805 (fhandler_base::init): Call set_flags with binmode argument.
4806 * fhandler_clipboard.cc (fhandler_dev_clipboard::open): Ditto.
4807 * fhandler_console.cc (fhandler_console::open): Ditto.
4808 (fhandler_console::init): Force binary on open.
4809 * fhandler_disk_file.cc (fhandler_disk_file::open): Don't set binmode
4810 here. Let it happen in base class.
4811 * fhandler_dsp.cc (fhandler_dev_dsp::open): Force binmode open. Set
4812 return value appropriately if unable to open.
4813 * fhandler_proc.cc (fhandler_proc::open): Make sure flags are set
4815 * fhandler_process.cc (fhandler_process::open): Ditto.
4816 * fhandler_registry.cc (fhandler_registry::open): Ditto.
4817 * fhandler_random.cc (fhandler_dev_random::fhandler_dev_random): Ditto.
4818 * fhandler_raw.cc (fhandler_dev_raw::open): Force O_BINARY by default.
4819 * fhandler_serial.cc (fhandler_serial::init): Ditto.
4820 * fhandler_tty.cc (fhandler_tty_slave::open): Ditto.
4821 (fhandler_pty_master::open): Ditto.
4822 * fhandler_virtual.cc (fhandler_virtual::open): Ditto.
4823 * fhandler_windows.cc (fhandler_windows::open): Ditto.
4824 * fhandler_zero.cc (fhandler_dev_zero::open): Ditto.
4825 * net.cc (fdsock): Ditto.
4826 * path.cc (path_conv::check): Avoid checking for executable extension
4827 when directory. (Suggested by Pavel Tsekov)
4828 (set_flags): Set PATH_TEXT explicitly, when appropriate.
4829 (mount_info::conv_to_win32_path): Use set_flags() to set path flags.
4830 * path.h (PATH_TEXT): New enum.
4831 (path_conv::binmode): Return appropriate constant based on binmode.
4832 * pipe.cc (make_pipe): Set binmode to O_TEXT xor O_BINARY.
4833 * syscalls.cc (setmode_helper): Make debugging message a little
4835 (setmode): Set binmode via set_flags.
4837 2002-06-04 Corinna Vinschen <corinna@vinschen.de>
4839 * fhandler.h (class fhandler_socket): Add private method
4840 fixup_after_fork (bool, HANDLE).
4841 * fhandler_socket.cc (fhandler_socket::fixup_after_fork): Move
4842 functionality to new private method. Add closing parent socket
4843 if not called from dup(). Create method new calling private method
4844 with appropriate parameter.
4845 (fhandler_socket::fixup_after_exec): Call private method
4846 fixup_after_fork with appropriate parameter.
4847 (fhandler_socket::dup): Ditto.
4849 2002-06-04 Corinna Vinschen <corinna@vinschen.de>
4851 * fhandler_dsp.cc (fhandler_dev_dsp::open): Set errno to EACCES if
4852 requested mode isn't supported.
4854 2002-06-03 Christopher Faylor <cgf@redhat.com>
4856 * fhandler.cc (fhandler_base::open): Don't set binmode if already set.
4857 Don't check for file. Files should already be set. Report on binary
4859 (fhandler_base::fhandler_base): Don't set default binmode here. That's
4861 * fhandler_console.cc (fhandler_console::output_tcsetattr): Don't set
4862 binmode, ever, for console.
4863 * fhandler_disk_file.cc (fhandler_disk_file::open): Always set the
4864 binary mode to the value derived from mount table.
4865 * path.cc (mount_info::conv_to_win32_path): Default to binmode if path
4866 does not translate into anything in the mount table.
4868 2002-06-03 Corinna Vinschen <corinna@vinschen.de>
4870 * external.cc (cygwin_internal): Add CW_EXTRACT_DOMAIN_AND_USER
4871 handling to call extract_nt_dom_user() from applications.
4872 * include/sys/cygwin.h (cygwin_getinfo_types): Add
4873 CW_EXTRACT_DOMAIN_AND_USER.
4875 2002-06-03 Corinna Vinschen <corinna@vinschen.de>
4877 * syscalls.cc (stat64_to_stat32): Transform st_dev correctly.
4878 (fstat64): Add evaluating st_ino and st_dev.
4879 (stat_worker): Evaluate st_dev as 32 bit value.
4880 * include/cygwin/stat.h: Use new dev_t definition throughout.
4881 * include/cygwin/types.h: Define __dev16_t and __dev32_t. Define
4882 dev_t according to __CYGWIN_USE_BIG_TYPES__ setting.
4883 * include/sys/sysmacros.h: Define major, minor and makedev
4884 according to __CYGWIN_USE_BIG_TYPES__ setting.
4886 2002-06-03 Pierre Humblet <pierre.humblet@ieee.org>
4888 * syscalls.cc (setegid32): Verify the correctness of the gid
4889 of the group returned by getgrgid32.
4891 2002-06-03 Pierre Humblet <pierre.humblet@ieee.org>
4893 * security.cc (lsa2wchar): Suppressed.
4894 (get_lsa_srv_inf): Suppressed.
4895 (get_logon_server_and_user_domain): Suppressed.
4896 (get_logon_server): Essentially new.
4897 (get_user_groups): Add "domain" argument. Only lookup the
4898 designated server and use "domain" in LookupAccountName.
4899 (is_group_member): Simplify the arguments.
4900 (get_user_local_groups): Simplify the arguments. Do only a
4901 local lookup. Use "BUILTIN" and local domain in LookupAccountName.
4902 (get_user_primary_group). Only lookup the designated server.
4903 (get_group_sidlist): Remove logonserver argument. Do not lookup
4904 any server for the SYSTEM account.
4905 (create_token): Delete logonserver and call to get_logon_server.
4906 Adjust arguments of get_group_sidlist, see above.
4907 * security.h: Delete declaration of get_logon_server_and_user_domain
4908 and add declaration of get_logon_server.
4909 * uinfo.cc (internal_get_login): Call get_logon_server instead of
4910 get_logon_server_and_user_domain.
4912 2002-06-02 Christopher Faylor <cgf@redhat.com>
4914 * dtable.cc (handle_to_fn): Use largest match for device. Correctly
4915 (?) deal with remote drive weirdness.
4917 2002-06-02 Christopher Faylor <cgf@redhat.com>
4919 * fhandler_disk_file.cc (fhandler_disk_file::fstat_by_name): Check
4920 specifically for non-existent file, first.
4921 (fhandler_disk_file::fstat): Perform fd open on files with funny
4924 2002-06-02 Christopher January <chris@atomice.net>
4926 * fhandler_process.cc (fhandler_process::open): Set fileid.
4928 2002-06-02 Christopher Faylor <cgf@redhat.com>
4930 Remove unneeded sigproc.h includes throughout.
4931 * fhandler.h (fhandler_proc::fill_filebuf): Take a pinfo argument.
4932 * fhandler_proc.cc (fhandler_proc::get_proc_fhandler): Simplify search
4934 (fhandler_proc::readdir): Assume that pid exists if it shows up in the
4936 * fhandler_process.cc (fhandler_process::open): Simplify search for
4937 given pid. Call fill_filebuf with pinfo argument.
4938 (fhandler_process::fill_filebuf): Pass pinfo here and assume that it
4940 * pinfo.h (pinfo::remember): Define differently if sigproc.h is not
4943 2002-06-02 Christopher Faylor <cgf@redhat.com>
4945 * dll_init.cc (dll_list::detach): Don't run destructor on exit.
4947 2002-06-01 Christopher Faylor <cgf@redhat.com>
4949 * fhandler.cc (fhandler_base::fstat): Move dev and ino calculation into
4951 * syscalls.cc (stat_worker): Calculate dev and ino calculation here, if
4953 * fhandler_proc.cc (fhandler_proc::fhandler_proc): Minor reorg for
4955 * fhandler_process.cc (fhandler_process::exists): Return 0 on
4957 (fhandler_process::fstat): Simplify pid logic.
4958 * fhandler_tape.cc (fhandler_dev_tape::fstat): Minor reformatting.
4960 2002-06-01 Christopher Faylor <cgf@redhat.com>
4962 * path.cc (chdir): Don't allow cd'ing to a non-directory virtual path.
4964 2002-05-31 Christopher Faylor <cgf@redhat.com>
4966 * fhandler_disk_file.cc (readdir): Move inode calculation into caller.
4967 (fhandler_cygdrive::readdir): Add "." and "..".
4968 * dir.cc (readdir): Move inode calculation here so that fhandler
4969 readdirs can benefit.
4971 2002-05-31 Christopher Faylor <cgf@redhat.com>
4973 * fhandler_console.cc (fhandler_console::open): Reinstate setting of
4976 * dtable.cc (dtable::init_std_file_from_handle): Default to using
4977 binmode derived from path_conv, when required.
4978 * fhandler.h (fhandler_base::get_w_binary): Default to binmode if
4979 nothing else is specified.
4980 * fhandler.h (fhandler_base::get_r_binary): Ditto.
4982 * fhandler_disk_file.cc (fhandler_disk_file::fstat_by_handle): Work
4985 * path.cc (path_conv::check): Remove a debugging statement.
4987 2002-05-31 Christopher Faylor <cgf@redhat.com>
4989 * fhandler_console.cc (fhandler_console::open): Always default to
4991 (fhandler_console::write_normal): Don't honor binmode setting. There
4992 is already a termios setting for this.
4993 (fhandler_console::init): Correct argument order in init call.
4995 2002-05-31 Christopher Faylor <cgf@redhat.com>
4997 * fhandler.cc (fhandler_base::open): Make default open mode == binmode.
4998 (fhandler_base::init): Set open flags based on derived binmode argument.
5000 2002-05-31 Christopher Faylor <cgf@redhat.com>
5002 * dll_init.cc (dll_list::init): Eliminate unneeded debugging statement.
5004 2002-05-31 Christopher Faylor <cgf@redhat.com>
5006 * fhandler_proc.cc (fhandler_proc::readdir): Set errno when no more
5008 * fhandler_process.cc (fhandler_process::readdir): Ditto.
5009 * fhandler_registry.cc (fhandler_registry::readdir): Ditto.
5011 2002-05-30 Christopher Faylor <cgf@redhat.com>
5013 * path.cc (path_conv::check): Set fileattr to INVALID_FILE_ATTRIBUTES
5014 for nonexistent virtual device path.
5015 (chdir): Set correct errno when attempt is made to cd to nonexistent
5016 virtual device path.
5018 2002-05-30 Christopher Faylor <cgf@redhat.com>
5020 * fhandler_disk_file.cc (fhandler_disk_file::fstat): Always call
5021 fstat_by_name if fd is not opened to allow fstat_by_name to properly
5024 2002-05-30 Corinna Vinschen <corinna@vinschen.de>
5026 * autoload.cc: Replace autoload statments for ZwXXX by NtXXX.
5027 Drop ZwQuerySystemInformation since NtQuerySystemInformation was
5029 * fhandler_proc.cc (format_proc_uptime): Replace call to
5030 ZwQuerySystemInformation by call to NtQuerySystemInformation.
5031 (format_proc_stat): Ditto.
5032 * fhandler_process.cc (format_process_stat): Replace call to
5033 ZwQueryInformationProcess by call to NtQueryInformationProcess.
5034 (get_process_state): Ditto.
5035 (get_mem_values): Ditto. Replace call to ZwQueryVirtualMemory by
5036 call to NtQueryVirtualMemory.
5037 * ntdll.h: Cleanup. Drop ZwQuerySystemInformation since
5038 NtQuerySystemInformation was already available. Replace declarations
5039 of ZwXXX functions by declarations of NtXXX.
5040 * pinfo.cc (winpids::enumNT): Replace call to ZwQuerySystemInformation
5041 by call to NtQuerySystemInformation.
5043 2002-05-29 Christopher Faylor <cgf@redhat.com>
5045 * fhandler.cc (binmode): Default to binmode when mode is not known.
5047 2002-05-29 Christopher Faylor <cgf@redhat.com>
5049 * include/sys/cygwin.h (EXTERNAL_PINFO_VERSION): Reinstate.
5050 * external.cc (fillout_pinfo): Use it.
5052 2002-05-29 Corinna Vinschen <corinna@vinschen.de>
5054 * external.cc (fillout_pinfo): Use new version define.
5055 * include/sys/cygwin.h (external_pinfo): Define
5056 EXTERNAL_PINFO_VERSION_16_BIT and EXTERNAL_PINFO_VERSION_32_BIT
5057 instead of just EXTERNAL_PINFO_VERSION.
5059 2002-05-29 Christopher Faylor <cgf@redhat.com>
5061 * external.cc (fillout_pinfo): Set new version field in external_pinfo
5063 * include/sys/cygwin.h (external_pinfo): Replace strace_file with
5066 2002-05-29 Corinna Vinschen <corinna@vinschen.de>
5068 Change internal uid datatype from __uid16_t to __uid32_t
5070 * cygwin.din: Export new symbols getpwuid32, getpwuid_r32, getuid32,
5071 geteuid32, setuid32, seteuid32.
5072 * passwd.cc (getpwuid32): New function.
5073 (getpwuid_r32): Ditto.
5074 * syscalls.cc (seteuid32): Ditto.
5076 * uinfo.cc (getuid32): Ditto.
5078 * winsup.h (uid16touid32): New macro, correct casting from __uid16_t
5080 (gid16togid32): Ditto fir gids.
5081 (getuid32): Declare.
5083 (getpwuid32): Ditto.
5084 * include/sys/cygwin.h (struct external_pinfo): Add members uid32 and
5087 2002-05-29 Corinna Vinschen <corinna@vinschen.de>
5089 * include/cygwin/socket.h: Protect some symbols against multiple
5091 * include/netinet/ip.h: Ditto.
5092 * include/netinet/tcp.h: Ditto.
5094 2002-05-29 Wu Yongwei <adah@netstd.com>
5096 * include/netinet/ip.h: Replace by BSD derived version of the file.
5097 * include/netinet/tcp.h: Ditto.
5098 * include/netinet/udp.h: New file.
5099 * include/cygwin/ip.h: Remove.
5101 2002-05-29 Christopher Faylor <cgf@redhat.com>
5103 * dtable.cc (dtable::init_std_file_from_handle): Attempt stronger
5104 detection of invalid handle.
5105 (handle_to_fn): Detect pathological condition where NT resets the
5106 buffer pointer to NULL on an invalid handle.
5108 2002-05-28 Christopher Faylor <cgf@redhat.com>
5110 * fhandler_disk_file.cc (fhandler_disk_file::fstat_helper): Properly
5111 check for whether we should be opening the file to search for #!
5112 characters. Set path_conv structure execability, too, when
5115 2002-05-28 Corinna Vinschen <corinna@vinschen.de>
5117 * security.cc (set_security_attribute): Call getegid32() instead of
5119 * include/cygwin/grp.h: Declare getegid32().
5121 2002-05-28 Corinna Vinschen <corinna@vinschen.de>
5123 Change internal gid datatype from __gid16_t to __gid32_t
5125 * cygwin.din: Export new symbols chown32, fchown32, getegid32,
5126 getgid32, getgrgid32, getgrnam32, getgroups32, initgroups32, lchown32,
5127 setgid32, setegid32, getgrent32.
5128 * grp.cc (grp32togrp16): New static function.
5129 (getgrgid32): New function.
5130 (getgrnam32): Ditto.
5131 (getgrent32): Ditto.
5132 (getgroups32): Change name of internal function from getgroups.
5133 (getgroups32): New function.
5134 (initgroups32): Ditto.
5135 * syscalls.cc (chown32): Ditto.
5140 * uinfo.cc (getgid32): Ditto.
5142 * include/cygwin/grp.h: Remove declaration of getgrgid() and getgrnam().
5143 Declare getgrgid32() and getgrnam32() instead. Declare getgid32().
5145 2002-05-27 Christopher Faylor <cgf@redhat.com>
5147 * autoload.cc (noload): Properly mask low order word for determining
5148 number of bytes to pop.
5150 2002-05-27 Christopher Faylor <cgf@redhat.com>
5152 * fhandler_disk_file.cc (fhandler_disk_file::fstat): Minor logic
5155 2002-05-27 Christopher Faylor <cgf@redhat.com>
5157 * autoload.cc (LoadFuncEx): Define via new LoadFuncEx2 macro.
5158 (LoadFuncEx2): Adapt from LoadFuncEx. Provides control of return
5159 value for nonexistent function.
5160 (NtQueryObject): Declare.
5161 (IsDebuggerPresent): Declare via LoadFuncEx2 and always return true if
5163 * debug.h (being_debugged): Just rely on IsDebuggerPresent return
5165 * dtable.cc (handle_to_fn): New function.
5166 (dtable::init_std_file_from_handle): Attempt to derive std handle's
5167 name via handle_to_fn.
5168 (dtable::build_fhandler_from_name): Fill in what we can in path_conv
5169 structure when given a handle and path doesn't exist.
5170 * fhandler.cc (fhandler_base::open): Don't set the file pointer here.
5171 Use pc->exists () to determine if file exists rather than calling
5172 GetFileAttributes again.
5173 * fhandler.h (fhandler_base::exec_state_isknown): New method.
5174 (fhandler_base::fstat_helper): Add extra arguments to declaration.
5175 (fhandler_base::fstat_by_handle): Declare new method.
5176 (fhandler_base::fstat_by_name): Declare new method.
5177 * fhandler_disk_file (num_entries): Make __stdcall.
5178 (fhandler_base::fstat_by_handle): Define new method.
5179 (fhandler_base::fstat_by_name): Define new method.
5180 (fhandler_base:fstat): Call fstat_by_{handle,name} as appropriate.
5181 (fhandler_disk_file::fstat_helper): Accept extra arguments for filling
5182 out stat structure. Move handle or name specific stuff to new methods
5184 (fhandler_disk_file::open): Use real_path->exists rather than calling
5185 GetFileAttributes again.
5186 * ntdll.h (FILE_NAME_INFORMATION): Define new structure.
5187 (OBJECT_INFORMATION_CLASS): Partially define new enum.
5188 (OBJECT_NAME_INFORMATION): Define new structure.
5189 (NtQueryInformationFile): New declaration.
5190 (NtQueryObject): New declaration.
5191 * path.cc (path_conv::fillin): Define new method.
5192 * path.h (path_conv::fillin): Declare new method.
5193 (path_conv::drive_thpe): Rename from 'get_drive_type'.
5194 (path_conv::volser): Declare new method.
5195 (path_conv::volname): Declare new method.
5196 (path_conv::root_dir): Declare new method.
5197 * syscalls.cc (fstat64): Send real path_conv to fstat as second
5200 2002-05-24 Pierre Humblet <pierre.humblet@ieee.org>
5202 * security.cc (lsa2str): New function.
5203 (get_priv_list): Call lsa2str instead of sys_wcstombs.
5205 2002-05-22 Pierre Humblet <pierre.humblet@ieee.org>
5207 * syscalls.cc (seteuid): Do not take allow_ntsec into account.
5208 Attempt to use an existing or new token even when the uid
5209 matches orig_uid, but the gid is not in the process token.
5210 Major reorganization after several incremental changes.
5211 (setegid): Do not take allow_ntsec into account. Minor
5212 reorganization after several incremental changes.
5214 2002-05-26 Christopher Faylor <cgf@redhat.com>
5216 * debug.h (being_debugged): New macro.
5217 * dtable.cc (dtable::extend): Use new macro.
5218 * exceptions.cc (try_to_debug): Ditto.
5219 * strace.cc (strace::hello): Only output debugging info when we think
5220 we're being debugged.
5222 2002-05-25 Robert Collins <rbtcollins@hotmail.com>
5224 * winsup.h: Remove duplicate declarations of malloc_lock and
5227 2002-05-24 Christopher Faylor <cgf@redhat.com>
5229 Remove unneeded sync.h, where appropriate, throughout.
5230 Remove unneeded heap.h, where appropriate, throughout.
5231 Remove unneeded exceptions.h, where appropriate, throughout.
5232 Remove unneeded perprocess.h, where appropriate, throughout.
5234 2002-05-22 Pierre Humblet <pierre.humblet@ieee.org>
5236 * security.cc (create_token): Call __sec_user() instead of
5237 sec_user() to remove dependence on allow_ntsec. Verify that
5238 the returned sd is non-null.
5240 2002-05-25 Robert Collins <rbtcollins@hotmail.com>
5242 * gmon.c (fake_sbrk): Correctly return -1 on failed malloc's.
5244 2002-05-24 Christopher Faylor <cgf@redhat.com>
5246 * dtable.cc (dtable::build_fhandler_from_name): Just pass posix path
5247 along to set_name via return_and_clear_normalized_path.
5248 (dtable::build_fhandler): New method with const char * argument.
5249 (dtable::reset_unix_path_name): Eliminate.
5250 (dtable::dup_worker): Use correct build_fhandler method.
5251 * mmap.cc (mmap_record::alloc_fh): Ditto.
5252 * dtable.h (dtable::build_fhandler): New method.
5253 (dtable::reset_unix_path_name): Eliminate.
5254 * fhandler.cc (fhandler_base::set_name): Assume that unix_name has
5255 already been cmalloced.
5256 (fhandler_base::reset_unix_path_name): Eliminate.
5257 (fhandler_base::~fhandler_base): Coercion for cfree.
5258 * fhandler.h (fhandler_base::unix_path_name): Make const char *.
5259 (fhandler_base::win32_path_name): Ditto.
5260 (fhandler_base::reset_unix_path_name): Eliminate.
5261 * fhandler_disk_file.cc (fhandler_cygdrive::set_drives): Accommodate
5262 const char *ness of win32_path_name.
5263 * fhandler_socket.cc (fhandler_socket::fstat): Accommodate new set_name
5265 * path.cc (path_conv::return_and_clear_normalized_path): New method.
5266 (path_conv::clear_normalized_path): Eliminate.
5267 (path_conv::~path_conv): Ditto.
5268 (path_conv::check): Accommodate new build_fhandler method.
5269 * path.h (path_conv::~path_conv): Eliminate.
5270 (path_conv::clear_normalized_path): Ditto.
5271 (path_conv::return_and_clear_normalized_path): Declare new method.
5273 2002-05-23 Christopher Faylor <cgf@redhat.com>
5275 * path.cc (path_conv::check): Make sure any trailing path component is
5276 part of potential normalized posix path.
5278 2002-05-23 Christopher Faylor <cgf@redhat.com>
5280 * smallprint.c (__small_vsprintf): Implement '%o' after all these
5283 2002-05-22 Christopher Faylor <cgf@redhat.com>
5285 * fhandler.h (fhandler_virtual::exists): Eliminate path argument.
5286 (fhandler_proc::exists): Ditto.
5287 (fhandler_registry::exists): Ditto.
5288 (fhandler_process::exists): Ditto.
5289 * fhandler_proc.cc (fhandler_proc::exists): Ditto. Use built-in name.
5290 * fhandler_process.cc (fhandler_process::exists): Ditto.
5292 * fhandler_registry.cc (fhandler_registry::exists): Ditto.
5293 (fhandler_registry::fstat): Ditto.
5294 * fhandler_virtual.cc (fhandler_virtual::opendir): Ditto.
5295 * path.cc (path_conv::check): Ditto. Add debugging.
5297 2002-05-22 Christopher Faylor <cgf@redhat.com>
5299 * syscalls.cc (dup): Always call dup2 for error handling.
5301 2002-05-22 Corinna Vinschen <corinna@vinschen.de>
5303 * include/cygwin/types.h: Revert previous patch.
5305 2002-05-22 Corinna Vinschen <corinna@vinschen.de>
5307 * include/cygwin/types.h: Define pthread stuff only if _POSIX_THREADS
5310 2002-05-19 Pierre Humblet <pierre.humblet@ieee.org>
5312 * security.cc (open_local_policy): Initialize lsa to
5313 INVALID_HANDLE_VALUE instead of NULL.
5314 (get_logon_server_and_user_domain): Test for INVALID_HANDLE_VALUE
5316 (create_token): Both of the above.
5318 2002-05-18 Christopher Faylor <cgf@redhat.com>
5320 * fhandler_disk_file.cc (fhandler_disk_file::fstat): Make handling of
5321 nlink consistent for remote files.
5323 2002-05-18 Christopher Faylor <cgf@redhat.com>
5325 * path.cc (path_conv::check): Always set executable bit for executable
5328 2002-05-17 Christopher Faylor <cgf@redhat.com>
5330 * fhandler.cc (fhandler_base::lseek): Avoid calling SetFilePointer with
5331 high order part of 64 bit address on OS's which do not support that
5332 kind of operation. Otherwise Windows 95 will become confused.
5334 2002-05-16 Pierre Humblet <pierre.humblet@ieee.org>
5336 * fhandler_raw.cc (fhandler_dev_raw::open): Replace set_errno()
5337 by __seterrno_from_win_error().
5338 * security.cc (open_local_policy): Ditto.
5339 (get_lsa_srv_inf): Ditto.
5340 (get_user_groups): Ditto.
5341 (get_user_primary_group): Ditto.
5342 (create_token): Ditto.
5345 2002-05-17 Corinna Vinschen <corinna@vinschen.de>
5347 * times.cc (utimes): Use FILE_WRITE_ATTRIBUTES even on 9x/Me when
5348 opening file for writing timestamp.
5349 * wincap.cc: Remove flag has_specific_access_rights.
5352 2002-05-13 Pierre Humblet <pierre.humblet@ieee.org>
5354 * syscalls.cc (seteuid): Set default dacl in process token.
5355 Replace in-line code by call to verify_token().
5356 (setegid): Reverse change from 2002-01-21. Add call to
5357 RevertToSelf and set primary group in impersonation token.
5358 * security.cc (create_token): Store pgrpsid in token security
5359 descriptor, except if it already appears in my_grps.
5360 Use sec_acl() in place of get_dacl().
5361 (verify_token): Create from code in seteuid(), with tighter checks.
5362 (get_dacl): Deleted.
5363 (get_group_sidlist): Add argument to indicate if pgrpsid is already
5365 * security.h: Define verify_token().
5366 * autoload.cc: Load GetKernelObjectSecurity().
5368 2002-05-13 Mark Bradshaw <bradshaw@staff.crosswalk.com>
5370 * cygwin.din: Add strlcat and strlcpy.
5371 * include/cygwin/version.h: Increment API minor version number.
5373 2002-05-09 Pierre Humblet <pierre.humblet@ieee.org>
5375 * shared.cc (__sec_user): Split into sec_acl() and call orig_sid().
5376 (sec_acl): Create from part of __sec_user(), except creator/owner.
5377 * security.h: Define sec_acl() and MAX_DACL_LEN.
5379 2002-05-12 Christopher Faylor <cgf@redhat.com>
5381 * fhandler_disk_file.cc (fhandler_disk_file::open): Avoid using
5382 O_DIROPEN when OS doesn't support it. Return proper errno in that
5385 2002-05-12 Christopher Faylor <cgf@redhat.com>
5387 * syscalls.cc (_read): Change error to EBADF if attempt to read from a
5390 2002-05-11 Christopher Faylor <cgf@redhat.com>
5392 * fhandler.h (executable_states): For now, make dont_care_if_executable
5393 equivalent to not_executable.
5394 * sys/mount.h: Define MOUNT_NOTEXEC.
5395 * path.h (fs_info): New class.
5396 (path_conv): Move fs-specific fields to new 'fs' structure.
5397 (path_conv::update_fs_info): Move to fs_info and rename to just 'update'.
5398 * path.cc (fs_info::update): Ditto. Return 'true' if successful.
5399 (fillout_mntent): Add ',noexec' to list of reported options.
5401 2002-05-11 Christopher Faylor <cgf@redhat.com>
5403 * fhandler_virtual.cc (fhandler_virtual::close): Quiet a compiler
5406 2002-05-10 Christopher January <chris@atomice.net>
5408 * autoload.cc: Add dynamic load statements for
5409 'ZwQueryInformationProcess' and 'ZwQueryVirtualMemory'.
5410 * fhandler.h: Change type of bufalloc and filesize members of
5411 fhandler_virtual from int to size_t. Change type of position member
5412 from __off32_t to __off64_t. Add new fileid member to fhandler_virtual
5413 class. Make seekdir take an __off64_t argument. Make lseek take an
5414 __off64_t argument. Add fill_filebuf method to fhandler_virtual. Add
5415 fill_filebuf method to fhandler_proc. Add fill_filebuf method to
5416 fhandler_registry. Add fill_filebuf method to fhandler_process. Add
5417 saved_pid and saved_p members to fhandler_process.
5418 * fhandler_proc.cc (proc_listing_array): Add 'loadavg', 'meminfo', and 'stat'.
5419 (proc_fhandlers array): Ditto.
5420 (fhandler_proc::open): Use fill_filebuf to flesh out the file contents.
5421 (fhandler_proc::fill_filebuf): New method.
5422 (fhandler_proc::format_proc_meminfo): Ditto.
5423 (fhandler_proc::format_proc_stat): Ditto.
5424 (fhandler_proc::format_proc_uptime): Ditto.
5425 * fhandler_process.cc (process_listing): Add 'stat' and 'statm'.
5426 (fhandler_process::fstat): Find the _pinfo structure for the process
5427 named in the filename. Return ENOENT if the process is no longer
5428 around. Set the gid and uid fields of the stat structure.
5429 (fhandler_process::open): Store pid and pointer to _pinfo structure in
5430 saved_pid and saved_p respectively. Use fill_filebuf to flesh out file
5432 (fhandler_proc::fill_filebuf): New method.
5433 (format_process_stat): New function.
5434 (format_process_status): Ditto.
5435 (format_process_statm): Ditto.
5436 (get_process_state): Ditto.
5437 (get_mem_values): Ditto.
5438 * fhandler_registry.cc (fhandler_registry::seekdir): Change argument
5439 type from __off32_t to __off64_t.
5440 (fhandler_registry::fill_filebuf): New method.
5441 * fhandler_virtual.cc (fhandler_virtual::seekdir): Change argument type
5442 from __off32_t to __off64_t.
5443 (fhandler_virtual::lseek): Ditto.
5444 (fhandler_virtual::fill_filebuf): New method.
5445 (fhandler_virtual::fhandler_virtual): Initialise fileid to -1.
5446 * wincap.cc: Set flag has_process_io_counters appropriately.
5447 * wincap.h: Add flag has_process_io_counters.
5449 2002-05-09 Christopher Faylor <cgf@redhat.com>
5451 * syscalls.cc (_write): Change error to EBADF if attempt to write to a
5454 2002-05-08 Corinna Vinschen <corinna@vinschen.de>
5456 * cygheap.h (class cygheap_user): Add member `orig_psid'.
5457 Add method `orig_sid()'.
5458 * cygheap.cc (cygheap_user::set_sid): Maintain orig_psid.
5460 2002-04-28 Norbert Schulze <norbert.schulze@web.de>
5462 * localtime.cc (tzsetwall): Use wildabbr if generated timezone name
5465 2002-05-05 Pierre Humblet <pierre.humblet@ieee.org>
5467 * spawn.cc (spawn_guts): Move call to set_process_privilege()
5468 to load_registry_hive().
5469 * registry.cc (load_registry_hive): ditto.
5470 * fork.cc (fork_parent): Call sec_user_nih() only once.
5472 2002-05-04 Christopher January <chris@atomice.net>
5474 * path.h (path_conv::path_conv): Initialise normalized_path to NULL.
5476 2002-05-03 Christopher Faylor <cgf@redhat.com>
5478 * net.cc (getdomainname): Change second argument of getdomainname to
5481 2002-05-03 Christopher January <chris@atomice.net>
5483 * fhandler_proc.cc (proc_listing): Add '.' and '..' to directory
5485 (fhandler_proc::open): Change use of mode to flags. If the file does
5486 not exist already, fail with EROFS if O_CREAT flag is set. Change
5487 EROFS error to EACCES error when writing to a file. Use cmalloc to
5488 allocate memory for filebuf.
5489 (fhandler_proc::close): Use cfree to free filebuf.
5490 (fhandler_proc::get_proc_fhandler): Properly detect attempts to access
5492 * fhandler_process.cc (process_listing): Add '.' and '..' to directory
5494 (fhandler_process::open): Use cmalloc to allocate memory for filebuf.
5495 (fhandler_process::close): Use cfree to free filebuf.
5496 * fhandler_registry.cc (registry_listing): Add . and '..' to directory
5498 (fhandler_registry::open): Move check for open for writing before
5499 open_key. Use cmalloc to allocate memory for filebuf.
5500 (fhandler_registry::close): Use cfree to free filebuf.
5501 (fhandler_registry::telldir): Use lower 16 bits of __d_position as
5502 position in directory.
5503 (fhandler_registry::seekdir): Ditto.
5504 * fhandler_virtual.cc (fhandler_virtual::write): Change EROFS error to
5506 (fhandler_virtual::open): Set the NOHANDLE flag.
5507 (fhandler_virtual::dup): Add call to fhandler_base::dup. Allocate
5508 child's filebuf using cmalloc. Copy filebuf from parent to child.
5509 (fhandler_virtual::close): Use cfree to free filebuf.
5510 (fhandler_virtual::~fhandler_virtual): Ditto.
5511 (from Chris Faylor <cgf@redhat.com>).
5512 (fhandler_registry::readdir): Add support for '.' and '..' files in
5513 subdirectories of /proc/registry.
5514 * path.cc (path_conv::check): Do not return ENOENT if a file is not
5517 2002-05-02 Christopher Faylor <cgf@redhat.com>
5519 * fhandler_proc.cc (fhandler_proc::fstat): Use fhandler name rather
5520 than path_conv name.
5521 (fhandler_proc::open): Ditto.
5522 * fhandler_process.cc (fhandler_process::fstat): Use fhandler name
5523 rather than path_conv name.
5524 (fhandler_process::open): Ditto.
5525 * fhandler_registry.cc (fhandler_registry::fstat): Use fhandler name
5526 rather than path_conv name.
5527 (fhandler_registry::open): Ditto.
5528 * path.cc (path_conv::check): Don't copy posix path when virtual.
5529 (mount_info::conv_to_win32_path): Don't zero string when isproc. Just
5530 derive normal windows path.
5532 * path.h (path_conv::clear_normalized_path): Declare new method.
5533 * path.cc (path_conv::clear_normalized_path): Define new method.
5534 * dtable.cc (build_fhandler_from_name): Clear normalized path when
5535 finished to conserve space.
5537 2002-05-02 Christopher Faylor <cgf@redhat.com>
5539 * fhandler_proc.cc (fhandler_proc::fstat): Prime with information from
5540 fhandler_base::fstat. Use defines rather than constants for permission
5543 2002-04-30 Eric Blake <ebb9@email.byu.edu>
5545 * path.cc (hash_path_name): Improve hash function strength.
5547 2002-05-02 Robert Collins <rbtcollins@hotmail.com>
5549 * thread.cc (__pthread_cond_dowait): Fix a race on signalling from a
5550 thread woken by the same condition variable it's signalling on. Thanks
5551 to Michael Beach for the report and test case.
5553 2002-05-02 Christopher Faylor <cgf@redhat.com>
5555 * path.h (pathconv_arg): Add PC_POSIX.
5556 (path_conv): Add normalized_path field.
5557 * path.cc (path_conv::~path_conv): New destructor.
5558 (path_conv::check): Set normalized_path, where appropriate.
5559 * dtable.cc (build_fhandler_from_name): Use normalized path from
5561 * syscalls.cc (chroot): Ditto.
5563 * cygheap.h: Remove path_prefix_p declaration.
5565 2002-02-26 Christopher January <chris@atomice.net>
5566 Christopher Faylor <cgf@redhat.com> (minor fixups)
5568 * Makefile.in: Add fhandler_proc.o, fhandler_registry.o,
5569 fhandler_process.o and fhandler_virtual.o.
5570 * dtable.cc (dtable::build_fhandler): Add entries for FH_PROC,
5571 FH_REGISTRY and FH_PROCESS. Set unix_name to the normalized posix
5573 * fhandler.h: Add constants for FH_PROC, FH_REGISTRY and FH_PROCESS.
5574 Add class declarations for fhandler_virtual, fhandler_proc,
5575 fhandler_registry and fhandler_virtual. Update fhandler_union
5577 * fhandler_proc.cc: New file. Add implementation for fhandler_proc.
5578 * fhandler_virtual.cc: New file. Add implementation for
5580 * fhandler_process.cc: New file. Add implementation for
5582 * fhandler_registry.cc: New file. Add implementation for
5584 * path.cc (isproc): New macro.
5585 (isvirtual_dev): Ditto.
5586 * path.cc (path_conv::check): Add check for virtual devices.
5587 * path.cc (mount_info::conv_to_win32_path): Convert paths in /proc to
5589 * path.cc (chdir): Replace check for FH_CYGDRIVE with more generic
5590 isvirtual_dev macro. Force setting of posix path for virtual
5592 * path.h (path_prefix_p): Declare.
5595 Wed May 1 16:06:02 2002 Jason Tishler <jason@tishler.net>
5597 * include/cygwin/types.h: Include <sys/sysmacros.h>.
5599 Wed Apr 17 11:27:04 2002 Jason Tishler <jason@tishler.net>
5601 * security.cc (get_lsa_srv_inf): Prevent extraneous backslashes for
5604 2002-04-12 Corinna Vinschen <corinna@vinschen.de>
5606 * net.cc (cygwin_accept): Set socket type for accepted socket.
5607 (socketpair): Set socket type for both sockets.
5609 2002-04-12 Egor Duda <deo@logos-m.ru>
5611 * fhandler.h (class fhandler_socket): New member to store socket type.
5612 (fhandler_socket::get_socket_type): Access it.
5613 (fhandler_socket::set_socket_type): Ditto.
5614 * net.cc (cygwin_socket): Store socket type.
5615 (cygwin_connect): Disable security checks for connectionless sockets.
5616 (cygwin_accept): Ditto.
5618 2002-04-09 Mark Bradshaw <bradshaw@staff.crosswalk.com>
5620 * cygwin.din: Add strptime.
5621 * include/cygwin/version.h: Increment API version number.
5623 2002-04-09 Corinna Vinschen <corinna@vinschen.de>
5625 * fork.cc (fork_child): Call fixup_mmaps_after_fork() somewhat earlier.
5627 2002-04-09 Corinna Vinschen <corinna@vinschen.de>
5629 * fhandler.cc (fhandler_base::open): Set read-only bit in
5630 file_attributes when adequate.
5632 2002-03-28 Christopher Faylor <cgf@redhat.com>
5634 * times.cc (gettimeofday): Fix typo in previous patch.
5636 2002-03-27 Wu Yongwei <adah@netstd.com>
5638 * times.cc (gettimeofday): Revert to setting timezone info if tz !=
5641 2002-03-21 Christopher Faylor <cgf@redhat.com>
5643 * fhandler_disk_file.cc (fhandler_disk_file::fstat_helper): Always set
5644 st_[ug]id to value derived from get_file_attributes.
5646 2002-03-21 Christopher Faylor <cgf@redhat.com>
5648 * spawn.cc (find_exec): Return input if file not found.
5650 2002-03-19 Boris Schaeling <boriss@web.de>
5652 * poll.cc (poll): Add support for invalid descriptors.
5654 2002-03-15 Robert Collins <rbtcollins@hotmail.com>
5656 * fhandler.h (fhandler_termios::lseek): Override lseek.
5657 * fhandler_termios.cc (fhandler_termios::lseek): Implement this.
5659 2002-03-15 Christopher Faylor <cgf@redhat.com>
5661 * cygserver.cc: Include stdlib.h for exit declaration.
5662 * threaded_queue.cc: Ditto.
5664 2002-03-15 Christopher Faylor <cgf@redhat.com>
5666 * pinfo.cc (pinfo::init): Use PID_ALLPIDS flag to control when a
5667 redirected block should be marked as nonexistent.
5668 (winpids::add): Use PID_ALLPIDS when looking for all pids.
5669 * cygwin.h (PID_ALLPIDS): New enum element.
5671 2002-03-15 Corinna Vinschen <corinna@vinschen.de>
5673 * glob.c (stat32_to_STAT): New function.
5674 (g_lstat): Call user space functions always with 32 bit struct stat
5677 * include/glob.h (struct glob): Don't prototype function pointers
5678 when compiling Cygwin.
5680 2002-03-14 Christopher Faylor <cgf@redhat.com>
5682 * pinfo.cc (pinfo::init): Properly handle execed process stub when
5683 PID_NOREDIR is specified.
5685 2002-03-13 Boris Schaeling <boriss@web.de>
5687 * poll.cc (poll): Remove variable open_fds. Rearrange and add code to
5688 fix settings of revents.
5690 2002-03-13 Corinna Vinschen <corinna@vinschen.de>
5692 * mmap.cc (mmap_record::map_map): Return -1 if VirtualProtect fails.
5693 (list::erase): New method with no argument. Erase latest record
5695 (mmap64): Fail if map_map() fails.
5697 2002-03-12 Corinna Vinschen <corinna@vinschen.de>
5699 * sysconf.cc (sysconf): Fix condition.
5701 2002-03-11 Corinna Vinschen <corinna@vinschen.de>
5703 * mmap.cc (msync): Check area given by addr and len for being a
5704 contigeous mmap'd region.
5706 2002-03-11 Corinna Vinschen <corinna@vinschen.de>
5708 * fork.cc (fork_child): Call fixup_mmaps_after_fork() before
5709 closing parent process handle. Call fixup_mmaps_after_fork()
5710 with parent process handle as parameter.
5711 * mmap.cc (mmap_record::access): New method.
5712 (fixup_mmaps_after_fork): Take process handle as parameter.
5713 In case of FILE_MAP_COPY access, copy valid memory regions to child.
5714 * pinfo.h (fixup_mmaps_after_fork): Change prototype accordingly.
5716 2002-03-07 Corinna Vinschen <corinna@vinschen.de>
5718 * autoload.cc (NetGetDCName): Add symbol.
5719 (NetServerEnum): Remove symbol.
5720 * security.cc (get_lsa_srv_inf): Call NetGetDCName() instead of
5721 NetServerEnum() since it's faster. Don't call it at all if machine
5722 is not a domain member.
5724 2002-03-06 Christopher Faylor <cgf@redhat.com>
5726 * path.cc (normalize_posix_path): Avoid runs of '.'s > 2.
5728 2002-03-05 Christopher Faylor <cgf@redhat.com>
5730 * errno.cc: Change EPERM associated text to "Operation not permitted"
5733 2002-03-05 Christopher Faylor <cgf@redhat.com>
5735 * fhandler_socket.cc (fhandler_socket::close): Respond to signals while
5736 looping, waiting for socket to close. Superstitiously clear last error
5737 when WSAEWOULDBLOCK.
5739 2002-03-05 Robert Collins <rbtcollins@hotmail.com>
5741 * cygserver_transport_pipes.cc (transport_layer_pipes::transport_layer_pipes):
5742 Always init - until static members work correctly.
5743 * shm.cc (shmget): Initialize the security descriptor - thanks Corinna!
5744 * include/sys/ipc.h: Make the ipc control constants partitioned off from the sem
5747 2002-03-04 Christian Lestrade <christian.lestrade@free.fr>
5749 * include/sys/termios.h: Define _POSIX_VDISABLE. Define CCEQ macro.
5750 * fhandler_termios.cc: Include <sys/termios.h>.
5751 (line_edit): Recognize disabled c_cc[] chars. Ignore VDISCARD when
5754 2002-03-04 Dmitry Timoshkov <dmitry@baikal.ru>
5756 * syscalls.cc (truncate64): Use ftruncate64 directly to not lose
5759 2002-03-04 Robert Collins <rbtcollins@hotmail.com>
5761 * cygserver_shm.cc (delete_shmnode): New function.
5762 (client_request_shm::serve): Use it.
5764 2002-03-04 Robert Collins <rbtcollins@hotmail.com>
5766 * cygserver_shm.cc (client_request_shm::serve): Implement SHM_DETACH.
5767 * shm.cc (shmdt): Implement.
5769 2002-03-04 Robert Collins <rbtcollins@hotmail.com>
5771 * cygserver_shm.cc: Run indent.
5772 (deleted_head): New global for storing shm id's pending deletion.
5773 (client_request_shm::serve): Return ENOSYS for invalid request types.
5774 Implement SHM_DEL - delete a shm id.
5775 * cygserver_shm.h (SHM_DEL): New type value.
5776 * shm.cc (delete_inprocess_shmds): New function, does what it's name implies.
5777 (shmctl): Implement shm_rmid control type.
5779 2002-03-04 Robert Collins <rbtcollins@hotmail.com>
5781 * Makefile.in (install): Remove install-bin to allow make install to work.
5783 2002-03-03 Robert Collins <rbtcollins@hotmail.com>
5785 * shm.cc (shmat): Prevent a compile error.
5786 (shmdt): Set errno as this function is incomplete.
5788 2002-02-28 Christopher Faylor <cgf@redhat.com>
5790 * times.cc: Remove if 0'd code. Clean up slightly.
5792 2002-02-28 Robert Collins <rbtcollins@hotmail.com>
5794 * Merge cygwin_daemon into head minus the new shm and ipc exports.
5796 2002-02-28 Robert Collins <rbtcollins@hotmail.com>
5798 * fhandler_tty.cc (fhandler_tty_slave::open): More debugging.
5799 (fhandler_tty_slave::read): Fix printf type for the handle.
5800 * tty.cc (tty::common_init): Add a FIXME for security.
5802 2002-01-29 Robert Collins <rbtcollins@hotmail.com>
5804 * Makefile.in (OBJS): Remove duplicate localtime.o.
5806 2002-01-17 Robert Collins <rbtcollins@hotmail.com>
5808 * cygserver.cc (check_and_dup_handle): Consolidate the two variants for
5810 Add Some basic debug output.
5811 (client_request_attach_tty::serve): Use the new debug_printf for clarity.
5812 Mark the duplicated handles as inheritable - fixup_after_fork() doesn't reopen
5815 2002-01-16 Robert Collins <rbtcollins@hotmail.com>
5817 * cygserver.cc (transport): Correct scope.
5818 (client_request_attach_tty::serve): Add more debug information.
5819 Fix erroneous use of transport instead of conn.
5820 * cygserver_transport_pipes.cc (transport_layer_pipes::close): More debug.
5821 (transport_layer_pipes::read): Ditto.
5822 (transport_layer_pipes::write): Ditto.
5823 (transport_layer_pipes::impersonate_client): Ditto.
5825 Mon Oct 8 7:41:00 2001 Robert Collins <rbtcollins@hotmail.com>
5827 * cygserver.cc (server_request::process): Rename client_request_shm_get to
5829 * cygserver_process.cc (process_cache::add): Rename to add_task.
5830 Use process_cleanup instead of process_request.
5831 (process_cache::remove_process): New method.
5832 (process::process): Initialize new members.
5833 (process::~process): New member.
5834 (process::cleanup): New method.
5835 (process::add_cleanup_routine): New method.
5836 (process_request::process): Rename to process_cleanup.
5837 Call the process object's cleanup method and then delete it.
5838 (process_process_param::request_loop): Remove the signalling process.
5839 * cygserver_shm.cc: Globally rename client_request_shm_get to client_request_shm.
5840 (client_request_shm_get::serve): Handle attach request counting.
5841 * cygserver_shm.h: Globally rename client_request_shm_get to client_request_shm.
5842 (class shm_cleanup): New class.
5843 * shm.cc: Globally rename client_request_shm_get to client_request_shm.
5844 (client_request_shm::client_request_shm): New constructor for attach requests.
5846 * include/cygwin/cygserver_process.h (class process_request): Rename to
5848 (class cleanup_routine): New class.
5849 (class process): New members and methods to allow calling back when the process
5852 Thu Oct 4 14:12:00 2001 Robert Collins <rbtcollins@hotmail.com>
5853 * cygserver.cc (request_loop): Make static.
5854 (main): Use new cache constructor syntax.
5855 Start cache worker threads.
5856 Cleanup the cache at shutdown.
5857 * cygserver_process.cc: Run indent.
5858 (process_cache::process_cache): Add a trigger to use when adding a process.
5859 (process_cache::process): Move process_entry to process.
5860 Insert at the end of the list.
5861 Trigger the request loop when new process's inserted.
5862 (process_cache::process_requests): Do it.
5863 (process_cache::add): New method.
5864 (process_cache::handle_snapshot): New method.
5865 (process::process): Merge in the process_entry fields.
5866 (process::handle): Make a stub function.
5867 (process::exit_code): New method.
5868 (process_request::process): New method.
5869 (process_process_param::request_loop): New method.
5870 * cygserver_shm.cc: New header dependency - threaded_queue.h.
5871 * threaded_queue.cc (threaded_queue::cleanup): Clearer messages.
5872 (queue_process_param::stop): Short spinlock on interruptible threads.
5873 * threaded_queue.h (class threaded_queue): New constructor.
5874 * include/cygwin/cygserver_process.h (process_request): New class.
5875 (process_entry): Remove.
5876 (process): Merge in process_entry.
5877 (process_cache): Inherit from threaded_queue.
5879 Tue Oct 2 23:24:00 2001 Robert Collins <rbtcollins@hotmail.com>
5881 * cygserver.cc (class server_process_param): Use new constructor syntax.
5882 * cygserver_process.cc (process_cache::~process_cache): New function.
5883 * threaded_queue.cc: Define condition debug_printf.
5885 (threaded_queue::cleanup): Move queue_process_param guts to a method.
5886 (threaded_queue::process_requests): Ditto.
5887 (queue_process_param::queue_process_param): New method.
5888 (queue_process_param::~queue_process_param): Ditto.
5889 (queue_process_param::start): Ditto.
5890 (queue_process_param::stop): Ditto.
5891 * threaded_queue.h (class queue_process_param): Add support for
5892 interruptible request loops.
5893 * cygwin/include/cygwin/cygserver_process.h (class process_cache): Add
5896 Tue Oct 2 23:24:00 2001 Robert Collins <rbtcollins@hotmail.com>
5898 * cygserver_client.cc: New flag allow_daemon to disable the daemon completely.
5899 (cygserver_request): Check it.
5900 (cygserver_init): Ditto.
5901 * environ.cc (parse_thing): Add (no)daemon option.
5903 Tue Oct 2 23:00:00 2001 Robert Collins <rbtcollins@hotmail.com>
5905 * shm.cc: Update to handle include changes from HEAD.
5907 Tue Oct 2 16:06:00 2001 Robert Collins <rbtcollins@hotmail.com>
5909 * Makefile.in: Remove cygserver_shm.o from cygwin1.dll.
5910 Rename cygserver_shm_outside.o to cygserver_shm.o.
5911 * cygserver.cc (server_request::process): Use the new client_request
5913 * cygserver_client.cc: Remove the #ifdef's stubs for the server method
5915 (client_request_attach_tty::client_request_attach_tty): Use the new
5916 client_request constructor.
5917 (client_request_shutdown::client_request_shutdown): Ditto.
5918 (client_request::client_request): Ditto.
5919 * cygserver_shm.cc (client_request_shm_get::serve): Remove the
5920 #ifdef'd stub for in-cygwin builds.
5921 (client_request_shm_get::client_request_shm_get): Use the new
5922 client_request constructor, and remove the in-cygwin variants.
5923 * cygserver_shm.h (class client_request_shm_get): #ifndef test the
5924 serve method - it's only used in cygserver.
5925 * shm.cc (client_request_shm_get::client_request_shm_get): New function.
5926 * include/cygwin/cygserver.h (request_header): New constructor.
5927 (class client_request): Use it.
5928 New constructor accepting the header size.
5929 #ifndef test the server method - it's only used within cygserver.
5930 (client_request_get_version): #ifdef test the server method.
5931 (client_request_shutdown): Ditto.
5932 (client_request_attach_tty): Ditto.
5934 Tue Oct 2 9:57:00 2001 Robert Collins <rbtcollins@hotmail.com>
5936 * Makefile.in: add threaded_queue.o to cygserver.exe.
5937 * cygserver.cc: Include threaded_queue.h
5938 (class server_request): Inherit from queue_request.
5939 (class server_process_param): Inherit from queue_process_param.
5940 (class server_request_queue): Inherit from threaded_queue.
5941 (request_loop): Adjust for new types.
5942 (server_request_queue::process_requests): Remove guts to
5943 threaded_queue::process_requests.
5944 (server_request::server_request): Adjust for new types.
5945 (worker_function): Delete.
5946 (server_request_queue::create_workers): Delete.
5947 (server_request_queue::cleanup): Delete.
5948 (server_request_queue::add): Move guts to threaded_queue::add.
5949 * threaded_queue.cc: New file.
5950 * threaded_queue.h: New file.
5952 Mon Oct 1 12:38:00 2001 Robert Collins <rbtcollins@hotmail.com>
5954 * cygserver.cc (client_request::serve): New function.
5955 * cygserver_process.cc: Inlude <pthread.h> for pthread_once.
5956 (process_cache::process_cache): Initialise a crtiical section for write access.
5957 (process_cache::process): Use the critical section. Also add missing entries to
5959 (do_process_init): New function to initalise class process static variables.
5960 (process::process): Ensure that the process access critical section is
5962 (process::handle): Close the handle of old process's when they have terminated
5963 and we are returning the handle for a process with the same pid.
5964 * cygserver_shm.cc: Run indent.
5965 Include cygserver_process.h to allow process cache functionality.
5966 (client_request_shm_get::serve): New parameter for process cache support.
5967 Use the process cache, not OpenProcess to get a handle to the originating process.
5968 Fix a handle leak with token_handle.
5969 * cygserver_shm.h (class client_request_shm_get): Update ::serve for process
5971 * cygserver_transport_pipes.cc: Redefine debug_printf to be conditional on DEBUG.
5972 * include/cygwin/cygserver.h: Do not implement client_request::serve in the
5974 * include/cygwin/cygserver_process.h (class process_cache): Add a write access
5975 critical section to prevent races when requests from a multithreaded
5978 Sun Sep 30 23:41:00 2001 Robert Collins <rbtcollins@hotmail.com>
5980 * Makefile.in: Add cygserver_process.o to cygserver.exe.
5981 * cygserver.cc: Include signal.h and cygwin_version.h.
5982 Define debug_printf as a macro.
5983 Define DEBUG to a value.
5984 (client_request_attach_tty::serve): Add beginning of process cache support.
5985 Change from #ifdef DEBUG to work with new DEBUG style.
5986 (client_request_get_version::serve): Add beginning of process cache support.
5987 (class server_request): New prototype for support of process cache.
5988 (class queue_process_param): New class to allow request loop threading.
5989 (class server_request_queue): Add beginning of process cache support.
5990 Allow request loop threading.
5991 (request_loop): Thread function for request loops.
5992 (server_request_queue::process_requests): Initiator for threaded request loops.
5993 (client_request_shutdown::serve): Add beginning of process cache support.
5994 (server_request::server_request): Ditto.
5995 (server_request::process): Use debug_printf. Add beginning of process cache
5997 (server_request_queue::cleanup): Kill off any request loop threads.
5998 (server_request_queue::add): Add beginning of process cache support.
5999 (handle_signal): Trigger a shutdown.
6000 (main): Print out some useful info at startup - version, date time.
6001 Add process cache support.
6002 Spawn a separate thread for the transport request loop, thus allowing concurrent
6003 support for multiple transports.
6004 * cygserver_client.cc (client_request_get_version::serve): Add process cache
6006 (client_request_attach_tty::serve): Add process cache support.
6007 (client_request_shutdown::serve): Add process cache support.
6008 * cygsserver_process.cc: New file with the process cache support.
6009 * cygserver_shm.cc: Redefine debug_printf to allow conditional output.
6010 * cygwin.din: Export shmdt().
6011 * shm.cc: Run indent.
6013 (shmdt): New function.
6014 * include/cygwin/cygserver.h (class client_request): Add process cache support.
6015 (class client_request_get_version): Ditto.
6016 (class client_request_shutdown): Ditto.
6017 (class client_request_attach_tty): Ditto.
6018 * include/cygwin/cygserver_process.h: New header for process cache support.
6020 Sun Sep 30 8:52:00 2001 Robert Collins <rbtcollins@hotmail.com>
6022 * include/cygwin/cygserver_transport.h: Add copyright header.
6023 * include/cygwin/cygserver_transport_pipes.h: Ditto.
6024 * include/cygwin/cygserver_transport_sockets.h: Ditto.
6026 Sat Sep 29 20:40:00 2001 Robert Collins <rbtcollins@hotmail.com>
6028 * Makefile.in: Add cygserver_transport_sockets.o to DLL_OFILES.
6029 Add cygserver_transport_sockets_outside.o to cygserver.exe.
6030 * cygserver.cc: Include new include files.
6031 * cygserver_client.cc: Ditto.
6032 * cygserver_shm.h: No need to include <sys/socket.h> now.
6033 * cygerver_transport.cc: Include new include files.
6034 (transport_layer_base::transport_layer_base): Strip back to a stub.
6035 (transport_layer_base::listen): Ditto.
6036 (transport_layer_base::accept): Ditto.
6037 (transport_layer_base::close): Ditto.
6038 (transport_layer_base::read): Ditto.
6039 (transport_layer_base::write): Ditto.
6040 (transport_layer_base::connect): Ditto.
6041 * cygserver_transport_pipes.cc: Include new header
6042 "cygwin/cygserver_transport_pipes.h".
6043 * cygserver_transport_sockets.cc: New file.
6044 * dcrt0.cc: No need to include <sys/socket.h> now.
6045 * fhandler_tty.cc: Ditto.
6047 * include/cygwin/cygserver_transport.h: Strip the base class to a stub.
6048 Remove the cygserver_transport_pipes class.
6049 * include/cygwin/cygserver_transport_pipes.h: New file.
6050 * include/cygwin/cygserver_transport_sockets.h: New file.
6052 Tue Sep 25 16:22:00 2001 Robert Collins <rbtcollins@hotmail.com>
6054 * autoload.cc: Add dynamic load statement for 'ImpersonateNamedPipeClient'.
6055 * Makefile.in: Add new object files, and build instructions for cygserver.exe.
6056 * cygwin.din: Export ftok, shmat, shmctl and shmget.
6057 * dcrt0.cc: Additional includes for cygserver support.
6058 (dll_crt0_1): Initialise the cygserver client.
6059 * fhandler.h (fhandler_tty): New method cygserver_attach_tty.
6060 * fhandler_tty.cc: Additional includes for cygserver support.
6061 (fhandler_tty_slave::open): Attempt to use the cygserver when obtaining
6062 handles from the parent process. On failure or 9x use the current method.
6063 (fhandler_tty_slave::cygserver_attach_tty): New function.
6064 * fork.cc (fork_child): Fixup shm memory mapped areas.
6065 * pinfo.h: Declare fixup_shms_after_fork().
6066 * security.h: Declare alloc_sd().
6067 * tty.cc: Additonal includes to support cygserver.
6068 (tty::common_init): Don't allow others to open us if the cygserver is running.
6069 * winsup.h: Declare cygserver_running.
6070 * cygserver.cc: New file.
6071 * cygserver_client.cc: New file.
6072 * cygserver_shm.cc: New file.
6073 * cygserver_shm.h: New file.
6074 * cygserver_transport.cc: New file.
6075 * cygserver_transport_pipes.cc: New file.
6078 * include/cygwin/cygserver.h: New file.
6079 * include/cygwin/cygserver_transport.h: New file.
6080 * include/sys/ipc.h: New file.
6081 * include/sys/shm.h: New file.
6083 2002-02-28 Robert Collins <rbtcollins@hotmail.com>
6085 * thread.cc (semaphore::TryWait): Set errno as required by posix 1003.1.
6086 (__sem_wait): Ditto.
6087 (__sem_trywait): Ditto.
6089 2002-02-27 Christopher Faylor <cgf@redhat.com>
6091 * include/cygwin/version.h: Bump DLL minor number.
6093 2002-02-23 Corinna Vinschen <corinna@vinschen.de>
6095 * cygwin.din (fstat64): New symbol.
6096 (ftruncate64): Ditto.
6103 (truncate64): Ditto.
6104 * dir.cc (telldir64): New function.
6105 (telldir): Call telldir64().
6106 (seekdir64): New function.
6107 (seekdir): Call seekdir64().
6108 * fhandler.h: Redefine all methods using __off32_t to use __off64_t.
6109 * fhandler.cc: Use __off64_t and struct __stat64 throughout.
6110 * fhandler_clipboard.cc: Ditto.
6111 * fhandler_disk_file.cc: Ditto.
6112 * fhandler_dsp.cc: Ditto.
6113 * fhandler_floppy.cc: Ditto.
6114 * fhandler_mem.cc: Ditto.
6115 * fhandler_random.cc: Ditto.
6116 * fhandler_socket.cc: Ditto.
6117 * fhandler_tape.cc: Ditto.
6118 * fhandler_zero.cc: Ditto.
6120 * glob.c: Ditto, call lstat64 and stat64 in Cygwin.
6121 * mmap.cc: Use __off64_t throughout.
6122 (mmap64): New function.
6123 * sec_acl.cc (acl_worker): Use struct __stat64, call stat64 and lstat64.
6124 * syscalls.cc (lseek64): New function.
6125 (stat64_to_stat32): Ditto.
6129 (ftruncate64): Ditto.
6130 (truncate64): Ditto.
6131 (_fstat): Call fstat64.
6132 (_stat): Call stat64.
6133 (cygwin_lstat): Rename to avoid declaration problem. Call lstat64.
6134 (stat_worker): Use struct __stat64.
6136 (ftruncate): Call ftruncate64.
6137 (truncate): Call truncate64.
6138 * wincap.cc: Set flag has_64bit_file_access appropriately.
6139 * wincap.h: Add flag has_64bit_file_access.
6140 * winsup.h (ILLEGAL_SEEK): Define as __off64_t.
6141 (stat_dev): Declare using struct __stat64.
6142 (stat_worker): Ditto.
6143 * include/cygwin/stat.h (struct __stat32): Define if compiling Cygwin.
6144 (struct __stat64): Ditto.
6145 (struct stat): Revert definition with explicitly sized datatypes.
6146 Eliminate sized field names.
6147 * include/cygwin/types.h (blksize_t): New type.
6148 (__blkcnt32_t): Ditto.
6149 (__blkcnt64_t): Ditto.
6152 2002-02-22 Christopher Faylor <cgf@redhat.com>
6154 * sync.h (new_muto): Just accept an argument which denotes the name of
6155 the muto. Use this argument to construct static storage.
6156 * cygheap.cc (cygheap_init): Reflect above change.
6157 * exceptions.cc (events_init): Ditto.
6158 * malloc.cc (malloc_init): Ditto.
6159 * path.cc (cwdstuff::init): Ditto.
6160 * cygheap.h (cwdstuff): Change name of lock element to make it less
6162 * path.cc (cwdstuff::get_hash): Ditto.
6163 (cwdstuff::get_initial): Ditto.
6164 (cwdstuff::set): Ditto.
6165 (cwdstuff::get): Ditto.
6166 * sigproc.cc (proc_subproc): Ditto.
6168 * debug.cc (lock_debug): Change to method. Use method rather than
6171 * tty.h (tty_min::kill_pgrp): Declare new method.
6172 * fhandler_termios.cc (tty_min::kill_pgrp): New method.
6173 (fhandler_termios::line_edit): Use new method for killing process.
6174 * dcrt0.cc (do_exit): Ditto.
6176 * dtable.cc (dtable::get_debugger_info): New method for inheriting
6177 dtable info from a debugger.
6178 * tty.cc (tty_init): Attempt to grab file handle info from parent
6179 debugger, if appropriate.
6181 # dtable.cc (dtable::stdio_init): Make this a method.
6182 (dtable::init_std_file_from_handle): Don't set fd unless it's not open.
6183 (dtable::build_fhandler_from_name): Move name setting to
6184 dtable::build_fhandler.
6185 (dtable::build_fhandler): Add win32 name parameter.
6186 * dcrt0.cc (dll_crt0_1): Change to use dtable stdio_init.
6187 * dtable.h (dtable): Reflect build_fhandler parameter change.
6188 * mmap.cc (mmap_record::alloc_fh): Don't set name parameter in
6190 * net.cc (fdsock): Remove set_name call since it is now handled by
6193 * sigproc.cc (proc_subproc): Release muto as early as possible.
6195 2001-02-22 Corinna Vinschen <corinna@vinschen.de>
6197 * smallprint.c (rn): Allow long long values.
6198 (__small_vsprintf): Add 'D', 'U' and 'X' formats for long long
6201 2002-02-19 Christopher Faylor <cgf@redhat.com>
6203 * fhandler.cc (fhandler_base::puts_readahead): Remove default parameter
6204 setting. Newer gcc's complain about this.
6205 (fhandler_base::set_readahead_valid): Ditto.
6206 * fhandler_dsp.cc (Audio::open): Ditto.
6207 (fhandler_dev_dsp::open): Ditto.
6209 2002-02-19 Christopher Faylor <cgf@redhat.com>
6211 * fork.cc (fork_parent): Use sec_user_nih to control process/thread
6212 inheritance/permission.
6213 * spawn.cc (spawn_guts): Ditto.
6214 * security.cc (create_token): Initialize token so that it is not tested
6215 for bogus value later. Use sec_user to control process/thread
6217 * security.h (__sec_user): Rename declaration from sec_user.
6218 (sec_user_nih): Declare here as inline function wrapper for __sec_user.
6220 * sigproc.cc (czombies): Allocate a character array for zombies to
6221 avoid constructor overhead
6222 (extremely hackish, I know).
6223 (cpchildren): Ditto.
6224 (pchildren): New define.
6226 (getsem): Use sec_user_nih to control semaphore inheritance/permission.
6228 2002-02-16 Christopher Faylor <cgf@redhat.com>
6230 * times.cc (hires::prime): Restore thread priority on failure
6233 * uinfo.cc (uinfo_init): Use more robust method for determining if
6234 process was invoked from a non-cygwin process.
6236 * sync.h (muto::init): Eliminate "inheritance" parameter.
6237 (new_muto): Reflect removal of parameter.
6238 * sync.cc (muto::init): Ditto.
6239 * cygheap.cc (cygheap_init): Ditto.
6240 * debug.cc (threadname_init): Ditto.
6241 * exceptions.cc (events_init): Ditto.
6242 * malloc.cc (malloc_init): Ditto.
6243 * path.cc (cwdstuff::init): Ditto.
6244 * sigproc.cc (sigproc_init): Ditto.
6246 * grp.cc (group_lock): Use different method for locking with static
6248 (read_etc_group): REALLY ensure that read lock mutex is released.
6249 * passwd.cc (passwd_lock): Use different method for locking with static
6251 (read_etc_passwd): REALLY ensure that read lock mutex is released.
6253 * shared.cc (sec_user): Correct reversed inheritance test.
6255 2002-02-15 Christopher Faylor <cgf@redhat.com>
6257 * hires.h (hires::usecs): Rename from utime. Accept an argument.
6258 * strace.cc (strace::microseconds): Use hires class for calculating
6260 * sync.h (new_muto): Use NO_COPY explicitly in declaration.
6261 * times.cc (gettimeofday): Reflect change in usecs argument.
6262 (hires::usecs): Ditto. Changed name from utime.
6263 * winsup.h (NO_COPY): Add nocommon attribute to force setting aside
6265 * regcomp.c (REQUIRE): Add a void cast to bypass a warning.
6267 2002-02-15 Christopher Faylor <cgf@redhat.com>
6269 * hires.h: New file.
6270 * times.cc (gettimeofday): Use hires class for calculating current time.
6271 (hires::prime): New method.
6272 (hires::utime): Ditto.
6274 2002-02-14 Christopher Faylor <cgf@redhat.com>
6276 * include/sys/cygwin.h (cygwin_getinfo_types): New CW_STRACE_ACTIVE.
6277 * external.cc (cygwin_internal): Handle CW_STRACE_ACTIVE.
6279 2002-02-14 Christopher Faylor <cgf@redhat.com>
6281 * exceptions.cc (unused_sig_wrapper): Eliminate unused parameter to
6283 * external.cc (cygwin_internal): Change CW_STRACE_ON to
6285 * strace.cc (strace::hello): Toggle strace on and off.
6286 * sync.cc (muto::init): Rename from constructor.
6287 * sync.h (muto::new): Delete.
6288 (muto::delete): Ditto.
6289 (new_muto): Simplify. Use muto.init for nearly everything.
6290 * uinfo.cc (uinfo_init): Avoid closing a NULL handle.
6291 * include/sys/cygwin.h (cygwin_getinfo_types): Rename CW_STRACE_OFF to
6292 CW_STRACE_TOGGLE. Delete CW_STRACE_OFF.
6293 * include/sys/strace.h (strace): Add "inited" field.
6295 2001-02-12 Corinna Vinschen <corinna@vinschen.de>
6297 * include/cygwin/acl.h: Fix definition of aclent_t.
6299 2002-02-10 Christopher Faylor <cgf@redhat.com>
6301 * Makefile.in (DLL_OFILES): Consolidate object files.
6303 2002-02-10 Corinna Vinschen <corinna@vinschen.de>
6305 * child_info.h, cygheap.h, fhandler_clipboard.cc, fhandler_dsp.cc,
6306 fhandler_floppy.cc, fhandler_mem.cc, fhandler_random.cc,
6307 fhandler_tape.cc, fhandler_zero.cc, grp.cc, mmap.cc, passwd.cc,
6308 pinfo.cc, pinfo.h, pipe.cc, sec_acl.cc, sec_helper.cc, security.cc,
6309 security.h, thread.h, uinfo.cc, include/cygwin/acl.h: Fix copyright.
6311 2002-02-10 Corinna Vinschen <corinna@vinschen.de>
6313 * child_info.h, cygheap.h, dcrt0.cc, dir.cc, fhandler.cc, fhandler.h,
6314 fhandler_clipboard.cc, fhandler_disk_file.cc, fhandler_dsp.cc,
6315 fhandler_floppy.cc, fhandler_mem.cc, fhandler_random.cc,
6316 fhandler_tape.cc, fhandler_zero.cc, grp.cc, mmap.cc, passwd.cc,
6317 pinfo.cc, pinfo.h, pipe.cc, sec_acl.cc, sec_helper.cc, security.cc,
6318 security.h, spawn.cc, syscalls.cc, thread.h, uinfo.cc, winsup.h:
6319 Change usage of uid_t to __uid16_t, gid_t to __gid16_t and
6320 off_t to __off32_t throughout. Use INVALID_UID, INVALID_GID and
6321 INVALID_SEEK instead casting -1 to the appropriate type.
6322 * winsup.h: Define INVALID_UID, INVALID_GID and INVALID_SEEK.
6323 * include/cygwin/acl.h: Define internal __aclent16_t and __aclent32_t
6324 types. Don't declare acl functions when compiling Cygwin.
6325 * include/cygwin/grp.h: Declare getgrgid() and getgrnam() with
6326 correct types for internal usage.
6328 2002-02-10 Corinna Vinschen <corinna@vinschen.de>
6330 Patch suggested by Pierre A. Humblet <Pierre.Humblet@ieee.org>:
6331 * uinfo.cc (internal_getlogin): Try evaluating user by SID even if
6333 (uinfo_init): Set primary group even if ntsec is off.
6335 2002-02-09 Corinna Vinschen <corinna@vinschen.de>
6337 * include/cygwin/grp.h: New file.
6338 * include/cygwin/stat.h: Ditto.
6339 * include/cygwin/types.h: Add definitions for __off32_t,
6340 __off64_t, off_t, __uid16_t, __uid32_t, uid_t, __gid16_t,
6341 __gid32_t and gid_t.
6342 * include/sys/cygwin.h: Use correct uid and gid types.
6344 2002-02-09 Corinna Vinschen <corinna@vinschen.de>
6346 * dtable.cc (dtable::dup2): Revert previous patch.
6347 * fhandler.h: Ditto.
6348 (fhandler_socket::recv): Define new method.
6349 (fhandler_socket::send): Ditto.
6350 * fhandler_socket.cc (fhandler_socket::recv): New method.
6351 (fhandler_socket::send): Ditto.
6352 (fhandler_socket::read): Call fhandler_socket::recv() now.
6353 (fhandler_socket::write): Call fhandler_socket::send() now.
6354 * net.cc (class wsock_event): Move definition to wsock_event.h.
6355 (fdsock): Revert previous patch.
6356 (cygwin_recv): Move implementation to fhandler_socket::recv().
6357 (cygwin_send): Move implementation to fhandler_socket::send().
6358 * wsock_event.h: New file.
6360 2002-02-06 Alexander Gottwald <Alexander.Gottwald@s1999.tuchemnitz.de>
6362 * net.cc (get_2k_ifconf): Create interface entries for tokenring cards.
6364 2002-02-08 Corinna Vinschen <corinna@vinschen.de>
6366 * dtable.cc (dtable::dup2): Store fd for fhandler_socket.
6367 * fhandler.h (fhandler_base::set_fd): New virtual method.
6368 (fhandler_base::get_fd): Ditto.
6369 (fhandler_socket::set_fd): Ditto.
6370 (fhandler_socket::get_fd): Ditto.
6371 * fhandler_socket.cc (fhandler_socket::read): Call cygwin_recv instead
6372 of native Winsock recv.
6373 (fhandler_socket::write): Call cygwin_send instead of native Winsock
6375 * net.cc (fdsock): Store fd in fhandler_socket.
6377 2002-02-07 Corinna Vinschen <corinna@vinschen.de>
6379 * net.cc (cygwin_getsockname): Fix handling of NULL sun_path.
6381 2002-01-29 Corinna Vinschen <corinna@vinschen.de>
6383 * net.cc (getdomainname): Fix registry key for 9x systems, too.
6385 2002-01-29 Corinna Vinschen <corinna@vinschen.de>
6387 * net.cc (getdomainname): Fix registry key for NT systems.
6389 2002-01-28 Christopher Faylor <cgf@redhat.com>
6391 * external.cc (cygwin_internal): Initialize various internal settings
6392 if required to allow use of some things from user loaded DLL.
6393 (CW_STRACE_ON): Add new feature.
6394 (CW_CYGWIN_PID_TO_WINPID): Ditto.
6395 * pinfo.cc (set_myself): Call "strace.hello" to initiate possible
6397 (pinfo::init): Guard against dereferencing uninitialized myself.
6398 * sigproc.cc (wait_sig): Call strace.hello() when __SIGTRACE "signal"
6400 * strace.cc (strace::hello): New method.
6401 * wincap.cc (wincapc::init): Avoid initializing if already initialized.
6402 * wincap.h (wincapc::wincapc): New method.
6403 * include/sys/cygwin.h: Add new CW_ enums. Kludge typedefs of
6404 {g,u}id_t if required.
6405 * strace.h (strace::hello): Declare new method.
6407 2002-01-28 Earnie Boyd <earnie@users.sf.net>
6409 * include/sys/strace.h (_STRACE_ON): Define.
6410 (_STRACE_OFF): Ditto.
6412 2002-01-24 Christopher Faylor <cgf@redhat.com>
6414 * speclib: Ensure that temporary def file is removed.
6416 2002-01-23 Christopher Faylor <cgf@redhat.com>
6418 * speclib: Use rm -f to remove temp file just to quiet any potential
6421 2002-01-23 Corinna Vinschen <corinna@vinschen.de>
6423 * security.cc (create_token): Use sec_user() to create
6424 SECURITY_ATTRIBUTES structure for primary token. Use
6425 MAXIMUM_ALLOWED access rights instead of TOKEN_ALL_ACCESS.
6427 2002-01-23 Corinna Vinschen <corinna@vinschen.de>
6429 * path.cc (symlink): Fix check for already existing file.
6431 2002-01-21 Christopher Faylor <cgf@redhat.com>
6433 * cygmagic: Suppress error output when figuring out if sum takes an
6436 2002-01-21 Christopher Faylor <cgf@redhat.com>
6438 * cygmagic: Attempt to figure out if sum takes an option.
6440 2002-01-21 DJ Delorie <dj@redhat.com>
6442 * Makefile.in (libpthread.a): Pass the assembler also.
6445 * speclib: Specify the assembler to dlltool.
6447 2002-01-21 Christopher Faylor <cgf@redhat.com>
6449 * include/cygwin/version.h: Bump DLL minor number.
6451 2002-01-21 Corinna Vinschen <corinna@vinschen.de>
6453 * grp.cc (getgrgid): Don't return default gid entry when ntsec is on.
6454 * syscalls.cc (setegid): Don't set primary group in process token.
6456 2002-01-21 Christopher Faylor <cgf@redhat.com>
6458 * speclib: Don't use /dev/null as DLL name. Just default to what's
6459 already in .def file.
6461 2002-01-21 Christopher Faylor <cgf@redhat.com>
6463 * exceptions.cc (sig_handle): Remove last vestiges of SA_NOCLDSTOP code
6464 which caused SIGCHLD to be ignored.
6466 2002-01-20 Christopher Faylor <cgf@redhat.com>
6468 * include/cygwin/version.h: Bump DLL minor number.
6470 2002-01-20 Christopher Faylor <cgf@redhat.com>
6472 * syscalls.cc (regfree): Make dll_export.
6474 2002-01-20 Christopher Faylor <cgf@redhat.com>
6476 * exceptions.cc (ctrl_c_handler): Convert windows pid to cygwin pid
6477 when detecting if we should actually handle CTRL-C.
6479 2002-01-19 Christopher Faylor <cgf@redhat.com>
6481 * Makefile.in (new-cygwin1.dll): Revert previous change. libsupc++.a
6482 is only available in libstdc++-v3.
6484 2002-01-19 Christopher Faylor <cgf@redhat.com>
6486 * exceptions.cc (sig_handle_tty_stop): Don't send SIGCHLD if parent
6488 (sig_handle): Don't check for SA_NOCLDSTOP here. We don't have enough
6491 2002-01-19 Christopher Faylor <cgf@redhat.com>
6493 * include/cygwin/version.h: Bump DLL minor number.
6495 2002-01-19 Christopher Faylor <cgf@redhat.com>
6497 * Makefile.in (new-cygwin1.dll): Just use -lsupc++ for link.
6498 * sigproc.cc (proc_exists): Change existence criteria.
6499 * sync.h (new_muto): Add volatile to definition to avoid gcc
6500 optimization problems.
6502 2002-01-19 Corinna Vinschen <corinna@vinschen.de>
6504 * include/cygwin/version.h: Bump API minor version to 51.
6506 2002-01-19 Mark Bradshaw <bradshaw@staff.crosswalk.com>
6508 * cygwin.din: Add recvmsg and sendmsg.
6509 * net.cc: Add cygwin_recvmsg and cygwin_sendmsg.
6510 * /usr/include/sys/socket.h: Add recvmsg and sendmsg.
6512 2002-01-19 Corinna Vinschen <corinna@vinschen.de>
6514 * security.cc (create_token): Close processes token handle as soon
6515 as it's not used anymore.
6517 2002-01-17 Corinna Vinschen <corinna@vinschen.de>
6519 * Makefile.in: Add fnmatch.o to DLL_OFILES.
6520 * cygwin.din: Add fnmatch export symbol.
6521 * fnmatch.c: New file.
6522 * include/fnmatch.h: Ditto.
6523 * include/cygwin/version.h: Bump API minor version to 50.
6525 2002-01-15 Corinna Vinschen <corinna@vinschen.de>
6527 * path.cc (fchdir): Call chdir with full windows path.
6529 2002-01-14 Corinna Vinschen <corinna@vinschen.de>
6531 * dir.cc: Use INVALID_FILE_ATTRIBUTES instead of "(DWORD) -1"
6532 for file attributes throughout.
6533 * fhandler.cc: Ditto.
6534 * fhandler_disk_file.cc: Ditto.
6537 * syscalls.cc: Ditto.
6538 * times.cc (utimes): Use path_conv::isdir() instead of explicit
6539 GetFileAttributes() call.
6541 2002-01-13 Christopher Faylor <cgf@redhat.com>
6543 * dcrt0.cc (multiple_cygwin_problem): Clarify logic and make
6544 CYGWIN_MISMATCH_OK more powerful.
6546 2002-01-10 Christopher Faylor <cgf@redhat.com>
6548 * exceptions.cc (sig_handle): Accept a second argument indicating
6549 whether the signal came from this process or not.
6550 * sigproc.h: Reflect sig_handle arg change.
6551 * signal.cc (kill_pgrp): Add sigframe info.
6552 (abort): New function. Eliminates newlib function of same name.
6553 * sigproc.cc (wait_sig): Pass "signal from this process" value as arg
6556 2002-01-10 Corinna Vinschen <corinna@vinschen.de>
6558 * syscalls.cc (pathconf): Guard _PC_PATH_MAX branch against invalid
6561 2002-01-09 Christopher Faylor <cgf@redhat.com>
6562 Robert Collins <rbtcollins@hotmail.com>
6564 * exceptions.cc (early_stuff_init): Rename from misnamed
6565 set_console_handler.
6566 (ctrl_c_handler): Attempt to work around potential signal duplication
6567 during process startup.
6568 (sig_handle): Ignore SIGINT when we're just an "exec stub".
6569 * spawn.cc (spawn_guts): Store pid of spawned process in global for use
6571 * dcrt0.cc (dll_crt0_1): Call renamed initialization function.
6572 * winsup.h: Reflect function name change.
6574 2002-01-08 Corinna Vinschen <corinna@vinschen.de>
6576 * net.cc (cygwin_accept): Set sun_path for newly connected socket.
6578 2002-01-07 Ralf Habacker <Ralf.Habacker@freenet.de>
6580 * Makefile.in: Add uninstall target.
6582 2002-01-07 Christopher Faylor <cgf@redhat.com>
6584 * sigproc.cc (getsem): Clean up debugging output.
6586 2002-01-07 Christopher Faylor <cgf@redhat.com>
6588 * sigproc.cc (getsem): Set errno when unable to create own semaphore.
6589 Reorganize to make clearer that error should only come from initial
6590 creation of process semaphore.
6592 2002-01-06 Christopher Faylor <cgf@redhat.com>
6594 * dtable.cc (dtable::init_std_file_from_handle): Add some defensive
6595 code to invalid handle case.
6597 2002-01-06 Corinna Vinschen <corinna@vinschen.de>
6599 * ioctl.cc (ioctl): Make third argument optional.
6600 * include/sys/ioctl.h: Ditto in declaration.
6601 * dtable.cc (dtable::init_std_file_from_handle): Revert previous
6603 * window.cc (WndProc): Raise SIGURG instead of SIGIO in case of FD_OOB
6606 2002-01-05 Christopher Faylor <cgf@redhat.com>
6608 * dir.cc (opendir): Guarantee release of alloced fhandler structure on
6611 2002-01-05 Corinna Vinschen <corinna@vinschen.de>
6613 * exceptions.cc (sig_handle): Set default action for SIGURG to SIG_IGN.
6615 2002-01-05 Corinna Vinschen <corinna@vinschen.de>
6617 * dtable.cc (dtable::init_std_file_from_handle): Don't treat NULL
6618 handle as errorneous.
6620 2002-01-04 Christopher Faylor <cgf@redhat.com>
6622 * cygmagic: Change logic for equality test.
6624 2002-01-04 Christopher Faylor <cgf@redhat.com>
6626 * dir.cc (opendir): Don't attempt to call sub-opendir if ENOENT.
6628 2002-01-04 Corinna Vinschen <corinna@vinschen.de>
6630 * net.cc: Replace usage of AF_UNIX by Posix compliant AF_LOCAL
6632 (socketpair): Explicitly allow SOCK_STREAM and SOCK_DGRAM socket types
6633 in families AF_UNIX and AF_LOCAL. Explicitly allow PF_UNSPEC, PF_LOCAL
6634 and PF_INET protocols. Return error otherwise. Implement datagram
6637 2002-01-01 Christopher Faylor <cgf@redhat.com>
6639 * speclib: Remove temp files automatically.
6641 2002-01-01 Corinna Vinschen <corinna@vinschen.de>
6642 * fhandler.h (fhandler_socket::sun_path): New private member.
6643 (fhandler_socket::set_sun_path): New method.
6644 (fhandler_socket::get_sun_path): Ditto.
6645 * fhandler_socket.cc (fhandler_socket::fhandler_socket): Initialize
6647 (fhandler_socket::~fhandler_socket): Free sun_path if needed.
6648 (fhandler_socket::set_sun_path): New method.
6649 * net.cc (cygwin_bind): Set sun_path to path of local socket file.
6650 (cygwin_getsockname): Add code to return correct sockaddr for unix