1 2003-01-01 Christopher Faylor <cgf@redhat.com>
3 * passwd.cc (getpwuid_r32): Revert previous change.
5 2003-01-01 Christopher Faylor <cgf@redhat.com>
7 * sysconf.cc (sysconf): Return arbitrary values for
8 _SC_GETGR_R_SIZE_MAX, _SC_LOGIN_NAME_MAX, _SC_GETPW_R_SIZE_MAX.
10 * passwd.cc (getpwuid_r32): Add uid/gid fields to size check
13 2002-12-30 Christopher Faylor <cgf@redhat.com>
15 * exceptions.cc (events_init): Display name of mutex on failure.
17 2002-12-30 Christopher Faylor <cgf@redhat.com>
19 * windows.cc (setitimer): Return ENOSYS on invalid argument.
21 2002-12-28 Christopher Faylor <cgf@redhat.com>
23 * fhandler_termios.cc (fhandler_termios::line_edit): Perform echo
24 before input is accepted or suffer a "race".
26 2002-12-27 Christopher Faylor <cgf@redhat.com>
28 * fhandler.h (fhandler_tty_master::set_winsize): Declare new function.
29 * fhandler_console.cc (fhandler_console::send_winch_maybe): If
30 appropriate, call tty master function to handle screen size change.
31 * fhandler_tty.cc (fhandler_tty_master::set_winsize): New function.
32 (fhandler_tty_master::init): Call set_winsize to set initial screen
35 2002-12-26 Christopher Faylor <cgf@redhat.com>
37 * fhandler_tty.cc (fhandler_tty_master::init): Set initial size of tty
38 to that of console in which tty is operating.
39 (process_input): Semi-revert previous change. Need to just use current
40 terminfo settings since this function is running in a thread, blocked
41 when the terminfo changes.
43 2002-12-26 Christopher Faylor <cgf@redhat.com>
45 * fhandler.h (fhandler_termios::line_edit): Replace third argument with
46 passed-in termios struct.
47 * fhandler_console.cc (fhandler_console::read): Prior to loop, make a
48 copy of current termios for passing to line_edit prior so that all
49 characters are processed consistently.
50 * fhandler_tty.cc (fhandler_pty_master::write): Ditto.
51 (process_input): Make a copy of curent termios prior to read for use in
53 * fhandler_termios.cc (fhandler_termios::line_edit): Replace third
54 parameter with passed-in termios struct and use it throughout rather
55 than the data from the current fhandler_termios class.
57 2002-12-25 Christopher Faylor <cgf@redhat.com>
59 * include/cygwin/version.h: Bump DLL minor number.
61 2002-12-25 Christopher Faylor <cgf@redhat.com>
63 * exceptions.cc (events_init): Initialize critical section to control
65 (signal_exit): Enter critical section early to avoid exit races with
67 * dcrt0.cc (do_exit): Use exit_lock critical section to avoid races.
69 2002-12-25 Christopher Faylor <cgf@redhat.com>
71 * cygthread.cc (cygthread::detach): Set errno with set_sig_errno so
72 that EINTR is properly restored after signal.
74 2002-12-21 Christopher Faylor <cgf@redhat.com>
76 * Makefile.in: Default fhandler objects to -fomit-frame-pointer.
77 Eliminate redundant CFLAGS settings.
79 2002-12-20 Christopher Faylor <cgf@redhat.com>
81 * fhandler.h (line_edit_status): Reorganize so that tests for error
82 condition can be < or >.
83 * fhandler_tty.cc (fhandler_pty_master::write): Don't return after
86 * fhandler_termios.cc (fhandler_termios::line_edit): Trivial change to
87 use built-in bool types.
89 2002-12-19 Pierre Humblet <pierre.humblet@ieee.org>
91 * localtime.cc (tzsetwall): Set lcl_is_set and lcl_TZname
92 in the Cygwin specific part of the routine.
94 2002-12-19 Pierre Humblet <pierre.humblet@ieee.org>
96 * fhandler.cc (fhandler_base::open): Use "flags" rather than "mode"
97 in Win9X directory code.
99 2002-12-19 Steve Osborn <bub@io.com>
101 * fhandler.h (line_edit_status): Add a new element.
102 * fhandler_termios.cc (fhandler_termios::line_edit): After
103 accept_input, handle both potential error condition and pipe full
105 * fhandler_tty.cc (fhandler_pty_master::accept_input): Return -1 on
107 (fhandler_pty_master::write): Handle pipe full condition.
109 2002-12-16 Steve Osborn <bub@io.com>
110 Christopher Faylor <cgf@redhat.com>
112 * fhandler_termios.cc (fhandler_termios::line_edit): Return
113 line_edit_error and remove last char from readahead buffer if
114 accept_input() fails.
115 * fhandler_tty.cc (fhandler_pty_master::accept_input): Return 0 and
116 restore readahead buffer when tty slave pipe is full.
118 2002-12-16 Christopher Faylor <cgf@redhat.com>
120 * pinfo.cc (_pinfo::cmdline): Allocate sufficient space for myself
123 2002-12-14 Steve Osborn <bub@io.com>
125 * fhandler_termios.cc (fhandler_termios::line_edit): Call
126 accept_input() in character processing loop. Set return value
127 independently of input_done.
129 2002-12-14 Christopher Faylor <cgf@redhat.com>
131 * fhandler.cc (fhandler_base::read): Signal event, if necessary, and
132 raw_read hasn't done so.
134 2002-12-14 Christopher Faylor <cgf@redhat.com>
136 * fhandler.cc (fhandler_base::raw_read): Reset priorities to minimize
137 window where thread termination may cause data loss.
138 (fhandler_base::read): Always return at end of function. Just set len
139 to copied_chars when len is zero. Return immediately after raw_read if
140 len <= 0. Remove in_len setting and just check end instead. Fix CRLF
141 handling at end of buffer.
143 2002-12-14 Corinna Vinschen <corinna@vinschen.de>
145 * dcrt0.cc (dll_crt0_1): Call well known SID initializer function.
146 * security.h (cygsid::init): Declare new static method.
147 * sec_helper.cc (cygsid::init): New method for initializing well
150 2002-12-14 Pierre Humblet <pierre.humblet@ieee.org>
152 * security.h: Declare well_known_creator_group_sid.
153 * sec_helper.cc: Define and initialize well_known_creator_group_sid.
155 2002-12-14 Corinna Vinschen <corinna@vinschen.de>
157 * netdb.cc: Remove strtok_r comment.
159 2002-12-14 Pierre Humblet <pierre.humblet@ieee.org>
161 * security.cc (get_user_local_groups): Use LookupAccountSid to find the
162 local equivalent of BUILTIN.
164 2002-12-14 Christopher Faylor <cgf@redhat.com>
166 * pipe.cc (make_pipe): Set fork fixup flag for read pipe.
168 2002-12-14 Christopher Faylor <cgf@redhat.com>
170 * winbase.h: Turn on inline versions of Interlocked* by default.
172 2002-12-14 Gary R. Van Sickle <g.r.vansickle@worldnet.att.net>
174 * winbase.h: Fixup inline asm functions. Add ilockcmpexch.
176 2002-12-13 Christopher Faylor <cgf@redhat.com>
178 Throughout, change fhandler_*::read and fhandler_*::raw_read to void
179 functions whose second arguments are both the length and the return
181 * fhandler.cc (fhandler_base::read): Rework slightly to use second
182 argument as input/output. Tweak CRLF stuff.
183 (fhandler_base::readv): Accommodate fhandler_*::read changes.
184 * cygthread.h (cygthread::detach): Declare as taking optional handle
186 (cygthread::detach): When given a handle argument, wait for the handle
187 to be signalled before waiting for thread to detach. Return true when
190 2002-12-12 Corinna Vinschen <corinna@vinschen.de>
192 * Makefile.in: Add MINGW_LDFLAGS when linking cygrun.exe.
194 2002-12-10 Christopher Faylor <cgf@redhat.com>
196 * cygthread.h (cygthread::stack_ptr): New element.
197 (cygthread::detach): Accept a "wait_for_signal" argument.
198 (cygthread::terminate_thread): New function.
199 * cygthread.cc (cygthread::stub): Set stack pointer argument.
200 (cygthread::terminate_thread): New function. Forcibly terminate
202 (cygthread::detach): Optionally wait for signals and kill thread when
204 * exceptions.cc (signal_exit): Set signal_arrived prior to exiting to
205 wake up anything blocking on signals.
206 * fhandler.h (fhandler_base::set_r_no_interrupt): Change to accept bool
208 (fhandler_pipe::ready_for_read): Declare.
209 * pipe.cc (pipeargs): New structure.
210 (read_pipe): New thread stub wrapper for normal pipe read.
211 (fhandler_pipe::read): Modify to call reader in a cygthread,
212 terminating on signal, as appropriate.
213 * select.cc (fhandler_pipe::ready_for_read): Define new function.
215 2002-12-10 Corinna Vinschen <corinna@vinschen.de>
217 * net.cc (free_protoent_ptr): Add missing free() for base structure.
218 (free_servent_pt): Ditto.
219 (free_hostent_pt): Ditto.
221 2002-12-10 Craig McGeachie <slapdau@yahoo.com.au>
223 * netdb.cc (parse_alias_list): Change strtok calls to strtok_r.
224 (parse_services_line): Ditto.
225 (parse_protocol_line): Ditto.
227 2002-12-10 Pierre Humblet <pierre.humblet@ieee.org>
229 * pwdgrp.h (pwdgrp_check::pwdgrp_state): Replace by
230 pwdgrp_check::isinitializing ().
231 (pwdgrp_check::isinitializing): Create.
232 * passwd.cc (grab_int): Change type to unsigned, use strtoul and set
233 the pointer content to 0 if the field is invalid.
234 (parse_pwd): Move validity test after getting pw_gid.
235 (read_etc_passwd): Replace "passwd_state <= " by
236 passwd_state::isinitializing ().
237 (internal_getpwuid): Ditto.
238 (internal_getpwnam): Ditto.
241 * grp.cc (parse_grp): Use strtoul for gr_gid and verify the validity.
242 (read_etc_group): Replace "group_state <= " by
243 group_state::isinitializing ().
244 (internal_getgrgid): Ditto.
246 (internal_getgrent): Ditto.
248 2002-12-10 Pierre Humblet <pierre.humblet@ieee.org>
250 * security.h: Move declarations of internal_getgrent,
251 internal_getpwsid and internal_getgrsid to pwdgrp.h.
252 * pwdgrp.h: Declare internal_getpwsid, internal_getpwnam,
253 internal_getpwuid, internal_getgrsid, internal_getgrgid,
254 internal_getgrnam, internal_getgrent and internal_getgroups.
255 Delete "emulated" from enum pwdgrp_state.
256 (pwdgrp_check::isuninitialized): Create.
257 (pwdgrp_check::pwdgrp_state): Change state to initializing
258 rather than to uninitialized.
259 (pwdgrp_read::gets): Remove trailing CRs.
260 * passwd.cc (grab_string): Don't look for NLs.
262 (parse_pwd): Don't look for CRs. Return 0 if entry is too short.
263 (search_for): Delete.
264 (read_etc_passwd): Simplify tests to actually read the file.
265 Set state to loaded before making internal_getpwXX calls.
266 Replace search_for calls by equivalent internal_pwgetXX calls.
267 (internal_getpwsid): Use passwd_state.isuninitialized to decide
268 to call read_etc_passwd.
269 (internal_getpwuid): Create.
270 (internal_getpwnam): Create.
271 (getpwuid32): Simply call internal_getpwuid.
272 (getpwuid_r32): Call internal_getpwuid.
273 (getpwnam): Simply call internal_getpwnam.
274 (getpwnam_r): Call internal_getpwnam.
275 * grp.cc (parse_grp): Don't look for CRs. Adjust blank space.
276 (add_grp_line): Adjust blank space.
277 (class group_lock): Ditto.
278 (read_etc_group): Simplify tests to actually read the file.
279 Set state to loaded before making internal_getgrXX calls.
280 Replace getgrXX calls by equivalent internal calls.
281 (internal_getgrsid): Use group_state.isuninitialized to decide
282 to call read_etc_group.
283 (internal_getgrgid): Create.
284 (internal_getgrnam): Create.
285 (getgroups32): Simply call internal_getgrgid.
286 (getgrnam32): Simply call internal_getgrnam.
287 (internal_getgrent): Call group_state.isuninitialized.
288 (internal_getgroups): Create from the former getgroups32, using
289 two of the four arguments. Set gid to myself->gid and username
290 to cygheap->user.name ().
291 (getgroups32): Simply call internal_getgroup.
292 (getgroups): Call internal_getgroup instead of getgroups32.
293 (setgroups32): Call internal versions of get{pw,gr}XX.
294 * sec_helper.cc: Include pwdgrp.h.
295 (is_grp_member): Call internal versions of get{pw,gr}XX.
296 * security.cc: Include pwdgrp.h.
297 (alloc_sd): Call internal versions of get{pw,gr}XX.
298 * syscalls.cc: Include pwdgrp.h.
299 (seteuid32): Call internal versions of get{pw,gr}XX.
301 * uinfo.cc: Include pwdgrp.h.
302 (internal_getlogin): Call internal versions of get{pw,gr}XX.
303 (cygheap_user::ontherange): Ditto.
304 * sec_acl.cc: Include pwdgrp.h.
305 (setacl): Call internal versions of get{pw,gr}XX.
306 (acl_access): Ditto and simplify logic.
307 (aclfromtext): Ditto.
309 2002-12-09 2002-12-02 Egor Duda <deo@logos-m.ru>
311 * lib/pseudo-reloc.c: New file.
312 * lib/_cygwin_crt0_common.cc: Perform pseudo-relocs during
313 initialization of cygwin binary (.exe or .dll).
315 2002-12-06 Christopher Faylor <cgf@redhat.com>
317 * cygwin.din: Reflect name change from strtodf to strtof. Export
319 * include/cygwin/version.h: Bump API minor number.
321 2002-12-04 Steve Osborn <bub@io.com>
323 * fhandler.h (fhandler_termios::line_edit): Change return from an int
324 to an enum to allow the function to return an error.
325 * fhandler_console.cc (fhandler_console::read): Update the line_edit
326 call to use the new enum.
327 * fhandler_termios.cc (fhandler_termios::line_edit): Change return from
328 an int to an enum to allow the function to return an error. Put
329 put_readahead call before doecho for future patch.
330 * fhandler_tty.cc (fhandler_pty_master::write): Change to call
331 line_edit one character at a time, and stop if an error occurs.
333 2002-12-04 Craig McGeachie <slapdau@yahoo.com.au>
335 * netdb.cc: New file.
336 * Makeile.in (DLL_OFILES): Add reference to the new netdb.cc file.
337 * cygwin.din : Add new aliased exports for service and protocol
338 enumerations in netdb.cc.
340 2002-12-04 Thomas Pfaff <tpfaff@gmx.net>
342 * cxx.cc: New file. Implement new, new[], delete and delete[]
343 operators and __cxa_pure_virtual if compiled by gcc >=3.
344 * Makefile.in (DLL_OFILES): Add cxx.o.
345 Remove libstdc++.a from cygwin1.dll link step.
347 2002-11-29 Steve Osborn <bub@io.com>
349 * fhandler_tty.cc (fhandler_pty_master::accept_input): Move
350 read_retval assignment to prevent race condition. Remove read_retval
351 from return statement.
353 2002-11-29 Christopher Faylor <cgf@redhat.com>
355 * pinfo.h (winpids::set): Renamed from init.
356 (winpids::init): New declaration.
357 (winpids::cs): Ditto.
358 (winpids::winpids): Use set rather than init.
359 * external.cc (fillout_pinfo): Ditto.
360 * dcrt0.cc (dll_crt0_1): Call winpids::init.
361 * pinfo.cc (winpids::set): Renamed from init. Wrap calls in critical
363 (winpids::init): New function.
364 (winpids::cs): Define.
366 2002-11-28 Christopher Faylor <cgf@redhat.com>
368 * sigproc.cc (sig_dispatch_pending): Remove assertion.
370 2002-11-27 Christopher Faylor <cgf@redhat.com>
372 * include/cygwin/version.h: Bump DLL minor number.
374 2002-11-27 Mikael Ylikoski <my@post.utfors.se>
376 * fhandler_socket.cc (fhandler_socket::sendto): Fix potential
377 unitialized value return.
379 2002-11-27 Christopher Faylor <cgf@redhat.com>
381 * cygwin.din: Export pthread_getsequence_np.
382 * include/cygwin/version.h: Bump API minor version.
384 2002-11-26 Jason Tishler <jason@tishler.net>
386 * cygwin.din: Export nl_langinfo().
387 * include/cygwin/version.h: Bump API minor version.
389 2002-11-26 Christopher Faylor <cgf@redhat.com>
391 * fhandler_tty.cc (fhandler_pty_master::accept_input): Just use a
392 normal Sleep or suffer amazing pauses when other tty apps are running.
393 (fhandler_pty_master::process_slave_output): Ditto.
395 2002-11-25 Pierre Humblet <pierre.humblet@ieee.org>
397 * passwd.cc (read_etc_passwd): Never add an entry when starting
398 on Win95/98/ME if a default entry is present.
399 * uinfo.cc (internal_getlogin): Look for the default uid if needed.
400 Always call user.set_name ().
402 2002-11-25 Corinna Vinschen <corinna@vinschen.de>
404 * sec_acl.cc (getacl): Set errno to ENOSPC if command is GETACL and
405 nentries is less than the number of entries in the file's ACL.
407 2002-11-24 Corinna Vinschen <corinna@vinschen.de>
409 * sec_acl.cc: Fix some formatting. Only set and check `other' bits in
410 a_perm throughout. Use ILLEGAL_GID id for all entries having no id.
411 (setacl): Fix inheritance condition.
412 (getacl): Set all permission bits in CLASS_OBJ and DEF_CLASS_OBJ
413 entries. Remove DENY bits before returning to calling function.
414 (acltomode): Fix usage of searchace(). If available, use CLASS_OBJ
415 to mask GROUP_OBJ permissions.
416 (aclfrommode): Fix usage of searchace(). If available, set CLASS_OBJ
417 permissions to same value as GROUP_OBJ permissions.
419 2002-11-24 Pierre Humblet <pierre.humblet@ieee.org>
421 * sec_acl.cc (getace): Fix the behavior when allow and
422 deny entries are present in arbitrary order.
423 (getacl): Report the actual number of entries when
424 aclbufp is NULL, even if nentries is zero. Fix the mask
425 reporting, handle the case where the owner and group sids
426 are equal and streamline the code.
427 (acl_worker): Take allow_ntsec into account.
429 2002-11-05 Thomas Pfaff <tpfaff@gmx.net>
431 * dcrt0.cc (dll_crt0_1): Add call to pthread::initMainThread to
432 initialize mainthread when it is safe to call new.
433 * init.cc (dll_entry): Change call to store reents in tls key.
434 * thread.cc (_reent_clib) : Change call to get reents from tls
436 (_reent_winsup): Ditto.
437 (MTinterface::Init): Key handling changed. Remove initialization
439 (MTinterface::fixup_after_fork): Reinitialize mainthread object
440 after fork. Reset threadount to 1.
441 (pthread::initMainThread): Create mainthread object dynamically.
442 and initialize with valid handles.
443 (pthread::self): Remove calls to create thread objects.
444 (pthread::setTlsSelfPointer): Change call to store thread self
446 (pthread::getTlsSelfPointer): New static method.
447 (pthread::exit): Remove setTlsSelfPointer call.
448 (pthread::initCurrentThread): New method.
449 (pthread::thread_init_wrapper): Change call to store thread self
451 (pthread::join): Check for a valid joiner.
452 (pthreadNull::pthreadNull): Mark Null object as detached.
453 (pthreadNull::exit): Terminate thread via ExitThread.
454 * thread.h (pthread::initMainThread): Change parameter in function
456 (pthread::getTlsSelfPointer): New static method.
457 (pthread::initCurrentThread): New method.
458 (MTinterface::reent_key): Remove.
459 (MTinterface::thread_self_dwTlsIndex): Ditto..
460 (MTinterface::indexallocated): Ditto.
461 (MTinterface::mainthread): Ditto.
462 (MTinterface::reent_key): New member.
463 (MTinterface::thread_self_key): Ditto.
464 (MTinterface::MTinterface): Initialize all members.
466 2002-11-23 Christopher Faylor <cgf@redhat.com>
468 * wait.cc (wait4): Force pending signal delivery before waiting for
471 2002-11-23 Christopher Faylor <cgf@redhat.com>
473 * include/cygwin/version.h: Bump DLL minor number.
475 2002-11-22 Christopher Faylor <cgf@redhat.com>
477 * exceptions.cc (handle_sigsuspend): Force pending signal delivery
478 before waiting for signals to happen.
479 * signal.cc (sleep): Force pending signal delivery before sleeping.
481 (signal): Force pending signal delivery before manipulating signal
483 (sigprocmask): Ditto.
484 (kill_worker): Ditto.
487 * syscalls.cc (readv): Force pending signal delivery before I/O.
490 * net.cc: Ditto, throughout.
491 * sigproc.cc (sig_dispatch_pending): Deliver any pending signals prior
494 * tty.cc (tty::make_pipes): Increase pipe buffer size.
496 2002-11-22 Christopher Faylor <cgf@redhat.com>
498 * include/cygwin/version.h: Fix comment.
500 2002-11-21 Igor Pechtchanski <pechtcha@cs.nyu.edu>
502 * external.cc (cygwin_internal): Fix va_arg references.
504 2002-11-21 Christopher Faylor <cgf@redhat.com>
506 * exceptions.cc (sigthread::get_winapi_lock): Just do standard 'give up
508 (setup_handler): Revamp YA to attempt to deliver signal multiple times
509 on failure rather than punting to wait_sig.
510 * miscfuncs.cc (low_priority_sleep): Accept INFINITE sleep to mean
511 "don't reset the priority after setting it to idle". Return previous
513 * winsup.h (SLEEP_0_STAY_LOW): Define.
514 (low_priority_sleep): Return an int.
515 * sigproc.h: Define WAIT_SIG_PRIORITY here.
516 * sigproc.cc: Remove WAIT_SIG_PRIORITY definition.
518 2002-11-20 Pierre Humblet <pierre.humblet@ieee.org>
520 * security.h: Declare internal_getpwsid and internal_getgrsid.
521 Undeclare internal_getpwent. Define DEFAULT_UID_NT. Change
523 * passwd.cc (internal_getpwsid): New function.
524 (internal_getpwent): Suppress.
525 (read_etc_passwd): Make static. Rewrite the code for the completion
526 line. Set curr_lines to 0.
527 (parse_pwd): Change type to static int. Return 0 for short lines.
528 (add_pwd_line): Pay attention to the value of parse_pwd.
529 (search_for): Do not look for nor return the DEFAULT_UID.
530 * grp.cc (read_etc_group): Make static. Free gr_mem and set
531 curr_lines to 0. Always call add_pwd_line. Rewrite the code for the
533 (internal_getgrsid): New function.
534 (parse_grp): If grp.gr_mem is empty, set it to &null_ptr.
535 Never NULL gr_passwd.
536 (getgrgid32): Only return the default if ntsec is off and the gid is
538 * sec_helper.cc (cygsid::get_id): Use getpwsid and getgrsid.
539 (cygsid_getfrompw): Clean up last line.
540 (cygsid_getfromgr): Ditto.
541 (is_grp_member): Use getpwuid32 and getgrgid32.
542 * uinfo.cc (internal_getlogin): Set DEFAULT_GID at start.
543 Use getpwsid. Move the read of /etc/group after the second access
544 to /etc/passwd. Change some debug_printf.
546 2002-11-20 Steven O'Brien <steven.obrien2@ntlworld.com>
548 * poll.cc (poll): ...but set POLLIN instead.
550 2002-11-20 Pierre Humblet <pierre.humblet@ieee.org>
552 * security.cc (get_attribute_from_acl): Always test "anti",
553 just in case an access_denied ACE follows an access_allowed.
554 Handle the case owner_sid == group_sid, with a FIXME.
555 Remove unnecessary tests for non-NULL PSIDs.
556 (alloc_sd): Use existing owner and group sids if {ug}id == -1.
557 Handle case where owner_sid == group_sid.
558 Do not call is_grp_member. Try to preserve canonical ACE order.
559 Remove unnecessary tests for non-NULL PSIDs. Reorganize
561 (get_initgroups_sidlist): Put well_known_system_sid on left
563 (add_access_denied_ace): Only call GetAce if inherit != 0.
564 (add_access_allowed_ace): Ditto. Use appropriate sizeof.
565 * syscalls.cc (chown_worker): Pass {ug}id equal to -1 to
566 alloc_sd, which removes the need to obtain old_{ug}id.
567 (chmod): Remove call to get_file_attribute (), simply pass
568 {ug}id equal to -1 to alloc_sd.
570 2002-11-20 Corinna Vinschen <corinna@vinschen.de>
572 * poll.cc (poll): Don't set POLLERR if a listening socket has a
573 pending connect. Don't use errno value from call to
574 fhandler_socket::recvfrom().
576 2002-11-19 Christopher Faylor <cgf@redhat.com>
578 * net.cc: Sprinkle sigframes throughout.
580 2002-11-16 Christopher Faylor <cgf@redhat.com>
582 * tty.cc (tty::make_pipes): Make pipe buffer larger.
584 2002-11-15 Pierre Humblet <pierre.humblet@ieee.org>
586 * grp.cc (getgroups32): Protect against closing cygheap->user.token.
588 2002-11-15 Christopher Faylor <cgf@redhat.com>
590 * include/cygwin/version.h: Bump API_MINOR to accommodate below
593 002-11-14 Sergey Okhapkin <sos@prospect.com.ru>
595 * cygwin.din (siginterrupt): New export.
596 * signal.cc (siginterrupt): New.
598 2002-11-15 Sergey Okhapkin <sos@prospect.com.ru>
600 * select.cc (peek_serial): Don't call PurgeComm() to avoid characters
603 2002-11-14 Christopher Faylor <cgf@redhat.com>
605 * exceptions.cc (setup_handler): Add debugging output. Set thread
606 priority to idle if pending signals to allow other threads to get into
608 * miscfuncs.cc (sys_mbstowcs): Save current thread in variable to avoid
610 * wait.cc (wait_sig): Reset thread priority each time through loop
611 since the priority may have been set down to deal with pending signals.
613 2002-11-14 Christopher Faylor <cgf@redhat.com>
615 * fhandler_serial.cc (fhandler_serial::tcgetattr): Don't take any
616 special action when vmin_ == 0.
618 2002-11-14 Corinna Vinschen <corinna@vinschen.de>
620 * grp.cc (getgroups32): Revert previous patch. Use impersonation
621 token if process is in impersonated state.
622 * sec_helper.cc (is_grp_member): Rewrite. Call getgroups32 only
623 for current user. Scan passwd and group info otherwise.
625 2002-11-14 Christopher Faylor <cgf@redhat.com>
627 * fhandler_console.cc (fhandler_console::write): Allow characters >=
628 0177 to be displayed in the title bar.
630 2002-11-14 Corinna Vinschen <corinna@vinschen.de>
632 * grp.cc (getgroups32): Don't use access token of current user when
633 retrieving group info for another user.
635 2002-11-13 Christopher Faylor <cgf@redhat.com>
637 * dll_init.cc (dll_list::detach): Eliminate reliance on passed in dll
638 address. Infer from module of caller instead.
639 (cygwin_detach_dll): Ignore dll_index argument.
640 * dll_init.h (dll_list::detach): Reflect argument change above.
642 2002-11-13 Christopher Faylor <cgf@redhat.com>
644 * ioctl.cc (ioctl): Always print ioctl results, even when it's a tty.
646 2002-11-13 Christopher Faylor <cgf@redhat.com>
648 * winsup.h (low_priority_sleep): Declare.
650 2002-11-13 Christopher Faylor <cgf@redhat.com>
652 * miscfuncs.cc (low_priority_sleep): New function. Use throughout
653 where code is supposed to be giving up time slice.
655 * fhandler_console.cc (fhandler_console::read): Switch button 2/3
656 output escape sequences to be consistent with xterm.
658 2002-11-12 Pierre Humblet <pierre.humblet@ieee.org>
660 * syscalls.cc (chmod): Simplify conditional.
661 * sec_helper (cygsid::getfromstr): Reorganize to remove
662 calls to strcpy and strtok_r.
663 (cygsid::getfromgr): Change type to __uid32_t instead of int.
664 Keep only the allow_ntsec branch. Never call LookupAccountSid
665 which calls PDCs, simply return -1 in case of failure.
666 Use cygsid == instead of calling EqualSid and remove test
668 * security.h: Declare cygsid::getfromgr as __uid32_t.
670 2002-11-10 Corinna Vinschen <corinna@vinschen.de>
672 * net.cc: Run indent.
674 2002-11-10 Alexander Gottwald <Alexander.Gottwald@s1999.tu-chemnitz.de>
676 * autoload.cc (GetIfEntry): Add symbol.
677 * net.cc (get_2k_ifconf): Get the interface entries with the GetIfEntry
678 call intead of the GetIfTable call. Clean-up multiple IP address naming.
680 2002-11-09 Sergey Okhapkin <sos@prospect.com.ru>
682 * fhandler.h (class fhandler_pipe): New ioctl() method.
683 * pipe.cc (fhandler_pipe::ioctl): New.
685 2002-11-07 Christopher Faylor <cgf@redhat.com>
687 * fhandler_serial.cc (fhandler_serial::ioctl): Fix typo.
689 2002-11-07 Christopher January <chris@atomice.net>
691 * include/cygwin/fs.h: New file.
692 * include/cygwin/hdreg.h: New file.
693 * fhandler_floppy.cc (fhandler_floppy::ioctl): Add implementation for
694 HDIO_GETGEO, BLKGETSIZE, BLKGETSIZE64, BLKRRPART and BLKSSZGET ioctls.
696 2002-11-07 Gilles Courcoux <Gilles.Courcoux@col.bsf.alcatel.fr>
698 * fhandler_socket.cc (fhandler_socket::ioctl): Return correct flags
699 for loopback interface when name is given on input instead of address.
701 2002-11-07 Jason Tishler <jason@tishler.net>
703 * cygwin.din: Export fseeko() and ftello().
704 * include/cygwin/version.h: Bump API minor version.
706 2002-11-06 Christopher Faylor <cgf@redhat.com>
708 * fhandler_console.cc (keytable[]): Revert previous change. It would
709 break too many things.
711 2002-11-06 Christopher Faylor <cgf@redhat.com>
713 * fhandler_console.cc (keytable[]): Redefine F1 - F5 to something a
714 little more sensical.
716 2002-11-06 Sergey Okhapkin <sos@prospect.com.ru>
718 * syscalls.cc (getutid): Use UT_IDLEN where appropriate.
720 2002-11-06 Christopher Faylor <cgf@redhat.com>
722 * include/cygwin/version.h: Bump API minor number for below export.
724 2002-11-06 Sergey Okhapkin <sos@prospect.com.ru>
726 * cygwin.din (pututline): New exported function.
727 * syscalls.cc (login): Use pututiline().
728 (setutent): Open utmp as read/write.
729 (endutent): Check if utmp file is open.
730 (utmpname): call endutent() to close current utmp file.
731 (getutid): Enable all cases, use strncmp() to compare ut_id fields.
733 * tty.cc (create_tty_master): Set ut_pid to current pid.
735 2002-11-05 Christopher Faylor <cgf@redhat.com>
737 * fhandler_serial.cc (fhandler_serial::ioctl): Don't try to figure out
738 if OS has the capability to retrieve RTS/CTS. Just set default values
739 if DeviceIoControl fails. (suggested by Sergey Okhapkin)
741 2002-11-05 Sergey Okhapkin <sos@prospect.com.ru>
743 * fhandler_serial.cc (fhandler_serial::raw_read): Use correct type for
745 (fhandler_serial::ioctl): Set errno if the ClearCommError fails.
746 (fhandler_serial::tcsetattr): Use correct value for vmin_.
747 (fhandler_serial::tcgetattr): Ditto.
749 2002-11-05 Thomas Pfaff <tpfaff@gmx.net>
751 * fhandler_socket.cc (fhandler_socket::recvmsg): Call if from == NULL
752 WSARecvFrom with fromlen = NULL.
754 2002-11-04 Christopher Faylor <cgf@redhat.com>
756 * pinfo.cc (_pinfo::commune_send): Fix thinko in previous checkin.
758 2002-11-04 Christopher Faylor <cgf@redhat.com>
760 * pinfo.cc (_pinfo::commune_send): Set priority low when sleeping,
761 waiting for commune completion so that we don't spin waiting for lower
764 2002-11-04 Christopher Faylor <cgf@redhat.com>
766 * sigproc.cc (WAIT_SIG_PRIORITY): Bump to THREAD_PRIORITY_TIME_CRITICAL.
768 2002-11-04 Christopher Faylor <cgf@redhat.com>
770 * pinfo.cc (_pinfo::commune_send): Initialize buffer or suffer random
773 2002-11-04 Christopher Faylor <cgf@redhat.com>
775 * fhandler_process.cc (fhandler_process::fill_filebuf): Deal with error
776 condition from cmdline retrieval.
778 2002-11-04 Christopher Faylor <cgf@redhat.com>
780 * sigproc.cc (WAIT_SIG_PRIORITY): Bump to highest priority.
782 2002-11-04 Christopher Faylor <cgf@redhat.com>
784 * include/cygwin/version.h: Bump DLL minor number.
786 2002-11-03 Christopher Faylor <cgf@redhat.com>
788 * fhandler_serial.cc (fhandler_serial::ioctl): Reformat. Set errno
789 appropriately. Exit from the bottom. Correctly deal with third
790 argument for TCFLSH. (Suggested by Sergey Okhapkin)
792 2003-11-03 Sergey Okhapkin <sos@prospect.com.ru>
794 * fhandler_tty.cc (fhandler_tty_slave::ioctl): Do nothing if the new
795 window size is equal to the old one. Send SIGWINCH if slave connected
797 (fhandler_pty_master::ioctl): Do nothing if the new window size is
798 equal to the old one.
800 2002-10-31 Pierre Humblet <pierre.humblet@ieee.org>
802 * fhandler.cc (fhandler_base::open): Verify pc isn't NULL.
804 2002-10-30 Christopher Faylor <cgf@redhat.com>
806 * include/cygwin/version.h: Bump DLL minor number.
808 2002-10-30 Christopher Faylor <cgf@redhat.com>
810 * external.cc (cygwin_internal): Implement CW_CMDLINE.
811 * pinfo.h (SIGCOMMUNE): New signal type.
812 (commune_result): New structure for commune functions.
813 (picom): New enum for commune functions.
814 (_pinfo::hello_pid): New. Pid who's communicating with me.
815 (_pinfo::tothem): New. Handle of communicating pipe.
816 (_pinfo::fromthem): Ditto.
817 (_pinfo::commune_recv): Declare.
818 (_pinfo::commune_send): Declare.
819 (_pinfo::alive): Declare.
820 (_pinfo::cmdline): Declare.
821 (_pinfo::lock): Declare.
822 * pinfo.cc (set_myself): Initialize new _pinfo lock.
823 (_pinfo::alive): Define. Determines if process still exists.
824 (_pinfo::commune_recv): Define. Receive info from another cooperating process.
825 (_pinfo::commune_send): Define. Send info to another cooperating process.
826 (_pinfo::cmdline): Define. Determine command line of a given process.
827 * include/sys/cygwin.h (CW_CMDLINE): Define.
829 *sigproc.cc (talktome): Communicate with any processes who want to talk
831 (wait_sig): Honor __SIGCOMMUNE.
833 * fhandler.cc (fhandler_virtual::fixup_after_exec): Declare.
834 * fhandler_proc.cc: Use malloc/free/realloc throughout rather than
835 cmalloc since buffers don't need to be propagated to subprocesses.
836 * fhandler_registry.cc: Ditto.
837 * fhandler_virtual.cc: Ditto.
838 (fhandler_virtual::fixup_after_exec): Define.
839 * fhandler_process.cc: Ditto for malloc/free/realloc.
840 (process_listin): Add "cmdline".
841 (fhandler_process::fill_filebuf): Implement PROCESS_CMDLINE.
843 * miscfuncs.cc (isalpha_array): New array populated with xor values for
844 alpha characters to switch from one case to another.
845 * string.h (cygwin_strcasematch): New asm implementation of case match.
846 * string.h (cygwin_nstrcasematch): New asm implementation of counted
849 2002-10-24 Pierre Humblet <pierre.humblet@ieee.org>
851 * pwdgrp.h (pwdgrp_read::open): Compare fh to INVALID_HANDLE_VALUE.
853 2002-10-22 Christopher Faylor <cgf@redhat.com>
855 * fhandler_disk_file.cc (fhandler_disk_file::fstat_helper): Nevermind.
856 Revert everything to previous state wrt ntsec and exec bits.
858 2002-10-22 Christopher Faylor <cgf@redhat.com>
860 * shared.cc (shared_info::initialize): Use correct value for version
862 * include/cygwin/version.h (CYGWIN_VERSION_MAGIC): Use all of a DWORD
863 for magic calculation.
865 2002-10-22 Christopher Faylor <cgf@redhat.com>
867 * fhandler_disk_file.cc (fhandler_disk_file::fstat_helper): Oops. Only
868 do the executable thing for #! scripts since .exe files wouldn't be
869 executable in ntsec case regardless.
871 2002-10-22 Christopher Faylor <cgf@redhat.com>
873 * fhandler_disk_file.cc (fhandler_disk_file::fstat_helper): Always
874 consider .exe files and '#!' shell scripts to be executable.
876 2002-10-22 Christopher Faylor <cgf@redhat.com>
878 * cygthread.cc (cygthread::exiting): New variable.
879 (cygthread::initialized): Delete.
880 (cygthread::stub): Use exiting variable to determine when to exit.
881 (cygthread::runner): Delete.
882 (cygthread_protect): New variable.
883 (cygthread::init): Don't start runner thread. Initialize muto for list
885 (cygthread::freerange): Return pointer to cygthread.
886 (cygthread::operator new): Change logic to start threads on an
888 (cygthread::detach): Don't zero id.
889 (cygthread::terminate): Don't kill any executing threads. Just set
891 * cygthread.h (cygthread): Reflect above changes.
892 * dcrt0.cc (dll_crt0_1): Move cygthread initialization later.
894 * fork.cc (fork_child): Do fdtab fixup after dll fixup or (apparently)
895 winsock may allocate memory in dll load address.
897 2002-10-22 Pierre Humblet <pierre.humblet@ieee.org>
899 * sec_helper.cc (cygsid::get_id): If the sid matches a sid stored in
900 cygheap->user, return the uid or gid from myself.
901 * security.cc (alloc_sd): If gid == myself->gid, return the group sid
902 from cygheap->user. Remove the test for uid == original_uid, which is
905 2002-10-22 Christopher Faylor <cgf@redhat.com>
907 * cygheap.cc (cygheap_fixup_in_child): Use user_heap element in
909 (init_cheap): Ditto for declaration.
910 * fork.cc (fork_parent): Use user_heap element in cygheap.
911 * heap.h (inheap): Ditto.
912 * heap.cc (sbrk): Ditto.
913 (heap_init): Ditto. Reorganize to shrink heap chunk as required and
914 record new value in cygheap.
915 * dcrt0.cc (dll_crt0_1): More "move the cygthread init" games.
916 * shared.cc (open_shared): Rework memory protection to properly deal
917 with relocated shared segment.
918 (shared_info::heap_chunk_size): Rename element to 'heap_chunk'.
919 * shared_info.h (shared_info): Ditto for declaration.
920 * strace.cc (strace::hello): Report on heap chunk size from cygheap
923 2002-10-20 Christopher Faylor <cgf@redhat.com>
925 Change _function() to function() throughout.
926 * cygwin.din: Remove last vestiges (?) of newlib wrappers.
928 2002-10-20 Christopher Faylor <cgf@redhat.com>
930 * cygthread.cc (cygthread::detach): Always wait for event or suffer an
931 apparently inavoidable race.
932 * dcrt0.cc (dll_crt0_1): Allocate threads after stack has been
934 * debub.cc (lock_debug): Don't acquire lock on exit.
935 * fork.cc (fork_child): Recreate mmaps before doing anything else since
936 Windows has a habit of using blocks of memory in the child that could
937 previously have been occupied by shared memory in the parent.
938 * mmap.cc (fhandler_disk_file::fixup_mmap_after_fork): Issue error here
939 and provide some details about what went wrong.
940 (fixup_mmaps_after_fork): Remove error message.
941 * shared.cc (open_shared): Move warning message so that more detail is
943 * sigproc.cc (sigproc_init): Initialize sync_proc_subproc to avoid a
945 (sigproc_terminate): Specifically wait for process thread to terminate.
947 2002-10-20 Christopher Faylor <cgf@redhat.com>
949 * cygthread.cc (cygthread::stub): Fix typo.
950 (cygthread::terminate): Don't zero thread handle prior to using it.
952 2002-10-20 Christopher Faylor <cgf@redhat.com>
954 * sigproc.cc (wait_sig): Remove obsolete sigchld logic.
956 2002-10-20 Christopher Faylor <cgf@redhat.com>
958 Rename _kill() to kill() throughout. Rename _raise() to raise()
959 throughout. Rename _pid() to pid() throughout.
960 * Makefile.in: Compile some objects with -fomit-frame-pointer.
961 * cygwin.din: Reverse aliasing for _kill.
962 * syscalls.cc (_getpid_r): New function, implemented for newlib
965 * shared.cc (open_shared): Remove reserving of memory since previous
966 change eliminate the need for this hack.
968 2002-10-19 Christopher Faylor <cgf@redhat.com>
970 * fork.cc (fork_child): Move pinfo fixup later to attempt some minor
971 gains from concurrency with cythread::init.
973 2002-10-18 Christopher Faylor <cgf@redhat.com>
975 * dcrt0.cc (dll_crt0_1): Initialize cygwin threads here only when not
977 * fork.cc (fork_child): Initialize cygwin thread later in process to
978 avoid allocating memory for thread stacks.
979 * shared.cc (open_shared): Issue warning if NT and shared segment is
982 2002-10-18 Christopher Faylor <cgf@redhat.com>
984 * cygthread.cc: Bump number of cygthreads up to accommodate
985 applications which use ttys.
987 2002-10-18 Christopher Faylor <cgf@redhat.com>
989 * fork.cc (fork_child): Move mmap initialization.
990 * shared.cc (shared_info::heap_chunk_size): Store info as megabytes.
991 Search HKEY_LOCAL_MACHINE as well as HKEY_CURRENT_USER.
992 * shared_info.h (shared_info::initial_heap_size): Change element name
993 to reflect new functionality.
994 * strace.cc (strace::hello): Report on initial heap size.
996 2002-10-18 Thomas Pfaff <tpfaff@gmx.net>
998 * thread.cc (verifyable_object_isvalid): Test for a valid object
999 pointer before testing for static ptr.
1001 2002-10-17 Christopher Faylor <cgf@redhat.com>
1003 * dtable.cc (dtable::init_std_file_from_handle): Force "devices" to
1004 always be in binary mode. Temporary fix until ssh is rebuilt?
1006 2002-10-17 Christopher Faylor <cgf@redhat.com>
1008 * dtable.cc (dtable::set_file_pointers_for_exec): New function.
1009 * dtable.h (dtable::set_file_pointers_for_exec): Declare new function.
1010 * spawn.cc (spawn_guts): Call dtable::set_file_pointers_for_exec to set
1011 pointers to EOF when execing non-cygwin applications.
1013 2002-10-17 Robert Collins <rbtcollins@hotmail.com>
1015 * thread.h (pthread_mutex::isGoodInitializerOrBadObject): Declare.
1016 * thread.cc (pthread_mutex::isGoodInitializerOrBadObject): Implement.
1017 (pthread_mutex::init): Use isGoodInitializerOrBadObject to avoid
1018 unneeded SEGV's during debugging.
1020 2002-10-17 Thomas Pfaff <tpfaff@gmx.net>
1022 * thread.cc (verifyable_object_isvalid): Test for static object first.
1024 2002-10-16 Christopher Faylor <cgf@redhat.com>
1026 * fhandler_tty.cc (fhandler_tty_slave::read): Attempt #527 to properly
1027 implement VMIN/VTIME.
1029 2002-10-15 Christopher Faylor <cgf@redhat.com>
1031 * shared.cc (open_shared): Revert to "old" method for shared memory
1032 location if !wincap.needs_memory_protection.
1033 * wincap.cc: Implement needs_memory_protection throughout.
1036 2002-10-15 Christopher Faylor <cgf@redhat.com>
1038 * child_info.h (CURR_CHILD_INFO_MAGIC): Reset.
1039 (child_info_fork::mount_table): Remove.
1040 (child_info_fork::myself_addr): Remove.
1041 * fork.cc (fork_child): Don't set either of the above.
1042 * dcrt0.cc (dll_crt0_1): Call memory_init as early as possible.
1043 * fhandler_console.cc (console_state): Move to shared_info.h.
1044 (fhandler_console::get_tty_stuff): Reflect open_shared arg change.
1045 * pinfo.cc (myself_addr): Remove definition.
1046 (pinfo::init): Get myself address from open_shared.
1047 * pinfo.h (myself_addr): Remove declaration.
1048 * shared.cc (open_shared): Rework so that known shared memory locations
1049 are protected. Take shared memory type as fifth argument.
1050 (memory_init): Reflect open_shared arg change.
1051 * shared_info.h (shared_locations): New enum.
1052 (console_state): Move here.
1053 (open_shared): Reflect open_shared arg change in declaration.
1055 2002-10-14 Christopher Faylor <cgf@redhat.com>
1057 * child_info.h (CURR_CHILD_INFO_MAGIC): Reset.
1058 (child_info_fork::heaptop): Remove obsolete element.
1059 (child_info_fork::heabbase): Ditto.
1060 (child_info_fork::heapptr): Ditto.
1061 (child_info_fork::mount_table): New element.
1062 (child_info_fork::myself_addr): Ditto.
1063 * dcrt0.cc (dll_crt0_1): Set mount_table and myself_addr when forking.
1064 (initial_env): Add newline to "sleeping" message.
1065 * dll_init.cc (reserve_upto): Accommodate cygwin heap when freeing
1066 memory. Make debugging output a little more descriptive.
1067 * fork.cc (fork_parent): Save mount_table and myself_addr.
1068 * pinfo.cc (myself_addr): New variable.
1069 (set_myself): Pass PID_MYSELF flag to init.
1070 (pinfo::init): Honor PID_MYSELF. Save address where myself shared
1071 memory resides in myself_addr, for fork.
1072 * pinfo.h (myself_addr): Declare.
1073 * shared.cc (memory_init): On fork, use previously saved address for
1074 location of mount table.
1075 * include/sys/cygwin.h (PID_MYSELF): New value.
1077 * dtable.cc (dtable::stdio_init): Don't pass access type to
1078 init_std_file_from_handle. It's always the same.
1079 (dtable::init_std_file_from_handle): Remove access type argument.
1081 * dtable.h (dtable::init_std_file_from_handle): Ditto for declaration.
1083 * exceptions.cc (try_to_debug): Don't try to debug if already being
1086 * fhandler_console.cc (shared_console_info_save): New variable.
1087 (fhandler_console::get_tty_stuff): Save address of shared console stuff
1090 2002-10-13 Christopher Faylor <cgf@redhat.com>
1092 * cygthread.cc (cygthread::stub): Reintroduce clearing of __name but do
1093 it before SetEvent to eliminate a race.
1094 (cygthread::terminate): Accumulate list of threads to check for
1095 termination and call WaitForMultipleObjects on list rather than waiting
1096 for each thread individually.
1097 * sigproc.cc (subproc_init): Zap hwait_subproc thread handle since it
1100 2002-10-13 Christopher Faylor <cgf@redhat.com>
1102 * spawn.cc (spawn_guts): Fix so that cygthread::terminate is *really*
1103 called only for exec.
1105 2002-10-13 Christopher Faylor <cgf@redhat.com>
1107 * cygthread.cc (cygthread::stub): Don't zero __name here. That
1110 2002-10-13 Christopher Faylor <cgf@redhat.com>
1112 * include/cygwin/version.h: Bump DLL minor number.
1114 2002-10-13 Christopher Faylor <cgf@redhat.com>
1116 * cygthread.cc (cygthread::stub): Don't create event for long-running
1117 threads. Initialize thread_sync event here which is used to Suspend
1118 using an event rather than relying on SuspendThread/ResumeThread.
1119 (cygthread::init): Save handle to runner thread for future termination.
1120 (cygthread::cygthread): Only resume thread when it is actually
1121 suspended. Otherwise signal thread completion event.
1122 (cygthread::terminate): Forcibly terminate runner thread and any helper
1123 threads. Call DisableThreadLibrary calls if execing.
1124 * cygthread.h (cygthread::thread_sync): Declare.
1125 * dcrt0.cc (do_exit): Eliminate calls to obsolete window_terminate and
1127 * exceptions.cc (events_terminate): Don't bother closing title_mutex
1128 since it is going away anyway.
1129 * pinfo.cc (_pinfo::exit): Call cygthread::terminate to ensure that
1130 threads are shut down before process exit or otherwise strange races
1132 * shared.cc (shared_terminate): Eliminate.
1133 * shared.h (shared_terminate): Eliminate declaration.
1134 * winsup.h (window_terminate): Eliminate declaration.
1135 * spawn.cc (spawn_guts): Call cygthread::terminate early in process if
1136 execing. Call DisableThreadLibrary calls if execing.
1137 * window.cc (Winmain): Call ExitThread to force exit.
1138 (window_terminate): Eliminate.
1140 * dcrt0.cc (do_exit): Track exit state more closely.
1142 2002-10-10 Christopher Faylor <cgf@redhat.com>
1144 * window.cc (gethwnd): Use SetThreadPriority method.
1146 2002-10-10 Christopher Faylor <cgf@redhat.com>
1148 * Makefile.in (new-cygwin1.dll): Reorganize library order.
1150 * dcrt0.cc (do_exit): Move thread stuff after vfork stuff or threads
1151 are terminated during vfork.
1152 * sigproc.cc (proc_terminate): Grab proc lock prior to signalling
1153 subproc thread exit to avoid an extra "wait-for-thread-to-exit".
1155 2002-10-09 Christopher Faylor <cgf@redhat.com>
1157 * cygthread.cc (cygthread::stub): Don't create an event for "cygself"
1158 threads. Assume that they exit via an ExitThread call.
1159 * cygthread.h (cygthread::SetThreadPriority): New function.
1160 (cygthread::zap_h): New function.
1161 * dcrt0.cc (do_exit): Move cygthread::terminate earlier and establish
1163 * fhandler.h (fhandler_tty_master::output_thread): Delete.
1164 * fhandler_tty.cc (fhandler_tty_master::init): Set priority for threads
1165 via method. Zap handles when done. Don't treat process_output
1167 (process_output): Call ExitThread directly.
1168 (fhandler_tty_master::fixup_after_fork): Don't worry about
1170 (fhandler_tty_master::fixup_after_exec): Ditto.
1171 * sigproc.cc (proc_terminate): Don't detach from hwait_subproc. Just
1173 (sigproc_init): Close thread handle after initialization.
1174 (wait_sig): Use GetCurrentThread() as SetThreadPriority call rather
1175 than *event* handle. Call ExitThread directly on termination.
1176 (wait_subproc): Call ExitThread directly on termination.
1177 * tty.cc (tty_list::terminate): Don't attempt to detach from
1180 2002-10-08 Christopher Faylor <cgf@redhat.com>
1182 * cygheap.cc (dup_now): Make fatal error a little more informative.
1183 (cygheap_setup_for_child): Detect when default size of shared region is
1184 less than the current size and allocate that much.
1185 (_cbrk): Just return NULL on inability to allocate.
1187 * cygheap.h (CYGHEAPSIZE): Change size to reflect newer, tinier
1189 * spawn.cc (av::error): New element, reflects potential errno from cmalloc.
1190 (av::~av): Don't free NULL pointers.
1191 (av::replace0_maybe): Detect out-of-memory conditions.
1192 (av::dup_maybe): Ditto.
1193 (av::dup_all): Ditto.
1194 (av::unshift): Ditto.
1195 (spawn_guts): Set errno and return if argv creation ran into problems.
1197 * fhandler.h (fhandler_union): Change member names to something safer.
1199 * fhandler_console.cc (fhandler_console::get_tty_stuff): Always set
1200 fhandler_console::dev_state regardless of whether shared region is
1203 * cygthread.cc (cygthread::runner): Use ExitThread rather than return
1204 (planning for future).
1206 2002-10-08 Christopher Faylor <cgf@redhat.com>
1208 * fhandler.h (dev_console): New class.
1209 (fhandler_console::dev_state): New class element.
1210 (fhandler_console::mouse_aware): Use dev_state element.
1211 (fhandler_console::get_tty_stuff): Declare new function.
1212 * fhandler_console.cc: Use dev_state fhandler_console element,
1214 (fhandler_console::get_tty_stuff): Move to fhandler_console class.
1215 Incorporate dev_console information. Move constructor stuff here.
1217 2002-10-07 Christopher Faylor <cgf@redhat.com>
1219 * dtable.cc (dtable::init_std_file_from_handle): Try to mimic standard
1220 open behavior with files redirected from stdin/stdout/stderr, i.e.,
1221 fmode settings take precedence over mount settings.
1223 2002-10-07 Christopher Faylor <cgf@redhat.com>
1225 * dtable.cc (unknown_file): New variable.
1226 (dtable::init_std_file_from_handle): Don't set binmode if we couldn't
1227 determine the actual file name on stdin/stdout/stderr.
1228 (handle_to_fn): Return unknown_file when can't determine filename.
1230 2002-10-07 Christopher Faylor <cgf@redhat.com>
1232 * dcrt0.cc (do_exit): Call DisableThreadLibraryCalls since we don't
1233 need to track thread detaches.
1234 * init.cc (dll_entry): Reorganize slightly. Fix api_fatal message.
1236 2002-10-05 Christopher Faylor <cgf@redhat.com>
1238 * cygthread.cc (cygthread::stub): Very minor cleanup.
1239 (cygthread::stub): Report overflows in cygwin thread pool when
1240 DEBUGGING is on and special environment variable is not set.
1241 (cygthread::terminate): Set event only when event actually exists.
1242 * exceptions.cc (signal_exit): Set priority of main thread to low
1243 before setting current thread to high.
1245 2002-10-01 Robert Collins <rbtcollins@hotmail.com>
1247 * thread.cc (pthread_key::keys): Copy on fork. Add a comment explaining
1249 (pthreadNull::_instance): Copy on fork. Absolutely no state exists
1252 2002-09-30 Conrad Scott <conrad.scott@dsl.pipex.com>
1254 * cygserver_transport_pipes.cc (transport_layer_pipes::accept):
1255 Remove trailing \n from debug_printf.
1257 2002-09-30 Christopher Faylor <cgf@redhat.com>
1259 * thread.cc (pthread_mutex::initMutex): Remove \n from api_fatal.
1261 2002-09-30 Christopher Faylor <cgf@redhat.com>
1263 * thread.cc (pthread::precreate): Use explicit "no inherit" option when
1265 (pthread_mutex::nativeMutex::init): Ditto.
1267 2002-09-30 Christopher Faylor <cgf@redhat.com>
1269 * thread.cc (pthread_key::keys): Do not copy on fork.
1270 (pthread_mutex::mutexInitializationLock): Ditto.
1271 (pthreadNull::_instance): Ditto.
1273 2002-09-30 Christopher Faylor <cgf@redhat.com>
1275 * exceptions.cc (unused_sig_wrapper): Still need additional level of
1276 indirection when setting errno.
1278 2002-09-30 Robert Collins <rbtcollins@hotmail.com>
1280 * thread.cc (pthread_mutex::initMutex): Use the wrapper init call.
1281 (pthread_mutex::nativeMutex::init): Implement.
1282 (pthread_mutex::nativeMutex::lock): Ditto.
1283 (pthread_mutex::nativeMutex::unlock): Ditto.
1284 (pthread_mutex::init): Use the wrapper lock and unlockcalls.
1285 * thread.h (pthread_mutex): Move mutexInitializationLock into a
1286 nativeMutex wrapper class.
1288 2002-09-30 Christopher Faylor <cgf@redhat.com>
1290 Remove \n from calls to strace class printfs throughout.
1292 2002-09-30 Christopher Faylor <cgf@redhat.com>
1294 * exceptions.cc (unused_sig_wrapper): Accommodate newer compilers.
1296 2002-09-29 Christopher Faylor <cgf@redhat.com>
1298 * security.cc (allow_ntsec): Default to zero.
1299 * environ.cc (environ_init): Set allow_ntsec to TRUE by default,
1300 assuming OS allows it.
1302 2002-09-29 Christopher Faylor <cgf@redhat.com>
1304 * environ.cc (environ_init): Avoid a compiler warning.
1305 * path.cc (path_conv::check): Ditto.
1306 * path.h (path_conv::operator int): Ditto.
1307 * regex/engine.c: Ditto throughout.
1308 * regex/regcomp.c: Ditto throughout.
1309 * regex/regexec.c: Ditto throughout.
1311 2002-09-29 Christopher Faylor <cgf@redhat.com>
1313 * thread.cc: Use "%E" in *_printf throughout rather than calling
1314 GetLastError. GNUify comments.
1315 (__pthread_mutex_lock): Don't return error on EBUSY since that just
1316 means that the mutex has already been initialized.
1318 2002-09-30 Robert Collins <rbtcollins@hotmail.com>
1320 * pthread.cc (pthread_mutex_init): Use new pthread_mutex::init.
1321 * thread.cc: Change __pthread_mutex_init to pthread_mutex::init
1323 (MTinterface::Init): Initialise pthread_mutex support.
1324 (pthread_mutex::mutexInitializationLock): Instantiate.
1325 (pthread_mutex::initMutex): New method.
1326 (__pthread_cond_dowait): Don't dereference untrusted pointers.
1327 Use the new pthread_mutex::init method.
1328 (__pthread_condattr_init): Don't dereference untrusted pointers.
1329 (__pthread_mutex_init): Rename to pthread_mutex::init.
1330 Lock and release mutexInitializationLock to prevent races on
1331 mutex initialisation.
1332 * thread.h (pthread_mutex::initMutex): New method, initialise
1333 pthread_mutex supporting state on process initialisation.
1334 (pthread_mutex::init): Initialise a single mutex.
1335 (pthread_mutex::mutexInitializationLock): A win32 mutex for
1336 syncronising pthread mutex initialisation.
1337 (__pthread_mutex_init): Remove this.
1339 2002-09-28 Christopher Faylor <cgf@redhat.com>
1341 * thread.h (verifyable_object:~verifyable_object): Make virtual.
1343 2002-09-28 Christopher Faylor <cgf@redhat.com>
1345 * cygthread.h (cygthread::terminate): Declare new function.
1346 (cygthread::initialized): Change to 'int'.
1347 * cygthread.cc (cygthread::stub): Exit thread if initialized < 0.
1348 (cygthread::new): Ditto.
1349 (cygthread::runner): Ditto. Set initialized using xor to preserve
1351 (cygthread::terminate): New function.
1352 * dcrt0.cc (do_exit): Call cygthread::terminate.
1354 2002-09-27 Robert Collins <rbtcollins@hotmail.com>
1356 * thread.cc (pthread_key::run_destructor): Run_destructor is not
1357 const as it needs to set the key value.
1358 * thread.h (pthread_key::run_destructor): Ditto.
1360 2002-09-27 Robert Collins <rbtcollins@hotmail.com>
1362 * thread.cc (pthread_key::run_destructor): Follow opengroup algorithm.
1363 I.e. only run the destructor NON-NULL key values, and reset the key
1364 to NULL before running the destructor. Reported by Thomas Pfaff.
1366 2002-09-25 Christopher Faylor <cgf@redhat.com>
1368 * cygrun.c (main): Fix setting of CYGWIN environment variable.
1370 * Makefile.in: Remove linking of unnecessary libraries.
1372 2002-09-24 Christopher January <chris@atomice.net>
1374 * fhandler_proc.cc (format_process_stat): make ctty a real device
1376 (format_process_status): use effective uid/gid as real and saved
1379 2002-09-24 Corinna Vinschen <corinna@vinschen.de>
1381 * errno.cc (errmap): Map ERROR_INVALID_ADDRESS to new errno code
1383 (_sys_errlist): Add entries for EILSEQ and EOVERFLOW.
1385 * mmap.cc (map_map): Set errno in case of error.
1386 (mmap64): Remove setting errno explicitely to ENOMEM.
1388 2002-09-24 Corinna Vinschen <corinna@vinschen.de>
1390 * mmap.cc (map_map): Add debug output.
1391 (mmap64): Evaluate gran_len correctly even if offset isn't 0.
1393 2002-09-22 Christopher Faylor <cgf@redhat.com>
1395 More GNUify non-GNU formatted functions calls throughout.
1397 2002-09-22 Christopher Faylor <cgf@redhat.com>
1399 * Makefile.in (DLL_O_FILES): Restore formatting.
1401 2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com>
1403 GNUify non-GNU formatted functions calls throughout.
1405 2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com>
1407 * cygserver_shm.cc (with_strerr): Remove macro.
1408 (server_shmmgr::segment_t::~segment_t): Remove calls to with_strerr.
1409 (server_shmmgr::segment_t::attach): Ditto.
1410 (server_shmmgr::new_segment): Ditto.
1411 * shm.cc (with_strerr): Remove macro.
1412 (client_shmmgr::shmdt): Remove calls to with_strerr.
1413 (client_shmmgr::attach): Ditto.
1415 2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com>
1417 * include/sys/ipc.h: Move to "include/cygwin/ipc.h".
1418 * include/sys/msg.h: Move to "include/cygwin/msg.h".
1419 * include/sys/sem.h: Move to "include/cygwin/sem.h".
1420 * include/sys/shm.h: Move to "include/cygwin/shm.h".
1421 * include/cygwin/ipc.h: New file.
1422 * include/cygwin/msg.h: Ditto.
1423 * include/cygwin/sem.h: Ditto.
1424 * include/cygwin/shm.h: Ditto.
1425 * cygserver_shm.h: Update includes.
1429 2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com>
1431 * safe_memory.h (safe_delete): Make a templated function.
1432 * cygserver.cc (~server_request): Update use of safe_delete.
1434 * cygserver_client.cc (client_request::handle_request): Ditto.
1435 (client_request::make_request): Ditto.
1436 * cygserver_process.cc (~process_cleanup): Ditto.
1437 (process::remove): Ditto.
1438 (process::cleanup): Ditto.
1439 (process_cache::process): Ditto.
1440 * cygserver_shm.cc (server_shmmgr::segment_t::detach): Ditto.
1441 (server_shmmgr::delete_segment): Ditto.
1442 * shm.cc (client_shmmgr::shmdt): Ditto.
1443 * threaded_queue.cc (~threaded_queue): Ditto.
1444 (threaded_queue::worker_loop): Ditto.
1446 2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com>
1448 * safe_memory.h: Replace #include <new> with an explicit
1449 definition of the placement new operator.
1450 (safe_delete): Remove unnecessary ## operator.
1452 2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com>
1454 * cygserver_shm.cc (class server_shmmgr): Remove `cleanup_t'
1456 (cleanup_t::cleanup_t): Use the segment's shmid as the key rather
1457 than the segment pointer itself.
1458 (cleanup_t::segptr): Remove method.
1459 (cleanup_t::shmid): New method.
1460 (cleanup_t::cleanup): Update for new key value.
1461 (server_shmmgr::find (segment_t *)): Remove method.
1462 * include/cygwin/cygserver_process.h (cleanup_routine::key): Make
1465 2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com>
1467 * include/cygwin/cygserver_process.h
1468 (cleanup_routine::_key): New field.
1469 (cleanup_routine::cleanup_routine): Initialise new field with new
1471 (cleanup_routine::operator==): New method.
1472 (cleanup_routine::key): New method.
1473 (cleanup_routine::cleanup): Make argument non-const.
1474 (process::is_active): New method.
1475 (process::remove): Ditto.
1476 (process::check_exit_code): Rename method.
1477 * cygserver_process.cc (process::add): Reorganize code.
1478 (process::remove): New method.
1479 (process::check_exit_code): Rename method.
1480 (process::cleanup): Use new `process::is_active' method.
1481 (process_cache::process): Ditto.
1482 (process_cache::sync_wait_array): Ditto.
1483 (process_cache::check_and_remove_process): Ditto.
1484 * cygserver_shm.cc (server_shmmgr): Make `cleanup_t' a friend.
1485 (segment_t::detach): Make argument non-const. Remove cleanup
1486 object from client if appropriate.
1487 (cleanup_t::_segptr): Remove field.
1488 (cleanup_t::cleanup_t): Initialise parent explicitly. Remove
1490 (cleanup_t::segptr): New method.
1491 (cleanup_t::cleanup): Add error checking and reporting.
1492 (server_shmmgr::shmdt): Make argument non-const.
1493 (server_shmmgr::find (segment_t *)): New method.
1495 2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com>
1497 * cygserver.cc (client_request_shutdown::client_request_shutdown):
1498 Comment out verbose tracing statement.
1499 * cygserver_client.cc
1500 (client_request_get_version::client_request_get_version): Ditto.
1501 (client_request_attach_tty::client_request_attach_tty): Ditto.
1502 * cygserver_shm.cc (client_request_shm::client_request_shm):
1505 2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com>
1507 * cygserver_transport_pipes.cc (transport_layer_pipes::listen):
1508 Set `_is_listening_endpoint' appropriately.
1510 2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com>
1512 * include/cygwin/cygserver_transport.h
1513 (transport_layer_base::listen): Change return type.
1514 (transport_layer_base::connect): Ditto.
1515 * include/cygwin/cygserver_transport_pipes.h
1516 (transport_layer_pipes::listen): Change return type.
1517 (transport_layer_pipes::connect): Ditto.
1518 (transport_layer_pipes::_sec_none_nih): Remove unused field.
1519 (transport_layer_pipes::_is_listening_endpoint): New field.
1520 * cygserver_transport_pipes.cc: Synchronize with sockets code.
1521 (transport_layer_pipes::transport_layer_pipes): Initialise new
1522 field. Separate out asserts.
1523 (transport_layer_pipes::listen): Change return type. Add asserts.
1524 (transport_layer_pipes::accept): Add asserts.
1525 (transport_layer_pipes::read): Change conditional to an assert.
1527 (transport_layer_pipes::write): Ditto.
1528 (transport_layer_pipes::connect): Change return type. Change
1529 conditional to an assert. Add asserts. Rationalize error code
1531 (transport_layer_pipes::impersonate_client): Add asserts.
1532 * include/cygwin/cygserver_transport_sockets.h
1533 (transport_layer_sockets::listen): Change return type.
1534 (transport_layer_sockets::connect): Ditto.
1535 (transport_layer_sockets::_addr): Change type of field.
1536 (transport_layer_sockets::_addr_len): Ditto.
1537 (transport_layer_sockets::_is_accepted_endpoint): New field.
1538 (transport_layer_sockets::_is_listening_endpoint): Ditto.
1539 * cygserver_transport_sockets.cc
1540 (MAX_CONNECT_RETRY): New constant.
1541 (transport_layer_sockets::transport_layer_sockets): Initialise new
1542 fields. Only initialise the socket address where necessary.
1543 (transport_layer_sockets::listen): Change return type. Rewrite.
1544 (transport_layer_sockets::accept): Add asserts. Add tracing
1545 statements. Use a local variable to hold the accepted address.
1546 (transport_layer_sockets::close): Add tracing statements. Unlink
1547 the UNIX domain socket file as appropriate. Close the socket
1549 (transport_layer_sockets::read): Rewrite method.
1550 (transport_layer_sockets::write): Ditto.
1551 (transport_layer_sockets::connect): Change return type. Rewrite.
1552 * cygserver.cc (server_submission_loop::request_loop): Run the
1553 listening thread at high priority with special handling for
1555 (main): Print the request error code rather than errno in shutdown
1556 request code. Install signal handlers with sigaction(2) to avoid
1557 setting SA_RESTART. Check value of the listen method call, now it
1559 * cygserver_client.cc (client_request::make_request): Check new
1560 return value on connect method call.
1562 2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com>
1564 * include/cygwin/cygserver_transport_pipes.h
1565 (cygserver_transport_pipes::_sd): Rename field.
1566 (cygserver_transport_pipes::_sec_none_nih): Ditto.
1567 (cygserver_transport_pipes::_sec_all_nih): Ditto.
1568 (cygserver_transport_pipes::_pipe_name): Ditto.
1569 (cygserver_transport_pipes::_hPipe): Ditto.
1570 (cygserver_transport_pipes::_is_accepted_endpoint): Ditto.
1571 * cygserver_transport_pipes.cc
1572 (transport_layer_pipes::transport_layer_pipes): Rename fields.
1573 (transport_layer_pipes::init_security): Ditto.
1574 (transport_layer_pipes::listen): Ditto.
1575 (transport_layer_pipes::accept): Ditto.
1576 (transport_layer_pipes::close): Ditto.
1577 (transport_layer_pipes::read): Ditto.
1578 (transport_layer_pipes::write): Ditto.
1579 (transport_layer_pipes::connect): Ditto.
1580 (transport_layer_pipes::impersonate_client): Ditto.
1581 (transport_layer_pipes::revert_to_self): Ditto.
1582 * include/cygwin/cygserver_transport_sockets.h
1583 (cygserver_transport_sockets::_fd): Rename field.
1584 (cygserver_transport_sockets::_addr): Ditto.
1585 (cygserver_transport_sockets::_addr_len): Ditto.
1586 * cygserver_transport_sockets.cc
1587 (transport_layer_sockets::transport_layer_sockets): Rename fields.
1588 (transport_layer_sockets::listen): Ditto.
1589 (transport_layer_sockets::accept): Ditto.
1590 (transport_layer_sockets::close): Ditto.
1591 (transport_layer_sockets::read): Ditto.
1592 (transport_layer_sockets::write): Ditto.
1593 (transport_layer_sockets::connect): Ditto.
1595 2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com>
1597 * cygserver_shm.cc (with_strerr): Fix use of %p format.
1598 * shm.cc (client_shmmgr::shmat): Ditto.
1599 (client_shmmgr::shmctl): Ditto.
1600 (client_shmmgr::shmdt): Ditto.
1601 (client_shmmgr::attach): Ditto.
1603 2002-09-22 Christopher Faylor <cgf@redhat.com>
1605 * woutsup.h (system_printf): Remove extraneous semicolon from macro
1608 2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com>
1610 * cygserver_transport_pipes.cc
1611 (transport_layer_pipes::connect): Use ProtectHandle in DLL code.
1612 (transport_layer_pipes::close): Use ForceCloseHandle in DLL code.
1614 2002-09-22 Nicholas Wourms <nwourms@netscape.com>
1616 * threaded_queue.h (class queue_submission_loop): Correct friend
1617 declaration for GCC 3.1.1.
1618 * include/cygwin/cygserver_process.h (class process): Ditto.
1619 (class process_cache): Ditto.
1621 2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com>
1623 * cygserver_shm.cc (server_shmmgr::shmdt): Only call
1624 delete_segment if the segment exists [sic].
1626 2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com>
1628 * safe_memory.h: Include <new> rather than <new.h> for gcc 3.
1630 2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com>
1632 * safe_memory.h: New file extracted from "woutsup.h".
1633 * woutsup.h: Move the "safe" new/delete macros into the new
1634 "safe_memory.h" header file and include that here.
1635 * cygserver_client.cc: Explicitly include "safe_memory.h" for
1637 (client_request::make_request): Use the "safe" new/delete macros
1638 unconditionally, i.e. use them on the client side as well as on
1640 * cygserver_transport.cc: Explicitly include "safe_memory.h" for
1642 (create_server_transport): Use the "safe" new/delete macros
1643 unconditionally, i.e. use them on the client side as well as on
1645 * shm.cc: Include "safe_memory.h".
1646 (client_shmmgr::instance): Use the "safe" new/delete macros.
1647 (client_shmmgr::shmdt): Ditto.
1648 (client_shmmgr::new_segment): Ditto.
1650 2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com>
1652 * cygserver_process (process::process): Add the client's cygpid
1653 and winpid to all tracing statements as appropriate.
1654 (process::exit_code): Ditto.
1655 (process_cache::check_and_remove_process): Ditto.
1656 * cygserver_shm.cc (server_shmmgr::shmat): Ditto.
1657 (server_shmmgr::shmdt): Ditto.
1658 (server_shmmgr::shmctl): Add a process object argument and remove
1659 the explicit cygpid argument. Add the client's cygpid and winpid
1660 to all tracing statements as appropriate.
1661 (server_shmmgr::shmget): Ditto.
1662 (client_request_shm::serve): Update for the new signature of the
1663 shmctl and shmget methods.
1665 2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com>
1667 * cygserver.cc (client_request_shutdown::serve): Don't set the
1668 shutdown flag directly, but send a SIGINT, as the signal handler
1669 sets the flag and the signal breaks the pause(2) in the main loop.
1670 (print_usage): Add new options.
1671 (main): Add new --cleanup-threads and --request-threads options to
1672 set the number of threads used by the daemon. Use pause(2) rather
1673 the win32 Sleep in the main loop.
1674 * shm.cc (shmat): Add sigframe.
1679 2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com>
1681 * cygserver_shm.cc: Automatically detach processes from any
1682 segments they are attached to at exit.
1683 (class server_shmmgr::attach_t): New class.
1684 (server_shmmgr::segment_t::IS_DELETED): Rename and make private.
1685 (server_shmmgr::segment_t::_sequence): Make private.
1686 (server_shmmgr::segment_t::_flg): Ditto.
1687 (server_shmmgr::segment_t::_hFileMap): Ditto.
1688 (server_shmmgr::segment_t::_attach_head): New private field.
1689 (server_shmmgr::segment_t::segment_t): Initialise new fields.
1691 (server_shmmgr::segment_t::~segment_t): New method.
1692 (server_shmmgr::segment_t::is_deleted): Ditto.
1693 (server_shmmgr::segment_t::is_pending_delete): Ditto.
1694 (server_shmmgr::segment_t::mark_deleted): Ditto.
1695 (server_shmmgr::segment_t::attach): Ditto.
1696 (server_shmmgr::segment_t::detach): Ditto.
1697 (server_shmmgr::segment_t::find): Ditto.
1698 (class server_shmmgr::cleanup_t): New class.
1699 (server_shmmgr::_shm_atts): New private field.
1700 (server_shmmgr::shmat): Add a process object argument to replace
1701 the removed process_cache, cygpid and winpid arguments. Remove
1702 the process_cache manipulations. Move body of code to the
1703 segment_t::attach method. Increment _shm_atts when required.
1704 Update tracing statements.
1705 (server_shmmgr::shmdt): Add a process object argument to replace
1706 the removed cygpid argument. Move body of code to the
1707 segment_t::detach method. Decrement _shm_atts when required.
1708 Update tracing statements.
1709 (server_shmmgr::shmget): Use the new segment_t::is_deleted method.
1710 (server_shmmgr::server_shmmgr): Initialise the new _shm_atts
1712 (server_shmmgr::delete_segment): Remove the CloseHandle code, as
1713 this is now done in the segment_t destructor.
1714 (client_request_shm::serve): Look up the client's process object
1715 and pass to the server_shmmgr::shmat and server_shmmgr::shmdt
1716 methods rather than passing the cache, winpid and cygpid.
1717 * cygserver_process.h: Add a cygpid to the process object to make
1718 it more useful and then pass process objects rather than winpids
1720 (cleanup_routine::cleanup): Change argument to be a pointer to a
1722 (class process): Re-order fields for no discernible reason.
1723 (process::_cygpid): New field.
1724 (process::process): Add a cygpid argument.
1725 (process::winpid): New method.
1726 (process::cygpid): Ditto.
1727 (process::add): Make public, as it always should have been.
1728 (process_cache::process): Add a cygpid argument.
1729 * cygserver_process.cc (process::process): Add a cygpid argument
1730 and use it to initialise the `_cygpid' field. Re-order
1731 initialisers to match new field order.
1732 (process::cleanup): Pass `this' rather than just the winpid to
1733 cleanup_routine::cleanup.
1734 (process_cache::process): Add a cygpid argument and pass it to the
1735 process object constructor.
1736 * include/sys/shm.h (shmatt_t): Make unsigned as per SUSv3.
1737 (shm_info::shm_atts): New field.
1739 2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com>
1741 * cygserver_shm.cc (class server_shmmgr::segment_t): Add `_'
1742 prefix to the names of all fields.
1744 2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com>
1746 * msg.cc: New file of stub functions, no functionality.
1748 * shm.cc (client_shmmgr::shmctl): Add support for an out shm_info
1749 buffer for the SHM_INFO command.
1750 (client_shmmgr::shmget): Use %X to print keys.
1751 * include/sys/ipc.h: Comment all fields and values.
1752 (IPC_PRIVATE): Change to be non-negative.
1753 * include/sys/msg.h: New file with SUSv3 and ipcs(8) interfaces.
1754 * include/sys/sem.h: Ditto.
1755 * include/sys/shm.h: Comment all fields and values.
1756 (struct shm_info): New struct.
1757 * cygserver_shm.h (client_request_shm::shminfo): Rename.
1758 (client_request_shm::shm_info): New method.
1759 (client_request_shm::_parameters.out.hFileMap): Move into union.
1760 (client_request_shm::_parameters.out.shminfo): Rename.
1761 (client_request_shm::_parameters.out.shm_info): New field.
1762 * cygserver_shm.cc (server_shmmgr::_shm_ids): Rename.
1763 (server_shmmgr::_shm_tot): New field.
1764 (server_shmmgr::shmctl): Rename `out_shminfo' argument. Add
1765 `out_shm_info' argument. Fill in the `out_shm_info' argument in
1766 the SHM_INFO command.
1767 (server_shmmgr::shmget): Check `shmflg' against the mode of
1768 existing segments as per Stevens 1990, p. 123.
1769 (server_shmmgr::server_shmmgr): Initialise the new `_shm_tot'
1771 (server_shmmgr::new_segment): Set ENOMEM if CreateFileMapping
1772 fails. Pass `size' to new_segment.
1773 (server_shmmgr::new_segment): Add size argument and use it to
1774 check against and update the new `_shm_tot' field.
1775 (server_shmmgr::delete_segment): Update the new `_shm_tot' field.
1776 * Makefile.in (DLL_OFILES): Add new DLL object files.
1778 2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com>
1780 * cygserver_transport_pipes.cc: The main change is to make the
1781 client try harder to connect to the server if it's previously
1782 connected, and so has good grounds for believing that the server
1784 (MAX_WAIT_NAMED_PIPE_RETRY): Change to be an enumerator.
1785 (WAIT_NAMED_PIPE_TIMEOUT): Ditto.
1786 (transport_layer_pipes::accept): Use interlocked operators on
1788 (transport_layer_pipes::close): Rearrange so that FlushFileBuffers
1789 and DisconnectNamedPipe are only called for accepted endpoints.
1790 Use interlocked operators on `pipe_instance'.
1791 (transport_layer_pipes::read): Use set_errno where required.
1792 (transport_layer_pipes::write): Ditto.
1793 (transport_layer_pipes::connect): Add local static variable
1794 `assume_cygserver'. Set it if a connection is made to cygserver,
1795 clear it if a connection is not made even after retrying. If set,
1796 ignore all errors from CreateFile and retry the connection. Catch
1797 the situation where WaitNamedPipe fails to wait [sic] and add a
1798 `Sleep (0)' so that the server gets a chance to run.
1800 2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com>
1802 * dcrt0.cc: Only check for cygserver if and when required.
1803 (dll_crt0_1): Remove call to `cygserver_init ()'.
1804 * fhandler_tty.cc (fhandler_tty_slave::open): Change the cygserver
1805 logic to allow for the fact that `cygserver_init ()' may not yet
1807 (fhandler_tty_slave::cygserver_attach_tty): Tweak the cygserver
1808 request logic to conform to the practice elsewhere in the code.
1809 * tty.cc (tty::common_init): Add an explicit call to
1810 `cygserver_init ()' if it hasn't already been called.
1811 * include/cygwin/cygserver.h (CYGSERVER_UNAVAIL): Rename from
1813 (client_request_get_version::check_version): Make available in
1814 cygserver as well the DLL.
1815 (check_cygserver_available): Ditto. Remove `check_version_too'
1817 (cygserver_init): Ditto. And likewise.
1818 * cygserver_client.cc (client_request_get_version::check_version):
1819 Make available in cygserver as well the DLL.
1820 (client_request::make_request): This may now be called without
1821 `cygserver_init ()' having been called first. Detect this and
1822 call it as required. Add tracing.
1823 (check_cygserver_available): Make available in cygserver as well
1824 the DLL. Remove `check_version_too' argument and always check the
1825 version information. And since this is called from within
1826 `cygserver_init ()', force `cygserver_running' before calling
1827 `client_request::make_request ()'.
1828 (cygserver_init): Make available in cygserver as well the DLL.
1829 Remove `check_version_too' argument.
1831 2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com>
1833 * cygserver_shm.cc: Implement the ipcs(8) interfaces, IPC_INFO,
1834 SHM_STAT and SHM_INFO.
1835 (server_shmmgr::segment_t::sequence): New static field.
1836 (server_shmmgr::segment_t::key): Remove field, use the new
1837 ds.shm_perm.key field instead.
1838 (server_shmmgr::segment_t::shmid): Remove field.
1839 (server_shmmgr::segment_t::intid): New field.
1840 (server_shmmgr::segment_t::segment_t): Use the `key' argument to
1841 initialise `ds.shm_perm.key'. Change from using `shmid' to
1843 (server_shmmgr::_shmseg_cnt): Renamed from `_shmid_cnt'.
1844 (server_shmmgr::_intid_max): Renamed from `_shmid_max.
1845 (server_shmmgr::shmat): Move the out arguments to the start of the
1846 argument list. Rename the `pid' argument as `cygpid'. Add
1847 tracing. Pass an intid to `find ()', not a shmid.
1848 (server_shmmgr::shmctl): Add separate out arguments. Rename the
1849 `pid' argument as `cygpid'. Add support for the ipcs(8)
1850 interfaces. Add tracing. Pass an intid to `find ()', not a
1852 (server_shmmgr::shmdt): Rename the `pid' argument as `cygpid'.
1853 Add tracing. Pass an intid to `find ()', not a shmid.
1854 (server_shmmgr::shmget): Add a separate out arguments. Rename the
1855 `pid' argument as `cygpid'. Add tracing.
1856 (server_shmmgr::server_shmmgr): Update for new field names.
1857 (server_shmmgr::find_by_key): Update for the new `ds.shm_perm.key'
1859 (server_shmmgr::find): Update to use the new `segment_t::intid'
1861 (server_shmmgr::new_segment): Rename the `pid' argument as
1862 `cygpid'. Check that the requested size is within bounds. Handle
1863 new error result from `new_segment (key, HANDLE)'.
1864 (server_shmmgr::new_segment): Work with intids, not shmids. Check
1865 that the new intid is within bounds. Update for new field names.
1866 (server_shmmgr::delete_segment): Pass an intid to `find ()', not a
1867 shmid. Update for new field names.
1868 (client_request_shm::serve): Check that the incoming message
1869 length is the size of the `_parameters.in' struct, not of the
1870 whole in/out parameter union. Likewise, set the outgoing message
1871 length to the size of the `_parameters.out' struct. Update for
1872 the new server_shmmgr interfaces.
1873 * include/sys/ipc.h (ipc_perm::key): New field.
1874 * include/sys/shm.h (SHM_INFO): New constant.
1875 * cygserver_ipc.h (IPCMNI): New constant.
1876 (ipc_int2ext): Add `sequence' argument and munge this into the
1878 (ipc_ext2int_subsys): Unmunge the sequence number from the
1880 (ipc_ext2int): Ditto.
1881 (ipc_inc_id): Remove.
1882 (ipc_dec_id): Remove.
1883 * cygserver_shm.h (SHMMAX): New constant.
1888 (client_request_shm::_parameters): Re-arrange as a union of two
1889 separate structs, one for in arguments, the other for out.
1890 (client_request_shm::shmid): Update for the new parameter layout.
1891 (client_request_shm::ds): Ditto.
1892 (client_request_shm::info): New method.
1893 * shm.cc (client_shmmgr::_shmat_cnt): New static field.
1894 (client_shmmgr::shmat): Add locking. Add tracing.
1895 (client_shmmgr::shmctl): Update for ipcs(8) commands. Add
1896 tracing. Add more argument checking.
1897 (client_shmmgr::shmdt): Add locking. Add tracing. Update the new
1899 (client_shmmgr::shmget): Add tracing.
1900 (client_shmmgr::fixup_shms_after_fork): Add tracing. Add
1901 consistency checking.
1902 (client_shmmgr::attach): Add more tracing.
1903 (client_shmmgr::new_segment): Update the new `_shmat_cnt' field.
1904 (client_request_shm::client_request_shm): Update for the new
1905 parameter layout. Set the outgoing message length to the size of
1906 the `_parameters.in' struct, not of the whole in/out parameter
1909 2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com>
1911 * shm.cc: Remove the use of a static client_shmmgr object.
1912 (client_shmmgr::_instance): New static variable.
1913 (client_shmmgr::instance): Allocate a new shmmgr on the heap,
1914 rather than using a local static object.
1916 2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com>
1918 * cygserver_transport.cc (create_server_transport): Fix
1919 cut-and-paste error.
1921 2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com>
1923 * cygserver_client.cc (client_request::handle_request): Don't
1924 bother with the client request activity marker when compiled with
1927 2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com>
1929 * cygserver_transport_pipes.cc
1930 (MAX_WAIT_NAMED_PIPE_RETRY): New constant.
1931 (WAIT_NAMED_PIPE_TIMEOUT): Ditto.
1932 (transport_layer_pipes::close): The `pipe' field is now either
1933 NULL or a valid handle, and it should never have the value
1934 `INVALID_HANDLE_VALUE'.
1935 (transport_layer_pipes::read): Ditto.
1936 (transport_layer_pipes::write): Ditto.
1937 (transport_layer_pipes::connect): Ditto.
1938 (transport_layer_pipes::impersonate_client): Ditto.
1939 (transport_layer_pipes::connect): Ditto. New, but still bogus,
1942 2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com>
1944 * cygserver_shm.cc (server_shmmgr::server_shmmgr): All fields have
1945 to be initialized now that the singleton is no longer static.
1947 2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com>
1949 * cygserver_shm.cc (server_shmmgr::_instance): New static field.
1950 (server_shmmgr::_instance_once): Ditto.
1951 (server_shmmgr::initialise_instance): New static method.
1952 (server_shmmgr::instance): Use a pthread_once_t rather than
1953 relying on a local static variable.
1955 2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com>
1957 * woutsup.h: Remove all uses of the C++ new and delete operators
1958 throughout cygserver until they are fully thread-safe.
1959 (safe_new0): New macro to replace the C++ new operator.
1961 (safe_delete): New macro to replace the C++ delete operator.
1962 * cygserver_client.cc (client_request::handle_request): Replace
1963 all uses of the C++ new and delete operators with the new macros
1965 (client_request::make_request): Ditto.
1966 * cygserver_process.cc (~process_cleanup): Ditto.
1967 (process::cleanup): Ditto.
1968 (process_cache::process): Ditto.
1969 (process_cache::check_and_remove_process): Ditto.
1970 * cygserver_shm.cc (server_shmmgr::new_segment): Ditto.
1971 (server_shmmgr::delete_segment): Ditto.
1972 * cygserver_transport.cc (create_server_transport): Ditto.
1973 * cygserver_transport_pipes.cc
1974 (transport_layer_pipes::accept): Ditto.
1975 * cygserver_transport_sockets.cc
1976 (transport_layer_sockets::accept): Ditto.
1977 * threaded_queue.cc (~threaded_queue): Ditto.
1978 (threaded_queue::worker_loop): Ditto.
1979 (threaded_queue::stop): Replace sleep(3) with win32 Sleep.
1980 * cygserver.cc (~server_request): Replace all uses of the C++ new
1981 and delete operators with the new macros from "woutsup.h".
1982 (server_submission_loop::request_loop): Ditto.
1983 (main): Ditto. Replace sleep(3) with win32 Sleep. Replace
1984 iostreams with FILEs.
1985 (print_usage): Replace iostreams with FILEs.
1986 (print_version): Ditto.
1988 2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com>
1990 * cygserver_transport_sockets.cc
1991 (transport_layer_sockets::accept): Rename local variable
1992 `accept_fd' to avoid shadowing the `fd' field.
1994 2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com>
1996 * cygwin_ipc.h: Moved (back) to "include/sys/ipc.h".
1997 * cygwin_shm.h: Moved (back) to "include/sys/shm.h".
1998 * include/sys/ipc.h: New file.
1999 * include/sys/shm.h: New file.
2000 * cygserver_shm.h: Update for new header file locations.
2003 2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com>
2005 * cygserver_client.cc (client_request::make_request): Comment out
2006 a verbose tracing statement.
2007 * cygserver_process.cc (process_cache::sync_wait_array): Fix
2009 * include/cygwin/cygserver.h (class client_request): Remove excess
2010 use of `class' qualifier in declarations.
2011 (class client_request_get_version): Ditto.
2012 (class client_request_shutdown): Ditto.
2013 (class client_request_attach_tty): Ditto.
2015 2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com>
2017 * cygserver_ipc.h: New file.
2018 * cygserver_shm.h: Re-written from scratch.
2019 * cygserver_shm.cc: Ditto.
2022 2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com>
2024 * threaded_queue.h (class queue_request): Re-write.
2025 (threaded_queue_thread_function): Remove.
2026 (class queue_process_param): Remove.
2027 (class threaded_queue): Re-write.
2028 (class queue_submission_loop): New version of the old
2029 `queue_process_param' class.
2030 (TInterlockedExchangePointer): New templated function.
2031 (TInterlockedCompareExchangePointer): Ditto.
2032 * threaded_queue.cc (worker_function): Remove.
2033 (class threaded_queue): Re-write.
2034 (class queue_process_param): Remove.
2035 (class queue_submission_loop): New version of the old
2036 `queue_process_param' class.
2037 * include/cygwin/cygserver_process.h (process_cleanup): Re-write.
2038 (class process_process_param): Remove.
2039 (class cleanup_routine): Re-write.
2040 (class process): Re-write.
2041 (class process_cache): Re-write.
2042 * cygserver_process.cc (process_cleanup): Re-write.
2043 (class process_process_param): Remove.
2044 (class cleanup_routine): Re-write.
2045 (class process): Re-write.
2046 (class process_cache): Re-write.
2047 * cygserver.cc (request_count): Remove unused variable.
2048 (class server_request): Move methods inline.
2049 (class server_process_param): Remove.
2050 (class server_request_queue): Remove.
2051 (request_queue): Move into `main ()' and change type to
2053 (request_loop): Remove.
2054 (class server_submission_loop): New version of the old
2055 `server_process_param' class.
2056 (shutdown_server): New variable.
2057 (client_request_shutdown::serve): Set `shutdown_server' to trigger
2059 (handle_signal): Ditto.
2060 (main): Install signal handler for SIGINT rather than SIGQUIT.
2061 Use new interfaces for the `request_queue' and the `cache'.
2062 Create a `server_submission_loop' and add to the `request_queue'.
2063 Add check for the `shutdown_server' variable to the main loop.
2064 * cygserver_shm.cc (client_request_shm::serve): Release the
2065 process object after use.
2067 2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com>
2069 * cygserver_client.cc (client_request::handle_request): Correct
2071 * cygserver_transport_pipes.cc: Remove local definition of
2072 FILE_FLAG_FIRST_PIPE_INSTANCE constant.
2073 * cygwin_ipc.h: Update copyright notice.
2074 * cygwin_shm.h: Ditto.
2075 * woutsup.h: Add definition of _WIN32_WINNT.
2077 2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com>
2079 * cygserver_client (client_request::make_request): Replace my
2080 inappropriate use of set_errno () with error_code () throughout.
2082 2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com>
2084 * include/cygwin/cygserver.h: Add forward declarations of class
2085 transport_layer_base and class process_cache to reduce
2086 dependencies between header files.
2087 * include/cygwin/cygserver_process.h: Add include of
2089 * cygserver.cc: Remove unnecessary cygserver header files.
2090 * cygserver_client.cc: Ditto.
2091 * cygserver_process.cc: Ditto.
2092 * cygserver_shm.cc: Ditto.
2093 * cygserver_shm.h: Ditto.
2094 * cygserver_transport_pipes.cc: Ditto.
2096 * fhandler_tty.cc: Ditto.
2099 2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com>
2101 * cygserver_shm.h: Replace <sys/shm.h> with "cygwin_shm.h" after
2103 * cygwin_ipc.h: Update with changes to include/sys/ipc.h lost in
2105 * cygwin_shm.h: Ditto.
2107 2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com>
2109 * cygserver.cc: The tests for a duplicate server instance are now
2110 the responsibility of the transport layer.
2111 (request_loop): Use new `recoverable' flag in call to
2112 `cygserver_transport::accept ()' and shutdown on an unrecoverable
2114 (main): Never call `cygserver_init ()'. Fake `cygserver_running'
2115 just for sending a shutdown request.
2116 * cygserver_client.cc (client_request::send): Comment out
2117 message-size tracing statements as verbose.
2118 (client_request::handle): Ditto.
2119 (client_request_get_version::check_version): #ifdef as DLL-only.
2120 (check_cygserver_available): Ditto.
2121 (cygserver_init): Ditto.
2122 * include/cygwin/cygserver.h
2123 (client_request_get_version::check_version): #ifdef as DLL-only.
2124 (check_cygserver_available): Ditto.
2125 (cygserver_init): Ditto.
2126 * include/cygwin/cygserver_transport.h
2127 (transport_layer_base::impersonate_client): #ifdef as
2129 (transport_layer_base::revert_to_self): Ditto.
2130 (transport_layer_base::listen): Ditto.
2131 (transport_layer_base::accept): Ditto. Add a `recoverable' out
2132 flag for error handling.
2133 * include/cygwin/cygserver_transport_sockets.h: Ditto.
2134 * include/cygwin/cygserver_transport_pipes.h: Ditto.
2135 (transport_layer_pipes): Change type of the `pipe_name' field.
2136 Remove the `inited' field, as unnecessary. Add new
2137 `is_accepted_endpoint' field.
2138 * include/cygwin/cygserver_transport.cc
2139 (transport_layer_base::impersonate_client): #ifdef as
2141 (transport_layer_base::revert_to_self): Ditto.
2142 * include/cygwin/cygserver_transport_sockets.cc
2143 (transport_layer_sockets::listen): #ifdef as cygserver-only.
2144 (transport_layer_sockets::accept): #ifdef as cygserver-only.
2145 Analyse any errno from `accept ()' and set `recoverable' as
2147 * cygserver_transport_pipes.cc: Add local #define of
2148 `FILE_FLAG_FIRST_PIPE_INSTANCE'.
2149 (pipe_instance_lock_once): New variable.
2150 (pipe_instance_lock): Ditto.
2151 (pipe_instance): Ditto.
2152 (initialise_pipe_instance_lock): New function.
2153 (transport_layer_pipes::transport_layer_pipes): Change
2154 initialization of `pipe_name'. Initialize `is_accepted_endpoint'
2155 as appropriate. Remove use of `inited'.
2156 (transport_layer_pipes::impersonate_client): #ifdef as
2158 (transport_layer_pipes::revert_to_self): Ditto.
2159 (transport_layer_pipes::listen): Ditto.
2160 (transport_layer_pipes::accept): Ditto. Keep track of how often
2161 many named pipes have been created, in the `pipe_instance'
2162 variable, and pass the `FILE_FLAG_FIRST_PIPE_INSTANCE' flag on the
2163 open of the first instance. Analyse the error code from
2164 `CreateNamedPipe ()' and set the `recoverable' flag as
2166 (transport_layer_pipes::close): Update the `pipe_instance' count.
2168 2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com>
2170 * woutsup.h (cygserver_running): Add declaration.
2171 (api_fatal): Eliminate.
2172 * include/cygwin/cygserver.h
2173 (client_request_get_version::check_version): Change return type to
2175 (check_cygserver_available): New function.
2176 (cygserver_init): Add check_version_too argument.
2177 * cygserver_client.cc (allow_daemon): Make a bool.
2178 (client_request_get_version::make_request): See errno on error.
2179 Remove special case for CYGSERVER_REQUEST_GET_VERSION; this is now
2180 handled in cygserver_init().
2181 (client_request_get_version::check_version): Use syscall_printf()
2182 instead of api_fatal(). Return true if cygserver version is
2184 (check_cygserver_available): New function; code moved here from
2186 (cygserver_init): Move some code into check_cygserver_available().
2187 * cygserver.cc (__set_errno): Copy from debug.cc so that
2188 set_errno() can be used when __OUTSIDE_CYGWIN__.
2189 (main): Call cygserver_init() to set up cygserver_running and add
2190 checks against this to (try and) prevent multiple copies of
2191 cygserver running simultaneously. Remember to delete all
2192 transport connections so that (one day) the transport classes can
2193 tidy up on cygserver shutdown.
2195 2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com>
2197 * cygserver.cc (main): Adjust tracing output for a cleaner display
2198 when compiled without --enable-debugging.
2199 * threaded_queue.cc (threaded_queue::cleanup): Ditto.
2200 (queue_process_param::stop): Ditto.
2201 * include/cygwin/cygserver.h
2202 (client_request::make_request): Make non-virtual.
2203 (client_request::send): Make virtual and protected, not private.
2204 (client_request_attach_tty::send): New virtual method.
2205 * cygserver_client.cc: Use the `msglen()' accessor rather than
2206 `_header.msglen' throughout.
2207 (client_request_attach_tty::send): New method.
2208 (client_request::make_request): Remove the explicit close of
2209 `transport' as it is closed on deletion.
2211 2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com>
2213 * include/cygwin/cygserver.h: Change the client_request classes to
2214 give greater encapsulation and to allow variable length requests
2216 (enum cygserver_request_code): Now client_request::request_code_t.
2217 (class request_header): Now client_request::header_t. Make a
2218 union of the request_code and the error_code. The `cb' field,
2219 which was the buffer length, is now the `size_t msglen' field.
2220 (struct request_get_version): Now
2221 client_request_get_version::request_get_version.
2222 (struct request_shutdown): Remove unused type.
2223 (struct request_attach_tty): Now
2224 client_request_attach_tty::request_attach_tty.
2225 (client_request::_buf): Make field const.
2226 (client_request::_buflen): New const private field.
2227 (client_request::request_code): New accessor.
2228 (client_request::error_code): Ditto.
2229 (client_request::msglen): Ditto.
2230 (client_request::handle_request): New static method.
2231 (client_request::make_request): New virtual method.
2232 (client_request::handle): New method.
2233 (client_request::send): Make private.
2234 (client_request_get_version::check_version): New method.
2235 (client_request_get_version::serve): Make private.
2236 (client_request_get_version::version): Ditto.
2237 (client_request_shutdown::serve): Ditto.
2238 (client_request_attach_tty::req): Ditto.
2239 (client_request_attach_tty::serve): Ditto.
2240 (client_request_attach_tty::from_master): Make method const.
2241 (client_request_attach_tty::from_master): Ditto.
2242 * cygserver_client.cc
2243 (client_request_get_version::client_request_get_version): Track
2244 changes to the client_request classes.
2245 (client_request_attach_tty::client_request_attach_tty): Ditto.
2246 (client_request_get_version::check_version): New method to
2247 encapsulate code from cygserver_init().
2248 (client_request_shutdown::client_request_shutdown): Move into
2250 (client_request::send): Track changes to the client_request
2251 classes. Add more error checking.
2252 (client_request::handle_request): New static method containing the
2253 first half of the old server_request::process() code.
2254 (client_request::make_request): New method to replace the old
2255 cygserver_request() function.
2256 (client_request::handle): New method containing the second half of
2257 the old server_request::process() code.
2258 (cygserver_init): Track changes to the client_request classes. In
2259 particular, some code moved into the
2260 client_request_get_version::check_version() method.
2261 * cygserver.cc (client_request_attach_tty::serve): Track changes
2262 to the client_request classes. In particular, only return a reply
2263 body if some handles are successfully duplicated for the client.
2265 (client_request_get_version::serve): Track changes to the
2266 client_request classes.
2267 (client_request_shutdown::serve): Ditto.
2268 (class client_request_invalid): Dead, and so young too.
2269 (server_request::request_buffer): Remove unnecessary field.
2270 (client_request_shutdown::client_request_shutdown): Moved here
2271 from "cygserver_client.cc".
2272 (server_request::process): Implementation moved into the new
2273 client_request::handle_request() and client_request::handle()
2275 * cygserver_shm.h (class client_request_shm): Put client- and
2276 server-specific interfaces inside #ifdef/#ifndef __INSIDE_CYGWIN__
2278 (client_request_shm::serve): Make private.
2280 (client_request_shm::client_request_shm): Track changes to the
2281 client_request classes.
2282 (client_request_shm::serve): Ditto
2283 * shm.cc (client_request_shm::client_request_shm): Ditto. Use
2284 alloc_sd() rather than set_security_attribute() to get access to
2285 the SECURITY_DESCRIPTOR length, so that we can use it to set the
2286 request body length.
2287 (shmat): Track changes to the client_request classes. In
2288 particular, allocate client_request objects on the stack rather
2289 than on the heap, and use the client_request::make_request()
2290 method rather than the old cygserver_request() function.
2294 * fhandler_tty.cc (fhandler_tty_slave::cygserver_attach_tty): Ditto.
2296 2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com>
2298 * include/cygwin/cygserver_transport.h
2299 (cygserver_transport::read): Change buffer type to void *.
2300 (cygserver_transport::write): Ditto.
2301 * include/cygwin/cygserver_transport_sockets.h
2302 (cygserver_transport_sockets::read): Ditto.
2303 (cygserver_transport_sockets::write): Ditto.
2304 * include/cygwin/cygserver_transport_pipes.h
2305 (cygserver_transport_pipes::read): Ditto.
2306 (cygserver_transport_pipes::write): Ditto.
2307 * cygserver_transport_sockets.cc
2308 (cygserver_transport_sockets::read): Ditto.
2309 (cygserver_transport_sockets::write): Ditto.
2310 * cygserver_transport_pipes.cc
2311 (cygserver_transport_pipes::read): Ditto. Set errno on error, to
2312 match behaviour of cygserver_transport_sockets class.
2313 (cygserver_transport_pipes::write): Ditto.
2315 2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com>
2317 * cygserver.cc (version): New static variable.
2318 (server_request_queue::add_connection): Remove my gratuitous use
2320 (setup_privileges): Declare static.
2321 (handle_signal): Ditto.
2322 (longopts): Make a local variable of main().
2324 (print_usage): New function.
2325 (print_version): Ditto (tip of the hat to Joshua Daniel Franklin
2326 for inspiration here).
2327 (main): More argument checking. Add --help and --version options.
2329 2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com>
2331 * include/cygwin/cygserver.h (client_request::serve): Make pure
2333 * cygserver.cc (client_request::serve): Remove definition of pure
2335 (class client_request_invalid): New class.
2336 (server_request::process): Use new client_request_invalid
2337 class. And remove goto's.
2339 2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com>
2341 * cygserver.cc (class server_request): Add virtual destructor.
2342 (server_request_queue::addConnection): New method to replace bad
2343 virtual add() method.
2344 (request_loop): Replace call to queue->add() with call to
2345 queue->addConnection().
2346 (server_request::server_request): Use field initialization.
2347 (server_request::~server_request): New virtual destructor.
2348 (server_request::process): Remove close and delete of
2349 transport_layer_base object. It is deleted by the server_request's
2350 own destructor and closed by its own destructor.
2351 * include/cygwin/cygserver.h
2352 (client_request::operator request_header): Remove unused method.
2353 * cygserver_client.cc: Ditto.
2354 * include/cygwin/cygserver_process.h
2355 (class cleanup_routine): Add virtual destructor.
2356 (cleanup_routine::cleanup): Make pure virtual.
2357 (class process_cache): Make destructor non-virtual.
2358 (process_cache::add): Ditto.
2359 * cygserver_process.cc
2360 (cleanup_routine::~cleanup_routine): New virtual destructor.
2361 * include/cygwin/cygserver_transport.h
2362 (class transport_layer_base): Add virtual destructor.
2363 * cygserver_transport.cc
2364 (transport_layer_base::~transport_layer_base): New virtual
2366 * include/cygwin/cygserver_transport_pipes.h
2367 (class transport_layer_pipes): Add virtual destructor.
2368 * cygserver_transport_pipes.cc
2369 (transport_layer_pipes::~transport_layer_pipes): New virtual
2371 (transport_layer_pipes::close): Null out handle after closing.
2372 * include/cygwin/cygserver_transport_sockets.h
2373 (class transport_layer_sockets): Add virtual destructor.
2374 * cygserver_transport_sockets.cc
2375 (transport_layer_sockets::~transport_layer_sockets): New virtual
2377 (transport_layer_sockets::close): Null out fd after closing.
2378 * threaded_queue.h (class queue_request): Add virtual destructor.
2379 (queue_request::process): Make pure virtual.
2380 * threaded_queue.cc (~queue_request): New virtual destructor.
2381 (queue_request::process): Remove definition of pure virtual
2384 2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com>
2386 * include/cygwin/cygserver.h (client_request::send): Make
2388 (class client_request_attach_tty): Put client- and server-specific
2389 interfaces inside #ifdef/#ifndef __INSIDE_CYGWIN__ guards.
2390 * cygserver_client.cc: Ditto.
2391 (cygserver_init): Fix error handling.
2393 2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com>
2395 * cygserver.cc: Throughout the code, check and correct level of
2396 the XXX_printf() functions used. Comment out several of the
2397 debug_printf() calls with "// verbose:". Reformat and correct
2398 typos of some of the XXX_printf() formats.
2399 * cygserver_process.cc: Ditto.
2400 * cygserver_shm.cc: Ditto.
2401 * cygserver_transport_pipes.cc: Ditto.
2402 * cygserver_transport_sockets.cc: Ditto.
2403 * shm.cc (hi_ulong): New function to allow printing of a 64-bit
2404 key with current small_printf implementation.
2406 (client_request_shm::client_request_shm): Use hi_ulong() and
2407 lo_ulong() in call to debug_printf().
2409 2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com>
2411 * cygserver_shm.cc: Remove #define __INSIDE_CYGWIN__ from around
2412 <sys/shm.h> as it no longer contains any internal code.
2414 2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com>
2416 * include/sys/ipc.h (IPC_PRIVATE): Add cast to key_t.
2417 (IPC_INFO): New flag for ipcs(8).
2418 (IPC_RMID IPC_SET IPC_STAT): Renumber.
2419 * include/sys/shm.h (SHM_RDONLY SHM_RND): Renumber with distinct
2421 (class _shmattach): Internal type moved to "cygserver_shm.h".
2422 (class shmnode): Ditto.
2423 (class shmid_ds): Ditto.
2424 (struct shmid_ds): Add spare fields.
2425 (struct shminfo): New type for IPC_INFO interface.
2426 * cygserver_shm.h: Remove obsolete #if 0 ... #endif block.
2427 (class shm_cleanup): Remove unused class.
2428 (struct _shmattach): Internal type moved from <sys/shm.h>.
2429 (struct shmnode): Ditto.
2430 (struct int_shmid_ds): Ditto. Renamed to avoid name clash with
2431 public interface struct shmid_ds. Use the shmid_bs structure as a
2433 * cygserver_shm.cc: Remove obsolete #if 0 ... #endif block.
2434 (client_request_shm::serve): Update for redefinition of
2435 int_shmid_ds structure.
2436 * shm.cc (build_inprocess_shmds): Ditto.
2437 (fixup_shms_after_fork): Ditto.
2439 (shmget): Ditto. Remove obsolete #if 0 ... #endif code.
2441 2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com>
2443 * include/cygwin/cygserver_transport.h
2444 (transport_layer_base::transport_layer_base): Remove since it is
2446 (transport_layer_base::listen): Make a pure virtual method.
2447 (transport_layer_base::accept): Ditto.
2448 (transport_layer_base::close): Ditto.
2449 (transport_layer_base::read): Ditto.
2450 (transport_layer_base::write): Ditto.
2451 (transport_layer_base::connect): Ditto.
2452 * cygserver_transport.cc
2453 (transport_layer_base::transport_layer_base): Remove since it is
2455 (transport_layer_base::listen): Remove since it is now a pure
2457 (transport_layer_base::accept): Ditto.
2458 (transport_layer_base::close): Ditto.
2459 (transport_layer_base::read): Ditto.
2460 (transport_layer_base::write): Ditto.
2461 (transport_layer_base::connect): Ditto.
2463 2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com>
2465 * cygserver.cc (check_and_dup_handle): Only use security code if
2466 running on NT, i.e. if wincap.has_security().
2467 (client_request_attach_tty::serve): Add check for has_security().
2468 * cygserver_process.cc (process_cache::process): Use DWORD winpid
2469 throughout to avoid win32 vs. cygwin pid confusion.
2470 (process::process): Ditto.
2471 * cygserver_shm.cc (client_request_shm::serve): Only use security
2472 code if running on NT, i.e. if wincap.has_security().
2473 * cygserver_shm.h (client_request_shm::parameters.in): Replace the
2474 ambiguous pid field with cygpid and winpid fields.
2475 (client_request_shm::client_request_shm): Reduce to only two
2476 client-side constructors: one for SHM_CREATE, another for all the
2478 * shm.cc (client_request_shm::client_request_shm):
2479 Ditto. Initialize cygpid and winpid fields here. On NT initialize
2480 sd_buf here using set_security_attribute() to make use of the euid
2482 (shmat): Use new client_request_shm constructor.
2485 (shmget): Ditto. Remove security code, now performed in the
2486 relevant client_request_shm constructor.
2487 * include/cygwin/cygserver_process.h: (class cleanup_routine):
2488 Change winpid type to DWORD.
2489 (class process): Ditto.
2491 2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com>
2493 * woutsup.h: New file.
2494 * cygserver.cc: Use "woutsup.h" and new XXX_printf macros.
2495 (getfunc): New function, copied verbatim from "strace.cc".
2496 (__cygserver__printf): New function.
2497 * cygserver_client.cc: Use "woutsup.h" and new XXX_printf macros.
2498 * cygserver_process.cc: Ditto.
2499 * cygserver_shm.cc: Ditto.
2500 * cygserver_transport.cc: Ditto.
2501 * cygserver_transport_pipes.cc: Ditto.
2502 * cygserver_transport_sockets.cc: Ditto.
2503 * threaded_queue.cc: Ditto.
2504 * shm.cc: Remove trailing \n from XXX_printf format strings.
2505 * Makefile.in: Remove special __OUTSIDE_CYGWIN__ case for
2508 2002-09-21 Christopher Faylor <cgf@redhat.com>
2510 * init.cc (dll_entry): Temporarily disable thread detach code.
2512 2002-09-21 Christopher Faylor <cgf@redhat.com>
2514 * fhandler.cc (fhandler_base::dup): Don't set handle on failure.
2515 Caller has already taken care of that.
2516 * fhandler_console.cc (fhandler_console::open): Initialize handles to
2518 (fhandler_console::close): Ditto.
2520 2002-09-21 Christopher Faylor <cgf@redhat.com>
2522 GNUify non-GNU formatted functions calls throughout.
2524 2002-09-21 Conrad Scott <conrad.scott@dsl.pipex.com>
2526 * cygwin_ipc.h: Move to "include/cygwin/ipc.h".
2527 * cygwin_shm.h: Move to "include/cygwin/shm.h".
2528 * include/cygwin/ipc.h: New file.
2529 * include/cygwin/shm.h: New file.
2530 * ipc.c:c Update <cygwin/ipc.h> include.
2531 * cygserver_shm.cc: Update <cygwin/shm.h> include.
2534 2002-09-21 Robert Collins <rbtcollins@hotmail.com>
2536 * pthread.cc: Use class::call for converted pthread and semaphore
2538 * thread.cc: Convert various __pthread_call and __sem_call to
2539 pthread::call and sem::call throughout.
2540 * pthread.h (__pthread_cancel): Convert to pthread::cancel.
2541 (__pthread_join): Convert to pthread::join.
2542 (__pthread_detach): Convert to pthread::detach.
2543 (__pthread_create): Convert to pthread::create.
2544 (__pthread_once): Convert to pthread::once.
2545 (__pthread_atfork): Convert to pthread::atfork.
2546 (__pthread_suspend): Convert to pthread::suspend.
2547 (__pthread_continue): Convert to pthread::resume.
2548 (__sem_init): Convert to semaphore::init.
2549 (__sem_destroy): Convert to semaphore::destroy.
2550 (__sem_wait): Convert to semaphore::wait.
2551 (__sem_trywait): Convert to semaphore::trywait.
2552 (__sem_post): Convert to semaphore::post.
2554 2002-09-21 Robert Collins <rbtcollins@hotmail.com>
2556 * thread.cc: Finish the removal of the separate pthread_key
2558 Remove all pthread_key_destructor and pthread_key_destructor_list
2559 references throughout.
2560 (pthread::exit): Call the new pthread_key interface to activate
2562 (pthread_key::keys): Change into a list.
2563 (pthread_key::saveAKey): New method, used via forEach.
2564 (pthread_key::restoreAKey): Ditto.
2565 (pthread_key::destroyAKey): Ditto.
2566 (pthread_key::fixup_before_fork): Use the List::forEach functionality.
2567 (pthread_key::fixup_after_fork): Ditto.
2568 (pthread_key::runAllDestructors): New method implementation.
2569 (pthread_key::pthread_key): Use List::Insert rather than custom list
2571 (pthread_key::~pthread_key): Use List::Remove for the same reason.
2572 * thread.h: Remove all pthread_key_destructor and
2573 pthread_key_destructor_list references throughout.
2574 (List): Move the interface above pthread_key in the header.
2575 Use atomic operations during insert and delete.
2576 (List::forEach): A generic interface for doing something on each node.
2577 (pthread_key::runAllDestructors): New method, run all destructors.
2578 (pthread_key::fork_buf): Make private.
2579 (pthread_key::run_destructor): Ditto.
2580 (pthread_key::saveAKey): New method for clearer source.
2581 (pthread_key::restoreAKey): Ditto.
2582 (pthread_key::destroyAKey): Ditto.
2583 (MTinterface::destructors): Remove.
2585 2002-09-21 Robert Collins <rbtcollins@hotmail.com>
2587 * thread.cc: Partial refactoring of pthread_key destructor
2588 handling. Loosely based on Thomas Pfaff's work.
2589 (pthread_key_destructor_list::Insert): Remove.
2590 (pthread_key_destructor_list::Pop): Remove.
2591 (pthread_key_destructor_list::IterateNull): Call the key's
2592 run_destructor method.
2593 (pthread_key::pthread_key): Initialize new member.
2594 (pthread_key::get): Mark as const for correctness.
2595 (pthread_key::run_destructor): Implement.
2596 * thread.h (pthread_key::get): Mark as const for correctness.
2597 (pthread_key::run_destructor): Declare.
2598 (List): New template class that implements a generic list.
2599 (pthread_key_destructor_list): Inherit from List, and remove
2600 now duplicate functions.
2602 2002-09-21 Robert Collins <rbtcollins@hotmail.com>
2604 * thread.cc: Change verifyable_object_isvalid calls with
2605 PTHREAD_CONDATTR_MAGIC, PTHREAD_MUTEXATTR_MAGIC, PTHREAD_COND_MAGIC,
2606 SEM_MAGIC to objecttype::isGoodObject() calls throughout.
2607 (pthread_condattr::isGoodObject): Implement.
2608 (pthread_mutex::isGoodInitializer): Implement.
2609 (pthread_mutex::isGoodInitializerOrObject): Minor bugfix in the
2610 check for verifyable_object_isvalid result.
2611 (pthread_mutexattr::isGoodObject): Implement.
2612 (pthread_cond::isGoodObject): Ditto.
2613 (pthread_cond::isGoodInitializer): Ditto.
2614 (pthread_cond::isGoodInitializerOrObject): Ditto.
2615 (semaphore::isGoodObject): Ditto.
2616 * thread.h (pthread_mutex::isGoodInitializer): Declare.
2617 (pthread_condattr::isGoodObject): Ditto.
2618 (pthread_cond::isGoodObject): Const correctness.
2619 (pthread_cond::isGoodInitializer): Declare.
2620 (pthread_cond::isGoodInitializerOrObject): Ditto.
2621 (semaphore::isGoodObject): Const correctness.
2623 2002-09-21 Robert Collins <rbtcollins@hotmail.com>
2625 * thread.cc: Change verifyable_object_isvalid calls with
2626 PTHREAD_MUTEX_MAGIC and PTHREAD_KEY_MAGIC and PTHREAD_ATTR_MAGIC to
2627 ::isGoodObject() calls throughout.
2628 (MTinterface::Init): Remove dead code.
2629 (pthread_attr::isGoodObject): Implement.
2630 (pthread_key::isGoodObject): Implement.
2631 (pthread_mutex::isGoodObject): Implement.
2632 (pthread_mutex::isGoodInitializerOrObject): Implement.
2633 (pthread::isGoodObject): Update signature.
2634 * thread.h (pthread_key::isGoodObject): Declare.
2635 (pthread_attr::isGoodObject): Ditto.
2636 (pthread_mutex::isGoodObject): Ditto.
2637 (pthread_mutex::isGoodInitializerOrObject): Ditto.
2638 (pthread::isGoodObject): Change to a const parameter for const
2640 (pthread_mutexattr::isGoodObject): Declare.
2641 (pthread_condattr::isGoodObject): Ditto.
2642 (pthread_cond::isGoodObject): Ditto.
2643 (semaphore::isGoodObject): Ditto.
2645 2002-09-19 Christopher Faylor <cgf@redhat.com>
2647 Cleanup calls to CreateFile throughout.
2648 * dcrt0.cc (__api_fatal): Correctly check for failing return from CreateFile.
2649 * assert.cc (__assert): Don't check return value from CreateFile for NULL.
2650 * fhandler_console.cc (set_console_state_for_spawn): Ditto.
2651 * fork.cc (fork_parent): Ditto.
2653 2002-09-18 Christopher Faylor <cgf@redhat.com>
2655 * cygthread.cc (cygthread::initialized): Avoid copying on fork or some
2656 threads may not end up in the pool.
2657 (cygthread::new): Avoid race when checking for initialized. Add
2660 2002-09-18 Pierre Humblet <pierre.humblet@ieee.org>
2662 * fhandler.cc (fhandler_base::raw_read): Add case for
2663 ERROR_INVALID_HANDLE due to Win95 directories.
2664 (fhandler_base::open): Handle errors due to Win95 directories.
2665 (fhandler_base::close): Add get_nohandle () test.
2666 (fhandler_base::set_close_on_exec): Ditto.
2667 (fhandler_base::fork_fixup): Ditto.
2668 (fhandler_base::lock): Change error code to Posix EINVAL.
2669 (fhandler_base::dup): If get_nohandle (), set new value to
2670 INVALID_HANDLE_VALUE instead of NULL.
2671 * fhandler_disk_file.cc (fhandler_disk_file::fstat): Call fstat_by_name
2672 if get_nohandle (). Remove extraneous element from strpbrk.
2673 (fhandler_disk_file::open): Remove test for Win95 directory.
2675 * fhandler_random.cc (fhandler_dev_random::open): Add set_nohandle ().
2676 * fhandler_clipboard.cc (fhandler_dev_clipboard::open): Ditto.
2677 * fhandler_zero.cc (fhandler_dev_zero::open): Ditto.
2678 (fhandler_dev_zero::close): Delete.
2679 * fhandler.h (class fhandler_dev_zero): Ditto.
2681 2002-09-17 Robert Collins <rbtcollins@hotmail.com>
2683 * thread.cc (pthread_key::set): Preserve GetLastError(). Reported
2686 2002-09-17 Robert Collins <rbtcollins@hotmail.com>
2688 This work inspires by Thomas Pfaff's pthread_fork patch (1).
2689 * fork.cc (fork_child): Remove MTinterface fixup call, it's
2690 adsorbed by pthread::atforkchild.
2691 Rename __pthread_atforkchild to pthread::atforkchild to give
2692 access to private members.
2693 (fork_parent): Rename __pthread_atforkparent to
2694 pthread::atforkparent to give it access to private members.
2695 Ditto for __pthread_atforkprepare.
2696 * thread.cc: Fix some formatting problems throughout.
2697 (MTinterface::fixup_before_fork): Implement.
2698 (MTinterface::fixup_after_fork): Fix pthread_keys.
2699 (pthread_key::keys): Implement.
2700 (pthread_key::fixup_before_fork): Ditto.
2701 (pthread_key::fixup_after_fork): Ditto.
2702 (pthread_key::pthread_key): Add to pthread_key::keys.
2703 (pthread_key::~pthread_key): Remove from pthread_key::keys.
2704 (pthread_key::saveKeyToBuffer): Implement.
2705 (pthread_key::recreateKeyFromBuffer): Ditto.
2706 (pthread::atforkprepare): Prepare all MT classes for fork.
2707 (pthread::atforkchild): And fix them up afterwards.
2708 * thread.h (pthread_key): Buffer the key value during
2710 List the keys needing to be fixed up in a linked list with
2711 head pthread_key::keys.
2712 (pthread): Move atfork cygwin internal calls into the class.
2713 (MTInterface): Provide a fixup_before_fork for objecst that
2715 (__pthread_atforkprepare): Remove.
2716 (__pthread_atforkparent): Remove.
2717 (__pthread_atforkchild): Remove.
2719 2002-09-16 Christopher Faylor <cgf@redhat.com>
2721 * init.cc: Cleanup slightly and remove obsolete code.
2723 2002-09-11 Robert Collins <rbtcollins@hotmail.com>
2725 * init.cc (dll_entry): On thread detach, if the thread hasn't
2727 * pthread.cc (pthread_getsequence_np): Remove the
2728 __pthread_getsequence_np wrapper. This requires errno.h.
2729 * thread.cc (pthread::self): Instantiate a new pthread object
2730 when called and none exists. return a NULL object if instantiation
2732 (pthread::precreate): Factor out common code.
2733 (pthread::postcreate): Ditto.
2734 (pthread::create): Ditto.
2735 (pthread::exit): Remove the TLS value when we exit to prevent
2737 (MTinterface::Init): Bugfix - don't mark the TLS index as created
2738 if one was not allocated.
2739 Apply Extract Method to move pthread specific initialisation into
2741 (pthread::initMainThread): Extracted method from MTinterface::Init.
2742 (pthread::setTlsSelfPointer): Extracted method from various pthread
2743 calls, to make reading those functions easier.
2744 (pthread::setThreadIdtoCurrent): Ditto.
2745 (pthread::cancel_self): Bring into the .cc file, it's only used
2747 (pthread::getThreadId): Ditto.
2748 (pthread::thread_init_wrapper): Apply Extract Method to the TLS
2750 (pthread::isGoodObject): Extracted method from various pthread
2751 wrapper calls, for clarity of reading.
2752 (pthread::getsequence_np): Converted from __pthread_getsquence_np.
2753 (__pthread_create): Apply Extract Method to the object validation.
2754 (__pthread_cancel): Ditto.
2755 (__pthread_join): Ditto.
2756 (__pthread_detach): Ditto.
2757 (__pthread_suspend): Ditto.
2758 (__pthread_continue): Ditto.
2759 (__pthread_getschedparam): Ditto.
2760 (__pthread_getsequence_np): Remove.
2761 (__pthread_setschedparam): Apply Extract Method to the object
2763 (pthreadNull::getNullpthread): New method, return the pthreadNull
2765 (pthreadNull::pthreadNull): Private constructor to prevent accidental
2767 (pthreadNull::~pthreadNull): Prevent compile warnings.
2768 (pthreadNull::create): Override pthread behaviour.
2769 (pthreadNull::exit): Ditto.
2770 (pthreadNull::cancel): Ditto.
2771 (pthreadNull::testcancel): Ditto.
2772 (pthreadNull::setcancelstate): Ditto.
2773 (pthreadNull::setcanceltype): Ditto.
2774 (pthreadNull::push_cleanup_handler): Ditto.
2775 (pthreadNull::pop_cleanup_handler): Ditto.
2776 (pthreadNull::getsequence_np): Ditto.
2777 (pthreadNull::_instance): Ditto.
2778 * thread.h (pthread): Declare pre- and post-create.
2779 Move GetThreadId to private scope and rename to getThreadId.
2780 Move setThreadIdtoCurrent to private scope.
2781 Make create virtual.
2782 Make ~pthread virtual.
2783 Declare initMainThread.
2784 Declare isGoodObject.
2786 Make cancel virtual.
2787 Make testcancel virtual.
2788 Make setcancelstate virtual.
2789 Make setcanceltype virtual.
2790 Make push_cleanup_handler virtual.
2791 Make pop_cleanup_handler virtual.
2792 Declare getsequence_np.
2793 Declare setTlsSelfPointer.
2794 (pthreadNull): New null object class for pthread.
2795 (__pthread_getsequence_np): Remove.
2797 2002-09-13 Corinna Vinschen <corinna@vinschen.de>
2799 * syscalls.cc (seteuid32): Treat ILLEGAL_UID invalid.
2800 (setegid32): Treat ILLEGAL_GID invalid.
2802 2002-09-10 Pierre Humblet <pierre.humblet@ieee.org>
2804 * grp.cc (initgroups): Call groups::clear_supp to free the
2805 supplementary group sids that may have been set by setgroups.
2806 * security.cc (cygsidlist::free_sids): Also zero the class members.
2807 * security.h (groups::clear_supp): New.
2808 Rename cygsidlist_unknown to cygsidlist_empty.
2810 2002-09-08 Christopher Faylor <cgf@redhat.com>
2812 * fhandler_tty.cc (fhandler_tty_slave::open): Don't protect
2813 input/output handles since they are not properly manipulated later.
2814 * tty.cc (tty::make_pipes): Ditto.
2816 2002-09-06 Christopher Faylor <cgf@redhat.com>
2818 * winsup.h (_WIN32_WINNT): Protect.
2820 2002-09-06 Christopher Faylor <cgf@redhat.com>
2822 * winsup.h (_WIN32_WINNT): Define.
2824 2002-09-03 Corinna Vinschen <corinna@vinschen.de>
2826 * Makefile.in (DLL_OFILES): Drop shortcut.o.
2827 * path.cc: Move all shortcut functions from shortcut.c to here.
2828 (check_shortcut): Implement without using COM interface.
2829 * path.h: Move definition of SHORTCUT_HDR_SIZE to here.
2830 * shortcut.c: Remove.
2831 * shortcut.h: Ditto.
2833 2002-09-03 Conrad Scott <conrad.scott@dsl.pipex.com>
2835 * fhandler.h (fhandler_socket::read): Remove method.
2836 (fhandler_socket::write): Ditto.
2837 (fhandler_socket::readv): New method.
2838 (fhandler_socket::writev): Ditto.
2839 (fhandler_socket::recvmsg): Add new optional argument.
2840 (fhandler_socket::sendmsg): Ditto.
2841 * fhandler.cc (fhandler_socket::read): Remove method.
2842 (fhandler_socket::write): Ditto.
2843 (fhandler_socket::readv): New method.
2844 (fhandler_socket::writev): Ditto.
2845 (fhandler_socket::recvmsg): Use win32's scatter/gather IO where
2847 (fhandler_socket::sendmsg): Ditto.
2848 * net.cc (cygwin_recvmsg): Check the msghdr's iovec fields.
2849 (cygwin_sendmsg): Ditto. Add omitted sigframe.
2851 2002-09-02 Kazuhiro Fujieda <fujieda@jaist.ac.jp>
2853 * cygwin.din: Revert exporting new wchar functions.
2854 * include/cygwin/version.h: Change comment for API minor 62.
2856 2002-09-02 Christopher Faylor <cgf@redhat.com>
2858 * dcrt0.cc (dll_crt0_1): Remove getpagesize() call.
2859 * shared.cc (memory_init): Move it here.
2861 2002-08-31 Christopher January <chris@atomice.net>
2863 * fhandler_proc.cc: Add <sys/param.h> include.
2864 (format_proc_uptime): Use KernelTime and UserTime only as they include
2866 (format_proc_stat): KernelTime includes IdleTime, so subtract IdleTime
2867 from KernelTime. Make number of 'jiffies' per second same as HZ define.
2868 * fhandler_process.cc: Add <sys/param.h> include.
2869 (format_process_stat): Make number of 'jiffies' per second same as
2870 HZ define. Use KernelTime and UserTime only to calculate start_time.
2872 2002-08-30 Christopher Faylor <cgf@redhat.com>
2874 (inspired by a patch from Egor Duda)
2875 * select.cc (fhandler_tty_slave::ready_for_read): Remove.
2876 * fhandler.h (fhandler_tty_slave::ready_for_read): Remove declaration.
2877 * fhandler_tty.cc (fhandler_tty_slave::fhandler_tty_slave): Set "don't
2878 need ready for read" flag.
2879 (fhandler_tty_slave::read): Don't do anything special with vtime when
2882 2002-08-30 Egor Duda <deo@logos-m.ru>
2884 * autoload.cc (GetConsoleWindow): Correct parameter count.
2886 2002-08-30 Christopher January <chris@atomice.net>
2887 Christopher Faylor <cgf@redhat.com>
2889 * tty.cc (tty_list::allocate_tty): Use GetConsoleWindow, if available.
2890 Call FindWindow in a loop.
2891 * autoload.cc (GetConsoleWindow): Export
2893 2002-08-30 Christopher Faylor <cgf@redhat.com>
2895 * miscfuncs.cc (check_iovec_for_read): Don't check buffer when zero
2897 (check_iovec_for_write): Ditto.
2899 2002-08-27 Conrad Scott <conrad.scott@dsl.pipex.com>
2901 * fhandler.h (fhandler_base::readv): New method.
2902 (fhandler_base::writev): Ditto.
2903 * fhandler.cc (fhandler_base::readv): New method.
2904 (fhandler_base::writev): Ditto.
2905 * syscalls.cc (_read): Delegate to readv(2).
2906 (_write): Ditto, mutatis mutandi.
2907 (readv): Rewrite, based on the old _read code, to use the new
2908 fhandler_base::readv method. Improve access mode handling and ensure
2909 all calls reach the final strace statement.
2910 (writev): Ditto, mutatis mutandi.
2911 * include/sys/uio.h (struct iovec): Change field types to match SUSv3.
2912 * winsup.h (check_iovec_for_read): New function.
2913 (check_iovec_for_write): Ditto.
2914 * miscfuncs.cc (check_iovec_for_read): Ditto.
2915 (check_iovec_for_write): Ditto.
2917 2002-08-30 Corinna Vinschen <corinna@vinschen.de>
2919 * cygwin.din: Add more prototypes for new wchar functions in newlib.
2921 2002-08-30 Corinna Vinschen <corinna@vinschen.de>
2923 * cygwin.din: Add prototypes for new wchar functions in newlib.
2924 * include/cygwin/version.h: Bump API minor number.
2926 2002-08-29 Boris Schaeling <boriss@web.de>
2927 Corinna Vinschen <corinna@vinschen.de>
2929 * poll.cc (poll): Peek sockets ready for read to see if there's
2932 2002-08-28 Christopher Faylor <cgf@redhat.com>
2934 * cygthread.cc (hthreads): Remove unneeded global.
2935 (cygthread::simplestub): New static member function.
2936 (cygthread::runner): Don't set hthreads.
2937 (cygthread::freerange): New member function.
2938 (cygthread::operator new): Call freerange if all cygwin slots are used
2940 (cygthread::exit_thread): Don't mess with event if freerange thread.
2941 (cygthread::detach): Ditto.
2942 * cygthread.h (class cygthread): Declare new member functions and
2945 2002-08-28 Christopher Faylor <cgf@redhat.com>
2947 * malloc.cc: Protect some definitions to avoid a compile time warning.
2949 2002-08-27 Nicholas Wourms <nwourms@netscape.net>
2951 * cygwin.din: Export getc_unlocked, getchar_unlocked,
2952 putc_unlocked, putchar_unlocked functions.
2953 * include/cygwin/version.h: Bump api minor.
2955 2002-08-28 Corinna Vinschen <corinna@vinschen.de>
2957 * fhandler_socket.cc (fhandler_socket::recvfrom): Eliminate flags
2958 not understood by WinSock.
2959 (fhandler_socket::sendto): Ditto. If WinSock sendto() returns
2960 WSAESHUTDOWN, change errno to EPIPE and raise SIGPIPE if MSG_NOSIGNAL
2962 * include/cygwin/socket.h: Define MSG_WINMASK and MSG_NOSIGNAL.
2963 * include/cygwin/version.h: Bump API minor number.
2965 2002-08-28 Corinna Vinschen <corinna@vinschen.de>
2967 * poll.cc (poll): Eliminate erroneous POLLERR conditional.
2969 2002-08-26 Conrad Scott <conrad.scott@dsl.pipex.com>
2971 * fhandler_socket.cc (fhandler_socket::check_peer_secret_event):
2973 (fhandler_socket::connect): Remove sigframe.
2974 (fhandler_socket::accept): Ditto.
2975 (fhandler_socket::getsockname): Ditto.
2976 (fhandler_socket::getpeername): Ditto.
2977 (fhandler_socket::recvfrom): Ditto.
2978 (fhandler_socket::recvmsg): Ditto.
2979 (fhandler_socket::sendto): Ditto.
2980 (fhandler_socket::sendmsg): Ditto.
2981 (fhandler_socket::close): Ditto.
2982 (fhandler_socket::ioctl): Ditto.
2983 * ioctl.cc (ioctl): Add sigframe.
2984 * net.cc (cygwin_sendto): Ditto.
2985 (cygwin_recvfrom): Ditto.
2986 (cygwin_recvfrom): Ditto.
2987 (cygwin_connect): Ditto.
2988 (cygwin_shutdown): Ditto.
2989 (cygwin_getpeername): Ditto.
2990 (cygwin_accept): Ditto. Improve strace message.
2991 (cygwin_getsockname): Ditto. Ditto.
2992 (cygwin_recvmsg): Ditto. Ditto.
2993 (cygwin_sendmsg): Fix strace message.
2995 2002-08-27 Christopher Faylor <cgf@redhat.com>
2997 * child_info.h: Add _PROC_WHOOPS enum value.
2998 (CURR_CHILD_INFO_MAGIC): Update.
2999 (child_info::magic): Make 'long'.
3000 * cygheap.h: Export _cygheap_start.
3001 * cygheap.cc: Don't declare _cygheap_start.
3002 * cygmagic: Use cksum to produce checksums. Append 'U' to end of
3004 * dcrt0.cc (initial_env): Calculate sleep ms before reusing buffer.
3005 (_dll_crt0): Detect cygheap mismatch as indicative of different cygwin
3006 version. Set child_proc_info to NULL when _PROC_WHOOPS.
3007 (multiple_cygwin_problem): If child_info specific problem, then set
3008 child_proc_info type to _PROC_WHOOPS.
3009 * shared_info.h (CURR_MOUNT_MAGIC): Update.
3010 (CURR_SHARED_MAGIC): Ditto.
3012 2002-08-25 Conrad Scott <conrad.scott@dsl.pipex.com>
3014 * fhandler.h (fhandler_socket::recvfrom): Fix prototype.
3015 (fhandler_socket::sendto): Ditto.
3016 * fhandler_socket.cc (fhandler_socket::recvfrom): Ditto.
3017 (fhandler_socket::sendto): Ditto.
3018 * include/sys/socket.h (recv): Fix prototype.
3022 * net.cc (cygwin_sendto): Ditto. Improve strace message
3023 (cygwin_recvfrom): Ditto. Ditto.
3024 (cygwin_setsockopt): Improve strace message.
3025 (cygwin_getsockopt): Ditto.
3026 (cygwin_connect): Ditto.
3027 (cygwin_accept): Ditto.
3028 (cygwin_bind): Ditto.
3029 (cygwin_getsockname): Ditto.
3030 (cygwin_getpeername): Ditto.
3031 (cygwin_recv): Fix prototype.
3032 (cygwin_send): Ditto.
3033 (cygwin_recvmsg): Improve strace message.
3034 (cygwin_sendmsg): Ditto.
3036 2002-08-25 Pierre Humblet <Pierre.Humblet@ieee.org>
3038 * sec_acl.cc (getacl): Check ace_sid == well_known_world_sid
3039 before owner_sid and group_sid so that well_known_world_sid
3040 means "other" even when owner_sid and/or group_sid are Everyone.
3041 * security.cc (get_attribute_from_acl): Created from code common
3042 to get_nt_attribute() and get_nt_object_attribute(), with same
3043 reordering as in getacl() above.
3044 (get_nt_attribute): Call get_attribute_from_acl().
3045 (get_nt_object_attribute): Ditto.
3047 2002-08-26 Christopher Faylor <cgf@redhat.com>
3049 * Makefile.in (cygrunk.exe): Make a -mno-cygwin program.
3050 * cygrun.c (main): Export CYGWIN=ntsec unless otherwise set.
3052 * shared.cc (shared_name): Only add build date to shared name when
3055 2002-08-24 Christopher Faylor <cgf@redhat.com>
3057 * Makefile.in (DLL_IMPORTS): Move libuuid.a and libshell32.a to list
3058 rather than referring to them via -l. Add DLL imports last in link
3059 line for new-cygwin.dll and cygrun.exe.
3061 2002-08-19 Christopher Faylor <cgf@redhat.com>
3063 * pinfo.h (pinfo::remember): Arrange for destructor call if
3064 proc_subproc returns error.
3065 * sigproc.cc (zombies): Store 1 + total zombies since proc_subproc uses
3068 2002-08-19 Corinna Vinschen <corinna@vinschen.de>
3070 * pwdgrp.h (pwdgrp_read::pwdgrp_read): Remove.
3071 (pwdgrp_read::~pwdgrp_read): Ditto.
3072 (pwdgrp_read::open): Reset fh to NULL instead of INVALID_HANDLE_VALUE.
3073 (pwdgrp_read::close): Ditto.
3075 2002-08-19 Christopher Faylor <cgf@redhat.com>
3077 * fhandler.h (fhandler_console::send_winch_maybe): New method.
3078 * fhandler_console.cc (set_console_state_for_spawn): Remove if 0'ed
3080 (fhandler_console::send_winch_maybe): Define new method.
3081 (fhandler_console::read): Use send_winch_maybe where appropriate.
3082 (fhandler_console::init): Just call all tcsetattr rather than
3084 * select.cc (peek_console): Reorganize so that send_winch_maybe is
3085 called for everything but keyboard input.
3087 2002-08-18 Christopher Faylor <cgf@redhat.com>
3089 * perthread.h (vfork_save): Add ctty, sid, pgid, exitval fields.
3090 (vfork_save::restore_pid): New method.
3091 (vfork_save::restore_exit): New method.
3092 * fork.cc (vfork): Save ctty, sid, pgid and restore them when returning
3093 to "parent". Use exitval field if exiting but never created a new
3095 * syscalls.cc (setsid): Detect when in "vfork" and force an actual fork
3096 so that pid will be allocated (UGLY!).
3097 (getsid): New function.
3098 * dcrt0.cc (do_exit): Use vfork_save::restore_exit method for returning
3100 * spawn.cc (spawnve): Use vfork_save::{restore_pid,restore_exit}
3101 methods for returning from vfork.
3102 * cygwin.din: Export getsid.
3103 * include/cygwin/version.h: Bump api minor number.
3105 * malloc.cc: #ifdef sYSTRIm for when MORECORE_CANNOT_TRIM is true.
3107 2002-08-18 Christopher Faylor <cgf@redhat.com>
3109 * cygmalloc.h (MORECORE_CANNOT_TRIM): Define.
3111 2002-08-18 Christopher Faylor <cgf@redhat.com>
3113 * sigproc.cc (sigCONT): Define.
3114 * sigproc.h (sigCONT): Declare.
3115 (wait_sig): Create sigCONT event here.
3116 * exceptions.cc (sig_handle_tty_stop): Wait for sigCONT event rather
3117 than stopping thread.
3118 (sig_handle): Set sigCONT event as appropriate on SIGCONT rather than
3119 calling ResumeThread.
3121 2002-08-17 Christopher Faylor <cgf@redhat.com>
3123 * malloc.cc: Update to 2.7.2.
3124 * malloc_wrapper.cc (malloc_init): Call user level mallocs to determine
3125 if the malloc routines have been overridden.
3127 2002-08-16 Christopher Faylor <cgf@redhat.com>
3129 * winsup.h: Remove malloc_*lock functions.
3131 2002-08-16 Christopher Faylor <cgf@redhat.com>
3133 * Makefile.in: Add support for new malloc.o and renamed
3134 malloc_wrapper.o. Use -fomit-frame-pointer for malloc.o compilation.
3135 * malloc_wrapper.cc: New file. Rename from malloc.cc. Add support for
3136 more malloc functions. Eliminate export_* calls. Just use straight
3137 malloc names. Remove unused argument from malloc lock functions.
3138 * cygwin.din: Just export straight malloc names. Add malloc_stats,
3139 malloc_trim, malloc_usable_size, mallopt, memalign, valloc.
3140 * dcrt0.cc (__cygwin_user): Eliminate export_* malloc entries.
3141 * fork.cc (fork_parent): Remove unused argument from malloc_lock
3143 * malloc.cc: New file. Doug Lea's malloc v2.7.1.
3144 * cygmalloc.h: New file.
3145 * include/cygwin/version.h: Bump API_MINOR.
3147 * sync.h (muto::acquire): Use appropriate number for regparm attribute.
3148 (muto::reset): Ditto.
3149 (muto::release): Ditto.
3151 2002-08-16 Pavel Tsekov <ptsekov@gmx.net>
3153 * exceptions.cc (interrupt_setup): Ensure that the previous signal mask
3156 2002-08-15 Thomas Pfaff <tpfaff@gmx.net>
3158 * dcrt0.cc: Modify define for CYGWIN_GUARD.
3159 (alloc_stack_hard_way): Just use CYGWIN_GUARD in VirtualAlloc call.
3161 2002-08-11 Conrad Scott <conrad.scott@dsl.pipex.com>
3163 * fhandler.h (fhandler_socket::recv): Remove method.
3164 (fhandler_socket::send): Ditto.
3165 * fhandler_socket.cc (fhandler_socket::recv): Ditto.
3166 (fhandler_socket::send): Ditto.
3167 (fhandler_socket::read): Delegate to fhandler_socket::recvfrom.
3168 (fhandler_socket::write): Delegate to fhandler_socket::sendto.
3169 (fhandler_socket::sendto): Check for null `to' address.
3170 * net.cc (cygwin_sendto): Check for zero request length.
3171 (cygwin_recvfrom): Ditto. Fix signature, use void *buf.
3172 (cygwin_recv): Delegate to cygwin_recvfrom.
3173 (cygwin_send): Delegate to cygwin_sendto.
3175 2002-08-11 Christopher Faylor <cgf@redhat.com>
3177 * cygthread.cc (cygthread::cygthread): Close another race.
3179 2002-08-11 Christopher Faylor <cgf@redhat.com>
3181 * assert.cc (__assert): Call debugger on assertion failure if
3183 * dcrt0.cc (dll_crt0_1): Just wait for signal thread to go live rather
3184 than going through the overhead of invoking it.
3185 * fork.cc (fork_child): Ditto.
3186 * exceptions.cc (signal_fixup_after_fork): Call sigproc_init here.
3187 * sigproc.cc (proc_can_be_signalled): Assume that the signal thread is
3189 (sig_dispatch): Ditto.
3191 (wait_for_sigthread): Rename from "wait_for_me". Assume that
3192 wait_sig_inited has been set and that this function is only called from
3194 * sigproc.h (wait_for_sigthread): Declare new function.
3196 2002-08-08 Christopher Faylor <cgf@redhat.com>
3198 * environ.cc (parse_options): Remember the "no" part of any options for
3201 2002-08-07 Conrad Scott <conrad.scott@dsl.pipex.com>
3203 * winsup.h (__check_null_invalid_struct): Make ptr argument non-const.
3204 (__check_null_invalid_struct_errno): Ditto.
3205 * miscfuncs.cc (__check_null_invalid_struct): Ditto.
3206 (__check_null_invalid_struct_errno): Ditto.
3207 (__check_invalid_read_ptr_errno): Remove superfluous cast.
3208 * net.cc (get): Set appropriate errno if fd is not a socket.
3209 (cygwin_sendto): Fix parameter checking.
3210 (cygwin_recvfrom): Ditto.
3211 (cygwin_setsockopt): Ditto.
3212 (cygwin_getsockopt): Ditto.
3213 (cygwin_connect): Ditto.
3214 (cygwin_gethostbyaddr): Ditto.
3215 (cygwin_accept): Ditto.
3216 (cygwin_bind): Ditto.
3217 (cygwin_getsockname): Ditto.
3218 (cygwin_listen): Ditto.
3219 (cygwin_getpeername): Ditto.
3220 (cygwin_send): Ditto.
3221 (cygwin_shutdown): Ditto. Move sigframe to fhandler_socket.
3222 (cygwin_recvmsg): Fix parameter checking. Add tracing.
3223 (cygwin_sendmsg): Ditto.
3224 * fhandler_socket.cc (fhandler_socket::shutdown): Add sigframe.
3225 * resource.cc (setrlimit): Fix parameter checking.
3227 2002-08-08 Joe Buehler <jbuehler@hekimian.com
3229 * sec_helper.cc (sec_acl): remove extraneous arg to debug_printf.
3231 2002-08-07 Conrad Scott <conrad.scott@dsl.pipex.com>
3233 * fhandler_socket.cc (fhandler_socket::accept): Fix FIONBIO call.
3235 2002-08-06 Christopher Faylor <cgf@redhat.com>
3237 * cygheap.cc (_csbrk): Avoid !cygheap considerations.
3238 (cygheap_init): Deal with unintialized cygheap issues here.
3239 (cheap_init): Move cygheap_max setting here.
3241 2002-08-06 Christopher Faylor <cgf@redhat.com>
3242 Conrad Scott <conrad.scott@dsl.pipex.com
3244 * cygheap.cc (_csbrk): Allocate some slop initially. Don't erroneously
3245 add sbrk amount to returned value in initial case.
3247 2002-08-06 Christopher Faylor <cgf@redhat.com>
3249 * spawn.cc (spawn_guts): Don't set mount_h here.
3250 * sigproc.cc (init_child_info): Set it here instead.
3251 * shared.cc (cygwin_mount_h): Make NO_COPY.
3253 2002-08-06 Christopher Faylor <cgf@redhat.com>
3255 * cygthread.cc (cygthread::stub): Accept flag to pass info structure to
3257 (cygthread::operator new): Add defensive debugging output.
3258 (cygthread::cygthread): Add debugging output. Set name after thread
3259 has been awakened to avoid a race.
3260 (cygthread::exit_thread): Use handle operator rather than using ev
3262 (cygthread::exit_thread): Reorganize to provide debugging. Set __name
3264 * cygthread.h (cygself): Define.
3265 * fhandler_tty.cc (fhandler_tty_master::init): Use cygself as argument
3266 so that invoked thread can access its own info.
3267 (process_output): Derive cygthread info of thread from thread argument.
3268 * sigproc.cc (sigproc_init): Use cygself as argument so that invoked
3269 thread can access its own info.
3270 (wait_sig): Derive cygthread info of thread from thread argument.
3272 2002-08-06 Conrad Scott <conrad.scott@dsl.pipex.com>
3274 * debug.h (handle_list::allocated): Remove field.
3275 * debug.cc (newh): Don't malloc extra entries.
3276 (add_handle): Downgrade strace message level.
3277 (delete_handle): Remove case for `allocated' entries.
3279 2002-08-05 Christopher Faylor <cgf@redhat.com>
3281 * cygthread.cc (cygthread::stub): Change event creation to manual
3282 reset. Set __name after calling SetEvent to prevent races.
3283 (cygthread::detach): Always reset event here to prevent races.
3285 2002-08-03 Conrad Scott <conrad.scott@dsl.pipex.com>
3287 * debug.h (WaitForMultipleObjects): Correct typo.
3289 2002-08-01 Pierre Humblet <Pierre.Humblet@ieee.org>
3291 * security.cc (verify_token): Do not reject a token just because
3292 the supplementary group list is missing Everyone or a groupsid
3293 equal to usersid, or because the primary group is not in the token,
3294 as long as it is equal to the usersid.
3295 * syscalls.cc (seteuid32): Use common code for all successful returns.
3296 * grp.cc (getgroups32): Never includes Everyone in the output.
3298 2002-08-01 Christopher Faylor <cgf@redhat.com>
3300 * cygthread.cc (cygthread::exit_thread): Define new method.
3301 * cygthread.h (cygthread::exit_thread): Declare new method.
3302 * fhandler.h (fhandler_tty_master::hThread): Delete.
3303 (fhandler_tty_master::output_thread): Define.
3304 * fhandler_tty.cc (fhandler_tty_master::fhandler_tty_master): Adjust
3306 (fhandler_tty_master::init): Use cygthread rather than handle.
3307 (process_output): Use cygthread method to exit.
3308 (fhandler_tty_master::fixup_after_fork): Set output_thread to NULL
3310 (fhandler_tty_master::fixup_after_exec): Set output_thread to NULL
3312 * tty.cc (tty_list::terminate): Detach from output_thread using
3315 2002-08-01 Christopher Faylor <cgf@redhat.com>
3317 * syscalls.cc (_link): Revert previous change and just always
3318 dereference the oldpath.
3320 2002-08-01 Christopher Faylor <cgf@redhat.com>
3322 * syscalls.cc (link): Properly deal with a link to a symlink.
3324 2002-08-01 Christopher Faylor <cgf@redhat.com>
3326 * cygthread.cc: Remove cruft.
3328 2002-08-01 Christopher Faylor <cgf@redhat.com>
3330 * Makefile.in (DLL_OFILES): Add cygthread.o.
3331 * dcrt0.cc (dll_crt0_1): Eliminate various thread initialization
3332 functions in favor of new cygthread class.
3333 * debug.cc: Remove thread manipulation functions.
3335 * external.cc (cygwin_internal): Use cygthread method for determining
3336 thread name. Remove capability for setting thread name.
3337 * fhandler_console.cc (fhandler_console::read): Use cygthread method
3338 rather than iscygthread function.
3339 * fhandler_tty.cc (fhandler_tty_master::fhandler_tty_master): Use
3340 cygthread methods to create threads.
3341 (fhandler_tty_common::__acquire_output_mutex): Use cygthread method to
3342 retrieve thread name.
3343 * select.cc (pipeinf): Use cygthread pointer rather than handle.
3344 (start_thread_pipe): Ditto.
3345 (pipe_cleanup): Ditto.
3347 (start_thread_serial): Ditto.
3348 (serial_cleanup): Ditto.
3350 (start_thread_socket): Ditto.
3351 (socket_cleanup): Ditto.
3352 * sigproc.cc (hwait_sig): Ditto.
3353 (hwait_subproc): Ditto.
3354 (proc_terminate): Ditto.
3355 (sigproc_terminate): Ditto.
3356 (sigproc_init): Initialize cygthread hwait_sig pointer.
3357 (subproc_init): Initialize cygthread hwait_subproc pointer.
3358 (wait_sig): Rely on cygthread HANDLE operator.
3359 * strace.cc (strace::vsprntf): Use cygthread::name rather than threadname.
3360 * window.cc (gethwnd): Use cygthread method to initialize thread.
3362 2002-07-31 Conrad Scott <conrad.scott@dsl.pipex.com>
3364 * fhandler.h (fhandler_base::get_r_no_interrupt): Make non-virtual.
3365 * net.cc (fdsock): Call set_r_no_interrupt.
3367 2002-07-30 Christopher Faylor <cgf@redhat.com>
3369 * syscalls.cc (_read): Clarify debugging output.
3371 2002-07-30 Christopher Faylor <cgf@redhat.com>
3373 * fhandler.h (fhandler_base::get_r_no_interrupt): Make virtual.
3375 2002-07-30 Christopher Faylor <cgf@redhat.com>
3377 * fhandler_disk_file.cc (fhandler_cygdrive::set_drives): Incorporate .
3378 and .. processing here.
3379 (fhandler_cygdrive::readdir): Assume . and .. are already in pdrive.
3380 (fhandler_cygdrive::seekdir): Ditto.
3382 2002-07-29 Christopher Faylor <cgf@redhat.com>
3384 * dcrt0.cc (dll_crt0_1): Move debug_fixup_after_fork_exec.
3385 * cygheap.cc (cygheap_fixup_in_child): Call debug_fixup_after_fork_exec
3386 immediately after cygheap has been set up.
3388 2002-07-29 Corinna Vinschen <corinna@vinschen.de>
3390 * security.cc: Change some formatting.
3391 * include/cygwin/version.h: Bump API minor version.
3393 2002-07-28 Pierre Humblet <Pierre.Humblet@ieee.org>
3395 * cygheap.h (class cygheap_user): Add member groups.
3396 * security.h (class cygsidlist): Add members type and maxcount, methods
3397 position, addfromgr, alloc_sids and free_sids and operator+= (const
3398 PSID psid). Modify contains () to call position () and optimize add ()
3400 (class user_groups): Create. Update declarations of verify_token and
3402 * security.cc (cygsidlist::alloc_sids): New.
3403 (cygsidlist::free_sids): New.
3404 (get_token_group_sidlist): Create from get_group_sidlist.
3405 (get_initgroups_sidlist): Create from get_group_sidlist.
3406 (get_group_sidlist): Suppress.
3407 (get_setgroups_sidlist): Create.
3408 (verify_token): Modify arguments. Add setgroups case.
3409 (create_token): Modify arguments. Call get_initgroups_sidlist and
3410 get_setgroups_sidlist as needed. Set SE_GROUP_LOGON_ID from auth_pos
3411 outside of the loop. Rename the various group sid lists consistently.
3412 * syscalls.cc (seteuid32): Modify to use cygheap->user.groups.
3413 (setegid32): Call cygheap->user.groups.update_pgrp.
3414 * grp.cc (setgroups): Create.
3415 (setgroups32): Create.
3416 * uinfo.cc (internal_getlogin): Initialize and update
3418 * cygwin.din: Add setgroups and setgroups32.
3420 2002-07-28 Christopher Faylor <cgf@redhat.com>
3422 * fhandler_console.cc (fhandler_console::read): Use appropriate
3424 * select.cc (peek_console): Ditto.
3425 * fhandler_termios.cc (fhandler_termios::bg_check): Send "stopped"
3426 signal to entire process group as dictated by SUSv3.
3427 * termios.cc (tcsetattr): Detect when stopped signal sent and force a
3428 stop before setting anything.
3430 2002-07-26 Christopher Faylor <cgf@redhat.com>
3432 * include/cygwin/version.h: Bump API version to indicate that ntsec is
3435 2002-07-26 Conrad Scott <conrad.scott@dsl.pipex.com>
3437 * fhandler_registry.cc (fhandler_registry::close): Return any error
3438 result to the caller.
3439 * syscalls.cc (_close): Return result of fhandler::close to the caller.
3441 2002-07-25 Christopher Faylor <cgf@redhat.com>
3443 * security.cc (allow_ntsec): Default to on.
3444 (allow_smbntsec): Default to off.
3446 2002-07-24 David MacMahon <davidm@smartsc.com>
3448 * times.cc (to_time_t): Always round time_t down to nearest second.
3450 2002-07-25 Egor Duda <deo@logos-m.ru>
3452 * Makefile.in: Check if API version is updated when exports are
3453 changed and stop if not so.
3455 2002-07-24 Egor Duda <deo@logos-m.ru>
3457 * include/cygwin/version.h: Bump minor API version.
3459 2002-07-24 Corinna Vinschen <corinna@vinschen.de>
3461 * fhandler_serial.cc: Change 'must_init_serial_line capability'
3462 to 'supports_reading_modem_output_lines' throughout (negated meaning).
3466 2002-07-23 Nicholas Wourms <nwourms@netscape.net>
3468 * cygwin.din (fcloseall): Add symbol for export.
3469 (fcloseall_r): Ditto.
3471 2002-07-24 Christopher Faylor <cgf@redhat.com>
3473 * path.cc (path_conv::check): Always set fileattr when component == 0.
3474 (readlink): Use path_conv method rather than field.
3475 * fhandler_disk_file.cc (fhandler_disk_file::fstat_helper): Ditto,
3477 * path.h (path_conv): Make fileattr private.
3478 * exceptions.cc (try_to_debug): Default to idle priority when looping.
3480 2002-07-23 Corinna Vinschen <corinna@vinschen.de>
3482 * fhandler_serial.cc: Use must_init_serial_line capability throughout.
3483 * wincap.cc: Set flag must_init_serial_line appropriately.
3484 * wincap.h: Add flag must_init_serial_line.
3486 2002-07-23 Corinna Vinschen <corinna@vinschen.de>
3488 * security.cc (get_group_sidlist): Create group list from /etc files
3489 even if DC is available but access fails.
3491 2002-07-22 Christopher Faylor <cgf@redhat.com>
3493 * fhandler_serial.cc: Fix formatting problems introduced by below
3496 2002-07-22 Jacek Trzcinski <jacek@certum.pl>
3498 * fhandler.h (class fhandler_serial): Add new members of the class -
3499 rts,dtr and method ioctl(). Variables rts and dtr important for Win 9x
3501 * fhandler_serial.cc (fhandler_serial::open): Add initial setting of
3502 dtr and rts. Important for Win 9x only.
3503 (fhandler_serial::ioctl): New function. Implements commands TIOCMGET,
3504 TIOCMSET and TIOCINQ.
3505 (fhandler_serial::tcflush): Fix found error.
3506 (fhandler_serial::tcsetattr): Add settings of rts and dtr. Important
3508 * termios.h: Add new defines as a support for ioctl() function on
3511 2002-07-20 Christopher Faylor <cgf@redhat.com>
3513 * autoload.cc (LoadDLLprime): Add jmp call to allow streamlining of
3515 (doit): Avoid use of cx register. Just change one word to avoid races.
3517 2002-07-18 Pierre Humblet <pierre.humblet@ieee.org>
3519 * security.cc (get_unix_group_sidlist): Create.
3520 (get_supplementary_group_sidlist): Evolve into get_unix_group_sidlist.
3521 (get_user_local_groups): Add check for duplicates.
3522 (get_user_primary_group): Suppress.
3523 (get_group_sidlist): Silently ignore PDC unavailability.
3524 Call get_unix_group_sidlist() before get_user_local_groups().
3525 Remove call to get_supplementary_group_sidlist(). Never call
3526 get_user_primary_group() as the passwd group is always included.
3527 Add well_known_authenticated_users_sid in only one statement.
3529 2002-07-19 Christopher Faylor <cgf@redhat.com>
3531 * fhandler_serial.cc (fhandler_serial::tcflush): Fix typo.
3533 2002-07-15 Corinna Vinschen <corinna@vinschen.de>
3535 * security.cc (get_group_sidlist): Fix formatting.
3537 2002-07-14 Christopher Faylor <cgf@redhat.com>
3539 * dcrt0.cc (initial_env): Force path and CYGWIN_DEBUG contents to lower
3541 * exceptions.cc (error_start_init): Use the name derived from
3542 GetModuleName rather than myself->progname.
3544 2002-07-14 Christopher Faylor <cgf@redhat.com>
3546 * dcrt0.cc (dll_crt0_1): Move debug_init call back to here. Avoid a
3548 * shared.cc (memory_init): Remove debug_init call.
3549 * debug.h (handle_list): Change "clexec" to "inherited".
3550 * debug.cc: Remove a spurious declaration.
3551 (setclexec): Conditionalize away since it is currently unused.
3552 (add_handle): Use inherited field rather than clexec.
3553 (debug_fixup_after_fork_exec): Ditto. Move debugging output to
3555 (delete_handle): Add debugging output.
3556 * fhandler.cc (fhandler_base::set_inheritance): Don't bother setting
3557 inheritance in debugging table since the handle was never protected
3559 (fhandler_base::fork_fixup): Ditto.
3561 * exceptions.cc (debugger_command): Revert.
3563 2002-07-14 Conrad Scott <conrad.scott@dsl.pipex.com>
3565 * debug.cc (clexec): Add missing `hl = hl->next'.
3567 2002-07-14 Christopher Faylor <cgf@redhat.com>
3569 * Makefile.in (cygrun.exe): Add a -lcygwin on the end.
3571 2002-07-14 Christopher Faylor <cgf@redhat.com>
3573 * Makefile.in (cygserver.exe): Add -lstdc++.
3574 (cygrun.exe): Move -lgcc last.
3576 2002-07-13 Christopher Faylor <cgf@redhat.com>
3578 * dcrt0.cc (dll_crt0_1): Delay closing of some handles until cygheap
3580 (break_here): New function, for debugging.
3581 (initial_env): Add program name to "Sleeping" message. Implement new
3582 "CYGWIN_DEBUG" environment variable option.
3583 * exceptions.cc (debugger_command): Add argument to dumper call.
3584 * strace.cc (strace::hello): Use winpid if cygwin pid is unavailable.
3585 (strace::vsprntf): Ditto.
3587 2002-07-13 Christopher Faylor <cgf@redhat.com>
3589 * debug.h (handle_list): Move here from debug.cc. Add "inherit" flag
3591 * cygheap.cc (init_cheap): Move cygheap_max calculation to _csbrk.
3592 (_csbrk): Reorganize to not assume first allocation is <= 1 page.
3593 (cygheap_setup_for_child): Mark protected handle as inheritable.
3594 * cygheap.h (cygheap_debug): New struct.
3595 (init_cygheap): Add new structure when debugging.
3596 * dcrt0.cc (dll_crt0_1): Remove call to debug_init. Close ppid_handle
3597 here, if appropriate. Don't protect subproc_ready, since it is already
3598 protected in the parent. Call memory_init prior to ProtectHandle to
3599 ensure that cygheap is set up. Call debug_fixup_after_fork_exec when
3601 (_dll_crt0): Don't close ppid_handle here.
3602 * debug.cc: Use cygheap debug structure rather than static elements
3604 (add_handle): Don't issue a warning if attempt to protect handle in
3605 exactly the same way from exactly the same place. Add pid info to
3606 warning output. Accept additional argument controlling whether handle
3607 is to be inherited. Add pid to stored information.
3608 (debug_fixup_after_fork_exec): Renamed from debug_fixup_after_fork.
3609 Reorganize to avoid erroneously skipping handles.
3610 (mark_closed): Add pid info to warning output.
3611 (setclexec): Rename from setclexec_pid.
3612 * fhandler.cc (fhandler_base::get_default_fmode): Minor reorg.
3613 (fhandler_base::fstat): Add debugging output.
3614 (fhandler_base::set_inheritance): Call setclexec rather than
3616 (fhandler_base::fork_fixup): Ditto.
3617 * fhandler_console.cc (get_tty_stuff): Mark protected handle as
3619 * fhandler_tty.cc (fhandler_tty_slave::open): Ditto.
3620 * tty.cc (tty::make_pipes): Ditto.
3621 (tty::common_init): Ditto.
3622 * fork.cc (fork_parent): Ditto.
3623 (fork_child): Close protected handles with correct name. Remove
3624 debug_fixup_after_fork call.
3625 * fhandler_socket.cc (fhandler_socket::create_secret_event): Mark
3626 protected handle as inheritable/non-inheritable, as appropriate.
3627 * shared.cc (memory_init): Mark protected handle as inheritable.
3628 Call debug_init here.
3629 * sigproc.cc (wait_sig): Close protected handle with correct name.
3630 * spawn.cc (spawn_guts): Rename spr to subproc_ready and mark it as
3633 * exceptions.cc (debugger_command): Try to run dumper.exe, if found.
3635 * syscalls.cc (fstat64): Don't follow symlinks for path_conv lookup
3636 since path is already resolved.
3638 2002-07-12 Christopher Faylor <cgf@redhat.com>
3640 * cygwin.din: Change erroneous entries.
3642 2002-07-11 Pavel Tsekov <ptsekov@gmx.net>
3644 * fhandler_disk_file.cc (fhandler_disk_file::open): Don't
3645 move the file pointer to the end of file if O_APPEND is
3646 specified in the open flags.
3648 2002-07-09 Christopher Faylor <cgf@redhat.com>
3650 * debug.cc: Avoid explicit zeroing of globals.
3651 (lock_debug): Make locker a static member. Avoid unlocking when
3652 already unlocked (from Conrad Scott).
3653 (debug_init): Initialize lock_debug::locker here.
3654 * fork.cc (fork_child): Fix up fdtab earlier to avoid some (but not
3655 all) confusion with close-on-exec craziness.
3657 2002-07-05 Corinna Vinschen <corinna@vinschen.de>
3659 * fhandler.h (fhandler_socket::is_unconnected): Constify.
3660 (fhandler_socket::is_connect_pending): Ditto.
3661 (fhandler_socket::is_connected): Ditto.
3662 (fhandler_socket::set_connect_state): New method.
3663 (struct select_record): Add member `except_on_write'.
3664 (select_record::select_record): Initialize all bool values to `false'.
3665 * fhandler_socket.cc: Use set_connect_state() method throughout.
3666 (fhandler_socket::connect): Set state always to connected if connection
3668 * net.cc (cygwin_getsockopt): Revert erroneous previous patch.
3669 * select.cc (set_bits): Check for `except_on_write'. Set fd in
3670 write_fds if set. Set connect state to connected if fd has been
3671 returned by WINSOCK_SELECT.
3672 (peek_socket): Check for `except_on_write'.
3673 (start_thread_socket): Ditto.
3674 (fhandler_socket::select_write): Don't set `write_ready' if connect
3675 is pending. Set `except_on_write' if connect is pending.
3677 2002-07-05 Christopher Faylor <cgf@redhat.com>
3679 * ntdll.h (_SYSTEM_PROCESSOR_TIMES): Force eight byte alignment.
3680 (_SYSTEM_TIME_OF_DAY_INFORMATION): Ditto.
3682 * path.cc (suffix_scan::has): Reorganize to eliminate double scanning
3683 for for .exe (in the typical case).
3685 2002-07-05 Corinna Vinschen <corinna@vinschen.de>
3687 * fhandler.h (UNCONNECTED): New define.
3688 (CONNECT_PENDING): Ditto.
3690 (class fhandler_socket): Add member `had_connect_or_listen'.
3691 Add member functions `is_unconnected', `is_connect_pending' and
3693 * fhandler_socket.cc (fhandler_socket::connect): Set member
3694 `had_connect_or_listen' according to return code of WinSock
3696 (fhandler_socket::listen): Ditto.
3697 * net.cc (cygwin_getsockopt): Modify SO_ERROR return value in
3698 case of socket with pending connect().
3699 * select.cc (peek_socket): Only add socket to matching fd_set
3700 if it's not "ready". Call WINSOCK_SELECT only if at least one
3701 socket is in one of the fd_sets.
3702 (start_thread_socket): Only add socket to matching fd_set
3703 if it's not "ready".
3704 (fhandler_socket::select_write): Set write_ready to true also
3705 if socket isn't connected or listening.
3707 2002-07-04 Corinna Vinschen <corinna@vinschen.de>
3709 * fhandler_socket.cc (fhandler_socket::set_sun_path): Don't free
3710 memory here. Allow NULL parameter.
3712 2002-07-04 Corinna Vinschen <corinna@vinschen.de>
3714 * fhandler_socket.cc (fhandler_socket::dup): Add missing copy operation
3717 2002-07-03 Christopher Faylor <cgf@redhat.com>
3719 * include/cygwin/version.h: Bump DLL minor number.
3721 2002-07-03 Christopher Faylor <cgf@redhat.com>
3723 * include/sys/statfs.h: New header file.
3725 2002-07-03 Christopher Faylor <cgf@redhat.com>
3727 * dtable.cc (cygwin_attach_handle_to_fd): Default to implicit bin mode
3729 * fhandler.cc (fhandler_base::init): Make bin argument a guarantee
3730 rather than a suggestion.
3731 * path.cc (path_conv::check): Load flag returned from
3732 cygwin_conv_to_win32_path into path_flags.
3734 2002-07-03 Conrad Scott <conrad.scott@dsl.pipex.com>
3736 * tty.cc (tty::common_init): Reverse logic of cygserver check in
3737 call to SetKernelObjectSecurity.
3739 2002-07-03 Thomas Pfaff <tpfaff@gmx.net>
3741 * autoload.cc (WSAEventSelect): Define new autoload function.
3742 (WSAEnumNetworkEvents): Ditto.
3743 * fhandler_socket.cc (fhandler_socket::accept): If socket is
3744 in blocking mode wait for incoming connection and signal.
3746 2002-07-02 Christopher Faylor <cgf@redhat.com>
3748 * cygheap.cc (init_cheap): Rearrange error message.
3749 (cygheap_fixup_in_child): Ditto.
3750 * dtable.cc: Remove if 0'ed code.
3751 * fhandler_dsp.cc (fhandler_dev_dsp::open): Force binmode.
3752 * sec_helper.cc (cygsid::get_id): Use system_printf for error message.
3753 * tty.cc (tty::common_init): Ditto.
3755 2002-07-02 Christopher Faylor <cgf@redhat.com>
3757 * net.cc (cygwin_getpeername): Defend against NULL pointer dereference.
3759 2002-07-02 Egor Duda <deo@logos-m.ru>
3761 * include/cygwin/version.h: Bump API minor version.
3763 2002-07-01 Pierre Humblet <pierre.humblet@ieee.org>
3765 * security.cc (get_logon_server): Interpret a zero length
3766 domain as the local domain.
3767 (get_group_sidlist): Add authenticated users SID to SYSTEM's group
3768 list instead of SYSTEM itself.
3769 (verify_token): Accept the primary group sid if it equals
3772 2002-07-02 Corinna Vinschen <corinna@vinschen.de>
3774 * cygwin.din (__fpclassifyd): Add symbol.
3775 (__fpclassifyf): Ditto.
3776 (__signbitd): Ditto.
3777 (__signbitf): Ditto.
3779 2002-07-02 Corinna Vinschen <corinna@vinschen.de>
3781 * security.h (DONT_INHERIT): Eliminate definition.
3782 (INHERIT_ALL): Ditto.
3783 (INHERIT_ONLY): Ditto.
3784 * sec_acl.cc: Use appropriate defines from accctrl.h instead of the
3786 * security.cc: Ditto.
3788 2002-07-01 Pierre Humblet <pierre.humblet@ieee.org>
3790 * syscalls.c (seteuid32): Return immediately if the program is not
3791 impersonated and both uid and gid are original.
3792 (setegid32): Return immediately if the new gid is the current egid.
3794 2002-07-01 Christopher Faylor <cgf@redhat.com>
3796 * syscalls.cc (seteuid32): Fix incorrect placement of Pierre's patch
3799 2002-07-01 Christopher Faylor <cgf@redhat.com>
3801 * syscalls.cc (seteuid32): Fix incorrect use of system_printf.
3803 2002-07-02 Christopher January <chris@atomice.net>
3805 * autoload.cc (GetSecurityInfo): Define new autoload function.
3806 (RegQueryInfoKeyA): Ditto.
3807 * fhandler.h (fhandler_virtual::fill_filebuf): Change return type to
3809 (fhandler_proc::fill_filebuf): Ditto.
3810 (fhandler_registry::fill_filebuf): Ditto.
3811 (fhandler_process::fill_filebuf): Ditto.
3812 (fhandler_registry::value_name): Add new member.
3813 (fhandler_registry::close): Add new method.
3814 (fhandler_process::p): Remove member.
3815 * fhandler_proc.cc (fhandler_proc::open): Add set_nohandle after
3816 calling superclass method. Check return value of fill_filebuf.
3817 (fhandler_proc::fill_filebuf): Change return type to bool. Add return
3819 * fhandler_process.cc (fhandler_process::open): Add set_nohandle after
3820 calling superclass method. Remove references to p. Check return value
3822 (fhandler_process::fill_filebuf): Change return type to bool. Don't
3823 use dereference operator on p. Add return statement.
3824 (fhandler_process::format_process_stat): Fix typo.
3825 * fhandler_registry.cc: Add static open_key declaration.
3826 (fhandler_registry::exists): Assume path is already normalised. Try
3827 opening the path as a key in its own right first, before reverting to
3828 enumerating subkeys and values of the parent key.
3829 (fhandler_registry::fstat): Add additional code to return more relevant
3830 information about the registry key/value.
3831 (fhandler_registry::readdir): Explicitly set desired access when
3832 opening registry key. Remove output of buf from debug_printf format
3834 (fhandler_registry::open): Use set_io_handle to store registry key
3835 handle. Set value_name member. Move code to read a value from the
3836 registry to fill_filebuf. Add call to fill_filebuf.
3837 (fhandler_registry::close): New method.
3838 (fhandler_registry::fill_filebuf): Change return type to bool. Add
3839 code to read a value from registry.
3840 (fhandler_registry::open_key): Make function static. Use KEY_READ as
3841 desired access unless this is the last path component. Check the
3842 return value of RegOpenKeyEx for an error instead of hKey.
3843 * fhandler_virtual.cc (fhandler_virtual::lseek): Check the return value
3845 (fhandler_virtual::open): Remove call to set_nohandle.
3846 (fhandler_virtual::fill_filebuf): Change return type to bool. Add
3848 * security.cc (get_nt_object_attribute): New function.
3849 (get_object_attribute): New function.
3850 * security.h (get_object_attribute): New function declaration.
3852 2002-07-01 Pierre Humblet <pierre.humblet@ieee.org>
3854 * syscalls.c (seteuid32): Do not return an error when the token cannot
3855 be created only because of a problem with the gid.
3857 2002-07-01 Christopher Faylor <cgf@redhat.com>
3859 * fhandler_clipboard.c (fhandler_dev_clipboard::open): Force text mode.
3860 * fhandler_console.cc (fhandler_console::open): *Really* force binary
3861 mode rather than make it optional.
3862 * fhandler_proc.cc (fhandler_proc::open): Ditto.
3863 * fhandler_process.cc (fhandler_process::open): Ditto.
3864 * fhandler_random.cc (fhandler_dev_random::fhandler_dev_random): Ditto.
3865 * fhandler_raw.cc (fhandler_dev_raw::open): Ditto.
3866 * fhandler_registry.cc (fhandler_registry::open): Ditto.
3867 * fhandler_tty.cc (fhandler_tty_slave::open): Ditto.
3868 * fhandler_virtual.cc (fhandler_virtual::open): Ditto.
3869 * fhandler_windows.cc (fhandler_windows::open): Ditto.
3870 * fhandler_zero.cc (fhandler_dev_zero::open): Ditto.
3871 * net.cc (fdsock): Ditto.
3872 * path.cc (set_flags): Add more debugging.
3874 2002-07-01 Christopher Faylor <cgf@redhat.com>
3876 * debug.cc (threads): Avoid initialization.
3877 * uinfo.cc (cygheap_user::ontherange): (from Corinna Vinschen) Actually
3878 make below changes work.
3880 2002-07-01 Christopher Faylor <cgf@redhat.com>
3882 * uinfo.cc (cygheap_user::ontherange): Make cygwin root the last resort
3883 for HOMEPATH/HOMEDRIVE for consistency with HOME.
3885 2002-07-01 Corinna Vinschen <corinna@vinschen.de>
3887 * shared.cc (sec_none): Move to sec_helper.cc.
3888 (sec_none_nih): Ditto.
3890 (sec_all_nih): Ditto.
3891 (get_null_sd): Ditto.
3893 (__sec_user): Ditto.
3894 * sec_helper.cc (sec_none): Move from shared.cc to here.
3895 (sec_none_nih): Ditto.
3897 (sec_all_nih): Ditto.
3898 (get_null_sd): Ditto.
3900 (__sec_user): Ditto.
3902 2002-06-30 Christopher Faylor <cgf@redhat.com>
3904 * uinfo.cc (cygheap_user::ontherange): Potentially set HOME from
3905 existing homepath and homedrive cygheap_user fields (not currently used
3906 yet). Set HOME to / if no other alternative.
3907 (cygheap_user::test_uid): Simplify.
3909 2002-06-30 Christopher Faylor <cgf@redhat.com>
3911 * environ.cc (parse_options): Use setenv to potentially replace CYGWIN
3912 value on export. Fixes broken behavior since November 2000 changes.
3913 (regopt): Return indication of whether or not something has been parsed
3915 (environ_init): Only attempt to export CYGWIN variable when values were
3916 set from the registry. It is exported automatically otherwise.
3918 2002-06-30 Christopher Faylor <cgf@redhat.com>
3920 * fhandler.h (fhandler_process::pid): New field.
3921 (fhandler_process::fstat): Remove unneeded array. Set pid element.
3922 (fhandler_process::open): Ditto.
3923 (fhandler_process::fill_filebuf): Handle case where 'p' field is NULL.
3925 2002-06-30 Christopher Faylor <cgf@redhat.com>
3927 * fhandler.h (fhandler_process::p): New field.
3928 (fhandler_process:fill_filebuf): Revert to same definition as virtual
3930 (fhandler_process::open): Fill out p field rather than passing as an
3932 (fhandler_process::fill_filebuf): Use p pointer rather than argument.
3934 2002-06-29 Pierre Humblet <pierre.humblet@ieee.org>
3936 * security.cc (extract_nt_dom_user): Check for all buffer overflows.
3937 Call LookupAccountSid after trying to get domain & user from passwd.
3938 (get_group_sidlist): Obtain the domain and user by calling
3939 extract_nt_dom_user instead of LookupAccountSid.
3941 2002-06-29 Christopher Faylor <cgf@redhat.com>
3943 * uinfo.cc (cygheap_user::test_uid): Use standard issetuid test.
3945 2002-06-29 Christopher Faylor <cgf@redhat.com>
3947 * autoload.cc (NetGetDCName): Change to make this an optional load
3949 * cygheap.h (cygheap_user::logsrv): Return NULL when operation fails.
3950 (cygheap_user::winname): Ditto.
3951 (cygheap_user::domain): Ditto.
3952 * uinfo.cc (cygheap_user::env_logsrv): Save results in temp variable.
3953 (cygheap_user::env_userprofile): Ditto.
3955 2002-06-29 Christopher Faylor <cgf@redhat.com>
3957 * environ.cc (spenv::retrieve): Detect return of env_dontadd from
3958 cygheap_user methods.
3959 (build_env): Avoid incrementing environment pointer if not actually
3960 adding to the environment. That could result in garbage in the
3961 environment table. Be more defensive when reallocing envblock.
3963 2002-06-29 Christopher Faylor <cgf@redhat.com>
3965 * uinfo.cc (cygheap_user::test_uid): Return NULL or further tests are
3967 (cygheap_user::env_domain): Recalculate if name is missing.
3969 2002-06-29 Christopher Faylor <cgf@redhat.com>
3971 * environ.cc (spenv::from_cygheap): Still need to take setuid into
3974 2002-06-28 Christopher Faylor <cgf@redhat.com>
3976 * uinfo.cc (cygheap_user::env_logsrv): Return "almost_null" in case
3977 where no domain or username is "SYSTEM".
3979 2002-06-28 Christopher Faylor <cgf@redhat.com>
3981 * cygheap.h (cygheap_user): Reorg to accommodate environment caching.
3982 (cygheap_user::logsrv): New method.
3983 (cygheap_user::winname): Ditto.
3984 (cygheap_user::domain): Ditto.
3985 (cygheap_user::test_uid): Ditto.
3986 * cygheap.cc (cygheap_user::set_name): Reflect name "pwinname" name
3988 * environ.cc (getwinenveq): New function.
3989 (penv::from_cygheap): penv::from_cygheap): Change arguments.
3990 (spenv::retrieve): Ditto for call. Use getwinenveq to retrieve info
3991 from environment. Always return value from cygwin environment, if it
3993 * environ.h (getwinenveq): Declare.
3994 * uinfo.cc (cygheap_user::ontherange): Use logsrv() rather than
3996 (cygheap_user::test_uid): Define new method.
3997 (cygheap_user::env_logsrv): Accept environment arguments. Use test_uid
3999 (cygheap_user::env_domain): Ditto.
4000 (cygheap_user::env_userprofile): Ditto.
4001 (cygheap_user::env_homepath): Ditto.
4002 (cygheap_user::env_homedrive): Ditto.
4003 (cygheap_user::env_name): Ditto.
4005 2002-06-27 Christopher Faylor <cgf@redhat.com>
4007 * cygheap.cc (cfree_and_set): New function.
4008 (cygheap_user::set_name): Use cfree_and_set to reset members.
4009 * cygheap.h (cygheap_user): Delete static members.
4010 (cygheap_user::puserprof): New member.
4011 (cfree_and_set): Declare.
4012 * dcrt0.cc (almost_null): Define.
4013 * environ.cc (env_dontadd): Redefine as "almost_null".
4014 * winsup.h (almost_null): Declare.
4015 * syscalls.cc (cfree_and_set): Remove unused variable.
4016 * uinfo.cc (cygheap_user::homepath_env_buf): Eliminate.
4017 (cygheap_user::homedrive_env_buf): Ditto.
4018 (cygheap_user::userprofile_env_buf): Ditto.
4019 (cygheap_user::ontherange): YA change to try to preserve existing
4020 HOMEPATH and HOMEDRIVE. Return almost_null values when variables
4021 should not actually exist.
4022 (cygheap_user::env_logsrv): Ditto.
4023 (cygheap_user::env_domain): Ditto.
4024 (cygheap_user::env_userprofile): Ditto.
4026 2002-06-27 Corinna Vinschen <corinna@vinschen.de>
4028 * dcrt0.cc (dll_crt0_1): Let __progname point to the applications
4029 basename. Move eliminating ".exe" suffix from argv[0] so that it
4030 always also affects __progname.
4032 2002-06-27 Thomas Pfaff <tpfaff@gmx.net>
4034 * thread.cc (pthread::create): Add trace printf to get CreateThread
4037 2002-06-27 Corinna Vinschen <corinna@vinschen.de>
4039 * mmap.cc (list::match): Check using pagesize aligned size.
4041 2002-06-26 Christopher Faylor <cgf@redhat.com>
4043 * fhandler_disk_file.cc (fhandler_disk_file::fstat_by_name): Force
4044 FindFirstFile on first file of directory when asking for x:\ .
4046 2002-06-26 Christopher Faylor <cgf@redhat.com>
4048 * cygheap.cc (cygheap_user::set_name): Correct thinko in below change.
4050 2002-06-26 Christopher Faylor <cgf@redhat.com>
4052 * cygheap.cc (cygheap_user::set_name): Avoid clearing things when just
4053 setting name to itself or during first time initialization.
4055 * environ.cc (check_case_init): Make case insensitive.
4057 2002-06-26 Corinna Vinschen <corinna@vinschen.de>
4059 * fhandler.h (fhandler_socket::bind): Add method definition.
4060 (fhandler_socket::connect): Ditto.
4061 (fhandler_socket::listen): Ditto.
4062 (fhandler_socket::accept): Ditto.
4063 (fhandler_socket::getsockname): Ditto.
4064 (fhandler_socket::getpeername): Ditto.
4065 (fhandler_socket::recvfrom): Ditto.
4066 (fhandler_socket::recvmsg): Ditto.
4067 (fhandler_socket::sendto): Ditto.
4068 (fhandler_socket::sendmsg): Ditto.
4069 (fhandler_socket::shutdown): Ditto.
4070 * fhandler_socket.cc (get_inet_addr): Move here from net.cc.
4071 (fhandler_socket::bind): New method.
4072 (fhandler_socket::connect): Ditto.
4073 (fhandler_socket::listen): Ditto.
4074 (fhandler_socket::accept): Ditto.
4075 (fhandler_socket::getsockname): Ditto.
4076 (fhandler_socket::getpeername): Ditto.
4077 (fhandler_socket::recvfrom): Ditto.
4078 (fhandler_socket::recvmsg): Ditto.
4079 (fhandler_socket::sendto): Ditto.
4080 (fhandler_socket::sendmsg): Ditto.
4081 (fhandler_socket::shutdown): Ditto.
4082 * net.cc: Various formatting cleanups throughout.
4083 (get_inet_addr): Move to fhandler_socket.cc.
4084 (cygwin_bind): Move base functionality to appropriate fhandler_socket
4086 (cygwin_connect): Ditto.
4087 (cygwin_listen): Ditto.
4088 (cygwin_accept): Ditto.
4089 (cygwin_getsockname): Ditto.
4090 (cygwin_getpeername): Ditto.
4091 (cygwin_recvfrom): Ditto.
4092 (cygwin_recvmsg): Ditto.
4093 (cygwin_sendto): Ditto.
4094 (cygwin_sendmsg): Ditto.
4095 (cygwin_shutdown): Ditto.
4097 2002-06-26 Corinna Vinschen <corinna@vinschen.de>
4099 * pwdgrp.h (pwdgrp_read::~pwdgrp_read): Avoid compiler warning.
4101 2002-06-26 Christopher Faylor <cgf@redhat.com>
4103 * dcrt0.cc (_dcrt0): Be more defensive when reserved block is used and
4104 it's not cygwin info.
4106 2002-06-26 Christopher Faylor <cgf@redhat.com>
4108 * autoload (noload): Avoid clobbering bx register.
4110 * environ.cc (codepage_init): Use case insensitive match.
4112 * fhandler_console.cc (cp_get_internal): Delete.
4113 (con_to_str): Use get_cp to derive code page.
4114 (str_to_con): Ditto.
4115 * miscfuncs.cc (get_cp): New function.
4116 (sys_wcstombs): New function. Converted from macro.
4117 (sys_mbstowcs): Ditto.
4118 * winsup.h: Reflect above changes.
4120 2002-06-26 Christopher Faylor <cgf@redhat.com>
4122 * winsup.h: Minor cleanup.
4123 * path.h (path_conv::[]): New operator.
4124 * syscalls.cc (_link): Use path_conv operators rather than methods,
4125 where appropriate. Minor white space cleanup.
4127 2002-06-26 Christopher Faylor <cgf@redhat.com>
4129 * include/cygwin/version.h: Bump DLL minor number.
4131 2002-06-25 Thomas Pfaff <tpfaff@gmx.net>
4133 * include/pthread.h (PTHREAD_CANCELED): Define a reasonable value.
4134 * pthread.cc (pthread_exit): Call method instead of function.
4135 (pthread_setcancelstate): Ditto.
4136 (pthread_setcanceltype): Ditto.
4137 (pthread_testcancel): Ditto.
4138 * thread.h (pthread::cancel_event): New member.
4139 (__pthread_cancel_self): New prototype.
4140 (pthread::exit): New Method.
4141 (pthread::cancel): Ditto.
4142 (pthread::testcancel): Ditto.
4143 (pthread::cancel_self): Ditto.
4144 (pthread::static_cancel_self): Ditto.
4145 (pthread::setcancelstate): Ditto.
4146 (pthread::setcanceltype): Ditto.
4147 (__pthread_cancel): Give c++ linkage.
4148 (__pthread_exit): Remove.
4149 (__pthread_setcancelstate): Ditto.
4150 (__pthread_setcanceltype): Ditto.
4151 (__pthread_testcancel): Ditto.
4152 * thread.cc (pthread::pthread): Inititialize cancel_event.
4153 (pthread::~pthread): Close cancel_event if needed.
4154 (pthread::create): Create cancel_event.
4155 (pthread::exit): New method. Replacement for __pthread_exit.
4156 (pthread::cancel): New method.
4157 (pthread::testcancel): Ditto.
4158 (pthread::static_cancel_self); New static method.
4159 (pthread::setcancelstate): New method. Replacement for
4160 __pthread_setcancelstate.
4161 (pthread::setcanceltype): New method. Replacement for
4162 __pthread_setcanceltype.
4163 (pthread::pop_cleanup_handler): Add lock for async cancel safe
4165 (pthread::thread_init_wrapper): Change __pthread_exit to
4167 (__pthread_cancel): Call method thread->cancel().
4168 (__pthread_exit): Remove.
4169 (__pthread_setcancelstate): Ditto.
4170 (__pthread_setcanceltype): Ditto.
4171 (__pthread_testcancel): Ditto.
4173 2002-06-25 Christopher Faylor <cgf@redhat.com>
4175 * dcrt0.cc (sm): Make NO_COPY.
4177 2002-06-25 Corinna Vinschen <corinna@vinschen.de>
4179 * syscalls.cc (chown): Convert uid to 32 bit.
4183 2002-06-24 Christopher Faylor <cgf@redhat.com>
4185 * dtable.cc (dtable::find_unused_handle): Avoid coercion.
4187 2002-06-24 Christopher Faylor <cgf@redhat.com>
4189 * dtable.cc (fhandler_base::dup2): Cleanup. Ensure that lock is turned
4190 off in error condition.
4192 2002-06-24 Corinna Vinschen <corinna@vinschen.de>
4194 * uinfo.cc (internal_getlogin): Set myself->uid and myself->gid instead
4195 of user.real_uid and user.real_gid.
4196 (uinfo_init): Evaluate orig_uid and real_uid from myself->uid. Ditto
4199 2002-06-23 Pierre Humblet <pierre.humblet@ieee.org>
4201 * security.cc (get_group_sidlist): Add pw argument and use pw->pw_name
4202 in call to get_supplementary_group_sidlist.
4203 (create_token): Add pw argument and use it in call to
4205 * security.h: Add pw argument in declaration of create_token.
4206 * syscalls.cc (seteuid32): Add pw argument in call to create_token.
4208 2002-06-23 Conrad Scott <conrad.scott@dsl.pipex.com>
4210 * fhandler.cc (fhandler_base::fstat): Set S_IFIFO for pipes.
4211 * fhandler_socket.cc (fhandler_socket.cc::fstat): Set S_IFSOCK.
4213 2002-06-23 Christopher Faylor <cgf@redhat.com>
4215 * lib/_cygwin_S_IEXEC.cc: Remove obsolete file.
4217 2002-06-23 Christopher Faylor <cgf@redhat.com>
4219 Use cygwin_{shm,ipc}.h instead of /sys/{shm,ipc}.h throughout.
4220 * sys/ipc.h: Remove.
4221 * sys/shm.h: Remove.
4222 * cygwin_ipc.h: New file.
4223 * cygwin_shm.h: New file.
4225 2002-06-23 Christopher Faylor <cgf@redhat.com>
4227 * cygwin.sc: Add recent changes from ld sources.
4229 2002-06-23 Conrad Scott <conrad.scott@dsl.pipex.com>
4231 * winsup.h: Move #ifdef EXPCGF code into "winbase.h".
4232 * winbase.h: #ifdef EXPCGF code moved here from "winsup.h".
4234 2002-06-12 Thomas Pfaff <tpfaff@gmx.net>
4236 * thread.h (pthread::cleanup_stack): Rename cleanup_handlers to
4238 * thread.cc (pthread::pthread): Ditto.
4239 (pthread::create): Fix mutex verification.
4240 (pthread::push_cleanup_handler): Renam cleanup_handlers to
4241 cleanup_stack. Remvoe Mutex calls, use InterlockedExchangePointer
4243 (pthread::pop_cleanup_handler): Rename cleanup_handlers to
4245 (pthread::pop_all_cleanup_handlers): Ditto.
4246 (__pthread_once): Check state first and return if already done.
4247 (__pthread_join): Revert DEADLOCK test to __pthread_equal call.
4248 (__pthread_detach): Unlock mutex before deletion.
4250 2002-06-21 Christopher Faylor <cgf@redhat.com>
4252 * Makefile.in (cygrun.exe): Move -lgcc where it will do some good.
4254 2002-06-21 Corinna Vinschen <corinna@vinschen.de>
4256 * syscalls.cc (stat64_to_stat32): Correctly evaluate st_rdev.
4257 (fstat64): Set st_rdev to same value as st_dev.
4258 (stat_worker): Ditto.
4260 2002-06-21 Corinna Vinschen <corinna@vinschen.de>
4262 * security.cc (alloc_sd): Carefully check owner_sid again after trying
4265 2002-06-21 Corinna Vinschen <corinna@vinschen.de>
4267 * security.cc (alloc_sd): Remove unnecessary retrieval of owner name.
4268 Check uid for current user first and use SIDs from cygheap if so.
4269 Set errno to EINVAL if user SID isn't retrievable. Just print user SID
4271 Don't bail out if group SID isn't retrievable. Change debug output
4274 2002-06-21 Christopher Faylor <cgf@redhat.com>
4276 * errno.cc: Change text description for EBADF throughout.
4278 2002-06-20 Pierre Humblet <pierre.humblet@ieee.org>
4280 * uinfo.cc (cygheap_user::ontherange): Use env_name for NetUserGetInfo.
4281 (cygheap_user::env_logsrv): Verify env_domain is valid.
4282 * environ.cc: Include child_info.h and keep spenvs[] sorted.
4283 (environ_init): Check child_proc_info instead of myself->ppid_handle.
4285 2002-06-19 Christopher Faylor <cgf@redhat.com>
4287 * fhandler.cc (fhandler_base::set_flags): Change priority of "linked
4288 in" default binmode setting so that it has priority over optional
4291 2002-06-19 Christopher Faylor <cgf@redhat.com>
4293 Use hMainProc where appropriate, throughout.
4294 * environ.cc (spenv::retrieve): Add debugging statements.
4296 * pinfo.cc (set_myself): Don't call strace.hello if already stracing.
4297 * strace.cc (strace): Move NO_COPY keyword so that it will actually
4300 2002-06-19 Corinna Vinschen <corinna@vinschen.de>
4302 * uinfo.cc (cygheap_user::ontherange): Call NetUserGetInfo() only with
4303 non-NULL logserver parameter.
4305 2002-06-16 Christopher Faylor <cgf@redhat.com>
4307 * cygheap.h (cygheap_user::issetuid): New method.
4308 * dtable.cc (dtable::vfork_child_dup): Use new method to determine if
4309 we are in "setuid mode."
4310 * fork.cc (fork_parent): Ditto.
4311 * spawn.cc (spawn_guts): Ditto.
4312 * syscalls.cc (seteuid32): Ditto.
4314 * environ.cc (spenv::retrieve): (Suggested by Pierre Humblet) Do
4315 potential recalculation of cygheap_user stuff when in setuid mode.
4316 Return special value when environment variable should be calculated but
4318 (build_env): Don't add retrieved value to dstp if it is 'dont_add'.
4320 2002-06-16 Christopher Faylor <cgf@redhat.com>
4322 Changes suggested by Pierre Humblet.
4323 * environ.cc (NL): New macro.
4324 (conv_envvars): Use NL macro to fill in name and namelen.
4325 (spenv::namelen): New field.
4326 (spenvs): Use NL to fill in name and namelen.
4327 (spenv::retrieve): Eliminate length argument. Instead, use namelen
4329 (build_env): Don't calculate length of initial FOO= part of
4330 environment. Accommodate spenv::retrive argument change.
4332 2002-06-16 Christopher Faylor <cgf@redhat.com>
4334 * cygheap.h (cygheap_user::winname): New field.
4335 * cygheap.cc (cygheap_user::set_name): Clear winname when name changes.
4336 * uinfo.cc (cygheap_user::env_logsrv): Avoid calculating server when
4337 Windows user == SYSTEM.
4338 (cygheap_user::env_domain): Set winname here too.
4339 (cygheap_user::env_userprofile): Eliminate superfluous tests.
4340 (cygheap_user::env_name): Seed winname by calling env_domain().
4342 2002-06-12 Pierre Humblet <pierre.humblet@ieee.org>
4344 * spawn.cc (spawn_guts): Revert removal of ciresrv.moreinfo->uid =
4347 2002-06-15 Christopher Faylor <cgf@redhat.com>
4349 * child_info.h (child_proc_info): Declare as base class.
4350 (spawn_info): Declare as alias of child_proc_info to aid debugging.
4352 * cygheap.cc (cygheap_fixup_in_child): Use child_proc_info global
4353 rather than parameter.
4354 * cygheap.h (cygheap_fixup_in_child): Reflect above change in
4356 * dcrt0.cc (_dll_crt0): Move 'si' definition here. Assign
4358 (dll_crt0_1): Accommodate cygheap_fixup_in_child and *_info changes.
4359 * environ.cc (spenv::retrieve): Make regparm.
4360 * environ.h (environ_init): Ditto.
4361 (win_env::add_cache): Ditto.
4364 * fork.cc (sync_with_parent): Use fork_info global.
4365 (fork_child): Ditto.
4367 2002-06-14 Christopher Faylor <cgf@redhat.com>
4369 * uinfo.cc (cygheap_user::ontherange): Don't set HOMEDRIVE or HOMEPATH
4370 unless one or the other is specified.
4372 2002-06-14 Christopher Faylor <cgf@redhat.com>
4374 * cygheap.h (cygheap_user::userprofile_env_buf): New static member.
4375 * environ.cc (build_env): Add debugging statement.
4376 (spenvs): Switch functions for USERDOMAIN and USERNAME.
4377 * spawn.cc (spawn_guts): Move environment initialization prior to
4378 cygheap_setup_for_child or environment info will never be copied to
4381 2002-06-14 Christopher Faylor <cgf@redhat.com>
4383 * cygheap.h (cygheap_user): Add static members to hold home{drive,path}
4385 * uinfo.cc (cygheap_user::ontherange): Use static class members for
4386 local HOME* storage.
4388 2002-06-14 Christopher Faylor <cgf@redhat.com>
4390 * cygheap.cc (cygheap_user::set_logsrv): Remove.
4391 (cygheap_user::set_domain): Ditto.
4392 * cygheap.h (cygheap_user::set_logsrv): Remove declaration.
4393 (cygheap_user::set_domain): Ditto.
4394 (cygheap_user::env_domain): Declare new method.
4395 (cygheap_user::env_name): Ditto.
4396 * environ.cc (spenvs): Add two environment variables.
4397 * spawn.cc (spawn_guts): Call build_env after RevertToSelf. Always set
4399 (cygheap_user::ontherange): Recalculate homedrive/homepath if they are
4400 empty. Use env_logsrv to get logon server.
4401 (cygheap_user::env_logsrv): Calculate server name here rather than
4402 relying on it having been previously calculated.
4403 (cygheap_user::env_domain): Ditto for domain name.
4404 (cygheap-user::env_name): New method.
4406 2002-06-12 Pierre Humblet <pierre.humblet@ieee.org>
4408 * syscalls.cc (seteuid32): Do not get or set the environment. Do not
4409 call LookupAccountSid nor internal_getlogin. Set cygheap->user name
4410 and sid from the passwd entry.
4411 * uinfo.cc (uinfo_init): Only call internal_getlogin when starting from
4412 a non Cygwin process and use the values returned in user.
4413 (internal_getlogin): Simplify to case where starting from a non Cygwin
4414 process. Store return values in user and return void. Do not set the
4415 Windows default environment.
4416 * dcrt0.cc (dll_crt0_1): Call uinfo_init only when needed. Do not set
4417 myself->uid nor reset user.sid.
4418 * spawn.cc (spawn_guts): Get the sid from cygheap->user. Always
4419 RevertToSelf(). Don't set uid in impersonated case.
4420 * cygheap.cc (cygheap_user::set_sid): Do not set orig_sig.
4421 (cygheap_user::set_orig_sid): New.
4422 * cygheap.h: Declare cygheap_user::set_sid.
4423 * winsup.h: Add argument to uinfo_init().
4425 2002-06-14 Corinna Vinschen <corinna@vinschen.de>
4427 * environ.cc (build_env): If realloc moves envblock, move s with it.
4429 2002-06-13 Nicholas S. Wourms <nwourms@netscape.net>
4431 * winver.rc: Add more words to copyright.
4433 2002-06-13 Corinna Vinschen <corinna@vinschen.de>
4435 * cygheap.cc (cygheap_user::set_name): Revert previous change.
4436 * environ.cc (spenv::retrieve): Check return value of call to
4437 cygheap->user.*from_cygheap().
4439 2002-06-13 Corinna Vinschen <corinna@vinschen.de>
4441 * cygheap.cc (cygheap_user::set_name): Remove setting homedrive and
4443 (cygheap_user::set_logsrv): Fix free'ing of plogsrv.
4444 * cygheap.h (cygheap_user::cygheap_user): Initialize homedrive and
4447 2002-06-13 Christopher Faylor <cgf@redhat.com>
4449 * security.cc (get_logon_server): Use strcasematch rather than
4452 2002-06-12 Christopher Faylor <cgf@redhat.com>
4454 * path.cc (chdir): Minor cleanup.
4456 2002-06-12 Christopher Faylor <cgf@redhat.com>
4458 * environ.cc (build_env): Correctly fill out windows environment block
4459 with win32 paths rather than posix paths.
4461 2002-06-12 Christopher Faylor <cgf@redhat.com>
4463 * cygheap.cc (cygheap_user::set_name): Set homedrive and homepath to
4464 NULL on user name change.
4465 (cygheap_user::set_logsrv): Allocate enough space for leading \\ so
4466 that we can put this in the environment, if needed.
4467 * cygheap.h (homebodies): New enum.
4468 (cygheap_user::homedrive): New field.
4469 (cygheap_user::homepath): Ditto.
4470 (cygheap_user::env_logsrv): New method.
4471 (cygheap_user::env_homepath): New method.
4472 (cygheap_user::env_homedrive): New method.
4473 (cygheap_user::env_userprofile): New method.
4474 (cygheap_user::ontherange): New method.
4475 * environ.cc (envsize): Eliminate debugging argument.
4476 (environ_init): Assume that envc counts number of elments not total
4479 (spenvs): New array, rename from forced_winenv_vars, using spenv.
4480 (spenv::retrieve): New method.
4481 (build_env): Rename from 'winenv' -- one stop shopping for building new
4482 environment blocks for both windows and "unix".
4483 * environ.h (build_env: Declare.
4484 (winenv): Delete declaration.
4486 * spawn.cc (spawn_guts): Use build_env to build windows and cygwin
4488 * uinfo.cc (internal_getlogin): Eliminate environment manipulation.
4489 Default to info from GetUserName if it exists. Move HOMEPATH and
4490 HOMEDRIVE stuff elsewhere. Move HOME setting elsewhere. Only set HOME
4491 environment variable in processes that are not parented by a cygwin
4493 (cygheap_user::ontherange): Define new method.
4494 (cygheap_user::env_logsrv): Ditto.
4495 (cygheap_user::env_homepath): Ditto.
4496 (cygheap_user::env_homedrive): Ditto.
4497 (cygheap_user::env_userprofile): Ditto.
4499 2002-06-11 Christopher Faylor <cgf@redhat.com>
4501 * spawn.cc (spawn_guts): More hToken removal cleanup.
4503 2002-06-09 Pierre Humblet <pierre.humblet@ieee.org>
4505 * spawn.cc (spawn_guts): Define sec_attribs and call sec_user_nih()
4508 2002-06-10 Christopher Faylor <cgf@redhat.com>
4510 * Makefile.in: Ensure that -MD gets added to CFLAGS regardless of
4511 CFLAGS command-line setting.
4513 * cygwin.din: Export sexec* functions as function which returns ENOSYS
4514 (i.e., sexec* is deprecated).
4515 * dtable.cc (dtable::vfork_child_dup): Ensure that impersonation is
4516 restored even on failure.
4517 * exec.cc: Throughout, remove references to sexec* and _spawnve.
4518 * pinfo.h: Remove _spawnve declaration.
4519 * spawn.cc: Rename _spawnve to spawnve and use throughout.
4520 (spawn_guts): Eliminate hToken argument and processing of same. Just
4521 perform special actions if impersonating.
4522 (spawnve): Rename from _spawnve.
4524 2002-06-10 Christopher Faylor <cgf@redhat.com>
4526 * include/sys/strace.h (strace): Avoid use of constructor.
4528 2002-06-10 Christopher Faylor <cgf@redhat.com>
4530 * dcrt0.cc (dll_crt0_1): Initialize wincap and check for sanity before
4531 running global ctors.
4532 * wincap.h (wincap): Eliminate constructor. Default is to zero memory,
4534 * wincap.cc (wincap): Copy this on fork to avoid initialization in
4537 2002-06-10 Corinna Vinschen <corinna@vinschen.de>
4539 * fhandler.h (fhandler_socket::fixup_after_fork): Revert patch from
4541 * fhandler_socket.cc (fhandler_socket::fixup_after_fork): Ditto.
4542 (fhandler_socket::dup): Ditto.
4543 * net.cc (fdsock): Make sockets explicitely noninheritable on NT.
4545 2002-06-09 Christopher Faylor <cgf@redhat.com>
4547 * fhandler_disk_file.cc (fhandler_disk_file::fstat_helper): Correctly
4548 set number of links for directory, if appropriate.
4550 2002-06-10 Robert Collins <rbtcollins@hotmail.com>
4552 * thread.cc: Variation of a patch from Thomas Pffaf.
4553 (__pthread_detach): Cleanup thread object if the thread has terminated.
4554 (__pthread_join): Change order of error checks, and lock against
4555 join/detach/exit races.
4556 (__pthread_exit): Lock object against join/detach/exit races.
4557 (pthread::thread_init_wrapper): Ditto.
4558 (thread_init_wrapper): Rename to pthread::thread_init_wrapper.
4559 (pthread::create): Check that the mutex initialized correctly.
4560 (pthread::push_cleanup_handler): Lock against potential cancellation
4561 race. NB: this may not be required if pthread_cleanup_push is non-
4563 * thread.h (pthread::mutex): New member.
4564 (thread_init_wrapper): Rename to pthread::thread_init_wrapper.
4565 (pthread::thread_init_wrapper_: New static member.
4567 2002-06-10 Robert Collins <rbtcollins@hotmail.com>
4569 * cygwin.din: Add _pthread_cleanup_push and _pthread_cleanup_pop.
4570 * pthread.cc: Change __pthread_self to pthread::self() thruoghout.
4571 (_pthread_cleanup_push): New function.
4572 (_pthread_cleanup_pop): Ditto.
4573 * thread.cc: Thanks to Thomas Pfaff for the pthread cleanup_push,_pop
4574 patch, this work is derived from that.
4575 Change __pthread_self to pthread::self() thruoghout.
4576 (__pthread_self): Rename to pthread::self.
4577 (pthread::self): New method.
4578 (pthread::pthread): Initialize new member.
4579 (pthread::push_cleanup_handler): New method.
4580 (pthread::pop_cleanup_handler): New method.
4581 (pthread::pop_all_cleanup_handlers): New method.
4582 (__pthread_exit): Pop all cleanup handlers.
4583 * thread.h (pthread::push_cleanup_handler): Declare.
4584 (pthread::pop_cleanup_handler): Ditto.
4585 (pthread::pop_all_cleanup_handlers): Ditto.
4586 (pthread::self): New static method.
4587 (__pthread_exit): Give C++ linkage.
4588 (__pthread_join): Ditto.
4589 (__pthread_detach): Ditto.
4590 (__pthread_self): Remove.
4592 2002-04-24 Thomas Pfaff <tpfaff@gmx.net>
4594 * include/pthread.h (__pthread_cleanup_handler): New structure.
4595 (pthread_cleanup_push): Rewritten.
4596 (pthread_cleanup_pop): Ditto.
4597 (_pthread_cleanup_push): New prototype.
4598 (_pthread_cleanup_pop): Ditto.
4600 2002-04-24 Thomas Pfaff <tpfaff@gmx.net>
4602 * thread.cc (thread_init_wrapper): Check if thread is already joined.
4603 (__pthread_join): Set joiner first.
4604 (__pthread_detach): Ditto.
4606 2002-06-10 Robert Collins <rbtcollins@hotmail.com>
4608 * cygserver_transport.cc (create_server_transport): Finish the split
4609 out of sockets code from transport_layer_base. Thanks to Nicholas
4610 Wourms and Conrad Scott for catching this.
4612 2002-06-08 Christopher Faylor <cgf@redhat.com>
4614 * pinfo.cc (pinfo_dummy): Initialize to correct size.
4616 2002-06-08 Christopher Faylor <cgf@redhat.com>
4618 * path.cc: Change MOUNT_AUTO to MOUNT_CYGDRIVE throughout.
4619 * shared_info.h (CURR_MOUNT_MAGIC): Update.
4621 2002-06-08 Christopher Faylor <cgf@redhat.com>
4623 * external.cc (cygwin_internal): Make v1 mount table access invalid.
4624 * path.cc (mount_info::init): Remove had_to_create_mount_areas initialization.
4625 (mount_info::from_registry): Remove v1 table import.
4626 (mount_info::read_v1_mounts): Eliminate.
4627 (mount_info::import_v1_mounts): Ditto.
4628 * shared_info.h (mount_info): Ditto for both of above.
4629 * sys/mount.h (MOUNT_DEVFS): New enum.
4630 (MOUNT_PROC): Ditto.
4632 2002-06-08 Christopher Faylor <cgf@redhat.com>
4634 * include/wchar.h: Define __need_size_t.
4636 2002-06-07 Christopher Faylor <cgf@redhat.com>
4638 * fhandler_socket.cc (fhandler_socket::fstat): Don't assume that socket
4639 is unix-domain socket.
4641 2002-06-07 Christopher Faylor <cgf@redhat.com>
4643 * times.cc (hires_ms::prime): Set init flag.
4645 2002-06-07 Conrad Scott <conrad.scott@dsl.pipex.com>
4647 * times.cc (hires_ms::prime): Adjust epoch of initime_us from 1601 to
4650 2002-06-06 Christopher Faylor <cgf@redhat.com>
4652 * autoload.cc (timeGetDevCaps): Define new autoload function.
4653 (timeGetTime): Ditto.
4654 (timeBeginPeriod): Ditto.
4655 (timeEndPeriod): Ditto.
4656 * hires.h (hires_base): New class. Rename from hires.
4657 (hires_us): New class.
4658 (hires_ms): New class.
4659 * strace.cc (strace::microseconds): Use hires_us class.
4660 * times.cc (gettimeofday): Use hires-ms class.
4661 (hires_us::prime): Rename from hires::prime.
4662 (hires_us::usecs): Rename from hires:usecs.
4663 (hires_ms::prime): New method.
4664 (hires_ms::usecs): New method.
4665 (hires_ms::~hires_ms): New destructor.
4667 2002-06-06 Christopher Faylor <cgf@redhat.com>
4669 * autoload.cc (noload): Correctly save argument count register.
4671 2002-06-05 Conrad Scott <conrad.scott@dsl.pipex.com>
4673 * fhandler.cc (fhandler_base::fstat): Initialise tv_nsec member of
4674 st_atim, st_mtim, and st_ctim fields.
4675 * fhandler_disk_file.cc (fhandler_disk_file::fstat_helper): Ditto.
4676 * fhandler_process.cc (fhandler_process::fstat): Ditto.
4677 * glob.c (stat32_to_STAT): Copy across the whole st_atim, st_mtime, and
4679 * syscalls.cc (stat64_to_stat32): Ditto.
4680 * times.cc (to_timestruc_t): New function.
4681 (time_as_timestruc_t): New function.
4682 * winsup.h: Add to_timestruc_t and time_as_timestruc_t functions.
4683 * include/cygwin/stat.h: Replace time_t with timestruc_t throughout for
4684 all file times, removing the st_spare1, st_spare2, and st_spare3 fields
4685 in the process. Add macros to access tv_sec fields by old names.
4686 * include/cygwin/types.h: Typedef timespec_t and timestruc_t as struct
4689 2002-06-03 Pierre Humblet <pierre.humblet@ieee.org>
4691 * sec_helper.cc (lookup_name): Suppress.
4692 * security.cc (alloc_sd): Remove logsrv argument.
4693 Remove two calls to lookup_name.
4694 (set_security_attribute): Remove logsrv argument.
4695 Remove logsrv argument in call to alloc_sd.
4696 (set_nt_attribute): Remove logsrv argument.
4697 Remove logsrv argument in call to set_security_attribute.
4698 (set_file_attribute): Remove logsrv argument.
4699 Remove logsrv argument in call to set_nt_attribute.
4700 (set_file_attribute): Remove logsrv argument.
4701 Remove logsrv argument in call to set_file_attribute.
4702 * syscalls.cc (chown_worker): Remove logserver argument in
4703 call to set_file_attribute.
4705 * shm.cc (shmget): Remove logsrv argument in call to alloc_sd.
4706 * uinfo.cc (internal_getlogin): Replace calls to
4707 lookup_name by call to LookupAccountName.
4708 * security.h: Remove logsrv in declarations of set_file_attribute
4709 and alloc_sd. Remove declaration of lookup_name.
4711 2002-06-05 Christopher Faylor <cgf@redhat.com>
4713 * child_info.h (CHILD_INFO_MAGIC): Oops. Revert previous change. gcc
4716 2002-06-05 Christopher Faylor <cgf@redhat.com>
4718 * child_info.h (CHILD_INFO_MAGIC): Update.
4720 2002-06-05 Christopher Faylor <cgf@redhat.com>
4722 * strace.cc (strace::hello): Set inited, when appropriate.
4724 2002-06-05 Christopher Faylor <cgf@redhat.com>
4726 * cygwin.din: Eliminate some newlib wrappers.
4727 * path.cc (get_devn): Only consider first 99 potential com devices.
4728 (get_device_number): Ditto.
4729 * times.cc (_times): Eliminate.
4730 (_times): Rename from times().
4732 2002-06-05 Christopher Faylor <cgf@redhat.com>
4734 * dir.cc (rmdir): Streamline. Detect attempts to remove directories
4735 from "read-only" virtual devices. (Suggested by Pavel Tsekov)
4736 * syscalls.cc (unlink): Detect attempts to remove directories from
4737 "read-only" virtual devices. (From Pavel Tsekov)
4739 2002-06-05 Christopher Faylor <cgf@redhat.com>
4741 * dtable.cc (handle_to_fn): Check error return value from NtQueryObject
4742 first before seeing if name buffer is NULL.
4744 * grp.cc (read_etc_group): Fix gcc warning regarding snprintf format.
4745 * passwd.cc (read_etc_passwd): Ditto.
4747 2002-04-18 Thomas Pfaff <tpfaff@gmx.net>
4749 * thread.h (pthread::joiner): New member.
4750 * thread.cc (pthread::pthread): Initialize joiner to NULL
4751 (pthread::create): Increment of thread counter moved from
4752 __pthread_create to this location.
4753 (__pthread_create): Increment thread counter removed.
4754 (thread_init_wrapper): Set joiner to self when thread was created
4756 (__pthread_exit): delete thread when it is detached and not
4758 (__pthread_join): Check for deadlock and delete thread when it has
4760 (__pthread_detach): Set joiner to self when thread state
4761 changed to detached.
4763 2002-06-05 Corinna Vinschen <corinna@vinschen.de>
4765 * grp.cc (read_etc_group): When emulating nonexisting group file on
4766 NT systems, read primary group SID from process token. Use that info
4767 to create correct group entry. On error or on 9x systems fallback
4768 to emulating Administrators group as before.
4769 * passwd.cc (read_etc_passwd): When emulating nonexisting passwd file
4770 on NT systems, read user and primary group SID from process token.
4771 Use that info to create correct passwd entry. On error or on 9x
4772 systems fallback to emulating user with Administrator user id and
4773 Administrators group as before.
4775 2002-06-05 Corinna Vinschen <corinna@vinschen.de>
4777 * grp.cc (etc_group): Removed.
4778 (parse_grp): Make line parameter nonconst. Don't copy data into new
4779 allocated memory. Check for CR instead of LF to accomodate new
4781 (add_grp_line): Make line parameter nonconst.
4782 (read_etc_group): Rearrange using new pwdgrp_read class.
4783 * passwd.cc (parse_pwd): Don't copy data into new allocated memory.
4784 Check for CR instead of LF to accomodate new read method.
4785 (read_etc_passwd): Rearrange using new pwdgrp_read class.
4786 * pwdgrp.h (pwdgrp_check::set_last_modified): Use different
4788 (class pwdgrp_read): New class for opening and reading passwd and
4791 2002-06-04 Christopher Faylor <cgf@redhat.com>
4793 * dtable.cc (handle_to_fn): Attempt to handle "raw" accesses to remote
4795 * path.cc (mount_info::conv_to_win32_path): Set flags to binary when
4796 mount entry is not found.
4797 (mount_info::set_flags_from_win32_path): Ditto.
4799 2002-06-04 Christopher Faylor <cgf@redhat.com>
4801 * dtable.cc (handle_to_fn): Correct placement and length of name
4802 buffer. (Suggested by Pavel Tsekov)
4804 2002-06-04 Christopher Faylor <cgf@redhat.com>
4806 Remove fcntl.h includes throughout.
4807 * fhandler.h: Move fcntl.h include here.
4808 (fhandler_base::set_flags): Accept supplied_bin argument. Make
4810 * dtable.cc (dtable::init_std_file_from_handle): Just use binmode from
4812 (reset_to_open_binmode): Use set_flags.
4813 * cygwin.din (open): Avoid newlib wrapper.
4817 * fhandler.cc (fhandler_base::set_flags): Accept supplied_bin argument.
4818 Make binmode decisions here.
4819 (fhandler_base::open): Avoid using pc if it is NULL. Eliminate binmode
4820 logic. Just call set_flags with binmode argument.
4821 (fhandler_base::init): Call set_flags with binmode argument.
4822 * fhandler_clipboard.cc (fhandler_dev_clipboard::open): Ditto.
4823 * fhandler_console.cc (fhandler_console::open): Ditto.
4824 (fhandler_console::init): Force binary on open.
4825 * fhandler_disk_file.cc (fhandler_disk_file::open): Don't set binmode
4826 here. Let it happen in base class.
4827 * fhandler_dsp.cc (fhandler_dev_dsp::open): Force binmode open. Set
4828 return value appropriately if unable to open.
4829 * fhandler_proc.cc (fhandler_proc::open): Make sure flags are set
4831 * fhandler_process.cc (fhandler_process::open): Ditto.
4832 * fhandler_registry.cc (fhandler_registry::open): Ditto.
4833 * fhandler_random.cc (fhandler_dev_random::fhandler_dev_random): Ditto.
4834 * fhandler_raw.cc (fhandler_dev_raw::open): Force O_BINARY by default.
4835 * fhandler_serial.cc (fhandler_serial::init): Ditto.
4836 * fhandler_tty.cc (fhandler_tty_slave::open): Ditto.
4837 (fhandler_pty_master::open): Ditto.
4838 * fhandler_virtual.cc (fhandler_virtual::open): Ditto.
4839 * fhandler_windows.cc (fhandler_windows::open): Ditto.
4840 * fhandler_zero.cc (fhandler_dev_zero::open): Ditto.
4841 * net.cc (fdsock): Ditto.
4842 * path.cc (path_conv::check): Avoid checking for executable extension
4843 when directory. (Suggested by Pavel Tsekov)
4844 (set_flags): Set PATH_TEXT explicitly, when appropriate.
4845 (mount_info::conv_to_win32_path): Use set_flags() to set path flags.
4846 * path.h (PATH_TEXT): New enum.
4847 (path_conv::binmode): Return appropriate constant based on binmode.
4848 * pipe.cc (make_pipe): Set binmode to O_TEXT xor O_BINARY.
4849 * syscalls.cc (setmode_helper): Make debugging message a little
4851 (setmode): Set binmode via set_flags.
4853 2002-06-04 Corinna Vinschen <corinna@vinschen.de>
4855 * fhandler.h (class fhandler_socket): Add private method
4856 fixup_after_fork (bool, HANDLE).
4857 * fhandler_socket.cc (fhandler_socket::fixup_after_fork): Move
4858 functionality to new private method. Add closing parent socket
4859 if not called from dup(). Create method new calling private method
4860 with appropriate parameter.
4861 (fhandler_socket::fixup_after_exec): Call private method
4862 fixup_after_fork with appropriate parameter.
4863 (fhandler_socket::dup): Ditto.
4865 2002-06-04 Corinna Vinschen <corinna@vinschen.de>
4867 * fhandler_dsp.cc (fhandler_dev_dsp::open): Set errno to EACCES if
4868 requested mode isn't supported.
4870 2002-06-03 Christopher Faylor <cgf@redhat.com>
4872 * fhandler.cc (fhandler_base::open): Don't set binmode if already set.
4873 Don't check for file. Files should already be set. Report on binary
4875 (fhandler_base::fhandler_base): Don't set default binmode here. That's
4877 * fhandler_console.cc (fhandler_console::output_tcsetattr): Don't set
4878 binmode, ever, for console.
4879 * fhandler_disk_file.cc (fhandler_disk_file::open): Always set the
4880 binary mode to the value derived from mount table.
4881 * path.cc (mount_info::conv_to_win32_path): Default to binmode if path
4882 does not translate into anything in the mount table.
4884 2002-06-03 Corinna Vinschen <corinna@vinschen.de>
4886 * external.cc (cygwin_internal): Add CW_EXTRACT_DOMAIN_AND_USER
4887 handling to call extract_nt_dom_user() from applications.
4888 * include/sys/cygwin.h (cygwin_getinfo_types): Add
4889 CW_EXTRACT_DOMAIN_AND_USER.
4891 2002-06-03 Corinna Vinschen <corinna@vinschen.de>
4893 * syscalls.cc (stat64_to_stat32): Transform st_dev correctly.
4894 (fstat64): Add evaluating st_ino and st_dev.
4895 (stat_worker): Evaluate st_dev as 32 bit value.
4896 * include/cygwin/stat.h: Use new dev_t definition throughout.
4897 * include/cygwin/types.h: Define __dev16_t and __dev32_t. Define
4898 dev_t according to __CYGWIN_USE_BIG_TYPES__ setting.
4899 * include/sys/sysmacros.h: Define major, minor and makedev
4900 according to __CYGWIN_USE_BIG_TYPES__ setting.
4902 2002-06-03 Pierre Humblet <pierre.humblet@ieee.org>
4904 * syscalls.cc (setegid32): Verify the correctness of the gid
4905 of the group returned by getgrgid32.
4907 2002-06-03 Pierre Humblet <pierre.humblet@ieee.org>
4909 * security.cc (lsa2wchar): Suppressed.
4910 (get_lsa_srv_inf): Suppressed.
4911 (get_logon_server_and_user_domain): Suppressed.
4912 (get_logon_server): Essentially new.
4913 (get_user_groups): Add "domain" argument. Only lookup the
4914 designated server and use "domain" in LookupAccountName.
4915 (is_group_member): Simplify the arguments.
4916 (get_user_local_groups): Simplify the arguments. Do only a
4917 local lookup. Use "BUILTIN" and local domain in LookupAccountName.
4918 (get_user_primary_group). Only lookup the designated server.
4919 (get_group_sidlist): Remove logonserver argument. Do not lookup
4920 any server for the SYSTEM account.
4921 (create_token): Delete logonserver and call to get_logon_server.
4922 Adjust arguments of get_group_sidlist, see above.
4923 * security.h: Delete declaration of get_logon_server_and_user_domain
4924 and add declaration of get_logon_server.
4925 * uinfo.cc (internal_get_login): Call get_logon_server instead of
4926 get_logon_server_and_user_domain.
4928 2002-06-02 Christopher Faylor <cgf@redhat.com>
4930 * dtable.cc (handle_to_fn): Use largest match for device. Correctly
4931 (?) deal with remote drive weirdness.
4933 2002-06-02 Christopher Faylor <cgf@redhat.com>
4935 * fhandler_disk_file.cc (fhandler_disk_file::fstat_by_name): Check
4936 specifically for non-existent file, first.
4937 (fhandler_disk_file::fstat): Perform fd open on files with funny
4940 2002-06-02 Christopher January <chris@atomice.net>
4942 * fhandler_process.cc (fhandler_process::open): Set fileid.
4944 2002-06-02 Christopher Faylor <cgf@redhat.com>
4946 Remove unneeded sigproc.h includes throughout.
4947 * fhandler.h (fhandler_proc::fill_filebuf): Take a pinfo argument.
4948 * fhandler_proc.cc (fhandler_proc::get_proc_fhandler): Simplify search
4950 (fhandler_proc::readdir): Assume that pid exists if it shows up in the
4952 * fhandler_process.cc (fhandler_process::open): Simplify search for
4953 given pid. Call fill_filebuf with pinfo argument.
4954 (fhandler_process::fill_filebuf): Pass pinfo here and assume that it
4956 * pinfo.h (pinfo::remember): Define differently if sigproc.h is not
4959 2002-06-02 Christopher Faylor <cgf@redhat.com>
4961 * dll_init.cc (dll_list::detach): Don't run destructor on exit.
4963 2002-06-01 Christopher Faylor <cgf@redhat.com>
4965 * fhandler.cc (fhandler_base::fstat): Move dev and ino calculation into
4967 * syscalls.cc (stat_worker): Calculate dev and ino calculation here, if
4969 * fhandler_proc.cc (fhandler_proc::fhandler_proc): Minor reorg for
4971 * fhandler_process.cc (fhandler_process::exists): Return 0 on
4973 (fhandler_process::fstat): Simplify pid logic.
4974 * fhandler_tape.cc (fhandler_dev_tape::fstat): Minor reformatting.
4976 2002-06-01 Christopher Faylor <cgf@redhat.com>
4978 * path.cc (chdir): Don't allow cd'ing to a non-directory virtual path.
4980 2002-05-31 Christopher Faylor <cgf@redhat.com>
4982 * fhandler_disk_file.cc (readdir): Move inode calculation into caller.
4983 (fhandler_cygdrive::readdir): Add "." and "..".
4984 * dir.cc (readdir): Move inode calculation here so that fhandler
4985 readdirs can benefit.
4987 2002-05-31 Christopher Faylor <cgf@redhat.com>
4989 * fhandler_console.cc (fhandler_console::open): Reinstate setting of
4992 * dtable.cc (dtable::init_std_file_from_handle): Default to using
4993 binmode derived from path_conv, when required.
4994 * fhandler.h (fhandler_base::get_w_binary): Default to binmode if
4995 nothing else is specified.
4996 * fhandler.h (fhandler_base::get_r_binary): Ditto.
4998 * fhandler_disk_file.cc (fhandler_disk_file::fstat_by_handle): Work
5001 * path.cc (path_conv::check): Remove a debugging statement.
5003 2002-05-31 Christopher Faylor <cgf@redhat.com>
5005 * fhandler_console.cc (fhandler_console::open): Always default to
5007 (fhandler_console::write_normal): Don't honor binmode setting. There
5008 is already a termios setting for this.
5009 (fhandler_console::init): Correct argument order in init call.
5011 2002-05-31 Christopher Faylor <cgf@redhat.com>
5013 * fhandler.cc (fhandler_base::open): Make default open mode == binmode.
5014 (fhandler_base::init): Set open flags based on derived binmode argument.
5016 2002-05-31 Christopher Faylor <cgf@redhat.com>
5018 * dll_init.cc (dll_list::init): Eliminate unneeded debugging statement.
5020 2002-05-31 Christopher Faylor <cgf@redhat.com>
5022 * fhandler_proc.cc (fhandler_proc::readdir): Set errno when no more
5024 * fhandler_process.cc (fhandler_process::readdir): Ditto.
5025 * fhandler_registry.cc (fhandler_registry::readdir): Ditto.
5027 2002-05-30 Christopher Faylor <cgf@redhat.com>
5029 * path.cc (path_conv::check): Set fileattr to INVALID_FILE_ATTRIBUTES
5030 for nonexistent virtual device path.
5031 (chdir): Set correct errno when attempt is made to cd to nonexistent
5032 virtual device path.
5034 2002-05-30 Christopher Faylor <cgf@redhat.com>
5036 * fhandler_disk_file.cc (fhandler_disk_file::fstat): Always call
5037 fstat_by_name if fd is not opened to allow fstat_by_name to properly
5040 2002-05-30 Corinna Vinschen <corinna@vinschen.de>
5042 * autoload.cc: Replace autoload statments for ZwXXX by NtXXX.
5043 Drop ZwQuerySystemInformation since NtQuerySystemInformation was
5045 * fhandler_proc.cc (format_proc_uptime): Replace call to
5046 ZwQuerySystemInformation by call to NtQuerySystemInformation.
5047 (format_proc_stat): Ditto.
5048 * fhandler_process.cc (format_process_stat): Replace call to
5049 ZwQueryInformationProcess by call to NtQueryInformationProcess.
5050 (get_process_state): Ditto.
5051 (get_mem_values): Ditto. Replace call to ZwQueryVirtualMemory by
5052 call to NtQueryVirtualMemory.
5053 * ntdll.h: Cleanup. Drop ZwQuerySystemInformation since
5054 NtQuerySystemInformation was already available. Replace declarations
5055 of ZwXXX functions by declarations of NtXXX.
5056 * pinfo.cc (winpids::enumNT): Replace call to ZwQuerySystemInformation
5057 by call to NtQuerySystemInformation.
5059 2002-05-29 Christopher Faylor <cgf@redhat.com>
5061 * fhandler.cc (binmode): Default to binmode when mode is not known.
5063 2002-05-29 Christopher Faylor <cgf@redhat.com>
5065 * include/sys/cygwin.h (EXTERNAL_PINFO_VERSION): Reinstate.
5066 * external.cc (fillout_pinfo): Use it.
5068 2002-05-29 Corinna Vinschen <corinna@vinschen.de>
5070 * external.cc (fillout_pinfo): Use new version define.
5071 * include/sys/cygwin.h (external_pinfo): Define
5072 EXTERNAL_PINFO_VERSION_16_BIT and EXTERNAL_PINFO_VERSION_32_BIT
5073 instead of just EXTERNAL_PINFO_VERSION.
5075 2002-05-29 Christopher Faylor <cgf@redhat.com>
5077 * external.cc (fillout_pinfo): Set new version field in external_pinfo
5079 * include/sys/cygwin.h (external_pinfo): Replace strace_file with
5082 2002-05-29 Corinna Vinschen <corinna@vinschen.de>
5084 Change internal uid datatype from __uid16_t to __uid32_t
5086 * cygwin.din: Export new symbols getpwuid32, getpwuid_r32, getuid32,
5087 geteuid32, setuid32, seteuid32.
5088 * passwd.cc (getpwuid32): New function.
5089 (getpwuid_r32): Ditto.
5090 * syscalls.cc (seteuid32): Ditto.
5092 * uinfo.cc (getuid32): Ditto.
5094 * winsup.h (uid16touid32): New macro, correct casting from __uid16_t
5096 (gid16togid32): Ditto fir gids.
5097 (getuid32): Declare.
5099 (getpwuid32): Ditto.
5100 * include/sys/cygwin.h (struct external_pinfo): Add members uid32 and
5103 2002-05-29 Corinna Vinschen <corinna@vinschen.de>
5105 * include/cygwin/socket.h: Protect some symbols against multiple
5107 * include/netinet/ip.h: Ditto.
5108 * include/netinet/tcp.h: Ditto.
5110 2002-05-29 Wu Yongwei <adah@netstd.com>
5112 * include/netinet/ip.h: Replace by BSD derived version of the file.
5113 * include/netinet/tcp.h: Ditto.
5114 * include/netinet/udp.h: New file.
5115 * include/cygwin/ip.h: Remove.
5117 2002-05-29 Christopher Faylor <cgf@redhat.com>
5119 * dtable.cc (dtable::init_std_file_from_handle): Attempt stronger
5120 detection of invalid handle.
5121 (handle_to_fn): Detect pathological condition where NT resets the
5122 buffer pointer to NULL on an invalid handle.
5124 2002-05-28 Christopher Faylor <cgf@redhat.com>
5126 * fhandler_disk_file.cc (fhandler_disk_file::fstat_helper): Properly
5127 check for whether we should be opening the file to search for #!
5128 characters. Set path_conv structure execability, too, when
5131 2002-05-28 Corinna Vinschen <corinna@vinschen.de>
5133 * security.cc (set_security_attribute): Call getegid32() instead of
5135 * include/cygwin/grp.h: Declare getegid32().
5137 2002-05-28 Corinna Vinschen <corinna@vinschen.de>
5139 Change internal gid datatype from __gid16_t to __gid32_t
5141 * cygwin.din: Export new symbols chown32, fchown32, getegid32,
5142 getgid32, getgrgid32, getgrnam32, getgroups32, initgroups32, lchown32,
5143 setgid32, setegid32, getgrent32.
5144 * grp.cc (grp32togrp16): New static function.
5145 (getgrgid32): New function.
5146 (getgrnam32): Ditto.
5147 (getgrent32): Ditto.
5148 (getgroups32): Change name of internal function from getgroups.
5149 (getgroups32): New function.
5150 (initgroups32): Ditto.
5151 * syscalls.cc (chown32): Ditto.
5156 * uinfo.cc (getgid32): Ditto.
5158 * include/cygwin/grp.h: Remove declaration of getgrgid() and getgrnam().
5159 Declare getgrgid32() and getgrnam32() instead. Declare getgid32().
5161 2002-05-27 Christopher Faylor <cgf@redhat.com>
5163 * autoload.cc (noload): Properly mask low order word for determining
5164 number of bytes to pop.
5166 2002-05-27 Christopher Faylor <cgf@redhat.com>
5168 * fhandler_disk_file.cc (fhandler_disk_file::fstat): Minor logic
5171 2002-05-27 Christopher Faylor <cgf@redhat.com>
5173 * autoload.cc (LoadFuncEx): Define via new LoadFuncEx2 macro.
5174 (LoadFuncEx2): Adapt from LoadFuncEx. Provides control of return
5175 value for nonexistent function.
5176 (NtQueryObject): Declare.
5177 (IsDebuggerPresent): Declare via LoadFuncEx2 and always return true if
5179 * debug.h (being_debugged): Just rely on IsDebuggerPresent return
5181 * dtable.cc (handle_to_fn): New function.
5182 (dtable::init_std_file_from_handle): Attempt to derive std handle's
5183 name via handle_to_fn.
5184 (dtable::build_fhandler_from_name): Fill in what we can in path_conv
5185 structure when given a handle and path doesn't exist.
5186 * fhandler.cc (fhandler_base::open): Don't set the file pointer here.
5187 Use pc->exists () to determine if file exists rather than calling
5188 GetFileAttributes again.
5189 * fhandler.h (fhandler_base::exec_state_isknown): New method.
5190 (fhandler_base::fstat_helper): Add extra arguments to declaration.
5191 (fhandler_base::fstat_by_handle): Declare new method.
5192 (fhandler_base::fstat_by_name): Declare new method.
5193 * fhandler_disk_file (num_entries): Make __stdcall.
5194 (fhandler_base::fstat_by_handle): Define new method.
5195 (fhandler_base::fstat_by_name): Define new method.
5196 (fhandler_base:fstat): Call fstat_by_{handle,name} as appropriate.
5197 (fhandler_disk_file::fstat_helper): Accept extra arguments for filling
5198 out stat structure. Move handle or name specific stuff to new methods
5200 (fhandler_disk_file::open): Use real_path->exists rather than calling
5201 GetFileAttributes again.
5202 * ntdll.h (FILE_NAME_INFORMATION): Define new structure.
5203 (OBJECT_INFORMATION_CLASS): Partially define new enum.
5204 (OBJECT_NAME_INFORMATION): Define new structure.
5205 (NtQueryInformationFile): New declaration.
5206 (NtQueryObject): New declaration.
5207 * path.cc (path_conv::fillin): Define new method.
5208 * path.h (path_conv::fillin): Declare new method.
5209 (path_conv::drive_thpe): Rename from 'get_drive_type'.
5210 (path_conv::volser): Declare new method.
5211 (path_conv::volname): Declare new method.
5212 (path_conv::root_dir): Declare new method.
5213 * syscalls.cc (fstat64): Send real path_conv to fstat as second
5216 2002-05-24 Pierre Humblet <pierre.humblet@ieee.org>
5218 * security.cc (lsa2str): New function.
5219 (get_priv_list): Call lsa2str instead of sys_wcstombs.
5221 2002-05-22 Pierre Humblet <pierre.humblet@ieee.org>
5223 * syscalls.cc (seteuid): Do not take allow_ntsec into account.
5224 Attempt to use an existing or new token even when the uid
5225 matches orig_uid, but the gid is not in the process token.
5226 Major reorganization after several incremental changes.
5227 (setegid): Do not take allow_ntsec into account. Minor
5228 reorganization after several incremental changes.
5230 2002-05-26 Christopher Faylor <cgf@redhat.com>
5232 * debug.h (being_debugged): New macro.
5233 * dtable.cc (dtable::extend): Use new macro.
5234 * exceptions.cc (try_to_debug): Ditto.
5235 * strace.cc (strace::hello): Only output debugging info when we think
5236 we're being debugged.
5238 2002-05-25 Robert Collins <rbtcollins@hotmail.com>
5240 * winsup.h: Remove duplicate declarations of malloc_lock and
5243 2002-05-24 Christopher Faylor <cgf@redhat.com>
5245 Remove unneeded sync.h, where appropriate, throughout.
5246 Remove unneeded heap.h, where appropriate, throughout.
5247 Remove unneeded exceptions.h, where appropriate, throughout.
5248 Remove unneeded perprocess.h, where appropriate, throughout.
5250 2002-05-22 Pierre Humblet <pierre.humblet@ieee.org>
5252 * security.cc (create_token): Call __sec_user() instead of
5253 sec_user() to remove dependence on allow_ntsec. Verify that
5254 the returned sd is non-null.
5256 2002-05-25 Robert Collins <rbtcollins@hotmail.com>
5258 * gmon.c (fake_sbrk): Correctly return -1 on failed malloc's.
5260 2002-05-24 Christopher Faylor <cgf@redhat.com>
5262 * dtable.cc (dtable::build_fhandler_from_name): Just pass posix path
5263 along to set_name via return_and_clear_normalized_path.
5264 (dtable::build_fhandler): New method with const char * argument.
5265 (dtable::reset_unix_path_name): Eliminate.
5266 (dtable::dup_worker): Use correct build_fhandler method.
5267 * mmap.cc (mmap_record::alloc_fh): Ditto.
5268 * dtable.h (dtable::build_fhandler): New method.
5269 (dtable::reset_unix_path_name): Eliminate.
5270 * fhandler.cc (fhandler_base::set_name): Assume that unix_name has
5271 already been cmalloced.
5272 (fhandler_base::reset_unix_path_name): Eliminate.
5273 (fhandler_base::~fhandler_base): Coercion for cfree.
5274 * fhandler.h (fhandler_base::unix_path_name): Make const char *.
5275 (fhandler_base::win32_path_name): Ditto.
5276 (fhandler_base::reset_unix_path_name): Eliminate.
5277 * fhandler_disk_file.cc (fhandler_cygdrive::set_drives): Accommodate
5278 const char *ness of win32_path_name.
5279 * fhandler_socket.cc (fhandler_socket::fstat): Accommodate new set_name
5281 * path.cc (path_conv::return_and_clear_normalized_path): New method.
5282 (path_conv::clear_normalized_path): Eliminate.
5283 (path_conv::~path_conv): Ditto.
5284 (path_conv::check): Accommodate new build_fhandler method.
5285 * path.h (path_conv::~path_conv): Eliminate.
5286 (path_conv::clear_normalized_path): Ditto.
5287 (path_conv::return_and_clear_normalized_path): Declare new method.
5289 2002-05-23 Christopher Faylor <cgf@redhat.com>
5291 * path.cc (path_conv::check): Make sure any trailing path component is
5292 part of potential normalized posix path.
5294 2002-05-23 Christopher Faylor <cgf@redhat.com>
5296 * smallprint.c (__small_vsprintf): Implement '%o' after all these
5299 2002-05-22 Christopher Faylor <cgf@redhat.com>
5301 * fhandler.h (fhandler_virtual::exists): Eliminate path argument.
5302 (fhandler_proc::exists): Ditto.
5303 (fhandler_registry::exists): Ditto.
5304 (fhandler_process::exists): Ditto.
5305 * fhandler_proc.cc (fhandler_proc::exists): Ditto. Use built-in name.
5306 * fhandler_process.cc (fhandler_process::exists): Ditto.
5308 * fhandler_registry.cc (fhandler_registry::exists): Ditto.
5309 (fhandler_registry::fstat): Ditto.
5310 * fhandler_virtual.cc (fhandler_virtual::opendir): Ditto.
5311 * path.cc (path_conv::check): Ditto. Add debugging.
5313 2002-05-22 Christopher Faylor <cgf@redhat.com>
5315 * syscalls.cc (dup): Always call dup2 for error handling.
5317 2002-05-22 Corinna Vinschen <corinna@vinschen.de>
5319 * include/cygwin/types.h: Revert previous patch.
5321 2002-05-22 Corinna Vinschen <corinna@vinschen.de>
5323 * include/cygwin/types.h: Define pthread stuff only if _POSIX_THREADS
5326 2002-05-19 Pierre Humblet <pierre.humblet@ieee.org>
5328 * security.cc (open_local_policy): Initialize lsa to
5329 INVALID_HANDLE_VALUE instead of NULL.
5330 (get_logon_server_and_user_domain): Test for INVALID_HANDLE_VALUE
5332 (create_token): Both of the above.
5334 2002-05-18 Christopher Faylor <cgf@redhat.com>
5336 * fhandler_disk_file.cc (fhandler_disk_file::fstat): Make handling of
5337 nlink consistent for remote files.
5339 2002-05-18 Christopher Faylor <cgf@redhat.com>
5341 * path.cc (path_conv::check): Always set executable bit for executable
5344 2002-05-17 Christopher Faylor <cgf@redhat.com>
5346 * fhandler.cc (fhandler_base::lseek): Avoid calling SetFilePointer with
5347 high order part of 64 bit address on OS's which do not support that
5348 kind of operation. Otherwise Windows 95 will become confused.
5350 2002-05-16 Pierre Humblet <pierre.humblet@ieee.org>
5352 * fhandler_raw.cc (fhandler_dev_raw::open): Replace set_errno()
5353 by __seterrno_from_win_error().
5354 * security.cc (open_local_policy): Ditto.
5355 (get_lsa_srv_inf): Ditto.
5356 (get_user_groups): Ditto.
5357 (get_user_primary_group): Ditto.
5358 (create_token): Ditto.
5361 2002-05-17 Corinna Vinschen <corinna@vinschen.de>
5363 * times.cc (utimes): Use FILE_WRITE_ATTRIBUTES even on 9x/Me when
5364 opening file for writing timestamp.
5365 * wincap.cc: Remove flag has_specific_access_rights.
5368 2002-05-13 Pierre Humblet <pierre.humblet@ieee.org>
5370 * syscalls.cc (seteuid): Set default dacl in process token.
5371 Replace in-line code by call to verify_token().
5372 (setegid): Reverse change from 2002-01-21. Add call to
5373 RevertToSelf and set primary group in impersonation token.
5374 * security.cc (create_token): Store pgrpsid in token security
5375 descriptor, except if it already appears in my_grps.
5376 Use sec_acl() in place of get_dacl().
5377 (verify_token): Create from code in seteuid(), with tighter checks.
5378 (get_dacl): Deleted.
5379 (get_group_sidlist): Add argument to indicate if pgrpsid is already
5381 * security.h: Define verify_token().
5382 * autoload.cc: Load GetKernelObjectSecurity().
5384 2002-05-13 Mark Bradshaw <bradshaw@staff.crosswalk.com>
5386 * cygwin.din: Add strlcat and strlcpy.
5387 * include/cygwin/version.h: Increment API minor version number.
5389 2002-05-09 Pierre Humblet <pierre.humblet@ieee.org>
5391 * shared.cc (__sec_user): Split into sec_acl() and call orig_sid().
5392 (sec_acl): Create from part of __sec_user(), except creator/owner.
5393 * security.h: Define sec_acl() and MAX_DACL_LEN.
5395 2002-05-12 Christopher Faylor <cgf@redhat.com>
5397 * fhandler_disk_file.cc (fhandler_disk_file::open): Avoid using
5398 O_DIROPEN when OS doesn't support it. Return proper errno in that
5401 2002-05-12 Christopher Faylor <cgf@redhat.com>
5403 * syscalls.cc (_read): Change error to EBADF if attempt to read from a
5406 2002-05-11 Christopher Faylor <cgf@redhat.com>
5408 * fhandler.h (executable_states): For now, make dont_care_if_executable
5409 equivalent to not_executable.
5410 * sys/mount.h: Define MOUNT_NOTEXEC.
5411 * path.h (fs_info): New class.
5412 (path_conv): Move fs-specific fields to new 'fs' structure.
5413 (path_conv::update_fs_info): Move to fs_info and rename to just 'update'.
5414 * path.cc (fs_info::update): Ditto. Return 'true' if successful.
5415 (fillout_mntent): Add ',noexec' to list of reported options.
5417 2002-05-11 Christopher Faylor <cgf@redhat.com>
5419 * fhandler_virtual.cc (fhandler_virtual::close): Quiet a compiler
5422 2002-05-10 Christopher January <chris@atomice.net>
5424 * autoload.cc: Add dynamic load statements for
5425 'ZwQueryInformationProcess' and 'ZwQueryVirtualMemory'.
5426 * fhandler.h: Change type of bufalloc and filesize members of
5427 fhandler_virtual from int to size_t. Change type of position member
5428 from __off32_t to __off64_t. Add new fileid member to fhandler_virtual
5429 class. Make seekdir take an __off64_t argument. Make lseek take an
5430 __off64_t argument. Add fill_filebuf method to fhandler_virtual. Add
5431 fill_filebuf method to fhandler_proc. Add fill_filebuf method to
5432 fhandler_registry. Add fill_filebuf method to fhandler_process. Add
5433 saved_pid and saved_p members to fhandler_process.
5434 * fhandler_proc.cc (proc_listing_array): Add 'loadavg', 'meminfo', and 'stat'.
5435 (proc_fhandlers array): Ditto.
5436 (fhandler_proc::open): Use fill_filebuf to flesh out the file contents.
5437 (fhandler_proc::fill_filebuf): New method.
5438 (fhandler_proc::format_proc_meminfo): Ditto.
5439 (fhandler_proc::format_proc_stat): Ditto.
5440 (fhandler_proc::format_proc_uptime): Ditto.
5441 * fhandler_process.cc (process_listing): Add 'stat' and 'statm'.
5442 (fhandler_process::fstat): Find the _pinfo structure for the process
5443 named in the filename. Return ENOENT if the process is no longer
5444 around. Set the gid and uid fields of the stat structure.
5445 (fhandler_process::open): Store pid and pointer to _pinfo structure in
5446 saved_pid and saved_p respectively. Use fill_filebuf to flesh out file
5448 (fhandler_proc::fill_filebuf): New method.
5449 (format_process_stat): New function.
5450 (format_process_status): Ditto.
5451 (format_process_statm): Ditto.
5452 (get_process_state): Ditto.
5453 (get_mem_values): Ditto.
5454 * fhandler_registry.cc (fhandler_registry::seekdir): Change argument
5455 type from __off32_t to __off64_t.
5456 (fhandler_registry::fill_filebuf): New method.
5457 * fhandler_virtual.cc (fhandler_virtual::seekdir): Change argument type
5458 from __off32_t to __off64_t.
5459 (fhandler_virtual::lseek): Ditto.
5460 (fhandler_virtual::fill_filebuf): New method.
5461 (fhandler_virtual::fhandler_virtual): Initialise fileid to -1.
5462 * wincap.cc: Set flag has_process_io_counters appropriately.
5463 * wincap.h: Add flag has_process_io_counters.
5465 2002-05-09 Christopher Faylor <cgf@redhat.com>
5467 * syscalls.cc (_write): Change error to EBADF if attempt to write to a
5470 2002-05-08 Corinna Vinschen <corinna@vinschen.de>
5472 * cygheap.h (class cygheap_user): Add member `orig_psid'.
5473 Add method `orig_sid()'.
5474 * cygheap.cc (cygheap_user::set_sid): Maintain orig_psid.
5476 2002-04-28 Norbert Schulze <norbert.schulze@web.de>
5478 * localtime.cc (tzsetwall): Use wildabbr if generated timezone name
5481 2002-05-05 Pierre Humblet <pierre.humblet@ieee.org>
5483 * spawn.cc (spawn_guts): Move call to set_process_privilege()
5484 to load_registry_hive().
5485 * registry.cc (load_registry_hive): ditto.
5486 * fork.cc (fork_parent): Call sec_user_nih() only once.
5488 2002-05-04 Christopher January <chris@atomice.net>
5490 * path.h (path_conv::path_conv): Initialise normalized_path to NULL.
5492 2002-05-03 Christopher Faylor <cgf@redhat.com>
5494 * net.cc (getdomainname): Change second argument of getdomainname to
5497 2002-05-03 Christopher January <chris@atomice.net>
5499 * fhandler_proc.cc (proc_listing): Add '.' and '..' to directory
5501 (fhandler_proc::open): Change use of mode to flags. If the file does
5502 not exist already, fail with EROFS if O_CREAT flag is set. Change
5503 EROFS error to EACCES error when writing to a file. Use cmalloc to
5504 allocate memory for filebuf.
5505 (fhandler_proc::close): Use cfree to free filebuf.
5506 (fhandler_proc::get_proc_fhandler): Properly detect attempts to access
5508 * fhandler_process.cc (process_listing): Add '.' and '..' to directory
5510 (fhandler_process::open): Use cmalloc to allocate memory for filebuf.
5511 (fhandler_process::close): Use cfree to free filebuf.
5512 * fhandler_registry.cc (registry_listing): Add . and '..' to directory
5514 (fhandler_registry::open): Move check for open for writing before
5515 open_key. Use cmalloc to allocate memory for filebuf.
5516 (fhandler_registry::close): Use cfree to free filebuf.
5517 (fhandler_registry::telldir): Use lower 16 bits of __d_position as
5518 position in directory.
5519 (fhandler_registry::seekdir): Ditto.
5520 * fhandler_virtual.cc (fhandler_virtual::write): Change EROFS error to
5522 (fhandler_virtual::open): Set the NOHANDLE flag.
5523 (fhandler_virtual::dup): Add call to fhandler_base::dup. Allocate
5524 child's filebuf using cmalloc. Copy filebuf from parent to child.
5525 (fhandler_virtual::close): Use cfree to free filebuf.
5526 (fhandler_virtual::~fhandler_virtual): Ditto.
5527 (from Chris Faylor <cgf@redhat.com>).
5528 (fhandler_registry::readdir): Add support for '.' and '..' files in
5529 subdirectories of /proc/registry.
5530 * path.cc (path_conv::check): Do not return ENOENT if a file is not
5533 2002-05-02 Christopher Faylor <cgf@redhat.com>
5535 * fhandler_proc.cc (fhandler_proc::fstat): Use fhandler name rather
5536 than path_conv name.
5537 (fhandler_proc::open): Ditto.
5538 * fhandler_process.cc (fhandler_process::fstat): Use fhandler name
5539 rather than path_conv name.
5540 (fhandler_process::open): Ditto.
5541 * fhandler_registry.cc (fhandler_registry::fstat): Use fhandler name
5542 rather than path_conv name.
5543 (fhandler_registry::open): Ditto.
5544 * path.cc (path_conv::check): Don't copy posix path when virtual.
5545 (mount_info::conv_to_win32_path): Don't zero string when isproc. Just
5546 derive normal windows path.
5548 * path.h (path_conv::clear_normalized_path): Declare new method.
5549 * path.cc (path_conv::clear_normalized_path): Define new method.
5550 * dtable.cc (build_fhandler_from_name): Clear normalized path when
5551 finished to conserve space.
5553 2002-05-02 Christopher Faylor <cgf@redhat.com>
5555 * fhandler_proc.cc (fhandler_proc::fstat): Prime with information from
5556 fhandler_base::fstat. Use defines rather than constants for permission
5559 2002-04-30 Eric Blake <ebb9@email.byu.edu>
5561 * path.cc (hash_path_name): Improve hash function strength.
5563 2002-05-02 Robert Collins <rbtcollins@hotmail.com>
5565 * thread.cc (__pthread_cond_dowait): Fix a race on signalling from a
5566 thread woken by the same condition variable it's signalling on. Thanks
5567 to Michael Beach for the report and test case.
5569 2002-05-02 Christopher Faylor <cgf@redhat.com>
5571 * path.h (pathconv_arg): Add PC_POSIX.
5572 (path_conv): Add normalized_path field.
5573 * path.cc (path_conv::~path_conv): New destructor.
5574 (path_conv::check): Set normalized_path, where appropriate.
5575 * dtable.cc (build_fhandler_from_name): Use normalized path from
5577 * syscalls.cc (chroot): Ditto.
5579 * cygheap.h: Remove path_prefix_p declaration.
5581 2002-02-26 Christopher January <chris@atomice.net>
5582 Christopher Faylor <cgf@redhat.com> (minor fixups)
5584 * Makefile.in: Add fhandler_proc.o, fhandler_registry.o,
5585 fhandler_process.o and fhandler_virtual.o.
5586 * dtable.cc (dtable::build_fhandler): Add entries for FH_PROC,
5587 FH_REGISTRY and FH_PROCESS. Set unix_name to the normalized posix
5589 * fhandler.h: Add constants for FH_PROC, FH_REGISTRY and FH_PROCESS.
5590 Add class declarations for fhandler_virtual, fhandler_proc,
5591 fhandler_registry and fhandler_virtual. Update fhandler_union
5593 * fhandler_proc.cc: New file. Add implementation for fhandler_proc.
5594 * fhandler_virtual.cc: New file. Add implementation for
5596 * fhandler_process.cc: New file. Add implementation for
5598 * fhandler_registry.cc: New file. Add implementation for
5600 * path.cc (isproc): New macro.
5601 (isvirtual_dev): Ditto.
5602 * path.cc (path_conv::check): Add check for virtual devices.
5603 * path.cc (mount_info::conv_to_win32_path): Convert paths in /proc to
5605 * path.cc (chdir): Replace check for FH_CYGDRIVE with more generic
5606 isvirtual_dev macro. Force setting of posix path for virtual
5608 * path.h (path_prefix_p): Declare.
5611 Wed May 1 16:06:02 2002 Jason Tishler <jason@tishler.net>
5613 * include/cygwin/types.h: Include <sys/sysmacros.h>.
5615 Wed Apr 17 11:27:04 2002 Jason Tishler <jason@tishler.net>
5617 * security.cc (get_lsa_srv_inf): Prevent extraneous backslashes for
5620 2002-04-12 Corinna Vinschen <corinna@vinschen.de>
5622 * net.cc (cygwin_accept): Set socket type for accepted socket.
5623 (socketpair): Set socket type for both sockets.
5625 2002-04-12 Egor Duda <deo@logos-m.ru>
5627 * fhandler.h (class fhandler_socket): New member to store socket type.
5628 (fhandler_socket::get_socket_type): Access it.
5629 (fhandler_socket::set_socket_type): Ditto.
5630 * net.cc (cygwin_socket): Store socket type.
5631 (cygwin_connect): Disable security checks for connectionless sockets.
5632 (cygwin_accept): Ditto.
5634 2002-04-09 Mark Bradshaw <bradshaw@staff.crosswalk.com>
5636 * cygwin.din: Add strptime.
5637 * include/cygwin/version.h: Increment API version number.
5639 2002-04-09 Corinna Vinschen <corinna@vinschen.de>
5641 * fork.cc (fork_child): Call fixup_mmaps_after_fork() somewhat earlier.
5643 2002-04-09 Corinna Vinschen <corinna@vinschen.de>
5645 * fhandler.cc (fhandler_base::open): Set read-only bit in
5646 file_attributes when adequate.
5648 2002-03-28 Christopher Faylor <cgf@redhat.com>
5650 * times.cc (gettimeofday): Fix typo in previous patch.
5652 2002-03-27 Wu Yongwei <adah@netstd.com>
5654 * times.cc (gettimeofday): Revert to setting timezone info if tz !=
5657 2002-03-21 Christopher Faylor <cgf@redhat.com>
5659 * fhandler_disk_file.cc (fhandler_disk_file::fstat_helper): Always set
5660 st_[ug]id to value derived from get_file_attributes.
5662 2002-03-21 Christopher Faylor <cgf@redhat.com>
5664 * spawn.cc (find_exec): Return input if file not found.
5666 2002-03-19 Boris Schaeling <boriss@web.de>
5668 * poll.cc (poll): Add support for invalid descriptors.
5670 2002-03-15 Robert Collins <rbtcollins@hotmail.com>
5672 * fhandler.h (fhandler_termios::lseek): Override lseek.
5673 * fhandler_termios.cc (fhandler_termios::lseek): Implement this.
5675 2002-03-15 Christopher Faylor <cgf@redhat.com>
5677 * cygserver.cc: Include stdlib.h for exit declaration.
5678 * threaded_queue.cc: Ditto.
5680 2002-03-15 Christopher Faylor <cgf@redhat.com>
5682 * pinfo.cc (pinfo::init): Use PID_ALLPIDS flag to control when a
5683 redirected block should be marked as nonexistent.
5684 (winpids::add): Use PID_ALLPIDS when looking for all pids.
5685 * cygwin.h (PID_ALLPIDS): New enum element.
5687 2002-03-15 Corinna Vinschen <corinna@vinschen.de>
5689 * glob.c (stat32_to_STAT): New function.
5690 (g_lstat): Call user space functions always with 32 bit struct stat
5693 * include/glob.h (struct glob): Don't prototype function pointers
5694 when compiling Cygwin.
5696 2002-03-14 Christopher Faylor <cgf@redhat.com>
5698 * pinfo.cc (pinfo::init): Properly handle execed process stub when
5699 PID_NOREDIR is specified.
5701 2002-03-13 Boris Schaeling <boriss@web.de>
5703 * poll.cc (poll): Remove variable open_fds. Rearrange and add code to
5704 fix settings of revents.
5706 2002-03-13 Corinna Vinschen <corinna@vinschen.de>
5708 * mmap.cc (mmap_record::map_map): Return -1 if VirtualProtect fails.
5709 (list::erase): New method with no argument. Erase latest record
5711 (mmap64): Fail if map_map() fails.
5713 2002-03-12 Corinna Vinschen <corinna@vinschen.de>
5715 * sysconf.cc (sysconf): Fix condition.
5717 2002-03-11 Corinna Vinschen <corinna@vinschen.de>
5719 * mmap.cc (msync): Check area given by addr and len for being a
5720 contigeous mmap'd region.
5722 2002-03-11 Corinna Vinschen <corinna@vinschen.de>
5724 * fork.cc (fork_child): Call fixup_mmaps_after_fork() before
5725 closing parent process handle. Call fixup_mmaps_after_fork()
5726 with parent process handle as parameter.
5727 * mmap.cc (mmap_record::access): New method.
5728 (fixup_mmaps_after_fork): Take process handle as parameter.
5729 In case of FILE_MAP_COPY access, copy valid memory regions to child.
5730 * pinfo.h (fixup_mmaps_after_fork): Change prototype accordingly.
5732 2002-03-07 Corinna Vinschen <corinna@vinschen.de>
5734 * autoload.cc (NetGetDCName): Add symbol.
5735 (NetServerEnum): Remove symbol.
5736 * security.cc (get_lsa_srv_inf): Call NetGetDCName() instead of
5737 NetServerEnum() since it's faster. Don't call it at all if machine
5738 is not a domain member.
5740 2002-03-06 Christopher Faylor <cgf@redhat.com>
5742 * path.cc (normalize_posix_path): Avoid runs of '.'s > 2.
5744 2002-03-05 Christopher Faylor <cgf@redhat.com>
5746 * errno.cc: Change EPERM associated text to "Operation not permitted"
5749 2002-03-05 Christopher Faylor <cgf@redhat.com>
5751 * fhandler_socket.cc (fhandler_socket::close): Respond to signals while
5752 looping, waiting for socket to close. Superstitiously clear last error
5753 when WSAEWOULDBLOCK.
5755 2002-03-05 Robert Collins <rbtcollins@hotmail.com>
5757 * cygserver_transport_pipes.cc (transport_layer_pipes::transport_layer_pipes):
5758 Always init - until static members work correctly.
5759 * shm.cc (shmget): Initialize the security descriptor - thanks Corinna!
5760 * include/sys/ipc.h: Make the ipc control constants partitioned off from the sem
5763 2002-03-04 Christian Lestrade <christian.lestrade@free.fr>
5765 * include/sys/termios.h: Define _POSIX_VDISABLE. Define CCEQ macro.
5766 * fhandler_termios.cc: Include <sys/termios.h>.
5767 (line_edit): Recognize disabled c_cc[] chars. Ignore VDISCARD when
5770 2002-03-04 Dmitry Timoshkov <dmitry@baikal.ru>
5772 * syscalls.cc (truncate64): Use ftruncate64 directly to not lose
5775 2002-03-04 Robert Collins <rbtcollins@hotmail.com>
5777 * cygserver_shm.cc (delete_shmnode): New function.
5778 (client_request_shm::serve): Use it.
5780 2002-03-04 Robert Collins <rbtcollins@hotmail.com>
5782 * cygserver_shm.cc (client_request_shm::serve): Implement SHM_DETACH.
5783 * shm.cc (shmdt): Implement.
5785 2002-03-04 Robert Collins <rbtcollins@hotmail.com>
5787 * cygserver_shm.cc: Run indent.
5788 (deleted_head): New global for storing shm id's pending deletion.
5789 (client_request_shm::serve): Return ENOSYS for invalid request types.
5790 Implement SHM_DEL - delete a shm id.
5791 * cygserver_shm.h (SHM_DEL): New type value.
5792 * shm.cc (delete_inprocess_shmds): New function, does what it's name implies.
5793 (shmctl): Implement shm_rmid control type.
5795 2002-03-04 Robert Collins <rbtcollins@hotmail.com>
5797 * Makefile.in (install): Remove install-bin to allow make install to work.
5799 2002-03-03 Robert Collins <rbtcollins@hotmail.com>
5801 * shm.cc (shmat): Prevent a compile error.
5802 (shmdt): Set errno as this function is incomplete.
5804 2002-02-28 Christopher Faylor <cgf@redhat.com>
5806 * times.cc: Remove if 0'd code. Clean up slightly.
5808 2002-02-28 Robert Collins <rbtcollins@hotmail.com>
5810 * Merge cygwin_daemon into head minus the new shm and ipc exports.
5812 2002-02-28 Robert Collins <rbtcollins@hotmail.com>
5814 * fhandler_tty.cc (fhandler_tty_slave::open): More debugging.
5815 (fhandler_tty_slave::read): Fix printf type for the handle.
5816 * tty.cc (tty::common_init): Add a FIXME for security.
5818 2002-01-29 Robert Collins <rbtcollins@hotmail.com>
5820 * Makefile.in (OBJS): Remove duplicate localtime.o.
5822 2002-01-17 Robert Collins <rbtcollins@hotmail.com>
5824 * cygserver.cc (check_and_dup_handle): Consolidate the two variants for
5826 Add Some basic debug output.
5827 (client_request_attach_tty::serve): Use the new debug_printf for clarity.
5828 Mark the duplicated handles as inheritable - fixup_after_fork() doesn't reopen
5831 2002-01-16 Robert Collins <rbtcollins@hotmail.com>
5833 * cygserver.cc (transport): Correct scope.
5834 (client_request_attach_tty::serve): Add more debug information.
5835 Fix erroneous use of transport instead of conn.
5836 * cygserver_transport_pipes.cc (transport_layer_pipes::close): More debug.
5837 (transport_layer_pipes::read): Ditto.
5838 (transport_layer_pipes::write): Ditto.
5839 (transport_layer_pipes::impersonate_client): Ditto.
5841 Mon Oct 8 7:41:00 2001 Robert Collins <rbtcollins@hotmail.com>
5843 * cygserver.cc (server_request::process): Rename client_request_shm_get to
5845 * cygserver_process.cc (process_cache::add): Rename to add_task.
5846 Use process_cleanup instead of process_request.
5847 (process_cache::remove_process): New method.
5848 (process::process): Initialize new members.
5849 (process::~process): New member.
5850 (process::cleanup): New method.
5851 (process::add_cleanup_routine): New method.
5852 (process_request::process): Rename to process_cleanup.
5853 Call the process object's cleanup method and then delete it.
5854 (process_process_param::request_loop): Remove the signalling process.
5855 * cygserver_shm.cc: Globally rename client_request_shm_get to client_request_shm.
5856 (client_request_shm_get::serve): Handle attach request counting.
5857 * cygserver_shm.h: Globally rename client_request_shm_get to client_request_shm.
5858 (class shm_cleanup): New class.
5859 * shm.cc: Globally rename client_request_shm_get to client_request_shm.
5860 (client_request_shm::client_request_shm): New constructor for attach requests.
5862 * include/cygwin/cygserver_process.h (class process_request): Rename to
5864 (class cleanup_routine): New class.
5865 (class process): New members and methods to allow calling back when the process
5868 Thu Oct 4 14:12:00 2001 Robert Collins <rbtcollins@hotmail.com>
5869 * cygserver.cc (request_loop): Make static.
5870 (main): Use new cache constructor syntax.
5871 Start cache worker threads.
5872 Cleanup the cache at shutdown.
5873 * cygserver_process.cc: Run indent.
5874 (process_cache::process_cache): Add a trigger to use when adding a process.
5875 (process_cache::process): Move process_entry to process.
5876 Insert at the end of the list.
5877 Trigger the request loop when new process's inserted.
5878 (process_cache::process_requests): Do it.
5879 (process_cache::add): New method.
5880 (process_cache::handle_snapshot): New method.
5881 (process::process): Merge in the process_entry fields.
5882 (process::handle): Make a stub function.
5883 (process::exit_code): New method.
5884 (process_request::process): New method.
5885 (process_process_param::request_loop): New method.
5886 * cygserver_shm.cc: New header dependency - threaded_queue.h.
5887 * threaded_queue.cc (threaded_queue::cleanup): Clearer messages.
5888 (queue_process_param::stop): Short spinlock on interruptible threads.
5889 * threaded_queue.h (class threaded_queue): New constructor.
5890 * include/cygwin/cygserver_process.h (process_request): New class.
5891 (process_entry): Remove.
5892 (process): Merge in process_entry.
5893 (process_cache): Inherit from threaded_queue.
5895 Tue Oct 2 23:24:00 2001 Robert Collins <rbtcollins@hotmail.com>
5897 * cygserver.cc (class server_process_param): Use new constructor syntax.
5898 * cygserver_process.cc (process_cache::~process_cache): New function.
5899 * threaded_queue.cc: Define condition debug_printf.
5901 (threaded_queue::cleanup): Move queue_process_param guts to a method.
5902 (threaded_queue::process_requests): Ditto.
5903 (queue_process_param::queue_process_param): New method.
5904 (queue_process_param::~queue_process_param): Ditto.
5905 (queue_process_param::start): Ditto.
5906 (queue_process_param::stop): Ditto.
5907 * threaded_queue.h (class queue_process_param): Add support for
5908 interruptible request loops.
5909 * cygwin/include/cygwin/cygserver_process.h (class process_cache): Add
5912 Tue Oct 2 23:24:00 2001 Robert Collins <rbtcollins@hotmail.com>
5914 * cygserver_client.cc: New flag allow_daemon to disable the daemon completely.
5915 (cygserver_request): Check it.
5916 (cygserver_init): Ditto.
5917 * environ.cc (parse_thing): Add (no)daemon option.
5919 Tue Oct 2 23:00:00 2001 Robert Collins <rbtcollins@hotmail.com>
5921 * shm.cc: Update to handle include changes from HEAD.
5923 Tue Oct 2 16:06:00 2001 Robert Collins <rbtcollins@hotmail.com>
5925 * Makefile.in: Remove cygserver_shm.o from cygwin1.dll.
5926 Rename cygserver_shm_outside.o to cygserver_shm.o.
5927 * cygserver.cc (server_request::process): Use the new client_request
5929 * cygserver_client.cc: Remove the #ifdef's stubs for the server method
5931 (client_request_attach_tty::client_request_attach_tty): Use the new
5932 client_request constructor.
5933 (client_request_shutdown::client_request_shutdown): Ditto.
5934 (client_request::client_request): Ditto.
5935 * cygserver_shm.cc (client_request_shm_get::serve): Remove the
5936 #ifdef'd stub for in-cygwin builds.
5937 (client_request_shm_get::client_request_shm_get): Use the new
5938 client_request constructor, and remove the in-cygwin variants.
5939 * cygserver_shm.h (class client_request_shm_get): #ifndef test the
5940 serve method - it's only used in cygserver.
5941 * shm.cc (client_request_shm_get::client_request_shm_get): New function.
5942 * include/cygwin/cygserver.h (request_header): New constructor.
5943 (class client_request): Use it.
5944 New constructor accepting the header size.
5945 #ifndef test the server method - it's only used within cygserver.
5946 (client_request_get_version): #ifdef test the server method.
5947 (client_request_shutdown): Ditto.
5948 (client_request_attach_tty): Ditto.
5950 Tue Oct 2 9:57:00 2001 Robert Collins <rbtcollins@hotmail.com>
5952 * Makefile.in: add threaded_queue.o to cygserver.exe.
5953 * cygserver.cc: Include threaded_queue.h
5954 (class server_request): Inherit from queue_request.
5955 (class server_process_param): Inherit from queue_process_param.
5956 (class server_request_queue): Inherit from threaded_queue.
5957 (request_loop): Adjust for new types.
5958 (server_request_queue::process_requests): Remove guts to
5959 threaded_queue::process_requests.
5960 (server_request::server_request): Adjust for new types.
5961 (worker_function): Delete.
5962 (server_request_queue::create_workers): Delete.
5963 (server_request_queue::cleanup): Delete.
5964 (server_request_queue::add): Move guts to threaded_queue::add.
5965 * threaded_queue.cc: New file.
5966 * threaded_queue.h: New file.
5968 Mon Oct 1 12:38:00 2001 Robert Collins <rbtcollins@hotmail.com>
5970 * cygserver.cc (client_request::serve): New function.
5971 * cygserver_process.cc: Inlude <pthread.h> for pthread_once.
5972 (process_cache::process_cache): Initialise a crtiical section for write access.
5973 (process_cache::process): Use the critical section. Also add missing entries to
5975 (do_process_init): New function to initalise class process static variables.
5976 (process::process): Ensure that the process access critical section is
5978 (process::handle): Close the handle of old process's when they have terminated
5979 and we are returning the handle for a process with the same pid.
5980 * cygserver_shm.cc: Run indent.
5981 Include cygserver_process.h to allow process cache functionality.
5982 (client_request_shm_get::serve): New parameter for process cache support.
5983 Use the process cache, not OpenProcess to get a handle to the originating process.
5984 Fix a handle leak with token_handle.
5985 * cygserver_shm.h (class client_request_shm_get): Update ::serve for process
5987 * cygserver_transport_pipes.cc: Redefine debug_printf to be conditional on DEBUG.
5988 * include/cygwin/cygserver.h: Do not implement client_request::serve in the
5990 * include/cygwin/cygserver_process.h (class process_cache): Add a write access
5991 critical section to prevent races when requests from a multithreaded
5994 Sun Sep 30 23:41:00 2001 Robert Collins <rbtcollins@hotmail.com>
5996 * Makefile.in: Add cygserver_process.o to cygserver.exe.
5997 * cygserver.cc: Include signal.h and cygwin_version.h.
5998 Define debug_printf as a macro.
5999 Define DEBUG to a value.
6000 (client_request_attach_tty::serve): Add beginning of process cache support.
6001 Change from #ifdef DEBUG to work with new DEBUG style.
6002 (client_request_get_version::serve): Add beginning of process cache support.
6003 (class server_request): New prototype for support of process cache.
6004 (class queue_process_param): New class to allow request loop threading.
6005 (class server_request_queue): Add beginning of process cache support.
6006 Allow request loop threading.
6007 (request_loop): Thread function for request loops.
6008 (server_request_queue::process_requests): Initiator for threaded request loops.
6009 (client_request_shutdown::serve): Add beginning of process cache support.
6010 (server_request::server_request): Ditto.
6011 (server_request::process): Use debug_printf. Add beginning of process cache
6013 (server_request_queue::cleanup): Kill off any request loop threads.
6014 (server_request_queue::add): Add beginning of process cache support.
6015 (handle_signal): Trigger a shutdown.
6016 (main): Print out some useful info at startup - version, date time.
6017 Add process cache support.
6018 Spawn a separate thread for the transport request loop, thus allowing concurrent
6019 support for multiple transports.
6020 * cygserver_client.cc (client_request_get_version::serve): Add process cache
6022 (client_request_attach_tty::serve): Add process cache support.
6023 (client_request_shutdown::serve): Add process cache support.
6024 * cygsserver_process.cc: New file with the process cache support.
6025 * cygserver_shm.cc: Redefine debug_printf to allow conditional output.
6026 * cygwin.din: Export shmdt().
6027 * shm.cc: Run indent.
6029 (shmdt): New function.
6030 * include/cygwin/cygserver.h (class client_request): Add process cache support.
6031 (class client_request_get_version): Ditto.
6032 (class client_request_shutdown): Ditto.
6033 (class client_request_attach_tty): Ditto.
6034 * include/cygwin/cygserver_process.h: New header for process cache support.
6036 Sun Sep 30 8:52:00 2001 Robert Collins <rbtcollins@hotmail.com>
6038 * include/cygwin/cygserver_transport.h: Add copyright header.
6039 * include/cygwin/cygserver_transport_pipes.h: Ditto.
6040 * include/cygwin/cygserver_transport_sockets.h: Ditto.
6042 Sat Sep 29 20:40:00 2001 Robert Collins <rbtcollins@hotmail.com>
6044 * Makefile.in: Add cygserver_transport_sockets.o to DLL_OFILES.
6045 Add cygserver_transport_sockets_outside.o to cygserver.exe.
6046 * cygserver.cc: Include new include files.
6047 * cygserver_client.cc: Ditto.
6048 * cygserver_shm.h: No need to include <sys/socket.h> now.
6049 * cygerver_transport.cc: Include new include files.
6050 (transport_layer_base::transport_layer_base): Strip back to a stub.
6051 (transport_layer_base::listen): Ditto.
6052 (transport_layer_base::accept): Ditto.
6053 (transport_layer_base::close): Ditto.
6054 (transport_layer_base::read): Ditto.
6055 (transport_layer_base::write): Ditto.
6056 (transport_layer_base::connect): Ditto.
6057 * cygserver_transport_pipes.cc: Include new header
6058 "cygwin/cygserver_transport_pipes.h".
6059 * cygserver_transport_sockets.cc: New file.
6060 * dcrt0.cc: No need to include <sys/socket.h> now.
6061 * fhandler_tty.cc: Ditto.
6063 * include/cygwin/cygserver_transport.h: Strip the base class to a stub.
6064 Remove the cygserver_transport_pipes class.
6065 * include/cygwin/cygserver_transport_pipes.h: New file.
6066 * include/cygwin/cygserver_transport_sockets.h: New file.
6068 Tue Sep 25 16:22:00 2001 Robert Collins <rbtcollins@hotmail.com>
6070 * autoload.cc: Add dynamic load statement for 'ImpersonateNamedPipeClient'.
6071 * Makefile.in: Add new object files, and build instructions for cygserver.exe.
6072 * cygwin.din: Export ftok, shmat, shmctl and shmget.
6073 * dcrt0.cc: Additional includes for cygserver support.
6074 (dll_crt0_1): Initialise the cygserver client.
6075 * fhandler.h (fhandler_tty): New method cygserver_attach_tty.
6076 * fhandler_tty.cc: Additional includes for cygserver support.
6077 (fhandler_tty_slave::open): Attempt to use the cygserver when obtaining
6078 handles from the parent process. On failure or 9x use the current method.
6079 (fhandler_tty_slave::cygserver_attach_tty): New function.
6080 * fork.cc (fork_child): Fixup shm memory mapped areas.
6081 * pinfo.h: Declare fixup_shms_after_fork().
6082 * security.h: Declare alloc_sd().
6083 * tty.cc: Additonal includes to support cygserver.
6084 (tty::common_init): Don't allow others to open us if the cygserver is running.
6085 * winsup.h: Declare cygserver_running.
6086 * cygserver.cc: New file.
6087 * cygserver_client.cc: New file.
6088 * cygserver_shm.cc: New file.
6089 * cygserver_shm.h: New file.
6090 * cygserver_transport.cc: New file.
6091 * cygserver_transport_pipes.cc: New file.
6094 * include/cygwin/cygserver.h: New file.
6095 * include/cygwin/cygserver_transport.h: New file.
6096 * include/sys/ipc.h: New file.
6097 * include/sys/shm.h: New file.
6099 2002-02-28 Robert Collins <rbtcollins@hotmail.com>
6101 * thread.cc (semaphore::TryWait): Set errno as required by posix 1003.1.
6102 (__sem_wait): Ditto.
6103 (__sem_trywait): Ditto.
6105 2002-02-27 Christopher Faylor <cgf@redhat.com>
6107 * include/cygwin/version.h: Bump DLL minor number.
6109 2002-02-23 Corinna Vinschen <corinna@vinschen.de>
6111 * cygwin.din (fstat64): New symbol.
6112 (ftruncate64): Ditto.
6119 (truncate64): Ditto.
6120 * dir.cc (telldir64): New function.
6121 (telldir): Call telldir64().
6122 (seekdir64): New function.
6123 (seekdir): Call seekdir64().
6124 * fhandler.h: Redefine all methods using __off32_t to use __off64_t.
6125 * fhandler.cc: Use __off64_t and struct __stat64 throughout.
6126 * fhandler_clipboard.cc: Ditto.
6127 * fhandler_disk_file.cc: Ditto.
6128 * fhandler_dsp.cc: Ditto.
6129 * fhandler_floppy.cc: Ditto.
6130 * fhandler_mem.cc: Ditto.
6131 * fhandler_random.cc: Ditto.
6132 * fhandler_socket.cc: Ditto.
6133 * fhandler_tape.cc: Ditto.
6134 * fhandler_zero.cc: Ditto.
6136 * glob.c: Ditto, call lstat64 and stat64 in Cygwin.
6137 * mmap.cc: Use __off64_t throughout.
6138 (mmap64): New function.
6139 * sec_acl.cc (acl_worker): Use struct __stat64, call stat64 and lstat64.
6140 * syscalls.cc (lseek64): New function.
6141 (stat64_to_stat32): Ditto.
6145 (ftruncate64): Ditto.
6146 (truncate64): Ditto.
6147 (_fstat): Call fstat64.
6148 (_stat): Call stat64.
6149 (cygwin_lstat): Rename to avoid declaration problem. Call lstat64.
6150 (stat_worker): Use struct __stat64.
6152 (ftruncate): Call ftruncate64.
6153 (truncate): Call truncate64.
6154 * wincap.cc: Set flag has_64bit_file_access appropriately.
6155 * wincap.h: Add flag has_64bit_file_access.
6156 * winsup.h (ILLEGAL_SEEK): Define as __off64_t.
6157 (stat_dev): Declare using struct __stat64.
6158 (stat_worker): Ditto.
6159 * include/cygwin/stat.h (struct __stat32): Define if compiling Cygwin.
6160 (struct __stat64): Ditto.
6161 (struct stat): Revert definition with explicitly sized datatypes.
6162 Eliminate sized field names.
6163 * include/cygwin/types.h (blksize_t): New type.
6164 (__blkcnt32_t): Ditto.
6165 (__blkcnt64_t): Ditto.
6168 2002-02-22 Christopher Faylor <cgf@redhat.com>
6170 * sync.h (new_muto): Just accept an argument which denotes the name of
6171 the muto. Use this argument to construct static storage.
6172 * cygheap.cc (cygheap_init): Reflect above change.
6173 * exceptions.cc (events_init): Ditto.
6174 * malloc.cc (malloc_init): Ditto.
6175 * path.cc (cwdstuff::init): Ditto.
6176 * cygheap.h (cwdstuff): Change name of lock element to make it less
6178 * path.cc (cwdstuff::get_hash): Ditto.
6179 (cwdstuff::get_initial): Ditto.
6180 (cwdstuff::set): Ditto.
6181 (cwdstuff::get): Ditto.
6182 * sigproc.cc (proc_subproc): Ditto.
6184 * debug.cc (lock_debug): Change to method. Use method rather than
6187 * tty.h (tty_min::kill_pgrp): Declare new method.
6188 * fhandler_termios.cc (tty_min::kill_pgrp): New method.
6189 (fhandler_termios::line_edit): Use new method for killing process.
6190 * dcrt0.cc (do_exit): Ditto.
6192 * dtable.cc (dtable::get_debugger_info): New method for inheriting
6193 dtable info from a debugger.
6194 * tty.cc (tty_init): Attempt to grab file handle info from parent
6195 debugger, if appropriate.
6197 # dtable.cc (dtable::stdio_init): Make this a method.
6198 (dtable::init_std_file_from_handle): Don't set fd unless it's not open.
6199 (dtable::build_fhandler_from_name): Move name setting to
6200 dtable::build_fhandler.
6201 (dtable::build_fhandler): Add win32 name parameter.
6202 * dcrt0.cc (dll_crt0_1): Change to use dtable stdio_init.
6203 * dtable.h (dtable): Reflect build_fhandler parameter change.
6204 * mmap.cc (mmap_record::alloc_fh): Don't set name parameter in
6206 * net.cc (fdsock): Remove set_name call since it is now handled by
6209 * sigproc.cc (proc_subproc): Release muto as early as possible.
6211 2001-02-22 Corinna Vinschen <corinna@vinschen.de>
6213 * smallprint.c (rn): Allow long long values.
6214 (__small_vsprintf): Add 'D', 'U' and 'X' formats for long long
6217 2002-02-19 Christopher Faylor <cgf@redhat.com>
6219 * fhandler.cc (fhandler_base::puts_readahead): Remove default parameter
6220 setting. Newer gcc's complain about this.
6221 (fhandler_base::set_readahead_valid): Ditto.
6222 * fhandler_dsp.cc (Audio::open): Ditto.
6223 (fhandler_dev_dsp::open): Ditto.
6225 2002-02-19 Christopher Faylor <cgf@redhat.com>
6227 * fork.cc (fork_parent): Use sec_user_nih to control process/thread
6228 inheritance/permission.
6229 * spawn.cc (spawn_guts): Ditto.
6230 * security.cc (create_token): Initialize token so that it is not tested
6231 for bogus value later. Use sec_user to control process/thread
6233 * security.h (__sec_user): Rename declaration from sec_user.
6234 (sec_user_nih): Declare here as inline function wrapper for __sec_user.
6236 * sigproc.cc (czombies): Allocate a character array for zombies to
6237 avoid constructor overhead
6238 (extremely hackish, I know).
6239 (cpchildren): Ditto.
6240 (pchildren): New define.
6242 (getsem): Use sec_user_nih to control semaphore inheritance/permission.
6244 2002-02-16 Christopher Faylor <cgf@redhat.com>
6246 * times.cc (hires::prime): Restore thread priority on failure
6249 * uinfo.cc (uinfo_init): Use more robust method for determining if
6250 process was invoked from a non-cygwin process.
6252 * sync.h (muto::init): Eliminate "inheritance" parameter.
6253 (new_muto): Reflect removal of parameter.
6254 * sync.cc (muto::init): Ditto.
6255 * cygheap.cc (cygheap_init): Ditto.
6256 * debug.cc (threadname_init): Ditto.
6257 * exceptions.cc (events_init): Ditto.
6258 * malloc.cc (malloc_init): Ditto.
6259 * path.cc (cwdstuff::init): Ditto.
6260 * sigproc.cc (sigproc_init): Ditto.
6262 * grp.cc (group_lock): Use different method for locking with static
6264 (read_etc_group): REALLY ensure that read lock mutex is released.
6265 * passwd.cc (passwd_lock): Use different method for locking with static
6267 (read_etc_passwd): REALLY ensure that read lock mutex is released.
6269 * shared.cc (sec_user): Correct reversed inheritance test.
6271 2002-02-15 Christopher Faylor <cgf@redhat.com>
6273 * hires.h (hires::usecs): Rename from utime. Accept an argument.
6274 * strace.cc (strace::microseconds): Use hires class for calculating
6276 * sync.h (new_muto): Use NO_COPY explicitly in declaration.
6277 * times.cc (gettimeofday): Reflect change in usecs argument.
6278 (hires::usecs): Ditto. Changed name from utime.
6279 * winsup.h (NO_COPY): Add nocommon attribute to force setting aside
6281 * regcomp.c (REQUIRE): Add a void cast to bypass a warning.
6283 2002-02-15 Christopher Faylor <cgf@redhat.com>
6285 * hires.h: New file.
6286 * times.cc (gettimeofday): Use hires class for calculating current time.
6287 (hires::prime): New method.
6288 (hires::utime): Ditto.
6290 2002-02-14 Christopher Faylor <cgf@redhat.com>
6292 * include/sys/cygwin.h (cygwin_getinfo_types): New CW_STRACE_ACTIVE.
6293 * external.cc (cygwin_internal): Handle CW_STRACE_ACTIVE.
6295 2002-02-14 Christopher Faylor <cgf@redhat.com>
6297 * exceptions.cc (unused_sig_wrapper): Eliminate unused parameter to
6299 * external.cc (cygwin_internal): Change CW_STRACE_ON to
6301 * strace.cc (strace::hello): Toggle strace on and off.
6302 * sync.cc (muto::init): Rename from constructor.
6303 * sync.h (muto::new): Delete.
6304 (muto::delete): Ditto.
6305 (new_muto): Simplify. Use muto.init for nearly everything.
6306 * uinfo.cc (uinfo_init): Avoid closing a NULL handle.
6307 * include/sys/cygwin.h (cygwin_getinfo_types): Rename CW_STRACE_OFF to
6308 CW_STRACE_TOGGLE. Delete CW_STRACE_OFF.
6309 * include/sys/strace.h (strace): Add "inited" field.
6311 2001-02-12 Corinna Vinschen <corinna@vinschen.de>
6313 * include/cygwin/acl.h: Fix definition of aclent_t.
6315 2002-02-10 Christopher Faylor <cgf@redhat.com>
6317 * Makefile.in (DLL_OFILES): Consolidate object files.
6319 2002-02-10 Corinna Vinschen <corinna@vinschen.de>
6321 * child_info.h, cygheap.h, fhandler_clipboard.cc, fhandler_dsp.cc,
6322 fhandler_floppy.cc, fhandler_mem.cc, fhandler_random.cc,
6323 fhandler_tape.cc, fhandler_zero.cc, grp.cc, mmap.cc, passwd.cc,
6324 pinfo.cc, pinfo.h, pipe.cc, sec_acl.cc, sec_helper.cc, security.cc,
6325 security.h, thread.h, uinfo.cc, include/cygwin/acl.h: Fix copyright.
6327 2002-02-10 Corinna Vinschen <corinna@vinschen.de>
6329 * child_info.h, cygheap.h, dcrt0.cc, dir.cc, fhandler.cc, fhandler.h,
6330 fhandler_clipboard.cc, fhandler_disk_file.cc, fhandler_dsp.cc,
6331 fhandler_floppy.cc, fhandler_mem.cc, fhandler_random.cc,
6332 fhandler_tape.cc, fhandler_zero.cc, grp.cc, mmap.cc, passwd.cc,
6333 pinfo.cc, pinfo.h, pipe.cc, sec_acl.cc, sec_helper.cc, security.cc,
6334 security.h, spawn.cc, syscalls.cc, thread.h, uinfo.cc, winsup.h:
6335 Change usage of uid_t to __uid16_t, gid_t to __gid16_t and
6336 off_t to __off32_t throughout. Use INVALID_UID, INVALID_GID and
6337 INVALID_SEEK instead casting -1 to the appropriate type.
6338 * winsup.h: Define INVALID_UID, INVALID_GID and INVALID_SEEK.
6339 * include/cygwin/acl.h: Define internal __aclent16_t and __aclent32_t
6340 types. Don't declare acl functions when compiling Cygwin.
6341 * include/cygwin/grp.h: Declare getgrgid() and getgrnam() with
6342 correct types for internal usage.
6344 2002-02-10 Corinna Vinschen <corinna@vinschen.de>
6346 Patch suggested by Pierre A. Humblet <Pierre.Humblet@ieee.org>:
6347 * uinfo.cc (internal_getlogin): Try evaluating user by SID even if
6349 (uinfo_init): Set primary group even if ntsec is off.
6351 2002-02-09 Corinna Vinschen <corinna@vinschen.de>
6353 * include/cygwin/grp.h: New file.
6354 * include/cygwin/stat.h: Ditto.
6355 * include/cygwin/types.h: Add definitions for __off32_t,
6356 __off64_t, off_t, __uid16_t, __uid32_t, uid_t, __gid16_t,
6357 __gid32_t and gid_t.
6358 * include/sys/cygwin.h: Use correct uid and gid types.
6360 2002-02-09 Corinna Vinschen <corinna@vinschen.de>
6362 * dtable.cc (dtable::dup2): Revert previous patch.
6363 * fhandler.h: Ditto.
6364 (fhandler_socket::recv): Define new method.
6365 (fhandler_socket::send): Ditto.
6366 * fhandler_socket.cc (fhandler_socket::recv): New method.
6367 (fhandler_socket::send): Ditto.
6368 (fhandler_socket::read): Call fhandler_socket::recv() now.
6369 (fhandler_socket::write): Call fhandler_socket::send() now.
6370 * net.cc (class wsock_event): Move definition to wsock_event.h.
6371 (fdsock): Revert previous patch.
6372 (cygwin_recv): Move implementation to fhandler_socket::recv().
6373 (cygwin_send): Move implementation to fhandler_socket::send().
6374 * wsock_event.h: New file.
6376 2002-02-06 Alexander Gottwald <Alexander.Gottwald@s1999.tuchemnitz.de>
6378 * net.cc (get_2k_ifconf): Create interface entries for tokenring cards.
6380 2002-02-08 Corinna Vinschen <corinna@vinschen.de>
6382 * dtable.cc (dtable::dup2): Store fd for fhandler_socket.
6383 * fhandler.h (fhandler_base::set_fd): New virtual method.
6384 (fhandler_base::get_fd): Ditto.
6385 (fhandler_socket::set_fd): Ditto.
6386 (fhandler_socket::get_fd): Ditto.
6387 * fhandler_socket.cc (fhandler_socket::read): Call cygwin_recv instead
6388 of native Winsock recv.
6389 (fhandler_socket::write): Call cygwin_send instead of native Winsock
6391 * net.cc (fdsock): Store fd in fhandler_socket.
6393 2002-02-07 Corinna Vinschen <corinna@vinschen.de>
6395 * net.cc (cygwin_getsockname): Fix handling of NULL sun_path.
6397 2002-01-29 Corinna Vinschen <corinna@vinschen.de>
6399 * net.cc (getdomainname): Fix registry key for 9x systems, too.
6401 2002-01-29 Corinna Vinschen <corinna@vinschen.de>
6403 * net.cc (getdomainname): Fix registry key for NT systems.
6405 2002-01-28 Christopher Faylor <cgf@redhat.com>
6407 * external.cc (cygwin_internal): Initialize various internal settings
6408 if required to allow use of some things from user loaded DLL.
6409 (CW_STRACE_ON): Add new feature.
6410 (CW_CYGWIN_PID_TO_WINPID): Ditto.
6411 * pinfo.cc (set_myself): Call "strace.hello" to initiate possible
6413 (pinfo::init): Guard against dereferencing uninitialized myself.
6414 * sigproc.cc (wait_sig): Call strace.hello() when __SIGTRACE "signal"
6416 * strace.cc (strace::hello): New method.
6417 * wincap.cc (wincapc::init): Avoid initializing if already initialized.
6418 * wincap.h (wincapc::wincapc): New method.
6419 * include/sys/cygwin.h: Add new CW_ enums. Kludge typedefs of
6420 {g,u}id_t if required.
6421 * strace.h (strace::hello): Declare new method.
6423 2002-01-28 Earnie Boyd <earnie@users.sf.net>
6425 * include/sys/strace.h (_STRACE_ON): Define.
6426 (_STRACE_OFF): Ditto.
6428 2002-01-24 Christopher Faylor <cgf@redhat.com>
6430 * speclib: Ensure that temporary def file is removed.
6432 2002-01-23 Christopher Faylor <cgf@redhat.com>
6434 * speclib: Use rm -f to remove temp file just to quiet any potential
6437 2002-01-23 Corinna Vinschen <corinna@vinschen.de>
6439 * security.cc (create_token): Use sec_user() to create
6440 SECURITY_ATTRIBUTES structure for primary token. Use
6441 MAXIMUM_ALLOWED access rights instead of TOKEN_ALL_ACCESS.
6443 2002-01-23 Corinna Vinschen <corinna@vinschen.de>
6445 * path.cc (symlink): Fix check for already existing file.
6447 2002-01-21 Christopher Faylor <cgf@redhat.com>
6449 * cygmagic: Suppress error output when figuring out if sum takes an
6452 2002-01-21 Christopher Faylor <cgf@redhat.com>
6454 * cygmagic: Attempt to figure out if sum takes an option.
6456 2002-01-21 DJ Delorie <dj@redhat.com>
6458 * Makefile.in (libpthread.a): Pass the assembler also.
6461 * speclib: Specify the assembler to dlltool.
6463 2002-01-21 Christopher Faylor <cgf@redhat.com>
6465 * include/cygwin/version.h: Bump DLL minor number.
6467 2002-01-21 Corinna Vinschen <corinna@vinschen.de>
6469 * grp.cc (getgrgid): Don't return default gid entry when ntsec is on.
6470 * syscalls.cc (setegid): Don't set primary group in process token.
6472 2002-01-21 Christopher Faylor <cgf@redhat.com>
6474 * speclib: Don't use /dev/null as DLL name. Just default to what's
6475 already in .def file.
6477 2002-01-21 Christopher Faylor <cgf@redhat.com>
6479 * exceptions.cc (sig_handle): Remove last vestiges of SA_NOCLDSTOP code
6480 which caused SIGCHLD to be ignored.
6482 2002-01-20 Christopher Faylor <cgf@redhat.com>
6484 * include/cygwin/version.h: Bump DLL minor number.
6486 2002-01-20 Christopher Faylor <cgf@redhat.com>
6488 * syscalls.cc (regfree): Make dll_export.
6490 2002-01-20 Christopher Faylor <cgf@redhat.com>
6492 * exceptions.cc (ctrl_c_handler): Convert windows pid to cygwin pid
6493 when detecting if we should actually handle CTRL-C.
6495 2002-01-19 Christopher Faylor <cgf@redhat.com>
6497 * Makefile.in (new-cygwin1.dll): Revert previous change. libsupc++.a
6498 is only available in libstdc++-v3.
6500 2002-01-19 Christopher Faylor <cgf@redhat.com>
6502 * exceptions.cc (sig_handle_tty_stop): Don't send SIGCHLD if parent
6504 (sig_handle): Don't check for SA_NOCLDSTOP here. We don't have enough
6507 2002-01-19 Christopher Faylor <cgf@redhat.com>
6509 * include/cygwin/version.h: Bump DLL minor number.
6511 2002-01-19 Christopher Faylor <cgf@redhat.com>
6513 * Makefile.in (new-cygwin1.dll): Just use -lsupc++ for link.
6514 * sigproc.cc (proc_exists): Change existence criteria.
6515 * sync.h (new_muto): Add volatile to definition to avoid gcc
6516 optimization problems.
6518 2002-01-19 Corinna Vinschen <corinna@vinschen.de>
6520 * include/cygwin/version.h: Bump API minor version to 51.
6522 2002-01-19 Mark Bradshaw <bradshaw@staff.crosswalk.com>
6524 * cygwin.din: Add recvmsg and sendmsg.
6525 * net.cc: Add cygwin_recvmsg and cygwin_sendmsg.
6526 * /usr/include/sys/socket.h: Add recvmsg and sendmsg.
6528 2002-01-19 Corinna Vinschen <corinna@vinschen.de>
6530 * security.cc (create_token): Close processes token handle as soon
6531 as it's not used anymore.
6533 2002-01-17 Corinna Vinschen <corinna@vinschen.de>
6535 * Makefile.in: Add fnmatch.o to DLL_OFILES.
6536 * cygwin.din: Add fnmatch export symbol.
6537 * fnmatch.c: New file.
6538 * include/fnmatch.h: Ditto.
6539 * include/cygwin/version.h: Bump API minor version to 50.
6541 2002-01-15 Corinna Vinschen <corinna@vinschen.de>
6543 * path.cc (fchdir): Call chdir with full windows path.
6545 2002-01-14 Corinna Vinschen <corinna@vinschen.de>
6547 * dir.cc: Use INVALID_FILE_ATTRIBUTES instead of "(DWORD) -1"
6548 for file attributes throughout.
6549 * fhandler.cc: Ditto.
6550 * fhandler_disk_file.cc: Ditto.
6553 * syscalls.cc: Ditto.
6554 * times.cc (utimes): Use path_conv::isdir() instead of explicit
6555 GetFileAttributes() call.
6557 2002-01-13 Christopher Faylor <cgf@redhat.com>
6559 * dcrt0.cc (multiple_cygwin_problem): Clarify logic and make
6560 CYGWIN_MISMATCH_OK more powerful.
6562 2002-01-10 Christopher Faylor <cgf@redhat.com>
6564 * exceptions.cc (sig_handle): Accept a second argument indicating
6565 whether the signal came from this process or not.
6566 * sigproc.h: Reflect sig_handle arg change.
6567 * signal.cc (kill_pgrp): Add sigframe info.
6568 (abort): New function. Eliminates newlib function of same name.
6569 * sigproc.cc (wait_sig): Pass "signal from this process" value as arg
6572 2002-01-10 Corinna Vinschen <corinna@vinschen.de>
6574 * syscalls.cc (pathconf): Guard _PC_PATH_MAX branch against invalid
6577 2002-01-09 Christopher Faylor <cgf@redhat.com>
6578 Robert Collins <rbtcollins@hotmail.com>
6580 * exceptions.cc (early_stuff_init): Rename from misnamed
6581 set_console_handler.
6582 (ctrl_c_handler): Attempt to work around potential signal duplication
6583 during process startup.
6584 (sig_handle): Ignore SIGINT when we're just an "exec stub".
6585 * spawn.cc (spawn_guts): Store pid of spawned process in global for use
6587 * dcrt0.cc (dll_crt0_1): Call renamed initialization function.
6588 * winsup.h: Reflect function name change.
6590 2002-01-08 Corinna Vinschen <corinna@vinschen.de>
6592 * net.cc (cygwin_accept): Set sun_path for newly connected socket.
6594 2002-01-07 Ralf Habacker <Ralf.Habacker@freenet.de>
6596 * Makefile.in: Add uninstall target.
6598 2002-01-07 Christopher Faylor <cgf@redhat.com>
6600 * sigproc.cc (getsem): Clean up debugging output.
6602 2002-01-07 Christopher Faylor <cgf@redhat.com>
6604 * sigproc.cc (getsem): Set errno when unable to create own semaphore.
6605 Reorganize to make clearer that error should only come from initial
6606 creation of process semaphore.
6608 2002-01-06 Christopher Faylor <cgf@redhat.com>
6610 * dtable.cc (dtable::init_std_file_from_handle): Add some defensive
6611 code to invalid handle case.
6613 2002-01-06 Corinna Vinschen <corinna@vinschen.de>
6615 * ioctl.cc (ioctl): Make third argument optional.
6616 * include/sys/ioctl.h: Ditto in declaration.
6617 * dtable.cc (dtable::init_std_file_from_handle): Revert previous
6619 * window.cc (WndProc): Raise SIGURG instead of SIGIO in case of FD_OOB
6622 2002-01-05 Christopher Faylor <cgf@redhat.com>
6624 * dir.cc (opendir): Guarantee release of alloced fhandler structure on
6627 2002-01-05 Corinna Vinschen <corinna@vinschen.de>
6629 * exceptions.cc (sig_handle): Set default action for SIGURG to SIG_IGN.
6631 2002-01-05 Corinna Vinschen <corinna@vinschen.de>
6633 * dtable.cc (dtable::init_std_file_from_handle): Don't treat NULL
6634 handle as errorneous.
6636 2002-01-04 Christopher Faylor <cgf@redhat.com>
6638 * cygmagic: Change logic for equality test.
6640 2002-01-04 Christopher Faylor <cgf@redhat.com>
6642 * dir.cc (opendir): Don't attempt to call sub-opendir if ENOENT.
6644 2002-01-04 Corinna Vinschen <corinna@vinschen.de>
6646 * net.cc: Replace usage of AF_UNIX by Posix compliant AF_LOCAL
6648 (socketpair): Explicitly allow SOCK_STREAM and SOCK_DGRAM socket types
6649 in families AF_UNIX and AF_LOCAL. Explicitly allow PF_UNSPEC, PF_LOCAL
6650 and PF_INET protocols. Return error otherwise. Implement datagram
6653 2002-01-01 Christopher Faylor <cgf@redhat.com>
6655 * speclib: Remove temp files automatically.
6657 2002-01-01 Corinna Vinschen <corinna@vinschen.de>
6658 * fhandler.h (fhandler_socket::sun_path): New private member.
6659 (fhandler_socket::set_sun_path): New method.
6660 (fhandler_socket::get_sun_path): Ditto.
6661 * fhandler_socket.cc (fhandler_socket::fhandler_socket): Initialize
6663 (fhandler_socket::~fhandler_socket): Free sun_path if needed.
6664 (fhandler_socket::set_sun_path): New method.
6665 * net.cc (cygwin_bind): Set sun_path to path of local socket file.
6666 (cygwin_getsockname): Add code to return correct sockaddr for unix