1 2006-10-27 Corinna Vinschen <corinna@vinschen.de>
3 * shared.cc (open_shared): Drop useless attempt from 2006-08-11.
5 2006-10-27 Corinna Vinschen <corinna@vinschen.de>
7 * dcrt0.cc (__api_fatal): Drop spare argument to __small_sprintf.
8 * smallprint.c (__small_vsprintf): Preserve GetLastError value.
9 * winsup.h (api_fatal): Simplify. Drop duplicate filename arg.
11 2006-10-23 Corinna Vinschen <corinna@vinschen.de>
13 * fhandler_disk_file.cc (fhandler_disk_file::rewinddir): Fix comment.
15 2006-10-23 Corinna Vinschen <corinna@vinschen.de>
17 * fhandler_disk_file.cc (fhandler_disk_file::rewinddir): Accomodate
18 buggy RestartScan behaviour of Windows 2000.
19 * wincap.h: Define has_buggy_restart_scan throughout.
22 2006-10-22 Corinna Vinschen <corinna@vinschen.de>
24 * fhandler_disk_file.cc (fhandler_disk_file::facl): Fix whitespace.
25 * external.cc: Update copyright.
27 * sec_helper.cc: Ditto.
30 (check_registry_access): Return -1 if W_OK is requested.
32 2006-10-22 Corinna Vinschen <corinna@vinschen.de>
34 * external.cc (cygwin_internal): Use security_descriptor::copy method.
35 * sec_helper.cc (security_descriptor::malloc): Use own free method.
37 (security_descriptor::realloc): Handle the case that psd has been
38 allocated using LocalAlloc. Set type.
39 (security_descriptor::free): Ditto.
40 * security.cc (get_nt_attribute): Remove.
41 (get_reg_security): Remove.
42 (get_nt_object_security): Use GetSecurityInfo which handles all
44 (get_nt_object_attribute): Remove.
45 (get_object_attribute): Call get_nt_object_security instead of
46 get_nt_object_attribute.
47 (get_file_attribute): Ditto.
48 (check_registry_access): Call get_nt_object_security instead of
50 * security.h (cygpsid::operator PSID): Make method const, not the
52 (class security_descriptor): Add type member. Accomodate throughout.
53 (security_descriptor::copy): New method.
54 (security_descriptor::operator PSECURITY_DESCRIPTOR *): New operator.
56 2006-10-22 Corinna Vinschen <corinna@vinschen.de>
58 * fhandler.cc (fhandler_base::fhaccess): Check if opening registry
59 actually created a handle. This handles the registry root dir.
60 * fhandler_registry.cc (fhandler_registry::open): Set io_handle in
61 case of opening one of the predefined registry keys.
63 2006-10-21 Corinna Vinschen <corinna@vinschen.de>
65 * fhandler.cc (fhandler_base::fhaccess): Call check_registry_access
66 for registry keys/values if ntsec is on.
67 * security.cc (check_access): New static function derived from
68 check_file_access, but object type agnostic.
69 (check_file_access): Only do file specific stuff. Call check_access.
70 (check_registry_access): New access check function for registry keys/
72 * security.h (check_registry_access): Declare.
74 2006-10-21 Corinna Vinschen <corinna@vinschen.de>
76 * fhandler_registry.cc (fhandler_registry::fstat): Set restrictive
77 permission and ownership if key can't be opened for reading security.
78 (open_key): If opening key fails, retry opening with backup intent.
80 2006-10-20 Corinna Vinschen <corinna@vinschen.de>
82 * net.cc (cygwin_getnameinfo): Fix typo in comment.
84 2006-10-19 Corinna Vinschen <corinna@vinschen.de>
86 * fhandler.h (fhandler_base::set_name): Make virtual.
87 (class fhandler_registry): Add wow64 and prefix_len members.
88 Declare set_name method.
89 * fhandler_proc.cc (PROC_REGISTRY32): Define.
90 (PROC_REGISTRY64): Define.
91 (proc_listing): Add "registry32" and "registry64" elements.
92 (proc_fhandlers): Add corresponding FH_REGISTRY values.
93 * fhandler_registry.cc (registry_len): Drop static value in favor of
94 class member prefix_len. Use preifx_len instead of registry_len
96 (fhandler_registry::set_name): Define. Set wow64 and prefix_len
97 according to directory prefix.
98 (fhandler_registry::fhandler_registry): Set wow64 and prefix_len to
100 (open_key): Add wow64 argument. Handle wow64 in call to RegOpenKeyEx.
101 Use fhandler_registry member wow64 in this place throughout.
103 2006-10-19 Corinna Vinschen <corinna@vinschen.de>
105 * fhandler_proc.cc: Drop superfluous definition of _WIN32_WINNT.
106 * miscfuncs.cc: Ditto.
109 2006-10-17 Corinna Vinschen <corinna@vinschen.de>
112 * glob.cc: New file. Latest glob version from FreeBSD plus Cygwin
113 specific changes (__stat64/__stat32, ignore_case_with_glob,
114 drop collate functions).
115 (glob3): Return GLOB_ABORTED in case directory is unreadable and
116 GLOB_ERR is set, as demanded by SUSv3.
117 * glob.h: Import latest version from FreeBSD.
119 2006-10-17 Corinna Vinschen <corinna@vinschen.de>
121 * winsup.h (WINVER): Define instead of _WIN32_WINNT. Set to 0x0502.
122 (_NO_W32_PSEUDO_MODIFIERS): Define.
124 2006-10-16 Corinna Vinschen <corinna@vinschen.de>
126 * fhandler_disk_file.cc (fhandler_disk_file::opendir): Drop redundant
129 2006-10-16 Corinna Vinschen <corinna@vinschen.de>
131 * include/asm/byteorder.h: Fix copyright dates.
133 2006-10-16 Corinna Vinschen <corinna@vinschen.de>
135 * autoload.cc (PrivilegeCheck): Define.
136 * fhandler.cc (fhandler_base::open): Always try opening with backup
137 resp. restore intent.
138 * fhandler_disk_file.cc (fhandler_disk_file::opendir): Always try
139 opening with backup intent.
140 (fhandler_disk_file::readdir): Ditto when trying to retrieve file id
142 * security.cc (check_file_access): Replace pbuf with correctly
143 PPRIVILEGE_SET typed pset. Check explicitely for backup and/or restore
144 privileges when AccessCheck fails, to circumvent AccessCheck
145 shortcoming. Add comment to explain.
147 2006-10-13 Christopher Faylor <cgf@timesys.com>
149 * winsup.h: Turn off DEBUGGING.
151 2006-10-13 Corinna Vinschen <corinna@vinschen.de>
153 * autoload.cc (Wow64DisableWow64FsRedirection): Define.
154 (Wow64RevertWow64FsRedirection): Define.
155 * security.cc (cygsuba_installed): New shared variable to store result
156 of cygsuba.dll installation test.
157 (subauth): Check if cygsuba.dll has been installed and registered
158 before issuing the (sub)authentication.
160 2006-10-12 Corinna Vinschen <corinna@vinschen.de>
162 * security.cc (create_token): Fix condition for source identifier.
164 2006-10-11 Corinna Vinschen <corinna@vinschen.de>
166 * select.cc (struct socketinf): Convert ser_num and w4 to dynamically
167 allocated arrays. Add max_w4 member to keep track.
168 (thread_socket): Make timeout depending on number of sockets to wait
169 for. Loop WFMO over all sockets.
170 (start_thread_socket): Handle any number of sockets. Fix typo. Don't
171 close socket event in out of memory condition.
172 (socket_cleanup): Free ser_num and w4.
174 2006-10-06 David Jade <d3@mutable.net>
176 * path.cc (path_conv::get_nt_native_path): Properly detect \\?\ paths.
177 (mount_info::conv_to_win32_path): Update comment.
178 * fhandler_disk_file.cc (path_conv::ndisk_links): Use backslashes
179 to make NT kernel functions work for \\?\GLOBALROOT paths.
181 2006-10-09 Corinna Vinschen <corinna@vinschen.de>
183 * devices.in: Raise number of handled serial ports to 64.
184 * devices.cc: Regenerate.
186 2006-09-17 Danny Smith <dannysmith@clear.net.nz>
188 * include/asm/byteorder.h: Correct typo.
190 2006-09-17 Danny Smith <dannysmith@clear.net.nz>
192 * include/asm/byteorder.h: Don't #define n* macros if -fnoinline is
195 2006-09-07 Christopher Faylor <cgf@timesys.com>
197 * environ.cc (build_env): Don't put an empty environment variable into
198 the environment. Optimize use of "len".
199 * errno.cc (ERROR_MORE_DATA): Translate to EMSGSIZE rather than EAGAIN.
201 2006-08-31 Corinna Vinschen <corinna@vinschen.de>
203 * grp.cc (initgroups32): Run get_server_groups under original token.
204 * syscalls.cc (seteuid32): Slightly reorganize code creating a token.
206 2006-08-27 Christopher Faylor <cgf@timesys.com>
208 * child_info.h (child_info_spawn::~child_info_spawn): Don't close
209 myself_pinfo handle when spawning.
211 2006-08-20 Corinna Vinschen <corinna@vinschen.de>
213 * fhandler_disk_file.cc (fhandler_disk_file::opendir): Fix formatting.
215 2006-08-20 Corinna Vinschen <corinna@vinschen.de>
217 * fhandler_disk_file.cc (DIR_NUM_ENTRIES): Set to 100 to maximize
218 performance on remote shares.
219 (fhandler_disk_file::opendir): Move comment about Samba weirdness into
220 fhandler_disk_file::readdir. Don't disallow
221 FileIdBothDirectoryInformation on Samba.
222 (fhandler_disk_file::readdir): Workaround Samba problem with
223 FileIdBothDirectoryInformation by rereading already read entries
224 using FileBothDirectoryInformation. Change comment about Samba
225 weirdness explaining this change.
227 2006-08-20 Hideki Iwamoto <h-iwamoto@kit.hi-ho.ne.jp>
229 * fhandler_disk_file.cc (fhandler_disk_file::pread): Properly check for
230 non-error return from lseek.
232 2006-08-17 Corinna Vinschen <corinna@vinschen.de>
234 * fhandler_serial.cc (raw_read): Evaluate minchars taking the
235 vmin_ > ulen case into account. Simplify evaluating the bytes to read.
236 Don't use bytes in Queue value from ClearCommError call in case vtime_
237 is > 0. Reformat GetOverlappedResult call. Simplify call to ReadFile.
239 2006-08-14 Corinna Vinschen <corinna@vinschen.de>
241 * security.cc (subauth): Initialize user_token to NULL. Add comment.
243 2006-08-11 Corinna Vinschen <corinna@vinschen.de>
245 * shared.cc (open_shared): Desperately try to get shared memory, only
246 when DEBUGGING enabled for now.
248 2006-08-10 Christopher Faylor <cgf@timesys.com>
250 * pinfo.cc (_onreturn::~onreturn): Don't attempt to close a NULL
253 2006-08-10 Christopher Faylor <cgf@timesys.com>
255 * winsup.h: Turn on DEBUGGING by default for now.
257 2006-08-10 Corinna Vinschen <corinna@vinschen.de>
259 * fhandler_disk_file.cc (fhandler_disk_file::lock): Handle
260 ERROR_NOT_LOCKED returned from UnlockFileEx.
262 2006-08-09 Corinna Vinschen <corinna@vinschen.de>
264 * path.h (SYMLINK_EA_NAME): Remove.
265 (SHORTCUT_HDR_SIZE): Ditto.
267 2006-08-09 Christopher Faylor <cgf@timesys.com>
269 * autoload.cc (GetHandleInformation): Declare new function.
270 (SetHandleInformation): Ditto.
271 * debug.cc (add_handle): Use SetHandleInformation to protect handle.
272 (close_handle): Use SetHandleInformation to unprotect handle.
274 * spawn.cc (spawn_guts): Move detached test outside of P_OVERLAY block.
276 2006-08-07 Corinna Vinschen <corinna@vinschen.de>
278 * autoload.cc (NtSetInformationFile): Define.
279 * cygwin.din: Export posix_fadvise and posix_fallocate.
280 * fhandler.cc (fhandler_base::fadvise): New method.
281 (fhandler_base::ftruncate): Add allow_truncate parameter.
282 * fhandler.h (class fhandler_base): Add fadvise method. Accomodate
283 new parameter to ftruncate.
284 (class fhandler_pipe): Add fadvise and ftruncate methods.
285 (class fhandler_disk_file): Add fadvise method. Accomodate new
286 parameter to ftruncate.
287 * fhandler_disk_file.cc (fhandler_disk_file::fadvise): New method.
288 (fhandler_disk_file::ftruncate): Accomodate new allow_truncate
289 parameter. Set EOF using NtSetInformationFile on NT.
290 * ntdll.h (struct _FILE_END_OF_FILE_INFORMATION): Define.
291 (NtSetInformationFile): Declare.
292 * pipe.cc (fhandler_pipe::fadvise): New method.
293 (fhandler_pipe::ftruncate): Ditto.
294 * syscalls.cc (posix_fadvise): New function.
295 (posix_fallocate): Ditto.
296 (ftruncate64): Accomodate second parameter to fhandler's ftruncate
298 * include/fcntl.h: Add POSIX_FADV_* flags. Add declarations of
299 posix_fadvise and posix_fallocate.
300 * include/cygwin/version.h: Bump API minor number.
302 2006-08-02 Christopher Faylor <cgf@timesys.com>
304 * environ.cc (env_win32_to_posix_path_list): Declare.
305 (conv_envvars): Use env_win32_to_posix_path_list rather than
306 cygwin_win32_to_posix_path_list.
307 (posify): Translate back to win32 path if errno is EIDRM.
308 * environ.h: Update copyright. Define ENV_CVT.
309 * path.cc (conv_path_list): If converting for the environment and
310 removed an element set errno to ENV_CVT.
311 (env_win32_to_posix_path_list): New function.
313 2006-08-01 Christopher Faylor <cgf@timesys.com>
315 * environ.cc (dos_file_warning): Declare.
316 (parse_thing): Add "dosfilewarning". Alphabetize.
317 * path.cc (normalize_posix_path): Return -1 when MS-DOS path detected.
318 (warn_msdos): New function.
319 (path_conv::check): Call if !PC_NOWARN and MS-DOS path detected.
320 (cygwin_conv_to_win32_path): Set PC_NOWARN when calling path_conv.
321 (cygwin_conv_to_full_win32_path): Ditto.
322 * path.h (pathconv_arg::PC_NOWARN): Define.
323 * shared_info.h (user_info::warned_msdos): New field.
324 (CURR_USER_MAGIC): Reset.
326 2006-07-31 Corinna Vinschen <corinna@vinschen.de>
328 * fhandler_socket.cc (fhandler_socket::recv_internal): Fix a problem
329 with poll(2) after shutdown(SHUT_RD) has been called on the local side.
330 * poll.cc (poll): Use POSIX type nfds_t for second parameter. Drop
331 special socket handling for POLLIN. Add comment to explain why.
332 * include/sys/poll.h: Declare nfds_t. Use as type for second parameter
333 in poll(2) declaration.
335 2006-07-31 Corinna Vinschen <corinna@vinschen.de>
337 * fhandler_socket.cc (fhandler_socket::evaluate_events): Circumvent
338 potential race condition.
339 (fhandler_socket::recv_internal): Fix MSG_PEEK bug on blocking sockets
340 and simplify recv loop.
341 (fhandler_socket::send_internal): Only lock when changing wsock_events.
343 2006-07-31 Corinna Vinschen <corinna@vinschen.de>
345 * autoload.cc: Drop LoadDLLprime for wsock32 since no wsock32 function
346 is used anymore. Drop all unused ws2_32.dll functions.
348 2006-07-28 Corinna Vinschen <corinna@vinschen.de>
350 * fhandler.h (struct wsa_event): Define here.
351 (class fhandler_socket): Make wsock_evt private again.
352 (fhandler_socket::wsock_event): New read accessor for wsock_evt.
353 (fhandler_socket::serial_number): New read accessor to get the
354 socket's serial number.
355 (fhandler_socket::ready_for_read): Just return true.
356 * fhandler_socket.cc (struct wsa_event): Move definition to fhandler.h.
357 * select.cc (struct socketinf): Add serial number vector.
358 (start_thread_socket): Identify duplicate sockets by their serial
359 number, not (wrongly) by their wsock_evt.
361 2006-07-27 Corinna Vinschen <corinna@vinschen.de>
363 * fhandler_socket.cc: Revert misguided attempt to handle FD_CLOSE error
364 conditions in evaluate_events.
365 (search_wsa_event_slot): Move wrongly placed memset in
366 fhandler_socket::init_events here.
367 (fhandler_socket::init_events): Initially set FD_WRITE event for
368 connectionless sockets.
369 * poll.cc (poll): Don't add sockets always to except_fds since select
370 is now supposed to do it right.
371 * select.cc (set_bits): Set connection state correctly for failed
372 af_local_connect on local sockets. Remove socket special handling
373 for except_selected descriptors.
374 (peek_socket): Try to set the read/write/exception bits actually
377 2006-07-27 Brian Ford <Brian.Ford@FlightSafety.com>
379 * fhandler_socket.cc (fhandler_socket::recvmsg): Remove unused tot
380 argument. All callers changed.
381 (fhandler_socket::sendmsg): Likewise.
382 * net.cc (cygwin_recvmsg): Likewise.
383 (cygwin_sendmsg): Likewise, and prevent calling sendmsg whith an
385 * fhandler.h (fhandler_socket::recvmsg): Adjust prototype.
386 (fhandler_socket::sendmsg): Likewise.
388 2006-07-27 Corinna Vinschen <corinna@vinschen.de>
390 * fhandler.h (class fhandler_socket): Remove prot_info_ptr.
391 (fhandler_socket::fixup_before_fork_exec): Remove.
392 (fhandler_socket::fixup_after_exec): Remove.
393 (fhandler_socket::need_fixup_before): Remove.
394 * fhandler_socket.cc (fhandler_socket::fhandler_socket): Drop
395 initializing prot_info_ptr. Remove unused code.
396 (fhandler_socket::~fhandler_socket): Drop free'ing prot_info_ptr.
397 (struct wsa_event): Rename connect_errorcode to errorcode.
398 (fhandler_socket::evaluate_events): Handle FD_CLOSE error condition
399 as FD_CONNECT error condition, except, never reset an FD_CLOSE error
400 condition. Always set FD_WRITE after successfully recorded FD_CONNECT.
401 (fhandler_socket::fixup_before_fork_exec): Remove.
402 (fhandler_socket::fixup_after_fork): Revert to using handle duplication.
403 (fhandler_socket::fixup_after_exec): Remove.
404 (fhandler_socket::dup): Revert to using handle duplication.
405 (fhandler_socket::send_internal): Only call wait_for_events in case
406 of WSAEWOULDBLOCK condition.
407 (fhandler_socket::set_close_on_exec): Call
408 fhandler_base::set_close_on_exec.
409 * net.cc (fdsock): Just set socket to inheritable on non-NT. Don't
410 call inc_need_fixup_before.
411 * select.cc (peek_socket): Don't set except_ready on every FD_CLOSE,
414 2006-07-26 Brian ford <Brian.Ford@FlightSafety.com>
416 * fhandler.cc (fhandler_base::read): Call get_readahead_into_buffer
417 instead of duplicating it.
419 2006-07-26 Corinna Vinschen <corinna@vinschen.de>
421 * shared.cc (offsets): Define as offsets relative to cygwin_hmodule
422 instead of addresses.
423 (off_addr): New macro.
424 (open_shared): Use offsets array accordingly. Remove unused code.
425 * shared_info.h (cygwin_shared_address): Remove.
427 2006-07-26 Corinna Vinschen <corinna@vinschen.de>
429 * cygheap.h (struct init_cygheap): Remove shared_h and mt_h members.
430 * fhandler_tape.cc (mt): Define as DLL shared area in
431 .cygwin_dll_common instead of as dynamically allocated area.
432 Change referencing throughout.
433 * mtinfo.h (mt_h): Remove entirely.
434 (mt): Remove extern declaration.
435 * shared.cc (cygwin_shared_area): New global cygwin_shared
436 variable located in .cygwin_dll_common.
437 (offsets): Define shared region addresses descending from
438 cygwin_shared_address.
439 (open_shared): Replace usage of SH_CYGWIN_SHARED by SH_USER_SHARED.
440 (memory_init): Set cygwin_shared just by pointing to cygwin_shared_area.
441 * shared_info.h (shared_locations): Remove SH_CYGWIN_SHARED and
443 (cygwin_shared_address): Define as DLL start address.
444 * tty.h (tty_min::tty_min): Remove constructor.
446 2006-07-25 Corinna Vinschen <corinna@vinschen.de>
448 * include/cygwin/in6.h: Guard in_port_t typedef more restrictive to
449 avoid compiler warning.
451 2006-07-25 Christopher Faylor <cgf@timesys.com>
453 * security.cc (get_logon_server): Remove nret and use dret for
454 everything to avoid a g++ warning.
456 2006-07-25 Corinna Vinschen <corinna@vinschen.de>
458 * include/cygwin/version.h: Bump DLL version to 1.7.0.
460 2006-07-25 Corinna Vinschen <corinna@vinschen.de>
463 * fhandler_socket.cc: Don't include select.h.
466 2006-07-25 Corinna Vinschen <corinna@vinschen.de>
468 * cygtls.h: Drop socket related includes.
469 (struct _local_storage): Remove exitsock and exitsock_sin. Add
471 * cygtls.cc: Accomodate above change throughout.
472 * fhandler.h (class fhandler_socket): Make wsock_evt public.
473 * fhandler_socket.cc (fhandler_socket::fhandler_socket): Accomodate
475 (fhandler_socket::evaluate_events): Drop FD_CONNECT event as soon as
476 it gets read once. Never remove FD_WRITE event here.
477 (fhandler_socket::wait_for_events): Wait 50 ms instead of INFINITE for
479 (fhandler_socket::accept): Fix conditional. Set wsock_events members
480 of accepted socket to useful start values.
481 (fhandler_socket::recv_internal): Always drop FD_READ/FD_OOB events from
482 wsock_events after the call to WSARecvFrom.
483 (fhandler_socket::send_internal): Drop FD_WRITE event from wsock_events
484 if the call to WSASendTo fails with WSAEWOULDBLOCK. Fix return value
486 * select.cc (struct socketinf): Change to accomodate using socket event
488 (peek_socket): Use event handling for peeking socket.
489 (thread_socket): Ditto.
490 (start_thread_socket): Ditto.
491 (socket_cleanup): Same here.
492 * tlsoffsets.h: Regenerate.
494 2006-07-23 Christopher Faylor <cgf@timesys.com>
496 * include/cygwin/version.h: Bump DLL minor version number to 22.
498 2006-07-20 Corinna Vinschen <corinna@vinschen.de>
500 * fhandler.h (class fhandler_socket): Rearrange slightly to keep
501 event handling methods and members together. Drop owner status flag.
502 Split wait method. Rename event handling methods for readability.
503 * fhandler_socket.cc (struct wsa_event): Add owner field.
504 (LOCK_EVENTS): New macro.
505 (UNLOCK_EVENTS): Ditto.
506 (fhandler_socket::init_events): rename from prepare.
507 (fhandler_socket::evaluate_events): First half of former wait method.
508 Do everything but wait. Allow specifiying whether or not events from
509 event_mask should be erased from wsock_events->events. Simplify
510 OOB handling. Allow sending SIGURG to any process (group).
511 (fhandler_socket::wait_for_events): Second half of former wait method.
512 Call evaluate_events and wait in a loop if socket is blocking.
513 (fhandler_socket::release_events): Rename from release.
514 (fhandler_socket::connect): Accomodate above name changes.
515 (fhandler_socket::accept): Ditto.
516 (fhandler_socket::recv_internal): Ditto.
517 (fhandler_socket::send_internal): Ditto.
518 (fhandler_socket::close): Ditto.
519 (fhandler_socket::fcntl): Always set owner to given input value on
520 F_SETOWN. Handle F_GETOWN.
521 * net.cc (fdsock): Accomodate above name changes.
523 2006-07-20 Corinna Vinschen <corinna@vinschen.de>
525 * fhandler_socket.cc (fhandler_socket::wait): Set Winsock errno to
526 WSAEWOULDBLOCK instead of WSAEINPROGRESS.
528 2006-07-19 Corinna Vinschen <corinna@vinschen.de>
530 * pinfo.cc (commune_process): Don't add extra \0 to cmdline.
531 (_pinfo::cmdline): Ditto process internal.
533 2006-07-19 Corinna Vinschen <corinna@vinschen.de>
535 * mmap.cc (msync): Disable rounding up len. Fix bug in access check
538 2006-07-19 Corinna Vinschen <corinna@vinschen.de>
540 * path.cc (symlink_worker): Return EEXIST if newpath exists.
542 2006-07-18 Christopher Faylor <cgf@timesys.com>
544 * tty.cc (tty_list::terminate): Don't enter the busy loop if we don't
547 2006-07-18 Silvio Laguzzi <slaguzzi@data-al.de>
549 * sec_acl.cc (acltotext32): Add missing handling of default ACL entry
552 2006-07-18 Brian Ford <Brian.Ford@FlightSafety.com>
553 Corinna Vinschen <corinna@vinschen.de>
555 * winsup.h (mmap_region_status): New enum.
556 (mmap_is_attached_or_noreserve_page): Adjust prototype and rename
558 * mmap.cc (mmap_is_attached_or_noreserve_page): Rename
559 mmap_is_attached_or_noreserve. Add region length parameter.
561 * exceptions.cc (_cygtls::handle_exceptions): Accomodate above.
562 * fhandler.cc (fhandler_base::raw_read): Call above for NOACCESS
563 errors and retry on success to allow reads into untouched
564 MAP_NORESERVE buffers.
566 2006-07-18 Corinna Vinschen <corinna@vinschen.de>
568 * fhandler_floppy.cc (fhandler_dev_floppy::ioctl): Fix typo in lint
571 2006-07-18 Corinna Vinschen <corinna@vinschen.de>
573 * cygwin.din (posix_openpt): Export.
574 * tty.cc (posix_openpt): New function.
575 * include/cygwin/stdlib.h (posix_openpt): Declare.
576 * include/cygwin/version.h: Bump API minor number.
578 2006-07-17 Christopher Faylor <cgf@timesys.com>
581 * cygheap.h (cygheap_user): Remove unneeded class names from function
583 * fhandler.h (fhandler_base): Ditto.
584 (fhandler_dev_floppy): Ditto.
585 (fhandler_console): Ditto.
586 * wininfo.h (wininfo): Ditto.
587 * exceptions.cc (sigpacket::process): Avoid compiler errors about gotos
589 * fhandler_fifo.cc (fhandler_fifo::open): Ditto.
590 * fhandler_floppy.cc (fhandler_dev_floppy::ioctl): Ditto.
591 * fhandler_tty.cc (fhandler_tty_slave::ioctl): Ditto.
592 * mmap.cc (mmap64): Ditto.
593 * pipe.cc (fhandler_pipe::open): Ditto.
594 * spawn.cc (spawn_guts): Ditto.
596 * sec_helper.cc: Fix some comments.
597 (get_null_sd): Move file-scope static to only function where it is
600 2006-07-14 Christopher Faylor <cgf@timesys.com>
602 * fork.cc (fork): Lock the process before forking to prevent things
603 like new fds from being opened, etc.
604 * sync.h (lock_process::dont_bother): New function.
606 2006-07-14 Christopher Faylor <cgf@timesys.com>
608 * include/cygwin/types.h: Update copyright.
610 2006-07-14 Christopher Faylor <cgf@timesys.com>
612 * cygwin.sc: Make sure there's something in the cygheap.
613 * dllfixdbg: Accommodate newer binutils which put the gnu_debuglink at
614 the end rather than at the beginning.
616 2006-07-14 Corinna Vinschen <corinna@vinschen.de>
618 * security.cc (get_token_group_sidlist): Always add the interactive
619 group to the token. Add comment. Create logon_id group SID by
620 copying it from incoming group list.
621 (create_token): Add subauth_token parameter. Use information in
622 subauth_token if present. Tweak SourceIdentifier if subauth_token
623 is present for debugging purposes.
624 * security.h (create_token): Add subauth_token parameter in declaration.
625 * syscalls.cc (seteuid32): Call subauth first. Call create_token
626 regardless. Use subauth token in call to create_token if subauth
629 2006-07-13 Christopher Faylor <cgf@timesys.com>
631 * sigproc.cc (waitq_head): Don't initialize to zero.
632 * sigproc.h: Update copyright, fix whitespace.
634 2006-07-13 Christopher Faylor <cgf@timesys.com>
636 * fhandler.cc (fhandler_base::raw_read): Only return EISDIR when we're
637 really trying to read a directory.
639 * sigproc.cc: Use "Static" where appropriate.
641 2006-07-13 Corinna Vinschen <corinna@vinschen.de>
643 * include/netinet/in.h: Update copyright.
645 2006-07-13 Corinna Vinschen <corinna@vinschen.de>
647 * fhandler_socket.cc: Update copyright.
648 * include/pthread.h: Ditto.
650 2006-07-13 Corinna Vinschen <corinna@vinschen.de>
652 * fhandler_socket.cc (fhandler_socket::wait): Rework function so that
653 WaitForMultipleObjects is really only called when necessary.
655 2006-07-13 Corinna Vinschen <corinna@vinschen.de>
657 * mmap.cc (mmap64): Drop MAP_NORESERVE flag for non-anonymous,
658 non-private mappings.
659 (mmap_record::unmap_pages): Only check noreserve flag which now implies
660 anonymous and private.
662 (fixup_mmaps_after_fork): Ditto.
664 2006-07-13 Corinna Vinschen <corinna@vinschen.de>
666 * mmap.cc (mmap64): Drop MAP_RESERVED flag for all non-anonymous,
667 non-private mappings.
669 2006-07-13 Corinna Vinschen <corinna@vinschen.de>
671 * exceptions.cc (_cygtls::handle_exceptions): Call new
672 mmap_is_attached_or_noreserve_page function in case of access violation
673 and allow application to retry access on noreserve pages.
674 * mmap.cc (mmap_is_attached_or_noreserve_page): Changed from
675 mmap_is_attached_page. Handle also noreserve pages now. Change
677 * winsup.h (mmap_is_attached_or_noreserve_page): Declare instead of
678 mmap_is_attached_page.
680 2006-07-12 Corinna Vinschen <corinna@vinschen.de>
682 * mmap.cc (mmap_record::alloc_page_map): Don't call VirtualProtect
683 on maps created with MAP_NORESERVE.
685 2006-07-12 Corinna Vinschen <corinna@vinschen.de>
687 * include/netdb.h: Declare rcmd, rcmd_af, rexec, rresvport,
688 rresvport_af, iruserok, iruserok_sa, ruserok.
690 2006-07-12 Corinna Vinschen <corinna@vinschen.de>
692 * Makefile.in (DLL_OFILES): Drop iruserok.o. Add rcmd.o.
693 * autoload.cc (rcmd): Drop definition.
694 * cygwin.din: Export bindresvport, bindresvport_sa, iruserok_sa,
695 rcmd_af, rresvport_af.
696 * net.cc (cygwin_rcmd): Remove.
697 (last_used_bindresvport): Rename from last_used_rrecvport.
698 (cygwin_bindresvport_sa): New function implementing bindresvport_sa.
699 (cygwin_bindresvport): New function implementing bindresvport.
700 (cygwin_rresvport): Remove.
701 * include/cygwin/version.h: Bump API minor number.
702 * include/netinet/in.h: Declare bindresvport and bindresvport_sa.
703 * libc/iruserok.c: Remove file.
704 * libc/rcmd.cc: New file implementing rcmd, rcmd_af, rresvport,
705 rresvport_af, iruserok_sa, iruserok and ruserok.
707 2006-07-12 Corinna Vinschen <corinna@vinschen.de>
709 * include/pthread.h: Define PTHREAD_PRIO_NONE, PTHREAD_PRIO_INHERIT and
710 PTHREAD_PRIO_PROTECT only if _POSIX_THREAD_PRIO_INHERIT is defined.
712 2006-07-12 Corinna Vinschen <corinna@vinschen.de>
714 * fhandler_socket.cc (fhandler_socket::getsockname): Return valid
715 result for unbound sockets.
717 2006-07-11 Corinna Vinschen <corinna@vinschen.de>
719 * fhandler_socket.cc (fhandler_socket::fixup_after_fork): Handle
720 wsock_mtx and wsock_evt on fork, thus handling close_on_exec correctly.
721 (fhandler_socket::fixup_after_exec): Drop misguided attempt to handle
723 (fhandler_socket::dup): Call fixup_after_fork with NULL parent.
725 (fhandler_socket::set_close_on_exec): Handle wsock_mtx and wsock_evt.
727 2006-07-10 Corinna Vinschen <corinna@vinschen.de>
729 * fhandler.h (class fhandler_socket): Add wsock_mtx, wsock_evt
730 and wsock_events members. Remove closed status flag, add listener
731 status flag. Accomodate new implementation of socket event handling
732 methods. Declare recv* and send* functions ssize_t as the POSIX
734 (fhandler_socket::recv_internal): Declare.
735 (fhandler_socket::send_internal): Ditto.
736 * fhandler_socket.cc (EVENT_MASK): Define mask of selected events.
737 (fhandler_socket::fhandler_socket): Initialize new members.
738 (fhandler_socket::af_local_setblocking): Don't actually set the
739 socket to blocking mode. Keep sane event selection.
740 (fhandler_socket::af_local_unsetblocking): Don't actually set the
741 socket to previous blocking setting, just remember it.
742 (struct wsa_event): New structure to keep event data per shared
744 (NUM_SOCKS): Define number of shared sockets concurrently handled by
745 all active Cygwin processes.
746 (wsa_events): New shared datastructure keeping all wsa_event records.
747 (socket_serial_number): New shared variable to identify shared sockets.
748 (wsa_slot_mtx): Global mutex to serialize wsa_events access.
749 (search_wsa_event_slot): New static function to select a new wsa_event
750 slot for a new socket.
751 (fhandler_socket::prepare): Rewrite. Prepare event selection
753 (fhandler_socket::wait): Rewrite. Wait for socket events in thread
754 safe and multiple process safe.
755 (fhandler_socket::release): Rewrite. Close per-socket descriptor
756 mutex handle and event handle.
757 (fhandler_socket::dup): Duplicate wsock_mtx and wsock_evt. Fix
758 copy-paste error in debug output.
759 (fhandler_socket::connect): Accomodate new event handling.
760 (fhandler_socket::listen): Set listener flag on successful listen.
761 (fhandler_socket::accept): Accomodate new event handling.
762 (fhandler_socket::recv_internal): New inline method centralizing
764 (fhandler_socket::recvfrom): Call recv_internal now.
765 (fhandler_socket::recvmsg): Ditto. Streamline copying from iovec
767 (fhandler_socket::send_internal): New inline method centralizing
769 (fhandler_socket::sendto): Call send_internal now.
770 (fhandler_socket::sendmsg): Ditto. Streamline copying from iovec
772 (fhandler_socket::close): Call release now.
773 (fhandler_socket::ioctl): Never actually switch to blocking mode.
774 Just keep track of the setting.
775 * net.cc (fdsock): Call prepare now.
776 (cygwin_connect): Revert again to event driven technique.
777 (cygwin_accept): Ditto.
778 * poll.cc (poll): Don't call recvfrom on a listening socket.
779 Remove special case for failing recvfrom.
780 * include/sys/socket.h: Declare recv* and send* functions ssize_t as
783 2006-07-10 Corinna Vinschen <corinna@vinschen.de>
785 * libc/inet_addr.c: Define __INSIDE_CYGWIN_NET__.
786 * libc/inet_network.c: Ditto.
788 2006-07-07 Corinna Vinschen <corinna@vinschen.de>
790 * fhandler_socket.cc (fhandler_socket::wait): Disable SA_RESTART
793 2006-07-07 Corinna Vinschen <corinna@vinschen.de>
795 * net.cc (cygwin_inet_ntop): Fix data type of forth parameter.
797 2006-07-07 Corinna Vinschen <corinna@vinschen.de>
799 * Makefile.in (DLL_OFILES): Add inet_addr.o and inet_network.o.
800 * autoload.cc (inet_addr): Drop definition.
802 * net.cc: Forward declare cygwin_inet_aton and cygwin_inet_ntop.
803 (cygwin_inet_ntoa): Call cygwin_inet_ntop instead of Winsock inet_ntoa.
804 (cygwin_inet_addr): Remove here.
805 (cygwin_inet_aton): Ditto.
806 (cygwin_inet_network): Ditto.
807 * libc/inet_addr.c: New file implementing cygwin_inet_aton and
809 * libc/inet_network.c: New file implementing cygwin_inet_network.
811 2006-07-06 Christopher Faylor <cgf@timesys.com>
813 * hookapi.cc: Add comment header
814 (putmem): Make static.
816 (rvadelta): Ditto. Don't assume that a section which ends where the
817 import_rva begins is the import list.
819 * child_info.h: Update copyright.
822 2006-07-06 Corinna Vinschen <corinna@vinschen.de>
824 * include/cygwin/in6.h (struct in6_addr): Fix typo.
826 2006-07-06 Corinna Vinschen <corinna@vinschen.de>
828 * cygwin.din: Export in6addr_any, in6addr_loopback, freeaddrinfo,
829 gai_strerror, getaddrinfo, getnameinfo.
830 * fhandler_socket.cc: Include cygwin/in6.h.
831 (get_inet_addr): Accomodate AF_INET6 usage.
832 (fhandler_socket::connect): Ditto.
833 (fhandler_socket::listen): Ditto.
834 (fhandler_socket::sendto): Ditto.
835 * net.cc: Include cygwin/in6.h.
836 (in6addr_any): Define.
837 (in6addr_loopback): Define.
838 (cygwin_socket): Accomodate AF_INET6 usage.
839 (socketpair): Bind socketpairs only to loopback for security.
840 (inet_pton4): New static function.
842 (cygwin_inet_pton): New AF_INET6 aware inet_pton implementation.
843 (inet_ntop4): New static function.
845 (cygwin_inet_ntop): New AF_INET6 aware inet_ntop implementation.
846 (ga_aistruct): New static function.
854 (ipv4_freeaddrinfo): Ditto.
855 (ipv4_getaddrinfo): Ditto.
856 (ipv4_getnameinfo): Ditto.
857 (gai_errmap_t): New structure holding error code - error string mapping.
858 (cygwin_gai_strerror): New function implementing gai_strerror.
859 (w32_to_gai_err): New static function.
860 (get_ipv6_funcs): Ditto.
861 (load_ipv6_funcs): Ditto.
862 (cygwin_freeaddrinfo): New function implementing freeaddrinfo.
863 (cygwin_getaddrinfo): New function implementing getaddrinfo.
864 (cygwin_getnameinfo): New function implementing getnameinfo.
865 * include/netdb.h: Include stdint.h and cygwin/socket.h. Define
866 data types and macros used by getaddrinfo and friends. Declare
867 freeaddrinfo, gai_strerror, getaddrinfo and getnameinfo.
868 * include/cygwin/in.h: Add IPv6 related IPPROTOs. Remove definition
869 of struct sockaddr_in6. Include cygwin/in6.h instead.
870 * include/cygwin/in6.h: New header file defining IPv6 releated
871 data types and macros.
872 * include/cygwin/socket.h: Enable AF_INET6 and PF_INET6. Add
873 IPv6 related socket options.
874 * include/cygwin/version.h: Bump API minor number.
876 2006-07-06 Corinna Vinschen <corinna@vinschen.de>
878 * autoload.cc (DsGetDcNameA): Define.
879 (NetGetAnyDCName): Define.
880 * security.cc: Include dsgetdc.h.
881 (DsGetDcNameA): Declare.
882 (DS_FORCE_REDISCOVERY): Define.
883 (get_logon_server): Add bool parameter to control rediscovery of DC.
884 Use DsGetDcNameA function if supported, NetGetDCName/NetGetAnyDCName
886 (get_server_groups): Rediscover DC if get_user_groups fails and
888 (get_reg_security): Use correct error code macro when testing
889 RegGetKeySecurity return value.
890 * security.h (get_logon_server): Remove default vaue from wserver
891 parameter. Add rediscovery parameter.
892 * uinfo.cc (cygheap_user::env_logsrv): Accomodate rediscovery parameter
893 in call to get_logon_server.
895 2006-07-05 Christopher Faylor <cgf@timesys.com>
897 * sortdin: Ignore all leading underscores when deriving a sort key.
898 * cygwin.din: Resort.
900 2006-07-05 Christopher Faylor <cgf@timesys.com>
902 * sortdin: New program.
905 2006-07-05 Corinna Vinschen <corinna@vinschen.de>
907 * fhandler.h (fhandler_socket::wait): Reset default timeout to 10ms.
909 2006-07-05 Corinna Vinschen <corinna@vinschen.de>
911 * path.cc (path_conv::check): Ignore has_ea setting, it's always unset
912 at this point anyway.
913 (get_symlink_ea): Remove.
914 (set_symlink_ea): Remove.
915 (symlink_worker): Drop writing symlink into NTFS extended attributes.
916 (symlink_info::check): Drop reading symlinks from NTFS extended
919 2006-07-04 Christopher Faylor <cgf@timesys.com>
921 * libc/rexec.cc (cygwin_rexec): Obvious (?) fix to correct a gcc
922 warning - set port to zero first thing in the function.
924 2006-07-04 Corinna Vinschen <corinna@vinschen.de>
926 * signal.cc (signal): Set sa_mask to sig.
928 2006-07-04 Corinna Vinschen <corinna@vinschen.de>
930 * Makefile.in (DLL_OFILES): Add rexec.o.
931 * autoload.cc (inet_network): Drop definition.
933 * net.cc (rexec): Drop extern declaration.
934 (inet_network): Ditto.
935 (cygwin_inet_network): Implement using inet_addr.
936 (cygwin_rexec): Remove.
937 * libc/rexec.cc: New file.
939 2006-07-04 Corinna Vinschen <corinna@vinschen.de>
941 * fhandler_socket.cc (fhandler_socket::listen): Allow listening on
944 2006-07-04 Corinna Vinschen <corinna@vinschen.de>
946 * fhandler.h (fhandler_socket::wait): Set default timeout to INFINITE.
948 2006-07-03 Corinna Vinschen <corinna@vinschen.de>
950 * autoload.cc (NtQueryEaFile): Define.
951 (NtSetEaFile): Define.
952 * fhandler.cc (fhandler_base::open): Use appropriate open flags
953 in query case when allow_ntea is set.
954 * ntdll.h (struct _FILE_GET_EA_INFORMATION): Define.
955 (struct _FILE_FULL_EA_INFORMATION): Define.
956 (NtQueryEaFile): Declare.
957 (NtSetEaFile): Declare.
958 * ntea.cc (read_ea): Rename from NTReadEA and rewrite using
960 (write_ea): Rename from NTWriteEA and rewrite using NtSetEaFile.
961 * path.cc (get_symlink_ea): Make static. Add handle parameter to
962 accomodate new read_ea call.
963 (set_symlink_ea): Make static. Add handle parameter to accomodate new
965 (symlink_worker): Call set_symlink_ea while file is still open.
966 (symlink_info::check): Call get_symlink_ea after file has been opened.
967 * security.cc (get_file_attribute): Accomodate new read_ea call.
968 (set_file_attribute): Accomodate new write_ea call.
969 * security.h (read_ea): Change declaration accordingly.
972 2006-07-03 Kazuhiro Fujieda <fujieda@jaist.ac.jp>
974 * fhandler.h (class dev_console): Add `metabit' indicating the
975 current meta key mode.
976 * fhandler_console.cc (fhandler_console::read): Set the top bit of
977 the character if metabit is true.
978 * fhandler_console.cc (fhandler_console::ioctl): Implement
979 KDGKBMETA and KDSKBMETA commands.
980 * fhandler_tty.cc (process_ioctl): Support KDSKBMETA.
981 (fhandler_tty_slave::ioctl): Send KDGKBMETA and KDSKBMETA to the
983 * include/cygwin/kd.h: New file for the meta key mode.
984 * include/sys/kd.h: New file.
986 2006-07-03 Eric Blake <ebb9@byu.net>
988 * include/stdint.h (UINT8_C, UINT16_C): Unsigned types smaller
989 than int promote to signed int.
991 2006-07-03 Corinna Vinschen <corinna@vinschen.de>
993 * net.cc (cygwin_sendto): Define appropriate parameters using
994 socklen_t type according to SUSv3.
995 (cygwin_recvfrom): Ditto.
996 (cygwin_setsockopt): Ditto.
997 (cygwin_getsockopt): Ditto.
998 (cygwin_connect): Ditto.
999 (cygwin_accept): Ditto.
1000 (cygwin_bind): Ditto.
1001 (cygwin_getsockname): Ditto.
1002 (cygwin_getpeername): Ditto.
1003 (cygwin_recv): Ditto.
1004 (cygwin_send): Ditto.
1005 * include/cygwin/socket.h (socklen_t): Typedef and define.
1006 * include/sys/socket.h: Declare socket functions using socklen_t type.
1008 2006-07-02 Christopher Faylor <cgf@timesys.com>
1010 * include/cygwin/version.h: Bump DLL minor version number to 21.
1012 2006-06-30 Corinna Vinschen <corinna@vinschen.de>
1014 * net.cc (cygwin_sendto): Allow zero-sized packets.
1015 (cygwin_sendmsg): Ditto.
1017 2006-06-26 Corinna Vinschen <corinna@vinschen.de>
1019 Revert patches from 2005-10-22 and 2006-06-14 to use event driven
1020 accept and connect back to using select:
1021 * fhandler.h (class fhandler_socket): Remove accept_mtx.
1022 * fhandler_socket.cc (fhandler_socket::fhandler_socket): Drop
1023 initializing accept_mtx.
1024 (fhandler_socket::accept): Drop event handling.
1025 (fhandler_socket.cc (fhandler_socket::connect): Ditto.
1026 (fhandler_socket::dup): Drop accept_mtx handling.
1027 (fhandler_socket::listen): Ditto.
1028 (fhandler_socket::prepare): Ditto.
1029 (fhandler_socket::release): Ditto.
1030 (fhandler_socket::close): Ditto.
1031 * net.cc (cygwin_accept): Revert to calling cygwin_select to
1032 implement interuptible accept.
1033 (cygwin_connect): Ditto for connect.
1035 2006-06-22 Christopher Faylor <cgf@timesys.com>
1037 * fhandler_fifo.cc (fhandler_fifo::open): Release process lock and grab
1038 a system-wide mutex to prevent a deadlock and a race.
1039 * sync.h (lock_process): Make fhandler_fifo a friend.
1041 * smallprint.c (__small_vsprintf): Cosmetic change.
1043 2006-06-15 Corinna Vinschen <corinna@vinschen.de>
1045 * cygwin.din: Export __srget_r, __swbuf_r.
1046 * include/cygwin/version.h: Bump API minor number to 156.
1048 2006-06-14 Corinna Vinschen <corinna@vinschen.de>
1050 * fhandler.h (class fhandler_socket): Add private mutex handle
1052 * fhandler_socket.cc (fhandler_socket::fhandler_socket): Initialize
1054 (fhandler_socket::dup): Duplicate accept_mtx, if available.
1055 (fhandler_socket::listen): Create accept_mtx before trying to listen.
1056 (fhandler_socket::prepare): Wait for accept_mtx if available to
1057 serialize accepts on the same socket.
1058 (fhandler_socket::release): Release accept_mtx.
1059 (fhandler_socket::close): Close accept_mtx on successful closesocket.
1061 2006-06-12 Christopher Faylor <cgf@timesys.com>
1063 * fhandler_tty.cc (fhandler_pty_master::close): Always close
1064 from_master/to_master since we always have copies of these handles.
1066 2006-06-12 Corinna Vinschen <corinna@vinschen.de>
1068 * include/sys/wait.h: Move definition of wait constants from here...
1069 * include/cygwin/wait.h: ...to here. New file.
1070 * include/cygwin/stdlib.h: Include cygwin/wait.h to conform with SUSv3.
1072 2006-06-12 Pierre Humblet Pierre.Humblet@ieee.org
1074 * heap.cc (heap_init): Only commit if allocsize is not zero.
1076 2006-06-12 Corinna Vinschen <corinna@vinschen.de>
1078 * net.cc (fdsock): Disable raising buffer sizes. Add comment to
1081 2006-06-04 Christopher Faylor <cgf@timesys.com>
1083 * ioctl.cc (ioctl): Accommodate change in reported pty master device
1085 * select.cc (peek_pipe): Ditto.
1087 2006-06-04 Christopher Faylor <cgf@timesys.com>
1089 * cygtls.h (CYGTLS_PADSIZE): Reset to a size that XP SP1 seems to like.
1090 * tlsoffsets.h: Regenerate.
1092 2006-06-03 Christopher Faylor <cgf@timesys.com>
1094 * cygthread.cc (cygthread::terminate_thread): In debugging output, use
1095 name of thread being terminated rather than thread doing the
1098 * fhandler.h (fhandler_pty_master::slave): Delete.
1099 (fhandler_pty_master::get_unit): Ditto.
1100 (fhandler_pty_master::setup): Change argument declaration to
1101 accommodate new usage.
1102 * fhandler_tty.cc (fhandler_tty_master::init): Remove obsolete slave
1103 assignment. Pass argument to setup indicating that this is a tty.
1104 (fhandler_tty_slave::open): Use dev() method rather than referencing
1106 (fhandler_pty_master::open): Don't create archetype based on ptym
1107 device number. Set device number to use DEV_TTYM_MAJOR and tty number.
1108 Pass argument to setup indicating that this is a pty.
1109 (fhandler_pty_master::setup): Change single argument to a flag
1110 indicating whether we're creating a pty and use appropriately.
1111 Calculate 't' variable here rather than in caller.
1113 * fhandler_dsp.cc (fhandler_dev_dsp::open): Use dev() method rather
1114 than referencing pc.dev directly.
1116 2006-06-03 Christopher Faylor <cgf@timesys.com>
1118 * dcrt0.cc (dll_crt0_0): Call tty_list::init_session here.
1119 (dll_crt0_1): Reflect renaming from tty_init to tty::init_session.
1120 (do_exit): Reflect moving of tty_terminate into tty_list.
1121 * exceptions.cc (events_init): Move tty_mutex stuff elsewhere.
1122 * fhandler_console.cc (set_console_title): Use lock_ttys class.
1123 * fhandler_termios.cc (fhandler_termios::bg_check): Make debug output
1125 * fhandler_tty.cc (fhandler_tty_slave::open): Reflect move of
1126 attach_tty into tty_list class. Don't attempt to grab master end of
1127 pty if master doesn't exist.
1128 (fhandler_pty_master::open): Reflect move of allocate_tty into tty_list
1129 class. Use lock_ttys::release to release mutex. Improve debugging
1131 (fhandler_pty_master::setup): Remove if 0'ed block. Fix argument to
1132 SetNamedPipeHandleState.
1133 * pinfo.cc (_pinfo::set_ctty): Lock ttys before setting sid/pgid.
1134 Improve debugging. Add temporary debugging.
1135 * tty.cc (tty_list::init_session): New function.
1136 (tty::init_session): Rename from tty_init. Reflect move of attach_tty
1138 (tty::create_master): Rename from create_tty_master.
1139 (tty_list::attach): Rename from attach_tty. Reflect renaming of
1140 connect_tty to connect. Ditto for allocate_tty.
1141 (tty_terminate): Delete.
1142 (tty_list::terminate): Subsume tty_terminate. Use lock_ttys rather
1143 than manipulating mutex directly.
1144 (tty_list::allocate): Rename from allocate_tty. Use lock_ttys rather
1145 than manipulating mutex directly. Don't set sid here since linux
1146 apparently doesn't do this. Reflect move of create_tty_master into
1148 (lock_ttys::lock_ttys): Define new constructor.
1149 (lock_ttys::release): New function.
1150 * tty.h (tty::exists): Return false immediately if !master_pid.
1151 (tty::set_master_closed): Define new function.
1152 (tty::create_master): Ditto.
1153 (tty::init_session): Ditto.
1154 (tty_list::mutex): New field.
1155 (tty_list::allocate): Define new function.
1156 (tty_list::connect): Ditto.
1157 (tty_list::attach): Ditto.
1158 (tty_list::init_session): Ditto.
1159 (lock_ttys): New class.
1160 (tty_init): Delete declaration.
1161 (tty_terminate): Ditto.
1162 (attach_tty): Ditto.
1163 (create_tty_master): Ditto.
1165 2006-06-03 Christopher Faylor <cgf@timesys.com>
1167 * Makefile.in (libdl.a): New library.
1169 2006-06-03 Christopher Faylor <cgf@timesys.com>
1171 * fhandler_tty.cc (fhandler_pty_master::close): Don't close handles if
1173 (fhandler_pty_master::setup): Make sure that original handle is closed
1174 when changing inheritance.
1175 (fhandler_pty_master::fixup_after_fork): Set from_master/to_master to
1177 (fhandler_pty_master::fixup_after_exec): Clear from_master/to_master
1180 2006-06-03 Christopher Faylor <cgf@timesys.com>
1182 * cygheap.cc (init_cygheap::close_ctty): Remove obsolete code.
1183 * dcrt0.cc (child_info_spawn::handle_spawn): Signal ready after we've
1184 run fixup_after_exec.
1185 * dtable.cc (dtable::fixup_after_exec): Add debugging output.
1186 * fhandler_tty.cc (fhandler_pty_master::doecho): Use class version of
1188 (fhandler_tty_common::close): Remove obsolete code.
1189 (fhandler_tty_slave::fixup_after_exec): Don't close, since this is done
1190 in dtable's fixup_after_exec. (revisit later?)
1191 (fhandler_pty_master::fixup_after_exec): Ditto.
1193 2006-06-02 Christopher Faylor <cgf@timesys.com>
1195 * cygtls.h (CYGTLS_PADSIZE): Bump up or suffer a regrettable collision
1196 with the call chain.
1197 * tlsoffsets.h: Regenerate.
1199 * dcrt0.cc (break_here): Define unconditionally for use elsewhere.
1200 Call DebugBreak, if appropriate.
1201 (initial_env): Rely on break_here() to call DebugBreak.
1202 * exceptions.cc (try_to_debug): Ditto.
1204 2006-06-02 Christopher Faylor <cgf@timesys.com>
1206 * fhandler.cc (fhandler_base::fixup_after_exec): Declare here.
1207 * fhandler.h (fhandler_base::fixup_after_exec): Make non-inline.
1208 (fhandler_termios::fixup_after_fork): Delete declaration.
1209 (fhandler_termios::fixup_after_exec): Ditto.
1210 (fhandler_tty_common::inuse): Remove.
1211 (fhandler_tty_common::dup): Delete declaration.
1212 (fhandler_tty_common::fixup_after_fork): Ditto.
1213 (fhandler_tty_slave::fixup_after_exec): Declare new function.
1214 (fhandler_pty_master::dwProcessId): New variable.
1215 (fhandler_pty_master::from_master): Ditto.
1216 (fhandler_pty_master::to_master): Ditto.
1217 (fhandler_pty_master::setup): New function.
1218 (fhandler_pty_master::fixup_after_fork): Ditto.
1219 (fhandler_pty_master::fixup_after_exec): Ditto.
1220 * fhandler_termios.cc (fhandler_termios::fixup_after_exec): Delete
1222 (fhandler_termios::fixup_after_fork): Ditto.
1223 * fhandler_tty.cc (fhandler_tty_master::init): Use fhandler_pty_master
1224 setup function rather than obsolete tty::common_init. Delete obsolete
1226 (fhandler_tty_slave::fhandler_tty_slave): Set inuse to NULL here.
1227 (fhandler_tty_slave::open): Change debugging output for clarity. Check
1228 for different things when doing a sanity check on the tty. Reflect the
1229 fact that master_pid now is the cygwin pid rather than the windows pid.
1230 Use "arch" rather than "archetype" for consistency.
1231 (fhandler_tty_slave::close): Close inuse here.
1232 (fhandler_tty_slave::dup): Remove old if 0'ed code.
1233 (fhandler_pty_master::dup): New function. Handles pty master
1235 (fhandler_pty_master::fhandler_pty_master): Zero pty_master specific
1237 (fhandler_pty_master::open): Implement using archetypes, similar to
1238 slave. Use fhandler_pty_master setup function rather than obsolete
1239 tty::common_init. Don't set inuse.
1240 (fhandler_tty_common::close): Don't deal with inuse. Delete old if
1242 (fhandler_pty_master::close): Implement using archetypes. Close
1243 from_master and to_master.
1244 (fhandler_tty_common::set_close_on_exec): Just set close_on_exec flag
1245 here since everything uses archetypes now.
1246 (fhandler_tty_common::fixup_after_fork): Delete definition.
1247 (fhandler_tty_slave::fixup_after_exec): Define new function.
1248 (fhandler_pty_master::setup): New function, derived from
1250 (fhandler_pty_master::fixup_after_fork): New function.
1251 (shared_info.h): Reset SHARED_INFO_CB to reflect new tty size.
1252 * tty.cc (tty_list::terminate): Close individual handles from
1254 (tty::master_alive): Delete.
1255 (tty::make_pipes): Ditto.
1256 (tty::common_init): Ditto.
1257 * tty.h (tty::from_slave): Delete.
1258 (tty::to_slave): Ditto.
1259 (tty::common_init): Delete declaration.
1260 (tty::make_pipes): Ditto.
1261 (tty::master_pid): Define as pid_t since it is now a cygwin pid.
1263 2006-06-01 Christopher Faylor <cgf@timesys.com>
1265 * cygheap.cc (cygheap_fixup_in_child): Don't close parent handle here.
1266 Let the caller do that.
1267 * dcrt0.cc (child_info_spawn::handle_spawn): Close parent handle here
1268 to allow fixup_after_exec functions to use it.
1270 * cygtls.cc (_cygtls::call2): Avoid calling exit thread if called with
1272 * cygtls.h (_cygtls::isinitialized): Check that we actually have a tls
1273 before seeing if it is initialized.
1274 * gendef (_sigfe_maybe): Ditto.
1275 * dcrt0.cc (dll_crt0_1): Remove static, use just one argument.
1276 * dll_init.cc (dllcrt0_info): New structure.
1277 (dll_dllcrt0): Change into a front-end to renamed dll_dllcrt0_1 so that
1278 we'll always be assured of having something like a tls.
1279 (dll_dllcrt0_1): New function, basically renamed from from dll_dllcrt0.
1280 Unconditionally call _my_tls.init_exception_handler now that we are
1281 assured of having a tls. Change variable name from "linking" to "linked".
1282 * winsup.h (dll_crt0_1): Declare.
1283 (dll_dllcrt0_1): Ditto.
1285 2006-05-30 Christopher Faylor <cgf@timesys.com>
1287 * cygtls.cc (_cygtls::call2): Don't call ExitThread on the main thread.
1289 2006-05-29 Christopher Faylor <cgf@timesys.com>
1291 * winf.h (MAXCYGWINCMDLEN): Set down size to 30000 or suffer fork
1294 2006-05-28 Christopher Faylor <cgf@timesys.com>
1296 * sigproc.cc (child_info::proc_retry): Mask all of the bits we're
1297 interested in, which includes bits above and below 0xc0000000.
1299 2006-05-27 Christopher Faylor <cgf@timesys.com>
1301 * dll_init.cc (dll_dllcrt0): Previous change didn't work very well with
1302 fork. Semi-revert it but change name of variable to something that
1305 2006-05-27 Christopher Faylor <cgf@timesys.com>
1307 * thread.cc (verifyable_object_isvalid): Check for NULL specifically.
1309 2006-05-27 Christopher Faylor <cgf@timesys.com>
1311 * dll_init.cc (dll_dllcrt0): Call _my_tls.init_exception_handler if
1312 we've finished initializing (Thanks to Gary Zablackis for noticing this
1313 problem). Just use cygwin_finished_initializing rather than defining a
1316 2006-05-25 Christopher Faylor <cgf@timesys.com>
1318 * debug.h (ModifyHandle): Define new macro.
1319 (modify_handle): Declare new function.
1320 * debug.cc (modify_handle): Define new function.
1321 * fhandler.h (fhandler_base::fork_fixup): Change return value from void
1323 * fhandler.cc (fhandler_base::fork_fixup): Return true if fork fixup has
1325 * pipe.cc (fhandler_pipe::set_close_on_exec): Set inheritance of
1326 protected handle via ModifyHandle if DEBUGGING.
1327 (fhandler_pipe::fixup_after_fork): Protect guard handle if fork fixup
1330 2006-05-24 Christopher Faylor <cgf@timesys.com>
1332 * cygtls.cc (_cygtls::call): Call call2 using _my_tls.
1333 (_cygtls::init_exception_handler): Always replace existing exception
1334 handler with cygwin exception handler.
1335 * cygtls.h (_cygtls::call2): Remove static designation.
1336 * dcrto.cc (dll_crt0_1): Define in a way that allows calling via
1338 (_initialize_main_tls): Delete.
1339 (_dll_crt0): Call dll_crt0_1 via cygtls::call. Set _main_tls here.
1340 * external.cc (cygwin_internal): Implement CW_CYGTLS_PADSIZE.
1341 * include/sys/cygwin.h (CW_CYGTLS_PADSIZE): Define.
1342 * tlsoffsets.h: Regenerate.
1344 2006-05-24 Christopher Faylor <cgf@timesys.com>
1346 * configure.in: Update to newer autoconf.
1347 (thanks to Steve Ellcey)
1348 * configure: Regenerate.
1349 * aclocal.m4: New file.
1351 2006-05-23 Lev Bishop <lev.bishop+cygwin@gmail.com>
1353 * fhandler.cc (readv): Remove nonsensical assert.
1355 2006-05-23 Christopher Faylor <cgf@timesys.com>
1357 * select.cc (start_thread_socket): Delay setting thread local exitsock
1358 until we know it's correct. Return correct value on error.
1360 2006-05-23 Lev Bishop <lev.bishop+cygwin@gmail.com>
1361 Christopher Faylor <cgf@timesys.com>
1363 * select.cc (start_thread_socket): Clean up exitsock in case of error.
1364 Use si->exitcode consistently.
1366 2006-05-21 Christopher Faylor <cgf@timesys.com>
1368 * child_info.h (_CI_SAW_CTRL_C): New enum.
1369 (CURR_CHILD_INFO_MAGIC): Reset.
1370 (saw_ctrl_c): New function.
1371 (set_saw_ctrl_c): Ditto.
1372 * sigproc.cc (child_info::proc_retry): Return EXITCODE_OK if we get
1373 STATUS_CONTROL_C_EXIT and we actually saw a CTRL-C.
1374 * spawn.cc (dwExeced): Delete.
1375 (chExeced): New variable.
1376 (spawn_guts): Set chExeced;
1377 * exceptions.cc (dwExeced): Delete declaration.
1378 (chExeced): Declare.
1379 (ctrl_c_handler): Detect if we're an exec stub process and set a flag,
1382 * fhandler_tty.cc (fhandler_tty_common::__release_output_mutex): Add
1383 extra DEBUGGING test.
1385 * pinfo.cc: Fix comment.
1387 2006-05-21 Christopher Faylor <cgf@timesys.com>
1389 * fhandle.h (fhandler_pipe::create_guard): Revert change which
1390 eliminated SECURITY_ATTRIBUTES argument.
1391 * pipe.cc (fhandler_pipe::open): Duplicate guard from other process and
1392 protect it appropriately. Eliminate unneeded writepipe_exists
1393 temporary variable. Set inheritance appropriately.
1394 (fhandler_pipe::set_close_on_exec): Revert change which eliminated
1395 handling guard inheritance.
1396 (fhandler_pipe::fixup_after_fork): Ditto. Use correct name of entity
1397 being checked by fork_fixup.
1398 (fhandler_pipe::fixup_after_exec): Don't bother with guard here.
1399 (fhandler_pipe::dup): Cosmetic changes and revert creation of
1400 writepipe_exists as noninheritable.
1401 (fhandler_pipe::create): Revert change which eliminated
1402 SECURITY_ATTRIBUTES argument. Revert change which always made
1403 writepipe_exists noninheritable.
1405 2006-05-21 Christopher Faylor <cgf@timesys.com>
1407 * debug.cc (add_handle): Print handle value when collision detected.
1408 * dtable.cc (dtable::stdio_init): Cosmetic change.
1409 * fhandler.h (fhandler_base::create_read_state): Protect handle.
1410 (fhandler_pipe::create_guard): Ditto. Always mark the handle as
1412 (fhandler_pipe::is_slow): Return boolean value rather than numeric 1.
1413 * pipe.cc (fhandler_pipe::fhandler_pipe): Always flag that we need fork
1415 (fhandler_pipe::open): Don't pass security attributes to create_guard.
1416 (fhandler_pipe::set_close_on_exec): Don't handle guard here.
1417 (fhandler_pipe::close): Accommodate now-protected guard handle.
1418 (fhandler_pipe::fixup_in_child): Don't protect read_state here.
1419 (fhandler_pipe::fixup_after_exec): Close guard handle if close_on_exec.
1420 (fhandler_pipe::fixup_after_fork): Don't bother with guard here.
1421 (fhandler_pipe::dup): Don't set res to non-error prematurely. Use
1422 boolean values where appropriate. Protect guard and read_state.
1423 (fhandler_pipe::create): Don't call need_fork_fixup since it is now the
1424 default. Don't protect read_state or guard.
1426 * pipe.cc (fhandler_base::ready_for_read): Use bool values for "avail".
1428 * spawn.cc (spawn_guts): Set cygheap->pid_handle as inheritable when
1431 2006-05-15 Lev Bishop <lev.bishop+cygwin@gmail.com>
1432 Christopher Faylor <cgf@timesys.com>
1434 * select.cc (fhandler_pipe::ready_for_read): Actually get the guard
1435 mutex for blocking reads.
1437 2006-05-20 Christopher Faylor <cgf@timesys.com>
1439 * fhandler_tty.cc (fhandler_tty::close): Remove problematic hExeced guard.
1441 2006-05-20 Christopher Faylor <cgf@timesys.com>
1443 * fhandler_tty.cc (fhandler_tty_slave::open): Reinstate call to
1444 need_invisible on first pty open.
1446 2006-05-18 Christopher Faylor <cgf@timesys.com>
1448 * fhandler_console.cc (fhandler_console::need_invisible): Allocate an
1449 invisible window station when ctty != TTY_CONSOLE.
1451 2006-05-16 Christopher Faylor <cgf@timesys.com>
1453 * cygtls.cc (_cygtls::remove): Don't test for initialization since
1454 this function will always be called when _my_tls is initialized.
1455 * init.cc (dll_entry): Don't attempt to remove tls info if _my_tls is
1456 obviously not even available.
1458 2006-05-15 Christopher Faylor <cgf@timesys.com>
1460 * sigproc.cc (no_signals_available): Detect hwait_sig ==
1461 INVALID_HANDLE_VALUE.
1462 (wait_sig): Set hwait_sig to INVALID_HANDLE_VALUE on __SIGEXIT.
1464 2006-05-15 Christopher Faylor <cgf@timesys.com>
1466 * cygtls.cc (_cygtls::init_thread): Zero entire _my_tls structure and
1468 * cygtls.h (_my_tls::padding): Delete.
1469 (CYGTLS_PADSIZE): Redefine concept of padding to mean padding at the
1471 * dcrt0.cc (initialize_main_tls): Change return to void.
1472 * gentls_offsets: Treat const specially, too. Keep going after a '}'
1473 is found. Change negative offset calculation to use CYGTLS_PADSIZE.
1474 * init.cc (_my_oldfunc): New variable.
1475 (threadfunc_fe): Use stored tls value for oldfunc rather than blindly
1476 writing to the stack.
1477 (munge_threadfunc): Set oldfunc in tls.
1478 (dll_entry): Initialize tls allocation.
1479 * tlsoffsets.h: Regenerate.
1481 2006-05-13 Christopher Faylor <cgf@timesys.com>
1483 * ntdll.h (STATUS_INVALID_INFO_CLASS): Conditionalize.
1485 2006-05-10 Brian Dessent <brian@dessent.net>
1487 * Makefile.in (clean): Also delete *.dbg.
1489 2006-05-08 Christian Franke <Christian.Franke@t-online.de>
1491 * fhandler_disk_file.cc (fhandler_disk_file::readdir): Fix typo which
1492 caused test for ".." to be skipped.
1494 2006-05-02 Christopher Faylor <cgf@timesys.com>
1496 * external.cc (cygwin_internal): Set errno on failure.
1498 2006-04-27 Corinna Vinschen <corinna@vinschen.de>
1500 * pipe.cc (DEFAULT_PIPEBUFSIZE): Raise to 64K.
1502 2006-04-26 Corinna Vinschen <corinna@vinschen.de>
1504 * fhandler.h (fhandler_base): Change fstat_helper prototype
1505 to take file size and inode number as 64 bit values.
1506 * fhandler_disk_file.cc (FS_IS_SAMBA): Move to path.cc
1507 (FS_IS_SAMBA_WITH_QUOTA): Ditto.
1508 (path_conv::hasgood_inode): Delete.
1509 (path_conv::is_samba): Delete.
1510 (path_conv::isgood_inode): Centralized function to recognize
1511 a good inode number.
1512 (fhandler_base::fstat_by_handle): Constify fvi_size and fai_size.
1513 Accomodate argument change in fstat_helper.
1514 (fhandler_base::fstat_by_name): Ditto.
1515 (fhandler_base::fstat_helper): Accomodate argument change. Call
1516 path_conv::isgood_inode to recognize good inodes.
1517 (fhandler_disk_file::opendir): Explain Samba weirdness here.
1518 Call path_conv::fs_is_samba instead of path_conv::is_samba.
1519 (fhandler_disk_file::readdir): Add STATUS_INVALID_INFO_CLASS
1520 as valid return code from NtQueryDirectoryFile to indicate that
1521 FileIdBothDirectoryInformation is not supported.
1522 Call path_conv::isgood_inode to recognize good inodes.
1523 * ntdll.h (STATUS_INVALID_INFO_CLASS): Define.
1524 * path.cc (fs_info::update): Rework file system recognition
1525 and set appropriate flags.
1526 * path.h (struct fs_info): Add is_ntfs, is_samba and is_nfs flags.
1527 Constify pure read accessors.
1529 2006-04-24 Christopher Faylor <cgf@timesys.com>
1531 * environ.cc (getearly): Force correct dereference order when
1532 inspecting environ table.
1534 2006-04-24 Corinna Vinschen <corinna@vinschen.de>
1536 * select.cc (thread_pipe): Raise sleep time only every 8th iteration.
1537 (thread_mailslot): Ditto.
1539 2006-04-23 Corinna Vinschen <corinna@vinschen.de>
1540 Christopher Faylor <cgf@timesys.com>
1542 * select.cc (thread_pipe): Raise sleep time dynamically to speed up
1543 select on pipes when copying lots of data.
1544 (thread_mailslot): Ditto for mailslots.
1546 2006-04-22 Christopher Faylor <cgf@timesys.com>
1548 * signal.cc (abort): On second thought, just set incyg once.
1550 2006-04-22 Christopher Faylor <cgf@timesys.com>
1552 * signal.cc (abort): Set incyg manually to help get a reliable gdb
1554 * cygwin.din (abort): Make NOSIGFE.
1556 2006-04-21 Pierre Humblet Pierre.Humblet@ieee.org
1557 Christopher Faylor <cgf@timesys.com>
1559 * environ.cc (getearly): Use GetEnvironmentVariable and cmalloc instead
1560 of GetEnvironmentStrings.
1561 (environ_init): Revert rawenv stuff.
1563 2006-04-21 Christopher Faylor <cgf@timesys.com>
1565 * environ.cc (rawenv): Make this variable a file-scope static.
1566 (getearly): Rename 's' variable to 'len' since 's' is used fairly
1567 consistently throughout cygwin as a string variable. Remove rawenv
1568 declaration. Perform other minor cleanups.
1569 (environ_init): Remove rawenv declaration. Only set rawenv to
1570 GetEnvironmentStrings() if it has not already been set. Properly free
1571 rawenv in all cases.
1573 2006-04-21 Christopher Faylor <cgf@timesys.com>
1575 * tty.h (tty::hwnd): Move to tty_min.
1576 (tty::gethwnd): Ditto.
1577 (tty::sethwnd): Ditto.
1578 (tty_min::hwnd): Receive variable from tty class.
1579 (tty_min::gethwnd): Receive function from tty classs.
1580 (tty_min::sethwnd): Ditto.
1581 * dtable.cc (dtable::stdio_init): Only call init_console_handler when
1582 we actually own the console.
1583 * fhandler_console.cc (fhandler_console::get_tty_stuff): Set tty's hwnd
1585 * fhandler_termios.cc (fhandler_termios::tcsetpgrp): Semi-reinstate
1586 handling of console when pgrp is set.
1588 2006-04-21 Pierre Humblet <Pierre.Humblet@ieee.org>
1589 Corinna Vinschen <corinna@vinschen.de>
1591 * environ.cc (getearly): New function.
1592 (findenv_func): New function pointer, predefined to getearly.
1593 (getenv): Call findenv function over the findenv_func pointer.
1594 (environ_init): Change findenv_func pointer to my_findenv after Cygwin
1595 environment is initialized.
1597 2006-04-21 Lars Munch <lars@segv.dk>
1599 * include/asm/byteorder.h (__ntohl): Fix the missing uint32_t.
1601 2006-04-21 Corinna Vinschen <corinna@vinschen.de>
1603 * fhandler_socket.cc (fhandler_socket::wait): Reorder setting
1604 WSAError to avoid spurious errors with WSAError set to 0.
1606 2006-04-21 Corinna Vinschen <corinna@vinschen.de>
1608 * include/asm/byteorder.h: Include stdint.h. Per standard, change
1609 datatypes in ntohX and htonX functions to uintXX_t types.
1611 2006-04-18 Christopher Faylor <cgf@timesys.com>
1613 * exceptions.cc (ctrl_c_handler): Only exit TRUE on CTRL_LOGOFF_EVENT
1614 when we have actually handled the event.
1616 2006-04-17 Eric Blake <ebb9@byu.net>
1618 * mktemp.cc (_gettemp): Open temp files in binary mode.
1620 2006-04-14 Corinna Vinschen <corinna@vinschen.de>
1622 * fhandler_disk_file.cc (fhandler_disk_file::readdir): Use UINT32_MAX
1623 instead of UINT_MAX.
1625 2006-04-14 Corinna Vinschen <corinna@vinschen.de>
1627 * fhandler_disk_file.cc (path_conv::hasgood_inode): Make inline.
1628 Drop remote fs handling entirely since unreliable inode numbers
1629 are now recognized differently.
1630 (path_conv::is_samba): Make inline.
1631 (fhandler_disk_file::opendir): Reformat comment.
1632 (fhandler_base::fstat_helper): Special case remote file systems
1633 returning (unreliable) 32 bit inode numbers.
1634 (fhandler_disk_file::readdir): Ditto.
1635 * fhandler_netdrive.cc (fhandler_netdrive::readdir): Ditto.
1637 2006-04-13 Christopher Faylor <cgf@timesys.com>
1639 * spawn.cc (spawn_guts): Move ch.set() call back to where it was
1642 2006-04-13 Corinna Vinschen <corinna@vinschen.de>
1644 * sysconf.cc (sysconf): Add _SC_THREADS, _SC_THREAD_ATTR_STACKSIZE,
1645 _SC_THREAD_PRIORITY_SCHEDULING, _SC_THREAD_PROCESS_SHARED,
1646 _SC_THREAD_SAFE_FUNCTIONS, _SC_TIMERS handling.
1648 2006-04-12 Corinna Vinschen <corinna@vinschen.de>
1649 Christopher Faylor <cgf@timesys.com>
1651 * spawn.cc (spawn_guts): Revert patch which treated derived cygwin
1652 programs differently from those which are mounted with -X. Pass extra
1653 argument to linebuf::fromargv.
1654 * winf.h (MAXCYGWINCMDLEN): New define.
1655 (linebuf::finish): Add a new argument denoting when command line
1657 (linebuf::fromargv): Ditto.
1658 * winf.cc (linebuf::finish): Implement above change.
1659 (linebuf::fromargv): Ditto.
1661 2006-04-11 Christopher Faylor <cgf@timesys.com>
1663 * Makefile.in (DLL_OFILES): Add winf.o.
1664 * spawn.cc: Move command line handling stuff into winf.cc.
1666 * winf.cc: New file.
1668 2006-04-05 Christopher Faylor <cgf@timesys.com>
1670 * fhandler_socket.cc: Move iptypes.h include after winsock2 since it
1674 2006-04-05 Christopher Faylor <cgf@timesys.com>
1676 * dcrt0.cc (dll_crt0_0): Move user_data->{resourcelocks,threadinterface}
1677 initialization here from dll_crt0_1.
1678 (dll_crt0_1): See above.
1680 2006-04-04 Corinna Vinschen <corinna@vinschen.de>
1682 * net.cc (fdsock): Raise default SO_RCVBUF/SO_SNDBUF buffer sizes to
1683 the same values as on Linux.
1685 2006-04-03 Christopher Faylor <cgf@timesys.com>
1687 * child_info.h (CURR_CHILD_INFO_MAGIC): Update.
1688 (child_info_fork::alloc_stack): Move into this class.
1689 (child_info_fork::alloc_stack_hard_way): Ditto.
1690 * dcrt0.cc (child_info_fork::alloc_stack): Ditto.
1691 (child_info_fork::alloc_stack_hard_way): Ditto.
1692 (_dll_crt0): Reference alloc_stack via fork_info.
1694 2006-04-03 Corinna Vinschen <corinna@vinschen.de>
1696 * spawn.cc (linebuf::finish): Drop argument. Don't check command line
1698 (spawn_guts): Remove wascygexec. Check real_path.iscygexec instead.
1699 Accommodate change to linebuf::finish.
1701 2006-04-03 Christopher Faylor <cgf@timesys.com>
1703 * dcrt0.cc (sm): Delete.
1704 (alloc_stack_hard_way): Figure out where the stack lives here rather
1705 than relying on previously filled out information which has been
1706 invalid since 1.5.19.
1708 2006-03-31 Corinna Vinschen <corinna@vinschen.de>
1710 * fhandler_disk_file.cc (FS_IS_SAMBA_WITH_QUOTA): New define.
1711 (path_conv::hasgood_inode): Recognize Samba with quota support
1713 (path_conv::is_samba): Ditto. Fix comment to include Samba version
1714 numbers for later reference.
1716 2006-03-30 Corinna Vinschen <corinna@vinschen.de>
1718 * security.h (sec_user_nih): Make sid1 argument mandatory.
1721 2006-03-29 Christopher Faylor <cgf@timesys.com>
1723 * sigproc.cc (wait_for_sigthread): Use the current user sid when
1724 setting up the signal pipe rather than relying on (eventually) the
1727 2006-03-29 Christopher Faylor <cgf@timesys.com>
1729 * dcrt0.cc (child_info_fork::handle_fork): Set uid/gid in myself so
1730 that it can be used by subsequent startup functions.
1731 (dll_crt0_0): Issue a warning if DuplicateTokenEx fails and DEBUGGING.
1732 (dll_crt0_1): Move user_data->{resourcelocks,threadinterface}
1733 initialization here from dll_crt0_0.
1734 * fork.cc (frok::child): Tell wait_for_sigthread that this is fork.
1735 (frok::parent): Only initialize start_time once. Tighten time when
1736 we're "deimpersonated".
1737 * sigproc.cc (signal_fixup_after_exec): Rework (futiley) sa_buf stuff.
1738 Add debugging output.
1739 (wait_for_sigthread): Accept an argument which illustrates whether we
1741 (wait_sig): Avoid using myself pointer.
1742 * winsup.h ((wait_for_sigthread): Reflect change to argument.
1744 2006-03-26 Christopher Faylor <cgf@timesys.com>
1746 * spawn.cc (spawn_guts): Close handles if we know that we will not be
1747 seeing a sync event from the child.
1749 2006-03-26 Christopher Faylor <cgf@timesys.com>
1751 * sigproc.cc (wait_sig): Move myself manipulation...
1752 (wait_for_sigthread): ...to here.
1754 2006-03-24 Corinna Vinschen <corinna@vinschen.de>
1756 * fhandler_floppy.cc: Include ntdef.h and ntdll.h.
1757 (fhandler_dev_floppy::get_drive_info): Rearrange so that now
1758 NtQueryVolumeInformationFile is called on drives which don't support
1759 IOCTL_DISK_GET_DRIVE_GEOMETRY.
1760 * ntdll.h (struct _FILE_FS_SIZE_INFORMATION): Add.
1761 (enum _FSINFOCLASS): Add missing values.
1763 2006-03-23 Christopher Faylor <cgf@timesys.com>
1765 * fhandler_console.cc (fhandler_console::fixup_after_fork_exec): Make
1766 error message more explicit.
1767 * pinfo.cc (_pinfo::commune_request): Don't lock process unless we're
1770 2006-03-23 Christopher Faylor <cgf@timesys.com>
1772 * dcrt0.cc (child_info_spawn::handle_spawn): Don't initialize the
1773 console handler here.
1774 * dtable.cc (dtable::stdio_init): Initialize console handler here.
1776 2006-03-23 Christopher Faylor <cgf@timesys.com>
1778 * sigproc.cc (sigalloc): Don't set SA_RESTART here.
1779 * signal.cc (_SA_NORESTART): New flag.
1780 (sigaction_worker): New function, derived from sigaction. Don't set
1781 internal flags unless called internally.
1782 (sigaction): Use sigaction_worker.
1783 (signal): Honor new _SA_NORESTART flag.
1784 (siginterrupt): Set _SA_NORESTART flag appropriately. Use
1785 sigaction_worker to set flags.
1786 * include/cygwin/signal.h: Define _SA_INTERNAL_MASK here.
1788 2006-03-22 Corinna Vinschen <corinna@vinschen.de>
1790 * thread.cc (pthread_mutex::is_good_initializer_or_bad_object): Delete.
1791 (pthread_cond::is_good_initializer_or_bad_object): Delete.
1792 (pthread_rwlock::is_good_initializer_or_bad_object): Delete.
1793 (pthread_cond::init): Remove disabled code. Guard assignment to
1794 object to initialize against access violation.
1795 (pthread_rwlock::init): Ditto.
1796 (pthread_mutex::init): Ditto.
1798 2006-03-22 Eric Blake <ebb9@byu.net>
1800 * fhandler.cc (fcntl): Print flags in hex.
1802 2006-03-22 Christopher Faylor <cgf@timesys.com>
1804 * dcrt0.cc (dll_crt0_0): Semi-revert 2006-03-14 change which moved
1805 pinfo_init and uinfo_init here.
1806 (dll_crt0_1): Ditto.
1807 (__dll_crt0): Ditto. Don't call update_envptrs here.
1808 (dll_crt0_1): Ditto. Move wait_for_sigthread call here from dll_crt0_0.
1809 * environ.cc (environ_init): Call it here instead.
1810 * sigproc.cc (my_readsig): New static variable.
1811 (wait_for_sigthread): Set up read pipe here since we are assured that
1812 we have the proper privileges when this is called.
1813 (talktome): Eliminate second argument since it is available as a global
1815 (wait_sig): Reflect use of my_readsig.
1817 2006-03-22 Corinna Vinschen <corinna@vinschen.de>
1819 * thread.cc (pthread_cond::init): Disable validity test of object
1820 to initialize since test of uninitialized content is unreliable.
1821 (pthread_rwlock::init): Ditto.
1822 (pthread_mutex::init): Ditto.
1824 2006-03-21 Christopher Faylor <cgf@timesys.com>
1826 * signal.cc (signal): Don't set SA_RESTART here.
1827 (siginterrupt): White space.
1828 * sigproc.cc (sigalloc): Set SA_RESTART here, on initialization.
1830 2006-03-21 Christopher Faylor <cgf@timesys.com>
1832 * child_info.h (child_status): Fix typo which made it impossible to set
1834 (child_info::isstraced): Booleanize.
1835 (child_info::iscygwin): Ditto.
1836 * sigproc.cc (child_info::child_info): Minor cleanup of flag setting.
1837 * spawn.cc (spawn_guts): Only close_all_files when we know the process
1838 has started successfully.
1840 * exceptions.cc (init_console_handler): Fix indentation.
1842 2006-03-20 Christopher Faylor <cgf@timesys.com>
1844 * dcrt0.cc (dll_crt0_0): Call SetErrorMode earlier.
1845 * pinfo.cc (_pinfo::dup_proc_pipe): Reset wr_proc_pipe on failure.
1846 Return previous pipe handle.
1847 * pinfo.h (_pinfo::dup_proc_pipe): Reflect change to return value.
1848 * spawn.cc (spawn_guts): Restore previous proc pipe on retry or if
1849 process exits before synchronization.
1851 2006-03-20 Christopher Faylor <cgf@timesys.com>
1853 * child_info.h (child_status): New enum.
1854 (child_info::flag): Rename from 'straced'.
1855 (child_info::isstraced): New function.
1856 (child_info::iscygwin): Ditto.
1857 (child_info_fork::handle_fork): Reparmize.
1858 (child_info_fork::handle_failure): Ditto.
1859 (child_info_spawn::handle_spawn): New function.
1860 * dcrt0.cc (get_cygwin_startup_info): Use isstraced method.
1861 (child_info_spawn::handle_spawn): Define new function from code
1862 previously in dll_crt0_0.
1863 (dll_crt0_0): Move spawn stuff into handle_spawn. Only call
1864 init_console_handler for fork case.
1865 * sigproc.cc (child_info::child_info): Set flag appropriately.
1866 (child_info::proc_retry): Treat exit code as "funny" if it's a cygwin
1868 * spawn.cc (spawn_guts): Remove commented out flag setting.
1870 2006-03-19 Christopher Faylor <cgf@timesys.com>
1872 * pinfo.cc (commune_process): Fix randomly invalid pointer which caused
1873 fifos to work incorrectly.
1875 2006-03-19 Christopher Faylor <cgf@timesys.com>
1877 * dcrt0.cc (dll_crt0_0): Oops. We need to bother with setting
1878 init_console_handler in the fork/exec case.
1880 2006-03-19 Christopher Faylor <cgf@timesys.com>
1882 * dcrt0.cc (dll_crt0_0): Don't bother with setting init_console_handler
1883 here since it will be set later when we discover if we have a ctty or
1885 * exceptions.cc (init_console_handler): Properly remove NULL handler.
1887 2006-03-18 Christopher Faylor <cgf@timesys.com>
1889 * pinfo.h (EXITCODE_OK): Define new constant.
1890 * sigproc.cc (child_info::sync): Return EXITCODE_OK if entering with
1892 (sig_send): Don't complain if sending signals while blocked if the
1893 sender isn't in the main thread.
1895 2006-03-18 Christopher Faylor <cgf@timesys.com>
1897 * child_info.h (CURR_CHILD_INFO_MAGIC): Regenerate.
1898 (child_info::retry): Move here from fork subclass.
1899 (child_info::exit_code): New field.
1900 (child_info::retry_count): Max retry count for process start.
1901 (child_info::proc_retry): Declare new function.
1902 (child_info_fork::retry): Move to parent.
1903 (child_info_fork::fork_retry): Ditto.
1904 * dcrt0.cc (child_info::fork_retry): Rename and move.
1905 (child_info_fork::handle_failure): Move.
1906 (dll_crt0_0): Initialize console handler based on whether we have a
1907 controlling tty or not. Avoid nonsensical check for fork where it can
1909 * environ.cc (set_proc_retry): Rename from set_fork_retry. Set
1910 retry_count in child_info.
1911 (parse_thing): Reflect above change.
1912 * exceptions.cc (dummy_ctrl_c_handler): Remove unused variable name.
1913 (ctrl_c_handler): Always return TRUE for the annoying
1915 * fhandler_termios.cc (fhandler_termios::tcsetpgrp): Remove call to
1916 init_console_handler.
1917 * fhandler_tty.cc (fhandler_tty_slave::open): Just call
1918 mange_console_count here and let it decide what to do with initializing
1919 console control handling.
1920 * fork.cc (fork_retry): Remove definition.
1921 (frok::parent): Define static errbuf and use in error messages (not
1922 thread safe yet). Close pi.hThread as soon as possible. Protect
1923 pi.hProcess as soon as possible. Don't set retry_count. That happens
1924 automatically in the constructor now. Accommodate name change from
1925 fork_retry to proc_retry.
1926 * init.cc (dll_entry): Turn off ctrl-c handling early until we know how
1927 it is supposed to be handled.
1928 * pinfo.cc (_pinfo::dup_proc_pipe): Remember original proc pipe value
1929 for failure error message. Tweak debug message slightly.
1930 * sigproc.cc (child_info::retry_count): Define.
1931 (child_info::child_info): Initialize retry count.
1932 (child_info::sync): Set exit code if process dies before
1934 (child_info::proc_retry): Rename from child_info_fork::fork_retry. Use
1935 previously derived exit code. Be more defensive about what is
1936 classified as an error exit.
1937 (child_info_fork::handle_failure): Move here from dcrt0.cc.
1938 * spawn.cc (spawn_guts): Maintain error mode when starting new process
1939 to avoid annoying pop ups. Move deimpersonate call within new loop.
1940 Move envblock freeing to end. Loop if process dies prematurely with
1942 * syscalls.cc (setpgid): Remove hopefully unneeded call to
1943 init_console_handler.
1945 2006-03-15 Christopher Faylor <cgf@timesys.com>
1947 * cygheap.cc (init_cygheap::manage_console_count): Turn console control
1948 handler on/off depending on whether we have allocated a console or not.
1949 * dcrt0.cc (child_info_fork::fork_retry): Add more potential retry
1951 (dll_crt0_0): Turn on/off console control depending on whether we have
1952 a controlling tty or not.
1953 * exceptions.cc (init_console_handler): Change BOOL to bool.
1954 * fhandler_console.cc (fhandler_console::need_invisible): Cosmetic
1956 * winsup.h (init_console_handler): Reflect argument type change.
1958 * wincap.h (supports_setconsolectrlhandler_null): Remove duplicate
1959 capability throughout.
1962 2006-03-14 Christopher Faylor <cgf@timesys.com>
1964 * child_info.h (child_info_fork::fork_retry): Declare new function.
1965 * dcrt0.cc (child_info_fork::fork_retry): Define new function.
1966 * fork.cc (frok::parent): Move retry decision into
1967 child_info_fork::fork_retry and honor what it tells us to do.
1968 * sigproc.cc (sig_send): Unhold signals on __SIGEXIT.
1970 2006-03-14 Christopher Faylor <cgf@timesys.com>
1972 * fork.cc (frok::parent): Improve error message.
1974 2006-03-14 Christopher Faylor <cgf@timesys.com>
1976 * dcrt0.cc (main_environ): Initialize to &__cygwin_environment.
1977 (dll_crt0_1): Move resourcelocks, thread interface, pinfo_init, and
1979 (dll_crt0_0): ...to here.
1980 (_dll_crt0): Call update_envptrs here after setting main_environ.
1981 * environ.cc (environ_init): Eliminate initted variable. Don't call
1982 update_envptrs here.
1983 * sigproc.cc (wait_sig): Use my_sendsig when calling CreatePipe to
1984 avoid a dereference.
1986 2006-03-13 Christopher Faylor <cgf@timesys.com>
1988 * child_info.h (child_info_fork::handle_failure): Declare new function.
1989 (child_info_fork::retry): New field.
1990 * dcrt0.cc (__api_fatal_exit_val): Define.
1991 (child_info_fork::handle_failure): Define new function.
1992 (__api_fatal): Exit using __api_fatal_exit_val value.
1993 * environ.cc (set_fork_retry): Set fork_retry based on CYGWIN
1994 environment variable.
1995 (parse_thing): Add "fork_retry" setting.
1996 * fork.cc (fork_retry): Define.
1997 (frok::parent): Reorganize to allow retry of failed child creation if
1998 child signalled that it was ok to do so.
1999 * heap.cc (heap_init): Signal parent via handle_failure when
2001 * pinfo.h (EXITCODE_RETRY): Declare.
2002 * sigproc.cc (child_info::sync): Properly exit with failure condition
2003 if called for fork and didn't see subproc_ready.
2004 * spawn.cc (spawn_guts): Use windows pid as first argument.
2005 * winsup.h: Remove obsolete NEW_MACRO_VARARGS define.
2006 (__api_fatal_exit_val): Declare.
2007 (set_api_fatal_return): Define.
2008 (in_dllentry): Declare.
2009 * exceptions.cc (inside_kernel): Remove unneeded in_dllentry
2012 2006-03-13 Christopher Faylor <cgf@timesys.com>
2014 * dcrt0.cc (dll_crt0_0): Reorganize so that sigproc_init is called a
2015 little later. Add a comment.
2016 * fork.cc (resume_child): Make void.
2017 (frok::parent): Only zero pi when necessary. Explicitly zero si. Set
2018 this_errno when child_copy fails. Accommodate change to resume_child.
2019 * sigproc.cc (sigalloc): Move global_sigs initialization here.
2020 (sigproc_init): Move global_sigs.
2021 (sig_send): Just check for flush signals once.
2023 * wincap.h: Define supports_setconsolectrlhandler_null throughout.
2026 2006-03-13 Corinna Vinschen <corinna@vinschen.de>
2028 * autoload.cc (LoadDLLfuncNt): New define to wrap NT native functions.
2029 Use for NT native functions throughout.
2030 * dtable.cc (handle_to_fn): Treat return value of NtQueryObject as
2033 2006-03-12 Christopher Faylor <cgf@timesys.com>
2035 * cygtls.cc (_cygtls::remove): Reset initialized flag right away if we
2036 were previously initialized.
2037 * cygtls.h (_cygtls::initialized): Move nearer to the end to catch
2038 situation when Windows 98 mysteriously changes parts of _my_tls when
2039 thread is detaching.
2040 * gendef (__sigfe_maybe): Simplify slightly.
2041 * tlsoffsets.h: Regenerate.
2043 2006-03-12 Christopher Faylor <cgf@timesys.com>
2045 * cygtls.h (CYGTLS_INITIALIZED): Change to a little more unlikely value.
2046 (CYGTLSMAGIC): Delete.
2047 * dcrt0.cc (dll_crt0_0): Call sigproc_init during init startup.
2048 (_dll_crt0): Don't worry about sync_startup. Just wait for sigthread here.
2049 * dll_init.cc (cygwin_detach_dll): Only pick up tls version of retaddr
2050 if we have a valid tls.
2051 * fork.cc (frok::child): Remove sigproc_init initialization since it
2052 happens much earlier now.
2053 * gendef: Recognize SIGFE_MAYBE.
2054 (fefunc): Generate calls to _sigfe_maybe, if appropriate.
2055 (_sigfe_maybe): New function.
2056 * init.cc (search_for): Always initialize search_for, even on fork.
2057 (calibration_thread): Delete.
2058 (calibration_id): Delete.
2059 (prime_threads): Delete.
2060 (munge_threadfunc): Remove calibration_thread special case. Avoid
2061 calling thread function if we haven't yet hit the "search_for" thread.
2062 (dll_entry): Remove prime_threads call. Only call munge_threadfunc
2063 when hwait_sig is active. Ditto. for _my_tls.remove ();
2064 * sigproc.cc (hwait_sig): Make global.
2065 (sigproc_init): Don't bother with sync_startup.
2066 (sig_send): Treat flush as a no-op when signals are held.
2067 (wait_sig): Cause signals to be held after fork.
2069 2006-03-09 Corinna Vinschen <corinna@vinschen.de>
2071 * syscalls.cc (rename): Move existance check for oldpath further up
2072 to the start of the function. Avoid another case of a name collision
2073 if oldpath is a shortcut and a file or directory newpath already exists.
2075 2006-03-09 Corinna Vinschen <corinna@vinschen.de>
2077 * autoload.cc (NtClose): Define.
2078 (NtOpenDirectoryObject): Define.
2079 (NtQueryDirectoryObject): Define.
2080 * fhandler_proc.cc: Include ctype.h and wchar.h.
2081 (format_proc_partitions): Revamp loop over existing harddisks by
2082 scanning the NT native \Device object directory and looking for
2084 * ntdll.h: Rearrange system call declarations alphabetically.
2085 (DIRECTORY_QUERY): Define.
2086 (struct _DIRECTORY_BASIC_INFORMATION): Define.
2087 (NtOpenDirectoryObject): Declare.
2088 (NtQueryDirectoryObject): Declare.
2090 2006-03-08 Christopher Faylor <cgf@timesys.com>
2092 * cygtls.h (_cygtls::retaddr): New method.
2093 * dll_init.cc (cygwin_detach_dll): Use new tls method to find return
2094 address since this function is now signal guarded.
2095 (update_envptrs): Remove unneeded braces.
2096 * syscalls.cc (statvfs): Coerce full_path to avoid a gcc warning.
2098 2006-03-08 Corinna Vinschen <corinna@vinschen.de>
2100 * syscalls.cc (statvfs): Simplify path name expression.
2102 2006-03-08 Corinna Vinschen <corinna@vinschen.de>
2104 * syscalls.cc: Include winioctl.h.
2105 (statvfs): Request correct volume size using DeviceIoControl if
2106 quotas are enforced on the file system.
2108 2006-03-03 Corinna Vinschen <corinna@vinschen.de>
2110 * dir.cc (opendir): Fix indentation.
2111 * fhandler_disk_file.cc (fhandler_disk_file::opendir): Move storing
2112 fhandler in file descriptor table to some point very late in function
2113 to avoid double free'ing. Add comment to explain what happens.
2114 Add label free_mounts and don't forget to delete __DIR_mounts structure
2115 if NtOpenFile fails.
2117 2006-03-02 Corinna Vinschen <corinna@vinschen.de>
2119 * syscalls.cc (chroot): Disallow chroot into special directories.
2120 Return EPERM instead.
2122 2006-03-02 Corinna Vinschen <corinna@vinschen.de>
2124 * fhandler_disk_file.cc (__DIR_mounts::check_missing_mount): Check
2125 cygdrive string length for those who have cygdrive mapped to "/".
2127 2006-03-01 Corinna Vinschen <corinna@vinschen.de>
2129 * sec_helper.cc (set_cygwin_privileges): Request SE_BACKUP_NAME
2132 2006-03-01 Corinna Vinschen <corinna@vinschen.de>
2134 * fhandler_proc.cc (fhandler_proc::fstat): Always return fixed link
2135 count of 1 for /proc directory instead of incorrect PROC_LINK_COUNT.
2137 2006-03-01 Corinna Vinschen <corinna@vinschen.de>
2139 * fhandler.h (enum dirent_states): Remove dirent_saw_cygdrive,
2140 dirent_saw_dev and dirent_saw_proc.
2141 (fhandler_cygdrive::open): Declare.
2142 (fhandler_cygdrive::close): Declare.
2143 * fhandler_disk_file.cc (class __DIR_mounts): Move to beginning of file.
2144 (__DIR_mounts::check_mount): New parameter to indicate if inode number
2145 is needed in calling function or not. Add /proc and /cygdrive handling.
2146 (__DIR_mounts::check_missing_mount): Ditto.
2147 (path_conv::ndisk_links): Use __DIR_mounts class to create correct
2148 hardlink count for directories with mount points in them.
2149 (fhandler_disk_file::readdir_helper): Remove /dev, /proc and /cygdrive
2151 (fhandler_cygdrive::open): New method.
2152 (fhandler_cygdrive::close): New method.
2153 (fhandler_cygdrive::fstat): Always return fixed inode number 2 and
2154 fixed link count of 1. Drop call to set_drives.
2155 (fhandler_cygdrive::opendir): Drop call to get_namehash.
2156 (fhandler_cygdrive::readdir): Handle "." entry to return fixed inode
2159 2006-03-01 Christopher Faylor <cgf@timesys.com>
2161 * cygwin.din: Fix some erroneous SIGFE/NOSIGFE settings.
2163 2006-03-01 Christopher Faylor <cgf@timesys.com>
2165 * cygthread.cc (cygthread::callfunc): Revert below change. Make ev a
2166 manual reset event again. so that it will be reset by WaitFor*Object
2168 (cygthread::stub): Ditto.
2169 (cygthread::terminate_thread): Reset ev if it was found to have been
2172 2006-03-01 Christopher Faylor <cgf@timesys.com>
2174 * analyze_sigfe: New script.
2175 * dllfixdbg: Add copyright.
2177 * gendevices: Ditto.
2178 * gentls_offsets: Ditto.
2180 2006-03-01 Christopher Faylor <cgf@timesys.com>
2182 * cygthread.cc (cygthread::callfunc): Create ev as an auto-reset event
2183 so that it will be reset by WaitFor*Object as appropriate.
2184 (cygthread::stub): Ditto.
2185 (cygthread::terminate_thread): Remove forced setting of thread
2188 2006-03-01 Corinna Vinschen <corinna@vinschen.de>
2190 * include/sys/dirent.h (struct __DIR): Rename __d_unused to
2192 * fhandler_disk_file.cc (struct __DIR_cache): Remove useless "typedef".
2193 (d_dirname): Remove useless "struct".
2194 (d_cachepos): Ditto.
2196 (class __DIR_mounts): New class, implementing mount point tracking
2198 (d_mounts): New macro for easy access to __DIR_mounts structure.
2199 (fhandler_disk_file::opendir): Allocate __DIR_mounts structure and
2200 let __d_internal element of dir point to it.
2201 (fhandler_disk_file::readdir_helper): Add mount points in the current
2202 directory, which don't have a real directory backing them.
2203 Don't generate an inode number for /dev. Add comment, why.
2204 (fhandler_disk_file::readdir): Move filling fname to an earlier point.
2205 Check if current entry is a mount point and evaluate correct inode
2207 (fhandler_disk_file::readdir_9x): Ditto.
2208 (fhandler_disk_file::rewinddir): Set all mount points in this directory
2209 to "not found" so that they are listed again after calling rewinddir().
2210 (fhandler_disk_file::closedir): Deallocate __DIR_mounts structure.
2211 * path.cc (mount_info::get_mounts_here): New method to evaluate a list
2212 of mount points in a given parent directory.
2213 * shared_info.h (class mount_info): Declare get_mounts_here.
2215 2006-02-28 Corinna Vinschen <corinna@vinschen.de>
2217 * fhandler_disk_file.cc (fhandler_disk_file::opendir): Use iscygdrive
2218 instead of isspecial.
2219 * path.h (path_conv::iscygdrive): New method.
2221 2006-02-28 Christopher Faylor <cgf@timesys.com>
2223 * exceptions.cc (_cygtls::interrupt_now): Remove "inside cygwin" check
2224 since some cygwin functions are meant to be interrupted.
2226 2006-02-28 Corinna Vinschen <corinna@vinschen.de>
2228 * cygwin.din: Export __isinff, __isinfd, __isnanf, __isnand.
2229 * include/cygwin/version.h: Bump API minor number to 155.
2231 2006-02-28 Corinna Vinschen <corinna@vinschen.de>
2233 * dir.cc (readdir_worker): Use slash as path separator when evaluating
2234 namehash for paths below /proc.
2235 * fhandler_netdrive.cc (fhandler_netdrive::readdir): Use expensive
2236 inode number evaluation on share names.
2238 2006-02-27 Christopher Faylor <cgf@timesys.com>
2240 * fhandler_disk_file.cc (fhandler_disk_file::opendir): Only set
2241 d_cachepos under NT or suffer memory corruption.
2242 (fhandler_disk_file::readdir_helper): Avoid else with a return. Just
2243 calculate extension location once when doing symlink checks.
2244 (fhandler_disk_file::readdir): Make debug output more useful.
2245 (fhandler_disk_file::readdir_9x): Ditto. Eliminate redundant variable.
2247 2006-02-27 Christopher Faylor <cgf@timesys.com>
2249 * include/sys/termios.h (cfsetispeed): Just define as a function rather
2250 than resorting to a macro.
2251 (cfsetospeed): Ditto.
2253 2006-02-27 Christopher Faylor <cgf@timesys.com>
2255 * sigproc.cc: Fix a comment.
2257 2006-02-27 Christopher Faylor <cgf@timesys.com>
2259 * cygthread.cc (cygthread::release): Add a comment.
2261 2006-02-27 Corinna Vinschen <corinna@vinschen.de>
2263 * fhandler_netdrive.cc (fhandler_netdrive::fstat): Create unambiguous
2265 (fhandler_netdrive::readdir): Ditto.
2267 2006-02-24 Christopher Faylor <cgf@timesys.com>
2269 * sigproc.cc (sigheld): Define new variable.
2270 (sig_dispatch_pending): Don't check sigq since that's racy.
2271 (sig_send): Set sigheld flag if __SIGHOLD is specified, reset it if
2272 __SIGNOHOLD is specified. Ignore flush signals if we're holding
2275 2006-02-23 Christopher Faylor <cgf@timesys.com>
2277 * cygwin.din (_exit): Use signal front end.
2280 2006-02-23 Christopher Faylor <cgf@timesys.com>
2282 * winsup.h (cygwin_hmodule): Declare.
2283 * exceptions.cc (inside_kernel): Reverse return values to reflect
2284 function name. Return true if we're in cygwin1.dll or if we're
2285 executing in dll_entry.
2286 (_cygtls::interrupt_now): Reflect reversal of inside_kernel return
2288 * hookapi.cc (cygwin_hmodule): Remove declaration.
2289 * init.cc (dll_entry): Use in_dllentry global to record that we are
2290 executing in dllentry.
2292 2006-02-22 Corinna Vinschen <corinna@vinschen.de>
2294 * exceptions.cc (_cygtls::interrupt_now): Reorder conditional
2295 to call inside_kernel only if this isn't locked.
2297 2006-02-22 Corinna Vinschen <corinna@vinschen.de>
2299 * fhandler.cc (fhandler_base::open): Add FILE_READ_ATTRIBUTES to
2300 access flags in case of query_read_control case, add FILE_READ_DATA
2301 in case of query_stat_control.
2303 2006-02-20 Christopher Faylor <cgf@timesys.com>
2305 * spawn.cc (av::fixup): Check for .bat and friends specifically now
2306 since these extensions are no longer automatically detected.
2308 2006-02-19 Christopher Faylor <cgf@timesys.com>
2310 * exceptions.cc (stackdump): Avoid dumping more than once.
2312 2006-02-19 Christopher Faylor <cgf@timesys.com>
2314 * fhandler_disk_file.cc (fhandler_disk_file::opendir): Use NtOpenFile
2315 to open the directory.
2316 (fhandler_disk_file::readdir): Use NT_SUCCESS to determine if status
2319 2006-02-19 Corinna Vinschen <corinna@vinschen.de>
2321 * fhandler_disk_file.cc (fhandler_disk_file::opendir): Drop generating
2324 2006-02-18 Corinna Vinschen <corinna@vinschen.de>
2326 * fhandler_disk_file.cc (FS_IS_SAMBA): Move out of
2327 path_conv::hasgood_inode.
2328 (path_conv::is_samba): New method.
2329 (fhandler_base::fstat_by_handle): Don't even try to use
2330 FileIdBothDirectoryInformation on Samba.
2331 * path.h (class path_conv): Declare is_samba method.
2333 2006-02-17 Christopher Faylor <cgf@timesys.com>
2335 * path.cc (conv_path_list): Eat empty paths when converting to POSIX.
2336 (cygwin_conv_to_win32_path): Deal with Cygwin's necessity of adding a
2337 '/' to the end of a path ending in '.'.
2339 2006-02-16 Corinna Vinschen <corinna@vinschen.de>
2341 * cygwin.din: Export sigignore and sigset.
2342 * exceptions.cc (sigset): New function.
2343 (sigignore): New function.
2344 * include/cygwin/signal.h (SIG_HOLD): Define.
2345 (sigignore): Declare.
2347 * include/cygwin/version.h: Bump API minor number to 154.
2349 2006-02-13 Igor Peshansky <pechtcha@cs.nyu.edu>
2351 * include/mntent.h: Add missing #include.
2353 2006-02-13 Igor Peshansky <pechtcha@cs.nyu.edu>
2355 * gentls_offsets: Fix typo in error message.
2357 2006-02-10 Christopher Faylor <cgf@timesys.com>
2359 * fhandler_process.cc (format_process_stat): Use cygwin-derived start
2360 time even on NT since it is the logical start time of the "process".
2361 * pinfo.cc (set_myself): Don't set start time when it should have
2362 already been set previously.
2364 2006-02-10 Brian Ford <Brian.Ford@FlightSafety.com>
2366 * times.cc (clock_getres): Use correct conversion from milliseconds to
2367 seconds/nanoseconds.
2368 (clock_setres): Use correct conversion to nanoseconds.
2370 2006-02-10 Christopher Faylor <cgf@timesys.com>
2372 * external.cc (sync_winenv): Rename from "setup_winenv". Use same
2373 mechanism as spawn to determine environment variables which should be
2374 converted back to windows form.
2375 (cygwin_internal): Reflect setup_winenv -> sync_winenv name change.
2376 * include/sys/cygwin.h: Ditto.
2378 2006-02-09 Corinna Vinschen <corinna@vinschen.de>
2380 * fhandler_disk_file.cc (fhandler_disk_file::opendir): Only set
2381 the dirent_get_d_ino flag on filesystems having useful File IDs.
2382 Add comment explaining why.
2384 2006-02-07 Corinna Vinschen <corinna@vinschen.de>
2386 * dtable.cc (handle_to_fn): Accommodate new argument order in call to
2388 * fhandler_disk_file.cc (fhandler_disk_file::readdir): Call sys_wcstombs
2389 instead of just wcstombs to accommodate OEM codepages.
2390 * miscfuncs.cc (sys_wcstombs): Split len argument in source and target
2391 length. Always 0-terminate result in target string.
2392 * security.cc (lsa2wchar): Remove unused function.
2394 (get_lsa_srv_inf): Ditto.
2395 (get_logon_server): Accommodate new argument order in call to
2397 (get_user_groups): Ditto.
2398 (get_user_local_groups): Ditto.
2399 (get_priv_list): Call sys_wcstombs directly instead of lsa2str.
2400 * uinfo.cc (cygheap_user::ontherange): Accommodate new argument order
2401 in call to sys_wcstombs.
2402 * winsup.h (sys_wcstombs): Change prototype to match new argument order.
2404 2006-02-07 Corinna Vinschen <corinna@vinschen.de>
2406 * init.cc (respawn_wow64_process): Exit with the exit code returned
2407 by the respawned process.
2409 2006-02-06 Christopher Faylor <cgf@timesys.com>
2411 Always zero all elements of siginfo_t throughout.
2412 * cygtls.h (_cygtls::thread_context): Declare new field.
2413 (_cygtls::thread_id): Ditto.
2414 (_cygtls::signal_exit): Move into this class.
2415 (_cygtls::copy_context): Declare new function.
2416 (_cygtls::signal_debugger): Ditto.
2417 * cygtls.cc (_cygtls::init_thread): Fill out thread id field.
2418 * exceptions.cc (exception): Change message when exception info is
2419 unknown. Copy context to thread local storage.
2420 (_cygtls::handle_exceptions): Avoid double test for fault_guarded.
2421 Reflect move of signal_exit to _cygtls class.
2422 (sigpacket::process): Copy context to thread local storage.
2423 (_cygtls::signal_exit): Move to _cygtls class. Call signal_debugger to
2424 notify debugger of exiting signal (WIP). Call stackdump here (WIP).
2425 (_cygtls::copy_context): Define new function.
2426 (_cygtls::signal_debugger): Ditto.
2427 * tlsoffsets.h: Regenerate.
2428 * include/cygwin.h (_fpstate): New internal structure.
2429 (ucontext): Declare new structure (WIP).
2430 (__COPY_CONTEXT_SIZE): New define.
2432 * exceptions.cc (_cygtls::interrupt_setup): Clear "threadkill" field
2433 when there is no sigwaiting thread.
2434 (setup_handler): Move event handling into interrupt_setup.
2436 2006-02-06 Corinna Vinschen <corinna@vinschen.de>
2438 * fhandler_socket.cc (fhandler_socket::connect): Fix formatting.
2439 (fhandler_socket::wait): Handle SA_RESTART when signal arrives.
2441 2006-02-06 Corinna Vinschen <corinna@vinschen.de>
2443 * include/cygwin/socket.h (CMSG_FIRSTHDR): Avoid compiler warning.
2445 2006-02-05 Corinna Vinschen <corinna@vinschen.de>
2447 * include/features.h: Add comment to explain what's going to happen
2449 * include/sys/stdio.h: Guard getline and getdelim prototypes with
2450 _GNU_SOURCE to avoid collision with old-style declarations.
2452 2006-02-05 Corinna Vinschen <corinna@vinschen.de>
2454 * environ.cc (struct parse_thing): Add transparent_exe option.
2455 * fhandler_disk_file.cc (fhandler_disk_file::link): Accommodate
2456 transparent_exe option. Add .exe suffix for links to executable files,
2457 if transparent_exe is set.
2458 * fhandler_process.cc (fhandler_process::fill_filebuf): Remove .exe
2459 suffix if transparent_exe option is set.
2460 * path.cc (symlink_worker): Accommodate transparent_exe option.
2461 (realpath): Don't tack on .exe suffix if transparent_exe is set.
2462 * syscalls.cc (transparent_exe): New global variable.
2463 (unlink): Accommodate transparent_exe option.
2466 (rename): Ditto. Maybe add .exe suffix when renaming executable files.
2467 (pathconf): Accommodate transparent_exe option.
2468 * winsup.h: Declare transparent_exe.
2470 2006-02-05 Christopher Faylor <cgf@timesys.com>
2471 Corinna Vinschen <corinna@vinschen.de>
2473 * fhandler_disk_file.cc (fhandler_disk_file::readdir_9x): Remove
2476 2006-02-05 Corinna Vinschen <corinna@vinschen.de>
2478 * fhandler_disk_file.cc (fhandler_disk_file::rewinddir): Remove label
2479 "out". Move test for NULL __handle ...
2480 (fhandler_disk_file::rewinddir_9x): ... here.
2482 2006-02-05 Corinna Vinschen <corinna@vinschen.de>
2484 * dir.cc (rewinddir): Keep dirent_get_d_ino and dirent_set_d_ino flags.
2486 2006-02-05 Christopher Faylor <cgf@timesys.com>
2488 * fhandler_disk_file.cc (fhandler_disk_file::readdir): Don't close dir
2489 handle when we hit EOF since rewwindir may reactivate it.
2490 (fhandler_disk_file::readdir_9x): Eliminate superfluous temporary
2492 (fhandler_disk_file::closedir): Return EBADF when trying to close
2493 unopened DIR. Reorganize slightly. Return actual derived error value
2494 rather than always returning 0.
2496 2006-02-04 Christopher Faylor <cgf@timesys.com>
2498 * dir.cc (rmdir): Reorganize check for trailing dot to return correct
2499 error when directory does not exist.
2501 2006-02-03 Christopher Faylor <cgf@timesys.com>
2503 * dir.cc (mkdir): Reorganize check for trailing dot to return correct
2504 error when directory exists.
2505 * fhandler_disk_file.cc (fhandler_disk_file::mkdir): Remove special
2506 test for path ending in '.'.
2508 2006-02-03 Corinna Vinschen <corinna@vinschen.de>
2510 * path.cc (suffix_scan::lnk_match): Return true beginning with
2512 (suffix_scan::next): Rearrange code to make .lnk append order slightly
2514 * spawn.cc (exe_suffixes): Try no suffix before .exe suffix to align
2515 evaluation with stat_suffixes.
2516 (dll_suffixes): Ditto.
2518 2006-02-02 Christopher Faylor <cgf@timesys.com>
2520 * cygwin/version.h: Mention CW_SETUP_WINENV in comment for API minor
2523 2006-02-02 Corinna Vinschen <corinna@vinschen.de>
2525 * cygwin.din (updwtmpx): Export.
2526 * syscalls.cc (updwtmpx): New function.
2527 * include/utmpx.h (updwtmpx): Declare.
2528 * include/cygwin/version.h: Bump API minor number to 153.
2530 2006-02-02 Christopher Faylor <cgf@timesys.com>
2532 * external.cc (setup_winenv): New function.
2533 (cygwin_internal): Implement CW_SETUP_WINENV.
2534 * sys/cygwin.h (cygwin_getinfo_types): Define CW_SETUP_WINENV.
2536 2006-02-02 Corinna Vinschen <corinna@vinschen.de>
2538 * security.cc (is_group_member): Fix comment.
2540 2006-02-02 Corinna Vinschen <corinna@vinschen.de>
2542 * security.cc (is_group_member): Use local group info type 1. Test
2543 group for being a global group or a well-known SID before adding it
2544 to the group list. Add comment.
2546 2006-02-01 Corinna Vinschen <corinna@vinschen.de>
2548 * autoload.cc (GetTcpTable): Define.
2549 * fhandler_socket.cc (address_in_use): New function to check if
2550 sockaddr_in address is already in use.
2551 (fhandler_socket::bind): Check if address is alreay in use in case of
2552 SO_REUSEADDR, to circumvent WinSock non-standard behaviour.
2554 2006-02-01 Corinna Vinschen <corinna@vinschen.de>
2556 * spawn.cc (dll_suffixes): Add .exe and "no suffix" to the list.
2558 2006-01-31 Corinna Vinschen <corinna@vinschen.de>
2560 * dlfcn.cc (check_path_access): Call find_exec with FE_DLL option.
2561 * path.h (enum fe_types): Add FE_DLL value.
2562 * spawn.cc (std_suffixes): Remove.
2563 (exe_suffixes): New suffix_info for executing files.
2564 (dll_suffixes): New suffix_info for searching shared libraries.
2565 (perhaps_suffix): Add opt argument. Use dll_suffixes if FE_DLL
2566 option is given, exe_suffixes otherwise.
2567 (find_exec): Propagate opt argument to perhaps_suffix. Drop suffix
2568 check when testing execute permission.
2569 (spawn_guts): Call perhaps_suffix with FE_NADA opt argument.
2571 2006-01-31 Christopher Faylor <cgf@timesys.com>
2573 * spawn.cc (av::fixup): Remove unused argument.
2574 (spawn_guts): Remove capitalization in debugging.
2576 2006-01-31 Corinna Vinschen <corinna@vinschen.de>
2578 * spawn.cc (find_exec): Only return files with execute permission set
2579 if ntsec is on. Don't check execute permission of Windows batch files.
2580 (av::fixup): Handle empty files gracefully. Drop execute permission
2582 * path.cc (suffix_scan::next): Don't skip any suffix on first run.
2584 2006-01-31 Corinna Vinschen <corinna@vinschen.de>
2586 * path.cc (cwdstuff::set): Don't set win32 error, only POSIX errno.
2588 2006-01-31 Corinna Vinschen <corinna@vinschen.de>
2590 * path.cc (cwdstuff::set): When SetCurrentDirectory returns
2591 ERROR_INVALID_FUNCTION, bend it over to ERROR_FILE_NOT_FOUND. Add
2592 comment to explain why.
2594 2006-01-31 Corinna Vinschen <corinna@vinschen.de>
2596 * dir.cc (readdir_worker): Add comment about writing old 32 bit d_ino.
2597 * include/cygwin/version.h: Bump API minor number to 152.
2598 (CYGWIN_VERSION_CHECK_FOR_NEEDS_D_INO): Remove.
2600 2006-01-30 Corinna Vinschen <corinna@vinschen.de>
2602 * fhandler_disk_file.cc (fhandler_disk_file::rewinddir): Simplify
2605 2006-01-30 Corinna Vinschen <corinna@vinschen.de>
2607 * fhandler_disk_file.cc (d_cachepos): Rename from d_pos to distinct
2608 clearly from __d_position. Change throughout.
2609 (fhandler_disk_file::rewinddir): Reset readdir cache on NT.
2611 2006-01-29 Corinna Vinschen <corinna@vinschen.de>
2613 * fhandler_disk_file.cc (readdir_get_ino): Don't follow symlinks.
2615 2006-01-29 Corinna Vinschen <corinna@vinschen.de>
2617 * fhandler.h (class fhandler_socket): Add saw_reuseaddr status flag.
2618 * fhandler_socket.cc (fhandler_socket::bind): Set socket to
2619 SO_EXCLUSIVEADDRUSE if application didn't explicitely set SO_REUSEADDR
2620 socket option, on systems supporting SO_EXCLUSIVEADDRUSE.
2621 * net.cc (cygwin_setsockopt): Set fhandler's saw_reuseaddr status flag
2622 if SO_REUSEADDR socket option has been successsfully set.
2623 * wincap.h (wincaps::has_exclusiveaddruse): New element.
2624 * wincap.cc: Implement above element throughout.
2626 2006-01-28 Corinna Vinschen <corinna@vinschen.de>
2628 * fhandler_disk_file.cc (fhandler_disk_file::mkdir): In case or error,
2629 check for existance explicitely and set errno to EEXIST.
2631 2006-01-28 Corinna Vinschen <corinna@vinschen.de>
2633 * fhandler_disk_file.cc (DIR_NUM_ENTRIES): New define determining
2634 minimum number of dir entries which fit into the readdir cache.
2635 (DIR_BUF_SIZE): Define globally as size of readdir cache.
2636 (struct __DIR_cache): New structure used for readdir caching on NT.
2637 (d_dirname): Accessor for struct __DIR_cache, use throughout.
2640 (fhandler_disk_file::opendir): Allocate __d_dirname to contain readdir
2642 (fhandler_disk_file::readdir): Use buf as pointer into readdir cache.
2643 Implement readdir caching.
2645 2006-01-28 Corinna Vinschen <corinna@vinschen.de>
2647 * include/sys/dirent.h (struct dirent): Revert misguided attempt to
2648 rename __d_unused1 to __d_fd.
2650 2006-01-27 Corinna Vinschen <corinna@vinschen.de>
2652 * autoload.cc (NtQueryDirectoryFile): Define.
2653 * dir.cc (__opendir_with_d_ino): Just call opendir.
2654 (opendir): Remove CYGWIN_VERSION_CHECK_FOR_NEEDS_D_INO handling.
2655 (readdir_worker): Only try generating d_ino if it's 0.
2656 Utilize namehash of directories fhandler. Call readdir_get_ino to
2657 generate d_ino for "..".
2658 (seekdir64): Keep dirent_set_d_ino flag.
2659 * fhandler.h (enum dirent_states): Add dirent_get_d_ino.
2660 (class fhandler_disk_file): Declare new private methods readdir_helper
2662 * fhandler_disk_file.cc (path_conv::hasgood_inode): New method to
2663 evaluate if a filesystem has reliable inode numbers.
2664 (fhandler_base::fstat_by_handle): Accommodate structure member name
2665 change from IndexNumber to FileId.
2666 (fhandler_base::fstat_helper): Call hasgood_inode here.
2667 (fhandler_disk_file::opendir): Call fhaccess only for real files.
2668 Don't append '*' to __d_dirname here, move to readdir_9x. On NT,
2669 open directory handle here. Set dirent_get_d_ino and dirent_set_d_ino
2670 flags according to wincap and filesystem.
2671 (fhandler_disk_file::readdir_helper): New method to implement readdir
2672 postprocessing only once.
2673 (readdir_get_ino_by_handle): New static function.
2674 (readdir_get_ino): New function to centralize inode number evaluation
2675 in case inode number hasn't been returned by NtQueryDirectoryFile.
2676 (fhandler_disk_file::readdir): Move old functionality to readdir_9x.
2677 Call readdir_9x when on 9x/Me. Implement NT specific readdir here.
2678 (fhandler_disk_file::readdir_9x): Move 9x specific readdir here.
2679 (fhandler_disk_file::seekdir): Accommodate new NT readdir method.
2680 (fhandler_disk_file::closedir): Ditto.
2681 (fhandler_cygdrive::fstat): Set d_ino to namehash. Add comment.
2682 (fhandler_cygdrive::opendir): Call get_namehash to prepare later
2683 correct evaluation of d_ino.
2684 (fhandler_cygdrive::readdir): Replace recursion with loop. Evaluate
2685 drive's d_ino by calling readdir_get_ino.
2686 * fhandler_proc.cc (fhandler_proc::readdir): Set dirent_saw_dot and
2687 dirent_saw_dot_dot to avoid seeing . and .. entries twice.
2688 * fhandler_process.cc (fhandler_process::readdir): Ditto.
2689 * fhandler_registry.cc (fhandler_registry::readdir): Ditto.
2690 * ntdll.h (STATUS_INVALID_PARAMETER): New define.
2691 (STATUS_INVALID_LEVEL): New define.
2692 (struct _FILE_INTERNAL_INFORMATION): Rename member IndexNumber to
2693 FileId (as in Nebbitt).
2694 * path.h (path_conv::hasgood_inode): Now implemented in
2695 fhandler_disk_file.cc.
2696 * wincap.h (wincaps::has_fileid_dirinfo): New element.
2697 * wincap.cc: Implement above element throughout.
2698 * winsup.h (readdir_get_ino): Add declaration.
2699 * include/sys/dirent.h (struct dirent): Slightly rename structure
2700 members to accommodate changes.
2701 Remove __USE_EXPENSIVE_CYGWIN_D_INO handling and declaration of
2702 __opendir_with_d_ino.
2704 2006-01-27 Christopher Faylor <cgf@timesys.com>
2706 * spawn.cc (spawn_guts): Fix potential handle leak when failing exec.
2708 2006-01-27 Christopher Faylor <cgf@timesys.com>
2710 * exceptions.cc (inside_kernel): Fix to return true if we can't get the
2711 name of the DLL for the given memory block since we are not in kernel
2714 2006-01-26 Corinna Vinschen <corinna@vinschen.de>
2716 * fhandler.cc (fhandler_base::open): Fix bug in argument order to
2717 InitializeObjectAttributes call.
2719 2006-01-25 Corinna Vinschen <corinna@vinschen.de>
2721 * fhandler_disk_file.cc (fhandler_disk_file::readdir): Fix test for
2722 dirent_isroot to use the correct boolean operator.
2724 2006-01-25 Christopher Faylor <cgf@timesys.com>
2726 * ntdll.h: (temporarily?) Add more functions for querying directory.
2728 2006-01-24 Christopher Faylor <cgf@timesys.com>
2730 * dir.cc (readdir_worker): Turn off expensive inode calculation.
2732 2006-01-24 Corinna Vinschen <corinna@vinschen.de>
2734 * fhandler_process.cc (fhandler_process::fill_filebuf): Disable
2735 stripping the .exe suffix from the link target in PROCESS_EXE and
2736 PROCESS_EXENAME case.
2737 * path.cc (realpath): Tack on .exe suffix if necessary.
2739 2006-01-24 Corinna Vinschen <corinna@vinschen.de>
2741 * fhandler_disk_file.cc (fhandler_base::fstat_helper): Try harder
2742 to determine remote file systems with reliable inode numbers. Add
2745 2006-01-23 Corinna Vinschen <corinna@vinschen.de>
2747 * fhandler_socket.cc (fhandler_socket::fixup_after_fork): Reset
2748 inheritance for duplicated socket.
2750 2006-01-20 Christopher Faylor <cgf@timesys.com>
2752 * include/cygwin/version.h: Bump API minor number to 151.
2753 * dir.cc (__opendir_with_d_ino): New function.
2754 (opendir): Set flag if we should be calculating inodes.
2755 (readdir_worker): Calculate d_ino by calling stat if the user has asked
2757 (seekdir64): Maintain all persistent flag settings.
2758 * fhandler.h (dirent_states): Add dirent_set_d_ino.
2759 * fhandler_disk_file.cc (fhandler_disk_file::opendir): Reflect changes
2760 to dirent structure.
2761 * fhandler_virtual.cc (fhandler_virtual::opendir): Ditto.
2762 * include/sys/dirent.h (struct dirent): Coalesce two similar
2763 structures. Remove all shreds of the apparently highly confusing
2764 references to inodes. Add support for calculating a real inode if
2765 __USE_EXPENSIVE_CYGWIN_D_INO is defined.
2767 2006-01-20 Christopher Faylor <cgf@timesys.com>
2769 * include/sys/dirent.h: Add comments for people who are REALLY confused
2770 about whether they should be using something called __invalid_d_ino or
2773 2006-01-20 Corinna Vinschen <corinna@vinschen.de>
2775 * fhandler_socket.cc (fhandler_socket::prepare): Fix debug output.
2776 (fhandler_socket::release): Add debug output for WSAEventSelect failure.
2777 (fhandler_socket::ioctl): Always cancel WSAEventSelect before switching
2778 to blocking mode. Only set nonblocking flag if ioctlsocket call
2779 succeeded. Only print new socket state if ioctlsocket call succeeded.
2781 2006-01-19 Christopher Faylor <cgf@timesys.com>
2783 * fhandler_disk_file.cc (fhandler_disk_file::opendir): Check posix path
2784 for root rather than windows path.
2786 2006-01-19 Christopher Faylor <cgf@timesys.com>
2788 * dir.cc (readdir_worker): Fill in invalid fields with -1. Accommodate
2789 name change from __ino32 to __invalid_ino32.
2790 * include/sys/dirent.h (__invalid_ino32): Rename from __ino32. Don't
2791 define unused d_type macros.
2793 2006-01-18 Christopher Faylor <cgf@timesys.com>
2795 * heap.cc (heap_init): Remove Sleep.
2797 2006-01-18 Corinna Vinschen <corinna@vinschen.de>
2799 * net.cc (rresvport): Remove extern declaration.
2801 2006-01-18 Corinna Vinschen <corinna@vinschen.de>
2803 * autoload.cc (rresvport): Remove.
2804 * net.cc (last_used_rrecvport): New global shared variable.
2805 (cygwin_rresvport): Implement rresvport without using rresvport from
2808 2006-01-18 Corinna Vinschen <corinna@vinschen.de>
2810 * include/cygwin/socket.h (struct sockaddr_storage): Fix typo in
2811 ss_family member name.
2813 2006-01-16 Christopher Faylor <cgf@timesys.com>
2815 * include/cygwin/version.h: Bump DLL minor version number to 20.
2817 2006-01-13 Corinna Vinschen <corinna@vinschen.de>
2819 * uname.cc (uname): Concatenate a "-WOW64" to utsname's sysname
2820 member to see when running under WOW64.
2822 2006-01-13 Corinna Vinschen <corinna@vinschen.de>
2824 * net.cc (cygwin_setsockopt): Ignore errors when setting IP_TOS on
2825 Windows 2000 and above. Clarify the comment about IP_TOS and move
2826 to the place where the magic happens.
2827 (get_ifconf): Remove unused code.
2828 * wincap.h (wincaps::has_disabled_user_tos_setting): New element.
2829 * wincap.cc: Implement above element throughout.
2831 2006-01-12 Christopher Faylor <cgf@timesys.com>
2833 * fhandler_console.cc (set_console_state_for_spawn): Fix to recognize
2836 2006-01-12 Christopher Faylor <cgf@timesys.com>
2838 * fhandler.h (set_console_state_for_spawn): Whackamole the argument
2840 * spawn.cc (spawn_guts): Ditto, i.e., once again call
2841 set_console_state_for_spawn with an indication of whether we're about
2842 to start a cygwin process.
2843 * fhandler_console.cc (set_console_state_for_spawn): Don't set the
2844 console state if we know we're starting a cygwin process or if we're
2847 2006-01-10 Corinna Vinschen <corinna@vinschen.de>
2849 * dcrt0.cc (dll_crt0_0): Remove call to wincap.init.
2850 * init.cc (dll_entry): Rename is_wow64_proc to wow64_test_stack_marker.
2851 Call wincap.init here before doing anything else. Use wincap.is_wow64
2852 to determine if we're running in a WOW64 emulator.
2853 * mmap.cc (MapViewNT): Don't use AT_ROUND_TO_PAGE in WOW64, it's
2854 apparently not supported.
2855 (mmap64): Don't create mappings beyond EOF, which would need to use
2856 AT_ROUND_TO_PAGE, on WOW64.
2857 * wincap.cc (wincap): Throw into the .cygwin_dll_common section.
2858 (wincapc::init): Determine if running in WOW64 and set wow_64 flag.
2859 * wincap.h (class wincapc): Add wow64 member.
2860 (wincapc::is_wow64): New method.
2862 2006-01-10 Christopher Faylor <cgf@timesys.com>
2864 * fhandler_proc.cc (format_proc_cpuinfo): Avoid leading whitespace in
2867 2006-01-09 Christopher Faylor <cgf@timesys.com>
2869 * spawn.cc (spawn_guts): Reorganize slightly so that 16 bit check is
2870 done prior to check for command.com/cmd.com. Don't bother setting
2871 CREATE_SUSPENDED flag for a MS-DOS process since it doesn't work
2872 anyway. Avoid calling remember() when the child process has already
2874 (av::fixup): Explicitly set cygexec flag to false on a 16 bit process.
2876 2006-01-09 Corinna Vinschen <corinna@vinschen.de>
2878 * include/getopt.h (getopt_long_only): Declare.
2880 2006-01-09 Eric Blake <ebb9@byu.net>
2882 * cygwin.din: Export getsubopt.
2883 * include/cygwin/version.h: Bump API minor version.
2885 2006-01-08 Christopher Faylor <cgf@timesys.com>
2887 * fhandler_tty.cc (fhandler_tty_slave::dup): Don't assign a controlling
2888 terminal to a process when duped. Linux doesn't do this, so we won't
2891 2006-01-08 Christopher Faylor <cgf@timesys.com>
2893 * environ.cc (spenvs[]): windir -> WINDIR.
2895 2006-01-07 Christopher Faylor <cgf@timesys.com>
2897 * fhandler_console.cc (fhandler_console::need_invisible): Remove
2900 2006-01-07 Christopher Faylor <cgf@timesys.com>
2902 * fhandler.h (set_console_state_for_spawn): Eliminate argument from
2904 * fhandler.cc (set_console_state_for_spawn): Eliminate argument from
2905 definition. Always check for invisible console.
2906 (fhandler_console::need_invisible): Don't do anything if the windows
2907 station is already not visible.
2908 * spawn.cc (spawn_guts): Accommodate change of argument to
2909 set_console_state_for_spawn.
2911 2006-01-05 Christopher Faylor <cgf@timesys.com>
2913 * sigproc.cc (no_signals_available): Use existence of signal thread
2914 handle to figure out if we can actually send signals rather than
2915 relying on my_sendsig.
2916 (hwait_sig): Make static.
2917 (sigproc_init): Don't set my_sendsig to anything special. Use new
2918 global static hwait_sig.
2919 (wait_sig): Set hwait_sig to NULL when we are exiting.
2921 2006-01-05 Christopher Faylor <cgf@timesys.com>
2923 * include/getopt.h: Accommodate recent unfortunate newlib changes.
2925 2006-01-05 Christopher Faylor <cgf@timesys.com>
2927 * cygtls.cc (_cygtls::remove): Don't output debugging info if this
2928 isn't a cygwin thread.
2929 * sigproc.cc (sigproc_init): Move clearing of sync_startup here to
2930 lessen the likelihood of trying to deal with non-cygwin threads in
2933 * fhandler_console: Fix set_console_state_for_spawn comment.
2935 2006-01-05 Igor Peshansky <pechtcha@cs.nyu.edu>
2937 * spawn.cc (spawn_guts): Invert the argument to
2938 set_console_state_for_spawn.
2940 2006-01-04 Christopher Faylor <cgf@timesys.com>
2942 * fhandler_console.cc (fhandler_console::need_invisible): Only try to
2943 open "CygwinInvisible" windows station if opening of default station
2944 fails. Use CloseWindowStation to close window station handle.
2946 2006-01-04 Christopher Faylor <cgf@timesys.com>
2948 * fhandler_console.cc (fhandler_console::need_invisible): Open up the
2949 security of the newly created windows station.
2951 2006-01-04 Eric Blake <ebb9@byu.net>
2953 * path.cc (dot_special_chars): Add ", <, >, and |.
2955 2006-01-03 Christopher Faylor <cgf@timesys.com>
2957 * fhandler_console.cc (beep): Use MB_OK which is documented as using
2958 the default bell rather than -1 which seems to behave differently on
2959 different versions of Windows.
2961 2006-01-03 Christopher Faylor <cgf@timesys.com>
2963 * fhandler_process.cc (fhandler_process::readdir): Add missing argument
2966 * fhandler_console.cc (fhandler_console::need_invisible): Use made-up
2967 name for windows station rather than asking Windows to create one for
2970 * spawn.cc (spawn_guts): Don't mess with console if we're detaching.
2972 2006-01-03 Christopher Faylor <cgf@timesys.com>
2974 * dir.cc (readdir_worker): Minor code cleanup.
2976 * fhandler_console.cc (beep): Use a more Windows-generic wav file if
2977 the beep is missing. Use a more foolproof way to find out whether we
2978 should be recreating the missing key.
2980 * registry.h (reg_key::_disposition): New field.
2981 (reg_key::created): New function.
2982 * registry.cc (reg_key::reg_key): Set _disposition to zero by default.
2983 (reg_key::build_key): Fill in _disposition field.
2985 2006-01-03 Eric Blake <ebb9@byu.net>
2987 * dir.cc (readdir_worker): Ensure that saw_dot* flags are updated when
2988 not handling inodes.
2990 2006-01-02 Christopher Faylor <cgf@timesys.com>
2992 * fhandler_console.cc (beep): New function. Restores missing "Default
2993 Beep", if necessary.
2994 (fhandler_console::write_normal): Use beep().
2996 2006-01-02 Christopher Faylor <cgf@timesys.com>
2998 * dcrt0.cc (_dll_crt0): Remove more leftover debugging stuff.
2999 (cygwin_dll_init): Remove unneeded initializations. Call _dll_crt0
3000 rather than dll_crt0_1.
3002 2006-01-02 Corinna Vinschen <corinna@vinschen.de>
3004 * syslog.cc: Include sys/un.h instead of sys/socket.h.
3005 (syslogd_inited): Convert to enum type noting the exact result of
3006 trying to connect to syslog daemon. Use this way throughout.
3007 (connect_syslogd): New static function taking over the task to
3008 connect to syslog socket. Use correct struct sockaddr_un instead of
3010 (try_connect_syslogd): Call connect_syslogd. If write fails on
3011 connection oriented socket, try to reconnect to syslog socket and
3014 2006-01-01 Christopher Faylor <cgf@timesys.com>
3016 * pinfo.cc (pinfo::exit): Swap signal and normal exit value when not
3017 started from a cygwin process - just like the good-old-days of B20.
3019 2006-01-01 Christopher Faylor <cgf@timesys.com>
3021 * strace.cc (strace::write_childpid): Remove debugging output.
3023 2006-01-01 Christopher Faylor <cgf@timesys.com>
3025 * cygtls.cc (_cygtls::remove): Remove left over debugging cruft which
3026 caused this function to always return prematurely.
3028 2006-01-01 Christopher Faylor <cgf@timesys.com>
3030 * exceptions.cc (sigpacket::process): Pass actual reference to signal's
3031 sigaction structure to setup_handler.
3033 2006-01-01 Christopher Faylor <cgf@timesys.com>
3035 * exceptions.cc (_cygtls::interrupt_setup): Implement SA_RESETHAND.
3036 * include/cygwin/signal.h: Define SA_ONESHOT and SA_NOMASK.
3038 * dcrt0.cc (get_cygwin_startup_info): Remove commented out code.
3040 2006-01-01 Corinna Vinschen <corinna@vinschen.de>
3042 * syslog.cc (vklog): Never log kernel messages using the vsyslog