1 2005-06-17 Christopher Faylor <cgf@timesys.com>
3 * spawn.cc (spawn_guts): Detect when executing a 16-bit application and
4 avoid setting the process pipe since this causes conniptions in Windows
7 2005-06-17 Corinna Vinschen <corinna@vinschen.de>
9 * cygwin.din (inet_pton): Export.
11 * net.cc (cygwin_inet_pton): Implement inet_pton for AF_INET for now.
12 (cygwin_inet_ntop): Implement inet_ntop for AF_INET for now.
13 * include/arpa/inet.h (inet_pton): Declare.
15 * include/cygwin/version.h: Bump API minor number.
17 2005-06-17 Corinna Vinschen <corinna@vinschen.de>
19 * fhandler.h (fhandler_union): Add missing members corresponding to
20 fhandler_fifo and fhandler_netdrive.
22 2005-06-16 Corinna Vinschen <corinna@vinschen.de>
24 * syscalls.cc (statvfs): Handle the case when GetDiskFreeSpaceEx
25 succeeds but GetDiskFreeSpace fails by faking bytes-per-sector and
26 sectors-per-cluster values.
28 2005-06-15 Christopher Faylor <cgf@timesys.com>
30 * cygthread.cc (cygthread::detach): Fix debugging output.
31 * dcrt0.cc (dll_crt0_1): Create signal_arrived early -- before any
32 filename manipulation.
33 * sigproc.cc (sigproc_init): Don't create signal_arrived here.
34 * fork.cc (fork_child): Ditto.
35 * sigproc.h (create_signal_arrived): Declare.
37 2005-06-14 Christopher Faylor <cgf@timesys.com>
39 * path.cc (path_conv::check): Always reset to FH_FS when component != 0
40 and FH_NETDRIVE to fix problems with strict case checking.
42 2005-06-12 Corinna Vinschen <corinna@vinschen.de>
44 * fhandler_socket.cc (fhandler_socket::recvmsg): Avoid SEGV in OpenSSH
45 when trying to pass file descriptor by setting msg->msg_accrightslen
48 2005-06-11 Christopher Faylor <cgf@timesys.com>
50 * Makefile.in: Avoid initial heap allocation since cygwin has its own
53 2005-06-11 Christopher Faylor <cgf@timesys.com>
55 * fhandler_console.cc (fhandler_console::read): Fix a compiler warning.
57 2005-06-10 Christopher Faylor <cgf@timesys.com>
59 * include/pthread.h: Change PTHREAD_MUTEX_DEFAULT to
60 PTHREAD_MUTEX_NORMAL. Revert PTHREAD_MUTEX_INITIALIZER to
61 PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP since that is actually closer
63 * thread.h (cw_cancel_action): New enum.
64 (cancelable_wait): Use cw_cancel_action as third argument.
65 * thread.cc (cancelable_wait): Ditto. Don't wait for cancel if
66 cancel_action == cw_no_cancel.
67 (pthread::create): Don't wait for cancel event since that is racy.
68 (pthread_mutex::pthread_mutex): Set default to PTHREAD_MUTEX_ERRORCHECK.
69 (pthread_mutexattr::pthread_mutexattr): Ditto.
70 (pthread_mutex::_lock): Tell cancelable_wait not to wait for
72 (semaphore::_timedwait): Accommodate change in cancelable_wait args.
73 (pthread::join): Ditto.
75 2005-06-10 Corinna Vinschen <corinna@vinschen.de>
77 * fhandler_socket.cc (fhandler_socket::sendto): Always initialize
79 (fhandler_socket::sendmsg): Ditto.
81 2005-06-10 Corinna Vinschen <corinna@vinschen.de>
83 * cygwin.din (imaxabs): Export.
89 * include/inttypes.h (imaxabs): Activate declaration.
93 * include/cygwin/version.h: Bump API minor.
95 2005-06-09 Christopher Faylor <cgf@timesys.com>
97 * cygthread.cc (cygthread::detach): Improve diagnostics for what should
98 be an impossible failure condition.
100 2005-06-09 Christopher Faylor <cgf@timesys.com>
102 * cygtls.h (_local_storage::setmode_file): New element.
103 (_local_storage::setmode_mode): New element.
104 * tlsoffsets.h: Regenerate.
105 * cygwin.din (setmode): Define as cygwin_getmode.
106 * syscalls.cc (setmode_helper): Use setmode_* variables from tls rather
107 than using unthreadsafe static.
108 (setmode): Break out fwalk stuff.
109 (cygwin_setmode): New function. Put fwalk stdio stuff here.
111 2005-06-09 Christopher Faylor <cgf@timesys.com>
113 * thread.cc (pthread_mutex::_lock): Use cancelable_wait rather than
116 2005-06-09 Christopher Faylor <cgf@timesys.com>
118 * cygwin.sc: Place .cygwin_dll_common in a more sensible spot.
120 2005-06-09 Christopher Faylor <cgf@timesys.com>
122 * cygwin.sc: Place .cygwin_dll_common.
123 * init.cc (threadfunc_ix): Use a more common name for the section name.
125 2005-06-09 Christopher Faylor <cgf@timesys.com>
127 * include/pthread.h (PTHREAD_MUTEX_INITIALIZER): Change to
128 PTHREAD_NORMAL_MUTEX_INITIALIZER_NP to be closer to linux default.
130 2005-06-09 Christopher Faylor <cgf@timesys.com>
132 * thread.cc (cancelable_wait): No-op change to make sure that res is
133 always a valid WFMO return.
135 2005-06-09 Christopher Faylor <cgf@timesys.com>
137 Change pthread::cancelable_wait to just cancelable_wait, throughout.
138 * thread.h (cw_sig_wait): New enum.
139 (fast_mutex::lock): Use cancelable_wait with resumable signal.
140 (cancelable_wait): Change fourth argument to cw_sig_wait enum.
141 * thread.cc (cancelable_wait): Ditto. Loop on signal detection if
142 fourth argument == cw_sig_resume.
144 2005-06-08 Christopher Faylor <cgf@timesys.com>
146 * cygwin.sc: Apparently nonloading sections need to go last.
148 2005-06-08 Christopher Faylor <cgf@timesys.com>
150 * cygwin.sc: Restore resource and reloc sections and use more modern
151 syntax for stabs sections.
153 2005-06-08 Christopher Faylor <cgf@timesys.com>
155 * environ.cc (spenvs): Remove cut/paste error which associated
156 CYGWIN_DEBUG with HOME.
158 2005-06-08 Corinna Vinschen <corinna@vinschen.de>
160 * security.cc (cygwin_logon_user): Run LogonUser in the primary
161 process token context. Fix potential handle leak.
163 2005-06-07 Corinna Vinschen <corinna@vinschen.de>
165 * pinfo.cc (pinfo::init): Define sa_buf as PSECURITY_ATTRIBUTES and
166 allocate dynamically.
167 (pinfo::set_acl): Replace sa_buf by dynamically allocated acl_buf.
168 * sec_acl.cc (setacl): Allocate acl dynamically.
169 * sec_helper.cc (sec_acl): Add test for alignment of acl when
170 DEBUGGING is defined.
171 (__sec_user): Same for sa_buf.
172 * security.cc (verify_token): Define sd_buf as PSECURITY_DESCRIPTOR
173 and allocate dynamically.
174 (alloc_sd): Allocate acl dynamically.
175 security.h (sec_user_nih): Change first parameter to
176 SECURITY_ATTRIBUTES *.
178 * sigproc.cc (wait_sig): Define sa_buf as PSECURITY_ATTRIBUTES and
179 allocate dynamically.
180 * syscalls.cc (seteuid32): Define dacl_buf as PACL and allocate
182 * uinfo.cc (cygheap_user::init): Define sa_buf as PSECURITY_ATTRIBUTES
183 and allocate dynamically.
184 * winbase.h (ilockincr): Mark first argument of inline assembly as
188 2005-06-07 Christopher Faylor <cgf@timesys.com>
190 * cygthread.cc (cygthread::detach): Make error message a little more
192 * fhandler.cc (fhandler_base::raw_read): Ditto for debug message.
193 * dcrt0.cc (do_exit): Add some more synchronization tests.
194 * fhandler_fifo.cc (fhandler_fifo::dup): Don't duplicate a nonexistent
195 handle. Use derived return value rather than always retuning 0.
196 * fhandler_netdrive.cc (fhandler_netdrive::exists): Wnet -> WNet.
197 * winsup.h (exit_states): Add a couple of new exit states.
199 2005-06-06 Corinna Vinschen <corinna@vinschen.de>
201 * path.cc (symlink_info::check): If GetFileAttributes returns
202 with ERROR_SHARING_VIOLATION, the file exists.
204 2005-06-06 Corinna Vinschen <corinna@vinschen.de>
206 * uname.cc (uname): Change "amd64" to "x86_64" as on Linux.
208 2005-06-06 Corinna Vinschen <corinna@vinschen.de>
210 * uname.cc (uname): Add missing break.
212 2005-06-05 Christopher Faylor <cgf@timesys.com>
214 * Makefile.in: Build sync.o with -fomit-frame-pointer and -O3.
216 2005-06-05 Christopher Faylor <cgf@timesys.com>
218 * sync.cc (muto::acquire): Remove unneeded brackets and fix whitespace.
220 2005-06-04 Christopher Faylor <cgf@timesys.com>
222 * malloc.cc: Update to Doug Lea's malloc v2.8.0.
224 2005-06-03 Max Kaehn <slothman@electric-cloud.com>
226 * dcrt0.cc (cygwin_dll_init): Initialize main_environ and cygtls. Add
227 comment to explain the caveats of this method.
228 * how-cygtls-works.txt: New file.
230 2005-06-02 Christopher Faylor <cgf@timesys.com>
232 * dlfcn.cc (get_full_path_of_dll): Use a relative path when converting
233 so that the standard Windows rules for finding a library will be used
234 if no path is given. Stop explicitly searching /usr/bin since that is
237 2005-06-01 Christopher Faylor <cgf@timesys.com>
239 Revert 2005-05-30 close_all_files changes.
240 * spawn.cc (spawn_guts): When execing, close all files after the child
243 2005-06-01 Christopher Faylor <cgf@timesys.com>
245 * fhandler_disk_file.cc (fhandler_disk_file::fchown): Make sure that
246 disk open is called in case we're passed in a non-existent device.
248 2005-06-01 Christopher Faylor <cgf@timesys.com>
250 * include/machine/stdlib.h: New file.
252 2005-06-01 Christopher Faylor <cgf@timesys.com>
254 * thread.h (List_remove): Revert most of 2005-05-30 change.
256 2005-06-01 Christopher Faylor <cgf@timesys.com>
258 * cygwin.sc: Don't output .reloc or .rsrc sections. Clean up stuff
259 around .cygheap and use a workaround to get things working with newer
262 2005-05-31 Christopher Faylor <cgf@timesys.com>
264 * cygheap.cc (cygheap_end): Remove bogus section attribute.
265 * cygwin.sc: Make __cygheap_mid absolute. Remove unused _cygheap_foo.
267 2005-05-30 Christopher Faylor <cgf@timesys.com>
269 * child_info.h (child_info::cygheap_h): Delete.
270 (child_info::dwProcessId): New field.
271 * cygheap.cc (init_cheap): Delete.
273 (cygheap_setup_for_child): Ditto.
274 (cygheap_setup_for_child_cleanup): Ditto.
275 (cygheap_fixup_in_child): Simplify. Use new "child_copy" function to
276 copy heap from parent.
277 (_csbrk): Don't attempt allocation if within cygheap section. Fix so
278 that more than one allocation will succeed.
279 (cygheap_init): Reset possibly-nonzero region to zero.
280 * cygheap.h (cygheap_setup_for_child): Delete declaration.
281 (cygheap_setup_for_child_cleanup): Ditto.
282 (cygheap_start): Define as an array.
283 * cygwin.sc: Modernize. Remove unneeded sections. Define cygheap
285 * dcrt0.cc (do_exit): Reflect argument change to close_all_files.
286 * dtable.cc (dtable::vfork_parent_restore): Ditto.
289 * fork.cc (fork_copy): Call ReadProcessMemory if there is no thread
290 (indicating that we're execing).
291 (fork_child): Don't mess with hParent.
292 (fork_parent): Remove hParent stuff. It happens earlier now.
293 Remove call to cygheap_setup_for_child* stuff.
294 (fork): Put child_info_stuff in grouped structure. Issue error if
295 parent handle is not set.
296 (child_copy): New function.
297 * sigproc.cc (child_info::child_info): Put cygheap settings here. Set
299 (child_info::~child_info): Close parent handle if it exists.
300 * spawn.cc (spawn_guts): Reorganize so that ciresrv is allocated at
301 only the last minute so that cygheap changes are reflected. Delete
302 cygheap_setup* calls.
303 * syscalls.cc (close_all_files): Add an argument to flag when the fd
304 entry should be released.
305 * winsup.h (close_all_files): Add an argument to close_all_files
306 declaration. Declare child_copy.
308 2005-05-30 Vaclav Haisman <v.haisman@sh.cvut.cz>
310 * thread.h (List_remove): Make node parameter const. Use simple
311 comparison and assignment rather than InterlockedCompareExchangePointer
312 since access is already synchronized.
314 2005-05-30 Christopher Faylor <cgf@timesys.com>
316 * dlfcn.cc (set_dl_error): Use UNIX error rather than Windows error.
318 2005-05-29 Christopher Faylor <cgf@timesys.com>
320 * cygmagic: Remove debugging cruft missed on 2005-05-21.
322 2005-05-29 Corinna Vinschen <corinna@vinschen.de>
324 * path.cc (path_conv::check): Move component to function scope. Set
325 PATH_RO only on *real* FH_NETDRIVEs or on non-FH_NETDRIVE virtual
326 paths. Allow non-retrievable shares to be handled as files.
328 2005-05-29 Eric Blake <ebb9@byu.net>
330 * include/limits.h (LLONG_MIN, LLONG_MAX, ULLONG_MAX): Always define.
332 2005-05-28 Christopher Faylor <cgf@timesys.com>
334 * thread.h (pthread_key::set): Inline.
335 (pthread_key::get): Ditto.
336 * thread.cc (pthread::set): Delete.
337 (pthread::get): Ditto.
339 2005-05-28 Christopher Faylor <cgf@timesys.com>
341 * cygwin.din: Remove signal front end from pthread_[gs]etspecific.
343 2005-05-28 Christopher Faylor <cgf@timesys.com>
345 * fhandler_tty.cc (fhandler_tty_slave:tcflush): Use signed comparison.
347 2005-05-28 Christopher Faylor <cgf@timesys.com>
349 * times.cc (time_ms::usecs): Coerce comparison to signed or whole test
352 2005-05-27 Christopher Faylor <cgf@timesys.com>
354 * cygheap.h: Reference _cygheap_start via .cygheap section.
356 * environ.cc: Fix force_into_environment typo throughout.
357 (spenvs): Export CYGWIN_DEBUG if DEBUGGING.
359 2005-05-26 Christopher Faylor <cgf@timesys.com>
361 * include/cygwin/version.h: Bump DLL minor number to 18.
363 2005-05-25 Pierre Humblet <pierre.humblet@ieee.org>
365 * fhandler.h (fhandler_base::mkdir): New virtual method.
366 (fhandler_base::rmdir): Ditto.
367 (fhandler_disk_file:mkdir): New method.
368 (fhandler_disk_file:rmdir): Ditto.
369 * dir.cc (mkdir): Implement with fhandlers.
371 * fhandler.cc (fhandler_base::mkdir): New virtual method.
372 (fhandler_base::rmdir): Ditto.
373 (fhandler_disk_file::mkdir): New method.
374 (fhandler_disk_file::rmdir): Ditto.
376 2005-05-24 Christopher Faylor <cgf@timesys.com>
378 * include/cygwin/version.h: Bump API minor number to 129.
380 2005-05-24 Christopher Faylor <cgf@timesys.com>
382 * cygwin.din: Export mkdtemp.
383 * mktemp.cc: New file.
384 * Makefile.in (DLL_OFILES): Add mktemp.o
386 2005-05-23 Eric Blake <ebb9@byu.net>
388 * include/stdint.h (INTMAX_C, UINTMAX_C): Fix definition.
390 2005-05-21 Christopher Faylor <cgf@timesys.com>
392 * spawn.cc (find_exec): Accept a PATH-like string in place of an
393 environment variable.
394 * dlfcn.cc (get_full_path_of_dll): Search /usr/bin (for windows
395 compatibility) and /usr/lib (for UNIX compatibility) when looking for
397 * environ.cc (conv_envvars): Put back LD_LIBRARY_PATH since it is used
398 by get_full_path_of_dll().
399 * errno.cc (errmap): Map MOD_NOT_FOUND to ENOENT.
401 * cygmagic: Remove debugging cruft.
403 2005-05-19 Corinna Vinschen <corinna@vinschen.de>
405 * include/cygwin/in.h: Add comment.
407 2005-05-19 Corinna Vinschen <corinna@vinschen.de>
409 * include/cygwin/in.h: Define IPPROTO_xxx values as macros to
412 2005-05-19 Christopher Faylor <cgf@timesys.com>
414 * include/limits.h: Include features.h, as on linux.
416 2005-05-19 Christopher Faylor <cgf@timesys.com>
418 * include/endian.h: New file.
420 2005-05-19 Corinna Vinschen <corinna@vinschen.de>
422 * cygwin.sc: Add Dwarf-2 debug sections.
424 2005-05-19 Corinna Vinschen <corinna@vinschen.de>
426 * mmap.cc (mmap64): Make granularity an automatic variable.
428 2005-05-19 Christopher Faylor <cgf@timesys.com>
430 * fhandler.h (fhandler_cygdrive::seekdir): Delete declaration.
431 (fhandler_cygdrive::seekdir): Delete.
433 2005-05-19 Pierre Humblet <pierre.humblet@ieee.org>
435 * fhandler.h (fhandler_cygdrive::iscygdrive_root): Delete method.
436 (fhandler_cygdrive::telldir): Delete declaration.
437 * fhandler_disk_file.cc: Remove all uses of
438 fhandler_cygdrive::iscygdrive_root.
439 (fhandler_disk_file::mkdir): New method.
440 (fhandler_disk_file::rmdir): Ditto.
441 (fhandler_cygdrive::telldir): Delete.
443 2005-05-18 Christopher Faylor <cgf@timesys.com>
445 * external.cc: Move pids declaration to file scope and use less
446 enthusiastic constructor.
447 * pinfo.h (winpids::winpids): Remove default setting.
448 * fhandler_fifo.cc (fhandler_fifo::open_not_mine): Accommodate removal
450 * fhandler_proc.cc (fhandler_proc::readdir): Ditto.
452 2005-05-18 Christopher Faylor <cgf@timesys.com>
454 * cygtls.h (_local_storage::unknown_thread_name): New buffer.
455 * tlsoffsets.h: Regenerate.
456 * cygthread.cc (cygthread::name): Use new thread-local buffer.
457 * exceptions.cc (handle_exceptions): Avoid unnecessary initialization
458 of static variables to zero.
459 * fork.cc (slow_pid_reuse) Ditto.
461 2005-05-18 Corinna Vinschen <corinna@vinschen.de>
463 * mmap.cc (mmap64): Avoid compiler warning.
464 * ntea.cc (NTReadEA): Ditto.
465 * hires.h (hires_base): Remove useless usecs function.
467 2005-05-18 Corinna Vinschen <corinna@vinschen.de>
469 * fhandler_netdrive.cc (fhandler_netdrive::telldir): Remove since it's
470 equivalent to fhandler_virtual::telldir now anyway.
471 * fhandler.h (class fhandler_netdrive): Remove telldir.
473 2005-05-18 Corinna Vinschen <corinna@vinschen.de>
475 * fhandler_netdrive.cc (fhandler_netdrive::telldir): Implement.
476 (fhandler_netdrive::seekdir): Implement.
477 (fhandler_netdrive::closedir): Call rewinddir to have only one point
478 of calling WNetCloseEnum.
480 2005-05-17 Corinna Vinschen <corinna@vinschen.de>
482 * fhandler.h (class fhandler_netdrive): Add method rewinddir.
483 * fhandler_netdrive.cc (struct netdriveinf): New structure to
484 store thread arguments.
485 (thread_netdrive): Thread handling all potentially blocking
487 (create_thread_and_wait): Start and wait for above thread.
488 (fhandler_netdrive::exists): Change to call create_thread_and_wait
489 instead of calling WNet... function.
490 (fhandler_netdrive::readdir): Ditto. Fix error handling.
491 (fhandler_netdrive::rewinddir): New method.
493 2005-05-17 Corinna Vinschen <corinna@vinschen.de>
495 * external.cc (cygwin_internal): Avoid compiler warning.
497 2005-05-16 Christopher Faylor <cgf@timesys.com>
499 * dcrt0.cc (dll_crt0_0): Don't do fixup_after_exec if dynamically
500 loaded since the state of fds is unknown at this point.
502 2005-05-16 Christopher Faylor <cgf@timesys.com>
504 * include/sys/cygwin.h (enum cygwin_getinfo_types): Add CW_DEBUG_SELF.
505 * external.cc (cygwin_internal): Implement CW_DEBUG_SELF.
507 * init.cc (dll_entry): Minor rearrangement of code.
509 2005-05-16 Christopher Faylor <cgf@timesys.com>
511 * path.cc (path_conv::check): Remove embedded dots before slashes.
513 2005-05-16 Corinna Vinschen <corinna@vinschen.de>
515 * environ.cc (conv_envvars): Remove LD_LIBRARY_PATH entirely.
516 It doesn't belong here.
518 2005-05-15 Corinna Vinschen <corinna@vinschen.de>
520 * environ.cc (conv_envvars): Treat LD_LIBRARY_PATH as path list.
522 2005-05-14 Corinna Vinschen <corinna@vinschen.de>
524 * fhandler_disk_file.cc (fhandler_base::fstat_by_handle): Check
525 return code from GetFileSize and set file size to 0 if necessary.
526 * fhandler_netdrive.cc (fhandler_netdrive::fstat): Set permissions
527 to read/execute for all.
529 2005-05-13 Christopher Faylor <cgf@timesys.com>
531 * path.cc (normalize_posix_path): Do normalization on . and .. after
534 2005-05-13 Corinna Vinschen <corinna@vinschen.de>
536 * fhandler.h (fhandler_netdrive::readdir): Remove useless comment.
538 2005-05-13 Corinna Vinschen <corinna@vinschen.de>
540 * autoload.cc (WNetGetResourceParentA): Import.
541 (WNetOpenEnumA): Import.
542 (WNetEnumResourceA): Import.
543 (WNetCloseEnum): Import.
544 * fhandler.h (fhandler_netdrive::telldir): Add declaration.
545 (fhandler_netdrive::seekdir): Ditto.
546 (fhandler_netdrive::closedir): Ditto.
547 * fhandler_netdrive.cc: Drop explicit including windows.h. Include
548 winnetwk.h instead of shlwapi.h. Include dirent.h.
549 (fhandler_netdrive::readdir): Implement.
550 (fhandler_netdrive::telldir): New method.
551 (fhandler_netdrive::seekdir): New method.
552 (fhandler_netdrive::closedir): Ditto.
554 2005-05-13 Christopher Faylor <cgf@timesys.com>
556 Remove PC_FULL from path_conv usage throughout.
557 * path.h (enum pathconv_arg): Change PC_FULL to PC_NOFULL.
558 * path.cc (path_conv::check): Test for PC_NOFULL rather than !PC_FULL.
559 (cygwin_conv_to_win32_path): Use PC_NOFULL to force non-absolute path.
561 2005-05-13 Christopher Faylor <cgf@timesys.com>
563 * fhandler_netdrive.cc (fhandler_netdrive::exists): Assert that "//"
566 2005-05-12 Christopher Faylor <cgf@timesys.com>
568 * cygtls.cc (_cygtls::remove): Eliminate compiler warning.
570 * dir.cc (mkdir): Check path for writability.
571 (rmdir): Ditto. Remove check for special directories.
572 * path.cc (path_conv::check): Set PATH_RO for virtual devices. Set
573 error if read-only and asked for writability.
574 * path.h (pathconv_arg): Add PC_WRITABLE.
575 (path_types): Add PATH_RO.
576 (path_conv::isro): Add (currently unused) check for read-only
577 filesystem. Return "ENOSHARE" when we know a share doesn't exist.
578 * include/sys/mount.h: Add MOUNT_RO flag.
579 * autoload.cc (WNetGetResourceInformationA): Import.
580 * fhandler_netdrive.cc (fhandler_netdrive::exists): Detect actual
581 existence of remote system rather than always assuming that it exists.
583 2005-05-11 Christopher Faylor <cgf@timesys.com>
585 * dcrt0.cc (do_global_dtors): Don't call dll_global_dtors here.
586 (__main): Reinstate atexit of do_global_dtors.
587 (cygwin_exit): Call dll_global_dtors here.
591 2005-05-10 Christopher Faylor <cgf@timesys.com>
593 * cygtls.cc (_cygtls::remove): Clear exitsock after close.
594 * fhandler_console.cc (fhandler_console::write_normal): Store character
595 in a local variable for potential future inspection.
597 2005-05-10 Corinna Vinschen <corinna@vinschen.de>
599 * Makefile.in (DLL_OFILES): Add fhandler_mailslot.o.
600 * devices.h (FH_KMSG): Define new device.
601 * devices.in: Add "/dev/kmsg" entry.
602 * devices.cc: Regenerate.
603 * dtable.cc (build_fh_pc): Handle case FH_KMSG.
604 * fhandler.h (class fhandler_mailslot): New class.
605 (class select_stuff): Add device_specific_mailslot pointer.
606 * fhandler_mailslot.cc: New file.
607 * select.cc (peek_mailslot): New function.
608 (verify_mailslot): Ditto.
609 (struct mailslotinf): New stuct to handle select on mailslots.
610 (thread_mailslot): New function.
611 (start_thread_mailslot): Ditto.
612 (mailslot_cleanup): Ditto.
613 (fhandler_mailslot::select_read): New method.
614 * syslog.cc (klog_guard): New muto.
615 (dev_kmsg): Local mailslot for kernel message device.
616 (vklog): New function.
618 * winsup.h (vklog): Declare.
620 * include/sys/syslog.h: Define _PATH_KLOG.
622 2005-05-10 Christopher Faylor <cgf@timesys.com>
624 * dcrt0.cc (dll_crt0_1): Call cygwin_exit to ensure that destructors
625 are handled correctly.
627 2005-05-10 Corinna Vinschen <corinna@vinschen.de>
629 * path.cc (path_conv::check): Set correct file attributes for socket
632 2005-05-09 Pierre Humblet <pierre.humblet@ieee.org>
634 * fhandler.h (class fhandler_netdrive): New class.
635 * fhandler_netdrive.cc (fhandler_netdrive::fhandler_netdrive): New constructor.
636 (fhandler_netdrive::exists): New method.
637 (fhandler_netdrive::fstat): Ditto.
638 (fhandler_netdrive::readdir): Ditto.
639 (fhandler_netdrive::open): Ditto.
640 * dtable.cc (build_fh_pc): Handle case FH_NETDRIVE.
641 * path.cc (isvirtual_dev): Add FH_NETDRIVE.
642 (mount_info::conv_to_win32_path): Detect netdrive device and bypass mount
643 search for network paths.
645 2005-05-08 Christopher Faylor <cgf@timesys.com>
647 * dcrt0.cc (get_cygwin_startup_info): New function pulled from
649 (dll_crt0_0): Use get_cygwin_startup_info to retrieve cygwin-specific
651 * external.cc (cygwin_internal): Implement CW_ARGV and CW_ENVP.
652 * include/sys/cygwin.h: Implement CW_ARGV and CW_ENVP.
654 2005-05-07 Christopher Faylor <cgf@timesys.com>
656 * path.cc (normalize_posix_path): Don't treat '//' specially since
657 newer versions of bash now get this right.
659 2005-05-07 Christopher Faylor <cgf@timesys.com>
661 * devices.cc: Regenerate with correct name for dev_netdrive_storage.
663 2005-05-06 Christopher Faylor <cgf@timesys.com>
665 * Makefile.in (DLL_O_FILES): Add fhandler_netdrive.o.
666 * fhandler_netdrive.cc: Placeholder file for future development.
667 * devices.h (FH_NETDRIVE): Define new virtual device type.
668 (netdrive_dev): Define.
669 * devices.in (dev_netdrive_storage): Define.
670 * devices.cc: Regenerate.
672 2005-05-04 Corinna Vinschen <corinna@vinschen.de>
674 * cygerrno.h (__set_errno): Remove useless parentheses.
676 2005-05-04 Corinna Vinschen <corinna@vinschen.de>
678 * cygerrno.h (__set_errno): Define as inline function here.
679 (set_errno): Always define as call to __set_errno.
680 * debug.cc (__set_errno): Move to cygerrno.h.
682 2005-05-03 Christopher Faylor <cgf@timesys.com>
684 * shared.cc (user_shared_initialize): Rework locking so that nothing is
685 checked until cb is non-zero.
687 2005-05-03 Corinna Vinschen <corinna@vinschen.de>
689 * fhandler_disk_file.cc (fhandler_disk_file::fchmod): Don't treat
690 inability to open file as failure if only SetFileAttributes is
691 going to be called. Only call set_file_attribute if really necessary.
693 2005-05-03 Corinna Vinschen <corinna@vinschen.de>
695 * fhandler_socket.cc (get_inet_addr): Add missing __seterrno call.
697 2005-05-01 Christopher Faylor <cgf@timesys.com>
699 * fhandler_tty.cc (fhandler_tty_slave::read): Actually read input when
702 2005-04-30 Christopher Faylor <cgf@timesys.com>
704 * environ.cc (spenv::force_into_environment): Rename from add_always.
705 (spenv::add_if_exists): Rename from force.
706 (build_env): Accommodate name changes. Make sure that stuff that is
707 always supposed to be in the environment is actually added to the
710 * shared.cc (open_shared): Restore VirtualFree eliminated by 2005-04-28
713 2005-04-30 Christopher Faylor <cgf@timesys.com>
715 * errno.cc (errmap): Sort table.
717 2005-04-29 Christopher Faylor <cgf@timesys.com>
719 * errno.cc (errmap): Map ERROR_NETNAME_DELETED to ENOSHARE.
721 2005-04-28 Corinna Vinschen <corinna@vinschen.de>
723 * shared_info.h (cygwin_shared_address): Bump to a higher value to avoid
724 collision with large data areas.
726 2005-04-28 Christopher Faylor <cgf@timesys.com>
728 * fhandler_console.cc (fhandler_console::get_tty_stuff): Accommodate
729 changes to open_shared arguments.
730 * fhandler_tape.cc (mtinfo_init): Ditto.
731 * pinfo.cc (pinfo::init): Use open_shared rather than win32 mmap calls.
732 * shared.cc (user_shared_initialize): Ditto.
733 (memory_init): Ditto.
734 (open_shared): Change to allow use a smore general mmap handler.
735 * shared_info.h (shared_locations): Add SH_JUSTCREATE, SH_JUSTOPEN.
736 (open_shared): Change declaration to match new usage.
738 * autoload.cc (LoadDLLfuncEx2): Define in terms of LoadDLLfuncEx3.
739 (LoadDLLfuncEx3): New macro.
741 2005-04-27 Christopher Faylor <cgf@timesys.com>
743 * fhandler.cc (fhandler_base::open_9x): Remove (broken) check for
745 * syscalls.cc (open): Do O_CREAT|O_EXCL check here first.
747 2005-04-26 Christopher Faylor <cgf@timesys.com>
749 * environ.cc (build_env): Ensure that win32 array is properly filled in
750 when a missing value has to be generated.
752 2005-04-26 Christopher Faylor <cgf@timesys.com>
754 * include/cygwin/version.h: Bump DLL minor number to 17.
756 2005-04-24 Pavel Tsekov <ptsekov@gmx.net>
758 * how-to-debug-cygwin.txt: Fix typo.
760 2005-04-22 Christopher Faylor <cgf@timesys.com>
762 * shared.cc (user_shared_initialize): Implement locking similar to
763 shared_info when initializing shared region.
765 2005-04-22 Christopher Faylor <cgf@timesys.com>
767 * fhandler.h (dev_console::set_color): Define new function.
768 (dev_console::set_default_attr): Ditto, moved from fhandler_console.
769 (dev_console::fillin_info): Ditto. Accommodate this change throughout
771 (fhandler_console::get_win32_attr): Eliminate.
772 * fhandler_console.cc (fhandler_console::get_tty_stuff): Properly set
773 default attributes on initialization.
774 (fhandler_console::open): Set current attributes rather than default
776 (fhandler_console::get_win32_attr): Eliminate.
777 (dev_console::set_color): New function. Move get_win32_attr stuff
779 (dev_console::set_default_attr): New function, moved from
781 (dev_console::fillin_info): Ditto.
782 (fhandler_console::char_command): Call set_color to set screen
785 2005-04-22 Christopher Faylor <cgf@timesys.com>
787 * fhandler.cc (fhandler_base::read): Remove unused signal state tweaks.
788 * fhandler.h (fhandler_pipe::create_selectable): Declare.
789 (fhandler_fifo::close_one_end): Declare.
790 * fhandler_fifo.cc (fhandler_fifo::close_one_end): Define.
791 (fhandler_fifo::open_not_mine): Use close_one_end to close appropriate
793 * pinfo.cc (_pinfo::commune_recv): Ditto.
794 * pipe.cc (fhandler_pipe::create_selectable): Rename from
795 create_selectable_pipe. Reorganize.
796 (fhandler_pipe::create): Use create_selectable.
798 2005-04-21 Christopher Faylor <cgf@timesys.com>
800 * shared.cc (shared_info::initialize): Test previous version of shared
801 memory magic rather than current version when determining if there has
802 been a shared memory mismatch.
804 2005-04-20 Christopher Faylor <cgf@timesys.com>
806 * sigproc.cc (proc_subproc): Fix handling of waiting for pids with zero
809 * strace.cc (strace::hello): Report parent pid of executing process.
811 2005-04-20 Christopher Faylor <cgf@timesys.com>
813 * path.cc (path_conv::check): Fix problem reading symlinks introduced
814 in below change by reverting the change and adding an additional test
815 for nonexistent files in /proc.
817 2005-04-20 Christopher Faylor <cgf@timesys.com>
819 * path.cc (path_conv::check): Punt when attempting to access a
820 nonexistent directory or file in /proc.
822 2005-04-19 Corinna Vinschen <corinna@vinschen.de>
824 * security.cc (alloc_sd): Remove DELETE bit from user's ACE if
825 allow_traverse is set.
827 2005-04-19 Corinna Vinschen <corinna@vinschen.de>
829 * cygwin.din (pselect): Export.
830 * select.cc (pselect): New function.
831 * include/cygwin/version.h: Bump API minor number.
832 * include/sys/select.h: Include signal.h. Declare pselect.
834 2005-04-18 Corinna Vinschen <corinna@vinschen.de>
836 * fhandler.h (enum conn_state): Add connect_failed state.
837 * fhandler_socket.cc (fhandler_socket::connect): Set connect_state to
838 connect_failed when connect failed.
839 * poll.cc (poll): Change errno to EINVAL if allocating memory fails,
840 according to SUSv3. Add socket descriptors always to except_fds. Test
841 for failed connect and set revents flags appropriately.
842 * select.cc (set_bits): Set connect_state to connect_failed when
843 select indicates failed nonblocking connect.
844 (fhandler_dev_null::select_except): Set except_ready to false so that
845 /dev/null is not always in except state.
846 (peek_socket): Fix bogus conditional.
847 (fhandler_socket::select_write): Treat all connect_states except
848 unconnected equivalent to return consistent results.
849 (fhandler_windows::select_except): Set except_ready to false so that
850 /dev/windows is not always in except state.
852 2005-04-18 Christopher Faylor <cgf@timesys.com>
854 * include/cygwin/version.h: Bump DLL minor number to 16.
856 2005-04-18 Pierre Humblet <pierre.humblet@ieee.org>
858 * grp.cc (initgroups32): Return the correct value.
860 2005-04-16 Corinna Vinschen <corinna@vinschen.de>
862 * fhandler_disk_file.cc (fhandler_base::utimes_fs): Ignore
863 ERROR_NOT_SUPPORTED to workaround Win9x weirdness.
864 * path.cc (symlink_info::check): Remap ERROR_INVALID_FUNTION to
865 ERROR_FILE_NOT_FOUND for the same reason.
867 2005-04-16 Corinna Vinschen <corinna@vinschen.de>
868 Pierre Humblet <pierre.humblet@ieee.org>
870 * security.h (cygsidlist::addfromgr): Allow duplicate entries.
871 (get_server_groups): Declare new function.
872 * security.cc (is_group_member): Simplify.
873 (get_server_groups): New function.
874 (get_initgroups_sidlist): Call get_server_groups.
875 (verify_token): Allow token when supplementary sids are not in
876 /etc/group but are in the token.
878 * grp.cc (initgroups32): New implementation.
879 (getgroups32): Handle case where the supplementary groups are set.
881 2005-04-16 Corinna Vinschen <corinna@vinschen.de>
883 * environ.cc (environ_init): Don't set traverse checking as default.
885 2005-04-16 Corinna Vinschen <corinna@vinschen.de>
887 * fhandler_disk_file.cc (fhandler_base::utimes_fs): Drop touching
890 2005-04-16 Christopher Faylor <cgf@timesys.com>
892 * fhandler.cc (fhandler::dup): Duplicate flags, too.
893 * fhandler.h (fhandler_fifo::owner): Eliminate.
894 * fhandler_disk_file.cc (fhandler_base::fstat_fs): Handle on-disk
896 (fhandler_base::fstat_helper): Ditto.
897 * fhandler_fifo.cc (fhandler_fifo::fhandler_fifo): Don't initialize
899 (fhandler_fifo::open_not_mine): Add some debugging. Duplicate correct
900 handle when we own it.
901 (fhandler_fifo::open): Set flags from input, not from first pipe. Flag
902 that fork fixup is needed.
903 (fhandler_fifo::dup): Set errno correctly when DuplicateHandle fails.
904 * pinfo.cc (commune_send): Add debugging for fifo.
906 * cygwin/version.h: Bump API minor version to 127 to reflect exporting
909 2005-04-14 Kazuhiro Fujieda <fujieda@jaist.ac.jp>
911 * syscalls.cc (setuid32): Correct debugging output.
913 2005-04-14 Christopher Faylor <cgf@timesys.com>
915 * dcrt0.cc (do_global_dtors): Run DLL dtors.
916 (__main): Don't rely on atexit to run dtors.
917 (do_exit): Specifically call do_global_dtors here.
918 (cygwin_exit): Ditto.
919 * dll_init.cc (dll_global_dtors): Make global. Only run dtors once.
920 (dll_list::init): Just set flag that dtors should be run. Don't rely on atexit.
921 * dll_init.h (dll_global_dtors): Declare.
923 * exceptions.cc (sigrelse): Define.
925 * path.h (is_fs_device): New method.
926 (is_lnk_special): Ditto.
927 * fhandler_disk_file.cc (fhandler_disk_file::link): Use
928 "is_lnk_special" rather than "is_lnk_symlink".
929 * syscalls.cc (rename): Ditto.
931 * hookapi.cc (ld_preload): Use colon as a separator rather than space.
933 2005-04-13 Corinna Vinschen <corinna@vinschen.de>
935 * fhandler.h (class fhandler_socket): Remove utimes.
936 * fhandler_socket.cc (fhandler_socket::utimes): Remove.
938 2005-04-13 Corinna Vinschen <corinna@vinschen.de>
940 * cygerrno.h (__seterrno_from_nt_status): Define. Always set Win32
941 error code as well as errno. Use throughout where errno is set from
943 (set_errno): Evaluate val only once.
944 * fhandler_disk_file.cc (fhandler_base::fstat_by_handle): Fix typo in
946 * fhandler_mem.cc (fhandler_dev_mem::open): Rely on
947 __seterrno_from_nt_status setting Win32 error code in debug output.
948 * fhandler_proc.cc (format_proc_uptime): Ditto.
949 (format_proc_stat): Ditto.
950 * fhandler_process.cc (format_process_stat): Ditto.
951 * sysconf.cc (sysconf): Ditto.
953 2005-04-13 Christopher Faylor <cgf@timesys.com>
955 * fhandler.h (fhandler_base::utimes_fs): New method.
956 * fhandler.cc (fhandler_base::utimes): Call utimes_fs if on-disk
958 * fhandler_disk_file.cc (fhandler_disk_file::utimes): Use utimes_fs.
959 (fhandler_base::utimes_fs): Handle on-disk device files.
961 2005-04-13 Corinna Vinschen <corinna@vinschen.de>
963 * fhandler_disk_file.cc (fhandler_disk_file::utimes): Don't set errno
964 if open fails, it has already been set by open.
966 2005-04-12 Corinna Vinschen <corinna@vinschen.de>
968 * autoload.cc (NtQueryVolumeInformationFile): Add.
969 * fhandler.cc (fhandler_base::raw_write): Don't touch has_changed flag.
970 * fhandler.h (enum change_state): Remove.
971 (fhandler_base::status): Revert has_changed to a simple bit.
972 (fhandler_base::fstat_helper): Add nAllocSize parameter. Rename
973 ftCreationTime to ftChangeTime.
974 * fhandler_disk_file.cc: Call fstat_helper with additional
975 allocation size throughout.
976 (fhandler_base::fstat_by_handle): Use NT native functions to get
977 full file information on NT. Call fstat_helper with LastWriteTime
978 as ctime, if ChangeTime is not available.
979 (fhandler_base::fstat_by_name): Call fstat_helper with LastWriteTime
981 (fhandler_base::fstat_helper): Add comment. Drop special FAT
982 handling since it's useless. Use nAllocSize for st_blocks if available.
983 (fhandler_disk_file::touch_ctime): Only touch LastWriteTime.
984 (fhandler_disk_file::fchmod): Set has_changed on 9x only.
985 (fhandler_disk_file::fchown): Don't set has_changed.
986 (fhandler_disk_file::facl): Ditto.
987 (fhandler_disk_file::ftruncate): Ditto.
988 (fhandler_disk_file::link): Set has_changed on 9x only and on original
990 (fhandler_base::open_fs): Don't set has_changed in O_TRUNC case.
991 * ntdll.h (FILE_BASIC_INFORMATION): Define.
992 (FILE_STANDARD_INFORMATION): Define.
993 (FILE_INTERNAL_INFORMATION): Define.
994 (FILE_EA_INFORMATION): Define.
995 (FILE_ACCESS_INFORMATION): Define.
996 (FILE_POSITION_INFORMATION): Define.
997 (FILE_MODE_INFORMATION): Define.
998 (FILE_ALIGNMENT_INFORMATION): Define.
999 (FILE_NAME_INFORMATION): Don't define with arbitrary FileName size.
1000 (FILE_ALL_INFORMATION): Define.
1001 (FILE_INFORMATION_CLASS): Add FileAllInformation.
1002 (FILE_FS_VOLUME_INFORMATION): Define.
1003 (FS_INFORMATION_CLASS): Define.
1004 (NtQueryVolumeInformationFile): Define.
1006 2005-04-11 Corinna Vinschen <corinna@vinschen.de>
1008 Revert previous patch.
1009 * autoload.cc (GetVolumePathNamesForVolumeNameA): Remove.
1010 (GetVolumeNameForVolumeMountPointA): Add.
1011 * syscalls.cc (sync): Rewrite guid case to skip floppies also on
1014 2005-04-11 Corinna Vinschen <corinna@vinschen.de>
1016 * syscalls.cc (sync): Use renamed has_get_volume_pathnames wincap.
1017 * wincap.h (wincaps::has_get_volume_pathnames): Rename from
1019 * wincap.cc: Accomodate above rename throughout. Set to false on
1022 2005-04-08 Christopher Faylor <cgf@timesys.com>
1024 * pipe.cc (fhandler_pipe::open): Remove O_CREAT limitation.
1026 2005-04-07 Corinna Vinschen <corinna@vinschen.de>
1028 * syslog.cc (try_connect_guard): Remove useless conditionalized code.
1030 2005-04-07 Corinna Vinschen <corinna@vinschen.de>
1032 * syslog.cc: Include sys/socket.h.
1033 (try_connect_guard): New static variable.
1034 (syslogd_inited): Ditto.
1035 (syslogd_sock): Ditto.
1036 (try_connect_syslogd): New function to connect and write syslog to
1038 (vsyslog): Log to stderr if LOG_PERROR flag has been given to openlog.
1039 Try logging to syslogd. Use Event Log resp. log file as fallback.
1040 (closelog): Close socket to syslogd.
1041 * include/sys/syslog.h (_PATH_LOG): Define.
1042 (INTERNAL_NOPRI): Define if SYSLOG_NAMES is defined.
1043 (INTERNAL_MARK): Ditto.
1044 (struct _code): Ditto.
1045 (prioritynames): Ditto.
1046 (facilitynames): Ditto.
1048 2005-04-06 Corinna Vinschen <corinna@vinschen.de>
1050 * fhandler_socket.cc (get_inet_addr): Add type parameter to return
1051 unix socket type. Read socket type from unix socket file.
1052 (fhandler_socket::bind): Write socket type to unix socket file.
1053 (fhandler_socket::connect): Return with errno EPROTOTYPE if
1054 socket type of socket doesn't match socket type of unix socket
1055 trying to connect to.
1057 2005-04-06 Pierre Humblet <pierre.humblet@ieee.org>
1059 * security.h (cygsidlist::addfromgr): Avoid duplicate entries.
1060 * grp.cc (initgrousp): Add syscall_printf.
1061 (setgroups): Add syscall_printf and make sure sids are added only once.
1063 2005-04-06 Christopher Faylor <cgf@timesys.com>
1065 * net.cc (cygwin_getservbyname): Return (possibly NULL) return value of
1066 dup_ent rather than assuming that tls buffer is valid.
1067 (cygwin_getservbyport): Ditto.
1068 (cygwin_gethostbyname): Ditto.
1069 (cygwin_gethostbyaddr): Ditto.
1071 2005-04-05 Christopher Faylor <cgf@timesys.com>
1073 * cygtls.cc (_cygtls::remove): Don't free or close stuff if we're being
1074 called in a "non-standard" way.
1076 2005-04-05 Christopher Faylor <cgf@timesys.com>
1078 * sync.h (muto::initforce): Delete flawed implementation.
1079 * pwdgrp.h (pwdgrp::pglock): Make static.
1080 * grp.cc (pwdgrp::pwdgrp): Eliminate use of initforce.
1082 2005-04-05 Christopher Faylor <cgf@timesys.com>
1084 * sync.h (muto::initforce): Force initialization even when name !=
1086 * grp.cc (pwdgrp::pwdgrp): Use initforce since the enclosing structure
1089 2005-04-05 Christopher Faylor <cgf@timesys.com>
1091 * sync.h (muto::operator int): New operator.
1092 (locker): Remove unused class.
1095 (new_muto_name): Ditto.
1096 * cygheap.cc (cygheap_setup_for_child): Reflect use of static storage
1097 for muto rather than pointer.
1102 * cygheap.h (cwdstuff::cwd_lock): Ditto.
1103 (cwdstuff::get_drive): Ditto.
1104 * cygmalloc.h (__malloc_lock): Ditto.
1105 (__malloc_unlock): Ditto.
1106 * cygtls.cc (sentry::lock): Ditto.
1107 (sentry::sentry): Ditto.
1109 (_cygtls::init): Ditto.
1111 (cygwin_atexit): Ditto.
1112 (cygwin_exit): Ditto.
1113 * debug.cc (lock_debug::locker): Ditto.
1114 (lock_debug::lock_debug): Ditto.
1115 (lock_debug::unlock): Ditto.
1116 (debug_init): Ditto.
1117 * dtable.cc (dtable::init_lock): Ditto.
1118 * dtable.h (dtable::lock_cs): Ditto.
1119 (dtable::lock): Ditto.
1120 (dtable::unlock): Ditto.
1121 * exceptions.cc (mask_sync): Ditto.
1123 (set_process_mask_delta): Ditto.
1124 (set_signal_mask): Ditto.
1125 (events_init): Ditto.
1126 * grp.cc (pwdgrp::pwdgrp): Ditto.
1127 * malloc_wrapper.cc (mallock): Ditto.
1128 (malloc_init): Ditto.
1129 * path.cc (cwdstuff::cwd_lock): Ditto.
1130 (cwdstuff::get_hash): Ditto.
1131 (cwdstuff::get_hash): Ditto.
1132 (cwdstuff::init): Ditto.
1133 (cwdstuff::set): Ditto.
1134 (cwdstuff::get): Ditto.
1135 * pwdgrp.h (pwdgrp::pglock): Ditto.
1136 (pwdgrp::refresh): Ditto.
1137 * sigproc.cc (sync_proc_subproc): Ditto.
1138 (get_proc_lock): Ditto.
1139 (proc_subproc): Ditto.
1140 (_cygtls::remove_wq): Ditto.
1141 (proc_terminate): Ditto.
1142 (sigproc_init): Ditto.
1143 * timer.cc (lock_timer_tracker::protect): Ditto.
1144 (lock_timer_tracker::lock_timer_tracker): Ditto.
1145 (lock_timer_tracker::~lock_timer_tracker): Ditto.
1146 * wininfo.cc (wininfo::_lock;): Ditto.
1147 (wininfo::winthread): Ditto.
1148 (operator HWND): Ditto.
1149 (wininfo::lock): Ditto.
1150 (wininfo::release): Ditto.
1151 * wininfo.h (wininfo::_lock;): Ditto.
1153 2005-04-04 Christopher Faylor <cgf@timesys.com>
1155 * path.cc (path_conv::check): Only check for PC_NO_ACCESS_CHECK in end
1158 2005-04-04 Corinna Vinschen <corinna@vinschen.de>
1160 * dcrt0.cc (dll_crt0_1): Don't call set_cygwin_privileges on 9x.
1162 * fhandler.h (enum change_state): Add.
1163 (fhandler_base::status): Add a bit to has_changed flag.
1164 (fhandler_base::has_changed): Implement with type change_state.
1165 * fhandler.cc (fhandler_base::raw_write): Accommodate type change
1167 * fhandler_disk_file.cc (fhandler_disk_file::touch_ctime): Also
1168 touch modification time if has_changed == data_changed.
1169 (fhandler_disk_file::fchmod): Also open on 9x, otherwise we can't
1170 touch ctime. Accommodate type change of has_changed.
1171 (fhandler_disk_file::fchown): Accommodate type change of has_changed.
1172 (fhandler_disk_file::facl): Ditto.
1173 (fhandler_disk_file::ftruncate): Ditto.
1174 (fhandler_disk_file::link): Ditto.
1175 (fhandler_base::open_fs): Ditto.
1177 2005-04-03 Corinna Vinschen <corinna@vinschen.de>
1179 * cygheap.cc (cygheap_init): Accommodate set_process_privilege change.
1180 * cygheap.h (cygheap_user::curr_primary_token): New member.
1181 (cygheap_user::primary_token): New method.
1182 (cygheap_user::deimpersonate): Always revert to processes'
1183 impersonation token.
1184 (cygheap_user::reimpersonate): Set processes' or setuid token as
1186 (cygheap_user::has_impersonation_tokens): Look for curr_primary_token
1188 (cygheap_user::close_impersonation_tokens): Close curr_primary_token
1189 here if necessary. Don't reset token values to NO_IMPERSONATION since
1190 that's done in uinfo_init anyway.
1191 (init_cygheap::luid): New LUID array keeping privilege LUIDs.
1192 * cygtls.cc (_cygtls::init_thread): Call cygheap->user.reimpersonate.
1193 * dcrt0.cc (hProcToken): New global variable to keep process token.
1194 (hProcImpToken): Ditto for process impersonation token.
1195 (dll_crt0_0): Open process token here once. Duplicate to create
1197 (dll_crt0_1): Call set_cygwin_privileges.
1198 * environ.cc (allow_ntea): Drop duplicate declaration.
1199 (allow_smbntsec): Ditto.
1200 (set_traverse): Only set allow_traverse here.
1201 (environ_init): Ditto.
1202 * fhandler_disk_file.cc (fhandler_disk_file::fchmod): Drop call to
1203 enable_restore_privilege.
1204 (fhandler_disk_file::fchown): Ditto.
1205 (fhandler_disk_file::facl): Ditto.
1206 * fork.cc (fork_child): Move call to cygheap->user.reimpersonate after
1207 syn with parent. Call set_cygwin_privileges.
1208 * grp.cc (internal_getgroups): Use hProcImpToken instead of opening
1210 * path.cc (fs_info::update): Bypass traverse checking when retrieving
1211 volume information using push/pop_thread_privileges.
1212 * registry.cc (load_registry_hive): Drop setting restore privilege
1213 since it's already set if available.
1214 * sec_helper.cc: Include cygtls.h.
1215 (cygpriv): Privilege string array.
1216 (privilege_luid): New function, evaluate LUID from cygpriv_idx.
1217 (privilege_luid_by_name): New function, evaluate LUID from privilege
1219 (privilege_name): New function, evaluate privilege string from
1221 (set_privilege): New static function called by set_process_privilege
1222 and set_thread_privilege. Call privilege_luid to get privilege LUID.
1223 Fix bug in return value evaluation. Improve debug output.
1224 (set_cygwin_privileges): New function.
1225 (set_process_privilege): Remove.
1226 (enable_restore_privilege): Remove.
1227 * security.cc (allow_traverse): New global variable.
1228 (sys_privs): Change type to cygpriv_idx and store privilege indices
1230 (SYSTEM_PRIVILEGES_COUNT): Renamed from SYSTEM_PERMISSION_COUNT.
1231 (get_system_priv_list): Don't use numerical constant in malloc call.
1232 Use privilege_luid to get privilege LUIDs.
1233 (get_priv_list): Call privilege_luid_by_name to get LUIDs. Improve
1234 inner privilege LUID comparison loop.
1235 (create_token): Enable create token privilege using
1236 push/pop_self_privileges. Use hProcToken instead of opening process
1237 token. Use default DACL when duplicating token.
1238 (subauth): Enable tcb privilege using push/pop_self_privileges.
1239 Use sec_none instead of homw made security attributes when duplicating
1241 (check_file_access): Don't duplicate access token, use active
1242 impersonation token as is.
1243 * security.h (enum cygpriv_idx): New enumeration type enumerating
1244 possible privileges.
1245 (privilege_luid): Declare new function.
1246 (privilege_luid_by_name): Ditto.
1247 (privilege_name): Ditto.
1248 (allow_traverse): Declare.
1249 (set_privilege): Declare function.
1250 (set_process_privilege): Define as macro.
1251 (enable_restore_privilege): Remove declaration.
1252 (_push_thread_privilege): Define macro.
1253 (push_thread_privilege): Ditto.
1254 (pop_thread_privilege): Ditto.
1255 (pop_self_privilege): Ditto.
1256 * spawn.cc (spawn_guts): Use cygheap->user.primary_token instead of
1257 cygheap->user.token.
1258 * syscalls.cc (statvfs): Bypass traverse checking when retrieving
1259 volume information using push/pop_thread_privileges. Rearrange code
1260 to simplify push/pop bracketing.
1261 (seteuid32): Use hProcToken instead of opening process token. Call
1262 cygheap->user.deimpersonate instead of RevertToSelf. Create
1263 impersonation token from primary internal or external token. Set
1264 cygheap->user.curr_primary_token and cygheap->user.current_token
1265 privileges once here. Drop "failed" and "failed_ptok" labels.
1266 Drop setting DefaultDacl of process token.
1267 (setegid32): Use hProcToken and hProcImpToken instead of opening
1268 process token. Always reimpersonate afterwards.
1269 * uinfo.cc (cygheap_user::init): Use hProcToken instead of opening
1271 (internal_getlogin): Ditto. Set hProcImpToken, too.
1272 (uinfo_init): Initialize cygheap->user.curr_primary_token.
1273 * winsup.h (hProcToken): Declare.
1274 (hProcImpToken): Declare.
1276 2005-04-03 Corinna Vinschen <corinna@vinschen.de>
1278 Unify usage of CYG_MAX_PATH throughout. Change buffers from
1279 size CYG_MAX_PATH + 1 to CYG_MAX_PATH. Change length tests
1282 2005-04-02 Christopher Faylor <cgf@timesys.com>
1284 * include/cygwin/version.h: Bump DLL minor number to 15.
1286 2005-04-01 Corinna Vinschen <corinna@vinschen.de>
1288 * fork.cc (fork_child): Add missing __stdcall.
1290 2005-04-01 Christopher Faylor <cgf@timesys.com>
1292 * sigproc.cc (create_signal_arrive): New (temporary?) function to
1293 create signal_arrived event.
1294 (sigproc_init): Use create_signal_arrived.
1295 * fork.cc (fork_child): Create signal_arrived early.
1297 2005-04-01 Corinna Vinschen <corinna@vinschen.de>
1299 * fork.cc (fork_child): Fixup SYSV IPC shared memory before fixing
1302 2005-03-31 Corinna Vinschen <corinna@vinschen.de>
1304 * gentls_offsets: Add '-m32' flag to native compiler call to satisfy
1305 cross platform builds.
1307 2005-03-31 Corinna Vinschen <corinna@vinschen.de>
1309 * errno.cc (NO_SYSTEM_RESOURCES): Map to EAGAIN.
1310 (NONPAGED_SYSTEM_RESOURCES): Ditto.
1311 (PAGED_SYSTEM_RESOURCES): Ditto.
1312 (WORKING_SET_QUOTA): Ditto.
1313 (PAGEFILE_QUOTA): Ditto.
1314 (COMMITMENT_LIMIT): Ditto.
1316 2005-03-30 Christopher Faylor <cgf@timesys.com>
1318 * environ.cc (spenvs): Re-force SYSTEMROOT to always be included in
1322 2005-03-30 Christopher Faylor <cgf@timesys.com>
1324 * environ.cc (spenv::retrieve): Revert most of previous change.
1325 (build_env): Ditto. Rework to track environment variables which need
1326 to always be in the windows environment in a separate array.
1328 2005-03-30 Igor Pechtchanski <pechtcha@cs.nyu.edu>
1330 * path.cc (symlink_info::case_check): Ignore trailing characters
1331 in paths when comparing case.
1333 2005-03-30 Christopher Faylor <cgf@timesys.com>
1335 * environ.h (win_env::immediate): Declare new field.
1336 (win_env::operator = ): Declare new operator.
1337 (win_env::reset): Declare new function.
1338 (win_env::~win_env): Declare new destructor.
1339 (getwinenv): Add optional third argument to declaration.
1340 * environ.cc (conv_envvars): Accommodate immediate field.
1341 (win_env::operator =): Define new operator.
1342 (win_env::~win_env): Define new destructor.
1343 (win_env::add_cache): Add value to environment immediately if
1345 (getwinenv): Accept optional third argument which will be used to store
1346 "cached" values to avoid overwriting real cache.
1347 (spenv::force): Declare new field.
1348 (spenvs): Accommodate force field. Add "PATH=" with force set to true.
1349 (spenv::retrieve): Avoid duping anything if we're not building an
1351 (build_env): Ditto. Use size of potentially constructed new
1352 environment block to determine if we need to create an environment
1353 block. Pass getwinenv temporary storage to avoid inappropriately
1354 overwriting the environment cache.
1356 2005-03-29 Eric Blake <ebb9@byu.net>
1358 * include/limits.h (NAME_MAX): New define.
1359 (PATH_MAX): POSIX allows PATH_MAX to include trailing NUL.
1361 2005-03-29 Corinna Vinschen <corinna@vinschen.de>
1363 * path.cc (is_floppy): Make externally available.
1364 * path.h (is_floppy): Declare.
1365 * syscalls.cc (sync): Check for floppies on A: and B: in guid case.
1366 Don't call setmntent in non-guid case but evaluate drive bit mask
1369 2005-03-29 Corinna Vinschen <corinna@vinschen.de>
1371 * fhandler_process.cc: Re-add exename.
1373 2005-03-28 Christopher Faylor <cgf@timesys.com>
1375 * include/ctype.h: Accommodate building in newlib.
1377 2005-03-28 Christopher Faylor <cgf@timesys.com>
1379 * timer.cc (getitimer): Check that ovalue is a valid pointer, not just
1382 2005-03-28 Christopher Faylor <cgf@timesys.com>
1384 * timer.cc (timer_tracker::settime): Set times to zero when just
1387 2005-03-28 Christopher Faylor <cgf@timesys.com>
1389 * cygthread.cc (cygthread::detach): Revert to just waiting for thread
1390 event since waiting for anything else is racy.
1391 * timer.cc (timer_tracker::hcancel): Rename from cancel.
1392 (timer_tracker::cancel): New method.
1393 (timer_tracker::th): Remove.
1394 (timer_tracker::~timer_tracker): Call cancel method.
1395 (timer_tracker::timer_tracker): Ditto.
1396 (timer_tracker::timer_tracker): Always, clear cancel, even though it is
1397 probably not strictly necessary for ttstart.
1398 (timer_thread): Accommodate cancel -> hcancel rename.
1399 (timer_tracker::settime): Ditto.
1400 (timer_tracker::gettime): Ditto.
1401 (timer_delete): Ditto.
1403 * cygwin.din: Export _ctype_.
1404 * include/ctype.h: Mark that _ctype_ is imported.
1406 2005-03-28 Christopher Faylor <cgf@timesys.com>
1408 * timer.cc (timer_tracker::timer_tracker): Eliminate simple
1410 (ttstart): Fully initialize.
1412 * errno.cc: Fix typo introduced in previous change.
1414 2005-03-28 Eric Blake <ebb9@byu.net>
1416 * errno.cc (FILENAME_EXCED_RANGE): Map to ENAMETOOLONG.
1418 2005-03-27 Christopher Faylor <cgf@timesys.com>
1420 * signal.cc (nanosleep): Revert tv_sec < 0 check as it is fixed
1421 properly in the below change to hires.h.
1423 2005-03-27 Pierre Humblet <pierre.humblet@ieee.org>
1425 * times.cc (hires_ms::usecs): Compare the difference.
1426 * hires.h: Add parentheses to HIRES_DELAY_MAX.
1428 2005-03-26 Christopher Faylor <cgf@timesys.com>
1430 * timer.cc (nanosleep): Treat tv_sec < 0 as invalid.
1432 * include/search.h: Make declarations consistent with newlib.
1434 2005-03-26 Pierre Humblet <pierre.humblet@ieee.org>
1435 Christopher Faylor <cgf@timesys.com>
1437 * wininfo.h (wininfo::timer_active): Delete.
1438 (wininfo::itv): Ditto.
1439 (wininfo::start_time): Ditto.
1440 (wininfo::window_started): Ditto.
1441 (wininfo::getitimer): Ditto.
1442 (wininfo::setitimer): Ditto.
1443 (wininfo::wininfo): Ditto.
1444 (wininfo::lock): New method.
1445 (wininfo::release): Ditto.
1446 * window.cc: Use new lock/acquire wininfo methods throughout.
1447 (wininfo::wininfo): Delete
1448 (wininfo::getitimer): Ditto.
1449 (wininfo::setitimer): Ditto.
1454 (wininfo::lock): Define new function.
1455 (wininfo::release): Ditto.
1456 (wininfo::process): Delete WM_TIMER handling.
1457 * timer.cc (struct timetracker): Delete it, flags. Add it_interval,
1458 interval_us, sleepto_us, running, init_muto(), syncthread, and
1460 (ttstart): Make NO_COPY.
1461 (lock_timer_tracker): New class.
1462 (timer_tracker::timer_tracker): Distinguish ttstart case.
1463 (timer_tracker::~timer_tracker): New destructor. Clean out events, and
1465 (timer_tracker::init_muto): New method.
1466 (to_us): Round up as per POSIX.
1467 (timer_thread): Reorganize to match timer_tracker::settime and
1468 timer_tracker::gettime. Call sig_send without wait. Call
1470 (timer_tracker::settime): Reorganize logic to avoid race. Call gettime
1471 to recover old value.
1472 (timer_tracker::gettime): New method.
1473 (timer_create): Properly set errno on invalid timerid. Use new
1474 lock_timer_tracker method.
1475 (timer_delete): Ditto. Simplify code slightly.
1476 (timer_gettime): New function.
1477 (fixup_timers_after_fork): Reinit ttstart.
1478 (getitimer): New implementation.
1482 * cygwin.din: Export timer_gettime.
1483 * winsup.h: Remove has has_visible_window_station declaration.
1485 2005-03-26 Christopher Faylor <cgf@timesys.com>
1487 * Makefile.in (DLL_OFILES): Add lsearch.o.
1488 * cygthread.h (cygthread::notify_detached): New element.
1489 (cygthread::cygthread): Take optional fourth argument signifying event
1490 to signal on thread completion.
1491 * cygthread.cc (cygthread::stub): Signal notify_detached event, if it
1493 (cygthread::cygthread): Initialize notify_detached from fourth argument.
1494 (cygthread::detach): Wait for notify_detached field is present.
1496 * lsearch.cc: New file.
1498 * include/cygwin/version.h: Bump API minor number to 126.
1499 * cygwin.din: Export lsearch, lfind.
1501 2005-03-23 Corinna Vinschen <corinna@vinschen.de>
1503 * fhandler.h (fhandler_socket::secret_event): Remove.
1504 (fhandler_socket::af_local_set_secret): New function combining former
1505 set_connect_secret and get_connect_secret into one function.
1506 (fhandler_socket::af_local_setblocking): Rename from eid_setblocking.
1507 (fhandler_socket::af_local_unsetblocking): Rename from
1509 (fhandler_socket::af_local_set_cred): New method.
1510 (fhandler_socket::af_local_copy): New method.
1511 (fhandler_socket::af_local_recv_secret): New method.
1512 (fhandler_socket::af_local_send_secret): New method.
1513 (fhandler_socket::af_local_recv_cred): Rename from eid_recv.
1514 (fhandler_socket::af_local_send_cred): Rename from eid_send.
1515 (fhandler_socket::af_local_accept): New method.
1516 (fhandler_socket::af_local_set_sockpair_cred): Rename from
1517 set_socketpair_eids.
1518 (fhandler_socket::eid_accept): Remove.
1519 (fhandler_socket::eid_connect): Remove.
1520 (fhandler_socket::set_connect_secret): Remove.
1521 (fhandler_socket::get_connect_secret): Remove.
1522 (fhandler_socket::create_secret_event): Remove.
1523 (fhandler_socket::check_peer_secret_event): Remove.
1524 (fhandler_socket::signal_secret_event): Remove.
1525 (fhandler_socket::close_secret_event): Remove.
1526 (fhandler_socket::sec_event_accept): Remove.
1527 (fhandler_socket::sec_event_connect): Remove.
1528 * fhandler_socket.cc (secret_event_name): Remove.
1529 (fhandler_socket::af_local_set_sockpair_cred): Rename from
1530 set_socketpair_eids.
1531 (fhandler_socket::af_local_setblocking): Rename from eid_setblocking.
1532 (fhandler_socket::af_local_unsetblocking): Rename from
1534 (fhandler_socket::af_local_recv_secret): New function to receive
1535 AF_LOCAL connect secret over socket itself.
1536 (fhandler_socket::af_local_send_secret): New function to send AF_LOCAL
1537 connect secret over socket itself.
1538 (fhandler_socket::af_local_recv_cred): Rename from eid_recv.
1539 (fhandler_socket::af_local_send_cred): Rename from eid_send.
1540 (fhandler_socket::eid_connect): Remove.
1541 (fhandler_socket::af_local_connect): Take over connect side handling
1542 of AF_LOCAL secret and credential handshake.
1543 (fhandler_socket::eid_accept): Remove.
1544 (fhandler_socket::af_local_accept): New method, take over accept side
1545 handling of AF_LOCAL secret and credential handshake.
1546 (fhandler_socket::af_local_set_cred): New method, set eid credentials
1548 (fhandler_socket::af_local_copy): New method, copy secret and
1549 credentials to another socket.
1550 (fhandler_socket::af_local_set_secret): New function combining former
1551 set_connect_secret and get_connect_secret into one function.
1552 (fhandler_socket::create_secret_event): Remove.
1553 (fhandler_socket::signal_secret_event): Remove.
1554 (fhandler_socket::close_secret_event): Remove.
1555 (fhandler_socket::check_peer_secret_event): Remove.
1556 (fhandler_socket::sec_event_connect): Remove.
1557 (fhandler_socket::sec_event_accept): Remove.
1558 (fhandler_socket::fixup_after_fork): Drop secret_event handling.
1559 (fhandler_socket::bind): Call af_local_set_secret.
1560 (fhandler_socket::connect): Call af_local_set_cred and af_local_connect.
1561 (fhandler_socket::listen): Call af_local_set_cred.
1562 (fhandler_socket::accept): Call af_local_copy and af_local_accept on
1564 (fhandler_socket::close): Don't call close_secret_event.
1565 (fhandler_socket::set_close_on_exec): Don't set secret_event
1567 * net.cc (cygwin_getsockopt): Add debug output.
1568 (socketpair): Call af_local_set_sockpair_cred instead of
1569 set_socketpair_eids.
1570 * select.cc (set_bits): Drop AF_LOCAL special handling in case
1573 2005-03-23 Christopher Faylor <cgf@timesys.com>
1575 * include/ctype.h: Always define macros when inside cygwin.
1576 (isblank): New macro.
1578 2005-03-23 Corinna Vinschen <corinna@vinschen.de>
1580 * fhandler.h (fhandler_socket::eid_connect): Make private.
1581 (fhandler_socket::set_connect_secret): Ditto.
1582 (fhandler_socket::get_connect_secret): Ditto.
1583 (fhandler_socket::create_secret_event): Ditto. Remove secret argument.
1584 (fhandler_socket::check_peer_secret_event): Ditto.
1585 (fhandler_socket::signal_secret_event): Make private.
1586 (fhandler_socket::close_secret_event): Ditto.
1587 (fhandler_socket::sec_event_accept): New private method.
1588 (fhandler_socket::sec_event_connect): Ditto.
1589 (fhandler_socket::af_local_connect): New public method.
1590 * fhandler_socket.cc: Use 'struct sockaddr' and 'struct sockaddr_in'
1591 rather than just 'sockaddr' and 'sockaddr_in' throughout.
1592 (fhandler_socket::eid_connect): Drop AF_LOCAL/SOCK_STREAM test.
1593 (fhandler_socket::create_secret_event): Remove secret argument.
1594 Always use connect_secret instead.
1595 (fhandler_socket::check_peer_secret_event): Ditto.
1596 (fhandler_socket::sec_event_connect): New method, combining entire
1597 secret event handshake on connect side.
1598 (fhandler_socket::af_local_connect): New method, combining secret
1599 event handshake and eid credential transaction on connect side, to
1600 be called from select.
1601 (fhandler_socket::sec_event_accept): New method, combining entire
1602 secret event handshake on accept side.
1603 (fhandler_socket::connect): Drop secret, use connect_secret instead.
1604 Move entire secret event handshake to sec_event_connect.
1605 (fhandler_socket::accept): Move entire secret event handshake to
1607 * select.cc (set_bits): Just call af_local_connect here.
1609 2005-03-23 Christopher Faylor <cgf@timesys.com>
1611 * include/cygwin/version.h: Change comment for most recent API version
1612 bump to reflect new additions to the DLL and to remove change obsoleted
1613 by the previous checkin.
1615 2005-03-23 Christopher Faylor <cgf@timesys.com>
1617 * include/ctype.h: New file.
1619 * Makefile.in: Add ctype.o to DLL_OFILES.
1620 * cygwin.din: Remove _ctype_ptr (for now?).
1622 2005-03-22 Christopher Faylor <cgf@timesys.com>
1624 * Makefile.in (DLL_OFILES): Add hookapi.o. Eliminate some cruft.
1625 * cygheap.h (cygheap_types): Add new enum: HEAP_1_HOOK.
1626 (hook_chain): New struct.
1627 (init_cygheap::hooks): Define new element.
1628 * cygheap.cc (cygheap_fixup_in_child): Zero hook chain on exec.
1629 * dcrt0.cc (dll_crt0_1): Call ld_preload just before calling main function.
1630 * external.cc (cygwin_internal): Implement CW_HOOK.
1631 * fork.cc (fork_child): Call fixup_hooks_after_fork.
1632 * init.cc (cygwin_hmodule): Reinstate after a long absence.
1633 * include/sys/cygwin.h: Define CW_HOOK.
1634 * hookapi.cc: New file.
1636 * select.cc (start_thread_socket): Add debugging output.
1638 * fhandler_disk_file.cc (fhandler_disk_file::fchmod): gcc 4.x
1641 * fhandler_socket.cc (fhandler_socket::connect): Make sure that err is
1644 2005-03-22 Corinna Vinschen <corinna@vinschen.de>
1646 * cygwin.din (__ctype_ptr): Export.
1647 * include/cygwin/version.h: Bump API minor version.
1649 2005-03-21 Corinna Vinschen <corinna@vinschen.de>
1651 * fhandler.h (class cygthread): Remove forward declaration.
1653 2005-03-21 Corinna Vinschen <corinna@vinschen.de>
1655 * fhandler.h (class cygthread): Forward declare.
1656 (fhandler_socket::sec_pipe): Remove.
1657 (fhandler_socket::eid_pipe_name): Remove.
1658 (fhandler_socket::eid_setblocking): New private method.
1659 (fhandler_socket::eid_unsetblocking): Ditto
1660 (fhandler_socket::eid_recv): Ditto
1661 (fhandler_socket::eid_send): Ditto
1662 (fhandler_socket::eid_accept): Ditto
1663 (fhandler_socket::eid_connect): New public method.
1664 * fhandler_socket.cc (ASYNC_MASK): Move to beginning of file.
1665 (fhandler_socket::eid_pipe_name): Remove.
1666 (fhandler_socket::set_socketpair_eids): Move down to fhandler_socket
1668 (fhandler_socket::fhandler_socket): Drop initializing sec_pipe.
1669 (fhandler_socket::~fhandler_socket): Drop closing sec_pipe.
1670 (fhandler_socket::eid_setblocking): New method.
1671 (fhandler_socket::eid_unsetblocking): New method.
1672 (fhandler_socket::eid_recv): New method.
1673 (fhandler_socket::eid_send): New method.
1674 (fhandler_socket::eid_connect): New method.
1675 (fhandler_socket::eid_accept): New method.
1676 (fhandler_socket::dup): Drop sec_pipe handling.
1677 (fhandler_socket::connect): Fix WinSock error handling. Prepare
1678 eid credential transaction. Call eid_connect on successful connect.
1679 (fhandler_socket::listen): Drop creating sec_pipe.
1680 (fhandler_socket::accept): Slightly simplify code. Call eid_accept
1682 (fhandler_socket::getpeereid): Reshuffle code for readability. Fix
1683 test for invalid pid.
1684 * select.cc (set_bits): Call eid_connect on successfully connected
1687 2005-03-19 Christopher Faylor <cgf@timesys.com>
1689 * child_info.h (fork_info): Use different method to alias variable.
1690 (spawn_info): Ditto.
1691 * cxx.cc (__cxa_guard_acquire): New function (needed for gcc 4.x).
1692 (__cxa_guard_release): Ditto.
1693 * devices.in: Make sure stuff is correctly bracketed (for gcc 4.x).
1694 * devices.cc: Regenerate.
1695 * fhandler.h (fhandler_disk_file::fchmod): Avoid left coercion (for gcc
1697 * smallprint.c (__rn): Declare as __fastcall since gcc 4.x complains
1698 about use of regparm, for some reason.
1699 * sync.h (sync::init_lock): Remove.
1700 * sync.cc (sync::init_lock): Ditto.
1702 2005-03-18 Christopher Faylor <cgf@timesys.com>
1704 * net.cc (cygwin_getprotobyname): Don't try to be fancy with return
1706 (cygwin_getprotobynumber): Ditto.
1708 2005-03-17 Corinna Vinschen <corinna@vinschen.de>
1710 * fhandler_disk_file.cc (fhandler_disk_file::utimes): Handle opening
1711 directories under 9x gracefully.
1713 2005-03-17 Corinna Vinschen <corinna@vinschen.de>
1715 * fhandler_socket.cc (fhandler_socket::connect): Always set sun_path
1716 in case of a successful or pending connect.
1717 (fhandler_socket::accept): Don't run secret event and eid credential
1718 transactions if OS accept returned WSAEWOULDBLOCK.
1720 2005-03-16 Christopher Faylor <cgf@timesys.com>
1722 * fhandler_tape.cc (get_ll): This is a generally useful function so
1724 * winsup.h (get_ll): to here.
1725 * security.cc (get_token_group_sidlist): Use get_ll to figure out the
1726 long long version of the luid since QuadPart is not part of the
1727 standard Windows API.
1729 2005-03-16 Christopher Faylor <cgf@timesys.com>
1731 * dir.cc: Rename opendir_* to dirent_* throughout.
1732 (opendir_states): Move and rename.
1733 * fhandler.h (dirent_states): to here.
1734 * fhandler_disk_file.cc (fhandler_disk_file::readdir): Use raw readdir
1735 when skipping through entries since it is keeping track of "." and
1737 (fhandler_cygdrive::seekdir): Use fhandler_disk_file::readdir to do
1739 * fhandler_virtual.cc (fhandler_virtual::opendir): Set flag indicating
1740 that we provide . and ..
1741 (fhandler_virtual::seekdir): Ditto.
1742 (fhandler_virtual::rewinddir): Ditto.
1743 * fhandler_registry.cc (fhandler_registry::rewinddir): Ditto.
1745 2005-03-16 Christopher Faylor <cgf@timesys.com>
1747 * cygtls.cc (free_local): New macro.
1748 (_cygtls::remove): Use free_local to free known-malloced local
1750 * cygtls.h: Mark some variables as "malloced".
1751 * net.cc (enum struct_type): Rename from is_* to t_* for clarity.
1752 (dump_protoent): Delete.
1753 (dup_ent): New macro.
1754 (__dup_ent): Renamed from dup_ent. Change arguments for convenience.
1755 Replace first argument with newly alloced value. Allocate a rounded
1756 number of bytes in an attempt to try to reuse space. Subsume
1758 (cygwin_getprotobyname): Simplify using new dup_ent functionality.
1759 (cygwin_getprotobynumber): Ditto.
1760 (cygwin_getservbyname): Ditto.
1761 (cygwin_getservbyport): Ditto.
1762 (cygwin_gethostname): Ditto.
1763 (cygwin_gethostbyname): Ditto.
1764 * tlsoffsets.h: Regenerate.
1766 * syslog.cc (openlog): Use NULL rather than 0, for consistency with the
1768 (pass_handler::initialize): Use unbuffered I/O in pass one.
1770 2005-03-15 Christopher Faylor <cgf@timesys.com>
1772 * errno.cc (errmap): Correct typo in previous change.
1774 2005-03-15 Christopher Faylor <cgf@timesys.com>
1776 * cygtls.cc (_cygtls::remove): Free process_ident, if it exists.
1778 * errno.cc (errmap): ERROR_DISK_CORRUPT -> EIO.
1780 2005-03-11 Christopher Faylor <cgf@timesys.com>
1782 * path.h (pathconv_arg): Define PC_NO_ACCESS_CHECK.
1783 (path_types): Define PATH_NO_ACCESS_CHECK == PC_NO_ACCESS_CHECK.
1784 * path.cc (symlink_info::check_sysfile): Move to symlink_info class and
1785 eliminate arguments that are part of class. Use set_error.
1786 (symlink_info::check_shortcut): Ditto.
1787 (symlink_info::set_error): New function.
1788 (path_conv::check): Pass PC_NO_ACCESS_CHECK to symlink_info::check.
1789 (symlink_info::check): Preserve PC_NO_ACCESS_CHECK in pflags. Use
1792 2005-03-10 Corinna Vinschen <corinna@vinschen.de>
1794 * path.cc (is_floppy): New function.
1795 (setmntent): Drop floppy drives on A: and B: from logical drive DWORD.
1796 * syscalls.cc (sync): Don't sync floppies on A: and B:.
1798 2005-03-10 Christopher Faylor <cgf@timesys.com>
1800 * autoload.cc (LoadDLLprime): Use nocopy segment or forked processes
1801 will not initialize properly.
1803 2005-03-10 Christopher Faylor <cgf@timesys.com>
1805 * autoload.cc (LoadDLLprime): Scrap use of .linkonce and just use an
1806 ifdef guard to load .foo_init into data segment.
1808 * dcrt0.cc (initial_env): Allow colon or space as CYGWIN_DEBUG
1809 separator for consistency.
1811 2005-03-09 Christopher Faylor <cgf@timesys.com>
1813 * pinfo.h (pinfo::pinfo): Clear more elements in the constructor.
1815 2005-03-09 Christopher Faylor <cgf@timesys.com>
1817 * net.cc (dup_ent): Revert older stupid test for null. Don't copy name
1820 2005-03-09 Corinna Vinschen <corinna@vinschen.de>
1822 * fhandler_socket.cc (fhandler_socket::eid_pipe_name): Fix format
1824 (fhandler_socket::connect): Set sun_path before running eid credential
1825 transaction. Run transaction only if OS connect was successful.
1826 (fhandler_socket::accept): Run transaction only if OS accept was
1829 2005-03-09 Corinna Vinschen <corinna@vinschen.de>
1831 * signal.cc (sigprocmask): Rename first parameter to "how".
1832 (handle_sigprocmask): Ditto. Check "how" for being a valid "how" value.
1833 Fix call order in case of wrong "how" value.
1835 2005-03-09 Christopher Faylor <cgf@timesys.com>
1837 * net.cc (dup_ent): Revert previous stupid change.
1839 2005-03-09 Christopher Faylor <cgf@timesys.com>
1841 * net.cc (dup_ent): Avoid dereferencing a null pointer in a debug_printf.
1843 2005-03-09 Christopher Faylor <cgf@timesys.com>
1845 * path.cc (path_conv::check): Treat ENOSHARE similarly to ENOENT when
1846 determining if there was a problem with a symlink.
1848 2005-03-08 Corinna Vinschen <corinna@vinschen.de>
1850 * fhandler_socket.cc (fhandler_socket::listen): Don't limit the number
1853 2005-03-08 Christopher Faylor <cgf@timesys.com>
1855 * pinfo.cc (pinfo::exit): Right shift exit value by eight when not
1856 started in a cygwin environment.
1858 2005-03-07 Corinna Vinschen <corinna@vinschen.de>
1860 * mmap.cc (mmap64): Handle MAP_AUTOGROW flag.
1861 (fhandler_disk_file::mmap): Ditto. Clean conditional for readability.
1862 * include/sys/mman.h: Add MAP_AUTOGROW flag.
1863 * include/cygwin/version.h: Bump API minor version.
1865 2005-03-08 Christopher Faylor <cgf@timesys.com>
1867 * dcrt0.cc (dll_crt0_0): Eliminate muto::init call.
1868 * sync.h (locker): New, currently unused class.
1869 (muto::init): Eliminate.
1870 * sync.cc (muto::init): Ditto.
1871 (muto::init): Eliminate critical section lock and instead use name as a
1872 guard to prevent against multiple attempts to initialize the same muto.
1874 * pinfo.cc (pinfo::init): Set myself procinfo when not execing and pid
1875 matches windows pid or cygwin pid.
1877 2005-03-06 Pavel Tsekov <ptsekov@gmx.net>
1879 * path.cc (mount_info::read_cygdrive_info_from_registry): Use the user
1880 prefix if it exists.
1882 2005-03-06 Christopher Faylor <cgf@timesys.com>
1884 * sync.h (sync::init_lock): Declare new static member.
1885 (sync::init()): Declare new static function.
1886 * sync.cc (sync::init): Define.
1887 (sync::init): Lock attempt to initialize a muto to stop multiple
1888 threads from colliding.
1889 * dcrt0.cc (dll_crt0_0): Initialize muto environment.
1891 2005-03-06 Christopher Faylor <cgf@timesys.com>
1893 * path.cc (special_name): Reorganize to always detect the use of
1894 special names first, before detecting special characters.
1896 2005-03-04 Christopher Faylor <cgf@timesys.com>
1898 * fhandler_clipboard.cc: Use int for cygnativeformat rather than UINT
1899 as that is what is returned by GetPriorityClipboardFormat.
1900 (fhandler_dev_clipboard::read): Ditto for the format variable.
1902 2005-03-04 Corinna Vinschen <corinna@vinschen.de>
1904 * fhandler.cc (fhandler_base::open_9x): Satisfy query_open values.
1906 2005-03-04 Pierre Humblet <pierre.humblet@ieee.org>
1908 * fhandler_socket.cc (fhandler_socket::ioctl): Only cancel
1909 WSAAsyncSelect when async mode is on.
1911 2005-03-03 Corinna Vinschen <corinna@vinschen.de>
1913 * cygwin.din (utmpxname): Export.
1914 * syscalls.cc (utmpxname): Create export alias to utmpname.
1915 * include/utmpx.h: Define ut_name and ut_xtime if not already defined.
1916 (utmpxname): Add prototype.
1917 * include/sys/utmp.h: Only define ut_name if not already defined.
1918 * include/cygwin/version.h: Bump API minor version.
1920 2005-03-03 Christopher Faylor <cgf@timesys.com>
1922 * cygthread.cc (cygthread::detach): Use a slightly higher priority when
1923 waiting for thread signalling.
1925 2005-03-02 Christopher Faylor <cgf@timesys.com>
1927 * autoload.cc (std_dll_init): Save and restore fpu control register
1928 around LoadAddress to prevent loaded dlls (like msvcrt.dll) from
1929 setting unwanted stuff.
1931 2005-03-02 Christopher Faylor <cgf@timesys.com>
1933 * cygtls.cc (_cygtls::remove): Don't attempt any removal activities if
1936 2005-03-02 Christopher Faylor <cgf@timesys.com>
1938 * cygtls.cc (_cygtls::init_thread): Move exitsock setting later. It
1939 should always be set.
1940 (_cygtls::remove): Detect zero exitsock. Not quite sure why this is needed.
1942 2005-03-02 Christopher Faylor <cgf@timesys.com>
1944 * autoload.cc (LoadDLLprime): Mask error code to low-order 16 bits.
1945 (noload): Preserve sign when returning error code.
1947 2005-03-02 Christopher Faylor <cgf@timesys.com>
1949 * spawn.cc (do_cleanup): Properly restore SIGINT/SIGQUIT even if they
1950 had previously been SIG_DFL.
1952 2005-03-01 Corinna Vinschen <corinna@vinschen.de>
1954 * fhandler_disk_file.cc (fhandler_disk_file::touch_ctime): Replace
1955 GetSystemTime/SystemTimeToFileTime with GetSystemTimeAsFileTime.
1956 * times.cc (time_as_timestruc_t): Ditto.
1959 2005-03-01 Christopher Faylor <cgf@timesys.com>
1961 * include/cygwin/version.h: Bump DLL minor number to 14.
1963 2005-03-01 Corinna Vinschen <corinna@vinschen.de>
1965 * fhandler_clipboard.cc (fhandler_dev_clipboard::write): Never set
1967 (fhandler_dev_clipboard::read): Ditto.
1968 * fhandler_windows.cc (fhandler_windows::read): Ditto.
1969 * scandir.cc (scandir): Ditto.
1970 * syscalls.cc (_fstat64_r): Ditto.
1975 * mmap.cc (mmap64): Fix /dev/zero mapping.
1977 2005-02-28 Corinna Vinschen <corinna@vinschen.de>
1979 * fhandler.h (class fhandler_socket): Declare new method
1980 set_socketpair_eids.
1981 * fhandler_socket.cc (fhandler_socket::set_socketpair_eids): New method.
1982 (fhandler_socket::dup): Duplicate sec_pipe if necessary.
1983 (fhandler_socket::listen): Only create sec_pipe if named pipes are
1984 available. Initialized sec_peer_pid to 0 as on Linux.
1985 (fhandler_socket::connect): Only run eid credential transaction if
1986 named pipes are available. Fake otherwise. Initialized sec_peer_pid
1988 (fhandler_socket::accept): Ditto.
1989 (fhandler_socket::close): Move closing sec_pipe handle from here...
1990 (fhandler_socket::~fhandler_socket): ... to here.
1991 * net.cc (socketpair): Set eid credentials by calling
1992 fhandler_socket::set_socketpair_eids() on both socket ends.
1993 * wincap.h (wincaps::has_named_pipes): New element.
1994 * wincap.cc: Implement above element throughout.
1996 2005-02-26 Christopher Faylor <cgf@timesys.com>
1998 * sigproc.cc (_pinfo::set_ctty): Move function
1999 * pinfo.cc (_pinfo::set_ctty): to here.
2001 * fhandler_mem.cc (fhandler_dev_mem::fstat): Don't fill out structure
2002 if this is an on-disk device rather than an "auto" device.
2003 * fhandler_raw.cc (fhandler_dev_raw::fstat): Ditto.
2005 * path.cc (normalize_posix_path): Don't treat a standalone '//' as
2006 introducing a UNC path.
2007 (normalize_win32_path): Ditto.
2009 2005-02-26 Christopher Faylor <cgf@timesys.com>
2011 * debug.cc (delete_handle): Report on handle value in debugging output.
2013 * pinfo.h (_pinfo::exists): Declare "new" function.
2014 (_pinfo::kill): Ditto.
2015 * fhandler_termios.cc (tty_min::kill_pgrp): Use _pinfo::exists rather
2017 * pinfo.cc (pinfo::init): Ditto. Don't do a low_priority_sleep(0) when
2018 looping to find exec'ed procinfo.
2019 (pinfo::release): Be more careful about unmapping and closing.
2020 * signal.cc (_pinfo::kill): Rename from kill_worker. Accommodate entry
2022 (kill0): Use _pinfo::kill rather than kill_worker.
2023 (kill_pgrp): Ditto. Use _pinfo::exists rather than proc_exists.
2024 * sigproc.cc (_pinfo::exists): Rename from proc_exists.
2025 (pid_exists): Use _pinfo::exists rather than proc_exists.
2026 (remove_proc): Ditto.
2027 * sigproc.h (proc_exists): Delete declaration.
2029 2005-02-25 Corinna Vinschen <corinna@vinschen.de>
2031 * fhandler.h (class fhandler_base): Declare fixup_mmap_after_fork
2032 with additional flags parameter. Change offset parameter to _off64_t.
2033 (class fhandler_disk_file): Ditto.
2034 (class fhandler_dev_mem): Ditto.
2035 * fhandler_mem.cc (fhandler_dev_mem::fixup_mmap_after_fork):
2036 Accommodate new parameters.
2037 * mmap.cc: Include ntdll.h.
2038 (class mmap_record): Add flags member.
2039 (mmap_record::mmap_record): Add flags parameter.
2040 (mmap_record::get_flags): New method.
2041 (class map): Add next_anon_addr member to store next anonymous mapping
2043 (map::get_next_anon_addr): New method.
2044 (map::set_next_anon_addr): New method.
2045 (mmap64): Don't align offset and length to granularity in case of
2046 MAP_ANONYMOUS on NT. Check for already existing mapping only on 9x.
2047 Call mmap_record::mmap_record with additional flags argument.
2048 (fhandler_base::fixup_mmap_after_fork): Accommodate new parameters.
2049 (fhandler_disk_file::mmap): Use NtMapViewOfSection with
2050 AT_ROUND_TO_PAGE flag for anonymous mappings on NT. If addr is NULL,
2051 try to map adjacent to previous mapping.
2052 (fhandler_disk_file::fixup_mmap_after_fork): Add flags argument.
2053 Change offset parameter to _off64_t. Use NtMapViewOfSection to
2054 re-create anonymous mappings on NT.
2055 (fixup_mmaps_after_fork): Accommodate new parameters when calling
2056 fhandler's fixup_mmaps_after_fork function.
2057 * ntdll.h (AT_ROUND_TO_PAGE): New define.
2059 2005-02-25 Corinna Vinschen <corinna@vinschen.de>
2061 * mmap.cc (mmap64): Handle anonymous MAP_FIXED request on
2062 non-granulation boundary.
2064 2005-02-25 Corinna Vinschen <corinna@vinschen.de>
2066 * mmap.cc (class mmap_record): Declare new map_pages method with
2068 (mmap_record::map_pages): New method with address parameter.
2069 (mmap64): Evaluate access mode before checking if already existing
2070 mapping can be used.
2071 Only use existing mapping if requested access mode matches the one
2072 in the existing mapping.
2073 Add check for existing mapping for anonymous MAP_FIXED case.
2075 2005-02-23 Corinna Vinschen <corinna@vinschen.de>
2077 * localtime.cc: Implement setting __tzrule's offset member using
2078 newlib's __gettzinfo () interface.
2080 (timezone): Define as long according to POSIX.
2082 2005-02-23 Eric Blake <ebb9@byu.net>
2084 * devices.in (parsedisk): Fix typo.
2085 * devices.cc: Regenerate.
2087 2005-02-23 Corinna Vinschen <corinna@vinschen.de>
2089 * cygwin.din (getpeereid): Export.
2090 * fhandler.h (class fhandler_socket): Add pipe and id members to
2091 exchange eid credentials for AF_LOCAL sockets.
2092 (eid_pipe_name): Declare new method.
2093 (getpeereid): Ditto.
2094 * fhandler_socket.cc (fhandler_socket::eid_pipe_name): New method.
2095 (fhandler_socket::fhandler_socket): Initialize sec_pipe.
2096 (fhandler_socket::connect): Exchange eid credentials with accepting
2098 (fhandler_socket::listen): Prepare eid credential transaction.
2099 (fhandler_socket::accept): Exchange eid credentials with connecting
2101 (fhandler_socket::close): Close eid credentials pipe if open.
2102 (fhandler_socket::getpeereid): New method.
2103 * net.cc (cygwin_getsockopt): Add SO_PEERCRED handling.
2104 (getpeereid): New function.
2105 * include/asm/socket.h (SO_PEERCRED): Define.
2106 * include/cygwin/socket.h (struct ucred): Define new type.
2107 * include/cygwin/version.h: Bump API minor version.
2109 2005-02-23 Corinna Vinschen <corinna@vinschen.de>
2111 * include/sys/statvfs.h (ST_RDONLY): Define.
2112 (ST_NOSUID): Define.
2114 2005-02-23 Corinna Vinschen <corinna@vinschen.de>
2116 * cygwin.din (fstatvfs): Export.
2118 * syscalls.cc: Include sys/statvfs.h.
2119 (statvfs): New function. Move statfs functionality here.
2120 (fstatvfs): New function.
2121 (statfs): Just call statvfs and copy structure. Check validity of
2122 incoming struct statfs pointer.
2123 * include/cygwin/types.h (fsblkcnt_t): Define.
2124 (fsfilcnt_t): Define.
2125 * include/cygwin/version.h: Bump API minor version.
2126 * include/sys/statvfs.h: New file.
2128 2005-02-23 Corinna Vinschen <corinna@vinschen.de>
2130 * devices.h: Switch FH_ZERO and FH_PORT as on Linux. Add FH_FULL.
2131 * devices.in: Add /dev/full.
2132 * devices.cc: Regenerate.
2133 * dtable.cc (build_fh_pc): Add FH_FULL.
2134 * fhandler.cc (fhandler_base::fstat): Set FH_FULL permission bits
2136 * fhandler_zero.cc (fhandler_dev_zero::write): Set errno to ENOSPC
2137 and return -1 if device is FH_FULL.
2139 2005-02-22 Christopher Faylor <cgf@timesys.com>
2141 * fhandler_disk_file.cc (fhandler_cygdrive::closedir): Return 0 when
2142 closing cygdrive_root.
2144 2005-02-22 Corinna Vinschen <corinna@vinschen.de>
2146 * cygwin.din (basename): Export.
2148 * path.cc (basename): New function.
2149 (dirname): New function.
2150 * include/libgen.h: New file.
2151 * include/cygwin/version.h: Bump API minor version.
2153 2005-02-22 Corinna Vinschen <corinna@vinschen.de>
2155 * select.cc (peek_pipe): Disable new pipe code until there's
2156 a working substitute.
2158 2005-02-22 Corinna Vinschen <corinna@vinschen.de>
2160 * cygwin.din (fdatasync): Export.
2161 * fhandler.cc (fhandler_base::fsync): Return with EINVAL if no
2162 handle is available.
2163 * syscalls.cc (fdatasync): Create export alias to fsync.
2164 * include/cygwin/version.h: Bump API minor version.
2166 2005-02-20 Corinna Vinschen <corinna@vinschen.de>
2168 * fhandler.h (fhandler_base::fstat_helper): Declare with additional
2169 dwVolumeSerialNumber argument. Drop default values for last three
2171 * fhandler_disk_file.cc (fhandler_base::fstat_by_handle): Pass
2172 dwVolumeSerialNumber from GetFileInformationByHandle to fstat_helper.
2173 (fhandler_base::fstat_by_name): Pass pc.volser () to fstat_helper.
2174 Accommodate dropping default values for last three arguments of
2176 (fhandler_base::fstat_helper): Add dwVolumeSerialNumber argument.
2177 Use for st_dev member unless 0 in which case pc.volser () is used.
2179 2005-02-20 Corinna Vinschen <corinna@vinschen.de>
2181 * autoload.cc (FindFirstVolumeA): Add.
2182 (FindNextVolumeA): Add.
2183 (FindVolumeClose): Add.
2184 (GetVolumePathNamesForVolumeNameA): Add.
2185 * fhandler.h (class fhandler_base): Declare new method fsync.
2186 * fhandler.cc (fhandler_base::fsync): New method.
2187 * syscalls.cc (fsync): Move functionality into fhandler method fsync.
2188 Just call this method from here.
2189 (sync_worker): New static function.
2190 (sync): Fill with life for NT systems.
2191 * wincap.h (wincaps::has_guid_volumes): New element.
2192 * wincap.cc: Implement above element throughout.
2194 2005-02-20 Corinna Vinschen <corinna@vinschen.de>
2196 * fhandler.h (enum query_state): Add query_write_attributes state.
2197 (fhandler_base::status.query_open): Add a bit to make room for more
2199 (class fhandler_base): Declare new method utimes.
2200 (class fhandler_socket): Ditto.
2201 (class fhandler_disk_file): Ditto.
2202 (fhandler_disk_file::fhandler_disk_file): Add constructor with
2203 path_conv parameter.
2204 * fhandler.cc (fhandler_base::open): Add query_write_attributes
2206 (fhandler_base::utimes): New method.
2207 * fhandler_disk_file.cc (fhandler_disk_file::link): Simplify.
2208 Open file with query_write_attributes instead of query_write_control.
2209 (fhandler_disk_file::utimes): New method.
2210 (fhandler_disk_file::fhandler_disk_file): Add constructor with
2211 path_conv parameter setting pc member immediately.
2212 * fhandler_socket.cc (fhandler_socket::fchmod): Use new
2213 fhandler_disk_file constructor.
2214 (fhandler_socket::fchown): Ditto.
2215 (fhandler_socket::facl): Ditto.
2216 (fhandler_socket::link): Ditto.
2217 (fhandler_socket::utimes): New method.
2218 * times.cc: Include dtable.h.
2219 (timeval_to_filetime): Make non-static.
2220 (utimes): Move functionality into fhandler method utimes. Just call
2221 this method from here.
2222 * winsup.h: Simplify declarations of time helper functions.
2223 (timeval_to_filetime): Add extern declaration.
2225 2005-02-19 Corinna Vinschen <corinna@vinschen.de>
2227 * fhandler.h (class fhandler_base): Declare new method link.
2228 (class fhandler_socket): Ditto.
2229 (class fhandler_disk_file): Ditto.
2230 * fhandler.cc (fhandler_base::open): Add FILE_WRITE_ATTRIBUTES
2231 to query_write_control access flags.
2232 (fhandler_base::link): New method.
2233 * fhandler_disk_file.cc (fhandler_disk_file::fchmod): Don't try to
2234 open with O_WRONLY since query_write_control includes
2235 FILE_WRITE_ATTRIBUTES.
2236 (fhandler_disk_file::fchown): Ditto.
2237 (fhandler_disk_file::facl): Ditto.
2238 (fhandler_disk_file::link): New method. Touch st_ctime on successful
2240 * fhandler_socket.cc (fhandler_socket::link): New method.
2241 * syscalls.cc (link): Move functionality into fhandler method link.
2242 Just call this method from here.
2244 2005-02-19 Corinna Vinschen <corinna@vinschen.de>
2246 * fhandler.h (class fhandler_socket): Declare new methods fchown,
2248 * fhandler_socket.cc (fhandler_socket::fstat): Handle AF_LOCAL
2250 (fhandler_socket::fchmod): New method.
2251 (fhandler_socket::fchown): New method.
2252 (fhandler_socket::facl): New method.
2254 2005-02-19 Corinna Vinschen <corinna@vinschen.de>
2256 * localtime.cc: Temporary implementation of setting __tzrule's offset
2257 member to be used by strftime.
2258 (__tzrule): New global variable.
2259 (tzparse): Set __tzrule's offset member appropriately.
2261 2005-02-17 Christopher Faylor <cgf@timesys.com>
2263 * path.cc (path_conv::check): Set fs flag when a unix-domain socket
2266 2005-02-17 Corinna Vinschen <corinna@vinschen.de>
2268 * fhandler_disk_file.cc (fhandler_disk_file::fstat): Set st_ctime if
2269 has_changed flag is set.
2270 (fhandler_disk_file::touch_ctime): Reset has_changed flag on success.
2272 2005-02-17 Corinna Vinschen <corinna@vinschen.de>
2274 * times.cc (utimes): Open files with FILE_WRITE_ATTRIBUTES first,
2275 if that fails, try opeing with GENERIC_WRITE. Fix comments.
2277 2005-02-15 Christopher Faylor <cgf@timesys.com>
2279 * path.h (path_conv::issocket): Return true if device == FH_UNIX rather
2280 than expecting path_conv to set a flag.
2282 2005-02-11 Corinna Vinschen <corinna@vinschen.de>
2284 * fhandler.cc (fhandler_base::raw_write): Mark as changed on
2286 * fhandler.h (fhandler_base::status_flags): Add 'has_changed' flag.
2287 * fhandler_disk_file.cc (fhandler_disk_file::fchmod): Call
2288 fhandler_disk_file's own open and close instead of open_fs and
2289 close_fs. Mark as changed on success.
2290 (fhandler_disk_file::fchown): Ditto.
2291 (fhandler_disk_file::facl): Ditto.
2292 (fhandler_disk_file::ftruncate): Ditto.
2293 (fhandler_base::open_fs): Mark as changed when O_TRUNC flag on existing
2295 (fhandler_disk_file::close): Set st_ctime if has_changed flag is set.
2297 2005-02-11 Christopher Faylor <cgf@timesys.com>
2299 * cygthread.cc (cygthread::release): Reset ev here if it exists.
2300 (cygthread::terminate_thread): Eliminate racy code which reset ev and
2301 thread_sync. Remove a few nonsensical inuse checks. Exit at the
2303 (cygthread::detach): Rewrite to again try to ensure that we don't say
2304 we're signalled when we are not signalled.
2305 * fhandler.cc (fhandler_base::raw_read): Revert to signalling read
2307 * pipe.cc (fhandler_pipe::close): Use base method to close handle.
2308 * sigproc.h (WAIT_SIG_PRIORITY): Just trundle along at normal priority
2309 to allow the pipe thread to do its thing if possible.
2311 * pinfo.h (pinfo::zap_cwd): Declare new function.
2312 (pinfo::zap_cwd): Move 'cd out of the way code' here.
2313 (pinfo::exit): Use it here.
2314 * spawn.cc (spawn_guts): And here.
2316 2005-02-11 Corinna Vinschen <corinna@vinschen.de>
2318 * times.cc (utimes): Open files with GENERIC_WRITE on file systems
2319 not supporting ACLs.
2321 2005-02-09 Corinna Vinschen <corinna@vinschen.de>
2323 * fhandler_disk_file.cc (fhandler_disk_file::ftruncate): Fix checking
2326 2005-02-08 Corinna Vinschen <corinna@vinschen.de>
2328 * times.cc (timeval_to_filetime): Define first parameter const.
2329 (utimes): Define second parameter to const according to SUSv3.
2331 * include/sys/utime.h (utime) : Change declaration accordingly.
2333 2005-02-08 Corinna Vinschen <corinna@vinschen.de>
2335 * cygthread.cc (cygthread::detach): Just test thread handle after
2336 signal arrived, don't wait infinitely for it.
2338 2005-02-08 Christopher Faylor <cgf@timesys.com>
2340 * pipe.cc (fhandler_pipe::read): Remove hold over from old read_state
2343 2005-02-06 Yitzchak Scott-Thoennes <sthoenna@efn.org>
2345 * net.cc (cygwin_gethostbyname): Be more picky about what's a numeric
2346 address string, and use tls in that case too.
2348 2005-02-07 Christopher Faylor <cgf@timesys.com>
2350 * exceptions.cc: Make windows_system_directory non-static.
2351 * pinfo.cc (pinfo::exit): Change innocuous cd'ed location to one that
2352 is more likely to exist.
2354 2005-02-06 Corinna Vinschen <corinna@vinschen.de>
2356 * path.cc (path_conv::check): Leave symlink expansion loop in case
2357 a not-ENOENT error happens.
2359 * cygheap.h (cygheap_fdmanip::fhandler_pipe *): New cast operator.
2360 * pinfo.cc (_pinfo::commune_recv): Add PICOM_PIPE_FHANDLER handling.
2361 (_pinfo::commune_send): Ditto.
2362 (_pinfo::pipe_fhandler): New method.
2363 * pinfo.h (enum picom): Add PICOM_PIPE_FHANDLER.
2364 (_pinfo::pipe_fhandler): Declare.
2365 * pipe.cc (fhandler_pipe::open): Rewrite. Allow to open foreign
2368 2005-02-03 Christopher Faylor <cgf@timesys.com>
2370 * cygthread.h (cygthread::terminate_thread): Reflect return value.
2371 * cygthread.cc (cygthread::detach): Be more careful about ensuring that
2372 sigwait is properly waited for to avoid later missynchronization.
2373 (cygthread::terminate_thread): Return true if thread was actually
2374 terminated and all handles were closed.
2375 * fhandler_base.cc (fhandler_base::raw_read): Use signal_read_state
2376 rather than raw calls to win32 api.
2377 (fhandler_base::read): Ditto.
2378 * fhandler.h (fhandler_pipe::fixup_after_exec): Use method to create
2379 read_state signalling.
2380 (fhandler_pipe::create): Ditto.
2382 * Makefile.in: Make some more files -fomit-frame-pointer.
2384 2005-02-02 Corinna Vinschen <corinna@vinschen.de>
2386 * fhandler.h (fhandler_base::ftruncate): Define new virtual method.
2387 (fhandler_disk_file::ftruncate): Ditto.
2388 * fhandler.cc (fhandler_base::ftruncate): New method.
2389 * fhandler_disk_file.cc (fhandler_disk_file::ftruncate): Ditto.
2390 * syscalls.cc (ftruncate64): Move functionality into fhandlers.
2391 Call fhandler method from here.
2393 2005-02-02 Corinna Vinschen <corinna@vinschen.de>
2395 * pipe.cc (fhandler_pipe::dup): Fix conditionals in case of error.
2397 2005-02-02 Corinna Vinschen <corinna@vinschen.de>
2399 * times.cc (utimes): Mark st_ctime for update according to SUSv3.
2401 2005-02-01 Christopher Faylor <cgf@timesys.com>
2403 * fhandler_proc.cc (format_proc_partitions): Remove PartitionType check
2404 since it could skip over partitions that are actually interesting.
2406 2005-02-01 Christopher Faylor <cgf@timesys.com>
2408 * cygthread.cc (cygthread::terminate_thread): Wait briefly for
2409 notification event in the event that the thread was actually in the
2412 * pipe.cc (fhandler_pipe::dup): read_state is not supposed to be
2413 inheritable. Fix that.
2415 * path.cc (path_conv::check): Set symlen = 0 to avoid a compiler
2418 * devices.h (devices::parsedisk): Declare new function.
2419 * devices.in (devices::parsedisk): Define new function.
2420 * dtable.cc (dtable::init_std_file_from_handle): Use device numbers
2422 * fhandler_proc.cc (format_proc_partitions): Use parsedisk to generate
2423 disk names from numeric codes. (This was broken on two of my
2424 systems previously and is still broken now)
2426 2005-02-01 Corinna Vinschen <corinna@vinschen.de>
2428 * pipe.cc (fhandler_pipe::open): Allow re-opening of /proc/<pid>/fd
2429 pipes of the current process.
2431 2005-02-01 Corinna Vinschen <corinna@vinschen.de>
2433 * fhandler.cc (fhandler_base::get_proc_fd_name): Don't generate
2435 * fhandler.h (fhandler_socket::open): New method.
2436 (fhandler_pipe::open): New method.
2437 * fhandler_proc.cc (fhandler_proc::exists): Return -2 in case of
2439 * fhandler_process.cc (fhandler_process::exists): Return -2 in
2440 case of symlinks, -3 for pipes and -4 for sockets.
2441 (fhandler_process::fstat): Handle pipes and sockets.
2442 (fhandler_process::open): Handle opening /proc/<pid>/fd.
2443 (fhandler_process::fill_filebuf): Generate empty names for
2444 non exisiting file descriptors.
2445 * fhandler_socket.cc (fhandler_socket::get_proc_fd_name): Always
2446 generate "socket:[number]" strings as on Linux.
2447 (fhandler_socket::open): New method.
2448 (fhandler_socket::fstat): Always return socket type.
2449 * path.cc (symlink_info::set): Remove unused second parameter.
2450 (path_conv::check): Handle pipes and sockets in /proc.
2451 Set correct device type for AF_LOCAL sockets.
2452 * pinfo.cc (_pinfo::commune_recv): Generate empty names for
2453 non exisiting file descriptors.
2454 (_pinfo::fd): Ditto.
2455 * pipe.cc (fhandler_pipe::open): New method.
2457 2005-01-31 Christopher Faylor <cgf@timesys.com>
2459 * path.h (path_conv::set_name): Declare new function.
2460 * path.cc (path_conv::set_name): Define new function.
2461 * fhandler.h (fhandler_dev_null::open): Declare new function.
2462 * fhandler.cc (fhandler_dev_null::open): Define new function.
2464 2005-01-31 Christopher Faylor <cgf@timesys.com>
2466 * smallprint.c (rnarg): Use long rather than unsigned long so that we
2467 get proper sign extension.
2469 2005-01-31 Corinna Vinschen <corinna@vinschen.de>
2471 * environ.cc (set_traverse): New function.
2472 (parse_thing): Add "traverse" option. Sort options alphabetically.
2473 (environ_init): On NT, switch on traverse checking by default.
2475 2005-01-31 Christopher Faylor <cgf@timesys.com>
2477 * smallprint.c (__rn): Regparmize.
2479 2005-01-31 Christopher Faylor <cgf@timesys.com>
2481 * smallprint.c (rnarg): New macro.
2483 (__rn): Rename from 'rn', add a mask argument, and use the mask
2484 argument to control how many significant digits to care about.
2485 (__small_vsprintf): Use __rn, rnarg, rnargLL, as appropriate.
2487 2005-01-31 Christopher Faylor <cgf@timesys.com>
2489 * pinfo.cc (pinfo::exit): Only return low-order 16 bits when exiting.
2491 2005-01-31 Corinna Vinschen <corinna@vinschen.de>
2493 * fhandler_process.cc (format_process_maps): Get destbuf argument by
2494 reference. Allow resizing of destbuf as necessary. Fix string
2497 2005-01-31 Corinna Vinschen <corinna@vinschen.de>
2499 * cygheap.h (class cygheap_fdenum): New class to enumerate used
2501 * dtable.h (class dtable): Add cygheap_fdenum as friend class.
2502 * fhandler.h (fhandler_base::get_proc_fd_name): New virtual method
2503 to return a name for /proc/<pid>/fd.
2504 (fhandler_socket::get_proc_fd_name): Ditto.
2505 (fhandler_pipe::get_proc_fd_name): Ditto.
2506 (fhandler_virtual::opendir): Make virtual method.
2507 (fhandler_process::opendir): New method.
2508 * fhandler.cc (fhandler_base::get_proc_fd_name): New method.
2509 * fhandler_process.cc: Include ctype.h.
2510 (PROCESS_FD): Define.
2511 (process_listing): Add "fd".
2512 (fhandler_process::exists): Fix comment. Return 1 in case of "fd"
2513 directory. Handle files below "fd".
2514 (fhandler_process::fstat): Drop "self" handling. Set correct link
2515 count for directories.
2516 (fhandler_process::opendir): New method to handle "fd" directory.
2517 (fhandler_process::readdir): Add "fd" handling.
2518 (fhandler_process::open): Drop "self" handling.
2519 (fhandler_process::fill_filebuf): Ditto. Add "fd" handling. Fix
2520 "maps" output string.
2521 * fhandler_registry.cc (fhandler_registry::fstat): Set correct link
2522 count for directories.
2523 * fhandler_socket.cc (fhandler_socket::get_proc_fd_name): New method.
2524 * path.cc (symlink_info::set): Fix thinko.
2525 * pinfo.cc (_pinfo::commune_recv): Rename pathbuf to path throughout.
2526 Drop local path variable in PICOM_FIFO case. Fix debug output.
2527 Close handles as early as possible. Add PICOM_FDS and PICOM_FD
2529 (_pinfo::commune_send): Add PICOM_FDS and PICOM_FD handling.
2530 (_pinfo::fd): New method.
2531 (_pinfo::fds): New method.
2532 * pinfo.h (enum picom): Add PICOM_FDS and PICOM_FD.
2533 (_pinfo::fd): Declare.
2534 (_pinfo::fds): Declare.
2535 * pipe.cc (fhandler_pipe::get_proc_fd_name): New method.
2537 2005-01-29 Corinna Vinschen <corinna@vinschen.de>
2539 * smallprint.c (rn): Change uval to unsigned long long to fix 64 bit
2541 * fhandler_process.cc (format_process_maps): Print major, minor and
2542 inode numbers correctly.
2544 2005-01-29 Corinna Vinschen <corinna@vinschen.de>
2546 * autoload.cc (GetModuleFileNameExA): Add.
2547 (GetModuleInformation): Add.
2548 (QueryWorkingSet): Add.
2549 * fhandler.h (fhandler_virtual::get_filebuf): New method.
2550 * fhandler_proc.cc (PROC_SELF): Define.
2551 (proc_fhandlers): Change type of self to FH_PROC.
2552 (fhandler_proc::exists): Return -3 if self.
2553 (fhandler_proc::fstat): Handle self as symlink.
2554 (fhandler_proc::fill_filebuf): Handle self.
2555 * fhandler_process.cc: Include psapi.h.
2556 (PROCESS_EXENAME): Remove.
2557 (PROCESS_MAPS): Define.
2558 (PROCESS_ROOT): Define.
2559 (PROCESS_EXE): Define.
2560 (PROCESS_CWD): Define.
2561 (process_listing): Remove "exename", add "maps, "root", "exe" and
2563 (fhandler_process::exists): Return -2 for symlinks.
2564 (fhandler_process::fstat): Handle symlinks.
2565 (fill_filebuf): Evaluate pid if pid is 0. Use exename handling for
2566 exe. Handle maps, root and cwd.
2567 (format_process_maps): New function evaluating "maps".
2568 * path.cc (symlink_info::set): New method to fill symlink_info
2569 with data matching virtual symlinks.
2570 (path_conv::check): Handle virtual symlinks.
2571 * pinfo.cc (_pinfo::commune_recv): Add PICOM_CWD and PICOM_ROOT
2573 (_pinfo::commune_send): Ditto.
2574 (_pinfo::root): New function.
2575 (_pinfo::cwd): New function.
2576 * pinfo.h (enum picom): Add PICOM_CWD and PICOM_ROOT.
2577 (_pinfo::root): Declare.
2578 (_pinfo::cwd): Declare.
2580 2005-01-29 Christopher Faylor <cgf@timesys.com>
2582 * cygthread.cc (new): Add a little more debugging.
2583 * thread.cc (pthread_null::exit): Add a _my_tls.remove() for safety.
2585 2005-01-28 Christopher Faylor <cgf@timesys.com>
2587 * cygtls.cc (cygtls::call2): Move socket cleanup.
2588 (cygtls::remove): Move socket cleanup here. Don't use _my_tls to
2591 2005-01-26 Christopher Faylor <cgf@timesys.com>
2593 * pinfo.cc (pinfo::init): Avoid a compiler warning.
2595 2005-01-25 Corinna Vinschen <corinna@vinschen.de>
2597 * syscalls.cc (setpriority): Implement PRIO_PGRP, PRIO_USER and
2598 setting priority in other Cygwin processes.
2599 (getpriority): Implement PRIO_PGRP, PRIO_USER and getting nice value
2600 from other processes.
2602 2005-01-26 Pierre Humblet <pierre.humblet@ieee.org>
2604 * path.cc (path_conv::check): Return ENOTDIR rather than ENOENT
2605 when a component is not a directory. Remove unreachable code.
2608 2005-01-25 Christopher Faylor <cgf@timesys.com>
2610 * pinfo.h (pinfo::init): Make third parameter non-optional and
2611 propagate change throughout.
2612 * pinfo.cc (set_myself): Pass INVALID_HANDLE_POINTER if h is NULL.
2613 (pinfo::init): Make third parameter non-optional. Eliminate use of
2614 PID_EXECED as an argument. Put setting of handle back inside loop but
2615 reorganize to try to open it only when necessary.
2617 2005-01-25 Corinna Vinschen <corinna@vinschen.de>
2619 * cygwin.din: Export getpriority and setpriority.
2620 * fork.cc (fork_parent): Copy parent's nice value into child.
2621 * spawn.cc (spawn_guts): Ditto.
2622 * miscfuncs.cc (winprio_to_nice): New function.
2623 (nice_to_winprio): Ditto.
2624 * pinfo.cc (pinfo_init): If parent is not a Cygwin process, set
2625 default nice value according to current Win32 priority class.
2626 * pinfo.h (class _pinfo): Add nice member.
2627 * syscalls.cc (setpriority): New function, only implementing
2628 PRIO_PROCESS for now.
2629 (getpriority): Ditto.
2630 (nice): Just call setpriority.
2631 * wincap.h (wincaps::has_extended_priority_class): New element.
2632 * wincap.cc: Implement above element throughout.
2633 * winsup.h: Add prototypes for winprio_to_nice and nice_to_winprio.
2634 * include/limits.h (NZERO): New define.
2635 * include/cygwin/types.h (id_t): New datatype.
2636 * include/cygwin/version.h: Bump API minor version.
2637 * include/sys/resource.h: Add PRIO_XXX defines and prototypes for
2638 getpriority and setpriority.
2640 2005-01-25 Corinna Vinschen <corinna@vinschen.de>
2642 * path.cc (realpath): Allow to expand with .exe suffix.
2644 2005-01-22 Christopher Faylor <cgf@timesys.com>
2646 * spawn.cc (spawn_guts): Perform same "cd" as in pinfo::exit below to
2647 make sure that a stub process does not keep the current working
2648 directory busy after the "execed" process has exited.
2650 2005-01-22 Christopher Faylor <cgf@timesys.com>
2652 * pinfo.cc (pinfo::init): Move everything but the MapViewOfFileEx out
2653 of the loop since trying multiple times to call CreateFileMapping
2654 doesn't make much sense. Try to structure the loop a little better so
2655 that exiting with a break does the right thing.
2656 (pinfo::release): Release shared memory area if it exists and close
2657 handle if it exists.
2659 2005-01-22 Christopher Faylor <cgf@timesys.com>
2661 * pinfo.cc (pinfo::maybe_set_exit_code_from_windows): Make sure that
2662 process has exited before getting an error code.
2663 (pinfo::exit): "cd" to innocuous location before exiting to make sure
2664 that process does not keep the current working directory busy while it
2665 is in the process of really exiting.
2667 2005-01-18 Corinna Vinschen <corinna@vinschen.de>
2669 * autoload.cc (CoInitialize): Remove.
2670 (CoUninitialize): Remove.
2671 (CoCreateInstance): Remove.
2672 (CoTaskMemFree): Add.
2673 (SHGetDesktopFolder): Add.
2674 * path.cc (shortcut_header): Remove.
2675 (shortcut_initalized): Remove.
2676 (GUID_shortcut): New static GUID.
2677 (struct win_shortcut_hdr): New struct describing Windows shortcut
2679 (symlink_worker): Rewrite creating Windows shortcuts. Create
2680 ITEMIDLIST if target exists. Only write once.
2681 (cmp_shortcut_header): Use win_shortcut_hdr structure for comparison.
2682 (check_shortcut): Rewrite to read only once from file. Allow skipping
2683 an ITIMIDLIST in the file.
2685 2005-01-16 Christopher Faylor <cgf@timesys.com>
2687 * pinfo.h (maybe_set_exit_code_from_windows): Renamed from
2689 * pinfo.cc (pinfo::exit): Use renamed function.
2690 (proc_waiter): Ditto. Make a copy of input argument to avoid problems
2691 when procs array is shuffled. Flag when copy is made so that
2692 remove_proc knows when it is safe to reshuffle.
2693 * sigproc.cc (proc_terminate): Don't flag process_state as PID_EXITED.
2694 (remove_proc): Wait for waiter to finish copying pinfo element before
2695 moving it (an actual wait should be an extremely rare event).
2697 2005-01-15 Christopher Faylor <cgf@timesys.com>
2699 * init.cc (dll_entry): Remove unused extern.
2701 * include/sys/cygwin.h: Remove PID_ZOMBIE.
2702 * pinfo.h: Rename EXITCODE_* defines.
2703 (pinfo::set_exit_state): Remove parameter.
2704 * pinfo.cc (set_exit_state): Remove parameter. Reverse sense of test
2705 so that exitcode is checked for having been set rather than not having
2706 been set. Set flag when exitcode has been established. Don't set
2708 (pinfo::init): Remove exitcode initialization.
2709 (pinfo::exit): Reflect change in EXITCODE_* naming. Set flag when
2710 exitcode has been established. Reflect change in arguments to
2712 (proc_waiter): Reflect change in arguments to set_process_state. Set
2713 process_state here and only here.
2714 * fhandler_process.cc (fhandler_process::fill_filebuf): Reflect removal
2715 of PID_ZOMBIE define.
2716 (format_process_stat): Ditto.
2717 (format_process_status): Ditto.
2718 * sigproc.cc (pid_exists): Ditto.
2719 (stopped_or_terminated): Ditto. Make sure that only low-order 16 bits of
2721 * spawn.cc (spawn_guts): Reflect change in EXITCODE_* naming.
2723 2005-01-15 Christopher Faylor <cgf@timesys.com>
2725 * sigproc.cc (sig_send): Don't complain if attempt to send signal to
2726 myself fails after I've "execed".
2728 2005-01-14 Corinna Vinschen <corinna@vinschen.de>
2730 * fhandler_disk_file.cc (fhandler_disk_file::facl): Pretend successful
2731 SETACL if no acls are available.
2732 * fhandler.cc (fhandler_base::facl): Implement to return sensible
2733 values on GETACL and GETACLCNT. Pretend successful SETACL.
2734 * fhandler_virtual.cc (fhandler_virtual::facl): Ditto.
2736 2005-01-13 Corinna Vinschen <corinna@vinschen.de>
2738 * fhandler.h (fhandler_disk_file::touch_ctime): Declare.
2739 * fhandler_disk_file.cc (fhandler_disk_file::touch_ctime): New method
2740 to set file's ctime.
2741 (fhandler_disk_file::fchmod): Try opening file for writing first.
2742 Set file's ctime on success.
2743 (fhandler_disk_file::fchown): Ditto.
2744 (fhandler_disk_file::facl): Ditto.
2746 2005-01-13 Corinna Vinschen <corinna@vinschen.de>
2748 * pinfo.cc (pinfo::exit): Don't access self after releasing it.
2749 * path.h (path_conv::path_conv): Fill path with native device
2750 name in case of device argument.
2752 2005-01-13 Corinna Vinschen <corinna@vinschen.de>
2754 * fhandler_serial.cc (fhandler_serial::dup): Call overlapped_setup
2755 for child, not for parent.
2757 2005-01-13 Christopher Faylor <cgf@timesys.com>
2759 * init.cc (dll_entry): Nuke attempt to set exit code since parent will
2760 use windows exit code if needed.
2761 * pinfo.cc (pinfo::exit): Move release() here to minimize pid creation
2762 race (suggested by Pierre Humblet).
2764 2005-01-12 Christopher Faylor <cgf@timesys.com>
2766 Reorganize header file inclusion throughout so that cygerrno.h comes
2768 * fhandler.h (select_record::thread_errno): Save any encountered errno
2770 (select_record::set_select_errno): New function.
2771 (select_record::saw_error): New function.
2772 (select_record::select_record): Initialize thread_errno to zero.
2773 * select.cc (set_handle_or_return_if_not_open): Set thread_errno on
2775 (select_stuff::wait): Record errno for later resurrection in calling
2777 (peek_serial): Ditto.
2779 2005-01-12 Christopher Faylor <cgf@timesys.com>
2781 * syscalls.cc (system): Use "/bin/sh" as per linux and (sorta) SUSv3.
2783 2005-01-12 Christopher Faylor <cgf@timesys.com>
2785 * pinfo.cc (pinfo::exit): Don't assume that this == myself.
2787 2005-01-11 Christopher Faylor <cgf@timesys.com>
2789 * pinfo.cc (pinfo::init): Don't close input handle on temporary (?)
2792 2005-01-11 Christopher Faylor <cgf@timesys.com>
2794 * pinfo.h (_pinfo::set_exit_state): Declare new function.
2795 (pinfo::exit): Move here from _pinfo::exit.
2796 * sigproc.cc (child_info::sync): Use new function to set exitcode and
2798 * pinfo.cc (_pinfo::exit): Ditto.
2799 (proc_waiter): Ditto.
2800 (_pinfo::set_exit_state): Define new function.
2801 (_pinfo::dup_proc_pipe): Close handle when there is no parent process
2802 around to care about the exit value.
2803 * dcrt0.cc (dll_crt0_0): Move subproc_ready synchronization later to
2804 make sure that myself is still mapped in parent.
2805 (do_exit): Reflect movement to pinfo::exit.
2806 (__api_fatal): Ditto.
2807 * exceptions.cc (signal_exit): Ditto.
2808 * errno.cc (errmap): Map PROC_NOT_FOUND.
2809 * init.cc (dll_entry): Release myself before exiting.
2810 * sigproc.cc (proc_can_be_signalled): Set errno appropriately.
2811 (sig_send): Ditto. Also remove ill-advised test for !myself->sendsig
2812 since this is an indication of a process which is still initializating
2813 -- it is not an error.
2814 (child_info::sync): Don't set exitcode here. Assume that will happen
2815 in proc_waiter, if necessary.
2816 * spawn.cc (spawn_guts): Delay "wait_for_myself" logic until later.
2817 Don't wait at all if the process has already exited. Reflect movement
2820 2005-01-11 Corinna Vinschen <corinna@vinschen.de>
2822 * environ.cc (build_env): Disallow empty strings and strings starting
2823 with '=' in Win32 environment.
2825 2005-01-08 Pierre Humblet <pierre.humblet@ieee.org>
2827 * syscalls.cc (seteuid32): Only change the default dacl when
2828 seteuid succeeds. Do not close HKCU.
2830 2005-01-06 Corinna Vinschen <corinna@vinschen.de>
2832 * fhandler_process.cc: Use strcasematch instead of strcasecmp
2835 2005-01-06 Corinna Vinschen <corinna@vinschen.de>
2837 * syscalls.cc (rename): Fix behaviour in case of renaming directories
2840 2005-01-06 Corinna Vinschen <corinna@vinschen.de>
2842 * fhandler_disk_file.cc (fhandler_base::open_fs): Don't allow
2843 opening directories for writing.
2845 2005-01-06 Christopher Faylor <cgf@timesys.com>
2847 * timer.cc (timer_thread): Pass sigev pointer value as per SuSv3 rather
2848 than pointer to sigev.
2850 2005-01-05 Christopher Faylor <cgf@timesys.com>
2852 * dcrt0.cc (multiple_cygwin_problem): Reorganize error message to not
2853 always talk about a "version" when it's not a version.
2854 (dll_crt0_0): Change info passed to multiple_cygwin_problem to be a
2855 little more precise.
2856 * shared.cc (user_shared_initialize): Ditto.
2857 (shared_info::initialize): Ditto.
2859 2005-01-03 Christopher Faylor <cgf@timesys.com>
2861 * pinfo.cc (_pinfo::dup_proc_pipe): Can't close proc pipe when execing
2862 or we will suffer an exit code race.
2864 2005-01-03 Corinna Vinschen <corinna@vinschen.de>
2866 * signal.cc (abort): Call _GLOBAL_REENT's __cleanup.
2868 2005-01-03 Corinna Vinschen <corinna@vinschen.de>
2870 * syscalls.cc (setmode): Call _fwalk with _GLOBAL_REENT.
2872 2005-01-01 Christopher Faylor <cgf@timesys.com>
2874 * cygthread.cc (cygthread::stub): Set inuse to false when exiting.
2875 (cygthread::cygthread): Actually pass name as argument to debugging
2876 output to avoid SEGV when strace'ing.
2877 (cygthread::release): Don't set stack_ptr to NULL, since it is only set
2878 once on first entry to a stub not on each stub iteration.
2879 (cygthead::exit_thread): Remove obsolete function.
2880 * cygthread.h (cygthread::exit_thread): Ditto.
2882 2005-01-01 Christopher Faylor <cgf@timesys.com>
2884 * shared.cc (open_shared): Don't attempt VirtualAlloc magic if first
2885 attempt to map memory fails.