1 2011-11-03 Christopher Faylor <me.cygwin2011@cgf.cx>
3 * sigproc.cc (child_info_spawn::reattach_children): Avoid issuing an
4 error when we can't duplicate from "parent" since it is probably ok if
5 children of the previous owner of the pid disappear.
7 2011-11-03 Corinna Vinschen <corinna@vinschen.de>
9 * fhandler.cc (off_current): Define local in fhandler_base::raw_write.
10 Drop erroneous NO_COPY, add _RDATA to make R/O.
12 * globals.cc (_RDATA): Move definition from here...
13 * winsup.h: ...to here.
15 2011-10-30 Christopher Faylor <me.cygwin2011@cgf.cx>
17 * fhandler.h (fhandler_pipe::create_selectable): Remove optional
18 argument, take an options argument for CreateNamedPipe/CreateFile.
19 Change handle arguments to expect pointers.
20 (fhandler_fifo::fifo_state): Delete.
21 (fhandler_fifo::dummy_client): Ditto.
22 (fhandler_fifo::open_nonserver): Ditto.
23 (fhandler_fifo::wait_state): Ditto.
24 (fhandler_fifo::raw_write): Ditto.
25 (fhandler_fifo::read_ready): New field.
26 (fhandler_fifo::write_ready): Ditto.
27 (fhandler_fifo::wait): Modify argument.
28 (fhandler_fifo::fifo_name): Add a new argument.
29 (fhandler_fifo::fixup_after_fork): New function.
30 * fhandler_fifo.cc (fhandler_fifo::fhandler_fifo): Remove
31 initialization of expunged elements. Initialize new handles to NULL.
32 (fhandler_fifo::open_nonserver): Delete.
33 (fnevent): New macro for creating a named event.
34 (fnpipe): New macro for creating a unique named pipe name.
35 (create_pipe): New macro for simplification of named pipe creation.
36 (fhandler_fifo::fifo_name): Use new argument when creating a shared
38 (fhandler_fifo::open): Rewrite. Use events to synchronize.
39 (fhandler_fifo::wait): Rewrite to wait for new fifo events which are
40 supplied as a parameter.
41 (fhandler_fifo::raw_read): Rewrite to use handle mechanism to detect
42 client-side disconnect.
43 (fhandler_fifo::raw_write): Delete.
44 (fhandler_fifo::close): Remove accommodations for expunged fields.
46 (fhandler_fifo::dup): Remove accommodations for expunged fields.
47 Duplicate event handles.
48 (fhandler_fifo::fixup_after_fork): New function. Perform fixups on
50 (fhandler_fifo::set_close_on_exec): Remove accommodations for expunged
51 fields. Set inheritance for new handle fields.
52 * miscfuncs.cc (CreatePipeOverlapped): Accommodate changes in
53 fhandler_pipe::create_selectable.
54 * tty.cc (tty::not_allocated): Ditto.
55 * pipe.cc (fhandler_pipe::create): Ditto.
56 (fhandler_pipe::create_selectable): Accept an extra open_mode argument.
57 Pass arguments by reference and allow opening one end of the pipe at a
60 * sys/strace.h (debug_only_printf): Define new macro which calls
61 debug_printf only when DEBUGGING is defined.
63 2011-10-28 Christopher Faylor <me.cygwin2011@cgf.cx>
65 * exceptions.cc (sigpacket::process): Avoid a potential deadlock when
66 exiting due to a signal.
68 2011-10-28 Corinna Vinschen <corinna@vinschen.de>
70 * cygwin.din (getgrouplist): Export.
71 * grp.cc (get_groups): New static function to run the core functionality
72 of initgroups and getgrouplist.
73 (initgroups32): Call get_groups and just create supplementary group
74 list in cygheap. Rename name of first argument to "user". Add an
75 assertion to test for a NULL user name.
76 (initgroups): Rename name of first argument to "user".
77 (getgrouplist): New function.
78 * posix.sgml (std-bsd): Add getgrouplist.
79 * include/cygwin/grp.h (getgrouplist): Declare.
80 * include/cygwin/version.h: Bump API minor number.
82 2011-10-25 Christopher Faylor <me.cygwin2011@cgf.cx>
84 * child_info.h (cchildren): New struct.
85 (child_info_spawn::nchildren): Rename from nprocs.
86 (child_info_spawn::children): Change type to cchildren for more
87 bookkeeping possibilities.
88 (child_info_spawn::child_info_spawn): Clear nchildren.
89 (child_info_spawn::record_children): Declare new function.
90 (child_info_spawn::reattach_children): Ditto.
91 * dcrt0.cc (child_info_spawn::handle_spawn): Call reattach_children to
92 gather list of processes we are potentially waiting for.
93 * pinfo.h (pinfo::pinfo): Make sure that rd_proc_pipe is always cleared.
94 (pinfo::reattach): New function.
95 * sigproc.cc: Move pinfo.h earlier so that it can be used in sigproc.h.
96 (get_proc_lock): Don't bother with a lock during DLL initialization.
97 (proc_subproc): Handle PROC_REATTACH_CHILD.
98 (proc_terminate): Orphan children only when we are not an execed
99 process or when the pid is about to be occupied by a non-cygwin
101 (child_info_spawn::record_children): Define new function.
102 (child_info_spawn::reattach_children): Ditto.
103 * sigproc.h (procstuff): Define PROC_REATTACH_CHILD and renumber other
105 * spawn.cc (spawn_guts): Record any to-be-waited-for subprocesses if
106 about to exec a cygwin process.
108 * sigproc.cc (sig_send): Fix harmless transposition of fifth and six
109 arguments to DuplicateHandle().
110 (child_info::child_info): Ditto.
112 * globals.cc (hExeced): Make NO_COPY.
114 2011-10-25 Corinna Vinschen <corinna@vinschen.de>
116 * hookapi.cc (hook_or_detect_cygwin): Take additional handle
117 to a file mapping as parameter. If this handle is not NULL,
118 create another file mapping for the IAT.
119 * spawn.cc (av::fixup): Only map the first 64K of an image and
120 keep the mapping handle to use as argument to hook_or_detect_cygwin.
121 * winsup.h (hook_or_detect_cygwin): Add mapping handle as default
122 parameter in declaration.
124 2011-10-24 Corinna Vinschen <corinna@vinschen.de>
126 * syscalls.cc (unlink_nt): Fix a bug which overwrites the NT status
127 value in case setting the delete disposition returns with
128 STATUS_DIRECTORY_NOT_EMPTY.
130 2011-10-24 Corinna Vinschen <corinna@vinschen.de>
132 * shared.cc (open_shared): Fix memory reservation of essential shared
133 memory regions. Drop delta computations since delta is always 0 in
134 non-relocated case. Add a comment.
136 2011-10-23 Christopher Faylor <me.cygwin2011@cgf.cx>
138 * fhandler_tty.cc (fhandler_pty_slave::read): Use consistent way for
139 testing ReadFile return.
140 * pipe.cc (fhandler_pipe::create_selectable): Open the write side of
141 the pipe in message-mode to force writing as "chunks". Explain why.
143 2011-10-23 Christopher Faylor <me.cygwin2011@cgf.cx>
145 * path.cc (path_conv::get_nt_native_path): Avoid dereferencing path
148 2011-10-21 Christopher Faylor <me.cygwin2011@cgf.cx>
150 * dtable.cc (dtable::delete_archetype): Improve debugging output.
151 (dtable::init_std_file_from_handle): Close console handle early, before
152 initialization. Build up openflags for passing to open_setup, just to
154 (last_tty_dev): New variable.
155 (fh_last_tty_dev): New macro.
156 (fh_alloc): Try again to keep track of previously opened tty, this time
157 by just saving the device and using that to potentially open an
158 archetype. Avoid setting the "/dev/tty" name if the creation of the
160 (build_fh_pc): Remove unused second argument. Reorganize how and where
161 the name is set. Set last_tty_dev as appropriate. Avoid a NULL
162 dereference in a debug printf.
163 * dtable.h (build_fh_pc): Reflect removal of second parameter.
164 * fhandler.cc (fhandler_base::reset): Use new '<<' operator to copy pc
165 since it preserves any potentially previously set name.
166 (fhandler_base::set_name): Ditto.
167 * fhandler.h (fhandler_*::clone): Throughout use ccalloc to allocate
168 new fhandler, primarily to make sure that pc field is properly zeroed.
169 (fhandler_termios::last): Eliminate.
170 (fhandler_termios): Remove setting of last.
171 (fhandler_base::~fhandler_termios): Ditto.
172 * fhandler_console.cc (fhandler_console::open): Don't make decisions
173 about opening close-on-exec handles here since it makes no sense for
175 (fhandler_console::init): Assume that input handle has already been
177 * fhandler_termios.cc (fhandler_termios::last): Delete.
178 * path.h (path_conv::eq_worker): New function. Move bulk of operator =
180 (operator <<): New function.
181 (operator =): Use eq_worker to perform old functionality.
183 * child_info.h (NPROCS): Move here from sigproc.cc.
184 (child_info::nprocs): New field. Not used yet.
185 (child_info::children):: Ditto.
187 2011-10-21 Corinna Vinschen <corinna@vinschen.de>
189 * fhandler_disk_file.cc (fhandler_disk_file::rmdir): Check invalid
190 success only on Samba shares.
191 * mount.cc (fs_info::update): Drop has_buggy_basic_info flag for
193 * syscalls.cc (unlink_nt): Fix typo in comment.
195 2011-10-21 Corinna Vinschen <corinna@vinschen.de>
197 * globals.cc (ro_u_ncfsd): New R/O unicode string.
198 * mount.cc (fs_info::update): Check for "NcFsd" FS. Set flags and
199 change comments accordingly.
200 (fs_names): Add entry for NcFsd FS.
201 * mount.h (enum fs_info_type): Add ncfsd.
202 (class fs_info): Add ncfsd flag and accessor methods.
203 * path.h (class path_conv): Add fs_is_ncfsd method.
204 * syscalls.cc (unlink_nt): Experimentally try delete-on-close on NcFsd
205 in STATUS_CANNOT_DELETE case.
207 2011-10-20 Christopher Faylor <me.cygwin2011@cgf.cx>
209 * fhandler.h (fhandler*::copyto): Free path_conv strings first.
210 * path.h (cfree_and_null): Rename and expand from cfree_maybe.
211 (path_conv &operator =): Call free_strings rather than freeing strings
214 2011-10-20 Christopher Faylor <me.cygwin2011@cgf.cx>
216 Throughout change TTY_* to PTY_*, tty_* to pty_*, and ttym_* to ptmx_*.
217 * devices.cc: Regenerate.
218 * dtable.cc: (fh_alloc): Preserve /dev/tty name when that's what we
220 (build_fh_pc): Preserve any existing name.
221 * fhandler.cc (fhandler_base::open_with_arch): Ditto.
222 * fhandler_tty.cc (fhandler_pty_master::fhandler_pty_master): Force the
223 name to /dev/ptmx while preserving other pty master device information.
224 * path.h (cfree_maybe): New macro.
225 (path_conv::operator =): Free any allocated strings in target.
226 (path_conv::free_strings): Delete unused function.
228 * sigproc.cc (proc_terminate): Remove previous accommodation for execed
229 processes since it didn't have the desired effect. Change comment to a
232 * spawn.cc (chExeced): Mark NO_COPY.
233 (exe_suffixes): Ditto.
235 2011-10-20 Corinna Vinschen <corinna@vinschen.de>
237 * syscalls.cc (try_to_bin): Improve debug output.
238 (check_dir_not_empty): Take additional path_conv argument. Improve
239 debug output. Change syscall_printf to debug_printf.
240 (unlink_nt): Improve debug output. Change syscall_printf to
242 (unlink): Change syscall_printf to debug_printf.
244 * cygthread.h: Fix copyright dates.
246 2011-10-18 Corinna Vinschen <corinna@vinschen.de>
248 * path.cc: Extend two comments. Mention the name RtlpCurDirRef
251 2011-10-17 Christopher Faylor <me.cygwin2011@cgf.cx>
253 * dcrt0.cc (dll_crt0_1): Copy argv before passing to main().
255 2011-10-17 Christopher Faylor <me.cygwin2011@cgf.cx>
257 * sigproc.cc (proc_terminate): Avoid setting ppid to 1 if we're execing.
259 2011-10-15 Christopher Faylor <me.cygwin2011@cgf.cx>
261 * cygerrno.h (__set_errno): Modify debugging output to make searching
264 Throughout, change /dev/tty* to /dev/pty*.
265 Throughout, add flags argument to fhandler_*::dup methods.
266 * devices.in: Rename (temporarily?) /dev/ttyN to /dev/ptyN. Add
267 /dev/ptymN devices for pty masters.
268 * devices.cc: Regenerate.
269 * devices.h (MAX_CONSOLES): Set to max number supported by devices.in.
270 (fh_devices::FH_PTMX): Rename from FH_PTYM.
271 (device::operator int): Return by reference.
272 * dtable.cc (fh_alloc): Take pc as an argument rather than just the
273 device. This makes debugging easier since more information is
274 available. Actually implement handling for already-allocated pty
275 master devices. Make different decisions when generating fhandler for
276 not-opened devices. Add kludge to deal with opening /dev/tty.
277 (cnew_no_ctor): New macro.
278 (build_fh_pc): Make debugging output more verbose. Use new clone()
279 fhandler interface to duplicate archetypes. Reset last term opened.
280 (dtable::dup_worker): Use Use new clone() fhandler interface to
281 duplicate archetypes. Pass flags to child dup handler.
282 (dtable::dup3): Set O_NOCTTY flag if newfd is not stdin/stdout/stderr.
283 * fhandler.cc (fhandler_base::reset): Rename from operator =() and
284 reduce functionality and sense of copy direction.
285 (fhandler_base::open_with_arch): Use published interface to query
286 io_handle(). Use new copyto() fhandler method to copy from/to found
288 * fhandler.h: Throughout, delete size(), add copyout, clone, and
289 fhandler_* (void *) methods.
290 (fhandler_base::reset): Rename from operator =().
291 (fhandler_termios::is_dev_tty): Delete.
292 (fhandler_termios): change "protected" region to "private".
293 (fhandler_termios::is_dev_tty): Delete.
294 (fhandler_termios): Rearrange protected/public.
295 (fhandler_termios::fhandler_termios): Remember last fhandler_termios
297 (fhandler_termios::~fhandler_termios): Forget last fhandler_termios
299 (ioctl): Rename from ioctl_termios. Take a void * argument. Reflect
300 argument change in pinfo::set_ctty.
301 (fhandler_console::dup): Declare new function. Set ctty here if
303 (fhandler_pty_master::from_master): Privatize.
304 (fhandler_pty_master::to_master): Ditto.
305 (fhandler_pty_master::dwProcessId): Ditto.
306 (fhandler_pty_master::fhandler_pty_master): Add an `int' argument.
307 (fhandler_pty_master::open_setup): Declare new function.
308 (fhandler_pty_master::~fhandler_pty_master): Declare new method.
309 (fhandler_nodevice): Remove commented out function declaration.
310 * fhandler_console.cc: Use get_ttyp() instead of tc() throughout.
311 (fhandler_console::dup): Define new function to set controlling ctty on
313 (fhandler_console::ioctl): Reflect ioctl_termios name change.
314 (fhandler_console::setup): Rename from get_tty_stuff.
315 (fhandler_console::open_setup): Reflect argument change in
317 (fhandler_console::fhandler_console): Set _tc here.
318 * fhandler_termios.cc (handler_termios::ioctl): Rename. Take a void *
319 arg like other ioctl functions.
320 * fhandler_tty.cc (fhandler_pty_slave::dup): Call myself->set_ctty to
321 potentially reset the controlling terminal.
322 (fhandler_pty_slave::ioctl): Reflect name/arg change for ioctl_termios.
323 (fhandler_pty_slave::fhandler_pty_slave): Take a "unit" argument. Call
324 setup() here so that we will know the unit number of this fhandler as
325 soon as possible. Set the unit as appropriate.
326 (handler_pty_master::open): Move most stuff to constructor and
328 (handler_pty_slave::open_setup): Reflect argument change in
330 (handler_pty_master::open_setup): Define new function.
331 (fhandler_pty_master::cleanup): Clear handles as a flag that the
332 destructor does not have to do "close" operations.
333 (fhandler_pty_master::close): Ditto.
334 (fhandler_pty_master::~fhandler_pty_master): Define new method.
335 (fhandler_pty_master::ioctl): Reflect name/arg change for
337 (fhandler_pty_master::setup): Allocate tty here. Rely on handles being
338 returned from allocated test rather than opening them here. Avoid
339 setting _need_nl here since it is already zeroed in the constructor.
340 Set up device information with DEV_TTYM_MAJOR.
341 * path.h (path_conv &operator =): Take a const argument.
342 (path_conv::dup): Ditto.
343 (pathconv_arg::PC_OPEN): New enum.
344 (pathconv_arg::PC_CTTY): Ditto.
345 (path_types::PATH_CTTY): Ditto.
346 (path_types::PATH_OPEN): Ditto.
347 (path_conv::isopen): New method.
348 (path_conv::isctty_capable): Ditto.
349 * path.cc (path_conv::check): Set PATH_OPEN and PATH_CTTY as
351 * pipe.cc (fhandler_pipe::open): Use copyto to copy pipe handle.
352 * syscall.cc (open): Reinstate fd > 2 check to disallow resetting ctty
354 * tty.cc (tty_list::allocate): Pass out handles for allocated tty. use
355 `not_allocated' to find unallocated ttys. Avoid keeping the lock since
356 the allocation of the tty should be sufficient to prevent multiple
358 (tty::not_allocated): Clarify comment. Rename. Return handles when an
359 unused tty is found. Simply test for existing tty.
360 (tty::exists): Rewrite to use `not_allocated'.
361 * tty.h (NTTYS): Reset down to actual number supported by devices.in.
362 (tty::not_allocated): Declare new function.
363 (tty_list::allocate): Pass out read/write tty handles. Zero them when
365 * fhandler_proc.cc: Reflect name change from FH_PTYM -> FH_PTMX.
366 * pinfo.h (pinfo::set_ctty): Reduce/reorder arguments passed in.
367 * pinfo.cc (pinfo::set_ctty): Ditto. Just use tc() built into the
368 passed-in fhandler_termios pointer. Return true if ctty is assigned.
369 * syscalls.cc (open): Call build_fh_pc with PC_OPEN flag. Set PC_CTTY
371 (stat_worker): Remove is_dev_tty () stuff.
373 2011-10-15 Corinna Vinschen <corinna@vinschen.de>
375 * fhandler_process.cc (dos_drive_mappings::fixup_if_match): Convert
376 native NT network paths into DOS UNC paths.
378 2011-10-15 Corinna Vinschen <corinna@vinschen.de>
380 * sec_auth.cc (get_token_group_sidlist): Add CONSOLE LOGON SID on
381 systems supporting it. Never add SERVICE SID but keep code in for
382 future reference. Explain why.
383 (get_priv_list): Add cygpsid pointer parameter. Point it to the
384 mandatory integrity SID which matches account and privileges.
385 (create_token): Fetch mandatory integrity SID from call to
387 (lsaauth): Call get_priv_list with additional NULL pointer. Change
389 * sec_helper.cc (well_known_console_logon_sid): New static SID.
390 (cygpriv): Change to structure containing extra flag to store info
391 about required integrity level.
392 (privilege_luid): Accommodate changes to cygpriv. Return integrity
393 level in new high_integrity parameter.
394 (privilege_name): Accommodate changes to cygpriv.
395 (set_privilege): Drop trailing \n from debug output.
396 (set_cygwin_privileges): Don't set SE_CREATE_GLOBAL_PRIVILEGE anymore
397 since it's just not needed, but keep code in for future reference.
398 Change comment accordingly.
399 * security.h (well_known_console_logon_sid): Declare.
400 (privilege_luid): Align declaration to above change.
401 * wincap.h (wincaps::has_console_logon_sid): New element.
402 * wincap.cc: Implement above element throughout.
404 2011-10-13 Corinna Vinschen <corinna@vinschen.de>
406 * path.cc (find_fast_cwd_pointer): Allow 'push crit-sect-addr' instead
407 of 'mov edi, crit-sect-addr; push edi' and set rcall accordingly.
409 2011-10-13 Corinna Vinschen <corinna@vinschen.de>
411 * path.cc (copy_cwd_str): Move up in file to be accessible from
413 (class fcwd_access_t): New class to consolidate and hide the details
414 of the various FAST_CWD implementations. Add implementation for
415 Windows 8 Developer Preview.
416 (fast_cwd_version): Make static private member of fcwd_access_t.
417 (fast_cwd_ptr): Change base type to fcwd_access_t.
418 (find_fast_cwd_pointer): Return fcwd_access_t**.
419 (find_fast_cwd): Ditto. Rip out all FAST_CWD implementations and use
420 fcwd_access_t methods instead.
421 (cwdstuff::override_win32_cwd): Ditto.
423 2011-10-12 Corinna Vinschen <corinna@vinschen.de>
425 * fhandler_console.cc (fhandler_console::cursor_set): Disable forcing
426 y to the current winBottom position. Explain why.
428 2011-10-11 Christopher Faylor <me.cygwin2011@cgf.cx>
430 * cygwin.din: Remove some _tc* exports. Add tcgetsid().
431 * dtable.cc (fh_alloc): Revert ill-advised setting of major/minor. Use
432 new is_dev_tty to remember that this device was opened as /dev/tty.
433 * fhandler.cc (fhandler_base::fstat): Remove leftover debugging
435 (fhandler_base::tcgetsid): New function.
436 * fhandler.h ((fhandler_base::tcgetsid): Declare new function.
437 (fhandler_base::is_dev_tty): Ditto.
438 (fhandler_termios): Rearrange protected/public.
439 (fhandler_termios::fhandler_termios): Remember last fhandler_termios
441 (fhandler_termios::~fhandler_termios): Forget last fhandler_termios
443 (fhandler_termios::opened_as_dev_tty): Declare new field.
444 (fhandler_termios::is_dev_tty): Declare new function.
445 (fhandler_termios::tcgetsid): Ditto.
446 (fhandler_pty_common::use_archetype): Move here from subclass.
447 (fhandler_pty_slave::use_archetype): Move up.
448 (fhandler_pty_master::use_archetype): Ditto.
449 * fhandler_console.cc (fhandler_console::ioctl): Rename second argument
450 from `buf' to `arg' for consistency. Call ioctl_termios for common
451 fhandler_termios ioctl handling.
452 * fhandler_tty.cc (fhandler_pty_slave::ioctl): Call ioctl_termios for
453 common fhandler_termios ioctl handling.
454 (fhandler_pty_master::ioctl): Ditto.
455 * fhandler_termios.cc (fhandler_termios::tcgetsid): Implement new
457 (fhandler_termios::ioctl_termios): Ditto. Implements TIOCSCTTY
459 * syscalls.cc (stat_worker): Set /dev/tty device info when appropriate.
460 * termios.cc (tcgetpgrp): Avoid extraneous "isatty" check.
461 (tcgetsid): Implement new function.
462 * include/cygwin/version.h: Bump CYGWIN_VERSION_API_MINOR to 253.
463 * include/sys/termios.h (TIOCSCTTY): Define.
465 2011-10-11 Christopher Faylor <me.cygwin2011@cgf.cx>
467 * dtable.cc (fh_alloc): Don't parse /dev/tty if ctty is < 0. Reset
468 major/minor from the specific tty to those for /dev/tty.
470 2011-10-10 Christopher Faylor <me.cygwin2011@cgf.cx>
472 * syscalls.cc (open): Add temporary kludge to avoid assigning the
473 controlling tty on open unless the open is for stdin/stdout/stderr.
474 * tty.cc (tty_list::connect): Set ENXIO when can't find a tty.
476 2011-10-10 Corinna Vinschen <corinna@vinschen.de>
478 * fhandler.h (fhandler_process::closedir): Declare.
479 * fhandler_process.cc (fhandler_process::closedir): New function to
480 avoid a SEGV in fhandler_proc::closedir.
482 2011-10-10 Christopher Faylor <me.cygwin2011@cgf.cx>
484 * fhandler_tty.cc (fhandler_pty_slave::open): Clarify debugging output.
485 (fhandler_pty_slave::open): Change ENOENT to ENXIO when can't open a
488 2011-10-07 Corinna Vinschen <corinna@vinschen.de>
489 Christopher Faylor <me.cygwin2011@cgf.cx>
491 * fhandler.h (fhandler_console::tc_getpgid): New function.
492 * spawn.cc (spawn_guts): Add logic to put pure-windows processes "in
493 the background" when they are started that way.
495 2011-10-07 Corinna Vinschen <corinna@vinschen.de>
497 * include/sys/cygwin.h (cygwin_getinfo_types): Define values
498 additionally as preprocessor symbols.
500 2011-10-06 Corinna Vinschen <corinna@vinschen.de>
502 * fhandler_termios.cc (fhandler_termios::tcsetpgrp): Send __SIGSETPGRP
503 pseudo signal to process group instead of just calling
504 init_console_handler.
505 * sigproc.cc (wait_sig): Call init_console_handler here on __SIGSETPGRP
507 * sigproc.h (__SIGSETPGRP): Define.
509 2011-10-06 Christian Franke <franke@computer.org>
511 * include/cygwin/wait.h: Use new __wait_status_to_int()
512 macro to access status value in W*() status checks.
513 Fix status description.
514 * include/sys/wait.h: Allow `int' and `union wait' as
515 wait status parameter. Change __wait_status_to_int()
516 macro and wait () prototypes accordingly. Add inline
517 functions for C++. Remove extra `;'.
519 2011-10-05 Corinna Vinschen <corinna@vinschen.de>
521 * external.cc (create_winenv): Rename from sync_winenv. Take
522 environment pointer as parameter and return pointer to corresponding
523 win32 environment block if != NULL. Otherwise just sync as before.
524 (cygwin_internal): Add CW_CVT_ENV_TO_WINENV case.
525 * include/cygwin/version.h: Bump API minor number.
526 * include/sys/cygwin.h (cygwin_getinfo_types): Add CW_CVT_ENV_TO_WINENV.
528 2011-10-04 Corinna Vinschen <corinna@vinschen.de>
530 * net.cc (socketpair): Bind first socket to loopback only as well.
532 2011-09-21 Christopher Faylor <me.cygwin2011@cgf.cx>
534 * tty.cc (grantpt): Check for valid fd.
537 2011-09-02 Corinna Vinschen <corinna@vinschen.de>
539 * net.cc (cygwin_getsockopt): Drop erroneous double conversion of error
540 code returned by SOL_SOCKET/SO_ERROR. Fix error handling.
542 2011-09-01 Corinna Vinschen <corinna@vinschen.de>
544 * lc_msg.h: Regenerate.
546 2011-09-01 Corinna Vinschen <corinna@vinschen.de>
548 * dlfcn.cc (gfpod_helper): Helper function to search DLL using
549 a given DLL name. Change default search path to allow /usr/bin.
550 (get_full_path_of_dll): Find DLLs even if the caller used a ".so"
551 suffix or a "lib" prefix for the DLL.
553 2011-08-31 Corinna Vinschen <corinna@vinschen.de>
555 * flock.cc (inode_t::unlock_and_remove_if_unused): Rename from
558 2011-08-29 Corinna Vinschen <corinna@vinschen.de>
560 * flock.cc (LOCK_OBJ_NAME_LEN): Change to accommodate extra lf_ver
562 (class lockf_t): Add lf_ver field.
563 (lockf_t::lockf_t): Initialize lf_ver to 0.
564 (class inode_t): Change i_wait to i_cnt. Change comment to explain
566 (inode_t:use): Rename from wait. Make private.
567 (inode_t::unuse): Rename from unwait. Make private.
568 (inode_t::inuse): Rename from waiting. Make private.
569 (inode_t::notused): New public method to set use count to 0.
570 (inode_t::unlock_and_remove): New method to unlock node and to delete
571 it if it's unused in current process.
572 (fhandler_base::del_my_locks): Drop global list lock. Drop variable
573 no_locks_left. Simpify unlocking and removing node by just calling
575 (fixup_lockf_after_exec): Call notused method for each node.
576 (inode_t::get): Call use method. Lock node only if outside of list
578 (inode_t::get_all_locks_list): Accommodate additional lf_ver field
579 when creating lockf_t structure from object name.
580 (lockf_t::create_lock_obj_attr): Accommodate additional lf_ver field
581 when creating object name from lockf_t structure. Handle
582 STATUS_OBJECT_NAME_COLLISION gracefully in F_POSIX case as well.
583 Change comment accordingly. Increment lf_ver field rather than high
584 byte of lf_wid field. Simplify comment.
585 (fhandler_disk_file::lock): Always call unlock_and_remove rather than
587 (lf_setlock): Move ret definition where it's used. Drop unneeded
588 tests for obj being not NULL. Only check for deadlock condition if the
589 lock we're trying to establish is a POSIX lock. Revamp object
590 collecting and wait code to cover all cases. Don't return with EDEADLK
591 if blocking process can't be opened for synchronization in F_POSIX case,
592 rather just wait like in F_FLOCK case. Change system_printf to
593 debug_printf in that case. Only run WaitForMultipleObjects with high
594 priority. Close obj and process handles prior to locking node.
596 2011-08-27 Corinna Vinschen <corinna@vinschen.de>
598 * fhandler.cc (fhandler_base::open): Fix typo in comment.
599 (fhandler_base::close): Move call to del_my_locks from here...
600 * fhandler_disk_file.cc (fhandler_disk_file::open): ...to here.
601 * flock.cc (struct lockfattr_t): New type.
602 (lockf_t::close_lock_obj): New method, use throughout.
603 (lockf_t::create_lock_obj_attr): New method.
604 (lockf_t::create_lock_obj): Use create_lock_obj_attr method. Handle
605 STATUS_OBJECT_NAME_COLLISION in F_FLOCK case gracefully. Add lengthy
606 comments to explain why and how.
607 (lockf_t::open_lock_obj): Use create_lock_obj_attr method.
608 (lockf_t::del_lock_obj): Call NtSetEvent rather than SetEvent for
610 (fhandler_disk_file::lock): Define n only where it's used. Call
611 need_fork_fixup only if call was successful. Handle EINTR and
612 ECANCELED return values from lf_setlock.
613 (lf_setlock): Drop WAIT_UNLOCKED and WAIT_PROC_EXITED. Don't wait
614 for event object handle count to become <= 1 in F_LOCK case.
615 Simplify WFMO return value handling. Don't handle signal and cancel
616 events here; just return with appropriate error code instead.
617 (lf_getblock): Ignore locks for which the handle can't be opened.
618 Use IsEventSignalled.
619 * ntdll.h (STATUS_INVALID_INFO_CLASS): Undef if defined elsewhere to
620 make sure the definition is casted to NTSTATUS.
621 (STATUS_INVALID_HANDLE): Define and ditto.
622 (STATUS_OBJECT_NAME_COLLISION): Define.
623 (NtSetEvent): Declare.
625 2011-08-25 Rafal Zwierz <rzwierz@googlemail.com>
627 * cygthread.cc (cygthread::simplestub): Notify that the thread has
628 detached also in freerange thread case.
630 2011-08-25 Corinna Vinschen <corinna@vinschen.de>
632 * fhandler.cc (fhandler_base::open): Never open files with
633 FILE_OVERWITE/FILE_OVERWRITE_IF. Set file size to 0 explicitely if
634 regular, existing file has been opened for writing with O_TRUNC flag
637 2011-08-24 Corinna Vinschen <corinna@vinschen.de>
639 * thread.cc (pthread::pthread): Drop setting parent_tls. Call
640 sigprocmask to copy parent thread signal mask into new parent_sigmask
642 (pthread::thread_init_wrapper): Copy _my_tls.sigmask from new
643 parent_sigmask member.
644 * thread.h (class pthread): Drop parent_tls. Add parent_sigmask.
646 2011-08-24 Christopher Faylor <me.cygwin2011@cgf.cx>
648 * thread.cc (pthread::exit): Create dummy tls structure to hold
649 _main_tls contents if we've asked _main_tls to exit.
651 2011-08-23 Corinna Vinschen <corinna@vinschen.de>
653 * poll.cc (poll): Don't return prematurely if invalid fds have been
654 encountered. Enforce timeout set to 0 in case of invalid fds. Take
655 number of invalid fds into account when returning.
657 2011-08-23 Corinna Vinschen <corinna@vinschen.de>
659 * fhandler_socket.cc (fhandler_socket::send_internal): Fix setting
660 nosignal flag. Convert ECONNABORTED on connection-oriented socket
663 2011-08-21 Christopher Faylor <me.cygwin2011@cgf.cx>
665 * dtable.cc (conv_start_chars): Remove unneeded section attribute.
667 2011-08-20 Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
669 * include/paths.h (_PATH_MAILDIR): Define.
670 (_PATH_SHELLS): Define.
672 2011-08-20 Corinna Vinschen <corinna@vinschen.de>
674 * fhandler_process.cc (format_process_maps): Define page protection
675 shortcuts RO, X, and WC. Use in creating access flag string. Don't
676 set type flag to 's' for copy-on-write pages, as on Linux.
678 2011-08-19 Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
680 * devices.h (fh_devices): Define DEV_MISC_MAJOR, DEV_MEM_MAJOR,
681 DEV_SOUND_MAJOR. Use throughout.
682 * fhandler_proc.cc (proc_tab): Add /proc/devices and /proc/misc
684 (format_proc_devices): New function.
685 (format_proc_misc): New function.
687 2011-08-19 Christopher Faylor <me.cygwin2011@cgf.cx>
689 * dtable.cc: Mark some const variables as static.
690 * environ.cc (conv_start_chars): Move to shared cygwin region and
691 initialize at compile time.
692 (match_first_char): New generic function for querying conv_start_chars.
693 (posify_maybe): Rename from posify.
694 (environ_init): Remove conv_envvars initialization. Don't check
695 conv_start_chars, just allow posify_maybe to make the decision.
696 * fhandler_console.cc (__vt100_conv): Fix formatting. Mark as const.
698 2011-08-19 Corinna Vinschen <corinna@vinschen.de>
700 * fhandler_console.cc (fhandler_console::read): Recognize backspace key
701 using the device independent key code, rather than the device dependent
704 2011-08-18 Christopher Faylor <me.cygwin2011@cgf.cx>
706 * dcrt0.cc (dll_crt0_0): Remove unneeded __stdcall decoration.
707 * init.cc: Reflect change to dll_crt0_0 in declaration.
709 2011-08-18 Corinna Vinschen <corinna@vinschen.de>
711 * dtable.cc (dtable::get_debugger_info): Add missing braces.
712 (dtable::stdio_init): Fix incorrect negation of not_open(2) condition.
714 2011-08-16 Pierre Humblet <Pierre.Humblet@ieee.org>
716 * net.cc (gethostby_helper): Remove DEBUGGING code from and
717 streamline the second pass.
719 2011-08-16 Corinna Vinschen <corinna@vinschen.de>
721 * dlfcn.cc (dlopen): Reimplement RTLD_NODELETE for Windows 2000 using
722 internal datastructures. Explain the code.
723 * ntdll.h (struct _LDR_DATA_TABLE_ENTRY): Define.
724 (struct _PEB_LDR_DATA): Define.
725 (struct _PEB): Change PVOID LoaderData to PPEB_LDR_DATA Ldr.
727 * fhandler_process.cc (format_process_maps): Call NtQueryVirtualMemory
728 with valid return length pointer. Explain why.
730 2011-08-16 Corinna Vinschen <corinna@vinschen.de>
732 * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump.
734 2011-08-16 Corinna Vinschen <corinna@vinschen.de>
736 * autoload.cc (GetModuleHandleExW): Define.
737 * dlfcn.cc: Throughout mark exported symbols as extern "C".
738 (dlopen): Unignore flags argument. Define ret to NULL. Fix typo in
739 comment. Support Glibc flags RTLD_NOLOAD and RTLD_NODELETE.
740 * include/dlfcn.h: Clean up comments.
741 (RTLD_NODELETE): Define.
742 (RTLD_NOLOAD): Define.
743 (RTLD_DEEPBIND): Define.
745 2011-08-15 Corinna Vinschen <corinna@vinschen.de>
747 * pipe.cc (pipe): Just call _pipe with O_BINARY mode. Move code to
748 generate normalized pathnames from here...
751 2011-08-13 Corinna Vinschen <corinna@vinschen.de>
753 * miscfuncs.cc (CreatePipeOverlapped): New function.
754 (ReadPipeOverlapped): Ditto.
755 (WritePipeOverlapped): Ditto.
756 * miscfuncs.h: Declare new functions.
757 * pinfo.cc (commune_process): Call WritePipeOverlapped instead of
758 WriteFile. Set timeout to 1 sec.
759 (_pinfo::commune_request): Call ReadPipeOverlapped instead of ReadFile.
760 Set timeout to 0.5 secs.
761 * sigproc.cc (sig_send): Create pipe using CreatePipeOverlapped.
763 2011-08-12 Christopher Faylor <me.cygwin2011@cgf.cx>
765 * miscfuncs.cc (create_pipe): Delete obsolete function.
766 * miscfuncs.h (create_pipe): Delete define.
768 * pipe.c (fhandler_pipe::create_selectable): Delete obsolete comment.
770 2011-08-12 Corinna Vinschen <corinna@vinschen.de>
772 * fhandler_proc.cc (fhandler_proc::closedir): Don't free, but delete
775 2011-08-12 Corinna Vinschen <corinna@vinschen.de>
777 * fhandler.h (fhandler_proc::opendir): Declare.
778 (fhandler_proc::closedir): Declare.
779 * fhandler_proc.cc (fhandler_proc::opendir): New method. Fetch list
780 of active processes here once to avoid potential duplicates and store
782 (fhandler_proc::closedir): New method. Free dir->__handle.
783 (fhandler_proc::readdir): Convert pinfo into a reference to the winpids
784 entry in dir->__handle.
786 2011-08-11 Corinna Vinschen <corinna@vinschen.de>
788 * fhandler_proc.cc (fhandler_proc::get_proc_fhandler): Don't allow to
789 access process info by using the Windows PID.
790 * fhandler_process.cc (fhandler_process::fstat): Ditto.
791 (fhandler_process::fill_filebuf): Ditto.
793 2011-08-11 Corinna Vinschen <corinna@vinschen.de>
795 * (winpids::add): Make sure to store always a Windows PID in
796 pidlist, even if pid is a Cygwin PID.
797 (winpids::enum_processes): Fetch Cygwin processes from listing of
798 shared cygwin object dir in the native NT namespace. Only if winpid
799 is true, fetch Windows processes using an additional call to
800 NtQuerySystemInformation.
802 2011-08-10 Corinna Vinschen <corinna@vinschen.de>
804 * fhandler_process.cc (format_process_status): Always print process name
806 (get_mem_values): Fix loop fetching working set list to avoid out of
807 memory conditions. Return all mem values set to 0 for zombies.
808 * ntdll.h (STATUS_PROCESS_IS_TERMINATING): Define.
810 2011-08-09 Corinna Vinschen <corinna@vinschen.de>
812 * heap.cc (eval_initial_heap_size): New function fetching the heap
813 size from the LoaderFlags field in the PE/COFF header.
814 (heap_init): Call eval_initial_heap_size rather than
815 cygwin_shared->heap_chunk_size to fetch the initial heap size.
816 * shared.cc (shared_info::heap_chunk_size): Remove.
817 * shared_info.h (class shared_info): Drop heap_chunk member.
818 (CURR_SHARED_MAGIC): Update.
820 2011-08-09 Corinna Vinschen <corinna@vinschen.de>
822 * ntdll.h (STATUS_NOT_FOUND): Define.
823 * ntea.cc (read_ea): Return correct ENOTSUP rather than EOPNOTSUPP.
824 Handle STATUS_INVALID_DEVICE_REQUEST and STATUS_NOT_FOUND. Explain
825 why. Convert conditional to switch statement.
826 (write_ea): Return correct ENOTSUP rather than EOPNOTSUPP. Handle
827 STATUS_INVALID_DEVICE_REQUEST. Convert conditional to switch statement.
829 2011-08-07 Corinna Vinschen <corinna@vinschen.de>
831 * resource.cc (getrlimit): Just return RLIM_INFINITY in a request for
834 2011-08-07 Corinna Vinschen <corinna@vinschen.de>
836 * fhandler_process.cc (format_process_maps): Actually print info about
837 the application heap of the printed process, not of the current process.
839 2011-08-04 Corinna Vinschen <corinna@vinschen.de>
841 * net.cc (socketpair): Release sb0 if there's no space left for sb1.
843 2011-08-03 Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
845 * cygwin.din (clock_nanosleep): Export.
846 * posix.sgml (std-notimpl): Move clock_nanosleep from here...
847 (std-susv4): ... to here.
848 (std-notes): Note limitations of clock_nanosleep.
849 * signal.cc (clock_nanosleep): Renamed from nanosleep, adding clock_id
850 and flags arguments and changing return values throughout.
851 Improve checks for illegal rqtp values. Add support for
852 CLOCK_MONOTONIC and TIMER_ABSTIME.
853 (nanosleep): Rewrite in terms of clock_nanosleep.
856 * thread.cc: Mark clock_nanosleep in list of cancellation points.
857 * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump.
859 2011-08-03 Christopher Faylor <me.cygwin2011@cgf.cx>
861 * dll_init.cc: Use fabort in favor of api_fatal and fork_info->abort
862 where appropriate throughout.
864 (dll_list::topsort): Don't print sorting information. Fix formatting.
865 (dll_list::topsort_visit): Fix formatting.
866 (dll_list::load_after_fork_impl): Perform comment fixups.
867 * sigproc.cc (child_info_fork::abort): (for now?) Always print cause of
869 * include/sys/strace.h (strace_vprintf): Remove _STRACE_NOTALL when
870 printing. We really do want to see this.
872 2011-08-03 Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
874 * cygtls.h (struct _local_storage): Add cw_timer member.
875 * cygtls.cc (_cygtls::init_thread): Initialize locals.cw_timer.
876 (_cygtls::fixup_after_fork): Ditto.
877 * tlsoffsets.h: Regenerate.
878 * ntdll.h (enum _TIMER_INFORMATION_CLASS): Define.
879 (struct _TIMER_BASIC_INFORMATION): Define.
880 (NtQueryTimer): Declare function.
881 * thread.h (cancelable_wait): Change timeout argument to
882 PLARGE_INTEGER and provide NULL default.
883 (fast_mutex::lock): Adjust accordingly.
884 (pthread_cond::wait): Change timeout argument to PLARGE_INTEGER
886 * thread.cc (cancelable_wait): Change timeout argument to
887 PLARGE_INTEGER. Initialize _cygtls.locals.cw_timer if needed.
888 Use NT waitable timers for handling timeout. Return remaining time
889 to timeout argument if timeout was relative.
890 (pthread_cond::wait): Change timeout argument to PLARGE_INTEGER.
891 Adjust to change in cancelable_wait.
892 (pthread_mutex::lock): Adjust to change in cancelable_wait.
893 (pthread_spinlock::lock): Ditto.
894 (pthread::join): Ditto.
895 (__pthread_cond_dowait): Change waitlength argument to PLARGE_INTEGER.
896 Adjust to changes in cancelable_wait and pthread_cond::wait.
897 (pthread_cond_timedwait): Adjust to change in __pthread_cond_dowait.
898 (pthread_cond_wait): Ditto.
899 (semaphore::_timedwait): Adjust to change in cancelable_wait.
900 (semaphore::_wait): Ditto.
901 * exceptions.cc (handle_sigsuspend): Ditto.
902 * signal.cc (nanosleep): Ditto.
903 * wait.cc (wait4): Ditto. Fix copyright dates.
904 * times.cc (FACTOR, NSPERSEC): Move from here...
905 * hires.h (FACTOR, NSPERSEC): ...to here.
907 2011-08-01 Corinna Vinschen <corinna@vinschen.de>
909 * syscalls.cc (faccessat): Fix parens in flag expression when calling
912 * fhandler_disk_file.cc (fhandler_disk_file::mkdir): Fix typo in
914 * fhandler_socket.cc (fhandler_socket::bind): Ditto.
915 * path.cc (symlink_worker): Ditto.
917 2011-07-31 Christopher Faylor <me.cygwin2011@cgf.cx>
919 * dll_init.cc (dll_list::load_after_fork_impl): Add a hint to an error
922 2011-07-31 Christopher Faylor <me.cygwin2011@cgf.cx>
924 * sigproc.cc (pending_signals::pending): Define new function.
925 (sig_dispatch_pending): Avoid calling sig_send if there are no pending
928 2011-07-31 Corinna Vinschen <corinna@vinschen.de>
930 * fhandler.h (class fhandler_dev_mem): Remove dup method declaration.
931 * fhandler_clipboard.cc (fhandler_dev_clipboard::dup): Accommodate the
932 fact that the entire fhandler gets copied over to the child in
934 * fhandler_floppy.cc (fhandler_dev_floppy::dup): Ditto.
935 * fhandler_raw.cc (fhandler_dev_raw::dup): Ditto.
936 * fhandler_serial.cc (fhandler_serial::dup): Ditto.
937 * fhandler_socket.cc (fhandler_socket::dup): Ditto.
938 * fhandler_virtual.cc (fhandler_virtual::dup): Ditto.
939 * fhandler_mem.cc (fhandler_dev_mem::dup): Ditto. Remove entirely.
941 2011-07-30 Christopher Faylor <me.cygwin2011@cgf.cx>
943 * cygthread.cc (cygthread::async_create): Define new function.
944 * cygthread.h (cygthread::create): Use correct regparm.
945 (cygthread::standalone): Delete from class and from all constructors.
946 (cygthread::cygthread): Use three only arguments for detached threads,
947 (cygthread::async_create): Declare.
948 and start the thread via QueueUserAPC/async_create.
949 * dcrt0.cc (dll_crt0_0): Remove handling for
950 wincap.has_buggy_thread_startup.
952 * wincap.cc: Ditto throughout.
955 2011-07-30 Christopher Faylor <me.cygwin2011@cgf.cx>
957 * fhandler.h (fhandler_base_overlapped::size): Declare/define size()
958 function for consistency.
959 (fhandler_termios::size): Ditto.
960 (fhandler_pty_common::size): Ditto.
962 2011-07-30 Corinna Vinschen <corinna@vinschen.de>
964 * fhandler_registry.cc (fhandler_registry::dup): Duplicate value_name.
966 2011-07-29 Corinna Vinschen <corinna@vinschen.de>
968 Throughout change "WinSock" to "Winsock" in comments.
969 * fhandler_socket.cc (fhandler_socket::sendmsg): Add missing call to
970 get_inet_addr to convert AF_LOCAL to AF_INET sockets.
971 * net.cc (cygwin_socket): Workaround UDP Winsock problem. Add comment
973 * select.cc: Include winsock2.h rather than winsock.h.
975 2011-07-26 Corinna Vinschen <corinna@vinschen.de>
977 * fhandler_disk_file.cc (__DIR_mounts::eval_ino): Create path_conv
978 with PC_KEEP_HANDLE flag.
979 * path.h (path_conv::operator =): Duplicate UNICODE path as well.
980 * security.cc (check_file_access): Use path_conv handle if available.
981 * syscalls.cc (access): Create fhandler with PC_KEEP_HANDLE flag set.
985 2011-07-26 Corinna Vinschen <corinna@vinschen.de>
987 * ntdll.h: Fix typo in comment.
990 2011-07-25 Corinna Vinschen <corinna@vinschen.de>
992 * fhandler_console.cc (fhandler_console::ioctl): Fetch console events
993 using PeekConsoleInput and return only key down events in buf.
994 * fhandler_tty.cc (fhandler_pty_slave::ioctl): Always return EINVAL
995 if PeekNamedPipe fails.
996 (fhandler_pty_master::ioctl): Ditto.
998 2011-07-22 Corinna Vinschen <corinna@vinschen.de>
1000 * fhandler_tty.cc (fhandler_pty_slave::ioctl): Drop FIONBIO case.
1002 (fhandler_pty_master::ioctl): Ditto. Call fhandler_base::ioctl to
1003 decode default condition.
1004 * fhandler_console.cc (fhandler_console::ioctl): Handle FIONREAD.
1006 2011-07-21 Christopher Faylor <me.cygwin2011@cgf.cx>
1007 Corinna Vinschen <corinna@vinschen.de>
1009 * fhandler.cc: Add #include for asm/socket.h for dealing with FIONREAD.
1010 (fhandler_base::ioctl): Special-case errno for FIONREAD.
1011 * fhandler_dsp.cc (fhandler_dev_dsp::ioctl): Rename parameter for
1012 consistency. Call fhandler_base::ioctl to decode default condition.
1013 * fhandler_serial.cc (fhandler_serial::ioctl): Ditto.
1014 * fhandler_tty.cc (fhandler_pty_slave::ioctl): Call
1015 fhandler_base::ioctl to decode default condition.
1016 * fhandler_windows.cc (fhandler_windows::ioctl): Ditto.
1018 2011-07-21 Corinna Vinschen <corinna@vinschen.de>
1020 * heap.cc (eval_start_address): Simplify test for large address
1021 awareness of executable, which works for 32 and 64 bit systems.
1022 Change comment accordingly.
1024 2011-07-21 Corinna Vinschen <corinna@vinschen.de>
1026 * heap.cc (eval_start_address): New static function to evaluate the
1027 best start address for the application heap.
1028 (heap_init): Call eval_start_address to fetch the start value for
1029 start_address. Move preceeding comment to eval_start_address.
1031 2011-07-21 Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
1033 * cygwin.din (pthread_condattr_getclock): Export.
1034 (pthread_condattr_setclock): Export.
1035 * posix.sgml (std-notimpl): Move pthread_condattr_getclock and
1036 pthread_condattr_setclock from here...
1037 (std-susv4): ... to here.
1038 * sysconf.cc (sca): Set _SC_CLOCK_SELECTION to _POSIX_CLOCK_SELECTION.
1039 * thread.cc: (pthread_condattr::pthread_condattr): Initialize clock_id.
1040 (pthread_cond::pthread_cond): Initialize clock_id.
1041 (pthread_cond_timedwait): Use clock_gettime() instead of gettimeofday()
1042 in order to support all allowed clocks.
1043 (pthread_condattr_getclock): New function.
1044 (pthread_condattr_setclock): New function.
1045 * thread.h (class pthread_condattr): Add clock_id member.
1046 (class pthread_cond): Ditto.
1047 * include/pthread.h: Remove obsolete comment.
1048 (pthread_condattr_getclock): Declare.
1049 (pthread_condattr_setclock): Declare.
1050 * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump.
1052 2011-07-18 Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
1054 * sysconf.cc (sca): Return -1 for _SC_THREAD_ROBUST_PRIO_INHERIT,
1055 _SC_THREAD_ROBUST_PRIO_PROTECT, and _SC_XOPEN_UUCP.
1056 (SC_MAX): Redefine accordingly.
1057 (csa): Return strings for _CS_POSIX_V7_THREADS_CFLAGS,
1058 _CS_POSIX_V7_THREADS_LDFLAGS, and _CS_V7_ENV.
1059 (CS_MAX): Redefine accordingly.
1060 * include/limits.h (LONG_BIT): Define.
1063 2011-07-18 Corinna Vinschen <corinna@vinschen.de>
1065 * heap.cc (heap_init): Change type of largest_found to PVOID. Start
1066 querying memory at 0x20000000. Use largest_found pointer when trying
1067 to allocate largest free memory area found.
1069 2011-07-14 Corinna Vinschen <corinna@vinschen.de>
1071 * fhandler_console.cc (fhandler_console::input_tcsetattr): Revert to
1072 setting ENABLE_PROCESSED_INPUT depending on ISIG and IGNBRK.
1073 (fhandler_console::tcgetattr): Set ISIG depending on
1074 ENABLE_PROCESSED_INPUT as well.
1076 2011-07-13 Corinna Vinschen <corinna@vinschen.de>
1078 * fhandler_serial.cc (fhandler_serial::raw_read): Handle non-blocking
1079 case more thoroughly.
1081 2011-07-13 Christopher Faylor <me.cygwin2011@cgf.cx>
1083 * setup_handler (setup_handler): Change break to goto out, missed in
1086 2011-07-10 Christopher Faylor <me.cygwin2011@cgf.cx>
1088 * fhandler_tty.cc (fhandler_pty_slave::ioctl): Remove erroneous support
1089 for TIOCLINUX for pty. Get rid of unneeded EINVAL handling in wake of
1090 tty removal. Remove now-unneeded variable.
1092 2011-07-10 Corinna Vinschen <corinna@vinschen.de>
1094 * include/netdb.h (gethostbyname2): Declare.
1096 2011-07-09 Eric Blake <eblake@redhat.com>
1098 * signal.cc (handle_sigprocmask): Return error rather than setting
1099 errno, for pthread_sigmask.
1100 (sigprocmask): Adjust caller.
1102 2011-07-07 Corinna Vinschen <corinna@vinschen.de>
1104 * miscfuncs.cc (yield): Drop thread priority only once.
1106 2011-07-06 Christopher Faylor <me.cygwin2011@cgf.cx>
1108 * exceptions.cc (_cygtls::interrupt_now): Back out previous change
1109 since it could theoretically cause a non-CTRL-C-able program if a
1110 program has suffered memory corruption.
1111 (setup_handler): Ditto.
1113 2011-07-06 Corinna Vinschen <corinna@vinschen.de>
1115 * sched.c (sched_yield): Just call SwitchToThread because yield now
1116 potentially switches CPU.
1118 2011-07-06 Christopher Faylor <me.cygwin2011@cgf.cx>
1120 * exceptions.cc (_cygtls::interrupt_now): Don't check for spinning
1122 (setup_handler): Check for spinning here, assuming that it is
1123 transitory and should not affect the retry loop.
1125 2011-07-06 Christopher Faylor <me.cygwin2011@cgf.cx>
1127 * exceptions.cc (CALL_HANDLER_RETRY_INNER): Rename to reflect different
1129 (CALL_HANDLER_RETRY_OUTER): New define.
1130 (setup_handler): Add outer loop to signal handler to try harder to
1132 * miscfuncs.cc (yield): Drop priority and use SleepEx() to force thread
1133 rescheduling rather than relying on SwitchToThread().
1135 2011-07-06 Corinna Vinschen <corinna@vinschen.de>
1137 * sigproc.cc (wait_sig): Fix debug output.
1139 2011-07-05 Corinna Vinschen <corinna@vinschen.de>
1141 * fhandler_console.cc (fhandler_console::input_tcsetattr): Make
1142 ENABLE_PROCESSED_INPUT flag only depending on value of IGNBRK.
1143 (fhandler_console::tcgetattr): Don't set ISIG depending on
1144 ENABLE_PROCESSED_INPUT, set IGNBRK instead.
1146 2011-07-05 Corinna Vinschen <corinna@vinschen.de>
1148 * security.cc (get_file_sd): Fix comment.
1150 2011-07-05 Corinna Vinschen <corinna@vinschen.de>
1152 * fhandler.cc (fhandler_base::open): Never create files with WRITE_DAC
1153 access. Explain why.
1154 * fhandler_disk_file.cc (fhandler_base::fstat_helper): Improve debug
1157 2011-07-05 Corinna Vinschen <corinna@vinschen.de>
1159 * fhandler.cc (fhandler_base::open): Don't open file with WRITE_DAC
1160 access on remote filesystem. Explain why.
1161 * fhandler_disk_file.cc (fhandler_disk_file::mkdir): Ditto for
1163 * fhandler_socket.cc (fhandler_socket::bind): Ditto for sockets.
1164 * path.cc (symlink_worker): Ditto for symlinks.
1166 2011-07-04 Christopher Faylor <me.cygwin2011@cgf.cx>
1168 * environ.cc (tty_is_gone): Wrap warning at 80 characters.
1170 2011-07-04 Corinna Vinschen <corinna@vinschen.de>
1172 Throughout, open console handles with sharing for reading and writing.
1173 * dcrt0.cc (insert_file): Open file with full sharing allowed.
1174 * hookapi.cc (find_first_notloaded_dll): Ditto.
1175 * spawn.cc (av::fixup): Ditto.
1177 2011-07-04 Corinna Vinschen <corinna@vinschen.de>
1179 * dtable.cc (dtable::init_std_file_from_handle): Change test for console
1180 device in call to fh->init to avoid conhost crash on W7.
1182 2011-07-04 Corinna Vinschen <corinna@vinschen.de>
1184 * environ.cc (environ_init): Reinstantiate on-the-fly CYGWIN variable
1185 test and call to parse_options if found.
1187 2011-07-04 Christopher Faylor <me.cygwin2011@cgf.cx>
1189 * fhandler.cc (fhandler_base::open_with_arch): Call close_on_exec last
1190 to avoid setting close_on_exec for archetype.
1191 * fhandler_tty.cc (fhandler_pty_master::setup): Protect {from,to}_pty
1192 handles. Use consistent naming in debug output. Use inheritable
1194 (fhandler_pty_master::fixup_after_fork): ...avoid duplicating handles
1196 (fhandler_pty_slave::open): Don't set close_on_exec flag here.
1198 2011-07-01 Christopher Faylor <me.cygwin2011@cgf.cx>
1200 * dtable.cc (cnew): Fix whitespace.
1202 2011-07-01 Corinna Vinschen <corinna@vinschen.de>
1204 * include/sys/param.h (NGROUPS): Redefine as NGROUPS_MAX.
1205 (MAXHOSTNAMELEN): Redefine with same value as MAX_HOSTNAME_LEN. Change
1207 (MAXPATHLEN): Improve comment.
1208 (MAXSYMLINKS): Define and add comment.
1210 2011-07-01 Corinna Vinschen <corinna@vinschen.de>
1212 * fhandler.cc (fhandler_base::open): Move NFS-specific code into the
1213 code block handling FH_FS stuff.
1215 2011-06-30 Ryan Johnson <ryan.johnson@cs.utoronto.ca>
1217 * dtable.cc (fh_oom): Remove.
1218 (fh_calloc): Remove.
1219 (cnew): Redefine to handle NULL returns from cmalloc.
1220 (build_fh_name): Accommodate new definition of cnew. Remove unneeded
1224 2011-06-30 Corinna Vinschen <corinna@vinschen.de>
1226 * fhandler_console.cc (fhandler_console::read): Add comment.
1227 (fhandler_console::input_tcsetattr): Don't set ENABLE_PROCESSED_INPUT
1228 if IGNBRK flag is set.
1230 2011-06-30 Corinna Vinschen <corinna@vinschen.de>
1232 * dtable.cc (fh_oom): New static fhandler storage.
1233 (fh_calloc): New static function. Add a comment to explain why this
1235 (cnew): Call fh_calloc as placement argument.
1236 (build_fh_name): Check return code from cnew against address of
1237 fh_oom to test for out of memory condition.
1239 (build_fh_pc): Avoid a crash due to useing a NULL fhandler.
1240 * pipe.cc (fhandler_pipe::create): Check if build_fh_dev returned a
1241 valid pointer before using it.
1243 2011-06-28 Corinna Vinschen <corinna@vinschen.de>
1245 * fhandler_process.cc (heap_info::fill_if_match): Rename info to
1246 note that this heap is a Windows heap.
1247 (format_process_maps): Print info about application heap.
1249 2011-06-24 Corinna Vinschen <corinna@vinschen.de>
1251 * fhandler_console.cc (fhandler_console::read): Don't generate ^@ on
1254 2011-06-22 Corinna Vinschen <corinna@vinschen.de>
1256 * fhandler_tty.cc (fhandler_pty_master::setup): Create pty pipes
1259 2011-06-22 Corinna Vinschen <corinna@vinschen.de>
1261 * fhandler_tty.cc (fhandler_pty_master::setup): Fix crash in debug
1264 2011-06-18 Corinna Vinschen <corinna@vinschen.de>
1266 * path.cc (normalize_win32_path): Skip all slashes after recognizing
1267 a ".." path component. Add comment.
1269 2011-06-17 Corinna Vinschen <corinna@vinschen.de>
1271 * fhandler.cc (fhandler_base::open): Drop local create_options variable.
1272 Use options member instead.
1273 * fhandler.h (class fhandler_base): Change type of access member to
1274 ACCESS_MASK. Change get_access and set_access methods accordingly.
1275 Add options member. Add get_options and set_options methods.
1276 (class fhandler_disk_file): Add prw_handle.
1277 (fhandler_disk_file::prw_open): Declare.
1278 (fhandler_disk_file::close): Declare.
1279 (fhandler_disk_file::dup): Declare.
1280 (fhandler_disk_file::fixup_after_fork): Declare.
1281 * fhandler_disk_file.cc (fhandler_disk_file::fhandler_disk_file):
1282 Initialize prw_handle to NULL.
1283 (fhandler_disk_file::close): Close prw_handle.
1284 (fhandler_disk_file::dup): New method.
1285 (fhandler_disk_file::fixup_after_fork): Set prw_handle to NULL since
1286 prw_handle is not inherited.
1287 (fhandler_disk_file::prw_open): New method. Add long comment to
1288 explain current behaviour.
1289 (fhandler_disk_file::pread): Revert previous change. Change to use
1290 prw_handle if possible.
1291 (fhandler_disk_file::pwrite): Change to use prw_handle if possible.
1293 2011-06-17 Corinna Vinschen <corinna@vinschen.de>
1295 * dcrt0.cc (dll_crt0_1): Call strace.dll_info after call to pinfo_init.
1296 * strace.cc (strace::hello): Drop printing DLL information here since
1297 application info is not always available at this point.
1298 (strace::dll_info): New method to print DLL info.
1299 * include/sys/strace.h (strace::dll_info): Declare.
1301 2011-06-17 Corinna Vinschen <corinna@vinschen.de>
1303 * dtable.cc (handle_to_fn): Accommodate name change of pty named pipes,
1304 otherwise ptys are not recognized.
1306 2011-06-16 Christopher Faylor <me.cygwin2011@cgf.cx>
1308 * fhandler_console.cc (fhandler_console::set_unit): Set
1309 pc.file_attributes() to reflect existence.
1310 * fhandler.h (fhandler_pty_common::fhandler_pty_common): Ditto.
1311 * pinfo.cc (_pinfo::set_ctty): Output device numbers in hex.
1313 2011-06-15 Christopher Faylor <me.cygwin2011@cgf.cx>
1315 * errno.cc (EIO): Lowercase "o" representative string.
1317 2011-06-14 Christopher Faylor <me.cygwin2011@cgf.cx>
1319 * cygheap.h (init_cygheap::ctty_on_hold): Remove conditionalized
1321 * dcrt0.cc (do_exit): Remove code which handled CYGWIN=tty style ttys.
1322 * devices.in: Remove "/dev/ttym".
1323 * dtable.cc: Rename tty to pty where appropriate throughout.
1324 (dtable::stdio_init): Use new t->is_console rather than using
1325 now-deleted hwnd element in tty structure.
1326 (dtable::init_std_file_from_handle): Remove code which handled
1327 CYGWIN=tty style ttys.
1329 * fhandler.h: Rename tty to pty where appropriate.
1330 (fhandler_pty_common): Delete output_done_event, ioctl_request_event,
1332 (fhandler_pty_master::setup): Delete argument.
1333 (fhandler_tty_master): Delete.
1334 (fhandler_union): Delete __tty_master.
1335 * fhandler_console.cc (use_tty): Delete.
1336 (fhandler_console::get_tty_stuff): Set is_console to true rather than
1338 (fhandler_console::send_winch_maybe): Remove CYGWIN=tty considerations.
1339 (fhandler_console::input_tcsetattr): Ditto.
1340 * fhandler_termios.cc (fhandler_termios::tcsetpgrp): Use new
1341 t->is_console rather than using now-deleted hwnd element in tty
1343 * fhandler_tty.cc: Rename tty to pty where appropriate throughout.
1344 (tty_master): Delete.
1345 (process_input): Ditto.
1346 (process_output): Ditto.
1347 (process_ioctl): Ditto.
1348 (fhandler_tty_master::*): Ditto.
1349 (fhandler_pty_master::process_slave_output): Remove CYGWIN=tty
1351 (fhandler_pty_slave::open): Ditto for *_done_event.
1352 (fhandler_pty_slave::write): Ditto.
1353 (fhandler_pty_slave::ioctl): Ditto.
1354 (fhandler_pty_slave::fch_open_handles): Ditto.
1355 (fhandler_pty_slave::fch_set_sd): Ditto.
1356 (fhandler_pty_slave::fch_close_handles): Ditto.
1357 (fhandler_pty_common::close): Ditto.
1358 (fhandler_pty_master::setup): Ditto. Remove now-unneeded ispty
1360 (fhandler_pty_master::open): Reflect argument removal for
1362 * select.cc: Rename tty to pty where appropriate throughout.
1363 * sigproc.cc (proc_subproc): Remove CYGWIN=tty considerations.
1364 * tty.cc (ttyslot): Accommodate CYGWIN=tty removal.
1365 (tty_list::init_session): Ditto.
1366 (tty_list::attach): Ditto.
1367 (tty::create_master): Delete.
1368 (tty_list::terminate): Ditto.
1369 (tty_list::allocate): Delete "with_console" parameter. Remove
1370 CYGWIN=tty considerations.
1371 (tty::init): Set is_console = false. Use 'false' for was_opened since
1373 * tty.h (*_{DONE,REQUEST}_EVENT): Delete.
1374 (tty_min::is_console): Declare new field which replaces hwnd.
1375 (tty_min::gethwnd): Delete.
1376 (tty_min::sethwnd): Ditto.
1377 (tty_list::allocate): Delete parameter.
1378 (tty_list::terminate): Delete declaration.
1379 * include/sys/cygwin.h (PID_USETTY): Redefine to PID_UNUSED1 and change
1380 comment to reflect its availability.
1382 2011-06-13 Christopher Faylor <me.cygwin2011@cgf.cx>
1384 * fhandler_tty_slave.cc (fhandler_tty_slave::fhandler_tty_slave):
1385 Revert previous change since unit 0 is perfectly valid.
1387 2011-06-12 Christopher Faylor <me.cygwin2011@cgf.cx>
1389 Rename FH_BAD to FH_NADA throughout.
1390 * devices.h (FH_ERROR): New value.
1391 (iscons_dev): Extend to detect all the console device types.
1392 * devices.in: Set aside storage for FH_ERROR.
1393 * dtable.cc (dtable::init_std_file_from_handle): Use iscons_dev to
1394 detect when device is a console.
1395 (fh_alloc): Pass device to console constructor.
1396 (build_fh_pc): Short circuit when we detect that the constructor saw an
1398 * fhandler.h (fhandler_console::fhandler_console): Accept fh_devices
1400 (get_tty_stuff): Change to void.
1401 * fhandler_console (fhandler_console::set_unit): Set device to FH_ERROR
1402 on attempt to access anything other than the current console.
1403 (fhandler_console::get_tty_stuff): Change to void return.
1404 (fhandler_console::open): Return EPERM on FH_ERROR device type.
1405 (fhandler_console::fhandler_console): Set the device type appropriately
1406 before calling get_tty_stuff and rely on that function to reset it if
1409 2011-06-10 Christopher Faylor <me.cygwin2011@cgf.cx>
1411 * environ.cc (create_upcaseenv): Delete.
1412 (ucenv): Don't honor create_upcaseenv.
1413 (environ_init): Remove early retrieval of CYGWIN environment variable.
1414 Change comment to reflect new behavior.
1416 2011-06-09 Christopher Faylor <me.cygwin2011@cgf.cx>
1418 * child_info.h (CURR_CHILD_INFO_MAGIC): Reset.
1419 (child_info::old_title): Delete.
1420 (child_info::~child_info_spawn): Remove recording of old_title.
1421 * dcrt0.cc (title_buf): Delete.
1422 (child_info_spawn::handle_spawn): Remove recording of old_title.
1423 (dll_crt0_1): Get rid of all title handling.
1425 * environ.cc (known): Delete strip_title and title.
1426 * fhandler_console.cc (fhandler_console::write): Remove recording of
1428 * globals.cc (exit_states): Remove ES_TITLE.
1429 (display_title): Delete.
1430 (strip_title_path): Delete.
1431 (old_title): Delete.
1432 * spawn.cc (spawn_guts): Remove old_title accommodation.
1434 2011-06-09 Christopher Faylor <me.cygwin2011@cgf.cx>
1436 * environ.cc (envcache): Delete.
1437 (known): Remove envcache.
1438 (getwinenv): Don't honor envcache setting.
1440 2011-06-09 Christopher Faylor <me.cygwin2011@cgf.cx>
1442 * environ.c: Move code earlier to allow:
1443 (_addenv): Call parse_options() when CYGWIN environment variable is
1445 (parse_options): Change parameter to 'const'.
1447 2011-06-08 Christopher Faylor <me.cygwin2011@cgf.cx>
1449 * environ.cc (tty_is_gone): Add missing space to message.
1451 2011-06-08 Christopher Faylor <me.cygwin2011@cgf.cx>
1453 * environ.cc (settings::set_process_state): Delete.
1454 (tty_is_gone): New function.
1455 (known): Change "tty" to call tty_is_gone(). Remove unneeded '&' from
1456 beginning of function address.
1457 (parse_options): Remove set_process_state handling.
1458 * shared_info.h (CURR_USER_MAGIC): Reset.
1459 (user_info::warned_notty): New member.
1461 2011-06-07 Christopher Faylor <me.cygwin2011@cgf.cx>
1463 * fhandler_console.cc (fhandler_console::open_shared_console):
1464 Semi-revert to using fixed location for console stuff.
1465 * shared.cc (offsets): Ditto. Comment.
1466 * shared_info (shared_locations): Re-add SH_SHARED_CONSOLE.
1468 2011-06-05 Christopher Faylor <me.cygwin2011@cgf.cx>
1470 * fhandler_disk_file.cc (fhandler_disk_file::pread): Reset windows file
1471 position pointer back to previous location after successful read.
1473 2011-06-04 Christopher Faylor <me.cygwin2011@cgf.cx>
1475 * fhandler_console.cc (fhandler_console::open_shared_console): Don't
1476 zero handle to open_shared since it is supposed to be an input.
1477 (enum_windows): Set handle input to open_shared to NULL since it does
1478 not represent any previously opened shared region.
1479 * shared.cc (open_shared): Tweak debugging output.
1481 2011-06-03 Christopher Faylor <me.cygwin2011@cgf.cx>
1483 * ntdll.h (FILE_PIPE_*): Define constants.
1484 * select.cc (pipe_data_available): Detect closing state.
1486 2011-06-03 Christopher Faylor <me.cygwin2011@cgf.cx>
1488 * pinfo.cc (_pinfo::set_ctty): Don't reset myself->{pgid,sid} if
1489 terminal has no pgid or sid settings.
1491 2011-06-03 Christopher Faylor <me.cygwin2011@cgf.cx>
1493 * fhandler.cc (fhandler_base_overlapped::wait_overlapped): Only raise
1494 SIGPIPE when writing.
1496 * fhandler.h: Include "tty.h".
1497 (fhandler_termios::_tc): Rename from tc.
1498 (fhandler_termios::tc): New method.
1499 (fhandler_termios::tcinit): Remove an argument.
1500 (fhandler_termios::get_ttyp): Use method to retrieve value.
1501 (fhandler_console::console_state): Move here.
1502 (fhandler_console::dev_state): Delete.
1503 (fhandler_console::shared_console_info): Define.
1504 (fhandler_console::open_shared_console): Move this function under
1505 fhandler_console umbrella.
1506 (fhandler_console::tc): Define. Return static value.
1507 (fhandler_console::focus_aware): Accommodate deletion of dev_state.
1508 (fhandler_console): Add tty_list::get_cttyp as a friend.
1509 * fhandler_console.cc (dev_state): Redefine as a pointer within
1510 shared_console_info and change dev-> to dev. throughout.
1511 (fhandler_console::shared_console_info): Move into fhandler_console.
1512 (fhandler_console::open_shared_console): Move into fhandler_console
1513 change argument to simple bool.
1514 (enum_windows): Accommodate changes to console_state and
1515 open_shared_console.
1516 (console_unit::console_unit): Ditto.
1517 (fhandler_console::get_tty_stuff): Accommodate change to dev_state.
1518 (tty_list::get_cttyp): Accommodate change to
1519 handler_console::shared_console_info.
1520 (fhandler_console::read): Accommodate change from tc to tc ().
1521 (fhandler_console::set_input_state): Ditto.
1522 (fhandler_console::open): Accommodate tcinit argument change and change
1524 (fhandler_console::input_tcsetattr): Accomodate change from tc to tc().
1525 (fhandler_console::input_tcsetattr): Ditto.
1526 (fhandler_console::write_normal): Ditto.
1527 (fhandler_console::init): Ditto.
1528 (fhandler_console::igncr_enabled): Ditto.
1529 * fhandler_termios.cc (fhandler_termios::tcinit): Remove first argument.
1530 Expect tc() to have been set up first. Use tc() rather than tc.
1531 (fhandler_termios::tcsetpgrp): Accomodate change from tc to tc().
1532 (fhandler_termios::tcgetpgrp): Ditto.
1533 (fhandler_termios::bg_check): Ditto.
1534 (fhandler_termios::line_edit: Ditto.
1535 (fhandler_tty_master::set_winsize): Ditto.
1536 (fhandler_tty_slave::open): Ditto.
1537 (fhandler_tty_slave::init): Ditto.
1538 (fhandler_pty_master::write): Ditto.
1539 (fhandler_pty_master::setup): Ditto. Accommodate change in arguments
1541 (fhandler_tty_slave::fch_open_handles): Set _tc directly.
1542 (tty_min::is_orphaned_process_group): Don't assume that parent pid
1544 * pinfo.cc (_pinfo::set_ctty): Reset myself->{pgid,sid} here if we were
1545 started by a non-Cygwin process but the tty exists.
1546 * shared_info.h (console_state): Delete from here.
1547 * tty.h: Make multiple inclusion safe.
1549 2011-05-31 Christopher Faylor <me.cygwin2011@cgf.cx>
1551 * exceptions.cc (ctrl_c_handler): Simplify test for no parent tty.
1552 * fhandler_console.cc (fhandler_console::get_tty_stuff): Return NULL if
1553 ctty is not tty/console. Improve test for slave tty/pty device.
1555 2011-05-31 Christopher Faylor <me.cygwin2011@cgf.cx>
1557 * external.cc (fillout_pinfo): Don't truncate ctty if it's < 0.
1559 * select.cc (pipe_data_available): Avoid printing debug info by default
1560 or suffer very large strace files.
1562 2011-05-31 Christopher Faylor <me.cygwin2011@cgf.cx>
1564 * select.cc (pipe_data_available): New function - uses
1565 NtQueryInformationFile to return information about pipes.
1566 (peek_pipe): Rewrite to use pipe_data_available for both read and write
1569 2011-05-30 Christopher Faylor <me.cygwin2011@cgf.cx>
1571 * dtable.cc (dtable::select_write): Add missing argument to
1574 * fhandler.cc (fhandler_base_overlapped::setup_overlapped): Explicitly
1575 set io_pending to false.
1576 (fhandler_base_overlapped::has_ongoing_io): Call GetOverlappedResult
1577 to force completion of I/O.
1578 (fhandler_base_overlapped::wait_overlapped): Rewrite to correctly deal
1579 with nonblocking reads and to make more race proof.
1580 (fhandler_base_overlapped::raw_write): Deal with new enum values.
1581 (fhandler_base_overlapped::raw_read): Ditto. Don't deal with ongoing
1582 I/O here since it makes no sense in the read context.
1583 * fhandler.h (enum wait_return): Add overlapped_unknown,
1584 overlapped_nonblocking_no_data.
1585 * pipe.cc (pipe): Add debugging output.
1587 2011-05-30 Christopher Faylor <me.cygwin2011@cgf.cx>
1589 * dll_init.cc (dll_list::append): Eliminate increment of unused tot
1591 * dll_init.h (dll_list::tot): Delete.
1592 (dll_list::populate_all_deps): Delete undefined function.
1594 * fhandler.cc (fhandler_base_overlapped::wait_overlapped): Move EPIPE
1595 handling under error condition.
1597 2011-05-30 Ryan Johnson <ryan.johnson@cs.utoronto.ca>
1599 * dll_init.cc (reserve_upto): Remove.
1600 (release_upto): Ditto.
1601 (dll_list::reserve_space): New function to reserve space needed by
1602 DLL_LOAD dlls early in the fork process.
1603 (dll_list::load_after_fork): Rewrite to use recursion to
1604 track reservations it makes while trying to make dlls land where they
1606 (dll_list::load_after_fork_impl): New function used by load_after_fork.
1607 (dll_list::alloc): Initialize image base field.
1608 * dll_init.h (dll_list::prefered_base): New field.
1609 (dll_list::reserve_space): Declare new function.
1610 (dll_list::load_after_fork): Declare new function.
1611 * fork.cc (frok::child): call dll_list::reserve_space early, so we can
1614 2011-05-30 Tor Perkins <cygwin@noid.net>
1616 * fhandler_termios.cc (fhandler_termios::bg_check): Do not return EIO
1617 when a process group has no leader as this is allowed and does not
1618 imply an orphaned process group. Add a test for orphaned process
1620 (tty_min::is_orphaned_process_group): Define new function.
1621 * tty.h (tty_min::is_orphaned_process_group): Define new function.
1623 2011-05-30 Ryan Johnson <ryan.johnson@cs.utoronto.ca>
1625 * dll_init.cc (dll_list::find_by_modname): New function to search the
1626 dll list for a module name only (no path).
1627 (dll_list::alloc): Initialize newly-added members of struct dll.
1628 (dll_list::append): New function to factor out the append operation
1629 (used by dll_list::topsort).
1630 (dll_list::populate_deps): New function to identify dll dependencies.
1631 (dll_list::topsort): New function to sort the dll list topologically by
1633 (dll_list::topsort_visit): New helper function for the above.
1634 * dll_init.h (dll::ndeps): New class member.
1636 (dll::modname): Ditto.
1637 (dll_list::find_by_modname): New function related to topsort.
1638 (dll_list::populate_all_deps): Ditto.
1639 (dll_list::populate_deps): Ditto.
1640 (dll_list::topsort): Ditto.
1641 (dll_list::topsort_visit): Ditto.
1642 (dll_list::append): Ditto.
1643 (pefile): New struct allowing simple introspection of dll images.
1644 * fork.cc (fork): Topologically sort the dll list before forking
1646 2011-05-30 Christopher Faylor <me.cygwin2011@cgf.cx>
1648 * child_info.h (CURR_CHILD_INFO_MAGIC): Refresh.
1649 (child_info::refresh_cygheap): New function.
1650 * spawn.cc (spawn_guts): Call refresh_cygheap before creating a new
1651 process to ensure that cygheap_max is up-to-date.
1652 * fork.cc (frok::parent): Ditto.
1654 2011-05-30 Christopher Faylor <me.cygwin2011@cgf.cx>
1656 * cygheap.cc (cygheap_dummy): Rename from cygheap_at_start.
1657 (cygheap): Accommodate name change to cygheap_dummy.
1658 (cygheap_init): Ditto.
1659 (cygheap_fixup_in_child): Simplify slightly.
1660 * fork.cc (fork): Add an advisory comment.
1662 2011-05-29 Christopher Faylor <me.cygwin2011@cgf.cx>
1664 * fhandler.cc (fhandler_overlapped::wait_overlapped): Make sure that
1665 I/O is cancelled on signal.
1667 2011-05-28 Ryan Johnson <ryan.johnson@cs.utoronto.ca>
1669 * dll_init.cc (dll_list::alloc): Initialize dll::image_size.
1670 (reserve_at): Don't reserve space needed by the target dll if the
1671 latter overlaps the free region to be blocked.
1672 (dll_list::load_after_fork): Use new version of reserve_at.
1673 * dll_init.h (dll::image_size): New member.
1674 (pefile): New struct.
1676 2011-05-28 Christopher Faylor <me.cygwin2011@cgf.cx>
1677 Ryan Johnson <ryan.johnson@cs.utoronto.ca>
1679 * dll_init.c (dll_list::load_after_fork): Don't clear in_forkee here.
1680 * fork.cc (frok::errmsg): Rename from 'error'.
1681 (frok::error): New function. Handle conditional printing of error
1683 (frok::parent): Record hchild handle for use by error function. Use
1684 throughout. Use error function rather than setting error pointer
1686 (fork): Clear is_forkee here. Accommodate rename of 'error' to
1688 * sigproc.cc (child_info::proc_retry): Detect EXITCODE_FORK_FAILED.
1690 2011-05-28 Christopher Faylor <me.cygwin2011@cgf.cx>
1692 * fhandler.cc (handler_base_overlapped::wait_overlapped): Rework to
1693 attempt to properly set errno and bytes read for non-blocking case.
1694 Change to just rely on res to indicate error conditions.
1696 2011-05-28 Christopher Faylor <me.cygwin2011@cgf.cx>
1698 * fhandler.cc (fhandler_base_overlapped::wait_overlapped): Don't set
1699 io_pending unless ReadFile has returned an error. (this is a partial fix,
1700 accidentally checked in)
1702 2011-05-28 Christopher Faylor <me.cygwin2011@cgf.cx>
1704 * autoload.cc: Call _api_fatal in asm.
1705 * child_info.h: Redefine CURR_CHILD_INFO_MAGIC.
1706 (child_info_fork::abort): Rename from handle_failure. Change
1708 * cygtls.h (_local_storage::ttybuf): New field.
1709 * dcrt0.cc (vapi_fatal): Split api_fatal. Add "in forked process" to
1710 message when appropriate.
1711 (api_fatal): Use vapi_fatal.
1712 * devices.h: Make multiple inclusion safe.
1713 (fh_devices): Add FH_CONS* stuff. Reorder slightly.
1714 (device): Eliminate anonymous union. Add more ways to access
1716 (device::setunit): Accommodate no-longer-anonymous union.
1717 (device::is_fs): Ditto.
1718 (device::is_fs_special): Ditto.
1719 (device::major): New function.
1720 (device::minor): Ditto.
1721 (device::is_device): New function.
1722 (device::not_device): Ditto.
1723 (device::operator int): New operator.
1724 (device::operator fh_devices): Ditto.
1725 (device::operator bool): Ditto.
1726 (device::operator DWORD): Ditto.
1727 (device::operator =): Ditto.
1728 (isproc_dev): New function.
1729 (isprocsys_dev): Ditto.
1730 (iscons_dev): Ditto.
1731 (istty_slave_dev): Ditto.
1732 * devices.in: Add new "/dev/cons*" strings. Accommodate
1733 no-longer-anonymous union throughout.
1734 (BRACK): Use more precise method for initialization.
1735 * devices.cc: Regenerate.
1736 * dtable.cc (dtable::stdio_init): Use get_cttyp instead of get_tty.
1737 (dtable::find_archetype): Use new DWORD operator in device to test
1739 (dtable::init_std_file_from_handle): Use different method to initialize
1740 'dev'. Adapt to different ctty handling and accommodate /dev/cons*.
1741 (fh_alloc): Accommodate no-longer-anonymous union. Adapt to new
1743 (build_fh_pc): Make debugging output more useful.
1744 * exceptions.cc (ctrl_c_handler): Use get_cttyp instead of get_tty.
1745 * external.cc (fillout_pinfo): Accommodate new cons* stuff.
1746 * fhandler.cc (fhandler_base::read): Eliminate is_slow() test.
1747 * fhandler.h (fhandler_base::*): Adapt to changes in device.h.
1748 (fhandler_*::is_slow): Delete.
1749 ( fhandler_proc::get_proc_fhandler): Return fh_devices type.
1750 * fhandler_console.cc (open_shared_console): New function.
1751 (console_unit): New class.
1752 (console_unit::console_unit): New constructor.
1753 (enum_windows): New function. Declare as friend to console_unit.
1754 (fhandler_console::set_unit): New function.
1755 (fhandler_console::get_tty_stuff): Call set_unit to set the unit number
1756 and determine if initialization is needed. Eliminate flags parameter.
1757 (tty_list::get_cttyp): Rename (sorta) from get_tty. Return pointer to
1759 (fhandler_console::open): Adapt to elimination of argument to
1761 (fhandler_console::output_tcsetattr): Properly detect error condition.
1762 (fhandler_console::fixup_after_fork_exec): Adapt to get_tty_stuff()
1763 setting tc automatically.
1764 * fhandler_proc.cc: Use FH_BAD rather than 0 throughout where using
1766 (fhandler_proc::get_proc_fhandler): Return fh_devices. Adapt to
1768 * fhandler_process.cc: Adapt to devices.h changes. Use FH_BAD rather
1769 than 0 throughout where using fh_devices enum.
1770 * fhandler_procnet.cc: Ditto.
1771 * fhandler_procsys.cc: Ditto.
1772 * fhandler_procsysvipc.cc: Ditto.
1773 * fhandler_tape.cc (fhandler_dev_tape::fhandler_dev_tape): Ditto.
1774 * fhandler_termios.cc (handler_termios::bg_check): Use tc->ttyname()
1775 rather than assuming that we can construct a tty.
1776 * fhandler_tty.cc (fhandler_tty_master::fhandler_tty_master): Just
1777 return get_minor() of dev.
1778 (fhandler_pty_master::process_slave_output): Add slightly more
1780 (fhandler_tty_slave::fhandler_tty_slave): Change name from ntty to
1782 (fhandler_pty_master::open): Ditto.
1783 (fhandler_tty_slave::ioctl): Adapt to change which causes ctty to
1784 represent a complete device.
1785 (fhandler_tty_master::init_console): Add debugging for failure path.
1786 (fhandler_pty_master::setup): Use get_unit() to retrieve unit number
1787 rather than relying on raw ntty.
1788 (fhandler_pty_master::setup): Ditto.
1789 * fhandler_virtual.h (virt_tab_t): Redefine fhandler as fh_devices.
1790 * fork.cc: Remove obsolete vfork stuff.
1791 (frok::child): Don't assume that a ctty == 0 is valid.
1792 * mount.cc (mount_info::conv_to_win32_path): Adapt to device struct
1794 (mount_info::conv_to_win32_path): Ditto.
1795 * path.cc (path_conv::check): Retrive major/minor numbers via a method
1796 rather than accessing them directly from device. Rely on dev operators
1797 to set/retrieve device information as required by device struct change.
1798 * path.h (isproc_dev): Move to devices.h.
1799 (isprocsys_dev): Ditto.
1800 (isvirtual_dev): Ditto.
1801 (path_conv:{isdevice,isfifo,isspecial,iscygdrive,issocket,get_devn,get_unitn}):
1802 Use device methods to access/manipulate devices.
1803 * pinfo.cc (pinfo::exit): Don't assume that ctty == 0 is valid. Use
1804 iscons_dev to determine if a device is a console.
1805 (_pinfo::_ctty): Use device::parse to generate tty/cons name.
1806 (_pinfo::set_ctty): Don't assume that ctty == 0 is valid. Remove
1807 redundant info from debugging.
1808 * shared.cc (offsets): Remove console offset.
1809 * shared_info.h (shared_locations): Ditto.
1810 * syscalls.cc (umask): Use device methods to manipulate device
1812 (ctermid): Use device::parse to generate term device name.
1813 * tlsoffsets.h: Regenerate.
1814 * tty.cc (ttyslot): Return minor number of ctty since ctty now
1815 represents a full device.
1816 (tty::create_master): Set ctty to a complete device.
1817 (tty_list::attach): Rework to detect new /dev/cons* stuff.
1818 (tty_list::terminate): Adapt to changes to ctty.
1819 (tty_list::init): Adapt to change to setntty - pass in device major
1821 (tty::exists): Use get_unit() to retrive tty unit number.
1822 (tty::open_mutex): Ditto.
1823 (tty::open_inuse): Ditto.
1824 (tty::create_inuse): Ditto.
1825 (tty::get_event): Ditto.
1826 (tty_min::ttyname): Define new function.
1827 * tty.h (tty_min::ntty): Redefine as fh_devices.
1828 (tty::exists): Use get_unit() to retrive tty unit number.
1829 (tty::open_mutex): Ditto.
1830 (tty::open_inuse): Ditto.
1831 (tty::create_inuse): Ditto.
1832 (tty::get_event): Ditto.
1833 (tty_min::ttyname): Declare new function.
1834 (tty::getntty): Declare as const.
1835 (tty_list::operator []): Assure that only minor part of argument is
1838 * dll_init.cc (dll_list::alloc): Detect mismatch of data segments early
1839 issuing an explicit error message if necessary.
1840 * heap.cc (heap_init): Adapt to changes from fork->handle_failure to
1842 * pinfo.h (EXITCODE_FORK_FAILED): New enum. (from Ryan Johnson)
1843 * sigproc.cc (child_info_fork::abort): Rename from handle_failure.
1844 Change arguments to allow passing in a printf-like message.
1845 * winsup.h (api_fatal): Delete macro definition.
1846 (api_fatal): Redefine from __api_fatal.
1847 (vapi_fatal): Declare new function.
1848 * include/sys/strace.h (strace_vprintf): Define new macro.
1850 * ntdll.h (_SYSTEM_INFORMATION_CLASS): Add SystemHandleInformation.
1852 2011-05-27 Corinna Vinschen <corinna@vinschen.de>
1854 * shared.cc (offsets): Reorder so that console_state is lowest in
1855 memory. Explain why.
1856 (open_shared): Accommodate reordering of offsets array.
1857 * shared_info.h (shared_locations): Reorder SH_SHARED_CONSOLE after
1860 2011-05-26 Corinna Vinschen <corinna@vinschen.de>
1862 * mount.h (MAX_MOUNTS): Raise to 64.
1864 2011-05-25 Eric Blake <eblake@redhat.com>
1866 * cygtls.h (strerror_r_buf): New buffer.
1867 * errno.cc (strerror): Move guts...
1868 (_strerror_r): ...to new function demanded by newlib.
1869 (strerror_r): Don't clobber strerror buffer.
1870 (_user_strerror): Drop unused declaration.
1871 * tlsoffsets.h: Regenerate.
1873 2011-05-25 Corinna Vinschen <corinna@vinschen.de>
1875 * init.cc (dll_entry): Reinstantiate wow64_test_stack_marker and
1876 previous stack tests.
1878 2011-05-25 Corinna Vinschen <corinna@vinschen.de>
1880 * posix.sgml (std-notes): Add missing <para>.
1882 2011-05-24 Corinna Vinschen <corinna@vinschen.de>
1884 * mount.cc (mount_info::conv_to_win32_path): Remove unused code.
1885 * mount.h (class mount_info): Remove sys_mount_table_counter member.
1886 * shared_info.h (class shared_info): Ditto.
1887 (CURR_SHARED_MAGIC): Update.
1889 2011-05-24 Corinna Vinschen <corinna@vinschen.de>
1891 * pinfo.h (struct _pinfo): Reduce size of progname array slightly.
1894 2011-05-23 Eric Blake <eblake@redhat.com>
1896 * errno.cc (strerror): Print unknown errno as int.
1897 (__xpg_strerror_r): Likewise, and don't clobber strerror buffer.
1898 * cygtls.h (strerror_buf): Resize to allow '-'.
1900 2011-05-23 Corinna Vinschen <corinna@vinschen.de>
1902 * fhandler_process.cc (thread_info::fill_if_match): Reformat.
1903 (format_process_maps): Ditto. Fetch pointer to procinfo structure
1904 from mapped process. Print info about global shared Cygwin regions.
1906 2011-05-21 Corinna Vinschen <corinna@vinschen.de>
1908 * fhandler_process.cc (struct dos_drive_mappings): Use malloc/free
1909 rather than cmalloc/cfree. Check return value from malloc before
1911 (struct heap_info): Ditto.
1912 (struct thread_info): Ditto. Rename from stack_info. Rename members
1913 and local variables accordingly.
1914 (thread_info::thread_info): Store stack and TEB addresses.
1915 (thread_info::fill_if_match): Print "teb" if a TEB address has been
1916 found. Special case for WOW64, explain why.
1917 (format_process_maps): Fetch PEB address. Print MEM_RESERVE regions
1918 with equal signs to distinguish them from PAGE_NOACCESS regions. Fix
1919 printing of 'p' and 's' to differ between MEM_PRIVATE and MEM_MAPPED
1920 pages, as on Linux. Print 'g' instead of 'p for PAGE_GUARD pages.
1921 Print PEB and SharedUserData area if recognized.
1923 2011-05-20 Corinna Vinschen <corinna@vinschen.de>
1925 * miscfuncs.cc (CygwinCreateThread): Fix condition for adding the
1926 guardsize to the stacksize. Fix accompanying comment.
1928 2011-05-20 Corinna Vinschen <corinna@vinschen.de>
1930 * miscfuncs.cc (CygwinCreateThread): Add accidentally missing comment.
1932 2011-05-20 Corinna Vinschen <corinna@vinschen.de>
1934 * fhandler_process.cc (struct heap_info): Change type of base and end
1935 members to char *. Print "shared" rather than "share".
1936 (struct stack_info): New class to fetch process stack information.
1937 (format_process_maps): Initialize and check for stack information.
1939 2011-05-20 Corinna Vinschen <corinna@vinschen.de>
1941 * miscfuncs.cc (thread_wrapper): Remove statements added for debugging
1944 2011-05-20 Corinna Vinschen <corinna@vinschen.de>
1946 * child_info.h (CURR_CHILD_INFO_MAGIC): Update.
1947 (class child_info_fork): Remove stacksize, add stackaddr and guardsize
1949 * dcrt0.cc (child_info_fork::alloc_stack_hard_way): Partial rewrite
1950 to regenerate the stack exactly as in the parent.
1951 (child_info_fork::alloc_stack): Set stackaddr to 0, rather than
1953 (dll_crt0_1): Check for stackaddr before changing the stack addresses
1955 * fork.cc (frok::child): Check for stackaddr here.
1956 (frok::parent): Set ch.stackaddr and ch.guardsize if not called from
1958 * init.cc (dll_entry): Replace pointer to NT_TIB with pointer to TEB.
1959 Fix incorrectly changed address test before removing _my_tls.
1960 Set StackLimit to NULL on Windows 2000. Explain why.
1961 * miscfuncs.cc (struct thread_wrapper_arg): Store stackbase rather
1962 than stacksize, store commitaddr, remove guardsize. Store all pointers
1963 as char * for easier address arithmetic.
1964 (thread_wrapper): Rewrite to remove OS stack before calling thread
1965 function. Add lots of comments to explain what we do.
1966 (CygwinCreateThread): Reserve our own stack in case we got no
1967 application stack. Add comments.
1968 * ntdll.h (struct _TEB): Extend defintion up to DeallocationStack
1970 * thread.cc (pthread_attr::pthread_attr): Use "(size_t) -1"
1971 rather then 0xffffffff.
1972 * wincap.h (wincaps::has_stack_size_param_is_a_reservation): New
1974 * wincap.cc: Implement above element throughout.
1976 2011-05-19 Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
1978 * thread.cc: Mark psiginfo and psignal as available in list of
1979 optional cancellation points.
1981 2011-05-19 Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
1983 * cygwin.din (__fpurge): Export.
1984 * posix.sgml (std-solaris): Add __fpurge.
1985 * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump.
1987 2011-05-18 Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
1989 * posix.sgml (std-susv4): Remove chroot, futimes, hstrerror.
1990 (std-deprec): Add chroot.
1991 (std-bsd): Add futimes, hstrerror.
1992 (std-notimpl): Add clock_nanosleep, nexttoward, nexttowardf.
1993 Remove initstate, which is implemented and listed in std-susv4.
1995 2011-05-17 Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
1997 * cygwin.din (error): Export.
1998 (error_at_line): Export.
1999 (error_message_count): Export.
2000 (error_one_per_line): Export.
2001 (error_print_progname): Export.
2002 * errno.cc (error_message_count): Define.
2003 (error_one_per_line): Define.
2004 (error_print_progname): Define.
2005 (_verror): New static function.
2006 (error): New function.
2007 (error_at_line): New function.
2008 * posix.sgml (std-gnu): Add error, error_at_line.
2009 * include/error.h: New header.
2010 * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump.
2012 2011-05-17 Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
2014 * cygwin.din (clock_getcpuclockid): Export.
2015 (pthread_getcpuclockid): Export.
2016 * hires.h (PID_TO_CLOCKID): New macro.
2017 (CLOCKID_TO_PID): New macro.
2018 (CLOCKID_IS_PROCESS): New macro.
2019 (THREADID_TO_CLOCKID): New macro.
2020 (CLOCKID_TO_THREADID): New macro.
2021 (CLOCKID_IS_THREAD): New macro.
2022 * ntdll.h (enum _THREAD_INFORMATION_CLASS): Add ThreadTimes.
2023 * posix.sgml (std-notimpl): Add clock_getcpuclockid and
2024 pthread_getcpuclockid from here...
2025 (std-susv4): ... to here.
2026 (std-notes): Remove limitations of clock_getres and clock_gettime.
2027 Note limitation of timer_create to CLOCK_REALTIME.
2028 * sysconf.cc (sca): Set _SC_CPUTIME to _POSIX_CPUTIME, and
2029 _SC_THREAD_CPUTIME to _POSIX_THREAD_CPUTIME.
2030 * thread.cc (pthread_getcpuclockid): New function.
2031 * timer.cc (timer_create): Set errno to ENOTSUP for CPU-time clocks.
2032 * times.cc (clock_gettime): Handle CLOCK_PROCESS_CPUTIME_ID and
2033 CLOCK_THREAD_CPUTIME_ID.
2034 (clock_getres): Ditto.
2035 (clock_settime): Set errno to EPERM for CPU-time clocks.
2036 (clock_getcpuclockid): New function.
2037 * include/pthread.h (pthread_getcpuclockid): Declare.
2038 * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump.
2040 2011-05-17 Corinna Vinschen <corinna@vinschen.de>
2042 * miscfuncs.cc (thread_wrapper): Remove unused _cygtls record.
2043 * mmap.cc (is_mmapped_region): Avoid crash if no mmaps exist.
2045 2011-05-16 Corinna Vinschen <corinna@vinschen.de>
2047 * globals.cc (__getlogin_username): Remove.
2048 * uinfo.cc (getlogin_r): Fetch username from cygheap.
2049 (getlogin): Add static buffer username and fetch username from
2052 2011-05-16 Corinna Vinschen <corinna@vinschen.de>
2054 * cygtls.h (struct _local_storage): Remove unused members rarg and
2055 _localtime_buf. Remove username in favor of a global buffer. Reorder
2056 slightly to keep the net.cc stuff together.
2057 * globals.cc (__getlogin_username): New global char buffer.
2058 * tlsoffsets.h: Regenerate.
2059 * uinfo.cc (getlogin): Copy username into __getlogin_username.
2061 2011-05-16 Corinna Vinschen <corinna@vinschen.de>
2063 * heap.cc (heap_init): Rewrite initial heap allocation to use addresses
2064 beyond 0x20000000. Explain why and how.
2065 * shared.cc (shared_info::heap_slop_size): Remove.
2066 * shared_info.h (class shared_info): Remove heap_slop_inited and
2067 heap_slop members. Remove heap_slop_size declaration.
2068 (CURR_SHARED_MAGIC): Update.
2069 * wincap.cc: Throughout, drop heapslop.
2070 * wincap.h (struct wincaps): Drop heapslop.
2072 2011-05-16 Corinna Vinschen <corinna@vinschen.de>
2074 * dcrt0.cc (child_info_fork::alloc_stack_hard_way): Check if the
2075 requested stack is application-provided within the user heap or an
2076 mmapped region. If so, just use it. Add comment to explain why.
2077 * miscfuncs.cc (thread_wrapper): If an application-provided stack
2078 has been given, implement cygtls area at the stackbase. Fix comment.
2079 * mmap.cc (is_mmapped_region): New function.
2080 * winsup.h (is_mmapped_region): Declare.
2082 2011-05-15 Corinna Vinschen <corinna@vinschen.de>
2084 * miscfuncs.cc (thread_wrapper): Add comments to assembler code.
2086 2011-05-15 Corinna Vinschen <corinna@vinschen.de>
2088 * cygwin.din (pthread_attr_getguardsize): Export.
2089 (pthread_attr_setguardsize): Export.
2090 (pthread_attr_setstack): Export.
2091 (pthread_attr_setstackaddr): Export.
2092 * init.cc (dll_entry): Remove wow64_test_stack_marker. Check for
2093 unusual stack address by testing stack addresses from current TEB.
2094 Check validity of _my_tls by testing if it's within the stack as
2095 given in current TEB.
2096 * miscfuncs.cc (struct thread_wrapper_arg): New structure used to
2097 push all required information to thread_wrapper function.
2098 (thread_wrapper): Wrapper function for actual thread function.
2099 If an application stack has been given, change %ebp and %esp so that
2100 the thread function runs on that stack. If the thread has been created
2101 by CygwinCreateThread, set up the POSIX guard pages if necessary.
2102 (CygwinCreateThread): New function.
2103 * miscfuncs.h (CygwinCreateThread): Declare.
2104 * ntdll.h (struct _TEB): Define all members up to Peb.
2105 * posix.sgml (std-susv4): Move pthread_attr_getguardsize,
2106 pthread_attr_setguardsize and pthread_attr_setstack here.
2107 (std-deprec): Add pthread_attr_setstackaddr.
2108 * sysconf.cc (sca): Set _SC_THREAD_ATTR_STACKADDR to
2109 _POSIX_THREAD_ATTR_STACKADDR.
2110 * thread.cc (pthread::precreate): Copy pthread_attr stackaddr and
2112 (pthread::create): Call CygwinCreateThread.
2113 (pthread_attr::pthread_attr): Initialize guardsize.
2114 (pthread_attr_setstack): New function.
2115 (pthread_attr_setstackaddr): New function.
2116 (pthread_attr_setguardsize): New function.
2117 (pthread_attr_getguardsize): New function.
2118 (pthread_getattr_np): Copy attr.guardsize.
2119 * thread.h (pthread_attr): Add member guardsize.
2120 * include/pthread.h (pthread_attr_getguardsize): Declare.
2121 (pthread_attr_setguardsize): Declare.
2122 * include/cygwin/version.h: Bump API minor number.
2124 2011-05-13 Corinna Vinschen <corinna@vinschen.de>
2126 * fhandler_process.cc (struct heap_info::heap): Convert base to
2127 uintptr_t. Add heap_id, end, flags members.
2128 (heap_info::heap_vm_chunks): Rename from heaps.
2129 (heap_info::heap_info): Rearrange using RtlQueryProcessDebugInformation
2130 to get information of heap virtual memory blocks. Store heap id and
2131 flags, as well as end address of each block.
2132 (heap_info::fill_if_match): Check incoming base address against full
2133 address range of heap chunks. Convert flag values in extra heap
2135 (format_process_maps): Change order so that heap check is done before
2136 MEM_MAPPED check since there are shareable heaps.
2137 * ntdll.h (PDI_HEAP_BLOCKS): Define.
2138 (HEAP_FLAG_NOSERIALIZE): Define.
2139 (HEAP_FLAG_GROWABLE): Define.
2140 (HEAP_FLAG_EXCEPTIONS): Define.
2141 (HEAP_FLAG_NONDEFAULT): Define.
2142 (HEAP_FLAG_SHAREABLE): Define.
2143 (HEAP_FLAG_EXECUTABLE): Define.
2144 (HEAP_FLAG_DEBUGGED): Define.
2145 (struct _DEBUG_HEAP_ARRAY): Define.
2146 (struct _DEBUG_HEAP_BLOCK): Define.
2148 2011-05-12 Corinna Vinschen <corinna@vinschen.de>
2150 Based on newlib patch to strptime by Peter Rosin <peda@lysator.liu.se>:
2151 * libc/time/strptime.c (is_leap_year): New static function.
2153 (__strptime): Fill in tm_yday when all of tm_year, tm_mon and tm_mday
2154 are updated. Fill in tm_mon, tm_mday and tm_wday when both of tm_year
2155 and tm_yday are updated.
2157 2011-05-12 Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
2159 * fhandler_proc.cc (format_proc_meminfo): Rewrite to use sysinfo().
2160 Support RAM and swap space larger than 4GB.
2161 Remove output elements not found with modern Linux kernels.
2162 (format_proc_swaps): Support paging files larger than 4GB.
2164 2011-05-11 Corinna Vinschen <corinna@vinschen.de>
2166 * autoload.cc: Remove useless comment.
2168 2011-05-11 Corinna Vinschen <corinna@vinschen.de>
2170 * autoload.cc (EnumProcessModules): Remove.
2171 * dlfcn.cc (dlopen): Make sure errno is set if an error occurs.
2172 (dlsym): Rewrite using RtlQueryProcessDebugInformation instead of
2174 * ntdll.h (struct _DEBUG_MODULE_ARRAY): Define.
2175 (RtlCreateQueryDebugBuffer): Declare.
2176 (RtlDestroyQueryDebugBuffer): Declare.
2177 (RtlQueryProcessDebugInformation): Declare.
2179 2011-05-11 Corinna Vinschen <corinna@vinschen.de>
2181 * autoload.cc (GetModuleFileNameExW): Remove.
2182 * autoload.cc (GetModuleInformation): Remove.
2184 2011-05-11 Corinna Vinschen <corinna@vinschen.de>
2186 * autoload.cc (QueryWorkingSet): Remove.
2188 2011-05-11 Ryan Johnson <ryan.johnson@cs.utoronto.ca>
2190 * fhandler_process.cc (format_process_maps): Rework to report
2191 all mapped address space in a process (committed or reserved),
2192 identifying the nature of the mapping (mapped file/image, heap,
2193 shared memory) when possible.
2194 (dos_drive_mappings): New helper classes.
2196 * ntdll.h (struct _MEMORY_SECTION_NAME): Define.
2198 2011-05-11 Corinna Vinschen <corinna@vinschen.de>
2200 * autoload.cc (GetProcessMemoryInfo): Remove.
2201 * resource.cc (fill_rusage): Call NtQueryInformationProcess rather than
2202 GetProcessMemoryInfo to drop a psapi dependency.
2204 2011-05-11 Corinna Vinschen <corinna@vinschen.de>
2206 * fhandler_socket.cc (get_inet_addr): Rearrange for better readability.
2207 Make waiting loop interruptible and cancelable. Check for SYSTEM DOS
2208 flag before reading the file. Change return value to return 0 on
2209 success, SOCKET_ERROR on failure.
2210 (fhandler_socket::bind): Only set R/O DOS flag on filesystems not
2212 (fhandler_socket::connect): Accommodate changed return values from
2213 get_inet_addr. Use SOCKET_ERROR instead of -1.
2214 (fhandler_socket::sendto): Accommodate changed return values from
2216 * syslog.cc (connect_syslogd): Ditto.
2218 2011-05-10 Christian Franke <franke@computer.org>
2220 * security.cc (check_registry_access): Handle missing
2221 security descriptor of HKEY_PERFORMANCE_DATA.
2223 2011-05-10 Corinna Vinschen <corinna@vinschen.de>
2225 * lc_msg.h: Regenerate.
2227 2011-05-10 Corinna Vinschen <corinna@vinschen.de>
2229 * fhandler_proc.cc (format_proc_uptime): Don't call GetSystemInfo.
2230 Fetch CPU count from wincap.
2231 (format_proc_stat): Ditto.
2232 * globals.cc (system_info): Move to wincap.
2233 * heap.cc (heap_init): Fetch page size from wincap.
2234 * syscalls.cc (getpagesize): Fetch allocation granularity from wincap.
2235 (getsystempagesize): Fetch page size from wincap.
2236 * wincap.cc (wincap_2003): Default is_server to false.
2237 (wincapc::init): Call GetSystemInfo here. Always set is_server value.
2238 * wincap.h (class wincapc): Add system_info as private member.
2239 (wincapc::cpu_count): New public method.
2240 (wincapc::page_size): Ditto.
2241 (wincapc::allocation_granularity): Ditto.
2243 2011-05-10 Corinna Vinschen <corinna@vinschen.de>
2245 * environ.cc (set_chunksize): Remove.
2246 (parse_thing): Remove forkchunk entry.
2247 * fork.cc (child_copy): Drop handling external chunksize setting.
2248 * wincap.cc: Througout, drop chunksize.
2249 (wincapc::set_chunksize): Remove.
2250 * wincap.h (struct wincaps): Drop chunksize and declaration of
2253 2011-05-08 Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
2255 * times.cc (settimeofday): Add EFAULT handler.
2256 Set errno to EINVAL if tv.tv_nsec is invalid, and to EPERM if
2257 SetSystemTime fails. Return -1 in case of failure, all for
2258 compatibility with BSD and Linux.
2259 (clock_settime): New function.
2260 * cygwin.din (clock_settime): Export.
2261 * posix.sgml (std-susv4): Add clock_settime.
2262 Move clock_setres from here...
2263 (std-deprec): ... to here.
2264 (std-notes): Correct limitation of clock_setres to only CLOCK_REALTIME.
2265 Add limitation of clock_settime to only CLOCK_REALTIME.
2266 * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump.
2268 2011-05-07 Corinna Vinschen <corinna@vinschen.de>
2270 * registry.cc (get_registry_hive_path): Change system_printf to
2272 (load_registry_hive): Ditto.
2274 2011-05-06 Christopher Faylor <me.cygwin2011@cgf.cx>
2276 * fhandler.h (fhandler_base::close_with_arch): Make non-virtual.
2277 (fhandler_base::open_fs): Move closer to it's close counterpart.
2279 2011-05-06 Christopher Faylor <me.cygwin2011@cgf.cx>
2281 * fhandler.cc (fhandler_base::dup): Avoid duping a handle when an
2282 fhandler has an archetype.
2283 * fhandler_console.cc (fhandler_console::invisible_console): Move to
2285 (fhandler_console::set_close_on_exec): Don't set close-on-exec on
2286 handle since it's an archetype and you don't know how many things could
2289 2011-05-06 Christopher Faylor <me.cygwin2011@cgf.cx>
2291 * fhandler.h (fhandler_dev_dsp): Cosmetic change.
2293 * fhandler_tty.cc (fhandler_pty_master::process_slave_output): Put back
2294 Sleep(10) for tty_master case.
2296 * sigproc.cc (stopped_or_terminated): Don't consider a pid which has
2297 been reaped to be terminated.
2299 2011-05-06 Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
2301 * sysconf.cc (sysinfo): New function.
2302 * cygwin.din (sysinfo): Export.
2303 * posix.sgml (std-gnu): Add sysinfo.
2304 * include/sys/sysinfo.h (struct sysinfo): Define.
2306 * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump.
2308 2011-05-06 Corinna Vinschen <corinna@vinschen.de>
2310 * libc/minires-os-if.c (get_dns_info): Drop printing uninitialized
2311 value of dwRetVal in debug output.
2313 2011-05-06 Corinna Vinschen <corinna@vinschen.de>
2315 * fhandler.h (fhandler_socket::read): Declare.
2316 (fhandler_socket::write): Declare.
2317 * fhandler_procsys.cc (fhandler_procsys::read): Add FIXME comment.
2318 (fhandler_procsys::write): Ditto.
2319 * fhandler_socket.cc (fhandler_socket::read): New method.
2320 (fhandler_socket::write): New method.
2321 * syscalls.cc: Rearrange order of read/write functions.
2322 (read): Call fhandler read method directly instead of just readv.
2323 (readv): Remove EINTR loop. This is done in all affected fhandler's
2325 (write): Call fhandler write method directly instead of just writev.
2328 2011-05-05 Christopher Faylor <me.cygwin2011@cgf.cx>
2330 * cygheap.cc (cygheap::close_ctty): Close ctty via close_with_arch().
2331 * debug.cc (close_handle): Call debugger on failure.
2332 * devices.in (device::tty_to_real_device): Delete.
2333 * devices.h (device::tty_to_real_device): Ditto.
2334 * devices.cc: Regenerate.
2335 * dtable.cc: Delete old ifdef'ed vfork code.
2336 (dtable::release): Don't handle archetype here.
2337 (dtable::init_std_file_from_handle): Consolidate console tests.
2338 Generate major/minor for tty ASAP. Fix incorrect setting of DEV_TTYS*
2340 (fh_alloc): New function derived from build_fh_pc. Pass current tty
2342 (build_pc_pc): Use fh_alloc to create. Set name from fh->dev if
2343 appropriate. Generate an archetype or point to one here.
2344 (dtable::dup_worker): Deal with archetypes. Rely on = operator copying
2345 whole class rather than just fhandler_base.
2346 (dtable::fixup_after_exec): Call close_with_arch to handle closing of
2347 fhandlers with archetypes.
2348 * fhandler.cc (fhandler_base::operator =): Call memcpy with fhandler's
2349 size() rather than sizeof fhandler_base.
2350 (fhandler_base::open_with_arch): New function. Handles opening of
2351 fhandler's with archetypes, dealing with usecounts, etc.
2352 (fhandler_base::close_with_arch): Ditto for close.
2353 * fhandler.h: Many changes for archetypes.
2354 (fhandler_base::set_name): Set both normalized path and regular path.
2355 (fhandler_base::open_with_arch): New function.
2356 (fhandler_base::open_setup): Ditto.
2357 (fhandler_base::use_archetype): Ditto.
2358 (fhandler_base::_archetype_usecount): Ditto.
2359 (fhandler_*::size): Ditto.
2360 (fhandler_dev_tape::open): Remove virtual decoration.
2361 (fhandler_console::use_archetype): New function. Return true.
2362 (fhandler_console::open_setup): New function.
2363 (fhandler_console::dup): Delete.
2364 (fhandler_tty_slave::fhandler_tty_slave): Redeclare to take an
2366 (fhandler_tty_slave::use_archetype): New function. Return true.
2367 (fhandler_tty_slave::cleanup): New function.
2368 (fhandler_pty_master::use_archetype): New function. Return true.
2369 (fhandler_pty_master::cleanup): New function.
2370 (fhandler_pty_master::is_tty_master): New function. Return false.
2371 (fhandler_tty_master::is_tty_master): New function. Return true.
2372 (fhandler_dev_dsp::fhandler_dev_dsp): New function. Return true.
2373 (report_tty_counts): Only report on archetype's usecount if there is
2375 * fhandler_console.cc (fhandler_console::get_tty_stuff): Remove
2376 handling of setsid, set_ctty, set_flags, and manage_console_count.
2377 (fhandler_console::open_setup): New function. Implement functionality
2378 removed from get_tty_stuff.
2379 (fhandler_console::dup): Delete.
2380 (fhandler_console::output_tcsetattr): Set errno on error.
2381 (fhandler_console::fhandler_console): Set device early.
2382 (fhandler_console::init): Use open_with_arch to open console handles.
2383 (fhandler_console::fixup_after_fork_exec): Nuke most of the stuff for
2384 dealing with console handles.
2385 * fhandler_dsp.cc (fhandler_dev_dsp::open): Remove archetype handling.
2386 (fhandler_dev_dsp::write): Ditto.
2387 (fhandler_dev_dsp::read): Ditto.
2388 (fhandler_dev_dsp::close): Ditto.
2389 (fhandler_dev_dsp::dup): Ditto.
2390 (fhandler_dev_dsp::ioctl): Ditto.
2391 (fhandler_dev_dsp::fixup_after_fork): Ditto.
2392 (fhandler_dev_dsp::fixup_after_exec): Ditto.
2393 * fhandler_tty.cc (fhandler_tty_common::__acquire_output_mutex): Add a
2394 little more debugging.
2395 (fhandler_tty_common::__release_output_mutex): Ditto.
2396 (fhandler_pty_master::process_slave_output): Ditto. Don't do signal
2397 handling or pthread_cancel handling in the tty master thread.
2398 (process_output): Minor reorg.
2399 (fhandler_tty_slave::fhandler_tty_slave): Set device based on new ntty
2401 (fhandler_tty_slave::open): Remove archetype handling. Move some
2402 processing into open_setup().
2403 (fhandler_tty_slave::open_setup): New function.
2404 (fhandler_tty_slave::cleanup): New function.
2405 (fhandler_tty_slave::close): Remove archetype handling. Move some
2406 processing into cleanup().
2407 (fhandler_tty_slave::init): Rename argument from f to h. Open device
2408 using open_with_arch(). Remove archetype handling.
2409 (fhandler_pty_master::dup): Ditto.
2410 (fhandler_pty_master::open): Ditto.
2411 (fhandler_pty_master::close): Ditto. Move some handling to cleanup().
2412 (fhandler_pty_master::cleanup): New function.
2413 (fhandler_tty_master::init_console): Give unique name to captive
2415 * pinfo.cc (_pinfo::set_ctty): Rename argument from arch to fh.
2416 Eliminate archetype assumption.
2417 * syscalls.cc (close_all_files): Use close_with_arch for closing.
2418 (open): Use open_with_arch() rather than open().
2419 (close): Use close_with_arch() rather than close().
2421 2011-05-05 Corinna Vinschen <corinna@vinschen.de>
2423 * pinfo.h (class push_process_state): New class to push a process state
2424 flag temporarily into myself->process_state.
2425 * fhandler_console.cc (fhandler_console::read): Add push_process_state
2427 (fhandler_console::write): Call bg_check from here. Add
2428 push_process_state handler.
2429 * fhandler_tty.cc (fhandler_tty_slave::write): Ditto.
2430 (fhandler_tty_slave::read): Ditto.
2431 (fhandler_pty_master::write): Ditto.
2432 (fhandler_pty_master::read): Ditto.
2433 * syscalls.cc (readv): Remove bg_check call and setting process state.
2436 2011-05-05 Corinna Vinschen <corinna@vinschen.de>
2438 * syscalls.cc (readv): Add myfault handler. Don't check repeatedly
2439 open state of file handler. Streamline loop.
2440 (writev): Add myfault handler.
2442 2011-05-05 Christopher Faylor <me.cygwin2011@cgf.cx>
2444 * fhandler.cc (fhandler_base_overlapped::raw_read): Rename from
2446 (fhandler_base_overlapped::raw_e): Rename from write_overlapped.
2447 * fhandler.h (fhandler_*::raw_read): Add reparm decoration.
2448 (fhandler_*::raw_write): Ditto.
2449 (fhandler_base_overlapped::raw_read): Rename from read_overlapped.
2450 (fhandler_base_overlapped::raw_write): Rename from write_overlapped.
2451 (fhandler_pipe::raw_read): Delete.
2452 (fhandler_pipe::raw_write): Ditto.
2453 (fhandler_mailslot::raw_read): Ditto.
2454 * fhandler_fifo.cc (fhandler_fifo::raw_read): Reflect read_overlapped
2456 (fhandler_fifo::raw_write): Ditto.
2457 * fhandler_mailslot.cc (fhandler_mailslot::raw_read): Delete.
2458 (fhandler_mailslot::raw_write): Reflect read_overlapped -> raw_read
2460 * pipe.cc (fhandler_pipe::raw_read): Delete.
2461 (fhandler_pipe::raw_write): Ditto.
2463 2011-05-05 Christopher Faylor <me.cygwin2011@cgf.cx>
2465 * fork.cc (fork): Clear PID_REAPED.
2466 * pinfo.cc (pinfo_init): Ditto.
2467 (pinfo::init): Check for PID_REAPED.
2468 * sigproc.cc (stopped_or_terminated): Ditto.
2470 2011-05-05 Christopher Faylor <me.cygwin2011@cgf.cx>
2472 * pinfo.cc (_pinfo::exists): Check for PID_REAPED.
2474 2011-05-05 Corinna Vinschen <corinna@vinschen.de>
2476 * fhandler_disk_file.cc (fhandler_disk_file::pread): Correctly return
2477 with errno set to EBADF if file open mode is incorrect.
2478 (fhandler_disk_file::pwrite): Ditto.
2480 2011-05-05 Corinna Vinschen <corinna@vinschen.de>
2482 * fhandler.cc (is_at_eof): Drop static storage class. Drop err
2483 parameter since we don't change the Win32 error here anymore.
2484 (fhandler_base::raw_read): Accommodate change to is_at_eof.
2486 * fhandler_disk_file.cc (fhandler_disk_file::pread): In binary mode use
2487 direct call to NtReadFile, rather than lseek/read.
2488 (fhandler_disk_file::pwrite): In binary mode use direct call to
2489 NtWriteFile, rather than lseek/write.
2491 2011-05-05 Corinna Vinschen <corinna@vinschen.de>
2493 * dcrt0.cc (dll_crt0_1): Reset locale to "C" even when dynamically
2496 2011-05-05 Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
2498 * posix.sgml (std-notimpl): Remove bsd_signal, setcontext, and
2499 swapcontext, marked obsolete in SUSv3 and not present in SUSv4.
2501 2011-05-05 Christian Franke <franke@computer.org>
2503 * fhandler_registry.cc (fhandler_registry::exists): Fix regression
2505 (fhandler_registry::open): Fix "%val" case.
2507 2011-05-04 Christopher Faylor <me.cygwin2011@cgf.cx>
2509 * signal.cc (_pinfo::kill): Return success on kill(0) only if pid
2510 exists or is in PID_EXITED state. Report pid 0 when pid does not exist
2511 rather than pid -1. Make debug output reflect actual function call.
2512 * sigproc.cc (stopped_or_terminated): Set process state to reaped when
2513 we've finished waiting for it.
2514 * include/sys/cygwin.h (PID_REAPED): New enum.
2516 2011-05-04 Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
2518 * cygwin.din (psiginfo): Export.
2520 (sys_siglist): Export.
2521 * posix.sgml (std-notimpl): Move psiginfo and psignal from here...
2522 (std-susv4): ... to here.
2523 (std-deprec): Add sys_siglist.
2524 * strsig.cc (sys_siglist): New array.
2525 (psiginfo): New function.
2526 * include/cygwin/signal.h (sys_siglist): Declare.
2527 (psiginfo): Declare.
2528 * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump.
2530 2011-05-04 Christopher Faylor <me.cygwin2011@cgf.cx>
2532 * dll_list::detach (dll_list::detach): Avoid doing anything with detach
2533 during a failing fork.
2535 2011-05-04 Christopher Faylor <me.cygwin2011@cgf.cx>
2537 * dll_init.cc (dll_global_dtors): Avoid calling destructors during
2540 2011-05-04 Corinna Vinschen <corinna@vinschen.de>
2542 * fhandler.h (class fhandler_base): Remove uninterruptible_io status
2544 (fhandler_base::ready_for_read): Remove declaration.
2545 (fhandler_socket::ready_for_read): Ditto.
2546 (fhandler_pipe::ready_for_read): Ditto.
2547 (fhandler_tty_master::is_slow): Remove.
2548 * fhandler_console.cc (fhandler_console::open): Drop setting
2550 * fhandler_serial.cc (fhandler_serial::open): Ditto.
2551 * fhandler_tty.cc (fhandler_tty_slave::fhandler_tty_slave): Ditto.
2552 (fhandler_tty_master::init_console): Ditto.
2553 * pipe.cc (fhandler_pipe::fhandler_pipe): Ditto.
2554 (fhandler_pipe::open): Ditto.
2556 * select.cc (fhandler_pipe::ready_for_read): Remove.
2557 (fhandler_base::ready_for_read): Remove.
2558 * syscalls.cc (readv): Drop unneeded wait variable. Remove entire test
2559 which might lead to calling ready_for_read. Remove now unused label
2562 2011-05-04 Corinna Vinschen <corinna@vinschen.de>
2564 * fhandler.h (class fhandler_mailslot): Move down in file and change
2565 parent class to fhandler_base_overlapped. Remove declaration of
2566 method write. Add declaraiotns for raw_read and raw_write.
2567 * fhandler_mailslot.cc (fhandler_mailslot::fhandler_mailslot): Call
2568 fhandler_base_overlapped constructor.
2569 (fhandler_mailslot::fstat): Call fhandler_base_overlapped::fstat.
2570 (fhandler_mailslot::open): Drop FILE_SYNCHRONOUS_IO_NONALERT flag from
2572 (fhandler_mailslot::raw_read): New method.
2573 (fhandler_mailslot::raw_write): Ditto. Take over length algorithm from
2574 former write method.
2575 (fhandler_mailslot::write): Remove.
2576 (fhandler_mailslot::ioctl): Call fhandler_base_overlapped::ioctl.
2578 2011-05-04 Corinna Vinschen <corinna@vinschen.de>
2580 * fhandler.h (fhandler_dev_tape::_lock): Add bool parameter.
2581 * fhandler_tape.cc (lock): Call _lock with false argument.
2582 (_lock): Take bool cancelable parameter. Handle O_NONBLOCK.
2583 Make cancelable if cancelabe parameter is true.
2584 (fhandler_dev_tape::raw_read): Call _lock with true argument.
2585 (fhandler_dev_tape::raw_write): Ditto.
2587 2011-05-04 Corinna Vinschen <corinna@vinschen.de>
2589 * fhandler_dsp.cc (fhandler_dev_dsp::Audio): Add fh member.
2590 (fhandler_dev_dsp::Audio_out::Audio_out): Take pointer to encapsulating
2591 fhandler_dev_dsp as parameter.
2592 (fhandler_dev_dsp::Audio_in::Audio_in): Ditto.
2593 (fhandler_dev_dsp::Audio::Audio): Take pointer to encapsulating
2594 fhandler_dev_dsp as parameter and store in fh.
2595 (fhandler_dev_dsp::Audio_out::write): Change return type to int and
2596 return number of bytes written. Return -1 if waitforspace returns false
2597 and no bytes have been written so far.
2598 (fhandler_dev_dsp::Audio_out::waitforspace): Change return type to bool.
2599 Handle O_NONBLOCK. Make waiting loop interruptible and cancelable.
2600 Return false in any of these cases, otherwise true.
2601 (fhandler_dev_dsp::Audio_in::read): Set returned nBytes to -1 if
2602 waitfordata returns false and nothing has been read so far.
2603 (fhandler_dev_dsp::Audio_in::waitfordata): Change return type to bool.
2604 Handle O_NONBLOCK. Make waiting loop interruptible and cancelable.
2605 Return false in any of these cases, otherwise true.
2606 (fhandler_dev_dsp::write): Call Audio_out constructor with this as
2608 (fhandler_dev_dsp::read): Call Audio_in constructor with this as
2611 2011-05-04 Christopher Faylor <me.cygwin2011@cgf.cx>
2613 * thread.h (pthread::static_cancel_self): Mark as noreturn.
2614 (pthread::cancel_self): Ditto.
2615 * thread.cc (pthread::cancel_self): Explicitly use pthread::exit to
2616 avoid a "function returns" error.
2618 2011-05-04 Christopher Faylor <me.cygwin2011@cgf.cx>
2620 * pinfo.h (pinfo::pinfo): Set procinfo to NULL to avoid potential
2621 cleanup of uninitialized garbage. (Suggested by Ryan Johnson)
2623 2011-05-03 Corinna Vinschen <corinna@vinschen.de>
2625 * select.cc (cygwin_select): Make degenerate case cancelable.
2626 (select_stuff::destroy): New inline method to delete memory taken
2628 (select_stuff::~select_stuff): Call destroy.
2629 (select_stuff::wait): Add case to allow canceling select.
2630 * select.h (select_stuff::destroy): Declare.
2631 * thread.cc: Mark poll, pselect and poll as cancelable.
2633 2011-05-03 Corinna Vinschen <corinna@vinschen.de>
2635 * fhandler.cc (fhandler_base_overlapped::wait_overlapped): Make
2636 cancelable. Remove test for main thread, always add signal_arrived
2639 2011-05-03 Corinna Vinschen <corinna@vinschen.de>
2641 * fhandler_tty.cc (fhandler_tty_slave::read): Set WFMO timeout to 0 for
2642 nonblocking case. Drop useless waiter variable. Rewrite wait for
2643 input_available_event to use a switch statement. Handle timeout and
2644 failure more gracefully. Make restartable and cancelable. Rewrite
2645 wait for input_mutex to use WFMO and a switch statement. Handle
2646 timeout and failure more gracefully. Make restartable and cancelable.
2648 2011-05-02 Christopher Faylor <me.cygwin2011@cgf.cx>
2650 * signal.cc (_pinfo::kill): Avoid referencing 'pid' after ESRCH.
2652 2011-05-02 Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
2654 * cygwin.din (pthread_attr_getstack): Export.
2655 (pthread_attr_getstackaddr): Export.
2656 (pthread_getattr_np): Export.
2657 * ntdll.h (enum _THREAD_INFORMATION_CLASS): Add ThreadBasicInformation.
2658 (struct _THREAD_BASIC_INFORMATION): Define.
2659 (NtQueryInformationThread): Declare.
2660 * posix.sgml (std-susv4): Add pthread_attr_getstack.
2661 (std-gnu): Add pthread_getattr_np.
2662 (std-deprec): Add pthread_attr_getstackaddr.
2663 (std-notimpl): Remove pthread_attr_[gs]etstackaddr, as they were
2665 * thread.cc (pthread_attr::pthread_attr): Initialize stackaddr.
2666 (pthread_attr_getstack): New function.
2667 (pthread_attr_getstackaddr): New function.
2668 (pthread_attr_setstacksize): Return EINVAL if passed size less than
2669 PTHREAD_STACK_MIN, as required by POSIX.
2670 (pthread_getattr_np): New function.
2671 * thread.h (class pthread_attr): Add stackaddr member.
2672 * include/pthread.h (pthread_attr_getstack): Declare.
2673 (pthread_attr_getstackaddr): Declare unconditionally.
2674 (pthread_attr_setstack): Declare inside false conditional for reference.
2675 (pthread_getattr_np): Declare.
2676 * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump.
2678 2011-05-02 Christopher Faylor <me.cygwin2011@cgf.cx>
2680 * Makefile.in: Allow CFLAGS to be overridden from the environment.
2682 2011-05-02 Corinna Vinschen <corinna@vinschen.de>
2684 * thread.cc (cancelable_wait): Remove test for main thread.
2685 * fhandler_fifo.cc (fhandler_fifo::open_nonserver): Ditto.
2687 2011-05-02 Corinna Vinschen <corinna@vinschen.de>
2689 * fhandler_tty.cc (andler_pty_master::process_slave_output): Make
2690 interruptible and cancelable. Fix nonblocking case.
2692 2011-05-02 Corinna Vinschen <corinna@vinschen.de>
2694 * fhandler_console.cc (fhandler_console::read): Make restartable and
2697 2011-05-02 Christopher Faylor <me.cygwin2011@cgf.cx>
2699 * strace.cc (strace::vprntf): Avoid closing unopened handle.
2701 2011-05-02 Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
2703 * sysconf.cc (sca): Set _SC_SPIN_LOCKS to _POSIX_SPIN_LOCKS.
2705 2011-05-02 Christopher Faylor <me.cygwin2011@cgf.cx>
2707 * dll_init.cc (dll_list::alloc): Reset 'p' in forked process.
2709 * select.cc (select_stuff::wait): Move cleanup() closer to WFMO to
2710 minimize unavoidable (?) race.
2712 2011-05-02 Corinna Vinschen <corinna@vinschen.de>
2714 * fhandler_serial.cc (fhandler_serial::raw_read): Add restartability
2715 after a signal. Add cancelability.
2716 (fhandler_serial::raw_write): Wait for write to succeed if O_NONBLOCK
2717 is not set. Add signal handling and cancelability.
2719 2011-05-01 Corinna Vinschen <corinna@vinschen.de>
2721 * fhandler_windows.cc (fhandler_windows::read): Use
2722 pthread::get_cancel_event to fetch thread's cancel event.
2723 * flock.cc (lf_setlock): Ditto.
2724 * posix_ipc.cc (ipc_cond_timedwait): Ditto.
2725 * thread.cc (pthread::get_cancel_event): New static method.
2726 * thread.h (pthread::get_cancel_event): Declare.
2728 2011-05-01 Corinna Vinschen <corinna@vinschen.de>
2730 * libc/minires-os-if.c (get_dns_info): Remove unnecessary test for
2731 existence of DnsQuery_A.
2733 2011-05-01 Corinna Vinschen <corinna@vinschen.de>
2735 Throughout, use user32 UNICODE functions rather than ANSI functions.
2736 * autoload.cc: Convert all definitions for ANSI user32 functions to
2737 definitions for the corresponding UNICODE function.
2738 (SendMessageA): Remove.
2739 (SendNotifyMessageW): Define.
2740 * fhandler.h (fhandler_windows::is_slow): Remove.
2741 * fhandler_windows.cc (fhandler_windows::write): Use SendNotifyMessageW
2742 call rather than SendMessage to make function always return immediately.
2743 (fhandler_windows::read): Make function interruptible and a cancellation
2744 point. Handle O_NONBLOCK.
2745 * select.cc (peek_serial): Don't wait for signal_arrived here.
2746 * window.cc (wininfo::winthread): Call CreateWindowExW directly rather
2747 than CreateWindow wrapper.
2749 2011-05-01 Corinna Vinschen <corinna@vinschen.de>
2751 * net.cc (fdsock): Drop setting uninterruptible_io to true.
2753 2011-05-01 Corinna Vinschen <corinna@vinschen.de>
2755 * fhandler.h (fhandler_socket::is_slow): Remove.
2757 2011-04-30 Corinna Vinschen <corinna@vinschen.de>
2759 * fcntl.cc (fcntl64): Call pthread_testcancel.
2760 * fhandler_socket.cc (fhandler_socket::connect): Ditto.
2761 (fhandler_socket::accept4): Ditto.
2762 (fhandler_socket::recvfrom): Ditto.
2763 (fhandler_socket::recvmsg): Ditto.
2764 (fhandler_socket::sendto): Ditto.
2765 (fhandler_socket::sendmsg): Ditto.
2766 * flock.cc (lf_setlock): Allow to cancel thread running blocking
2767 file lock. Try to make code more readable.
2768 (lockf): Call pthread_testcancel.
2769 * mmap.cc (msync): Ditto.
2770 * posix_ipc.cc (ipc_cond_timedwait): Call pthread::static_cancel_self
2771 rather than pthread_testcancel.
2772 * select.cc (cygwin_select): Call pthread_testcancel.
2773 * syscalls.cc (pread): Ditto.
2780 * termios.cc (tcdrain): Ditto.
2781 * thread.cc: Align list of cancellation points with above changes.
2782 Mark not-implemented functions, too.
2783 (cancelable_wait): Don't set unused object indices to WAIT_FAILED
2784 since that could result in wrong behaviour. Set them to the invalid
2785 value WAIT_TIMEOUT + 1 instead.
2787 2011-04-30 Corinna Vinschen <corinna@vinschen.de>
2789 * thread.h (class pthread): Add bool member canceled.
2790 * thread.cc (pthread::pthread): Initialize canceled to false.
2791 (pthread::cancel): Set canceled before setting cancel_event.
2792 (pthread::testcancel): Check for canceled. Only wait for cancel_event
2793 if canceled is true. Explain why.
2794 (pthread::_fixup_after_fork): Set canceled to false.
2796 2011-04-29 Corinna Vinschen <corinna@vinschen.de>
2798 * errno.cc (errmap): Sort. Map ERROR_EXE_MACHINE_TYPE_MISMATCH to
2801 2011-04-29 Corinna Vinschen <corinna@vinschen.de>
2803 * thread.cc: Update comment listing cancellation points per POSIX.
2805 2011-04-29 Corinna Vinschen <corinna@vinschen.de>
2807 * advapi32.cc: Add comment.
2810 (AddAccessAllowedAce): Remove.
2811 (AddAccessDeniedAce): Remove.
2812 (MakeSelfRelativeSD): Remove.
2813 * flock.cc: Replace above functions throughout with their ntdll.dll
2815 * sec_acl.cc: Ditto.
2816 * sec_auth.cc: Ditto.
2817 * sec_helper.cc: Ditto.
2818 * security.cc: Ditto.
2819 * security.h: Ditto.
2820 (RtlEqualSid): Declare. Explain why.
2821 (RtlCopySid): Ditto.
2823 2011-04-29 Corinna Vinschen <corinna@vinschen.de>
2825 * advapi32.cc (AccessCheck): Remove.
2826 (PrivilegeCheck): Remove.
2827 (OpenThreadToken): Remove.
2828 * fhandler_tty.cc: Replace above functions throughout with their
2829 ntdll.dll equivalent.
2830 * security.cc: Ditto.
2832 2011-04-29 Corinna Vinschen <corinna@vinschen.de>
2834 * ntdll.h (IsEventSignalled): New inline function.
2835 * cygthread.cc (cygthread::terminate_thread): Use IsEventSignalled in
2836 place of WaitForSingleObject on event with 0 timeout.
2837 * fhandler.cc (fhandler_base_overlapped::has_ongoing_io): Ditto.
2838 * fhandler_fifo.cc (fhandler_fifo::open_nonserver): Ditto.
2839 (fhandler_fifo::wait): Ditto.
2840 * fhandler_termios.cc (fhandler_termios::bg_check): Ditto.
2841 * select.cc (verify_tty_slave): Ditto.
2842 * thread.cc (pthread::testcancel): Ditto.
2844 2011-04-29 Corinna Vinschen <corinna@vinschen.de>
2846 * advapi32.cc (GetTokenInformation): Remove.
2847 (SetTokenInformation): Remove.
2848 * grp.cc: Replace above functions throughout with their ntdll.dll
2850 * sec_auth.cc: Ditto.
2851 * syscalls.cc: Ditto.
2854 2011-04-29 Corinna Vinschen <corinna@vinschen.de>
2856 * posix_ipc.cc (ipc_cond_timedwait): Only wait for pthread's
2857 cancel_event if thread's cancelability isn't disabled.
2859 2011-04-28 Corinna Vinschen <corinna@vinschen.de>
2861 * advapi32.cc (SetSecurityDescriptorDacl): Remove.
2862 (SetSecurityDescriptorGroup): Remove.
2863 (SetSecurityDescriptorOwner): Remove.
2864 * pinfo.cc: Replace above functions throughout with their ntdll.dll
2866 * sec_acl.cc: Ditto.
2867 * sec_helper.cc: Ditto.
2868 * security.cc: Ditto.
2870 * sec_helper.cc (__sec_user): Remove old comment.
2872 2011-04-28 Corinna Vinschen <corinna@vinschen.de>
2874 * posix_ipc.cc (ipc_cond_timedwait): Also wait for pthread's
2875 cancel_event, if any. Call pthread_testcancel if cancel_event has been
2878 2011-04-28 Corinna Vinschen <corinna@vinschen.de>
2880 * posix_ipc.cc (ipc_cond_timedwait): Remove pthread_testcancel calls.
2881 (_mq_send): Add pthread_testcancel call at start of function.
2882 (_mq_receive): Ditto.
2884 2011-04-28 Corinna Vinschen <corinna@vinschen.de>
2886 * cygerrno.h (geterrno_from_nt_status): Declare.
2887 * errno.cc (geterrno_from_nt_status): Define.
2888 * flock.cc: Fix copyright dates.
2889 * ntdll.h (enum _TIMER_TYPE): Define.
2890 (PTIMER_APC_ROUTINE): Define.
2891 (NtCancelTimer): Declare.
2892 (NtCreateTimer): Declare.
2893 (NtSetTimer): Declare.
2894 * posix_ipc.cc (ipc_cond_timedwait): Rewrite to make interruptible and
2895 restartable. Call pthread_testcancel in case of timeout to enable
2896 pthread_cancel on waiting thread. Replace WFMO timeout with waiting
2897 for a waitable timer. Explain why. Replace single call to WFMO with
2898 two calls, one for the event, one for the mutex. Don't lock mutex in
2900 (ipc_cond_signal): Make void function.
2901 (ipc_cond_close): Ditto.
2902 (_mq_send): Immediately return -1 in case of error from
2904 (_mq_receive): Ditto.
2906 2011-04-28 Corinna Vinschen <corinna@vinschen.de>
2908 * advapi32.cc (GetSecurityDescriptorDacl): Remove.
2909 (GetSecurityDescriptorGroup): Remove.
2910 (GetSecurityDescriptorOwner): Remove.
2911 * sec_acl.cc: Replace above functions throughout with their ntdll.dll
2912 equivalent. Remove redundant debug output.
2913 * sec_auth.cc: Ditto.
2914 * security.cc: Ditto.
2917 2011-04-28 Corinna Vinschen <corinna@vinschen.de>
2919 * advapi32.cc (InitializeAcl): Remove.
2921 (FindFirstFreeAce): Remove.
2923 (InitializeSecurityDescriptor): Remove.
2924 (OpenProcessToken): Remove.
2925 * dcrt0.cc: Replace above functions throughout with their ntdll.dll
2927 * fhandler_tty.cc: Ditto.
2929 * pinfo.cc: Ditto. Drop unnecessary error handling.
2930 * sec_acl.cc: Ditto.
2931 * sec_auth.cc: Ditto.
2932 * sec_helper.cc: Ditto.
2933 * security.cc: Ditto.
2935 2011-04-28 Corinna Vinschen <corinna@vinschen.de>
2937 * advapi32.cc (InitializeSid): Remove.
2938 (EqualPrefixSid): Remove.
2939 (GetLengthSid): Remove.
2940 (GetSidSubAuthority): Remove.
2941 (GetSidSubAuthorityCount): Remove.
2942 (GetSidIdentifierAuthority): Remove.
2943 * fhandler_disk_file.cc: Replace above functions throughout with their
2944 ntdll.dll equivalent.
2945 * sec_auth.cc: Ditto.
2946 * sec_helper.cc: Ditto.
2947 * security.cc: Ditto.
2949 2011-04-28 Corinna Vinschen <corinna@vinschen.de>
2951 * advapi32.cc (AllocateLocallyUniqueId): Remove.
2952 * fhandler_disk_file.cc (fhandler_base::open_fs): Replace call to
2953 AllocateLocallyUniqueId with call to NtAllocateLocallyUniqueId;
2954 * posix_ipc.cc (mq_open): Ditto. Drop error handling for that call.
2957 2011-04-28 Corinna Vinschen <corinna@vinschen.de>
2959 * autoload.cc (GetSecurityInfo): Remove.
2960 * ntdll.h (RtlConvertToAutoInheritSecurityObject): Declare.
2961 (RtlDeleteSecurityObject): Declare.
2962 (RtlGetControlSecurityDescriptor): Declare.
2963 (RtlLengthSecurityDescriptor): Declare.
2964 * security.cc (file_mapping): New global variable.
2965 (get_file_sd): Rewrite. Clean up code. Get rid of GetSecurityInfo
2967 (alloc_sd): Call RtlSetControlSecurityDescriptor to set
2968 SE_DACL_PROTECTED flag.
2969 (check_file_access): Remove mapping. Use file_mapping instead.
2970 (check_registry_access): Rename mapping to reg_mapping.
2971 * wincap.cc: Througout, drop use_get_sec_info_on_dirs,
2972 * wincap.h (struct wincaps): Drop use_get_sec_info_on_dirs.
2974 2011-04-24 Corinna Vinschen <corinna@vinschen.de>
2976 * include/fenv.h: Add missing _FENV_H_ define.
2978 2011-04-23 Corinna Vinschen <corinna@vinschen.de>
2980 * registry.cc (reg_key::get_dword): Rename from get_int, use DWORD
2981 rather than int type. Avoid compiler warning.
2982 (reg_key::set_dword): Rename from set_int, use DWORD rather than int
2983 type. Change return type to NTSTATUS.
2984 (reg_key::get_string): Change return type to NTSTATUS.
2985 (reg_key::set_string): Ditto.
2986 * registry.h: Accommodate above changes.
2987 * environ.cc (regopt): Test return value of reg_key::get_string as
2989 * sched.cc (sched_rr_get_interval): Change local int vars to DWORD.
2990 Call reg_key::get_dword instead of reg_key::get_int.
2991 * shared.cc (init_installation_root): Test return value of
2992 reg_key::get_string as NTSTATUS.
2993 (shared_info::heap_slop_size): Call reg_key::get_dword rather than
2995 (shared_info::heap_chunk_size): Ditto.
2996 * shared_info.h (CURR_SHARED_MAGIC): Update.
2997 (class shared_info): Change heap_chunk and heap_slop to DWORD values.
2999 2011-04-21 Corinna Vinschen <corinna@vinschen.de>
3001 * cygtls.cc (_cygtls::init_thread): Drop setting locals.process_logmask.
3002 * cygtls.cc (_cygtls::remove): Always free mallocated TLS storage on
3003 thread exit. Drop freeing locals.process_ident.
3004 * cygtls.h (struct _local_storage): Remove syslog-related members.
3005 * syslog.cc (syslog_globals): New static storage for global syslog
3006 settings. Use throughout instead of _my_tls.locals.
3007 (openlog): Set new syslog_globals.process_ident value more carefully.
3008 * tlsoffsets.h: Regenerate.
3010 2011-04-21 Thomas Stalder <cygwinml@gmail.com>
3012 * include/sys/poll.h: Include signal.h to get definition of sigset_t.
3014 2011-04-20 Christopher Faylor <me.cygwin2011@cgf.cx>
3016 * cygheap.cc (init_cygheap::close_ctty): Avoid closing console-cttys
3017 since they don't use archetypes and this will just result in double
3019 * dll_init.cc (dll_list::protect): Define.
3020 (dll_list::alloc): Guard list access.
3021 (dll_list::detach): Ditto.
3022 * dll_init.h (dll_list::protect): Declare new muto.
3023 (dll_list::guard): Define/declare function to guard list access.
3024 * fhandler_termios.cc (fhandler_termios::sigflush): Avoid SEGV in
3025 pathological condition of get_ttyp() == NULL.
3027 2011-04-20 Christopher Faylor <me.cygwin2011@cgf.cx>
3029 * select.cc (serial_cleanup): Make sure that device_specific_pipe is
3030 always deleted regardless of whether it has a unique thread associated
3032 (socket_cleanup): Ditto.
3033 (mailslot_cleanup): Ditto.
3035 2011-04-20 Corinna Vinschen <corinna@vinschen.de>
3037 * devices.h: Renumber internal devices so that FH_PROCESS is part of
3038 the /proc family of virtual devices.
3039 (FH_PROC_MAX_MINOR): Define.
3040 * path.h (isproc_dev): Use FH_PROC_MAX_MINOR rather than FH_PROC.
3042 2011-04-19 Peter Rosin <peda@lysator.liu.se>
3044 * select.cc (pipe_cleanup): Make sure that device_specific_pipe is
3045 always deleted regardless of whether it has a unique thread associated
3048 2011-04-19 Jon TURNEY <jon.turney@dronecode.org.uk>
3050 * thread.cc (semaphore::init): We cannot reliably infer anything from
3051 the existing contents of sem, so merely warn rather than return EBUSY
3052 if it looks like we are reinitialising a semaphore.
3054 2011-04-19 Corinna Vinschen <corinna@vinschen.de>
3056 * autoload.cc (GetConsoleWindow): Drop.
3057 (GetSystemWindowsDirectoryW): Drop.
3058 * fhandler_console.cc (beep): Call GetSystemWindowsDirectoryW instead of
3059 GetWindowsDirectoryW.
3060 * uinfo.cc (cygheap_user::env_systemroot): Call
3061 GetSystemWindowsDirectoryW and convert to multibyte on the fly.
3062 * winlean.h (GetWindowsDirectoryW): Redefine to something invalid.
3065 2011-04-19 Corinna Vinschen <corinna@vinschen.de>
3067 * Makefile.in (DLL_IMPORTS): Drop advapi32.dll.
3068 * autoload.cc: Enable autoloading advapi32 functions.
3069 * environ.cc (regopt): Use wide char arguments in reg_key functions.
3070 * fhandler_console.cc (beep): Ditto. Use WCHAR throughout.
3071 * registry.cc (reg_key): Rewrite reg_key class to use native NT registry
3072 functions. Use WCHAR string parameters throughout. Use PCWSTR rather
3073 than const WCHAR. Drop multibyte char functionality. Drop unused
3075 (get_registry_hive_path): Use RtlQueryRegistryValues to fetch path from
3077 (load_registry_hive): Drop useless check for user hive being available.
3078 Load hive using NtLoadKey.
3079 * registry.h: Accommodate above changes.
3080 * sched.cc (sched_rr_get_interval): Use wide char arguments in reg_key
3082 * shared.cc (init_installation_root): Ditto.
3083 (shared_info::init_obcaseinsensitive): Use RtlQueryRegistryValues to
3084 fetch obcaseinsensitive value.
3085 (shared_info::heap_slop_size): Use wide char arguments in reg_key
3087 (shared_info::heap_chunk_size): Ditto.
3088 * syscalls.cc (gethostid): Ditto.
3089 * winsup.h (__WIDE): Define.
3091 * libc/minires-os-if.c (get_registry_dns_items): Don't fetch values
3092 from registry. Just extract them from given UNICODE_STRING parameter.
3093 (get_registry_dns): Fetch all registry values at once using
3094 RtlQueryRegistryValues.
3096 2011-04-19 Corinna Vinschen <corinna@vinschen.de>
3098 * net.cc (get_ipv4fromreg_ipcnt): Rearrange to fetch all registry
3099 values at once using RtlQueryRegistryValues.
3100 (get_ipv4fromreg): Ditto.
3102 2011-04-19 Corinna Vinschen <corinna@vinschen.de>
3104 * fhandler_registry.cc (fhandler_registry::fstat): Use RegQueryInfoKeyW.
3106 2011-04-19 Corinna Vinschen <corinna@vinschen.de>
3108 * fhandler_proc.cc (read_value): Remove definition.
3110 (format_proc_cpuinfo): Drop useless call to GetSystemInfo. Rearrange
3111 to use Rtl registry functions. Rename dwOldThreadAffinityMask to
3114 2011-04-18 Corinna Vinschen <corinna@vinschen.de>
3116 * localtime.cc (tzload): Don't change global timezone information
3117 when called from gmtime or gmtime_r.
3120 2011-04-18 Corinna Vinschen <corinna@vinschen.de>
3122 * cygtls.cc (_cygtls::remove): Always close sockevt handle.
3124 2011-04-18 Corinna Vinschen <corinna@vinschen.de>
3126 * cygwin.din (ppoll): Export.
3127 * poll.cc (ppoll): Implement.
3128 * posix.sgml (std-gnu): Add ppoll.
3129 * include/cygwin/version.h: Bump API minor number.
3130 * include/sys/poll.h (ppoll): Declare.
3132 2011-04-18 Corinna Vinschen <corinna@vinschen.de>
3134 * fhandler_socket.cc (fhandler_socket::evaluate_events): Handle the
3135 FD_CLOSE event specially when called from accept. Explain why.
3136 (fhandler_socket::shutdown): Fake success on not-connected socket and
3137 trigger socket event if the read side of a socket is affected. Explain
3139 * poll.cc (poll): Check for saw_shutdown_read on sockets to generate
3142 2011-04-18 Corinna Vinschen <corinna@vinschen.de>
3144 * Fix various copyrights.
3146 2011-04-17 Christopher Faylor <me.cygwin2011@cgf.cx>
3148 * signal.cc (_pinfo::kill): Set this_process_state when process
3151 2011-04-17 Christopher Faylor <me.cygwin2011@cgf.cx>
3153 * signal.cc (_pinfo::kill): Return 0 when attempting to test for
3154 existence of an existed process which has not yet been reaped.
3156 2011-04-17 Christopher Faylor <me.cygwin2011@cgf.cx>
3158 * cygheap.h (init_cygheap::ctty): Use base class so that console can
3160 * dtable.cc (dtable::stdio_init): Remove special-case call to
3161 set_console_ctty ().
3162 * exceptions.cc (sigpacket::process): Conditionally flush terminal
3163 input on certain signals.
3164 * fhandler.h (fhandler_console::get_tty_stuff): Make non-static.
3165 (fhandler_termios::get_ttyp): Move here.
3166 (fhandler_termios::sigflush): Declare.
3167 (fhandler_tty_common::get_ttyp): Delete.
3168 * fhandler_console.cc (fhandler_console::get_tty_stuff): Pass this as
3170 (set_console_ctty): Delete.
3171 (tty_list::get_tty): Just return pointer to shared console region,
3172 delaying get_tty_stuff until open().
3173 (fhandler_console::init): Treat NULL handle as signifying that console
3174 should be opened with O_NOCTTY flag. Rename handle argument to the
3176 * fhandler_termios.cc (fhandler_termios::sigflush): Define.
3177 * fhandler_tty.cc (handler_tty_master::init_console): Pass NULL as
3178 first argument to fhandler_console::init.
3179 * pinfo.cc (_pinfo::set_ctty): Change third parameter to
3180 fhandler_termios *. Add extra debugging.
3181 * pinfo.h (_pinfo::set_ctty): Change third parameter to
3184 * sigproc.cc (handle_sigsuspend): Don't special-case non-main threads.
3186 2011-04-15 Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
3188 * thread.cc (pthread_setschedprio): New function.
3189 * include/pthread.h (pthread_setschedprio): Declare.
3190 * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump.
3191 * cygwin.din (pthread_setschedprio): Export.
3192 * posix.sgml (std-notimpl) Move pthread_setschedprio from here...
3193 (std-susv4) ...to here.
3195 2011-04-10 Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
3197 * fhandler_proc.cc (proc_tab): Add /proc/swaps virtual file.
3198 (format_proc_swaps): New function.
3200 2011-04-06 Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
3202 * Makefile.in: Move srcdir definition before others which uses it.
3204 2011-04-06 Jon TURNEY <jon.turney@dronecode.org.uk>
3206 * dll_init.cc (reserve_at, release_at): New functions.
3207 (load_after_fork): If the DLL was loaded higher than the required
3208 address, assume that it loaded at it's base address and also reserve
3209 memory there to force it to be relocated.
3211 2011-04-04 Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
3213 * include/cygwin/types.h: Move #include <sys/sysmacros.h> to
3214 end of header so that it gets the dev_t typedef.
3215 * include/sys/sysmacros.h (gnu_dev_major, gnu_dev_minor,
3216 gnu_dev_makedev): Prototype and define as inline functions.
3217 (major, minor, makedev): Redefine in terms of gnu_dev_*.
3219 2011-04-04 Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
3221 * include/cygwin/types.h: Move multiple inclusion guards to
3222 beginning and end of header.
3224 2011-04-04 Christopher Faylor <me.cygwin2011@cgf.cx>
3226 * Makefile.in: Move Makefile.common include earlier to fix problems
3227 with relative ${srcdir} path which confuses make.
3229 2011-04-04 Corinna Vinschen <corinna@vinschen.de>
3232 * autoload.cc (DnsQuery_A): Fatal if not available.
3233 (DnsRecordListFree): Ditto.
3234 (DsGetDcNameW): Ditto.
3235 (NetGetAnyDCName): Remove.
3236 (NetGetDCName): Remove.
3237 (EnumProcessModules): Fatal if not available.
3238 (GetModuleFileNameExW): Ditto.
3239 (GetModuleInformation): Ditto.
3240 (GetProcessMemoryInfo): Ditto.
3241 (QueryWorkingSet): Ditto.
3242 (LsaRegisterLogonProcess): Ditto.
3243 * fenv.cc (_feinitialise): Drop supports_sse condition.
3244 * fhandler_disk_file.cc (path_conv::isgood_inode): Fix comment.
3245 (fhandler_base::fstat_by_name): Drop has_fileid_dirinfo condition.
3246 (fhandler_disk_file::opendir): Ditto.
3247 * fhandler_netdrive.cc (fhandler_netdrive::readdir): Fix comment.
3248 * fhandler_proc.cc (format_proc_partitions): Drop NT4-only code.
3249 * fhandler_process.cc (get_process_state): Ditto.
3250 * kernel32.cc (GetWindowsDirectoryW): Remove.
3251 (GetWindowsDirectoryA): Remove.
3252 * miscfuncs.cc (nice_to_winprio): Drop NT4-only code.
3253 * mount.cc (fs_info::update): Fix comments.
3254 * net.cc (get_2k_ifs): Drop NT4-only code.
3255 * sec_auth.cc (get_logon_server): Ditto.
3256 (lsaauth): Drop NT4-specific error handling.
3257 * security.cc (alloc_sd): Set SE_DACL_PROTECTED unconditionally.
3258 * select.cc (select_stuff::wait): Always use MWMO_INPUTAVAILABLE.
3259 (peek_windows): Drop NT4-only condition in call to PeekMessage.
3260 * syscalls.cc (gethostid): Remove NT4-only workaround.
3261 * wincap.cc: Througout, drop has_dacl_protect,
3262 has_broken_if_oper_status, has_process_io_counters,
3263 has_terminal_services, has_extended_priority_class, has_guid_volumes,
3264 has_fileid_dirinfo, has_mwmo_inputavailable and supports_sse from
3266 (wincap_nt4sp4): Remove.
3267 (wincap_minimal): Set to wincap_2000.
3268 (wincapc::init): Rely on availability of OSVERSIONINFOEX structure.
3269 Treat error from GetVersionEx as fatal. Treat NT4 as fatal.
3270 * wincap.h (struct wincaps): Drop has_dacl_protect,
3271 has_broken_if_oper_status, has_process_io_counters,
3272 has_terminal_services, has_extended_priority_class, has_guid_volumes,
3273 has_fileid_dirinfo, has_mwmo_inputavailable and supports_sse flags
3275 * winlean.h (GetWindowsDirectoryW) Define as GetSystemWindowsDirectoryW.
3276 (GetWindowsDirectoryA): Define as GetSystemWindowsDirectoryA.
3278 2011-04-04 Corinna Vinschen <corinna@vinschen.de>
3280 * dtable.cc (dtable::init_std_file_from_handle): Fix a comment to
3281 reflect the current state.
3283 2011-04-04 Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
3285 * Makefile.in (fhandler_proc_CFLAGS): Define USERNAME, HOSTNAME,
3287 * fhandler_proc.cc (format_proc_version): Add build machine and GCC
3288 version information as on Linux.
3290 2011-04-04 Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
3291 Corinna Vinschen <corinna@vinschen.de>
3293 * devices.h (fh_devices): Define FH_PROC_MIN_MINOR.
3294 Reorder major-0 devices so that all /proc directories fall
3295 between FH_PROC and FH_PROC_MIN_MINOR.
3296 * path.h (isproc_dev): Redefine accordingly.
3298 2011-04-04 Corinna Vinschen <corinna@vinschen.de>
3300 * cygserver_setpwd.h (setlsapwd): Add username parameter to declaration.
3301 * external.cc (cygwin_internal): In the CW_SET_PRIV_KEY case, fetch
3302 additional username parameter.
3303 * setlsapwd.cc (setlsapwd): Add username parameter. Allow admin to
3304 set the hidden password for other users.
3306 2011-04-04 Corinna Vinschen <corinna@vinschen.de>
3308 * sec_auth.cc (get_user_groups): Mark well-known groups as well-known.
3309 (get_user_local_groups): Ditto.
3310 (verify_token): Drop useless label.
3311 * sec_helper.cc (cygsid::get_sid): Check for well-known SID if
3312 well_known isn't set.
3313 * security.h (well_known_sid_type): New inline function.
3315 2011-04-02 Corinna Vinschen <corinna@vinschen.de>
3317 * autoload.cc (FindFirstVolumeA): Remove.
3318 (FindNextVolumeA): Remove.
3319 (FindVolumeClose): Remove.
3320 (GetVolumeNameForVolumeMountPointA): Remove.
3321 * ntdll.h (NtFlushBuffersFile): Declare.
3322 * syscalls.cc (sync_worker): Rewrite using native NT functions.
3325 2011-04-02 Corinna Vinschen <corinna@vinschen.de>
3327 * fhandler_proc.cc (format_proc_partitions): Express length in WCHAR
3330 2011-04-02 Corinna Vinschen <corinna@vinschen.de>
3332 * autoload.cc (GetExtendedTcpTable): Remove.
3333 (GetTcpTable): Remove.
3334 (CharNextExA): Remove.
3335 (FindWindowA): Remove.
3336 (ShowWindowAsync): Remove.
3337 * dcrt0.cc (disable_dep): Remove unused function.
3338 (dll_crt0_0): Drop comment babbling about TS & DEP.
3339 * fhandler_socket.cc (address_in_use): Remove unused function.
3340 * wincap.cc: Throughout, drop ts_has_dep_problem from wincaps.
3341 (wincapc::init): Drop code setting ts_has_dep_problem flag.
3342 * wincap.h (struct wincaps): Drop ts_has_dep_problem flags and method.
3344 2011-04-01 Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
3346 Implement /proc/sysvipc/*
3347 * devices.in (dev_procsysvipc_storage): Add.
3348 * devices.cc: Regenerate.
3349 * devices.h (fh_devices): Add FH_PROCSYSVIPC.
3350 * dtable.cc (build_fh_pc): Add case FH_PROCSYSVIPC.
3351 * fhandler.h (class fhandler_procsysvipc): Declare.
3352 (fhandler_union): Add __procsysvipc.
3353 * fhandler_proc.cc (proc_tab): Add sysvipc virt_directory.
3354 * fhandler_procsysvipc.cc: New file.
3355 * Makefile.in (DLL_OFILES): Add fhandler_procsysvipc.o.
3356 * path.h (isproc_dev): Add FH_PROCSYSVIPC to conditional.
3358 2011-04-01 Corinna Vinschen <corinna@vinschen.de>
3360 * Makefile.in (DLL_OFILES): Add avapi32.o.
3361 * advapi32.cc: New file.
3362 * autoload.cc: Add block of remaining advapi32 functions used by
3363 Cygwin. Keep commented out. Explain why.
3365 2011-04-01 Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
3367 * fhandler_proc.cc (format_proc_loadavg): Add running/total
3368 processes as fourth component of output.
3369 * fhandler_process.cc (get_process_state): Make non-static.
3370 Add FIXME about generating an 'O' flag.
3372 2011-04-01 Corinna Vinschen <corinna@vinschen.de>
3374 * fhandler_random.cc (fhandler_dev_random::crypt_gen_random):
3375 Use CryptAcquireContextW.
3376 * ntdll.h (STATUS_PROCEDURE_NOT_FOUND): Define.
3377 * sec_auth.cc (open_local_policy): Rename NTSTATUS variable ret to
3378 status. Drop usage of LsaNtStatusToWinError.
3379 (verify_token): Call NtQuerySecurityObject instead of
3380 GetKernelObjectSecurity.
3381 (create_token): Rename NTSTATUS variable ret to status. Rename ret2 to
3382 sub_status. Drop usage of LsaNtStatusToWinError. In case LsaLogonUser
3383 fails, report the sub_status as well.
3385 2011-04-01 Corinna Vinschen <corinna@vinschen.de>
3387 * libc/strptime.c: Remove misleading comment.
3389 2011-03-31 Corinna Vinschen <corinna@vinschen.de>
3391 * ntdll.h: Allow usage from plain C code.
3392 (FSCTL_PIPE_IMPERSONATE): Define.
3393 (enum _THREAD_INFORMATION_CLASS): Define.
3394 (RTL_QUERY_REGISTRY_xxx): Define.
3395 (RTL_REGISTRY_xxx): Define.
3396 (PRTL_QUERY_REGISTRY_ROUTINE): Define.
3397 (struct _RTL_QUERY_REGISTRY_TABLE): Define.
3398 (enum _KEY_VALUE_INFORMATION_CLASS): Define.
3399 (struct _KEY_VALUE_PARTIAL_INFORMATION): Define.
3400 (NtAccessCheck): Declare.
3401 (NtAllocateLocallyUniqueId): Declare.
3402 (NtCreateKey): Declare.
3403 (NtDuplicateToken): Declare.
3404 (NtLoadKey): Declare.
3405 (NtOpenKey): Declare.
3406 (NtOpenProcessToken): Declare.
3407 (NtOpenThreadToken): Declare.
3408 (NtPrivilegeCheck): Declare.
3409 (NtQueryInformationToken): Declare.
3410 (NtQueryValueKey): Declare.
3411 (NtSetInformationThread): Declare.
3412 (NtSetInformationToken): Declare.
3413 (NtSetValueKey): Declare.
3414 (RtlAbsoluteToSelfRelativeSD): Declare.
3415 (RtlAddAccessAllowedAce): Declare.
3416 (RtlAddAccessDeniedAce): Declare.
3417 (RtlAddAce): Declare.
3418 (RtlCheckRegistryKey): Declare.
3419 (RtlCopySid): Declare.
3420 (RtlCreateAcl): Declare.
3421 (RtlCreateRegistryKey): Declare.
3422 (RtlCreateSecurityDescriptor): Declare.
3423 (RtlEqualPrefixSid): Declare.
3424 (RtlEqualSid): Declare.
3425 (RtlFirstFreeAce): Declare.
3426 (RtlGetAce): Declare.
3427 (RtlGetDaclSecurityDescriptor): Declare.
3428 (RtlGetGroupSecurityDescriptor): Declare.
3429 (RtlGetOwnerSecurityDescriptor): Declare.
3430 (RtlIdentifierAuthoritySid): Declare.
3431 (RtlInitializeSid): Declare.
3432 (RtlLengthSid): Declare.
3433 (RtlQueryRegistryValues): Declare.
3434 (RtlSetControlSecurityDescriptor): Declare.
3435 (RtlSetDaclSecurityDescriptor): Declare.
3436 (RtlSetGroupSecurityDescriptor): Declare.
3437 (RtlSetOwnerSecurityDescriptor): Declare.
3438 (RtlSubAuthorityCountSid): Declare.
3439 (RtlSubAuthoritySid): Declare.
3440 (RtlWriteRegistryValue): Declare.
3442 2011-03-31 Corinna Vinschen <corinna@vinschen.de>
3444 * uinfo.cc (cygheap_user::init): Don't call GetUserName. Fetch username
3445 from Windows environment instead. Explain why.
3446 (cygheap_user::env_domain): Use MAX_DOMAIN_NAME_LEN rather than DNLEN
3447 to specify the size of the domain name buffer.
3449 2011-03-30 Corinna Vinschen <corinna@vinschen.de>
3451 * hires.h: Fix copyright.
3453 (FACTOR): Add comment.
3455 (JITTER): New definition. Comment.
3456 (systime_ns): Avoid gratuitous copying of the value returned by
3457 GetSystemTimeAsFileTime.
3458 (corelocaltime, localtime, gmtime): Remove very old, unused code block.
3459 (cygwin_tzset): Remove.
3460 (hires_ms::timeGetTime_ns): Add missing semicolon in comment.
3461 (hires_ms::nsecs): Redefine check for difference between internal
3462 timer value and system time.
3464 2011-03-30 Corinna Vinschen <corinna@vinschen.de>
3466 * times.cc (hires_ms::resolution): Make sure resolution is never 0.
3467 (clock_setres): Ditto.
3469 2011-03-29 Corinna Vinschen <corinna@vinschen.de>
3471 * cygtls.h (struct _local_storage): Redefine process_ident as wchar_t
3473 * syslog.cc (CYGWIN_LOG_NAME): Convert to wide char constant.
3474 (openlog): Convert incoming ident string to wide char. Fix formatting.
3475 (vsyslog): Print ident string as wide char string. Convert message
3476 string to wide char and call UNICODE Win32 Event functions to make sure
3477 to use correct codeset.
3478 * tlsoffset.h: Regenerate.
3480 2011-03-29 Corinna Vinschen <corinna@vinschen.de>
3482 * fhandler_socket.cc (get_inet_addr): Make externally available.
3483 * autoload.cc (GetUdpTable): Define.
3484 * syslog.cc (connect_syslogd): Use get_inet_addr rather than _stat64
3485 to check for local socket file. Create socket with type returned by
3486 get_inet_addr. If connect on UDP socket works, test if there's
3487 really a listening peer, otherwise fall back to Windows event log.
3488 (try_connect_syslogd): Use syslogd_inited flag to check if syslogd
3491 2011-03-29 Corinna Vinschen <corinna@vinschen.de>
3493 * uinfo.cc (cygheap_user::env_domain): Use LookupAccountSidW and
3494 convert user and domain to multibyte strings to make sure to use
3497 2011-03-29 Corinna Vinschen <corinna@vinschen.de>
3499 * autoload.cc (UuidCreate): Remove.
3500 (UuidCreateSequential): Remove.
3501 * passwd.cc (internal_getpwsid): Avoid a strict-aliasing compiler
3502 error with gcc 4.5.1.
3503 * fhandler_floppy.cc (fhandler_dev_floppy::get_drive_info): Ditto.
3504 * ntdll.h (NtAllocateUuids): Declare.
3505 * syscalls.cc (gethostid): Use NtAllocateUuids function rather than
3506 UuidCreateSequential/UuidCreate to get rid of rpcrt4 dependency.
3508 2011-03-29 Corinna Vinschen <corinna@vinschen.de>
3510 * cygwin.din (pthread_spin_destroy): Export.
3511 (pthread_spin_init): Export.
3512 (pthread_spin_lock): Export.
3513 (pthread_spin_trylock): Export.
3514 (pthread_spin_unlock): Export.
3515 * posix.sgml (std-susv4): Add pthread_spin_destroy, pthread_spin_init,
3516 pthread_spin_lock, pthread_spin_trylock, pthread_spin_unlock.
3517 (std-notimpl): Remove pthread_spin_[...].
3518 * pthread.cc (pthread_spin_init): New function.
3519 * thread.cc (pthread_spinlock::is_good_object): New function.
3520 (pthread_mutex::pthread_mutex): Rearrange initializers to accommodate
3521 protected data in pthread_mutex.
3522 (pthread_spinlock::pthread_spinlock): New constructor.
3523 (pthread_spinlock::lock): New method.
3524 (pthread_spinlock::unlock): New method.
3525 (pthread_spinlock::init): New method.
3526 (pthread_spin_lock): New function.
3527 (pthread_spin_trylock): New function.
3528 (pthread_spin_unlock): New function.
3529 (pthread_spin_destroy): New function.
3530 * thread.h (PTHREAD_SPINLOCK_MAGIC): Define.
3531 (class pthread_mutex): Change access level of members shared with
3532 derived classes to protected.
3533 (pthread_mutex::set_shared): New protected method.
3534 (class pthread_spinlock): New class, derived class of pthread_mutex.
3535 * include/pthread.h (pthread_spin_destroy): Declare.
3536 (pthread_spin_init): Declare.
3537 (pthread_spin_lock): Declare.
3538 (pthread_spin_trylock): Declare.
3539 (pthread_spin_unlock): Declare.
3540 * include/cygwin/types.h (pthread_spinlock_t): New typedef.
3541 * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump.
3543 2011-03-29 Corinna Vinschen <corinna@vinschen.de>
3545 * net.cc (SIO_BASE_HANDLE): Define.
3546 (fdsock): If we got an LSP handle, try to create a copy of the base
3547 handle instead. Change comment to explain.
3549 2011-03-29 Corinna Vinschen <corinna@vinschen.de>
3551 * include/cygwin/version.h: Bump CYGWIN_VERSION_DLL_MINOR to 10.
3553 2011-03-29 Corinna Vinschen <corinna@vinschen.de>
3555 * autoload.cc (winmm): Remove time functions. Don't treat
3556 unloadable wave functions as fatal.
3557 * hires.h (hires_ms::timeGetTime_ns): New private method.
3558 (hires_ms::dmsecs): Call timeGetTime_ns here.
3559 * ntdll.h (struct _KSYSTEM_TIME): Define.
3560 (KUSER_SHARED_DATA): Redefine to allow access to InterruptTime.
3561 (SharedUserData): Define here.
3562 (NtQueryTimerResolution): Declare.
3563 (NtSetTimerResolution): Declare.
3564 * path.cc (SharedUserData): Move to ntdll.h.
3565 * times.cc (hires_ms::timeGetTime_ns): New private method.
3566 Use throughout instead of timeGetTime. Document entire functionality
3567 of timeGetTime in case we need it.
3568 (hires_ms::resolution): Try a call to NtQueryTimerResolution
3569 to fetch current period. Fall back to heuristic if that fails.
3570 Cast to DWORD in assignments to minperiod.
3571 (clock_setres): Align period to possible values per a call to
3572 NtQueryTimerResolution. Explain why. Replace calls to timeBeginPeriod
3573 and timeEndPeriod with underlying call to NtSetTimerResolution. Use
3574 status code from NtSetTimerResolution to compute errno.
3575 Convert period to ULONGLONG and store 100ns value to simplify code.
3577 2011-03-29 Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
3578 Corinna Vinschen <corinna@vinschen.de>
3580 * include/sys/xattr.h: New file.
3582 2011-03-28 Jon TURNEY <jon.turney@dronecode.org.uk>
3584 * thread.cc (semaphore::init, destroy, close): Standards conformance
3585 fix. On a failure, return -1 and set errno.
3586 * thread.h (semaphore::terminate): Save errno since semaphore::close()
3589 2011-03-27 Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
3591 * cygwin.din (strchrnul): Export.
3592 * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump.
3593 * posix.sgml (std-gnu): Add strchrnul.
3595 2011-03-27 Christopher Faylor <me.cygwin2011@cgf.cx>
3597 * dll_init.cc (dll::init): Accommodate ill-behaved dlls who don't fill
3600 2011-03-25 Corinna Vinschen <corinna@vinschen.de>
3602 * mmap.cc (mmap64): Add a cheat to let a certain autoconf test succeed
3603 on 64 bit systems. Explain why.
3605 2011-03-23 Christopher Faylor <me.cygwin2011@cgf.cx>
3607 * wincap.cc (wincap_2003): Set use_dont_resolve_hack to true.
3609 2011-03-23 Christopher Faylor <me.cygwin2011@cgf.cx>
3611 * autoload.cc (dll_load): Change error message to make it clear if a
3612 newer DLL is being run.
3614 2011-03-20 Corinna Vinschen <corinna@vinschen.de>
3616 * fenv.cc (_feinitialise): Don't use SSE instructions on systems not
3618 * wincap.h (wincaps::supports_sse): New element.
3619 * wincap.cc: Implement above element throughout.
3621 2011-03-18 Corinna Vinschen <corinna@vinschen.de>
3623 * cygwin.sc: Raise default cygheap size to 2 Megs.
3625 2011-03-18 Christopher Faylor <me.cygwin2011@cgf.cx>
3627 * fhandler.h (DEFAULT_PIPEBUFSIZE): Reset to 64K.
3629 2011-03-18 Corinna Vinschen <corinna@vinschen.de>
3631 * mmap.cc (mmap_record::alloc_fh): Initialize name strings in fdev to
3632 empty strings or suffer a SEGV. Drop second parameter in call to
3635 2011-03-18 Corinna Vinschen <corinna@vinschen.de>
3637 * mmap.cc (class mmap_record): Pack 4 byte-aligned. Convert member dev
3639 (mmap_record::alloc_fh): Create temporary device from dev and use in
3640 call to build_fh_dev.
3642 2011-03-18 Corinna Vinschen <corinna@vinschen.de>
3644 * mmap.cc (mmap_record::page_map): Define as variable array rather than
3646 (mmap_record::alloc_page_map): Remove.
3647 (mmap_record::free_page_map): Remove.
3648 (mmap_record::init_page_map): New method.
3649 (mmap_record::add_record): Take mmap_record parameter by reference
3650 rather than by value.
3651 (mmap_record::map_pages): Fix comment.
3652 (mmap_list::add_record): Allocate space for mmap_record including the
3653 page_map in a single ccalloc call. Call init_page_map afterwards.
3654 (mmap_list::del_record): Remove call to mmap_record::free_page_map.
3656 2011-03-16 Corinna Vinschen <corinna@vinschen.de>
3658 * crt0.c (mainCRTStartup): Move call to _feinitialise from here...
3659 * dcrt0.cc (_dll_crt0): ...to here.
3661 2011-03-16 Corinna Vinschen <corinna@vinschen.de>
3663 * winver.rc: Fix copyright dates.
3665 2011-03-14 Corinna Vinschen <corinna@vinschen.de>
3667 * fhandler_disk_file.cc (fhandler_base::fstat_by_handle): Only use
3668 file id as inode number if it masters the isgood_inode check.
3670 2011-03-13 Christopher Faylor <me.cygwin2011@cgf.cx>
3672 * fhandler.cc (fhandler_base_overlapped::wait_overlapped): Remove
3673 special treatment for ERROR_NO_SYSTEM_RESOURCES. Cancel I/O and reset
3674 the overlapped handle on error.
3675 (fhandler_base_overlapped::write_overlapped): Limit writes to
3676 max_atomic_write bytes in blocking case. Incorporate code from
3677 now-defunct write_overlapped_fallback. Fix serious oversight where ptr
3678 was not advanced as buffer was written.
3679 (fhandler_base_overlapped::write_overlapped_fallback): Eliminate.
3680 * fhandler.h (fhandler_base_overlapped::write_overlapped_fallback):
3681 Ditto for declaration.
3682 (DEFAULT_PIPEBUFSIZE): Lower size to slightly less than documented
3683 worst-case atomic write size.
3684 (fhandler_overlapped::wait_return): Remove unused element.
3686 2011-03-09 Christopher Faylor <me.cygwin2011@cgf.cx>
3688 * fhandler.cc (fhandler_base_overlapped::wait_overlapped): Handle
3689 overlapped_fallback error condition like other error conditions. Set
3690 res carefully and specifically for each condition rather than resorting
3692 (fhandler_base_overlapped::write_overlapped): Preserve errno in
3693 overlapped_fallback condition. Correct write_overlapped_fallback to
3694 avoid inappropriate looping.
3695 (fhandler_base_overlapped::write_overlapped_fallback): Add some more
3698 2011-03-09 Christopher Faylor <me.cygwin2011@cgf.cx>
3700 * fhandler.cc (fhandler_base_overlapped::write_overlapp): Oops!
3701 Accommodate change in arguments to wait_overlapped.
3703 2011-03-09 Christopher Faylor <me+cygwin@cgf.cx>
3705 * errno.cc (errmap): Change mapping of NO_SYSTEM_RESOURCES to EFBIG.
3706 * fhandler.cc (MAX_OVERLAPPED_WRITE_LEN): New constant.
3707 (MIN_OVERLAPPED_WRITE_LEN): Ditto.
3708 (fhandler_base_overlapped::close): Accommodate change in arguments to
3710 (fhandler_base_overlapped::setup_overlapped): Add __stdcall and regparm
3712 (fhandler_base_overlapped::destroy_overlapped): Ditto.
3713 (fhandler_base_overlapped::has_ongoing_io): Ditto.
3714 (fhandler_base_overlapped::wait_overlapped): Modify to return an enum
3715 returning various states. Accept nonblocking parameter.
3716 (fhandler_base_overlapped::read_overlapped): Add __stdcall and regparm
3717 modifiers. Rework to attempt to be smarter about reacting to states
3718 returned by wait_overlapped.
3719 (fhandler_base_overlapped::write_overlapped): Ditto. Add fallback
3720 option for when wait_overlapped detects that smaller chunks must be
3722 (fhandler_base_overlapped::write_overlapped_fallback): Ditto.
3723 * fhandler.h (DEFAULT_PIPEBUFSIZE): Move definition here from pipe.cc.
3724 (fhandler_base::has_ongoing_io): Define with __stdcall and regparm
3726 (fhandler_base_overlapped::wait_return): New enum.
3727 (fhandler_base_overlapped::max_atomic_write): New variable.
3728 (fhandler_base_overlapped:: wait_overlapped): Accommodate changes
3729 mentioned above to arguments and modifiers.
3730 (fhandler_base_overlapped::setup_overlapped): Ditto for modifiers.
3731 (fhandler_base_overlapped::read_overlapped): Ditto.
3732 (fhandler_base_overlapped::write_overlapped): Ditto.
3733 (fhandler_base_overlapped::destroy_overlapped): Ditto.
3734 (fhandler_base_overlapped::has_ongoing_io): Ditto.
3735 (fhandler_base_overlapped::fhandler_base_overlapped): Zero
3737 * fhandler_fifo.cc (fhandler_fifo::fhandler_fifo): Set max_atomic_write
3738 to the size of the DEFAULT_PIPEBUFSIZE.
3739 (fhandler_fifo::wait): Accommodate change in arguments to
3741 * pipe.cc (fhandler_pipe::fhandler_pipe): Set max_atomic_write to the
3742 size of the DEFAULT_PIPEBUFSIZE.
3743 (fhandler_pipe::create_selectable): Allow minimum size of DEFAULT_PIPEBUFSIZE.
3744 (DEFAULT_PIPEBUFSIZE): Delete here, move to fhandler.h.
3746 2011-03-08 Corinna Vinschen <corinna@vinschen.de>
3748 * security.cc: Fix copyright dates.
3750 2011-03-08 Corinna Vinschen <corinna@vinschen.de>
3752 * fhandler.cc (fhandler_base::open): When creating a file on a
3753 filesystem supporting ACLs, create the file with WRITE_DAC access.
3755 * fhandler_disk_file.cc (fhandler_disk_file::mkdir): Ditto for
3757 * fhandler_socket.cc (fhandler_socket::bind): Ditto for sockets.
3758 * path.cc (symlink_worker): Ditto for symlinks.
3759 * security.cc (get_file_sd): Always call GetSecurityInfo for directories
3760 on XP and Server 2003. Improve comment to explain why.
3761 (set_file_attribute): Explicitely cast mode_t value to bool in call to
3763 * wincap.h (wincaps::use_get_sec_info_on_dirs): New element.
3764 * wincap.cc: Implement above element throughout.
3766 2011-03-04 Corinna Vinschen <corinna@vinschen.de>
3768 * fhandler_procsys.cc (fhandler_procsys::exists): Rewrite.
3769 (fhandler_procsys::fill_filebuf): Fill buffer with valid string even if
3770 reading the symlink fails.
3772 2011-03-03 Corinna Vinschen <corinna@vinschen.de>
3774 * posix_ipc.cc (ipc_cond_timedwait): If ipc_mutex_unlock fails, return
3775 actual error number.
3776 (_mq_send): Break loop if ipc_cond_timedwait returns with error.
3777 (_mq_receive): Ditto.
3779 2011-03-03 Corinna Vinschen <corinna@vinschen.de>
3781 * errno.cc (__xpg_strerror_r): Add accidentally missing condition.
3783 2011-03-02 Corinna Vinschen <corinna@vinschen.de>
3785 * fhandler_procsys.cc (fhandler_procsys::open): Call worker exists
3786 method, rather than wrapper.
3788 2011-03-01 Christopher Faylor <me+cygwin@cgf.cx>
3790 * autoload.cc (dll_load): Avoid in_forkee test since this apparently
3791 fails even when not forked.
3793 2011-03-01 Christopher Faylor <me+cygwin@cgf.cx>
3795 * include/cygwin/version.h: Bump CYGWIN_VERSION_DLL_MINOR to 9.
3797 2011-02-28 Christopher Faylor <me+cygwin@cgf.cx>
3799 * autoload.cc (dll_load): Only perform DONT_RESOLVE_DLL_REFERENCES hack
3800 on systems which need it.
3801 * wincap.cc (use_dont_resolve_hack): Set as appropriate.
3802 * wincap.h (use_dont_resolve_hack): Define.
3804 2011-02-28 Christopher Faylor <me+cygwin@cgf.cx>
3806 * autoload.cc (dll_load): Make inline. Clarify logic.
3808 2011-02-27 Corinna Vinschen <corinna@vinschen.de>
3810 * autoload.cc (dll_load): Only call LoadLibraryExW with
3811 DONT_RESOLVE_DLL_REFERENCES if a normal LoadLibrary call failed with
3812 ERROR_INVALID_ADDRESS.
3813 (LsaRegisterLogonProcess): Align comment to previous change.
3815 2011-02-26 Christopher Faylor <me+cygwin@cgf.cx>
3817 * autoload.cc: Use LoadDLLfuncEx3 for all winmm functions. Accommodate
3818 changes to LoadDLLprime.
3819 (LoadDLLprime): Take an extra argument indicating whether this dll
3820 needs special handling on fork. Place this information in the "handle"
3822 (LoadDLLfuncEx3): Eliminate "func" handling. Pass new
3823 no_resolve_on_fork argument to LoadDLLprime.
3824 (dll_load): New function.
3825 (std_dll_init): Accommodate changes to dll_info::handle. Use dll_load
3826 to load DLL in both cases where it is used.
3828 2011-02-26 Corinna Vinschen <corinna@vinschen.de>
3830 * autoload.cc: Make autoloaded ntdll function non-optional. Ditto for
3831 secur32 functions, except for LsaRegisterLogonProcess. Change return
3832 value to ERROR_PROC_NOT_FOUND. Explain why.
3833 * sec_auth.cc (lsaauth): Handle ERROR_PROC_NOT_FOUND from call to
3834 LsaRegisterLogonProcess when generating the errno value.
3836 2011-02-22 Corinna Vinschen <corinna@vinschen.de>
3838 * dcrt0.cc: Fix copyright dates.
3840 * syscalls.cc (_read): Move EXPORT_ALIAS to its rightful place.
3842 2011-02-21 Christopher Faylor <me+cygwin@cgf.cx>
3844 * cygwin.din: Mark __assert* and _abort as NOSIGFE.
3846 2011-02-21 Corinna Vinschen <corinna@vinschen.de>
3848 * fhandler_socket (fhandler_socket::readv): Call recv_internal directly,
3849 rather than recvmsg.
3850 (fhandler_socket::writev): Call send_internal directly, rather than
3852 * net.cc (cygwin_recv): Call fhandler_socket::recvfrom directly, rather
3853 than cygwin_recvfrom.
3854 (cygwin_send): Call fhandler_socket::sendto directly, rather than
3857 2011-02-20 Christopher Faylor <me+cygwin@cgf.cx>
3859 * fhandler.cc (fhandler_base_overlapped::close): Finish any pending I/O
3861 (fhandler_base_overlapped::wait_overlapped): Defensively zero bytes
3862 read. Add more info to debugging output.
3864 2011-02-18 Christopher Faylor <me+cygwin@cgf.cx>
3866 * dcrt0.cc (dll_crt0_1): Add a CYGHEAP_DEBUG conditional for debugging
3867 which allocates a lot of space at startup.
3869 2011-02-18 Corinna Vinschen <corinna@vinschen.de>
3871 * cygwin.sc: Set alignment of .cygheap section to 64K.
3873 2011-02-15 Corinna Vinschen <corinna@vinschen.de>
3875 * spawn.cc (spawn_guts): Only set PID_NOTCYGWIN in _P_OVERLAY mode.
3876 Drop flag if creating new process failed.
3878 2011-02-15 Corinna Vinschen <corinna@vinschen.de>
3880 * Throughout fix copyright dates.
3882 2011-02-15 Corinna Vinschen <corinna@vinschen.de>
3884 * devices.in: Throughout use slashes instead of backslashes in the
3885 native path of devices not backed by native NT devices.
3886 * devices.cc: Regenerate.
3887 * globals.cc (ro_u_pmem): Use correct case.
3888 (ro_u_globalroot): New R/O unicode string.
3889 * path.cc (path_conv::check): Fix incorrect handling of /proc/sys
3890 block devices if they are just visited due to a component check.
3891 (symlink_info::posixify): Fix typo in comment.
3892 (cygwin_conv_path): Use ro_u_globalroot instead of string constant.
3893 (fast_cwd_version): New shared variable to store FAST_CWD version
3895 (find_fast_cwd_pointer): Rename from find_fast_cwd_pointers. Don't
3896 set global fast_cwd_ptr pointer here. Return pointer value instead.
3897 (find_fast_cwd): New function to set fast_cwd_ptr and fast_cwd_version.
3898 (cwdstuff::override_win32_cwd): Call find_fast_cwd from here.
3899 Check for fast_cwd_version to differ between old and new FAST_CWD
3900 structure. Check old_cwd for NULL to avoid SEGV. Don't set CWD if
3901 we have neitehr a valid fast_cwd_ptr, nor a valid CWD handle in the
3902 process parameter block.
3903 (cwdstuff::set): Create Win32 path taking /proc/sys paths into account.
3904 * spawn.cc (spawn_guts): Recode creating runpath. Also take /proc/sys
3905 paths into account. Drop special CWD handling when starting non-Cygwin
3908 2011-02-15 Corinna Vinschen <corinna@vinschen.de>
3910 * fhandler_procsys.cc (fhandler_procsys::opendir): Avoid SEGV if
3911 opening object directory fails.
3912 * fhandler_virtual.cc (fhandler_virtual::opendir): Don't leak memory.
3914 2011-02-15 Corinna Vinschen <corinna@vinschen.de>
3916 * fhandler_disk_file.cc (fhandler_disk_file::readdir_helper): Don't
3917 append slash if there is one already.
3919 2011-02-15 Corinna Vinschen <corinna@vinschen.de>
3921 Revert change from 2010-08-31:
3922 * path.cc (normalize_posix_path): Drop support for //./ and //?/
3924 (path_conv::check): Ditto.
3926 2011-02-15 Corinna Vinschen <corinna@vinschen.de>
3928 * fhandler_disk_file.cc (fhandler_disk_file::readdir_helper): Use POSIX
3929 path to check for symlink.
3931 2011-02-14 Corinna Vinschen <corinna@vinschen.de>
3933 * config/i386/profile.h: Sync with Mingw.
3935 2011-02-13 Corinna Vinschen <corinna@vinschen.de>
3937 * path.cc (struct _FAST_CWD): Redefine to new layout used since patch
3938 for KB 2393802. Adjust comments throughout.
3939 (struct _FAST_CWD_OLD): Rename former definition.
3940 (cwdstuff::override_win32_cwd): Check if the OS is using the old or the
3941 new FAST_CWD structure layout and handle accordingly.
3943 2011-02-11 Christopher Faylor <me+cygwin@cgf.cx>
3945 * mkstatic: Make sure that we are not cd'ed to temporary directory on
3946 exit to avoid bogus warnings on directory cleanup.
3950 2011-02-11 Christopher Faylor <me+cygwin@cgf.cx>
3952 * cygwin.sc: Eliminate __cygheap_mid.
3953 * cygheap.cc: Ditto.
3955 2011-02-11 Christopher Faylor <me+cygwin@cgf.cx>
3957 * cygheap.cc (_cygheap_mid): Drop unneeded section attribute.
3958 (cygheap_init): Just zero cygheap structure.
3959 * cygwin.sc: Keep 16 byte alignment but drop all other alignments
3960 related to cygheap. Eliminate unused __cygheap_end1.
3962 2011-02-11 Corinna Vinschen <corinna@vinschen.de>
3964 * cygwin.sc: Raise default cygheap size to 1 Meg. Set alignment to
3967 2011-02-11 Corinna Vinschen <corinna@vinschen.de>
3969 * include/endian.h: Move definitions of __BIG_ENDIAN, __LITTLE_ENDIAN,
3970 and __BYTE_ORDER into ...
3971 * include/bits/endian.h: New file.
3972 * include/arpa/nameser_compat.h: Include endian.h rather than defining
3974 * include/asm/byteorder.h: Include bits/endian.h. Drop definition of
3976 * include/netinet/ip.h: Include bits/endian.h. Drop definitions of
3977 BIG_ENDIAN, LITTLE_ENDIAN, and BYTE_ORDER. Use underscored variants
3978 of aforementioned constants.
3979 * include/netinet/tcp.h: Ditto.
3980 * include/sys/param.h: Drop disabled definitions of BIG_ENDIAN,
3981 LITTLE_ENDIAN, and BYTE_ORDER.
3983 * include/netinet/ip.h: Reformat. Define setsockopt IP_TOS options
3984 matching recent RFCs. Tweak comments.
3986 2011-02-10 Eric Blake <eblake@redhat.com>
3988 * errno.cc (includes): Avoid compilation failure if <string.h>
3989 settles on wrong strerror_r signature.
3991 * errno.cc (__xpg_strerror_r): New function.
3992 (strerror_r): Update to copy newlib's fixes.
3993 (strerror): Set errno on failure.
3994 (_sys_errlist): Cause EINVAL failure for reserved values.
3995 * cygwin.din: Export new function.
3996 * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Combine
3997 this into minor 236.
3999 2011-02-09 Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
4001 * cygwin.din (pthread_yield): Export as alias to sched_yield.
4002 * include/pthread.h (pthread_yield): Declare.
4003 * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump.
4004 * posix.sgml (std-deprec): Add pthread_yield.
4006 2011-02-09 Christopher Faylor <me+cygwin@cgf.cx>
4008 * cygheap.cc: Add some __stdcall decoration where appropriate.
4009 * lib/cygwin_crt0.c: __attribute -> __attribute__.
4011 2011-02-09 Christopher Faylor <me+cygwin@cgf.cx>
4013 * hookapi.cc (hook_or_detect_cygwin): Prevent i from being considered
4014 uninitialized by gcc.
4016 2011-02-09 Christopher Faylor <me+cygwin@cgf.cx>
4018 * exception.h: Remove DEBUG_EXCEPTION left over debugging ifdef.
4020 2011-02-08 Christopher Faylor <me+cygwin@cgf.cx>
4022 * dll_init.cc: Fix typo in comment.
4024 2011-02-07 Corinna Vinschen <corinna@vinschen.de>
4026 * configure.in: Remove AC_ALLOCA test and test for __builtin_memset.
4027 * configure: Regenerate.
4029 2011-02-07 Corinna Vinschen <corinna@vinschen.de>
4031 * fhandler_console.cc (fhandler_console::write_normal): Remove
4032 erroneous premature return after collecting truncated multibyte
4033 sequence in trunc_buf. Rather fall through to printing routine.
4034 Fix return value to take trunc_buf content into account. Improve
4037 2011-02-05 Christopher Faylor <me+cygwin@cgf.cx>
4039 * autoload.cc (wsock_init): Properly define WSAStartup function pointer
4040 to avoid stack damage.
4042 2011-02-02 Corinna Vinschen <corinna@vinschen.de>
4044 * libc/bsdlib.cc: Include err.h.
4046 2011-02-02 Eric Blake <eblake@redhat.com>
4048 * include/err.h: Fix loss of semicolons in previous patch.
4050 2011-02-02 Corinna Vinschen <corinna@vinschen.de>
4052 * include/err.h (err): Add noreturn attribute.
4057 2011-02-02 Corinna Vinschen <corinna@vinschen.de>
4059 * path.cc (conv_path_list): Remove enclosing quotes and trailing
4060 backslashes from Win32 environment path lists.
4062 2011-02-01 Christian Franke <franke@computer.org>
4064 * fhandler.cc (fhandler_base::fsync): Ignore ERROR_INVALID_FUNCTION
4065 error from FlushFileBuffers().
4067 2011-01-31 Corinna Vinschen <corinna@vinschen.de>
4069 * syscalls.cc (utmp_data): Fix potential buffer overflow.
4071 2011-01-31 Corinna Vinschen <corinna@vinschen.de>
4073 * fhandler_socket.cc (address_in_use): Improve comment readability.
4075 2011-01-30 Corinna Vinschen <corinna@vinschen.de>
4077 * fhandler_socket.cc (address_in_use): Disable. Add comment.
4078 (fhandler_socket::bind): Change comment to explain setting the
4079 SO_EXCLUSIVEADDRUSE socket option. Remove code which checks for
4081 * net.cc (cygwin_setsockopt): Never set SO_REUSEADDR option. Improve
4082 comment to compensate for the deleted comment in fhandler_socket::bind.
4083 * wincap.cc: Throughout, drop has_enhanced_socket_security from wincaps.
4084 * wincap.h (struct wincaps): Drop has_enhanced_socket_security flags
4087 2011-01-28 Peter Foley <jpfoley2@verizon.net>
4089 * configure.in: Define LIBSERVER regardless of cross_host.
4090 * configure: Regenerate.
4092 2011-01-28 Corinna Vinschen <corinna@vinschen.de>
4094 * fhandler_socket.cc (fhandler_socket::wait_for_events): Call
4095 pthread_testcancel in case of timeout to enable pthread_cancel
4098 2011-01-27 Corinna Vinschen <corinna@vinschen.de>
4100 * include/features.h (__STDC_ISO_10646__): Move to newlib's
4103 2011-01-26 Corinna Vinschen <corinna@vinschen.de>
4105 * fhandler_disk_file.cc (fhandler_base::fstat_by_nfs_ea): Fix
4106 computation of st_blocks.
4107 (fhandler_base::fstat_helper): Fix formatting.
4109 2011-01-24 Corinna Vinschen <corinna@vinschen.de>
4111 * include/features.h (__STDC_ISO_10646__): Define. Add comment.
4113 2011-01-21 Corinna Vinschen <corinna@vinschen.de>
4115 * syscalls.cc (rename): Fix permission problem with symlinks on NFS.
4116 Rework how NtOpenFile gets called to make it more readable. Change
4119 2011-01-20 Corinna Vinschen <corinna@vinschen.de>
4121 * exec.cc: Include pinfo.h.
4122 * winf.h: Move definitions of _P_PATH_TYPE_EXEC and _P_MODE from here...
4123 * pinfo.h: ...to here.
4124 (_P_PATH_TYPE_EXEC): Redefine to be bigger than _P_SYSTEM.
4125 (_P_MODE): Redefine so as not to mask out _P_SYSTEM.
4126 * spawn.cc (spawnlp): Add _P_PATH_TYPE_EXEC flag in call to spawnve.
4130 2011-01-19 Corinna Vinschen <corinna@vinschen.de>
4132 * spawn.cc (av::fixup): Reenable #! handling for all exec functions.
4133 Return ENOEXEC in !p_type_exec case only for unrecognized files.
4134 Fix comment formatting.
4136 2011-01-19 Corinna Vinschen <corinna@vinschen.de>
4138 * exec.cc (execlp): Add missing _P_PATH_TYPE_EXEC flag in call to
4141 2011-01-19 Corinna Vinschen <corinna@vinschen.de>
4143 * exec.cc: Rearrange functions in alphabetical order.
4144 (_execve): Drop temporary define and drop export alias.
4145 (execl): Call spawnve.
4146 (execle): New function.
4147 (execlp): New function.
4148 (execv): Call spawnve.
4149 (execve): Drop converting NULL envp to emtpy envp.
4150 (execvp): Call spawnve.
4151 (execvpe): Drop converting NULL envp to emtpy envp. Call spawnve.
4152 (fexecve): Call spawnve.
4153 * spawn.cc (spawnve): Convert NULL envp to emtpy envp. Remove outdated
4155 (spawnlp): Call spawnve.
4158 (spawnvpe): Fix formatting.
4160 2011-01-19 Corinna Vinschen <corinna@vinschen.de>
4162 * exec.cc (strccpy): Move function from here...
4163 * strfuncs.cc (strccpy): ...to here.
4164 * string.h (strccpy): Declare.
4165 * winsup.h (strccpy): Drop declaration.
4167 2011-01-19 Corinna Vinschen <corinna@vinschen.de>
4169 * errno.cc (errmap): Add error codes for invalid binaries.
4170 * exec.cc (execvp): Call spawnve with _P_PATH_TYPE_EXEC flag
4173 * spawn.cc (spawn_guts): Filter _P_PATH_TYPE_EXEC from mode and
4174 store in p_type_exec. Call av::fixup with addtional p_type_exec
4176 (spawnve): Check for filtered mode.
4177 (spawnvpe): Add _P_PATH_TYPE_EXEC flag when calling spawnve.
4178 (av::fixup): Accept additional bool parameter p_type_exec. Only check
4179 for script if p_type_exec is true.
4180 * winf.h (_P_PATH_TYPE_EXEC): Define.
4182 (av::fixup): Declare with additional bool parameter.
4184 2011-01-17 Corinna Vinschen <corinna@vinschen.de>
4186 * fhandler_proc.cc (format_proc_partitions): Fix compiler warning.
4188 2011-01-17 Corinna Vinschen <corinna@vinschen.de>
4190 * path.cc (path_conv::check): Don't follow reparse point symlinks if
4191 PC_SYM_NOFOLLOW_REP flag is set.
4192 (cygwin_conv_path): Set PC_SYM_NOFOLLOW_REP flag when converting from
4194 * path.h (enum pathconv_arg): Define PC_SYM_NOFOLLOW_REP flag.
4196 2011-01-17 Corinna Vinschen <corinna@vinschen.de>
4198 * fhandler_proc.cc (proc_tab_cmp): Fix typo in comment.
4199 (fhandler_proc::fill_filebuf): Handle return value of 0 from format
4201 (format_proc_stat): Set errno when returning 0 size.
4202 (format_proc_partitions): Rewrite method to fetch partition info.
4204 2011-01-13 Corinna Vinschen <corinna@vinschen.de>
4206 * fhandler_disk_file.cc (fhandler_base::fstat_helper): Always set
4207 st_size of directories to 0. Explain why.
4209 2011-01-12 Corinna Vinschen <corinna@vinschen.de>
4211 * posix.sgml: Add madvise to BSD list.
4213 2011-01-12 Corinna Vinschen <corinna@vinschen.de>
4215 * cygwin.din (madvise): Export posix_madvise as madvise.
4216 * include/cygwin/version.h: Bump CYGWIN_VERSION_API_MINOR.
4217 * include/sys/mman.h: Define madvise constants, keep Linux-specific
4218 constants undefined.
4221 2011-01-12 Corinna Vinschen <corinna@vinschen.de>
4223 * fhandler.h (struct part_t): New type.
4224 (class fhandler_dev_floppy): Convert partitions to part_t pointer.
4225 Add lock_partition method.
4226 * fhandler_floppy.cc (fhandler_dev_floppy::lock_partition): New method
4227 to implement ondemand partition locking.
4228 (fhandler_dev_floppy::write_file): Call lock_partition from here if
4229 writing failed due to a potential write restriction on a disk
4231 (fhandler_dev_floppy::open): Don't lock partitions here.
4232 (fhandler_dev_floppy::close): Keep track of partition handle reference
4233 count. Close handles and remove partitions pointer ony if count is 0.
4234 (fhandler_dev_floppy::dup): Just copy partitions pointer and increment
4237 2011-01-11 Corinna Vinschen <corinna@vinschen.de>
4239 * fhandler.h (MAX_PARTITIONS): New definition.
4240 (class fhandler_dev_floppy): Add partitions array member. Add close
4242 * fhandler_floppy.cc (fhandler_dev_floppy::fhandler_dev_floppy): Zero
4243 out partitions array.
4244 (fhandler_dev_floppy::open): Fix "entire disk" condition for call to
4245 DeviceIoControl (FSCTL_ALLOW_EXTENDED_DASD_IO).
4246 When opening disks for writing, call DeviceIoControl (FSCTL_LOCK_VOLUME)
4247 on all affected disk partitions starting with Vista.
4248 (fhandler_dev_floppy::close): New method.
4249 (fhandler_dev_floppy::dup): Duplicate handles in partitions, if any.
4250 * wincap.h (wincaps::has_restricted_raw_disk_access): New element.
4251 * wincap.cc: Implement above element throughout.
4253 2011-01-11 Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
4255 * termios.cc (cfgetospeed, cfgetispeed): Constify argument per POSIX.
4256 * include/sys/termios.h (cfgetospeed, cfgetispeed): Declare functions.
4257 Move macros after declarations and make conditional on !__cplusplus.
4259 2011-01-11 Corinna Vinschen <corinna@vinschen.de>
4261 * cygtls.cc (_cygtls::init_thread): Call _REENT_INIT_PTR. Drop setting
4262 current locale and calling srand48.
4264 2011-01-02 Christopher Faylor <me+cygwin@cgf.cx>
4266 * ChangeLog-2010: Create from ChangeLog.
4267 * ChangeLog: Start fresh.