1 2003-09-03 Christopher Faylor <cgf@redhat.com>
3 * exceptions.cc (set_process_mask): Set pending signals only when
4 signals become unmasked.
5 * sigproc.cc (pending_signals): Flip back to a global.
6 (wait_sig): Don't set pending signals when there is an armed semaphore
9 * shared.cc (shared_info::initialize): Add a username parameter for
10 user-mode mounts. Reorganize to try to avoid startup race.
11 (memory_init): Move some stuff into shared_info::initialize.
12 * shared_info.h (shared_info::initialize): Change declaration.
13 (CURR_SHARED_MAGIC): Update.
15 2003-09-01 Christopher Faylor <cgf@redhat.com>
17 * include/cygwin/version.h: Bump DLL minor number to 4.
19 2003-09-01 Christopher Faylor <cgf@redhat.com>
21 * net.cc (dup_ent): Restore check for NULL input.
23 2003-08-31 Christopher Faylor <cgf@redhat.com>
25 * include/sys/cygwin.h: Don't define cygwin-specific things if
28 2003-08-31 Christopher Faylor <cgf@redhat.com>
30 * cygheap.cc (cygheap_init): Allocate space for sigaction array in
32 * cygheap.h (cygheap_types): Add HEAP_SIGS.
33 * exceptions.cc (signal_fixup_after_exec): Remove from this file.
34 * pinfo.h (pinfo::getsig): Just return global_sigs array.
35 (pinfo::sigs): Delete.
36 * sigproc.cc (signal_fixup_after_exec): Move it here.
37 (global_sigs): New global array, moved from pinfo structure.
38 (sigalloc): New function. Allocate global sigaction array here.
39 (proc_subproc): Remove copysigs call. It's automatic now.
40 * include/sys/cygwin.h (PID_NOCLDSTOP): New value.
41 * signal.cc (sigaction): Set myself->PID_NODCLDSTOP when appropriate.
42 * sigproc.h (sigalloc): Declare.
44 * fnmatch.c (fnmatch): Use C90 parameters.
47 * fhandler.cc (fhandler_base::raw_read): Use right coercion to avoid a
50 2003-08-31 Christopher Faylor <cgf@redhat.com>
52 * net.cc (dup_ent): Make debugging output consistent.
54 2003-08-31 Christopher Faylor <cgf@redhat.com>
56 Use dup_ent rather than specific dup_*_ptr functions throughout.
58 (dup_ent): Subsume gen_ent functionality.
59 (dup_host_ptr): Delete.
60 (dup_proto_ptr): Ditto.
61 (dup_servent_ptr): Ditto.
63 2003-08-31 Christopher Faylor <cgf@redhat.com>
65 * net.cc (gen_ent): Invert sense of null check so that debug output
68 2003-08-31 Christopher Faylor <cgf@redhat.com>
70 * net.cc (free_char_list): Delete.
71 (dup_addr_list): Delete.
72 (dup_char_list): Delete.
73 (free_hostent_ptr): Delete.
74 (free_protoent_ptr): Delete.
75 (free_servent_ptr): Delete.
76 (DWORD_round): New function.
77 (strlen_round): New function. Returns strlen rounded up to word size.
78 (dup_ent): New, generic function to duplicate a {host,proto,serv}ent
80 (gen_ent): New macro. Generates a generic dup_{host,proto,serv}ent_ptr
82 (cygwin_getservbyname): Remove call to free_servent_ptr, pass
83 servent_buf to dup_servent_ptr.
84 (cygwin_getservbyport): Ditto.
85 (cygwin_gethostbyname): Ditto for hostent.
86 (cygwin_gethostbyaddr): Ditto.
87 (cygwin_getprotobyname): Ditto for protoent.
88 (cygwin_getprotobynumber): Ditto.
90 2003-08-31 Christopher Faylor <cgf@redhat.com>
92 * Makefile.in (MALLOC_OFILES): Always fill in with correct malloc
94 * configure.in: Fill in MALLOC_OFILES with either debugging or regular
96 * configure: Regenerate.
97 * dlmalloc.c: Make various fruitless changes to attempt to get to work.
99 * malloc.cc (free): Check malloc pool when debugging.
101 * path.cc (win32_device_name): Eliminate compiler warning.
103 * sigproc.cc (sig_dispatch_pending): Remove use of was_pending. Let
104 thisframe.call_signal_handler decide if handler should be called rather
105 than using bogus was_pending check.
107 * exceptions.cc (interrupt_setup): Remove accidentally checked in
110 2003-08-30 Christopher Faylor <cgf@redhat.com>
112 * heap.cc (sbrk): Save rounded addess in user_heap_max.
114 2003-08-30 Christopher Faylor <cgf@redhat.com>
116 * sigproc.cc (sig_dispatch_pending): Remove explicit call to
117 thisframe.call_signal_handler.
119 2003-08-30 Christopher Faylor <cgf@redhat.com>
121 Remove some cygserver files.
123 2003-08-28 Christopher Faylor <cgf@redhat.com>
125 * sigproc.h: Make some functions regparm.
126 * sigproc.cc (checkstate): Make regparm.
127 (getevent): Change parameters in declaration, rename from getsem, make regparm.
128 (sig_send): Recognize that nosync is now an event. Remove some old
129 cruft from previous interrupt anywhere signal handler.
130 (getevent): Change parameters in definition, rename from getsem.
131 Allocate event rather than semaphore.
132 (wait_sig): Treat sigcatch_nosync as an event.
134 2003-08-28 Christopher Faylor <cgf@redhat.com>
136 * exceptions.cc (sigreturn): Fix problem where old return address was
137 not properly restored for a nested signal.
139 2003-08-27 Christopher Faylor <cgf@redhat.com>
141 * autoload.cc (SwitchToThread): Declare as autoload function.
142 * cygthread.h (cygthread::main_thread_id): Make public.
143 * exceptions.cc (setup_handler): Remove unneeded priority stuff.
144 Rename label to reflect what it does. Add debugging for idiotic
145 Windows NT problem. Change debugging output to include signal number.
146 * miscfuncs.cc (low_priority_sleep): If available, use SwitchToThread
147 function to give time slice to other threads.
148 * wincap.cc: Properly define have_switch_to_thread throughout.
149 * wincap.h (wincap::switch_to_thread): New element.
151 2003-08-27 Christopher Faylor <cgf@redhat.com>
153 * syscalls.cc (mount): Don't check win32_path when doing cygdrive
156 2003-08-27 Christopher Faylor <cgf@redhat.com>
158 * specdir: Correctly remove temporary directory prior to use.
160 2003-08-27 Christopher Faylor <cgf@redhat.com>
162 * sigproc.cc (wait_sig): Count number of iterations through
163 'more_signals' loop and issue a warning if DEBUGGING and excessive.
164 (WFSO): When debugging and infinite timeout, loop.
166 2003-08-26 Corinna Vinschen <corinna@vinschen.de>
168 * include/cygwin/stat.h: Allow definition of internal stat structures
169 also when compiling newlib.
171 2003-08-25 Christopher Faylor <cgf@redhat.com>
173 Throughout, change USE_CYGSERVER to USE_SERVER.
174 * Makefile.in (LIBSERVER): Define and use.
175 * configure.in: Set LIBSERVER as appropriate.
176 * configure: Regenerate.
177 * acconfig.h: Regenerate.
178 * environ.cc: Rename allow_daemon to allow_server. Only recognize when
179 USE_SERVER is defined.
181 2003-08-23 Christopher Faylor <cgf@redhat.com>
183 * syscalls.cc (_remove_r): Define.
185 2003-08-22 Corinna Vinschen <corinna@vinschen.de>
187 * cygheap.h (enum cygheap_types): Add HEAP_MMAP.
188 (CYGHEAPSIZE): Add another 64K.
189 * mmap.cc: Use cmalloc, ccalloc and crealloc with HEAP_MMAP type
192 2003-08-22 Christopher Faylor <cgf@redhat.com>
194 * cygheap.cc (user_heap_info::max): New field.
195 * heap.cc (heap_init): Save pointer to end of heap reserved memory.
196 (sbrk): Don't attempt to commit memory beyond end of heap reserved
197 memory. Attempt to honor comment and reserve commitbytes if heapchunk
200 2003-08-20 Pierre Humblet <pierre.humblet@ieee.org>
202 * exceptions.cc (sigreturn): Don't clobber ebp in recursive signal
205 2003-08-22 Christopher Faylor <cgf@redhat.com>
207 * exceptions.cc (sig_handle): Change so that default signals indicate
210 2003-08-21 Christopher Faylor <cgf@redhat.com>
212 * sigproc.cc (wait_sig): Remove redundant test in do/while.
214 2003-08-21 Christopher Faylor <cgf@redhat.com>
216 * sigproc.cc (wait_sig): Avoid infinite loop.
218 2003-08-20 Christopher Faylor <cgf@redhat.com>
220 * speclib: Reenable removal of temp files.
222 2003-08-20 Christopher Faylor <cgf@redhat.com>
224 * miscfuncs.cc (low_priority_sleep): Sleep at same priority as main
226 * sigproc.cc (wait_sig): Keep looping if there are more signals to
227 consider and we are flushing signals.
228 (sig_send): Put nonsync signals in the correct bucket.
230 2003-08-20 Christopher Faylor <cgf@redhat.com>
232 * speclib: Fix created lib to avoid "File truncated" problems.
234 2003-08-20 Pierre Humblet <pierre.humblet@ieee.org>
236 * exceptions.cc (interrupt_setup): Set sigsave.sig last to avoid a
239 2003-08-20 Christopher Faylor <cgf@redhat.com>
241 * sigproc.cc (wait_sig): Ensure that myself->getsigtodo array is
242 flushed on a __SIGFLUSH.
244 2003-08-20 Pierre Humblet <pierre.humblet@ieee.org>
245 Christopher Faylor <cgf@redhat.com>
247 * exceptions.cc (_sigreturn): Handle nested signals without growing the
250 2003-08-19 Christopher Faylor <cgf@redhat.com>
252 * exceptions.cc (pending_signals): Remove unneeded declaration.
253 * sigproc.cc (pending_signals): Make static.
254 (wait_sig): Use defined values rather than integers for rc. Never scan
255 both todo arrays as this could cause hangs if signals arrive from two
256 different sources. Rename saw_pending_signals to saw_failed_interrupt.
257 Exit loop when signal found. Enter low-priority sleep, if necessary,
258 after finished signalling completion. Set pending_signals when blocked
259 (from Pierre Humblet).
261 2003-08-19 Christopher Faylor <cgf@redhat.com>
263 * signal.cc (sigpending): Move.
264 * sigproc.cc (sigpending): To here.
265 (getlocal_sigtodo): Return process-local signal array.
266 (sigpending): Accommodate new process-local signal array.
268 (sig_set_pending): Ditto.
271 2003-08-19 Christopher Faylor <cgf@redhat.com>
273 Throughout, eliminate argument to sig_dispatch_pending.
274 * exceptions.cc (setup_handler): Move non-interruptible condition
275 handling (back) to wait_sig.
276 (set_process_mask): Don't worry about calling sig_dispatch_pending from
277 sigthread since it is detected in the function anyway.
278 (sig_handle): Eliminate thisproc arg. Don't call sig_dispatch_pending
279 on SIGCONT since that should happen automatically.
280 * sigproc.cc (sig_dispatch_pending): Eliminate justwake argument. Just
281 return when called from sigthread.
282 (wait_sig): Change some variables to bool. Change inner while to an
283 if. Move uninterruptible signal handling here.
284 (sigproc_terminate): Don't call sig_dispatch_pending. Just increment
287 * speclib: Use slightly different (but still flawed) method for
288 determining symbols to extract from libraries.
290 2003-08-18 Christopher Faylor <cgf@redhat.com>
292 * exceptions.cc (sigdelayed): Fix race where signal handler could get
293 the wrong mask (as suggested by Pierre Humblet).
295 2003-08-18 Christopher Faylor <cgf@redhat.com>
297 * path.cc (mount): Add null/empty check for input parameters.
298 (umount): Add null/empty check for input parameters.
300 2003-08-17 Pierre Humblet <pierre.humblet@ieee.org>
302 * grp.cc (read_group): Revert previous change.
303 * uinfo.cc (pwdgrp::load): Always reset curr_lines.
305 2003-08-17 Corinna Vinschen <corinna@vinschen.de>
307 * errno.cc (errmap): Map ERROR_INVALID_BLOCK_LENGTH to EIO.
308 * fhandler_raw.cc (fhandler_dev_raw::raw_read): Set more accurate
309 errnos instead of EACCES.
310 (fhandler_dev_raw::raw_write): Ditto.
312 2003-08-17 Christopher Faylor <cgf@redhat.com>
314 * path.cc (special_name): Accommodate all special names with
317 2003-08-15 Corinna Vinschen <corinna@vinschen.de>
319 * mmap.cc (mmap64): Avoid crash if file size is less than requested
322 2003-08-13 Igor Pechtchanski <pechtcha@cs.nyu.edu>
324 * path.cc (special_name): Add checks for some specials followed by
325 a "." and a FIXME comment.
327 2003-08-13 Corinna Vinschen <corinna@vinschen.de>
329 * cygwin.din: Accommodate change from cygwin_lstat to lstat.
330 * syscalls.cc: Add defines to avoid declaration issues when
331 renaming cygwin_lstat back to lstat.
332 (lstat): Reverted name change from cygwin_lstat.
334 2003-08-12 Corinna Vinschen <corinna@vinschen.de>
336 * include/sys/param.h (NBBY): Define if not defined.
338 2003-08-12 Nicholas Wourms <nwourms@netscape.net>
340 * include/sys/param.h (setbit): Add new bitmap related macro.
344 (howmany): Add new counting/rounding macro.
345 (rounddown): Likewise.
347 (roundup2): Likewise.
349 (MIN): Add macro for calculating min.
350 (MAX): Add macro for calculating max.
352 2003-08-09 Christopher Faylor <cgf@redhat.com>
354 * include/cygwin/version.h: Bump DLL minor number to 3.
356 2003-08-08 Gerrit P. Haase <gp@familiehaase.de>
358 * include/stdint.h: Correctly define INT32_MIN.
360 2003-08-08 David Rothenberger <daveroth@acm.org>
362 * grp.cc (read_group): Set __group32.gr_mem pointer back to &null_ptr
363 after free() is called.
365 2003-08-05 Christopher Faylor <cgf@redhat.com>
367 * Makefile.in: Rework to accommodate new speclib arguments.
368 * speclib: Rework to extract everything from libcygwin.a rather than
369 building things from existing object files.
371 2003-08-05 Pavel Tsekov <ptsekov@gmx.net>
373 * path.cc (cygdrive_getmntent): Do not skip over drives of type
376 2003-08-05 Christopher Faylor <cgf@redhat.com>
378 * fhandler.cc (fhandler_base::lseek): Be more paranoid when
379 constructing offsets from 64 bit value.
380 * syscalls.cc (logout): Avoid temp buffer memcpy since new scheme does
382 (utmp_data): Rework as a macro which returns a pointer into a buffer.
383 (getutent): Use new buffer allocation mechanism to grab a utmp buffer.
387 2003-08-05 Pavel Tsekov <ptsekov@gmx.net>
389 * fhandler_disk_file.cc (fhandler_cygdrive::readdir): Do not change
390 'errno' if end of directory condition is encountered as per SUSv2.
391 * fhandler_proc.cc (fhandler_proc::readdir): Ditto.
392 * fhandler_process (fhandler_process::readdir): Ditto.
393 * fhandler_registry (fhandler_registry::readdir): Ditto.
395 2003-07-30 Christopher Faylor <cgf@redhat.com>
397 * dcrt0.cc (_dll_crt0): Move strace.microseconds initialization to
398 after pthread initialization.
399 (dll_crt0_1): i.e., here.
401 2003-07-28 Christopher Faylor <cgf@redhat.com>
403 * fhandler_base.cc (fhandler_base::readv): Rework to properly return
404 number of bytes from read.
406 2003-07-28 Christopher Faylor <cgf@redhat.com>
408 * include/cygwin/version.h: Bump DLL minor number to 2.
410 2003-07-26 Christopher Faylor <cgf@redhat.com>
412 * exceptions.cc (ctrl_c_handler): Send SIGHUP when events occur only if
413 there is a tty associated with the process. Send SIGHUP on
416 * fhandler_tty.cc (fhandler_tty_slave::open): Adjust console open
417 handle counter regardless of whether this is a pty or tty.
418 (fhandler_tty_slave::open): Ditto.
419 (fhandler_tty_slave::dup): Ditto.
420 (fhandler_tty_common::set_close_on_exec): Ditto.
421 (fhandler_tty_master::init_console): Decrement console open handle
422 counter after init since it will now be handled by all tty open.
423 * syscalls.cc (setsid): Rework debugging output slightly.
425 2003-07-25 Christopher Faylor <cgf@redhat.com>
427 * configure.in: Use 'install-sh -c'.
428 * configure: Regenerate.
430 2003-07-25 Christopher Faylor <cgf@redhat.com>
432 * configure.in: Always use install-sh.
433 * configure: Regenerate.
435 2003-07-25 Christopher Faylor <cgf@redhat.com>
437 * include/cygwin/socket.h: Conditionalize [AP]F_INET6 define.
439 2003-07-25 Christopher Faylor <cgf@redhat.com>
441 * Makefile.in (OBSOLETE_FUNCTION): Add fdopen.
443 2003-07-25 Christopher Faylor <cgf@redhat.com>
445 * cygwin.din: Export _fdopen64
446 * Makefile.in (NEW_FUNCTIONS): Add _fdopen64 -> fdopen translation.
447 * include/cygwin/version.h: Bump api minor number.
449 * ntdll.h: Remove (now) duplicate FILE_SYNCHRONOUS_IO_NONALERT
452 2003-07-24 Christopher Faylor <cgf@redhat.com>
454 * environ.cc (check_case_init): Use strncasematch.
456 * cygwin.din: Export __mempcpy.
457 * cygwin/version.h: Bump api minor number.
459 2003-07-21 Pavel Tsekov <ptsekov@gmx.net>
461 * mmap.cc: Use proper format specifiers for _off64_t and size_t in
462 format strings passed to syscall_printf () and debug_printf ()
465 2003-07-18 Pierre Humblet <pierre.humblet@ieee.org>
467 * security.cc (verify_token): Fix white space and style.
468 Use type bool instead of BOOL and char. Use alloca
469 instead of malloc and free for my_grps.
471 2003-07-17 Corinna Vinschen <corinna@vinschen.de>
473 * sysconf.cc (sysconf): Fix OPEN_MAX patch. Return page size on
476 2003-07-14 Corinna Vinschen <corinna@vinschen.de>
478 * cygheap.h (class cygheap_user): Use INVALID_HANDLE_VALUE as invalid
480 * syscalls.cc (seteuid32): Ditto. Set new_token to process token if
481 process token is suitable.
482 * uinfo.cc (uinfo_init): Initialize tokens in cygheap user info
483 to INVALID_HANDLE_VALUE.
485 2003-07-14 Pierre Humblet <pierre.humblet@ieee.org>
487 * cygheap.h (enum impersonation): Delete.
488 (cygheap_user::impersonation_state): Delete.
489 (cygheap_user::current_token): New.
490 (cygheap_user::issetuid): Modify to use current_token.
491 (cygheap_user::token): Ditto.
492 (cygheap_user::deimpersonate): Ditto.
493 (cygheap_user::reimpersonate): Ditto.
494 (cygheap_user::has_impersonation_tokens): Ditto.
495 (cygheap_user::close_impersonation_tokens): Ditto.
496 * security.cc (cygwin_set_impersonation_token): Always set the token.
497 (verify_token): Change type of gsid to cygpsid.
498 (get_file_attribute): Use the effective ids.
499 * syscalls.cc (seteuid32): Modify to use cygheap_user::current_token.
500 * uinfo.cc (uinfo_init) Do not set cygheap->user.impersonation_state.
502 2003-07-12 Christopher Faylor <cgf@redhat.com>
504 * pinfo.cc (_pinfo::commune_send): Fix bounds test so that poll of
505 communicating pid actually stops eventually.
507 2003-07-10 Christopher Faylor <cgf@redhat.com>
509 * path.cc (get_device_number): Remove special com? consideration.
510 (special_chars): Make static.
511 (special_introducers): New.
512 (special_char): Allow specified valid_chars args.
513 (fnunmunge): Handle aux-like filenames correctly.
514 (special_name): Add con, conin$, conout$.
515 (mount_item::fnmunge): Use __small_sprintf return value to calculate
518 2003-07-09 Christopher Faylor <cgf@redhat.com>
520 * include/cygwin/version.h: Bump DLL minor number to 1.
522 2003-07-09 Christopher Faylor <cgf@redhat.com>
524 * fhandler_proc.cc (format_proc_stat): Use correctly sized constants
525 for filling in zeros on 98.
527 2003-07-09 Christopher Faylor <cgf@redhat.com>
529 * fhandler_proc.cc (fhandler_proc::fill_filebuf): Allocate more space
531 (format_proc_stat): Reorganize to accumulate and report on all cpus.
533 2003-07-09 Christopher Faylor <cgf@redhat.com>
535 * sysconf.cc (sysconf): Return processors online rather than bitmask
536 for _SC_NPROCESSORS_ONLN.
538 2003-07-08 Christopher Faylor <cgf@redhat.com>
540 * cygheap.cc (creturn): Set appropriate errno when out of memory.
541 (ccalloc): Only issue system_printf when debugging.
542 * dtable.cc (dtable::extend): Only allocate 100 * the incremental growth
543 size max. Set errno appropriately.
544 (dtable::build_fhandler): Check for error from set_name.
545 * fhandler.cc (fhandler_base::set_name): Set errno and return error on OOM.
546 * fhandler.h (fhandler_base::set_name): Change to bool.
547 * fhandler_process.cc (format_process_stat): Fix formatting.
548 * resource.cc (getrlimit): Return greater of OPEN_MAX or fd table size.
549 * sysconf.cc (sysconf): Ditto.
551 2003-07-07 Christopher Faylor <cgf@redhat.com>
553 * rmsym: Don't use ranlib.
555 2003-07-07 Christopher Faylor <cgf@redhat.com>
557 * newsym: Reenable removal of tmp directory. Just use ar to generate
559 * Makefile.in: Don't send ranlib to newsym or rmsym.
561 2003-07-07 Christopher Faylor <cgf@redhat.com>
563 * newsym: Create objects that are closer to those created by dlltool so
564 as not to confuse --export-all-symbols.
565 * rmsym: Be a little more accepting of object filenames now that
566 dlltool can create different format files.
568 2003-07-06 Christopher Faylor <cgf@redhat.com>
570 * newsym: Oops. Revert below change.
572 2003-07-06 Christopher Faylor <cgf@redhat.com>
574 * newsym: Use correct prefix for generating imports.
575 * pinfo.cc (_pinfo::commune_send): Don't wait forever for a response
576 from another process.
578 2003-07-06 Christopher Faylor <cgf@redhat.com>
580 * syscalls.cc (gethostid): Set thread affinity so that results are
583 2003-07-05 Corinna Vinschen <corinna@vinschen.de>
585 * mmap.cc (list::match): Add parameters to return valid address and
586 length back to munmap(). Evaluate intersection between given
587 area and mapped area and return it, if any.
588 (mmap64): On regular files, don't allow mappings beginning beyond
589 EOF. Return with errno set to ENXIO instead.
590 (munmap): Rewrite SUSv3 conformant. Check if given memory area is
591 valid. Unmap all maps inside given memory area. Don't return error
592 if no mapping has been unmapped.
594 2003-07-05 N Stephens <nigel@mips.com>
596 * fhandler.h (fhandler_socket::get_connect_state): New method to
597 return socket connection state.
598 * fhandler_socket.cc (dup): Copy socket connect state to new file
600 * net.cc (cygwin_rcmd): Mark file handles of sockets returned by
601 rcmd() as CONNECTED state.
602 (cygwin_rexec): Similarly for rexec().
603 (socketpair): Mark both ends of a new socket pair as CONNECTED.
605 2003-07-04 Corinna Vinschen <corinna@vinschen.de>
607 * mmap.cc (fhandler_disk_file::mmap): Fix address test.
609 2003-07-03 Christopher Faylor <cgf@redhat.com>
611 * path.cc (fillout_mntent): Change "posix" to "managed".
613 2003-07-02 Christopher Faylor <cgf@redhat.com>
615 * fhandler.h (FH_ENC): New enum.
616 (fhandler_base::get_encoded): New function.
617 (fhandler_base::set_encoded): Ditto.
618 * fhandler_disk_file.cc (fhandler_disk_file::opendir): Set encoded flag
619 in fhandler, as appropriate.
620 (fhandler_disk_file::readdir): Unmunge filename as appropriate based on
622 * path.cc (normalize_posix_path): Don't punt on files with colons.
623 (special_char): New function.
624 (mount_item::fnmunge): Ditto.
626 (special_name): Ditto.
627 (mount_item::build_win32): Avoid drive considerations when file is
629 (mount_info::conv_to_win32_path): Handle encoded filenames.
630 (mount_info::conv_to_posix_path): Ditto.
631 (fillout_mntent): Add posix string when directory is encoded.
632 * path.h (fnunmunge): Declare.
633 (path_conv::is_encoded): Declare.
635 2003-07-03 Christopher Faylor <cgf@redhat.com>
637 * fhandler_tty.cc (fhandler_tty_slave::open): Conditionalize a little
638 more of the cygserver stuff so that ttys actually work.
640 2003-07-03 Corinna Vinschen <corinna@vinschen.de>
642 * mmap.cc (mmap64): Allow MAP_FIXED with pagesize granularity (4K).
643 If a non-zero addr is given, align it to the next lower 64K boundary.
644 (fhandler_disk_file::mmap): If a non-zero address is given, try
645 mapping using the given address first. If it fails and flags is not
646 MAP_FIXED, try again with NULL address.
648 2003-07-01 Christopher Faylor <cgf@redhat.com>
650 * thread.cc: Remove _MT_SAFE conditional.
652 2003-07-01 Christopher Faylor <cgf@redhat.com>
654 * configure.in: Fix --enable-server option.
655 * configure: Regenerate.
657 2003-07-01 Christopher Faylor <cgf@redhat.com>
659 * Makefile.in: Remove cygserver stuff.
660 * acconfig.h: Add USE_CYGSERVER define.
661 * config.h.in: Regenerate.
662 * configure.in: Add --enable-server setting.
663 * configure: Regenerate.
664 * fhandler_tty.cc (fhandler_tty_slave::open): Conditionalize
665 compilation of cygserver stuff.
666 * fork.cc (fork_child): Ditto.
668 * tty.cc (tty::common_init): Ditto.
670 * dcrt0.cc: Use bool rather than BOOL for CYGWIN environment variable
674 * security.cc: Ditto.
676 * syscalls.cc (check_posix_perm): Remove externs that were already
677 declared in a header.
678 * winsup.h: Ditto. Declare _MT_SAFE here. Delete it someday since
679 cygwin should always be _MT_SAFE.
681 2003-07-01 Christopher Faylor <cgf@redhat.com>
683 * thread.cc: Remove _MT_SAFE conditional.
685 2003-07-01 Christopher Faylor <cgf@redhat.com>
687 * configure.in: Fix --enable-server option.
688 * configure: Regenerate.
690 2003-07-01 Christopher Faylor <cgf@redhat.com>
692 * Makefile.in: Remove cygserver stuff.
693 * acconfig.h: Add USE_CYGSERVER define.
694 * config.h.in: Regenerate.
695 * configure.in: Add --enable-server setting.
696 * configure: Regenerate.
697 * fhandler_tty.cc (fhandler_tty_slave::open): Conditionalize
698 compilation of cygserver stuff.
699 * fork.cc (fork_child): Ditto.
701 * tty.cc (tty::common_init): Ditto.
703 * dcrt0.cc: Use bool rather than BOOL for CYGWIN environment variable
707 * security.cc: Ditto.
709 * syscalls.cc (check_posix_perm): Remove externs that were already
710 declared in a header.
711 * winsup.h: Ditto. Declare _MT_SAFE here. Delete it someday since
712 cygwin should always be _MT_SAFE.
714 2003-06-30 Pierre Humblet <pierre.humblet@ieee.org>
716 * cygheap.h (enum impersonation): New enum.
717 (cygheap_user::token): Delete.
718 (cygheap_user::impersonated): Delete.
719 (cygheap_user::external_token): New member.
720 (cygheap_user::internal_token): New member.
721 (cygheap_user::impersonation_state): New member.
722 (cygheap_user::issetuid): Modify.
723 (cygheap_user::token): New method.
724 (cygheap_user::deimpersonate): New method.
725 (cygheap_user::reimpersonate): New method.
726 (cygheap_user::has_impersonation_tokens): New method.
727 (cygheap_user::close_impersonation_tokens): New method.
728 * dtable.cc (dtable::vfork_child_dup): Use new cygheap_user methods.
729 * fhandler_socket.cc (fhandler_socket::dup): Ditto.
730 * fork.cc (fork_child): Ditto.
731 (fork_parent): Ditto.
732 * grp.cc (internal_getgroups): Ditto.
733 * security.cc (verify_token): Ditto.
734 (check_file_access): Ditto.
735 (cygwin_set_impersonation_token): Detect conflicts. Set
737 * spawn.cc (spawn_guts): Use new cygheap_user methods.
738 * syscalls.cc (seteuid32): Rearrange to use the two tokens
740 (setegid32): Use new cygheap_user methods.
741 * uinfo.cc: (internal_getlogin): Ditto.
743 2003-06-25 Doru Carastan <doru.carastan@mvista.com>
745 * Makefile.in: Use INSTALL_PROGRAM to install the cygwin DLL.
747 2003-06-24 Thomas Pfaff <tpfaff@gmx.net>
749 * thread.cc (MTinterface::fixup_after_fork): Fix thread list after
751 (pthread::threads): Instantiate.
752 (pthread::pthread): Initialize running and suspendend.
753 Initialize next with NULL.
754 Add thread to thread list if it is not the null_pthread.
755 (pthread::~pthread): Remove thread from thread list if it is
756 not the null_pthread.
757 (pthread::postcreate): Set running flag.
758 (pthread::exit): Reset running flag.
759 (pthread::cancel): Try to cancel thread only if still running.
760 (pthread::_fixup_after_fork): Implement.
761 (pthread::detach): Check if thread is still running before detach.
762 * thread.h (pthread::running): New member.
763 (pthread::next): Ditto.
764 (pthread::fixup_after_fork): New static method.
765 (pthread::threads): New static method.
766 (pthread::_fixup_after_fork): New method.
768 2003-06-20 Christopher Faylor <cgf@redhat.com>
770 * pinfo.cc (_pinfo::commune_send): Don't attempt to communicate with a
771 pure windows process.
773 2003-06-18 Pierre Humblet <pierre.humblet@ieee.org>
775 * autoload.cc (GetNetworkParams): Add.
776 * net.cc (getdomainname): Call GetNetworkParams and read the
777 DhcpDomain registry value if warranted.
779 2003-06-17 Christopher Faylor <cgf@redhat.com>
781 * path.cc (mount): Do more strict checking on posix path arguments.
783 2003-06-15 Christopher Faylor <cgf@redhat.com>
785 Throughout, remove "include <errno.h>" from files which already include
788 2003-06-15 Thomas Pfaff <tpfaff@gmx.net>
790 * include/cygwin/config.h (__DYNAMIC_REENT__): Define.
791 * include/cygwin/version.h: Bump API minor version.
792 * cygwin.din: Export __getreent
793 * cygerrno.h: Include errno.h. Fix places where _impure_ptr is used
794 directly to store the errno value.
795 * debug.cc (__set_errno): Ditto.
796 * errno.cc: Remove _RRENT_ONLY define to get errno.cc compiled.
797 * signal.cc: Rename _reent_clib to _REENT throughout.
798 * thread.h (reent_clib): Remove prototype.
799 * thread.cc (reent_clib): Rename reent_clib to __getreent. Return
800 _impure_ptr until MTinterface is initialized.
801 (reent_winsup): Fix a possible SEGV when _r == NULL. Return NULL
803 * MTinterface::fixup_after_fork: Switch reent back to _impure_ptr to
804 keep signal handling running when fork is called from a thread other
807 2003-06-12 Thomas Pfaff <tpfaff@gmx.net>
809 * thread.cc (pthread_attr_init): Revert change from 2003-06-11
810 to return 0 if attribute is already initialized back to EBUSY.
811 (pthread_condattr_init): Ditto.
812 (pthread_rwlockattr_init): Ditto.
813 (pthread_mutexattr_init): Ditto.
815 2003-06-12 Corinna Vinschen <corinna@vinschen.de>
817 * exceptions.cc (ctrl_c_handler): Don't send a signal on
818 CTRL_SHUTDOWN_EVENT. Add a comment to rationalize the patch.
820 2003-06-11 Thomas Pfaff <tpfaff@gmx.net>
822 * thread.cc (pthread_attr_init): Return 0 if attribute is already
824 Fix return code if out of memory.
825 (pthread_condattr_init): Ditto.
826 (pthread_rwlockattr_init): Ditto.
827 (pthread_mutexattr_init): Return 0 if attribute is already
830 2003-06-09 Pierre Humblet <pierre.humblet@ieee.org>
832 * spawn.cc (spawn_guts): Call CreateProcess while impersonated,
833 when the real {u,g}ids and the groups are original.
834 Move RevertToSelf and ImpersonateLoggedOnUser to the main line.
835 * uinfo.cc (uinfo_init): Reorganize. If CreateProcess was called
836 while impersonated, preserve the uids and gids and call
837 ImpersonateLoggedOnUser. Preserve the uids and gids on Win9X.
839 * exceptions.cc (error_start_init): Quote the pgm in the command.
841 2003-06-07 Christopher Faylor <cgf@redhat.com>
843 * poll.cc: Define FD_SETSIZE to ridiculously large number so that there
844 will be no artificially small limits.
846 2003-06-07 Christopher Faylor <cgf@redhat.com>
848 * fhandler_tty.cc (fhandler_tty_slave::close): Free the console when
851 2003-06-07 Thomas Pfaff <tpfaff@gmx.net>
853 * fhandler_socket.cc (fhandler_socket::connect): Change error
854 handling for nonblocking connects to return EALREADY when
855 connect is called more than once for the same socket.
857 2003-06-06 Corinna Vinschen <corinna@vinschen.de>
859 * cygwin.din: Add vsyslog.
860 * fhandler.cc (fhandler_base::write): Only make file sparse if the
861 seeked area is >= 128K.
862 * syslog.cc (vsyslog): New function, overtaking functionality from
864 (syslog): Just call vsyslog.
865 * include/cygwin/version.h: Bump API minor.
866 * include/sys/syslog.h: Add vsyslog declaration.
868 2003-06-05 Christopher Faylor <cgf@redhat.com>
870 * cygthread.cc (cygthread::terminate_thread): Change system_printf to
873 2003-06-04 Christopher Faylor <cgf@redhat.com>
875 * shared.cc (shared_info::heap_chunk_size): Be really defensive about
876 making sure that heap_chunk is set.
878 2003-06-04 Christopher Faylor <cgf@redhat.com>
880 * path.cc (conv_path_list): Use correct value when calculating length
881 to avoid a potential SEGV.
883 2003-06-03 Pierre Humblet <pierre.humblet@ieee.org>
885 * fhandler_disk_file.cc (fhandler_disk_file::fstat): Mark the pc
886 as non-executable if the file cannot be opened for read. Retry query
887 open only if errno is EACCES. Never change the mode, even if it is 000
888 when query open() fails.
890 2003-06-03 Christopher Faylor <cgf@redhat.com>
892 * configure.in: Allow any i?86 variant.
893 * configure: Regenerate.
895 2003-06-03 Corinna Vinschen <corinna@vinschen.de>
896 Thomas Pfaff <tpfaff@gmx.net>
898 * fhandler_socket.cc (connect_thread): Remove.
899 (accept_thread): Remove.
900 (fhandler_socket::connect): Remove all special blocking handling.
901 (fhandler_socket::accept): Ditto.
902 * net.cc (cygwin_connect): Make blocking sockets temporarily
903 non-blocking and call cygwin_select on them to be interruptible.
904 (cygwin_accept): Ditto.
906 2003-06-02 Christopher Faylor <cgf@redhat.com>
908 * spawn.cc (spawn_guts): Don't hang around if the parent doesn't exist.
910 2003-06-02 Christopher Faylor <cgf@redhat.com>
912 * cygthread.h (cygthread::terminate_thread): Mark private.
913 * cygthread.cc (cygthread::terminate_thread): Deallocate free_range
916 2003-06-02 Corinna Vinschen <corinna@vinschen.de>
918 * fhandler_socket.cc (fhandler_socket::accept): Rename `signalled'
919 to `interrupted' as used in fhandler_socket::connect.
921 2003-06-02 Corinna Vinschen <corinna@vinschen.de>
923 * fhandler_socket.cc (fhandler_socket::connect): Simplify previous
925 (fhandler_socket::accept): Ditto.
927 2003-06-02 Corinna Vinschen <corinna@vinschen.de>
929 * fhandler_socket.cc: Include cygthread.h.
930 (class sock_event): Remove.
931 (thread_connect): New function.
932 (thread_accept): Ditto.
933 (fhandler_socket::connect): Use cygthread instead of socket event
934 handling for blocking sockets.
935 (fhandler_socket::accept): Ditto.
937 2003-06-02 Christopher Faylor <cgf@redhat.com>
939 * fhandler.cc (fhandler_base::write): Correct minor printf formatting
942 2003-06-01 Pierre Humblet <pierre.humblet@ieee.org>
944 * fhandler_disk_file.cc (fhandler_disk_file::fstat_by_name): Assume
945 an existing directory is a root if FindFirstFile fails.
947 2003-05-30 Christopher Faylor <cgf@redhat.com>
949 * path.cc (mount_info::conv_to_win32_path): gcc warning about chroot_ok
950 was actually valid. Fix it.
952 2003-05-30 Christopher Faylor <cgf@redhat.com>
954 * cygheap.cc (init_cheap): Temporarily remove inline that newer gcc's
957 * path.cc (path_conv::check): Rework has_acls logic slightly. Uncouple
958 exec tests away from filesystem tests.
960 2003-05-30 Corinna Vinschen <corinna@vinschen.de>
962 * include/sys/param.h: Add DEV_BSIZE.
964 2003-05-29 Pierre Humblet <pierre.humblet@ieee.org>
965 Corinna Vinschen <corinna@vinschen.de>
967 * fhandler_socket.cc (fhandler_socket::dup): Rearrange. Fix
970 2003-05-28 Christopher Faylor <cgf@redhat.com>
972 * mkvers.sh: Avoid "-dontuse" tags.
974 * path.cc (path_conv::check): Set exec state based on known situations.
976 * path.cc (mount_item::fnmunge): New function.
977 (mount_item::build_win32): New function.
978 (mount_info::conv_to_win32_path): Use build_win32 to build windows
980 * path.h (mount_item::fnmunge): Declare new function.
981 (mount_item::build_win32): Ditto.
982 * sys/mount.h (MOUNT_ENC): Define.
984 2003-05-28 Corinna Vinschen <corinna@vinschen.de>
986 * fhandler_socket.cc (fhandler_socket::dup): If running impersonated,
987 revert to original account before calling fixup_before_fork_exec
988 and impersonate again afterwards. Change comment accordingly.
989 Clean up error handling and debug output.
991 2003-05-27 Thomas Pfaff <tpfaff@gmx.net>
993 * fhandler_socket.cc (sock_event::~sock_event): New method.
994 (sock_event::load): Change to void. Check if winsock2 is available.
995 (socke_event::wait): Return 0 if interruptible mode is not available.
996 (fhandler_socket::connect): Remove checks for winsock2 availability.
997 (fhandler_socket::accept): Ditto.
999 2003-05-27 Corinna Vinschen <corinna@vinschen.de>
1001 * fhandler_socket.cc (fhandler_socket::dup): First try duplicating
1002 using WSADuplicateSocket/WSASocket, if that fails, try DuplicateHandle.
1004 2003-05-27 Bill C. Riemers <cygwin@docbill.net>
1006 * fhandler_disk_file.cc (fhandler_disk_file::fstat_helper): Filter
1007 permissions through umask on FAT or if ntsec is off.
1009 2003-05-26 Pierre Humblet <pierre.humblet@ieee.org>
1011 * syscalls.cc (statfs): Call GetDiskFreeSpaceEx before GetDiskFreeSpace.
1013 2003-05-26 Corinna Vinschen <corinna@vinschen.de>
1015 * fhandler.cc (is_at_eof): Fix conditional. Use INVALID_FILE_SIZE
1016 instead of numeric constant.
1018 2003-05-26 Corinna Vinschen <corinna@vinschen.de>
1020 * fhandler_socket.cc (fhandler_socket::connect): Guard calls to
1021 sock_event methods by a check for WinSock2 availability.
1022 (fhandler_socket::accept): Ditto.
1024 2003-05-26 Corinna Vinschen <corinna@vinschen.de>
1026 * fhandler.h: Rename FH_W95LSBUG flag to FH_LSEEKED.
1027 (fhandler_base::set_did_lseek): Rename from set_check_win95_lseek_bug.
1028 (fhandler_base::get_did_lseek): Rename from get_check_win95_lseek_bug.
1029 (fhandler_base::set_fs_flags): New method.
1030 (fhandler_base::get_fs_flags): Ditto.
1031 * fhandler.cc (fhandler_base::write): Make 64 bit clean. Convert file
1032 to a "sparse" file when writing after a long lseek (>64K) beyond EOF.
1033 (fhandler_base::lseek): Call set_did_lseek() instead of
1034 set_check_win95_lseek_bug().
1035 (fhandler_base::fhandler_base): Initialize fs_flags to 0.
1036 * fhandler_disk_file.cc (fhandler_disk_file::open): Don't create files
1037 as "sparse" unconditionally. Set fs_flags member.
1039 2003-05-25 Pierre Humblet <pierre.humblet@ieee.org>
1041 * autoload.cc (GetDiskFreeSpaceEx): Add.
1042 * syscalls.cc (statfs): Call full_path.root_dir() instead of
1043 rootdir(full_path). Use GetDiskFreeSpaceEx when available and
1044 report space available in addition to free space.
1045 * fhandler_disk_file.cc (fhandler_disk_file::fstat_by_name):
1046 Do not call FindFirstFile for disk root directories.
1048 2003-05-24 Joe Buehler <jhpb@draco.hekimian.com>
1050 * fhandler_process.cc (format_process_stat): Use PagefileUsage
1051 instead of VirtualSize.
1052 (get_mem_values): Ditto.
1054 2003-05-21 Corinna Vinschen <corinna@vinschen.de>
1056 * shared_info.h: Match shared_name declaration with below change.
1057 * shared.cc (shared_name): Use incoming char * parameter instead of
1058 local static buffer.
1059 (open_shared): Accommodate new calling convention for shared_name.
1060 * exceptions.cc (events_init): Ditto.
1061 * sigproc.cc (getsem): Ditto.
1062 * syscalls.cc (login): Ditto.
1066 2003-05-20 Corinna Vinschen <corinna@vinschen.de>
1068 * fhandler_socket.cc (secret_event_name): Return void. Use incoming
1069 char * parameter instead of local static buffer.
1070 (fhandler_socket::create_secret_event): Accommodate new calling
1071 convention for secret_event_name.
1072 (fhandler_socket::close_secret_event): Ditto.
1074 2003-05-20 Corinna Vinschen <corinna@vinschen.de>
1076 * fhandler_socket.cc (SECRET_EVENT_NAME): Remove.
1077 (ENTROPY_SOURCE_NAME): Ditto.
1078 (secret_event_name): New static function. Create shared event name
1079 with "Global\" prefix on systems supporting terminal services.
1080 (fhandler_socket::set_connect_secret): Fix conditional.
1081 (fhandler_socket::create_secret_event): Create secret event using
1082 secret_event_name().
1083 (fhandler_socket::close_secret_event): Ditto.
1084 * shared.cc (shared_name): Create shared object name with "Global\"
1085 prefix on systems supporting terminal services.
1086 * wincap.cc: Set has_terminal_services capability throughout.
1087 (wincap_2003): New global object representing Windows 2003 Server
1089 (wincapc::init): Accommodate Windows 2003 Server.
1090 * wincap.h (struct wincaps): Add has_terminal_services capability.
1092 2003-05-20 Charles Wilson <cygwin@cwilson.fastmail.fm>
1094 * winsup/cygwin/include/cygwin/version.h: Bump API minor version.
1095 * winsup/cygwin/include/cygwin/types.h: Define key_t as long long.
1096 * winsup/cygwin/cygwin.din: Add ftok, _ftok.
1097 * winsup/cygwin/ipc.cc (ftok): Rework implementation.
1099 2003-05-18 Joe Buehler <jhpb@hekimian.com>
1101 * spawn.cc (spawn_guts): Show more of command line in strace output.
1103 2003-05-15 Thomas Pfaff <tpfaff@gmx.net>
1105 * thread.h (pthread::init_mainthread): Remove function parameter.
1106 (MTinterface::Init): Ditto.
1107 * thread.cc (MTinterface::Init): Remove function parameter.
1108 Always initialize reent_key.
1109 (pthread::init_mainthread): Remove function parameter.
1110 (MTinterface::fixup_after_fork): Fix pthread::init_mainthread call.
1111 * dcrt0.cc (dll_crt_0_1) Fix calls to MTinterface::Init and
1112 pthread::init_mainthread.
1113 Call pthread::init_mainthread only when not forked.
1115 2003-05-15 Corinna Vinschen <corinna@vinschen.de>
1117 * fhandler_proc.cc (format_proc_meminfo): Make swap memory output
1120 2003-05-13 Corinna Vinschen <corinna@vinschen.de>
1122 * include/cygwin/config.h: Define __USE_INTERNAL_STAT64 appropriately.
1124 2003-05-12 Corinna Vinschen <corinna@vinschen.de>
1126 * Makefile.in (CYGWIN_START): Define as crt0.o. Add to TARGET_LIBS.
1127 * fhandler.h (fhandler_virtual::fstat): Remove useless declaration.
1128 * fhandler_virtual.cc: Remove _COMPILING_NEWLIB define.
1129 * ipc.cc (ftok): Use stat64.
1130 * syscalls.cc (_fstat64): Remove alias.
1133 (_fstat64_r): New function.
1137 * crt0.o: New file, moved from newlib.
1138 * include/sys/param.h: Ditto.
1139 * include/sys/utime.h: Ditto.
1140 * include/sys/utmp.h: Ditto.
1141 * include/sys/dirent.h: Ditto. Expose different struct dirent,
1142 dependening of the environment.
1144 2003-05-11 Corinna Vinschen <corinna@vinschen.de>
1146 Replace ino_t by __ino64_t throughout.
1148 2003-05-11 Corinna Vinschen <corinna@vinschen.de>
1150 * include/cygwin/types.h: Add key_t typedef.
1152 2003-05-10 Christopher Faylor <cgf@redhat.com>
1154 * dir.cc (readdir): Fill out new old_d_ino field.
1155 * fhandler.h (fhandler_base::namehash): Define as ino_t.
1156 (fhandler_base::get_namehash): Ditto.
1157 * fhandler_disk_file.cc (fhandler_disk_file::fstat_helper): Accommodate
1159 * fhandler_socket.cc (fhandler_socket::fstat): Ditto.
1160 * path.cc (hash_path_name): Return ino_t.
1161 * syscalls.cc (stat64_to_stat32): Convert 64 bit inode to 32 bit.
1162 * winsup.h (hash_path_name): Declare as returning ino_t.
1163 * include/cygwin/stat.h (__stat32): Use 32 bit st_ino.
1164 (__stat64): Use 64 bit st_ino.
1165 * include/cygwin/types.h (__ino64_t): Define.
1167 (ino_t): Define appropriately.
1169 2003-05-10 Corinna Vinschen <corinna@vinschen.de>
1171 * Makefile.in (NEW_FUNCTIONS): All 32/64 from 0.79 API get
1173 * cygwin.din: Ditto.
1174 * include/cygwin/version.h: Bump API minor number.
1176 2003-05-09 Corinna Vinschen <corinna@vinschen.de>
1178 * include/cygwin/config.h: New file.
1180 2003-05-09 Christopher Faylor <cgf@redhat.com>
1182 * cygthread.cc (cygthread::detach): Prioritize waiting for I/O
1183 completion over waiting for signal delivery.
1185 2003-05-06 Thomas Pfaff <tpfaff@gmx.net>
1187 * signal.cc (nanosleep): Do not wait twice for signal arrival.
1189 2003-05-03 Corinna Vinschen <corinna@vinschen.de>
1191 * include/cygwin/types.h: Fix erroneous definition of ino_t from
1194 2003-05-03 Corinna Vinschen <corinna@vinschen.de>
1196 * syscalls.cc (chown_worker): Allow chown'ing of socket files.
1198 2003-04-30 Thomas Pfaff <tpfaff@gmx.net>
1200 * Makefile.in: Revert patch from 2003-04-17.
1202 2003-04-28 Brian Ford <ford@vss.fsi.com>
1204 * profil.h (PROFADDR): Prevent overflow when text segments are larger
1206 * profil.c (profthr_func): Raise thread priority for more accurate
1209 2003-04-26 Christopher Faylor <cgf@redhat.com>
1211 * path.cc (hash_path_name): Use ino_t as type.
1213 2003-04-26 Christopher Faylor <cgf@redhat.com>
1215 * errno.cc (_sys_nerr): Fix compile error erroneously checked in on
1218 2003-04-25 Corinna Vinschen <corinna@vinschen.de>
1220 * include/netinet/ip.h: Include netinet/in_systm.h and netinet/in.h
1221 to allow standalone usage (autoconf).
1223 2003-04-23 Christopher Faylor <cgf@redhat.com>
1225 * fork.cc: Change SLOW_PID_REUSE to NO_SLOW_PID_REUSE and invert ifdef
1228 2003-04-22 Christopher Faylor <cgf@redhat.com>
1230 * select.cc (fhandler_pipe::ready_for_read): Assure that get_guard is
1231 called for successful non-blocking pipe reads.
1233 2003-04-22 Corinna Vinschen <corinna@vinschen.de>
1235 * include/inttypes.h: New file.
1236 * include/stdint.h: New file.
1237 * include/cygwin/in.h: Include stdint.h instead of sys/types.h.
1238 * include/cygwin/types.h: Include stdint.h. Remove typedefs for
1239 intN_t and uintN_t since these are defined in stdint.h now.
1241 2003-04-21 Christopher Faylor <cgf@redhat.com>
1243 * include/cygwin/version.h: Bump DLL major number to 1005. Change DLL
1244 minor number to 0. Bump API minor number.
1246 2003-04-20 Corinna Vinschen <corinna@vinschen.de>
1248 * autoload.cc (CreateWindowStationA): Add.
1249 (SetProcessWindowStation): Add.
1251 2003-04-19 Christopher Faylor <cgf@redhat.com>
1253 * wincap.h (wincaps:pty_needs_alloc_console): New element.
1254 (wincapc:pty_needs_alloc_console): New function.
1255 * wincap.cc: Add pty_needs_alloc_console throughout.
1256 * fhandler_tty.cc (fhandler_tty_slave::open): Open an "invisible"
1257 console on first pty allocation.
1259 2003-04-18 Christopher Faylor <cgf@redhat.com>
1261 * fhandler_tty.cc (fhandler_tty_slave::open): Allocate a console
1262 whenever a pty is allocated.
1264 2003-04-18 Christopher Faylor <cgf@redhat.com>
1266 * Makefile.in: Use ${nostdlib} variable.
1268 2003-04-18 Diego Biurrun <diego@biurrun.de>
1270 * fhandler_proc.cc (format_proc_cpuinfo): Change /proc/cpuinfo "vendor
1271 id" string to "vendor_id" to conform with Linux systems.
1273 2003-04-17 Christopher Faylor <cgf@redhat.com>
1275 * syscalls.cc (setsid): Don't call FreeConsole if ctty is already < 0.
1277 2003-04-17 Thomas Pfaff <tpfaff@gmx.net>
1279 * Makefile.in: Add finline-functions optimization to CXXFLAGS.
1280 * autoload.cc (LoadDLLprime): Rename std_dll_init to
1282 (std_dll_init): Remove name mangling prototype. Add attributes
1284 (wsock_init): Ditto.
1285 Change wsock_init to _wsock_init in wsock32 and ws2_32
1287 * exceptions.cc (unused_sig_wrapper): Remove prototype. Add
1288 attributes used and noinline.
1289 * pwdgrp.h ((pwdgrp (passwd *&)): Remove inline code.
1290 (pwdgrp (__group32 *&)): Ditto.
1291 * grp.cc (pwdgrp (passwd *&)): Outline constructor.
1292 (pwdgrp (__group32 *&)): Ditto.
1294 2003-04-17 Thomas Pfaff <tpfaff@gmx.net>
1296 * thread.h (pthread::equal): New static method.
1297 * thread.cc: Rename pthread_equal to pthread::equal throughout.
1298 (pthread_equal): Use pthread::equal to compare threads ids.
1300 2003-04-15 Christopher Faylor <cgf@redhat.com>
1302 * termios.cc (setspeed): New function.
1303 (cfsetospeed): Use setspeed to set speed.
1304 (cfsetispeed): Use setspeed to set speed.
1306 2003-04-15 Chris January <chris@atomice.net>
1308 * autoload.cc: Add load statement for UuidCreate, and
1309 UuidCreateSequential.
1310 * cpuid.h: New file.
1311 * cygwin.din: Export gethostid.
1312 * fhandler_proc.cc (cpuid): Move to cpuid.h.
1313 (can_set_flag): Move to cpuid.h.
1314 * syscalls.cc (gethostid): New function.
1315 * version.h: Bump api minor version number to 83.
1317 2003-04-15 Thomas Pfaff <tpfaff@gmx.net>
1319 * thread.h (pthread_rwlock::release): New method.
1320 * thread.cc (pthread_rwlock::unlock): Use release to signal waiting
1322 (pthread_rwlock::rdlock_cleanup): Signal waiting threads after a
1324 (pthread_rwlock::wrlock_cleanup): Ditto.
1326 2003-04-13 Pierre Humblet <pierre.humblet@ieee.org>
1328 * mkvers.sh: Prefix day with 0 in date only when day < 10.
1330 2003-04-11 Pierre Humblet <pierre.humblet@ieee.org>
1332 * security.cc (get_info_from_sd): New function.
1333 (get_nt_attribute): Only call read_sd and get_info_from_sd.
1335 (get_file_attribute): Move sd error handling to get_info_from_sd.
1336 and symlink handling to fhandler_disk_file::fstat_helper.
1337 (get_nt_object_attribute): Only call read_sd and get_info_from_sd.
1339 (get_object_attribute): Remove symlink handling and simply return -1
1341 * fhandler_disk_file.cc (fhandler_disk_file::fstat_helper): For
1342 symlinks set the attribute, call get_file_attribute to get the ids
1343 and return. In the normal case call get_file_attribute with the
1344 addresses of the buffer ids and do not recheck if the file is a socket.
1346 2003-04-10 Christopher Faylor <cgf@redhat.com>
1348 * cygthread.cc (cygthread::stub): Initialize stack pointer earlier.
1349 (cygthread::simplestub): Initialize stack pointer.
1350 (cygthread::terminate_thread): Account for possibility that stack
1351 pointer has not been set. Issue warnings for unusual conditions.
1353 2003-04-10 Corinna Vinschen <corinna@vinschen.de>
1355 * regex/regex.h: Define regoff_t as _off_t.
1356 * regex/regex2.h: Ditto.
1358 2003-04-10 Corinna Vinschen <corinna@vinschen.de>
1360 * cygwin.din: Export wcscoll, wcswidth and wcwidth.
1361 * include/cygwin/version.h: Bump API minor number.
1363 2003-04-10 Christopher Faylor <cgf@redhat.com>
1365 * cygthread.h: Change 'avail' cygthread element to 'inuse' throughout.
1366 * cygthread.cc: Ditto.
1367 (cygthread::stub): Don't initialize already initialized events.
1368 (cygthread::freerange): Don't create thread here.
1369 (cygthread::cygthread): Create thread here. Die if thread not created.
1370 (cygthread::operator new): Simplify. Just grab a thread structure from
1371 the pool. Don't try to start the thread.
1372 (cygthread::terminate_thread): Don't close event handles. Just reuse
1373 them. Call MEM_RELEASE rather than MEM_DECOMMIT (from Joe uehler).
1375 2003-04-08 Bob Cassels <bcassels@abinitio.com>
1377 * fhandler_console.cc (fhandler_console::read) Handle certain key up
1378 events, to allow pasting accented characters and typing them using the
1379 "alt + numerics" sequences.
1381 2003-04-07 Christopher Faylor <cgf@redhat.com>
1383 * include/limits.h (IOV_MAX): Set to a number which is small enough to
1386 2003-04-04 Christopher Faylor <cgf@redhat.com>
1388 * cygthread.h (cygthread::avail): Make LONG for easier use with
1389 Interlocked* functions.
1390 * cygthread.cc (cygthread::init): Eliminate unneeded muto.
1391 (cygthread::operator new): Don't lock. Instead change use of avail
1392 variable into tri-state: available (1), not available (-1),
1394 (cygthread::terminate_thread): Set avail to uninitialized.
1395 (cygthread::detach): Eliminate local 'avail'. Always set avail to 1
1398 2003-04-04 Christopher Faylor <cgf@redhat.com>
1400 * cygthread.cc (cygthread::operator new): Be more defensive when messing with
1401 threads that are marked "unavailable".
1403 2003-04-03 Christopher Faylor <cgf@redhat.com>
1405 * fhandler_console.cc (CONVERT_LIMIT): Use a size for the 21st century.
1407 2003-04-03 Corinna Vinschen <corinna@vinschen.de>
1409 * external.cc (check_ntsec): Return general ntsec state on NULL
1410 filename. Check wincap.is_security() additionally.
1412 2003-04-02 Christopher Faylor <cgf@redhat.com>
1414 * Makefile.in (EXTRA_OFILES): Remove debugging object.
1416 2003-04-02 Jason Tishler <jason@tishler.net>
1417 Christopher Faylor <cgf@redhat.com>
1419 * external.cc (check_ntsec): New function.
1420 (cygwin_internal): Add CW_CHECK_NTSEC handling to call check_ntsec()
1422 * include/cygwin/version.h: Bump API minor number.
1423 * include/sys/cygwin.h (cygwin_getinfo_types): Add CW_CHECK_NTSEC.
1425 2003-04-02 Christopher Faylor <cgf@redhat.com>
1427 * cygthread.cc (cygthread::new): Add more defensive debugging.
1429 2003-04-01 Pierre Humblet <pierre.humblet@ieee.org>
1431 * fhandler.cc (fhandler_base::fstat): Set the uid and gid fields
1432 from the current effective ids.
1433 * fhandler_socket.cc (fhandler_socket::fstat): Keep the uid and gid set
1434 by fhandler_base::fstat.
1435 * security.cc (get_nt_attribute): Do not test wincap.has_security ().
1436 (get_nt_object_attribute): Ditto.
1437 (get_file_attribute): Add test for wincap.has_security ().
1438 (get_object_attribute): Ditto.
1440 2003-04-01 Corinna Vinschen <corinna@vinschen.de>
1442 * dir.cc: Change __off32_t to _off_t and __off64_t to _off64_t
1444 * fhandler.cc: Ditto.
1445 * fhandler.h: Ditto.
1446 * fhandler_clipboard.cc: Ditto.
1447 * fhandler_disk_file.cc: Ditto.
1448 * fhandler_dsp.cc: Ditto.
1449 * fhandler_floppy.cc: Ditto.
1450 * fhandler_mem.cc: Ditto.
1451 * fhandler_proc.cc: Ditto.
1452 * fhandler_process.cc: Ditto.
1453 * fhandler_random.cc: Ditto.
1454 * fhandler_registry.cc: Ditto.
1455 * fhandler_tape.cc: Ditto.
1456 * fhandler_termios.cc: Ditto.
1457 * fhandler_virtual.cc: Ditto.
1458 * fhandler_zero.cc: Ditto.
1461 * syscalls.cc: Ditto.
1463 * include/cygwin/stat.h: Ditto.
1464 * include/cygwin/types.h: Ditto. Remove definition of __off32_t
1467 2003-03-31 Christopher Faylor <cgf@redhat.com>
1469 * exceptions.cc (setup_handler): Make sure winapi lock is released when
1472 2003-03-30 Christopher Faylor <cgf@redhat.com>
1474 * include/cygwin/fs.h: Remove unneeded include.
1475 * include/cygwin/in.h: Include sys/types.h rather than cygwin/types.h.
1477 2003-03-29 Corinna Vinschen <corinna@vinschen.de>
1479 * syscalls.cc (login): Fix comment.
1482 2003-03-29 Corinna Vinschen <corinna@vinschen.de>
1484 * syscalls.cc: Slightly cleanup all utmp functions.
1485 (login): Use mutex to secure against concurrent access to wtmp file.
1486 (logout): Rewrite using POSIX calls.
1487 (utmp_fd): Initialized to -1 now. Any value < 0 is treated as closed
1488 in subsequent functions.
1489 (utmp_readonly): New variable, indicating utmp file open for reading
1491 (internal_setutent): New function implementing setutent().
1492 (setutent): Call internal_setutent now.
1493 (endutent): Reset utmp_readonly.
1494 (getutent): Return immediately if utmp file can't be opened.
1497 (pututline): Ditto. Use mutex to secure against concurrent access to
1500 2003-03-28 Christopher Faylor <cgf@redhat.com>
1502 * Makefile.in: Remove EXE_LDFLAGS. Fix fhandler_CFLAGS typo. Recognize .s suffix.
1503 * configure.in: Remove EXE_LDFLAGS.
1504 * configure: Regenerate.
1506 2003-03-28 Christopher Faylor <cgf@redhat.com>
1508 * include/sys/cygwin.h: Declare cygwin_internal as unsigned long.
1509 * external.cc (cygwin_internal): Define as unsigned long.
1511 2003-03-27 Christopher Faylor <cgf@redhat.com>
1513 * include/sys/cygwin.h: Move cygwin_internal outside of WINVER
1516 2003-03-27 Thomas Pfaff <tpfaff@gmx.net>
1518 * thread.cc: Change 1==foo equations to foo==1 throughout.
1520 2003-03-27 Thomas Pfaff <tpfaff@gmx.net>
1522 * thread.h: Change class names, methods, members and local vars
1523 according to the GNU coding style.
1525 * dcrt0.cc (dll_crt0_1): Rename pthread::initMainThread call to
1526 pthread::init_mainthread.
1527 * pthread.cc (pthead_getsequence_np): Rename pthread::isGoodObject
1528 call to pthread::is_good_object.
1530 2003-03-27 Joe Buehler <jhpb@draco.hekimian.com>
1532 * autoload.cc: Add RegGetKeySecurity().
1533 * security.cc (get_nt_object_attribute): Use RegGetKeySecurity() for
1536 2003-03-25 Christopher Faylor <cgf@redhat.com>
1537 Joe Buehler <jhpb@draco.hekimian.com>
1539 * fork.cc (fork_parent): Don't copy signals from parent to child here.
1540 * sigproc.cc (proc_subproc): Copy signals from parent to child pinfo
1543 2003-03-23 Thomas Pfaff <tpfaff@gmx.net>
1545 * thread.h (class List): Move inline code inside class declaration.
1546 (List::forEach): Change callback parameter to template class member
1548 (pthread_keys::fixup_before_fork): Change to inline. Use List::forEach
1550 (pthread_keys::fixup_after_fork): Ditto.
1551 (pthread_keys::runAllDestructors): Ditto.
1552 (pthread_key::saveAKey): Remove.
1553 (pthread_key::restoreAKey): Ditto.
1554 (pthread_key::destroyAKey): Ditto.
1555 (pthread_key::run_destructor): Rename to runDestructor.
1556 (pthread_mutex::fixup_after_fork): Change to inline. Use List::forEach
1557 to fixup mutexes after a fork.
1558 (pthread_mutex::FixupAfterFork): New method.
1559 (pthread_mutex::mutexes): New member.
1560 (pthread_cond::fixup_after_fork): Change to inline. Use List::forEach
1561 to fixup conds after a fork.
1562 (pthread_cond::FixupAfterFork): New method.
1563 (pthread_cond::conds): New member.
1564 (pthread_rwlock::fixup_after_fork): Change to inline. Use
1565 List::forEach to fixup rwlocks after a fork.
1566 (pthread_rwlock::FixupAfterFork): New method.
1567 (pthread_rwlock::rwlocks): New member.
1568 (semaphore::fixup_after_fork): Change to inline. Use List::forEach to
1569 fixup mutexes after a fork.
1570 (semaphore::FixupAfterFork): New method.
1571 (semaphore::semaphores): New member.
1572 (MTinterface::mutexs): Remove.
1573 (MTinterface::conds): Ditto.
1574 (MTinterface::rwlocks): Ditto.
1575 (MTinterface::semaphores): Ditto.
1576 (pthread_equal): Add extern "C".
1577 (pthread_mutex_lock): Ditto.
1579 * thread.cc (MTinterface::fixup_after_fork): Change fixup_after_fork
1580 calls for pthread objects.
1581 (semaphore::conds): Instantiate.
1582 (pthread_cond::pthread_cond): Use List::Insert rather than custom list
1584 (pthread_cond::~pthread_cond): Use List::Remove rather than custom list
1586 (pthread_cond::fixup_after_fork): Rename to FixupAfterFork.
1587 (pthread_rwlock::rwlocks): Instantiate.
1588 (pthread_rwlock::pthread_crwlock): Use List::Insert rather than custom
1590 (pthread_rwlock::~pthread_rwlock): Use List::Remove rather than custom
1592 (pthread_rwlock::fixup_after_fork): Rename to FixupAfterFork.
1593 (pthread_key::saveAKey): Remove.
1594 (pthread_key::fixup_before_fork): Ditto.
1595 (pthread_key::restoreAKey): Ditto.
1596 (pthread_key::fixup_after_fork): Ditto.
1597 (pthread_key::destroyAKey): Ditto.
1598 (pthread_key::runAllDestructors): Ditto.
1599 (pthread_key::run_destructor): Rename to runDestructor.
1600 (pthread_mutex::mutexes): Instantiate.
1601 (pthread_mutex::pthread_mutex): Use List::Insert rather than custom
1603 (pthread_mutex::~pthread_mutex): Use List::Remove rather than custom
1605 (pthread_mutex::fixup_after_fork): Rename to FixupAfterFork.
1606 (semaphore::conds): Instantiate.
1607 (semaphore::semaphore): Use List::Insert rather than custom list code.
1608 (semaphores::~semaphore): Use List::Remove rather than custom list
1610 (semaphore::fixup_after_fork): Rename to FixupAfterFork.
1612 2003-03-22 Christopher Faylor <cgf@redhat.com>
1614 * pipe.cc (fhandler_pipe::dup): Don't dup input_handle if it doesn't
1617 2003-03-22 Christopher Faylor <cgf@redhat.com>
1619 * syscalls.cc (unlink): Be more defensive when SetFileAttributes is
1620 called. Fix typo in debugging output.
1622 2003-03-21 Christopher Faylor <cgf@redhat.com>
1624 * fork.cc: Conditionalize use of slow_pid_reuse throughout. It's not
1625 necessary for newer versions of bash.
1627 2003-03-20 Corinna Vinschen <corinna@vinschen.de>
1629 * fhandler_socket.cc (fhandler_socket::sendto): Restrict EPIPE and
1630 SIGPIPE handling to connection oriented sockets. Add comment.
1632 2003-03-19 Christopher Faylor <cgf@redhat.com>
1634 * sigproc.h (signal_fixup_after_exec): Eliminate argument in declaration.
1635 * exceptions.cc (signal_fixup_after_exec): Eliminate argument in
1636 definition. Don't reset signal handlers after spawm. Just treat like
1638 * dcrt0.cc (dll_crt0_1): Don't pass PROC_SPAWN argument to
1639 signal_fixup_after_exec.
1640 * syscalls.cc (unlink): Don't change attributes of file if not readonly/system.
1641 Ditto for resetting of arguments.
1643 2003-03-19 Corinna Vinschen <corinna@vinschen.de>
1645 * glob.c: Eliminate __INSIDE_CYGWIN__ preprocessor conditionals
1648 2003-03-19 Corinna Vinschen <corinna@vinschen.de>
1650 * fhandler_disk_file.cc (fhandler_disk_file::fstat_helper): Fix
1651 wrong usage of S_IFDIR.
1652 * security.cc (get_attribute_from_acl): Ditto.
1653 (get_file_attribute): Fix wrong usage of S_IFLNK.
1654 (get_object_attribute): Ditto.
1655 (alloc_sd): Fix wrong usage of S_IFDIR.
1656 * syscalls.cc (chmod): Allow chmod'ing of socket files.
1658 2003-03-19 Corinna Vinschen <corinna@vinschen.de>
1660 * include/cygwin/version.h (CYGWIN_VERSION_CHECK_FOR_USING_BIG_TYPES):
1662 * glob.c (g_lstat): Use CYGWIN_VERSION_CHECK_FOR_USING_BIG_TYPES
1663 instead of numerical constants.
1666 2003-03-18 Thomas Pfaff <tpfaff@gmx.net>
1668 * pthread.cc (pthread_attr_init): Remove
1669 (pthread_attr_destroy): Ditto.
1670 (pthread_attr_setdetachstate): Ditto.
1671 (pthread_attr_getdetachstate): Ditto.
1672 (pthread_attr_setstacksize): Ditto.
1673 (pthread_attr_getstacksize): Ditto.
1674 (pthread_attr_setinheritsched): Ditto.
1675 (pthread_attr_getinheritsched): Ditto.
1676 (pthread_attr_setschedparam): Ditto.
1677 (pthread_attr_getschedparam): Ditto.
1678 (pthread_attr_setschedpolicy): Ditto.
1679 (pthread_attr_getschedpolicy): Ditto.
1680 (pthread_attr_setscope): Ditto.
1681 (pthread_attr_getscope): Ditto.
1682 (pthread_attr_setstackaddr): Ditto.
1683 (pthread_attr_getstackaddr): Ditto.
1684 (pthread_key_create): Ditto.
1685 (pthread_key_delete): Ditto.
1686 (pthread_setspecific): Ditto.
1687 (pthread_getspecific): Ditto.
1688 (pthread_kill): Ditto.
1689 (pthread_sigmask): Ditto.
1690 (pthread_equal): Ditto.
1691 (pthread_mutex_lock): Ditto.
1692 (pthread_mutex_trylock): Ditto.
1693 (pthread_mutex_unlock): Ditto.
1694 (pthread_mutex_destroy): Ditto.
1695 (pthread_mutex_setprioceiling): Ditto.
1696 (pthread_mutex_getprioceiling): Ditto.
1697 (pthread_mutexattr_destroy): Ditto.
1698 (pthread_mutexattr_getprioceiling): Ditto.
1699 (pthread_mutexattr_getprotocol): Ditto.
1700 (pthread_mutexattr_getpshared): Ditto.
1701 (pthread_mutexattr_gettype): Ditto.
1702 (pthread_mutexattr_init): Ditto.
1703 (pthread_mutexattr_setprioceiling): Ditto.
1704 (pthread_mutexattr_setprotocol): Ditto.
1705 (pthread_mutexattr_setpshared): Ditto.
1706 (pthread_mutexattr_settype): Ditto.
1707 (pthread_cond_destroy): Ditto.
1708 (pthread_cond_signal): Ditto.
1709 (pthread_cond_broadcast): Ditto.
1710 (pthread_condattr_init): Ditto.
1711 (pthread_condattr_destroy): Ditto.
1712 (pthread_condattr_getpshared): Ditto.
1713 (pthread_condattr_setpshared): Ditto.
1714 (pthread_rwlock_destroy): Ditto.
1715 (pthread_rwlock_rdlock): Ditto.
1716 (pthread_rwlock_tryrdlock): Ditto.
1717 (pthread_rwlock_wrlock): Ditto.
1718 (pthread_rwlock_trywrlock): Ditto.
1719 (pthread_rwlock_unlock): Ditto.
1720 (pthread_rwlockattr_init): Ditto.
1721 (pthread_rwlockattr_getpshared): Ditto.
1722 (pthread_rwlockattr_setpshared): Ditto.
1723 (pthread_rwlockattr_destroy): Ditto.
1724 (pthread_getconcurrency): Ditto.
1725 (pthread_setconcurrency): Ditto.
1726 (pthread_getschedparam): Ditto.
1727 (pthread_setschedparam): Ditto.
1729 * thread.h (__pthread_attr_init): Remove prototype.
1730 (__pthread_attr_destroy): Ditto.
1731 (__pthread_attr_setdetachstate): Ditto.
1732 (__pthread_attr_getdetachstate): Ditto.
1733 (__pthread_attr_setstacksize): Ditto.
1734 (__pthread_attr_getstacksize): Ditto.
1735 (__pthread_attr_setinheritsched): Ditto.
1736 (__pthread_attr_getinheritsched): Ditto.
1737 (__pthread_attr_setschedparam): Ditto.
1738 (__pthread_attr_getschedparam): Ditto.
1739 (__pthread_attr_setschedpolicy): Ditto.
1740 (__pthread_attr_getschedpolicy): Ditto.
1741 (__pthread_attr_setscope): Ditto.
1742 (__pthread_attr_getscope): Ditto.
1743 (__pthread_attr_setstackaddr): Ditto.
1744 (__pthread_attr_getstackaddr): Ditto.
1745 (__pthread_key_create): Ditto.
1746 (__pthread_key_delete): Ditto.
1747 (__pthread_setspecific): Ditto.
1748 (__pthread_getspecific): Ditto.
1749 (__pthread_kill): Ditto.
1750 (__pthread_sigmask): Ditto.
1751 (__pthread_equal): Ditto.
1752 (__pthread_mutex_lock): Ditto.
1753 (__pthread_mutex_trylock): Ditto.
1754 (__pthread_mutex_unlock): Ditto.
1755 (__pthread_mutex_destroy): Ditto.
1756 (__pthread_mutex_setprioceiling): Ditto.
1757 (__pthread_mutex_getprioceiling): Ditto.
1758 (__pthread_mutexattr_destroy): Ditto.
1759 (__pthread_mutexattr_getprioceiling): Ditto.
1760 (__pthread_mutexattr_getprotocol): Ditto.
1761 (__pthread_mutexattr_getpshared): Ditto.
1762 (__pthread_mutexattr_gettype): Ditto.
1763 (__pthread_mutexattr_init): Ditto.
1764 (__pthread_mutexattr_setprioceiling): Ditto.
1765 (__pthread_mutexattr_setprotocol): Ditto.
1766 (__pthread_mutexattr_setpshared): Ditto.
1767 (__pthread_mutexattr_settype): Ditto.
1768 (__pthread_cond_destroy): Ditto.
1769 (__pthread_cond_signal): Ditto.
1770 (__pthread_cond_broadcast): Ditto.
1771 (__pthread_condattr_init): Ditto.
1772 (__pthread_condattr_destroy): Ditto.
1773 (__pthread_condattr_getpshared): Ditto.
1774 (__pthread_condattr_setpshared): Ditto.
1775 (__pthread_rwlock_destroy): Ditto.
1776 (__pthread_rwlock_rdlock): Ditto.
1777 (__pthread_rwlock_tryrdlock): Ditto.
1778 (__pthread_rwlock_wrlock): Ditto.
1779 (__pthread_rwlock_trywrlock): Ditto.
1780 (__pthread_rwlock_unlock): Ditto.
1781 (__pthread_rwlockattr_init): Ditto.
1782 (__pthread_rwlockattr_getpshared): Ditto.
1783 (__pthread_rwlockattr_setpshared): Ditto.
1784 (__pthread_rwlockattr_destroy): Ditto.
1785 (__pthread_getconcurrency): Ditto.
1786 (__pthread_setconcurrency): Ditto.
1787 (__pthread_getschedparam): Ditto.
1788 (__pthread_setschedparam): Ditto.
1790 * thread.cc: Rename __pthread_equal to pthread_equal throughout.
1791 Change pthread_self parameter appropriate.
1792 (__pthread_attr_init): Remove __ prefix. Change to extern "C".
1793 (__pthread_attr_destroy): Ditto.
1794 (__pthread_attr_setdetachstate): Ditto.
1795 (__pthread_attr_getdetachstate): Ditto.
1796 (__pthread_attr_setstacksize): Ditto.
1797 (__pthread_attr_getstacksize): Ditto.
1798 (__pthread_attr_setinheritsched): Ditto.
1799 (__pthread_attr_getinheritsched): Ditto.
1800 (__pthread_attr_setschedparam): Ditto.
1801 (__pthread_attr_getschedparam): Ditto.
1802 (__pthread_attr_setschedpolicy): Ditto.
1803 (__pthread_attr_getschedpolicy): Ditto.
1804 (__pthread_attr_setscope): Ditto.
1805 (__pthread_attr_getscope): Ditto.
1806 (__pthread_attr_setstackaddr): Ditto.
1807 (__pthread_attr_getstackaddr): Ditto.
1808 (__pthread_key_create): Ditto.
1809 (__pthread_key_delete): Ditto.
1810 (__pthread_setspecific): Ditto.
1811 (__pthread_getspecific): Ditto.
1812 (__pthread_kill): Ditto.
1813 (__pthread_sigmask): Ditto.
1814 (__pthread_equal): Ditto.
1815 (__pthread_mutex_lock): Ditto.
1816 (__pthread_mutex_trylock): Ditto.
1817 (__pthread_mutex_unlock): Ditto.
1818 (__pthread_mutex_destroy): Ditto.
1819 (__pthread_mutex_setprioceiling): Ditto.
1820 (__pthread_mutex_getprioceiling): Ditto.
1821 (__pthread_mutexattr_destroy): Ditto.
1822 (__pthread_mutexattr_getprioceiling): Ditto.
1823 (__pthread_mutexattr_getprotocol): Ditto.
1824 (__pthread_mutexattr_getpshared): Ditto.
1825 (__pthread_mutexattr_gettype): Ditto.
1826 (__pthread_mutexattr_init): Ditto.
1827 (__pthread_mutexattr_setprioceiling): Ditto.
1828 (__pthread_mutexattr_setprotocol): Ditto.
1829 (__pthread_mutexattr_setpshared): Ditto.
1830 (__pthread_mutexattr_settype): Ditto.
1831 (__pthread_cond_destroy): Ditto.
1832 (__pthread_cond_signal): Ditto.
1833 (__pthread_cond_broadcast): Ditto.
1834 (__pthread_condattr_init): Ditto.
1835 (__pthread_condattr_destroy): Ditto.
1836 (__pthread_condattr_getpshared): Ditto.
1837 (__pthread_condattr_setpshared): Ditto.
1838 (__pthread_rwlock_destroy): Ditto.
1839 (__pthread_rwlock_rdlock): Ditto.
1840 (__pthread_rwlock_tryrdlock): Ditto.
1841 (__pthread_rwlock_wrlock): Ditto.
1842 (__pthread_rwlock_trywrlock): Ditto.
1843 (__pthread_rwlock_unlock): Ditto.
1844 (__pthread_rwlockattr_init): Ditto.
1845 (__pthread_rwlockattr_getpshared): Ditto.
1846 (__pthread_rwlockattr_setpshared): Ditto.
1847 (__pthread_rwlockattr_destroy): Ditto.
1848 (__pthread_getconcurrency): Ditto.
1849 (__pthread_setconcurrency): Ditto.
1850 (__pthread_getschedparam): Ditto.
1851 (__pthread_setschedparam): Ditto.
1853 2003-03-18 Thomas Pfaff <tpfaff@gmx.net>
1855 * cygwin.din: Add pthread_rwlock_destroy, pthread_rwlock_init,
1856 pthread_rwlock_rdlock, pthread_rwlock_tryrdlock,
1857 pthread_rwlock_wrlock, pthread_rwlock_trywrlock,
1858 pthread_rwlock_unlock, pthread_rwlockattr_init,
1859 pthread_rwlockattr_getpshared, pthread_rwlockattr_setpshared,
1860 and pthread_rwlockattr_destroy.
1861 * include/cygwin/version.h: Bump API minor number.
1862 * include/pthread.h (PTHREAD_RWLOCK_INITIALIZER): Define a
1864 Add prototypes for pthread_rwlock_destroy, pthread_rwlock_init,
1865 pthread_rwlock_rdlock, pthread_rwlock_tryrdlock,
1866 pthread_rwlock_wrlock, pthread_rwlock_trywrlock,
1867 pthread_rwlock_unlock, pthread_rwlockattr_init,
1868 pthread_rwlockattr_getpshared, pthread_rwlockattr_setpshared,
1869 and pthread_rwlockattr_destroy.
1870 * thread.h (PTHREAD_ONCE_MAGIC): Remove superflous semicolon.
1871 (PTHREAD_RWLOCK_MAGIC): New define.
1872 (PTHREAD_RWLOCKATTR_MAGIC): Ditto.
1873 (pthread_rwlockattr): New class.
1874 (pthread_rwlock): Ditto.
1875 (MTinterface::rwlocks): New member.
1876 (MTinterface::MTinterface): Initialize rwlocks.
1877 Add prototypes for __pthread_rwlock_destroy,
1878 __pthread_rwlock_wrlock, __pthread_rwlock_trywrlock,
1879 __pthread_rwlock_unlock, __pthread_rwlockattr_init,
1880 __pthread_rwlockattr_getpshared, __pthread_rwlockattr_setpshared,
1881 and __pthread_rwlockattr_destroy.
1882 * thread.cc (MTinterface::Init): Initialize rwlock internal mutex.
1883 (MTinterface::fixup_after_fork): Fixup rwlocks after fork.
1884 (pthread_rwlockattr::isGoodObject): Implement.
1885 (pthread_rwlockattr::pthread_rwlockattr): Ditto.
1886 (pthread_rwlockattr::~pthread_rwlockattr): Ditto.
1887 (pthread_rwlock::initMutex): Ditto.
1888 (pthread_rwlock::pthread_rwlock): Ditto.
1889 (pthread_rwlock::~pthread_rwlock): Ditto.
1890 (pthread_rwlock::RdLock): Ditto.
1891 (pthread_rwlock::TryRdLock): Ditto.
1892 (pthread_rwlock::WrLock): Ditto.
1893 (pthread_rwlock::TryWrLock): Ditto.
1894 (pthread_rwlock::UnLock): Ditto.
1895 (pthread_rwlock::addReader): Ditto.
1896 (pthread_rwlock::removeReader): Ditto.
1897 (pthread_rwlock::lookupReader): Ditto.
1898 (pthread_rwlock::RdLockCleanup): Ditto.
1899 (pthread_rwlock::WrLockCleanup): Ditto.
1900 (pthread_rwlock::fixup_after_fork): Ditto.
1901 (pthread_rwlock::isGoodObject): Ditto.
1902 (pthread_rwlock::isGoodInitializer): Ditto.
1903 (pthread_rwlock::isGoodInitializerOrObject): Ditto.
1904 (pthread_rwlock::isGoodInitializerOrBadObject): Ditto.
1905 (__pthread_rwlock_destroy): Ditto.
1906 (pthread_rwlock::init): Ditto.
1907 (__pthread_rwlock_rdlock): Ditto.
1908 (__pthread_rwlock_tryrdlock): Ditto.
1909 (__pthread_rwlock_wrlock): Ditto.
1910 (__pthread_rwlock_trywrlock): Ditto.
1912 2003-03-18 Thomas Pfaff <tpfaff@gmx.net>
1914 * thread.h (pthread_cond::ExitingWait): Remove.
1915 (pthread_cond::mutex): Ditto.
1916 (pthread_cond::cond_access): Ditto.
1917 (pthread_cond::win32_obj_id): Ditto.
1918 (pthread_cond::TimedWait): Ditto.
1919 (pthread_cond::BroadCast): Ditto.
1920 (pthread_cond::Signal): Ditto.
1921 (pthread_cond::waiting): Change type to unsigned long.
1922 (pthread_cond::pending): New member.
1923 (pthread_cond::semWait): Ditto.
1924 (pthread_cond::mtxIn): Ditto.
1925 (pthread_cond::mtxOut): Ditto.
1926 (pthread_cond::mtxCond): Ditto.
1927 (pthread_cond::UnBlock): New method.
1928 (pthread_cond::Wait): Ditto.
1929 * thread.cc: Update list of cancellation points.
1930 (pthread_cond::pthread_cond): Rewrite.
1931 (pthread_cond::~pthread_cond): Ditto.
1932 (pthread_cond::TimedWait): Remove.
1933 (pthread_cond::BroadCast): Ditto.
1934 (pthread_cond::Signal): Ditto.
1935 (pthread_cond::UnBlock): Implement.
1936 (pthread_cond::Wait): Ditto.
1937 (pthread_cond::fixup_after_fork): Rewrite.
1938 (pthread_mutex::fixup_after_fork): Remove DETECT_BAD_APP
1940 (__pthread_cond_broadcast): Just return 0 if the condition is
1941 not initialized. Call pthread_cond::UnBlock to release blocked
1943 (__pthread_cond_signal): Ditto.
1944 (__pthread_cond__dowait): Rewrite.
1945 (pthread_cond_timedwait): Add pthread_testcancel call. Fix
1946 waitlength calculation.
1947 (pthread_cond_wait): Add pthread_testcancel call.
1949 2003-03-18 Thomas Pfaff <tpfaff@gmx.net>
1951 * include/pthread.h (PTHREAD_MUTEX_NORMAL): New define.
1952 * thread.cc: Remove errno.h include.
1953 (pthread::precreate): Change internal mutex type to normal.
1954 (pthread_mutex::canBeUnlocked): Implement.
1955 (pthread_mutex::pthread_mutex): Initialize lock_counter with 0.
1956 (pthread_mutex::Lock): Rename to _Lock. Add self parameter.
1957 Change lock_counter logic. Update SetOwner call.
1958 (pthread_mutex::TryLock): Rename to _TryLock. Add self parameter.
1959 Change lock_counter logic. Update SetOwner call.
1960 (pthread_mutex::UnLock): Rename to _UnLock. Add self parameter.
1961 Change lock_counter logic.
1962 (pthread_mutex::Destroy): Rename to _Destroy. Update TryLock call.
1963 (pthread_mutex::SetOwner): Move to thread.h as inline.
1964 (pthread_mutex::LockRecursive): Ditto.
1965 (pthread_mutex::fixup_after_fork): Change lock_counter logic.
1966 (__pthread_mutexattr_settype): Add PTHREAD_MUTEX_NORMAL to valid
1968 * thread.h: Include errno.h and limits.h.
1969 (MUTEX_LOCK_COUNTER_INITIAL): Remove.
1970 (MUTEX_OWNER_ANONYMOUS): New define.
1971 (pthread_mutex::canBeUnlocked): New static method.
1972 (pthread_mutex::lock_counter): Change type to unsigned long.
1973 (pthread_mutex::GetPthreadSelf): New method.
1974 (pthread_mutex::Lock): Call _Lock with pthread_self pointer.
1975 (pthread_mutex::TryLock): Call _TryLock with pthread_self pointer.
1976 (pthread_mutex::UnLock): Call _UnLock with pthread_self pointer.
1977 (pthread_mutex::Destroy): Call _Destroy with pthread_self pointer.
1978 (pthread_mutex::SetOwner): Moved from thread.cc as inline.
1979 (pthread_mutex::LockRecursive): Ditto.
1980 (pthread_mutex::_Lock): New method.
1981 (pthread_mutex::_TryLock): New method.
1982 (pthread_mutex::_UnLock): New method.
1983 (pthread_mutex::_Destroy): New method.
1985 2003-03-18 Christopher January <chris@atomice.net>
1987 * fhandler_proc.cc (format_proc_cpuinfo): Use IsProcessorFeaturePresent
1988 only on Windows NT. Read CPU Mhz value only on NT. Revert previous
1989 change so cpuid instruction is called even on non-NT systems.
1991 2003-03-17 Corinna Vinschen <corinna@vinschen.de>
1993 * glob.c (g_lstat): Change API minor test to match API minor number
1994 change in previous patch.
1997 2003-03-17 Christopher Faylor <cgf@redhat.com>
1999 * include/cygwin/version.h: Reorganize last two api versions so that
2000 btowc and trunc exports show up before previous bump since there has
2001 been no exported version of the DLL with the 64 bit changes yet but
2002 1.3.22 will have the btowc and trunc.
2004 2003-03-17 Christopher Faylor <cgf@redhat.com>
2006 * cygwin.din: Export btowc, trunc.
2007 * include/cygwin/version.h: Reflect new exports.
2008 * syscalls.cc (_stat): Rename to stat to avoid newlib wrapper.
2009 * syscalls.cc (_fstat): Ditto.
2011 2003-03-16 Christopher Faylor <cgf@redhat.com>
2013 * fhandler_console.cc (fhandler_console::close): Correct check for
2014 current tty. Add debugging output when console is freed.
2015 (set_console_state_for_spawn): Add debugging output.
2016 * fhandler_tty.cc (fhandler_tty_slave::open): Don't decrement console
2017 open flag when vforking.
2018 * sigproc.cc (sigproc_terminate): Fix debugging output.
2019 * spawn.cc (handle): Eliminate second argument.
2020 (spawn_guts): Reflect elimination of argument change to handle.
2021 * syscalls.cc (setsid): Add debugging output when console is freed.
2023 2003-03-14 Christopher Faylor <cgf@redhat.com>
2025 * syscalls.cc (rename): Revert assumption that DELETE_ON_CLOSE works on
2028 2003-03-13 Christopher Faylor <cgf@redhat.com>
2030 * include/cygwin/version.h: Bump DLL minor number to 23.
2032 2003-03-13 Corinna Vinschen <corinna@vinschen.de>
2034 * autoload.cc (IsProcessorFeaturePresent): Add.
2035 * fhandler_proc.cc (format_proc_cpuinfo): Add case for 9x systems.
2037 2003-03-13 Corinna Vinschen <corinna@vinschen.de>
2039 * fhandler_proc.cc (format_proc_cpuinfo): Fix vendor id in cpuid case.
2041 2003-03-13 Corinna Vinschen <corinna@vinschen.de>
2043 * net.cc (cygwin_rcmd): Use correct file descriptor in call to fdsock.
2044 (cygwin_rexec): Ditto.
2046 2003-03-13 Christopher Faylor <cgf@redhat.com>
2048 * fhandler_tty.cc (fhandler_tty_slave::close): Fix typo in debug
2051 * syscalls.cc (rename): Assume that DELETE_ON_CLOSE works on Win9x.
2053 2003-03-11 Corinna Vinschen <corinna@vinschen.de>
2055 * fhandler_socket.cc (fhandler_socket::dup): Don't call
2056 fhandler_base::dup() but call DuplicateHandle directly instead to have
2057 control over socket inheritence.
2059 2003-03-11 Corinna Vinschen <corinna@vinschen.de>
2061 * fhandler_socket.cc (fhandler_socket::dup): On NT systems avoid
2062 using WinSock2 socket duplication methods. Add comment.
2064 2003-03-11 Pierre Humblet <pierre.humblet@ieee.org>
2066 * fhandler_socket.cc (fhandler_socket::fixup_after_fork):
2067 Set io_handle to INVALID_SOCKET in case of failure.
2068 (fhandler_socket::dup): Return 0 if the io_handle is valid.
2070 2003-03-10 Corinna Vinschen <corinna@vinschen.de>
2072 * sec_acl.cc (setacl): Don't handle DELETE flag specially.
2073 * security.cc (alloc_sd): Ditto.
2075 2003-03-09 Corinna Vinschen <corinna@vinschen.de>
2077 * winver.rc: Change Copyright hint to include 2003.
2079 2003-03-09 Corinna Vinschen <corinna@vinschen.de>
2081 Switch to 32/64 datatypes:
2082 * Makefile.in (OBSOLETE_FUNCTIONS): Add open acl aclcheck aclfrommode
2083 aclfrompbits aclfromtext aclsort acltomode acltopbits acltotext chown
2084 facl fchown fgetpos fopen freopen fseeko fsetpos fstat ftello
2085 ftruncate getegid geteuid getgid getgrent getgrgid getgrnam getgroups
2086 getpwuid getpwuid_r getuid initgroups lchown lseek lstat mknod mmap
2087 seekdir setegid seteuid setgid setgroups setregid setreuid setuid stat
2089 (NEW_FUNCTIONS): Add _open64 acl32 aclcheck32 aclfrommode32
2090 aclfrompbits32 aclfromtext32 aclsort32 acltomode32 acltopbits32
2091 acltotext32 chown32 facl32 fchown32 fgetpos64 fopen64 freopen64
2092 fseeko64 fsetpos64 fstat64 ftello64 ftruncate64 getegid32 geteuid32
2093 getgid32 getgrent32 getgrgid32 getgrnam32 getgroups32 getpwuid32
2094 getpwuid_r32 getuid32 initgroups32 lchown32 lseek64 lstat64 mknod32
2095 mmap64 seekdir64 setegid32 seteuid32 setgid32 setgroups32 setregid32
2096 setreuid32 setuid32 stat64 telldir64 truncate64 to substitute the
2098 * cygserver_shm.h (class client_request_shm): Change uid_t and gid_t
2099 members to __uid32_t and __gid32_t.
2100 * cygwin.din: Add symbols acl32 aclcheck32 aclfrommode32
2101 aclfrompbits32 aclfromtext32 aclsort32 acltomode32 acltopbits32
2102 acltotext32 facl32 fgetpos64 fopen64 freopen64 fseeko64 fsetpos64
2103 _fstat64 ftello64 _lseek64 mknod32 _open64.
2104 * glob.c: Include perprocess.h.
2105 (globtilde): Call getpwuid32 and getuid32 instead of getpwuid and
2107 (g_lstat): Check for applications API version to call the appropriate
2108 typed gl_lstat function.
2109 (g_stat): Ditto for gl_stat.
2110 * shm.cc (client_request_shm::client_request_shm): Call geteuid32
2111 and getegid32 instead of geteuid and getegid throughout.
2112 * syscalls.cc (_open64): New alias for open.
2113 (_lseek64): New alias for lseek64.
2114 (_fstat64): New alias for fseek64.
2115 (mknod32): New function.
2116 (mknod): Calls mknod32 now.
2117 * winsup.h: Make function declarations for getuid32, geteuid32,
2118 and getpwuid32 accessible for plain C sources. Add declarations
2119 for getegid32 and getpwnam.
2120 * include/cygwin/version.h: Bum API minor number to 78.
2121 * include/sys/cygwin.h: Guard C++ specific members of struct
2122 per_process against inclusion in plain C sources.
2123 * include/sys/mman.h (mman): Add guard to avoid type clash when
2126 2003-03-09 Christopher Faylor <cgf@redhat.com>
2128 * include/cygwin/version.h: Bump DLL minor number to 22.
2130 2003-03-09 Christopher Faylor <cgf@redhat.com>
2132 Do some minor reformatting of 'extern "C"' use throughout.
2134 2003-03-06 Christopher January <chris@atomice.net>
2136 * autoload.cc (GetSystemTimes): Define new autoload function.
2137 * fhandler_proc.cc (proc_listing): Add cpuinfo and partitions entries.
2138 (fhandler_proc::fill_filebuf): Add PROC_CPUINFO and PROC_PARTITIONS
2140 (format_proc_uptime): Use GetSystemTimes if available.
2141 (read_value): New macro.
2143 (cpuid): New function.
2144 (can_set_flag): New function.
2145 (format_proc_cpuinfo): New function.
2146 (format_proc_partitions): New function.
2148 2003-03-09 Christopher Faylor <cgf@redhat.com>
2150 * syscalls.cc (unlink): Attempt to be more clever about setting
2151 attributes of file. Only open file in query mode to avoid having to
2152 mess with security stuff for reading.
2154 2003-03-09 Corinna Vinschen <corinna@vinschen.de>
2156 * rmsym: Fix regular expression.
2158 2003-03-09 Christopher Faylor <cgf@redhat.com>
2160 * Makefile.in: Change from using new-* to cygwin0 for temporary
2163 2003-03-09 Corinna Vinschen <corinna@vinschen.de>
2165 * include/cygwin/socket.h: Set SOMAXCONN to Winsock2 value.
2167 2003-03-08 Christopher Faylor <cgf@redhat.com>
2169 * syscalls.cc (unlink): Always attempt to use FILE_FLAG_CLOSE_ON_DELETE
2170 to delete files since this allows us to preserve the protection of hard
2172 (link): Generate full path for potentially recalculated .lnk target.
2174 2003-03-08 Christopher Faylor <cgf@redhat.com>
2176 Revert below changes regarding _pinfo::cmdline.
2178 2003-03-08 Corinna Vinschen <corinna@vinschen.de>
2180 * external.cc (cygwin_internal): Change n to __off64_t to match change
2182 * fhandler.h (class fhandler_virtual): Change filesize member to
2184 * fhandler_proc.cc (format_proc_meminfo): Change to return __off64_t.
2185 (format_proc_stat): Ditto.
2186 (format_proc_uptime): Ditto.
2187 * fhandler_process.cc (format_process_stat): Ditto.
2188 (format_process_status): Ditto.
2189 (format_process_statm): Ditto.
2190 * pinfo.cc (_pinfo::cmdline): Expect __off64_t parameter.
2191 * pinfo.h (class _pinfo): Change declaration of cmdline accordingly.
2193 2003-03-07 Christopher Faylor <cgf@redhat.com>
2195 * path.h (PATH_LNK): New enum val.
2196 (path_conv::is_lnk_symlink): New function. True if path represents
2198 * path.cc (check_shortcut): Set PATH_LNK in pflags when appropriate.
2199 (symlink_info::check): Ditto. Remove PATH_LNK from pflags initially.
2200 * syscalls.cc (unlink): Always remove readonly attribute from a symlink
2202 (link): (from Corinna Vinschen) Allow links to symlinks. Reset
2203 attributes on a symlink after successful link creation.
2204 (chmod): Use is_lnk_symlink where appropriate.
2207 2003-03-07 Pierre Humblet <pierre.humblet@ieee.org>
2209 * tty.cc (create_tty_master): Call GetComputerName instead of
2210 cygwin_gethostname. Set ut_id.
2211 * syscalls.cc (login): Call endutent.
2212 (setutent): Do not seek after a fresh open.
2214 2003-03-07 Corinna Vinschen <corinna@vinschen.de>
2216 * syscalls.cc (seteuid32): Fix formatting.
2218 2003-03-04 Thomas Pfaff <tpfaff@gmx.net>
2220 * thread.cc (MTinterface::fixup_after_fork): Initialize mainthread
2221 prior to pthread objects.
2223 2003-03-04 Jason Tishler <jason@tishler.net>
2225 * fhandler_socket.cc (fhandler_socket::dup): Initialize type.
2227 2003-03-03 Christopher Faylor <cgf@redhat.com>
2229 * fhandler.h (fhandler_tty_slave::close): Declare new function.
2230 (fhandler_tty_slave::dup): Declare new function.
2231 (fhandler_tty_slave::fixup_after_function): Declare new function.
2232 * fhandler_tty.cc (fhandler_tty_slave_open): Only increment
2233 fhandler_console::open_fhs when associated with a pty.
2234 (fhandler_tty_slave::close): Define new function. Decrement
2235 fhandler_console::open_fhs when associated with a pty.
2236 (fhandler_tty_slave::dup): Define new function. Increment
2237 fhandler_console::open_fhs when associated with a pty.
2238 (fhandler_tty_slave::fixup_after_fork): Define new function. Increment
2239 fhandler_console::open_fhs when associated with a pty.
2241 2003-03-03 Christopher Faylor <cgf@redhat.com>
2243 * fhandler_tty.cc (fhandler_pty_slave::open): Grudgingly increment
2244 fhandler_console::open_fhs here.
2245 (fhandler_pty_slave::close): Ditto for close.
2247 2003-03-02 Christopher Faylor <cgf@redhat.com>
2249 * lib/getopt.c: Refresh from NetBSD sources.
2251 2003-03-02 Christopher Faylor <cgf@redhat.com>
2253 * fhandler_console.cc (fhandler_console::close): Don't decrement
2254 in use counter if in vfork fixup stage.
2256 2003-03-02 Christopher Faylor <cgf@redhat.com>
2258 * lib/getopt.c: Nuke use of unneeded BSDisms.
2260 2003-03-02 Christopher Faylor <cgf@redhat.com>
2262 * dll_init.cc (dll_list::load_after_fork): Don't revert to LoadLibrary
2263 if LoadLibraryEx fails.
2264 * dtable.cc (dtable::dec_console_fds): Eliminate.
2265 (dtable::release): Don't treat console specially.
2266 (dtable::build_fhandler): Ditto.
2267 * dtable.h (console_fds): Eliminate.
2268 (dtable::dec_console_fds): Eliminate.
2269 (dtable::inc_console_fds): Eliminate.
2270 * fhandler.h (fhandler_console::open_fhs): New static element.
2271 * fhandler_console.cc (fhandler_console::open): Increment open_fs.
2272 (fhandler_console::close): Call FreeConsole if no more open consoles
2273 and ctty is not associated with the console.
2274 * syscalls.cc (setsid): Simplify check for when to call FreeConsole.
2275 (check_pty_fds): Eliminate definition.
2276 * winsup.h (check_pty_fds): Eliminate declaration.
2278 2003-03-02 Christopher Faylor <cgf@redhat.com>
2280 * dll_init.cc (dll_list::load_after_fork): Fix typo where result of
2281 LoadLibrary was ignored.
2283 2003-03-01 Corinna Vinschen <corinna@vinschen.de>
2285 * fhandler_socket.cc (fhandler_socket::bind): Open and write socket
2286 file using Win32 calls.
2288 2003-03-01 Corinna Vinschen <corinna@vinschen.de>
2290 * fhandler_socket.cc (get_inet_addr): Open and read socket file using
2293 2003-02-28 Christopher Faylor <cgf@redhat.com>
2295 * cygwin.din: Wrap atexit and exit with cygwin, thread-safe functions.
2296 * dcrt0.cc (cygwin_atexit): New function.
2297 (cygwin_exit): Ditto.
2299 2003-02-28 Pierre Humblet <pierre.humblet@ieee.org>
2301 * syscalls.cc (fstat64): Pass get_name () to pc.
2302 (access): Pass fn to stat_worker.
2304 2003-03-27 Corinna Vinschen <corinna@vinschen.de>
2306 * fhandler_socket.cc (class sock_event): New class managing Winsock
2307 events for interruptible socket calls.
2308 (fhandler_socket::connect): Move support for interruptible call to
2309 class sock_event. Use class object instead.
2310 (fhandler_socket::accept): Ditto. Remove useless casts.
2312 2003-03-27 Thomas Pfaff <tpfaff@gmx.net>
2314 * fhandler_socket.cc (fhandler_socket::connect): Add support for
2315 an interruptable connect.
2317 2003-02-27 Pierre Humblet <pierre.humblet@ieee.org>
2319 * uinfo.cc (internal_getlogin): Only update user.groups.pgsid
2320 if the call to set the primary group succeeds.
2322 2003-02-27 Christopher Faylor <cgf@redhat.com>
2324 * cygthread::detach: Improve error message.
2326 2003-02-26 Pierre Humblet <pierre.humblet@ieee.org>
2328 * sec_helper.cc (get_sids_info): debug_print owner_sid and group_sid.
2330 2003-02-25 Corinna Vinschen <corinna@vinschen.de>
2332 * mmap.cc (mmap64): Fix returned address by taking the granularity
2335 2003-02-23 Pierre Humblet <pierre.humblet@ieee.org>
2337 * syslog.cc (syslog): Do not unlock the file before closing it
2338 and remove debug_printf about stream errors.
2340 2003-02-22 Christopher Faylor <cgf@redhat.com>
2342 * cygmalloc.h: Remove MORECORE_CANNOT_TRIM. It's not true.
2343 # cygwin.din: Export mallinfo.
2344 # malloc_wrapper.cc (mallinfo): New function.
2346 2003-02-22 Pierre Humblet <pierre.humblet@ieee.org>
2348 * syslog.cc (syslog): Do not print the Windows pid. Print the Cygwin
2349 pid as an unsigned decimal. On Win95 print a timestamp and attempt to
2350 lock the file up to four times in 3 ms.
2352 2003-02-21 Corinna Vinschen <corinna@vinschen.de>
2354 * fhandler_socket.cc (fhandler_socket::fhandler_socket): Fix compiler
2356 (fhandler_socket::fstat): Simplify. Set st_uid/st_gid to effective
2357 uid/gid of current process in case of open sockets.
2359 2003-02-21 Corinna Vinschen <corinna@vinschen.de>
2361 * dtable.cc (dtable::build_fhandler_from_name): Set some fhandler
2362 data on sockets to evaluate AF_LOCAL sockets correctly.
2363 (dtable::build_fhandler): Set unit number on sockets.
2364 * fhandler.h (fhandler_socket): Add unit number.
2365 (fhandler_socket::get_unit): New method.
2366 * fhandler_socket.cc (fhandler_socket::fhandler_socket): Set unit
2368 (fhandler_socket::fstat): Reorganize to return more Linux-like
2370 * net.cc: include ctype.h.
2371 (fdsock): Set unit number when building fhandler.
2372 * path.cc (path_conv::check): Set device type to FH_SOCKET if file
2373 is a AF_UNIX socket.
2374 (get_devn): Evaluate unit for virtual socket devices.
2375 (win32_device_name): Set windows path for sockets to unix_path with
2376 just backslashes to keep the different names.
2377 * syscalls.cc (fstat64): Don't override st_ino, st_dev and st_rdev
2379 (stat_worker): Ditto.
2381 2003-02-21 Pierre Humblet <pierre.humblet@ieee.org>
2383 * autoload.cc (AccessCheck): Add.
2384 (DuplicateToken): Add.
2385 * security.h (check_file_access): Declare.
2386 * syscalls.cc (access): Convert path to Windows, check existence
2387 and readonly attribute. Call check_file_access instead of acl_access.
2388 * security.cc (check_file_access): Create.
2389 * sec_acl (acl_access): Delete.
2391 2003-02-19 Christopher Faylor <cgf@redhat.com>
2393 * fhandler.cc (fhandler_base::open): Move some filesystem specific
2395 (fhandler_disk_file::open): Accept some filesystem specific stuff.
2396 * sigproc.cc (wait_for_sigthread): Become slightly more thread safe.
2397 (sig_send): Don't assume that signal thread is ready.
2399 2003-02-20 Corinna Vinschen <corinna@vinschen.de>
2401 * wincap.h (wincap): Remove unnecessary definition of
2402 supports_sparse_files.
2405 2003-02-20 Corinna Vinschen <corinna@vinschen.de>
2407 * fhandler_disk_file.cc (fhandler_disk_file::opendir): Check descriptor
2408 created by cygheap_fdnew constructor.
2409 * fhandler_virtual.cc (fhandler_virtual::opendir): Ditto.
2410 * fhandler_socket.cc (fhandler_socket::accept): Ditto and move
2411 creation of file descriptor behind blocking OS call.
2412 * net.cc (cygwin_socket): Ditto.
2413 (cygwin_rcmd): Ditto.
2414 (cygwin_rresvport): Ditto.
2415 (cygwin_rexec): Ditto.
2416 (socketpair): Ditto.
2418 2003-02-20 Corinna Vinschen <corinna@vinschen.de>
2420 * autoload.cc (GetCompressedFileSize): Add.
2421 * fhandler_disk_file.cc (fhandler_disk_file::fstat_helper): Compute
2422 st_blocks value from GetCompressedFileSize() if available.
2424 2003-02-18 Vaclav Haisman <V.Haisman@sh.cvut.cz>
2426 * wincap.h (wincaps::supports_sparse_files): New flag.
2427 (wincapc::supports_sparse_files): New method.
2428 * wincap.cc (wincap_unknown): Define value for the new flag.
2430 (wincap_95osr2): Ditto.
2432 (wincap_98se): Ditto.
2434 (wincap_nt3): Ditto.
2435 (wincap_nt4): Ditto.
2436 (wincap_nt4sp4): Ditto.
2437 (wincap_2000): Ditto.
2439 * path.h (path_conv::fs_flags): New method.
2440 * fhandler_disk_file.cc: Include winioctl.h for DeviceIoControl.
2441 (fhandler_disk_file::open): Set newly created and truncated files as
2442 sparse on platforms that support it.
2444 2003-02-17 Pierre Humblet <pierre.humblet@ieee.org>
2446 * grp.cc (internal_getgroups): Handle properly tokens with
2447 no groups. Fix bug introduced on 2003-02-04.
2449 2003-02-16 Christopher Faylor <cgf@redhat.com>
2451 * cygwin.din: Export all appropriate newlib libm functions. Sort.
2452 * include/cygwin/version.h: Bump API minor number.
2454 2003-02-15 Christopher Faylor <cgf@redhat.com>
2456 * cygwin.din: Export all appropriate newlib libc functions.
2457 * include/cygwin/version.h: Bump API minor number.
2459 2003-02-14 Jason Tishler <jason@tishler.net>
2461 * mmap.cc (mprotect): Add missing break.
2463 2003-02-13 Christopher Faylor <cgf@redhat.com>
2465 * exceptions.cc (try_to_debug): Don't reset priority when returning
2466 from non-waitloop call.
2468 2003-02-13 Vaclav Haisman <V.Haisman@sh.cvut.cz>
2469 Christopher Faylor <cgf@redhat.com>
2471 * fhandler_console.cc (fhandler_console::write_normal): Use MessageBeep
2473 * autoload.cc (MessageBeep): Add.
2475 2003-02-13 Christopher Faylor <cgf@redhat.com>
2477 * include/cygwin/types.h: Use correct ifdef guard for u_ definitions.
2479 2003-02-13 Christopher Faylor <cgf@redhat.com>
2481 * environ.cc (environ_init): Use strechr.
2483 2003-02-13 Christopher Faylor <cgf@redhat.com>
2485 * include/cygwin/in.h (sockaddr_in): Fix typo.
2487 2003-02-12 Christopher Faylor <cgf@redhat.com>
2489 * path.h (path_conv): Reorganize slightly.
2491 2003-02-12 Christopher Faylor <cgf@redhat.com>
2493 * fhandler_tty.cc (process_input): Add sanity check to ensure that
2494 console typeahead is cleared on signal.
2496 2003-02-12 Christopher Faylor <cgf@redhat.com>
2498 * spawn.cc (linebuf::~linebuf): Resurrect commented out (for
2501 2003-02-10 Ralf Habacker <ralf.habacker@freenet.de>
2503 * include/cygwin/in.h (in_attr_t): Define new type.
2504 * include/arpa/inet.h (inet_addr): Change return type to in_addr_t.
2505 (inet_lnaof): Ditto.
2506 (inet_netof): Ditto.
2507 (inet_network): Ditto.
2509 2003-02-10 Christopher Faylor <cgf@redhat.com>
2511 * include/cygwin/types.h: Move many *_t typedefs here. Protect them
2513 * fhandler_disk_file.cc (fhandler_disk_file::fstat): Change ntsec_atts to mode_t.
2514 * security.cc (get_attribute_from_acl): Accept mode_t attribute.
2515 (get_nt_attribute): Ditto.
2516 (get_file_attribute): Ditto.
2517 (get_nt_object_attribute): Ditto.
2518 (get_object_attribute): Ditto.
2519 * security.h: Reflect above changes.
2520 * syscalls.cc (chown_worker): Change attrib to mode_t.
2522 2003-02-08 Christopher Faylor <cgf@redhat.com>
2524 * include/cygwin/version.h: Bump DLL minor number to 21.
2526 2003-02-07 Christopher Faylor <cgf@redhat.com>
2528 * malloc.cc (DEFAULT_MMAP_THRESHOLD): Bump down to 16MB thanks to below
2531 2003-02-07 Corinna Vinschen <corinna@vinschen.de>
2533 * mmap.cc (mmap_record::alloc_map): De-inline. Add offset and length
2534 parameter. Only protect pages actually unused currently. Do job
2535 of map_map() when initializing a map.
2536 (mmap_record::map_map): Reduce functionality for the reuse case
2537 of private anonymous mapping.
2538 (mmap_record::fixup_map): Format change.
2539 (list::add_record): Add offset and length parameter to call
2540 mmap_record::alloc_map() correctly.
2541 (mmap64): Rename `l' variable to `map_list'. Accommodate above changes.
2542 (munmap): Rename `l' variable to `map_list'.
2544 (fhandler_disk_file::mmap): Streamline code.
2546 (fixup_mmaps_after_fork): Rename `l' variable to `map_list'.
2548 2003-02-07 Vaclav Haisman <V.Haisman@sh.cvut.cz>
2549 Christopher Faylor <cgf@redhat.com>
2551 * exceptions.cc (try_to_debug): Set priority of current thread rather
2552 than the main thread. Make busy waiting loop less busy. Restore
2553 priority when function returns.
2555 2003-02-07 Christopher Faylor <cgf@redhat.com>
2557 * malloc.cc (DEFAULT_MMAP_THRESHOLD): Set high to avoid mmaps.
2559 2003-02-07 Christopher Faylor <cgf@redhat.com>
2561 * pipe.cc (fhandler_pipe::close): Avoid extraneous this->.
2563 2003-02-06 Christopher Faylor <cgf@redhat.com>
2565 * heap.cc (heap_init): Remove debugging code.
2567 2003-02-06 Pierre Humblet <pierre.humblet@ieee.org>
2569 * security.h: Introduce names UNKNOWN_UID and UNKNOWN_GID and delete
2570 declaration of is_grp_member.
2571 * uinfo.cc (internal_getlogin): Use UNKNOWN_GID.
2572 * passwd.cc (pwdgrp::read_passwd): Use UNKNOWN_UID.
2573 * grp.cc (pwdgrp::read_group): Change group name to provide better
2575 (getgrgid): Use gid16togid32.
2576 * sec_helper.cc (is_grp_member): Delete.
2578 2003-02-05 Christopher Faylor <cgf@redhat.com>
2580 * path.cc: Change 'to_posix_p' to 'to_posix' throughout.
2581 (conv_path_list_buf_size): Accommodate relative paths.
2583 2003-02-05 Christopher Faylor <cgf@redhat.com>
2585 * path.cc (etc::dir_changed): Fix debug printf.
2587 2003-02-05 Corinna Vinschen <corinna@vinschen.de>
2589 * sec_acl.cc (setacl): Move all permission settings to beginning of
2590 loop. Set default rights to same values as in alloc_sd(). Set DELETE
2591 for owner and default owner only if S_IWOTH is given.
2593 2003-02-05 Pierre Humblet <pierre.humblet@ieee.org>
2595 * sec_acl.cc: Change all __aclent16_t to __aclent32_t except in
2596 wrapper function definitions. Replace call to the aclXYZ functions by
2598 (searchace): Change type of third argument to __uid32_t and use
2599 ILLEGAL_UID instead of -1;
2600 (setacl): Remove some initializations. Only give STANDARD_RIGHTS_WRITE
2601 for S_IWOTH. Replace -1 by ILLEGAL_UID.
2602 (getacl): Change type of owner_sid, group_sid and ace_sid to cygpsid.
2603 In last else clause, suppress second call to ace_sid.get_id and use
2604 TRUE in first call. Replace EqualSid by ==.
2605 (acl_access): Call internal_getgroups in USER and GROUP cases.
2606 (acecmp: Define static.
2607 (acl32): Create from 16 bit type.
2610 (aclcheck32): Ditto.
2612 (acltomode32): Ditto.
2613 (aclfrommode32): Ditto.
2614 (acltopbits32): Ditto.
2615 (aclfrompbits32): Ditto.
2616 (acltotext32): Ditto.
2617 (aclfromtext32): Ditto, and use strechr.
2618 (acl16to32): Create.
2619 (acl): Make it a wrapper function.
2625 (aclfrommode): Ditto.
2626 (acltopbits): Ditto.
2627 (aclfrompbits): Ditto.
2629 (aclfromtext): Ditto.
2630 * security.cc (write_sd): Call set_process_privilege and check
2632 (alloc_sd): Remove call to set_process_privilege and the owner check.
2634 2003-02-05 Christopher Faylor <cgf@redhat.com>
2636 * include/sys/cygwin.h: Use C-style comments.
2638 2003-02-05 Pierre Humblet <pierre.humblet@ieee.org>
2640 * sec_helper.cc (get_sids_info): New function.
2641 * security.cc (extract_nt_dom_user): Simplify with strechr.
2642 (get_user_groups): Initialize glen to MAX_SID_LEN.
2643 (get_user_local_groups): Ditto.
2644 (get_attribute_from_acl): Define ace_sid as cygpsid.
2645 (get_nt_attribute): Define owner_sid and group_sid as cygpsid.
2646 Call get_sids_info instead of cygsid.get_{u,g}id and is_grp_member.
2647 (get_nt_object_attribute): Ditto.
2648 (alloc_sd): Define ace_sid as cygpsid.
2650 2003-02-04 Thomas Pfaff <tpfaff@gmx.net>
2652 * syscalls.cc (struct system_cleanup_args): New struct.
2653 (system_cleanup): New function.
2654 (system): Use pthread_cleanup_push and _pop to save and restore
2655 signal handlers and sigprocmask.
2657 2003-02-04 Corinna Vinschen <corinna@vinschen.de>
2659 * path.cc (symlink): Create security attributes so that only the
2660 user can modify the symlink.
2661 * security.cc (set_security_attribute): Remove symlink special
2664 2003-02-04 Pierre Humblet <pierre.humblet@ieee.org>
2666 * grp.cc (internal_getgroups): Do not return without closing
2669 2003-02-04 Pierre Humblet <pierre.humblet@ieee.org>
2671 * security.h (class cygpsid): New class.
2672 (class cygsid): Use cygpsid as base. Remove members psid, get_id,
2673 get_uid, get_gid, string, debug_printf and the == and != operators.
2674 (cygsidlist::clear_supp): Only do work if setgroups has been called.
2675 * sec_helper.cc: Define sid_auth NO_COPY.
2676 (cygpsid::operator==): New operator.
2677 (cygpsid::get_id): New function.
2678 (cygpsid::string): New function.
2679 (cygsid::string): Delete.
2680 (cygsid::get_id): Delete.
2681 * pwdgrp.h: Change arguments of internal_getpwsid,
2682 internal_getgrsid and internal_getgroups to cygpsid.
2683 * passwd.cc (internal_getpwsid): Change argument from cygsid to cygpsid.
2684 * grp.cc (internal_getgrsid): Ditto.
2685 (internal_getgroups): Ditto.
2687 2003-02-03 Christopher Faylor <cgf@redhat.com>
2689 Eliminate most unneeded this-> pointers throughout.
2691 2003-02-03 Pierre Humblet <pierre.humblet@ieee.org>
2693 * security.h: Add third argument to set_process_privilege.
2694 * autoload.cc: Add OpenThreadToken.
2695 * sec_helper.cc (set_process_privilege): Add and use use_thread
2697 * security.cc (alloc_sd): Modify call to set_process_privilege.
2698 Remember the result in each process. If failed and file owner is not
2701 2003-02-03 Corinna Vinschen <corinna@vinschen.de>
2703 * fhandler_socket.cc (fhandler_socket::recvfrom): Return buffer
2704 length and don't set errno in case of WSAEMSGSIZE error.
2705 (fhandler_socket::recvmsg): Ditto.
2707 2003-02-01 Christopher Faylor <cgf@redhat.com>
2709 * grp.cc (getgrent32): Only refresh group entries when at beginning.
2710 (internal_getgrsid): Only refresh if uninitialized.
2711 (internal_getgrent): Ditto.
2712 * passwd.cc (getpwent): Only refresh passwd entries when at beginning.
2713 (pwdgrp::read_passwd): linebuf *cannot* be NO_COPY.
2714 (internal_getpwsid): Only refresh if uninitialized.
2715 (getpass): No need to refresh passwd data here.
2716 * pwdgrp.h (refresh): Eliminate default.
2718 2003-01-31 Christopher Faylor <cgf@redhat.com>
2720 * dlfcn.cc (dlerror): Only report load errors once per error.
2722 2003-01-31 Christopher Faylor <cgf@redhat.com>
2724 * fhandler_serial.cc (fhandler_serial::open): Avoid extraneous setting
2727 * termios.cc (tcsetattr): Correctly record errno after tcsetattr call.
2729 2003-01-31 Troy Curtiss <troyc@usa.net>
2731 * fhandler_serial.cc (fhandler_serial::tcsetattr): Add error-checking
2732 so that if any Win32 SetComm*() calls fail, errno gets set to EINVAL
2733 and tcsetattr() returns -1. Catch invalid bitrates, mostly. If baud
2734 rate setting is B0, just drop DTR and leave Win32 DCB bitrate as-is
2735 since 0 is not a valid Win32 setting.
2736 (fhandler_serial::tcgetattr): If DTR is low, populate the bitrate as
2737 B0, otherwise get it from the DCB.
2739 2003-01-31 Christopher Faylor <cgf@redhat.com>
2741 * passwd.cc (pwdgrp::read_passwd): linebuf *must* be static (from
2743 * pwdgrp.h (pwdgrp::refresh): Avoid calling read function if we already
2744 have lock since that means we are in the process of reading the file.
2746 2003-01-31 Jason Tishler <jason@tishler.net>
2748 * shared.cc (shared_info::heap_chunk_size): Use correct variable when
2751 2003-01-30 Christopher Faylor <cgf@redhat.com>
2753 * fhandler_registry.cc (fhandler_registry::exists): Fix off-by-one
2754 error when inspecting path.
2756 2003-01-29 Christopher Faylor <cgf@redhat.com>
2758 * lib/getopt.c: Allow environment variable control of POSIXLY_INCORRECT
2761 2003-01-28 Corinna Vinschen <corinna@vinschen.de>
2763 * fhandler_socket.cc (fhandler_socket::accept): On successful execution
2764 set connection state of returned socket to CONNECTED.
2766 2003-01-27 Christopher Faylor <cgf@redhat.com>
2768 * passwd.cc (pwdgrp::parse_passwd): Be more unforgiving about
2771 2003-01-26 Christopher Faylor <cgf@redhat.com>
2773 * uinfo.cc (pwdgrp::next_num): Remove check for NULL since it is no
2774 longer a valid return from next_str.
2775 (pwdgrp::add_line): Duh. Revert to use strchr.
2777 2003-01-26 Christopher Faylor <cgf@redhat.com>
2779 * string.h (strechr): New function.
2780 * uinfo.cc (pwdgrp::next_str): Search only for input char in string.
2781 Return EOS on failure. Don't check for NULL since it shouldn't be
2783 (pwdgrp::add_line): Revert to replacing '\n' in input line with '\0'.
2784 (pwdgrp::next_num): Pass explicit separator character to next_str.
2785 * grp.cc (pwdgrp::parse_group): Ditto.
2786 * passwd.cc (pwdgrp::parse_passwd): Ditto. Revamp test for garbage
2788 * pwdgrp.h (pwdgrp::next_str): Don't use default parameter.
2790 2003-01-26 Christopher Faylor <cgf@redhat.com>
2792 * uinfo.cc (pwdgrp::load): Regularize strace output. Add warning for
2795 2003-01-26 Christopher Faylor <cgf@redhat.com>
2797 * passwd.cc (pwdgrp::parse_passwd): Eliminate use of memset. The
2798 structure should always be completely filled out.
2799 * grp.cc (pwdgrp::parse_group): Ditto.
2801 2003-01-26 Christopher Faylor <cgf@redhat.com>
2803 * grp.cc (pwdgrp::parse_group): Fix off-by-one problem in allocating
2806 2003-01-26 Christopher Faylor <cgf@redhat.com>
2808 * include/sys/strace.h (paranoid_printf): Define as not being part of
2811 2003-01-25 Christopher Faylor <cgf@redhat.com>
2813 * pwdgrp.h (pwdgrp::next_num): Rename from next_int. Returns
2814 true/false if parse operation succeeded.
2815 (pwdgrp::reparse): Remove.
2816 (pwdgrp::raw_ptr): New function. Returns pointer in line.
2817 (pwdgrp::next_num): New functions for parsing other than unsigned long.
2818 * grp.cc (pwdgrp::parse_group): Reinstate previous parsing behavior.
2819 Don't fill in fields with NULL and assign empty gr_mem to known pointer
2820 rather than doing a pointless calloc. Streamline gr_mem parsing.
2821 Don't increment curr_lines here.
2822 * passwd.cc (pwdgrp::parse_passwd): Use new behavior of next_num.
2823 Don't increment curr_lines here.
2824 * uinfo.cc (pwdgrp::next_str): Keep returning EOL if out of data.
2825 (pwdgrp::reparse): Remove.
2826 (pwdgrp::next_num): Rename from next_int. Return bool indicating
2827 success of parse, argument returns value parsed.
2828 (pwdgrp::add_line): Increment curr_lines here on successful parse.
2829 (pwdgrp::load): (from Pierre Humblet) Don't return status. Just report
2832 2003-01-25 Christopher Faylor <cgf@redhat.com>
2834 * pwdgrp.cc (pwdgrp::reparse): Declare.
2835 * uinfo.cc (pwdgrp::reparse): Define.
2836 * grp.cc (pwdgrp::parse_group): Use reparse.
2838 2003-01-25 Pierre Humblet <pierre.humblet@ieee.org>
2840 * syscalls.cc (seteuid32): On Win95 get the pw entry. If it exists
2841 update the euid and call cygheap->user.set_name. Remove special
2842 handling of ILLEGAL_UID.
2843 (setgid32): Add a debug_printf. On Win95, always set the egid.
2844 Remove special handling of ILLEGAL_GID. Do not compare gid and gr_gid.
2845 * child_info.h (class cygheap_exec_info): Remove uid.
2846 * spawn.cc (spawn_guts): Do not set ciresrv.moreinfo->uid.
2847 * dcrto.cc (dll_crt0_1): Always call uinfo_init.
2848 * uinfo.cc (uinfo_init): Reorganize and close handle if needed.
2849 (cygheap_user::ontherange): Do not call internal_getpwnam if pw is NULL.
2851 2003-01-24 Christopher Faylor <cgf@redhat.com>
2853 * fhandler_console.cc (fhandler_console::send_winch_maybe): Reset
2854 scroll region if size changes.
2856 2003-01-24 Pierre Humblet <pierre.humblet@ieee.org>
2857 Jason Tishler <jason@tishler.net>
2859 * cygwin.din: Export setreuid32, setreuid, setregid32, setregid.
2860 * syscalls.cc (setreuid32): New function.
2862 (setregid32): Ditto.
2864 * include/cygwin/version.h: Bump API minor number.
2866 2003-01-23 Christopher Faylor <cgf@redhat.com>
2868 * pwdrp.h (pwdgrp::refresh): Lock entire test prior to reading.
2870 2003-01-23 Christopher Faylor <cgf@redhat.com>
2872 * grp.cc (pwdgrp::parse_group): Eliminate arg and use class member
2873 instead. Use next_str and next_int to parse arguments.
2874 * passwd.cc (pwdgrp::parse_passwd): Ditto.
2875 (grab_string): Eliminate.
2877 * pwdgrp.h (pwdgrp::parse): Eliminate input arg.
2878 (pwdgrp::parse_passwd): Reflect above change.
2879 (pwdgrp::parse_group): Reflect above change.
2880 (pwdgrp::next_str): New function.
2881 (pwdgrp::next_int): Ditto.
2882 (pwdgrp::gets): Eliminate.
2883 * uinfo.cc (pwdgrp::next_str): New function.
2884 (pwdgrp::next_int): Ditto.
2885 (pwdgrp::add_line): Subsume gets.
2886 (pwdgrp::gets): Eliminate.
2887 (pwdgrp::load): Just call add_line to parse input buffer.
2889 2003-01-22 Thomas Pfaff <tpfaff@gmx.net>
2891 * include/pthread.h (PTHREAD_MUTEX_RECURSIVE): Revert changes from
2892 2003-01-09 mutex patch.
2893 (PTHREAD_MUTEX_ERRORCHECK): Ditto.
2895 2003-01-22 Corinna Vinschen <corinna@vinschen.de>
2897 * cygrun.c: Move from here to ../testsuite.
2898 * Makefile.in: Remove cygrun.exe dependencies.
2900 2003-01-21 Jason Tishler <jason@tishler.net>
2902 * cygwin.din: Export nanosleep().
2903 * signal.cc (nanosleep): New function.
2904 (sleep): Move old functionality to nanosleep(). Call nanosleep().
2905 (usleep): Remove old functionality. Call nanosleep().
2906 * include/cygwin/version.h: Bump API minor number.
2908 2003-01-21 Christopher Faylor <cgf@redhat.com>
2910 * grp.cc: Call gr.refresh() rather than doing isunitialized tests
2912 (gr): Use constructor (sigh).
2913 (pwdgrp::parse_group): Rename from parse_grp.
2914 (pwdgrp::read_group): Rename from read_etc_group. Just call gr.load
2915 with a single argument.
2916 * passwd.cc: Call pr.refresh() rather than doing isunitialized tests
2918 (pr): Use constructor (sigh).
2919 (pwdgrp::parse_passwd): Rename from "parse_pwd".
2920 (pwdgrp::read_passwd): Rename from read_etc_passwd. Just call pr.load
2921 with a single argument.
2922 * pwdgrp.h (pwdgrp_state): Eliminate.
2923 (pwdgrp): Reflect above renamings.
2924 (pwdgrp::etc_ix): Rename from pwd_ix.
2925 (pwdgrp::read): New element.
2926 (pwdgrp::lock): New element.
2927 (pwdgrp::refresh): New function.
2928 (pwdgrp::load): Eliminate variations which take buffer arguments.
2929 (pwdgrp::pwdgrp): New constructors. Initialize mutex here.
2930 * uinfo.cc (pwdgrp::load): Accommodate pwd_ix -> etc_ix renaming.
2931 (pwdgrp::load): Set initialized state to true rather than setting state
2934 2003-01-21 Christopher Faylor <cgf@redhat.com>
2936 * include/cygwin/version.h: Bump DLL minor number.
2938 2003-01-21 Pierre Humblet <pierre.humblet@ieee.org>
2940 * path.h (etc::change_possible): Revert the type to bool.
2941 (etc::set_last_modified): Remove obsolete function.
2942 * path.cc (etc::change_possible): Revert type to bool.
2943 (etc::test_file_change): Do not test for negative values of
2944 change_possible and do not set it to -res.
2945 (etc::dir_changed): When the handle is NULL, call memset instead of
2946 test_file_changed. When the handle is invalid, return true. Detect
2947 filename change in /etc.
2948 (etc::file_changed): Remove unneeded check for !fn[n].
2949 * uinfo.cc (pwdgrp::load): Eliminate spurious setting of fh to NULL.
2950 * pwdgrp.h (pwdgrp::operator =): Eliminate.
2952 2003-01-19 Christopher Faylor <cgf@redhat.com>
2954 * pwdgrp.h (etc): Move to path.h.
2955 (pwdgrp::max_lines): New field.
2956 (pwdgrp::curr_lines): New field.
2957 (pwdgrp::pwdgrp_buf): Ditto.
2958 (pwdgrp_buf_elem_size): Ditto.
2959 (pwdgrp_parse): Ditto.
2960 (pwdgrp::gets): Just declare here.
2961 (pwdgrp::load): Ditto. Just take one argument.
2962 (pwdgrp::load): Define overloaded function accepting passwd buf.
2963 (pwdgrp::load): Define overloaded function accepting group buf.
2964 * grp.cc: Use pwdgrp elements rather than standalone static variables
2966 (curr_lines): Eliminate.
2968 (add_grp_line): Ditto.
2969 (parse_grp): Define as returning boolean. Accept void * arg and line
2970 count. Coerce first argument into __group32 buf reference. Increment
2971 curr_line as appropriate.
2972 (read_etc_group): Pass pwdgrp buffer to gr.load.
2973 * passwd.cc: Use pwdgrp elements rather than standalone static variables
2975 (curr_lines): Eliminate.
2977 (add_grp_line): Ditto.
2978 (parse_passwd): Define as returning boolean. Accept void * arg and line
2979 count. Coerce first argument into passwd buf reference. Increment
2980 curr_line as appropriate.
2981 (read_etc_group): Pass pwdgrp buffer to pr.load.
2982 * path.cc (etc::fn): Extend buffer size to allow index by 1 rather than
2984 (etc::last_modified): Ditto.
2985 (etc::change_possible): Ditto. Renamed from sawchange. Change to
2986 signed char since elements are now tri-state.
2987 (etc::init): Assume "handle" is 1 based rather than 0.
2988 (etc::test_file_change): New function. Sets change_possible based on
2989 file date comparison.
2990 (etc::dir_changed): Check file states immediately after changed_h is
2991 initialized to avoid a race.
2992 (etc::file_changed): Use test_file_change to detect if file needs to be
2994 * path.h (etc): Move class here from pwdgrp.h.
2995 * uinfo.cc: Move etc:: functions to path.cc. Move pwdgrp functions
2997 (pwdgrp::gets): Eliminate buf checks. Just check eptr and set lptr.
2998 (pwdgrp::add_line): New function.
2999 (pwdgrp::load): Call generic add_line function which will call correct
3002 2003-01-17 Christopher Faylor <cgf@redhat.com>
3004 * cygheap.cc: Change most 'int's to 'unsigned's.
3005 (_cmalloc): Only check for size of malloced region when calculating
3006 bucket. Add overhead when performing the sbrk. Previous change broke
3009 2003-01-17 Christopher Faylor <cgf@redhat.com>
3011 * dcrt0.cc (initialize_env): Use colon for CYGWIN_DEBUG separator.
3012 * grp.cc: Change most statics to NO_COPY throughout.
3015 2003-01-17 Christopher Faylor <cgf@redhat.com>
3017 * pwdgrp.h: Change some BOOLs to bools.
3018 (pwdgrp::pwdgrp): Remove unneeded constructor.
3019 * passwd.cc: Change BOOL to bool throughout.
3021 2003-01-17 Corinna Vinschen <corinna@vinschen.de>
3023 * cygwin.din: Add strerror_r.
3024 * include/cygwin/version.h: Bump API minor number.
3026 2003-01-17 Christopher Faylor <cgf@redhat.com>
3028 * uinfo.cc (etc::dir_changed): Don't print a warning if can't open
3029 /etc, unless debugging.
3031 2003-01-17 Pierre Humblet <pierre.humblet@ieee.org>
3033 * grp.cc (read_etc_group): On NT, add a line for gid = -1. Change name
3034 "unknown" to "mkgroup".
3035 (internal_getgrgid): Do not return default in nontsec case.
3036 (internal_getgroups): Add argument srchsid and look for it in groups if
3038 * passwd.cc (read_etc_passwd): On NT, add a line for uid = -1. Use
3039 same default uid for Win95 and NT. Call cygheap_user::ontherange to
3042 2003-01-16 Christopher Faylor <cgf@redhat.com>
3044 * cygheap.cc (init_cygheap::etc_changed): Move to uinfo.cc.
3045 * cygheap.h (init_cygheap::etc_changed_h): Remove.
3046 (init_cygheap::etc_changed): Ditto.
3047 * grp.cc (group_state): Remove. Use gr instead throughout.
3048 (gr): Define as class pwdgrp.
3049 (read_etc_group): Remove gr definition. Remove calls to
3050 set_last_modified and close. Pass add_grp to gr.load to load file.
3051 * passwd.cc (passwd_state): Remove. Use pr instead, throughout.
3052 (pr): Define as class pwdgrp.
3053 (read_etc_passwd): Remove pr definition. Remove calls to
3054 set_last_modified and close. Pass add_pwd_line to pr.load to load
3056 * pwdgrp.h (etc): New helper class for pwdgrp.
3057 (pwdgrp): Combine pwdgrp_check and pwdgrp_read into one class. Remove
3058 file_w32 and last_modified fields.
3059 (pwdgrp::set_last_modified): Remove.
3060 (pwdgrp::isinitializing): Remove FindFirstFile stuff. Move to
3062 (pwdgrp::load): Rename from 'open'. Call etc::init to initialize etc
3063 scanning. Close file handle after reading buffer into memory. Parse
3064 buffer by calling second argument.
3065 (pwdgrp::gets): Reorganize slightly to rely on eptr starting at
3066 beginning of buffer.
3067 (pwdgrp::close): Remove.
3068 * uinfo.cc (etc::dir_changed): New function.
3070 (etc::file_changed): Ditto.
3071 (etc::set_last_modified): Ditto.
3073 2003-01-16 Jason Tishler <jason@tishler.net>
3075 * mmap.cc (fixup_mmaps_after_fork): Add ERROR_NOACCESS to the list of
3076 ReadProcessMemory() error codes that trigger a retry with temporary
3077 PAGE_READONLY access. Note that this can occur on NT 4.0.
3079 2003-01-15 Christopher Faylor <cgf@redhat.com>
3081 * path.cc (normalize_posix_path): Convert win32 path separators to
3082 slashes when full path is specified.
3084 2003-01-15 Pierre Humblet <pierre.humblet@ieee.org>
3086 * cmalloc.cc (_cmalloc): Fix memory leak.
3088 2003-01-15 Corinna Vinschen <corinna@vinschen.de>
3090 * autoload.cc: Fix copyright date.
3091 * fhandler_dsp.cc: Ditto.
3096 * syscalls.cc: Ditto.
3100 2003-01-14 Corinna Vinschen <corinna@vinschen.de>
3102 * mmap.cc (fixup_mmaps_after_fork): Copy protection to child process.
3103 Change ambiguous debug output.
3105 2003-01-14 Corinna Vinschen <corinna@vinschen.de>
3107 * mmap.cc (mmap_record::access): Change argument type to caddr_t
3109 (mprotect): Protect against calling VirtualProtect() for shared
3111 (fixup_mmaps_after_fork): If ReadProcessMemory() fails, try to
3112 change protection of parent page to PAGE_READONLY, then try again.
3113 Revert protection afterwards.
3115 2003-01-14 Thomas Pfaff <tpfaff@gmx.net>
3117 * syscalls.cc (system): Add pthread_testcancel call.
3118 * thread.cc: Update list of cancellation points.
3120 2003-01-14 Thomas Pfaff <tpfaff@gmx.net>
3122 * wait.cc: Include thread.h
3123 (wait4): Add pthread_testcancel call.
3124 Wait for child process and cancellation event.
3125 * thread.cc: Update list of cancellation points.
3127 2003-01-14 Thomas Pfaff <tpfaff@gmx.net>
3129 * signal.cc (sleep): Add pthread_testcancel call.
3130 Wait for signal and cancellation event.
3133 2003-01-14 Thomas Pfaff <tpfaff@gmx.net>
3135 * exceptions.cc (handle_sigsuspend): Add pthread_testcancel call.
3136 Wait for signal and cancellation event.
3137 * thread.cc: Update list of cancellation points.
3139 2003-01-14 David Huang <davehzhr@hotmail.com>
3141 * fhandler_dsp.cc (fhandler_dsp::ioctl): Add limited support for
3144 2003-01-12 Christopher Faylor <cgf@redhat.com>
3146 * ntdll.h: Fix typo.
3148 2003-01-12 Corinna Vinschen <corinna@vinschen.de>
3150 * uname.cc (uname): Use cygwin_gethostname() to retrieve hostname.
3152 2003-01-12 Pierre Humblet <pierre.humblet@ieee.org>
3154 * sec_acl.cc (search_ace): Use id == -1, instead of < 0, as wildcard.
3155 (setacl): Start the search for a matching default at the next entry.
3156 Invalidate the type of merged entries instead of clearing it.
3157 Use well_known_creator for default owner and owning group and do
3158 not try to merge non-default and default entries in these cases.
3159 (getacl): Recognize well_known_creator for default owner and group.
3160 (acl_worker): Improve errno settings and streamline the nontsec case.
3161 * security.cc (write_sd): Remove the call to set_process_privilege.
3162 (alloc_sd): If the owner changes, call set_process_privilege and return
3163 immediately on failure. Change inheritance rules: on new directories add
3164 inherit only allow ACEs for creator_owner, creator_group and everyone.
3165 Preserve all inheritances through chmod and chown calls. Introduce
3166 isownergroup to implement the uid == gid case, to keep the inheritance
3167 code simple. Do not initialize owner_sid and group_sid and stop using
3170 2003-01-10 Christopher Faylor <cgf@redhat.com>
3172 * net.cc: Use gethostname define from winsock2.h.
3174 2003-01-10 Christopher Faylor <cgf@redhat.com>
3176 * path.cc: Unrevert below reversion except for
3177 mount_info::conv_to_posix_path part.
3179 2003-01-10 Corinna Vinschen <corinna@vinschen.de>
3181 * path.cc: Revert patch from 2003-01-09 to normalize a windows path
3182 rather than converting to posix.
3184 2003-01-10 Corinna Vinschen <corinna@vinschen.de>
3186 * autoload.cc (gethostname): Make call optional, return 1 if function
3188 * net.cc (cygwin_gethostname): Call GetComputerName if return value
3189 of gethostname is non-zero.
3191 2003-01-10 Charles Wilson <cwilson@ece.gatech.edu>
3193 * cygwin.din: Add asprintf and vasprintf, as well as the reentrant
3194 versions and underscore variants.
3195 * include/cygwin/version.h: Bump CYGWIN_VERSION_API_MINOR.
3197 2003-01-10 Corinna Vinschen <corinna@vinschen.de>
3199 * net.cc (cygwin_gethostname): Fix call to wsock function gethostname.
3201 2003-01-09 Christopher Faylor <cgf@redhat.com>
3203 * cygthread.cc (cygthread::cygthread): Be more noisy about odd
3205 * miscfuncs.cc (low_priority_sleep): Sleep in regular priority if
3206 that's what we're currently running at.
3208 2003-01-09 Thomas Pfaff <tpfaff@gmx.net>
3210 * include/semaphore.h: Modify typedef for sem_t.
3211 * include/cygwin/types.h: Modify typedefs for pthread_t,
3212 pthread_mutex_t, pthread_key_t, pthread_attr_t,
3213 pthread_mutexattr_t, pthread_condattr_t, pthread_cond_t,
3214 pthread_rwlock_t and pthread_rwlockattr_t.
3216 2003-01-09 Thomas Pfaff <tpfaff@gmx.net>
3218 * thread.h (WAIT_CANCELED): New define.
3219 (pthread::cancelable_wait): New static method.
3220 * thread.cc (pthread::cancelable_wait): Implement.
3221 (semaphore::Wait): Wait on semaphore and thread cancellation.
3222 (pthread::join): Wait on joined thread and thread cancellation.
3223 (semaphore::wait): Add testcancel to check for thread
3224 cancellation even if the semaphore is available.
3226 2003-01-09 Thomas Pfaff <tpfaff@gmx.net>
3228 * include/pthread.h: Add define for errorchecking mutexes.
3229 Change default mutex type.
3230 * thread.cc (pthread_cond::TimedWait): Update mutex unlock
3232 (pthread_mutex::pthread_mutex): New implement.
3233 (pthread_mutex::~pthread_mutex): Ditto.
3234 (pthread_mutex::Lock): Ditto.
3235 (pthread_mutex::TryLock): Ditto.
3236 (pthread_mutex::UnLock): Ditto.
3237 (pthread_mutex::Destroy): Implement new method.
3238 (pthread_mutex::SetOwner): Ditto.
3239 (pthread_mutex::LockRecursive): Ditto.
3240 (pthread_mutex::fixup_after_fork): Restore locking state after
3242 (__pthread_mutex_lock): Return pthread_mutex::Lock errorcode.
3243 (__pthread_mutex_trylock): Return pthread_mutex::TryLock
3245 (__pthread_mutex_unlock): Return pthread_mutex::UnLock
3247 (__pthread_mutex_destroy): Call pthread_mutex::Destroy to
3249 (__pthread_mutexattr_settype): Allow errorchecking and recursive
3251 * thread.h (MUTEX_LOCK_COUNTER_INITIAL): New define.
3252 (pthread_mutex::criticalsection): Remove.
3253 (pthread_mutex::lock_counter): New member.
3254 (pthread_mutex::recursion_counter): Ditto.
3255 (pthread_mutex::owner): Ditto.
3256 (pthread_mutex::type): Ditto.
3257 (pthread_mutex::Destroy): New method.
3258 (pthread_mutex::SetOwner): Ditto.
3259 (pthread_mutex::LockRecursive): Ditto.
3261 2003-01-09 Thomas Pfaff <tpfaff@gmx.net>
3263 * pthread.cc (pthread_cond_init): Use new pthread_cond::init.
3264 * thread.cc: Some white spaces cleanups.
3265 Change __pthread_cond_init to pthread_cond::init throughout.
3266 (nativeMutex): Move class methods outside pthread_mutex.
3267 (MTinterface::Init): Initialize pthread_cond init lock.
3268 (pthread_cond::condInitializationLock): Instantiate.
3269 (pthread_cond::initMutex): New Method.
3270 (pthread_cond::isGoodInitializerOrBadObject): Ditto.
3271 * thread.h: Some white spaces cleanups.
3272 (nativeMutex): Move class declaration outside pthread_mutex.
3273 (pthread_cond::condInitializationLock): New static member.
3274 (pthread_cond::initMutex): New Method.
3275 (pthread_cond::isGoodInitializerOrBadObject): Ditto.
3276 (__pthread_cond_init): Remove prototype.
3278 2003-01-09 Corinna Vinschen <corinna@vinschen.de>
3280 * fhandler_disk_file.cc (num_entries): Return 2 as link count if
3281 directory unreadable.
3283 2003-01-09 Corinna Vinschen <corinna@vinschen.de>
3285 * security.cc (get_nt_attribute): Always return -1 when read_sd()
3287 (get_file_attribute): Set permissions to 0 and owner/group to -1
3288 if security descriptor is unreadable.
3290 2003-01-09 Christopher Faylor <cgf@redhat.com>
3292 Use isdirsep rather than SLASH_P throughout.
3293 * path.cc (iscygdrive): Disallow /cygdrive\x.
3294 (normalize_posix_path): "Normalize" a windows path, if detected, rather
3295 than converting to posix.
3297 2003-01-06 Troy Curtiss <troyc@usa.net>
3299 * fhandler_serial.cc (fhandler_serial::tcsetattr): Add support and
3300 capability checking for B230400 bitrate.
3301 (fhandler_serial::tcgetattr): Add support for B230400 bitrate.
3302 * include/sys/termios.h: Add B230400 definition for Posix support of
3305 2003-01-05 Christopher Faylor <cgf@redhat.com>
3307 * pinfo.cc (_pinfo::commune_send): Use myself->lock rather than just
3310 2003-01-03 Christopher Faylor <cgf@redhat.com>
3312 * dtable.h (dtable::in_vfork_cleanup): New function. True if vfork
3314 * dtable.cc (dtable::vfork_parent_restore): Remove assertion.
3315 * pipe.cc (fhandler_pipe::close): Don't close read_state during
3316 fork_fixup since it wasn't inherited.
3318 2003-01-01 Christopher Faylor <cgf@redhat.com>
3320 * passwd.cc (getpwuid_r32): Revert previous change.
3322 2003-01-01 Christopher Faylor <cgf@redhat.com>
3324 * sysconf.cc (sysconf): Return arbitrary values for
3325 _SC_GETGR_R_SIZE_MAX, _SC_LOGIN_NAME_MAX, _SC_GETPW_R_SIZE_MAX.
3327 * passwd.cc (getpwuid_r32): Add uid/gid fields to size check