* fhandler_proc.cc: Add <sys/param.h> include.
(format_proc_uptime): Use KernelTime and UserTime only as they include the
other counters.
(format_proc_stat): KernelTime includes IdleTime, so subtract IdleTime from
KernelTime. Make number of 'jiffies' per second same as HZ define.
* fhandler_process.cc: Add <sys/param.h> include.
(format_process_stat): Make number of 'jiffies' per second same as HZ define.
Use KernelTime and UserTime only to calculate start_time.
* fhandler_tty.cc (fhandler_tty_slave::fhandler_tty_slave): Set "don't need
ready for read" flag.
(fhandler_tty_slave::read): Don't do anything special with vtime when vmin ==
0.
(inspired by a patch from Egor Duda)
* select.cc (fhandler_tty_slave::ready_for_read): Remove.
* fhandler.h (fhandler_tty_slave::ready_for_read): Remove declaration.
* fhandler_tty.cc (fhandler_tty_slave::read): Don't do anything special with
vtime when vmin == 0.
* autoload.cc (GetConsoleWindow): Correct parameter count.
* miscfuncs.cc (check_iovec_for_read): Don't check buffer when zero length
iov_len.
(check_iovec_for_write): Ditto.
* fhandler.h (fhandler_base::readv): New method.
(fhandler_base::writev): Ditto.
* fhandler.cc (fhandler_base::readv): New method.
(fhandler_base::writev): Ditto.
* syscalls.cc (_read): Delegate to readv(2).
(_write): Ditto, mutatis mutandi.
(readv): Rewrite, based on the old _read code, to use the new
fhandler_base::readv method. Improve access mode handling and ensure all calls
reach the final strace statement.
(writev): Ditto, mutatis mutandi.
* include/sys/uio.h (struct iovec): Change field types to match SUSv3.
* winsup.h (check_iovec_for_read): New function.
(check_iovec_for_write): Ditto.
* miscfuncs.cc (check_iovec_for_read): Ditto.
(check_iovec_for_write): Ditto.
Jeff Johnston [Thu, 29 Aug 2002 15:32:08 +0000 (15:32 +0000)]
2002-08-29 Jeff Johnston <jjohnstn@redhat.com>
* libc/locale/locale.c (_setlocale_r)[MB_CAPABLE]: Fix so
default locale "" is accepted for LC_CTYPE or LC_MESSAGES
and is treated as if "C" was specified.
* cygthread.cc (hthreads): Remove unneeded global.
(cygthread::simplestub): New static member function.
(cygthread::runner): Don't set hthreads.
(cygthread::freerange): New member function.
(cygthread::operator new): Call freerange if all cygwin slots are used up.
(cygthread::exit_thread): Don't mess with event if freerange thread.
(cygthread::detach): Ditto.
* cygthread.h (class cygthread): Declare new member functions and variables.
Jeff Johnston [Thu, 29 Aug 2002 00:22:10 +0000 (00:22 +0000)]
2002-08-28 Jeff Johnston <jjohnstn@redhat.com>
* Makefile.am (install-data-local): Move install of build
newlib.h after installing headers in libc/include so as to
overwrite default newlib.h.
* Makefile.in: Regenerated.
Corinna Vinschen [Wed, 28 Aug 2002 10:18:20 +0000 (10:18 +0000)]
* fhandler_socket.cc (fhandler_socket::recvfrom): Eliminate flags
not understood by WinSock.
(fhandler_socket::sendto): Ditto. If WinSock sendto() returns
WSAESHUTDOWN, change errno to EPIPE and raise SIGPIPE if MSG_NOSIGNAL
isn't set in flags.
* include/cygwin/socket.h: Define MSG_WINMASK and MSG_NOSIGNAL.
* include/cygwin/version.h: Bump API minor number.
Jeff Johnston [Tue, 27 Aug 2002 20:30:15 +0000 (20:30 +0000)]
2002-08-27 Jeff Johnston <jjohnstn@redhat.com>
* configure.host: Remove _ELIX_LEVEL flag setting.
* Makefile.am(stmp-targ-include): Copy newlib.h to targ-include.
(install-data-local): Install newlib.h.
* Makefile.in: Regenerated.
* aclocal.m4: Ditto.
* configure: Ditto.
* configure.in: Add AM_CONFIG_HEADER to generate newlib.h based on
newlib.hin. Add AC_DEFINE_UNQUOTED entries for _ELIX_LEVEL
and _NEWLIB_VERSION to fill in newlib.h header file entries.
In AC_OUTPUT statement, unset ac_file so multilib support does
not use last ac_file temporary used in newlib.h configuration.
* libc/include/_ansi.h: Include <newlib.h>.
* newlib.hin: New template file for newlib.h.
* stamp-h.in: New file.
Jeff Johnston [Tue, 27 Aug 2002 20:27:35 +0000 (20:27 +0000)]
2002-08-27 Jeff Johnston <jjohnstn@redhat.com>
* Makefile.am(stmp-targ-include): Copy newlib.h to targ-include.
(install-data-local): Install newlib.h.
* Makefile.in: Regenerated.
* aclocal.m4: Ditto.
* configure: Ditto.
* configure.in: Add AM_CONFIG_HEADER to generate newlib.h based on
newlib.hin. Add AC_DEFINE_UNQUOTED entries for _ELIX_LEVEL
and _NEWLIB_VERSION to fill in newlib.h header file entries.
In AC_OUTPUT statement, unset ac_file so multilib support does
not use last ac_file temporary used in newlib.h configuration.
* libc/include/_ansi.h: Include <newlib.h>.
* newlib.hin: New template file for newlib.h.
* stamp-h.in: New file.
* child_info.h: Add _PROC_WHOOPS enum value.
(CURR_CHILD_INFO_MAGIC): Update.
(child_info::magic): Make 'long'.
* cygheap.h: Export _cygheap_start.
* cygheap.cc: Don't declare _cygheap_start.
* cygmagic: Use cksum to produce checksums. Append 'U' to end of checksum.
* dcrt0.cc (initial_env): Calculate sleep ms before reusing buffer.
(_dll_crt0): Detect cygheap mismatch as indicative of different cygwin version.
Set child_proc_info to NULL when _PROC_WHOOPS.
(multiple_cygwin_problem): If child_info specific problem, then set
child_proc_info type to _PROC_WHOOPS.
* shared_info.h (CURR_MOUNT_MAGIC): Update.
(CURR_SHARED_MAGIC): Ditto.
* include/winsock2.h (SOCKET_ADDRESS): Define if
__CSADDR_T_DEFINED is not defined (copied from nspapi.h)
(CSADDR_INFO): Ditto.
(nspapi.h) : Don't include. Removed FIXME comment.
* include/nspapi.h (SOCKET_ADDRESS) Only define if
__CSADDR_T_DEFINED is not defined.
(CSADDR_INFO): Ditto.
(BLOB): Added structure and typedef if not already defined.
(NS_*): Add defines.
(SERVICE_*): Ditto.
(SERVICE_ADDRESS): Add structure and typedefs.
(SERVICE_ADDRESSES): Ditto.
(SERVICE_INFO[AW]): Ditto, and add UNICODE mappings.
(LPSERVICE_ASYNC_INFO): Add typedef.
(SetService[AW], GetAddressByName[AW]): Add prototypes and UNICODE
mappings.
* include/wsipx.h: New file.
* include/svcguid.h: New file.
* lib/test.c: Include wspix.h and svcguid.h.
Corinna Vinschen [Mon, 26 Aug 2002 09:56:06 +0000 (09:56 +0000)]
* sec_acl.cc (getacl): Check ace_sid == well_known_world_sid
before owner_sid and group_sid so that well_known_world_sid
means "other" even when owner_sid and/or group_sid are Everyone.
* security.cc (get_attribute_from_acl): Created from code common
to get_nt_attribute() and get_nt_object_attribute(), with same
reordering as in getacl() above.
(get_nt_attribute): Call get_attribute_from_acl().
(get_nt_object_attribute): Ditto.
* libc/include/malloc.h: On cygwin, define malloc _r functions as wrapper
macros to standard malloc functions.
* libc/include/stdlib.h: Ditto.
* configure.host: Always define MALLOC_PROVIDED on cygwin.
* Makefile.in (cygcheck.exe): Make a -mno-cygwin program.
* cygrun.c (main): Export CYGWIN=ntsec unless otherwise set.
* shared.cc (shared_name): Only add build date to shared name when
*testing*.
* Makefile.in (RUNTEST): Use Makefile's srcdir and bupdir* macros, where
appropriate.
* winsup.api/winsup.exp: Use -nodefaultlibs when linking executable to avoid
potentially linking installed dll.
* Makefile.in (DLL_IMPORTS): Move libuuid.a and libshell32.a to list rather
than referring to them via -l. Add DLL imports last in link line for
new-cygwin.dll and cygrun.exe.
Jeff Johnston [Tue, 20 Aug 2002 01:40:39 +0000 (01:40 +0000)]
2002-08-19 Jeff Johnston <jjohnstn@redhat.com>
* libc/include/sys/types.h: Support __need_inttypes macro
that only sets the __intxx and __uintxx types.
* libc/machine/powerpc/Makefile.am: Add stdlib to include directories
to get mprec.h.
* libc/machine/powerpc/Makefile.in: Regenerated.
* libc/machine/powerpc/vfprintf.c: Fix state variable type.
* libc/machine/powerpc/vfscanf.c: Fix state variable type. Remove
redundant fixed-point conversion prototypes.
* libc/machine/powerpc/machine/stdlib.h[__SPE__]: Include <sys/types.h>
after setting __need_inttypes.
Elena Zannoni [Mon, 19 Aug 2002 20:55:48 +0000 (20:55 +0000)]
2002-08-19 Elena Zannoni <ezannoni@redhat.com>
From matthew green <mrg@redhat.com>
* ppc.h (PPC_OPCODE_SPE): New opcode flag for Powerpc e500
instructions.
(PPC_OPCODE_ISEL, PPC_OPCODE_BRLOCK, PPC_OPCODE_PMR,
PPC_OPCODE_CACHELCK, PPC_OPCODE_RFMCI): New opcode flags for the
e500x2 Integer select, branch locking, performance monitor,
cache locking and machine check APUs, respectively.
(PPC_OPCODE_EFS): New opcode type for efs* instructions.
(PPC_OPCODE_CLASSIC): New opcode type for Classic PowerPC instructions.
* pinfo.h (pinfo::remember): Arrange for destructor call if proc_subproc
returns error.
* sigproc.cc (zombies): Store 1 + total zombies since proc_subproc uses
NZOMBIES element.
* fhandler.h (fhandler_console::send_winch_maybe): New method.
* fhandler_console.cc (set_console_state_for_spawn): Remove if 0'ed code.
(fhandler_console::send_winch_maybe): Define new method.
(fhandler_console::read): Use send_winch_maybe where appropriate.
(fhandler_console::init): Just call all tcsetattr rather than output_tcsetattr.
* select.cc (peek_console): Reorganize so that send_winch_maybe is called for
everything but keyboard input.
* perthread.h (vfork_save): Add ctty, sid, pgid, exitval fields.
(vfork_save::restore_pid): New method.
(vfork_save::restore_exit): New method.
* fork.cc (vfork): Save ctty, sid, pgid and restore them when returning to
"parent". Use exitval field if exiting but never created a new process.
* syscalls.cc (setsid): Detect when in "vfork" and force an actual fork so that
pid will be allocated (UGLY!).
(getsid): New function.
* dcrt0.cc (do_exit): Use vfork_save::restore_exit method for returning from a
vfork.
* spawn.cc (spawnve): Use vfork_save::{restore_pid,restore_exit} methods for
returning from vfork.
* cygwin.din: Export getsid.
* include/cygwin/version.h: Bump api minor number.
* malloc.cc: #ifdef sYSTRIm for when MORECORE_CANNOT_TRIM is true.
* sigproc.cc (sigCONT): Define.
* sigproc.h (sigCONT): Declare.
(wait_sig): Create sigCONT event here.
* exceptions.cc (sig_handle_tty_stop): Wait for sigCONT event rather than
stopping thread.
(sig_handle): Set sigCONT event as appropriate on SIGCONT rather than calling
ResumeThread.
Jeff Johnston [Sat, 17 Aug 2002 05:19:18 +0000 (05:19 +0000)]
2002-08-17 Jeff Johnston <jjohnstn@redhat.com>
* Makefile.am: Move cmath stuff into libc/sys/linux.
* Makefile.in: Regenerated.
* configure.host: Default -DMB_CAPABLE for x86-linux.
* libc/include/reent.h: Define _sbrk to take signed int argument.
* libc/include/sys/unistd.h: Ditto for _sbrk_r and sbrk.
* libc/locale/locale.c[MB_CAPABLE]: Add LC_MESSAGES support and
make locale name checking more efficient. Also allow "C-ISO-8859-1"
locale for LC_CTYPE and LC_MESSAGES.
* libc/reent/sbrkr.c: Change prototype to take ptrdiff_t.
* libc/sys/linux/brk.c: Change sbrk prototype.
* libc/sys/linux/include/time.h: Remove Cygwin stuff and
include <sys/features.h>.
(CLOCK_THREAD_CPUTIME): Renamed to CLOCK_THREAD_CPUTIME_ID.
(CLOCK_PROCESS_CPUTIME): Renamed to CLOCK_PROCESS_CPUTIME_ID.
* libc/sys/linux/sys/cdefs.h: Replace with glibc sys/cdefs.h
with a few local additions.
* libc/sys/linux/sys/features.h: New file.
* libc/sys/linux/sys/unistd.h: Change _sbrk_r and sbrk prototypes
to take signed argument.
* libc/syscalls/syssbrk.c: Change sbrk, _sbrk_r, and _sbrk
prototypes to take signed size argument.
* Makefile.in: Add support for new malloc.o and renamed malloc_wrapper.o. Use
-fomit-frame-pointer for malloc.o compilation.
* malloc_wrapper.cc: New file. Rename from malloc.cc. Add support for more
malloc functions. Eliminate export_* calls. Just use straight malloc names.
Remove unused argument from malloc lock functions.
* cygwin.din: Just export straight malloc names. Add malloc_stats,
malloc_trim, malloc_usable_size, mallopt, memalign, valloc.
* dcrt0.cc (__cygwin_user): Eliminate export_* malloc entries.
* fork.cc (fork_parent): Remove unused argument from malloc_lock argument.
* malloc.cc: New file. Doug Lea's malloc v2.7.1.
* cygmalloc.h: New file.
* include/cygwin/version.h: Bump API_MINOR.
* sync.h (muto::acquire): Use appropriate number for regparm attribute.
(muto::reset): Ditto.
(muto::release): Ditto.