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