* mount.cc (do_mount): Default to non-exec option for remote drives. Report
warnings before attempting a mount.
(longopts): Add no-executable option.
(mount_commands): Ditto.
(opts): Ditto.
(usage): Ditto. Indicate that system mount is now the default.
(main): Accommodate no-executable option. Make system mount the default.
* umount.cc (usage): Indicate that system umount is now the default.
(main): Make system umount the default.
* fhandler.h (executable_states): For now, make dont_care_if_executable
equivalent to not_executable.
* sys/mount.h: Define MOUNT_NOTEXEC.
* path.h (fs_info): New class.
(path_conv): Move fs-specific fields to new 'fs' structure.
(path_conv::update_fs_info): Move to fs_info and rename to just 'update'.
* path.cc (fs_info::update): Ditto. Return 'true' if successful.
(fillout_mntent): Add ',noexec' to list of reported options.
* autoload.cc: Add dynamic load statements for 'ZwQueryInformationProcess' and
'ZwQueryVirtualMemory'.
* fhandler.h: Change type of bufalloc and filesize members of fhandler_virtual
from int to size_t. Change type of position member from __off32_t to
__off64_t. Add new fileid member to fhandler_virtual class. Make seekdir take
an __off64_t argument. Make lseek take an __off64_t argument. Add
fill_filebuf method to fhandler_virtual. Add fill_filebuf method to
fhandler_proc. Add fill_filebuf method to fhandler_registry. Add fill_filebuf
method to fhandler_process. Add saved_pid and saved_p members to
fhandler_process.
* fhandler_proc.cc (proc_listing_array): Add 'loadavg', 'meminfo', and 'stat'.
(proc_fhandlers array): Ditto.
(fhandler_proc::open): Use fill_filebuf to flesh out the file contents.
(fhandler_proc::fill_filebuf): New method.
(fhandler_proc::format_proc_meminfo): Ditto.
(fhandler_proc::format_proc_stat): Ditto.
(fhandler_proc::format_proc_uptime): Ditto.
* fhandler_process.cc (process_listing): Add 'stat' and 'statm'.
(fhandler_process::fstat): Find the _pinfo structure for the process named in
the filename. Return ENOENT if the process is no longer around. Set the gid
and uid fields of the stat structure.
(fhandler_process::open): Store pid and pointer to _pinfo structure in
saved_pid and saved_p respectively. Use fill_filebuf to flesh out file
contents.
(fhandler_proc::fill_filebuf): New method.
(format_process_stat): New function.
(format_process_status): Ditto.
(format_process_statm): Ditto.
(get_process_state): Ditto.
(get_mem_values): Ditto.
* fhandler_registry.cc (fhandler_registry::seekdir): Change argument type from
__off32_t to __off64_t.
(fhandler_registry::fill_filebuf): New method.
* fhandler_virtual.cc (fhandler_virtual::seekdir): Change argument type from
__off32_t to __off64_t.
(fhandler_virtual::lseek): Ditto.
(fhandler_virtual::fill_filebuf): New method.
(fhandler_virtual::fhandler_virtual): Initialise fileid to -1.
* wincap.cc: Set flag has_process_io_counters appropriately.
* wincap.h: Add flag has_process_io_counters.
* libnosys/acconfig.h (HAVE_SECTION_ATTRIBUTES): New macro.
* libnosys/configure.in: Check gcc's support for section attributes.
* libnosys/warning.h: Have link_warning expand to nothing if gcc
does not support section attributes.
* signals.h: Update comments.
(enum target_signal): Remove conditional compilation around
Mach-specific signals. Move them to after TARGET_SIGNAL_DEFAULT.
* acinclude.m4: Add support for --enable-newlib-multithread.
* configure.host (newlib_cflags): Add -D__SINGLE_THREAD__ if
--enable-newlib-multithread=no.
* libc/stdio/getc_u.c: New file.
* libc/stdio/getchar_u.c: New file.
* libc/stdio/putc_u.c: New file.
* libc/stdio/putchar_u.c: New file.
* libc/include/stdio.h: Add declarations for getc_unlocked,
getchar_unlocked, putc_unlocked and putchar_unlocked.
* libc/stdio/Makefile.am (LIB_SOURCES): Add new files.
(CHEWOUT_FILES): Add new files' .def's.
* libc/stdio/putchar.c (_putchar_r): Replace __sputc with putc.
Joern Rennecke [Wed, 8 May 2002 17:56:50 +0000 (17:56 +0000)]
* libc/machine/sh/memset.S (memset, __SHMEDIA__ code):
Also handle as single quad word when destination ends at last
byte of first quad word. Fix byte selection in single quad code.
* dumper.cc (usage) Standardize usage output. Generalize to allow use for
help.
(longopts) New struct. Added longopts for all options.
(print_version) New function.
(main) Change getopt to getopt_long. Accommodate new help and version options.
* libc/machine/powerpc/vfprintf.c[__ALTIVEC__]: Add vector
support for 'p' format. Fix code to print bytes for vector
integer formats that do not specify 'h' or 'l'.
* libc/machine/powerpc/vfscanf.c[__ALTIVEC__]: Add vector support
for 'p' specifier. Fix code to scan 16 bytes for vector integer
formats that do not specify 'h' or 'l'.
Jeff Johnston [Mon, 6 May 2002 20:44:54 +0000 (20:44 +0000)]
2002-05-06 Jeff Johnston <jjohnstn@redhat.com>
* libc/include/sys/reent.h (_l64a_buf): New reentrant area.
(_REENT_L64A_BUF): New macro for accessing area.
* libc/stdlib/Makefile.am: Add a64l.c and l64a.c.
* libc/stdlib/Makefile.in: Regenerated.
* libc/stdlib/a64l.c: New file.
* libc/stdlib/l64a.c: New file.
* net.cc (getdomainname): Change second argument of getdomainname to size_t.
* fhandler_proc.cc (proc_listing): Add '.' and '..' to directory listing.
(fhandler_proc::open): Change use of mode to flags. If the file does not exist
already, fail with EROFS if O_CREAT flag is set. Change EROFS error to EACCES
error when writing to a file. Use cmalloc to allocate memory for filebuf.
(fhandler_proc::close): Use cfree to free filebuf.
(fhandler_proc::get_proc_fhandler): Properly detect attempts to access unknown
subdir.
* fhandler_process.cc (process_listing): Add '.' and '..' to directory listing.
(fhandler_process::open): Use cmalloc to allocate memory for filebuf.
(fhandler_process::close): Use cfree to free filebuf.
* fhandler_registry.cc (registry_listing): Add . and '..' to directory
listing.
(fhandler_registry::open): Move check for open for writing before open_key.
Use cmalloc to allocate memory for filebuf.
(fhandler_registry::close): Use cfree to free filebuf.
(fhandler_registry::telldir): Use lower 16 bits of __d_position as position in
directory.
(fhandler_registry::seekdir): Ditto.
* fhandler_virtual.cc (fhandler_virtual::write): Change EROFS error to EACCES
error.
(fhandler_virtual::open): Set the NOHANDLE flag.
(fhandler_virtual::dup): Add call to fhandler_base::dup. Allocate child's
filebuf using cmalloc. Copy filebuf from parent to child.
(fhandler_virtual::close): Use cfree to free filebuf.
(fhandler_virtual::~fhandler_virtual): Ditto.
(from Chris Faylor <cgf@redhat.com>).
(fhandler_registry::readdir): Add support for '.' and '..' files in
subdirectories of /proc/registry.
* path.cc (path_conv::check): Do not return ENOENT if a file is not found in
/proc.
* fhandler_proc.cc (fhandler_proc::fstat): Use fhandler name rather than
path_conv name.
(fhandler_proc::open): Ditto.
* fhandler_process.cc (fhandler_process::fstat): Use fhandler name rather than
path_conv name.
(fhandler_process::open): Ditto.
* fhandler_registry.cc (fhandler_registry::fstat): Use fhandler name rather
than path_conv name.
(fhandler_registry::open): Ditto.
* path.cc (path_conv::check): Don't copy posix path when virtual.
(mount_info::conv_to_win32_path): Don't zero string when isproc. Just derive
normal windows path.
* path.h (path_conv::clear_normalized_path): Declare new method.
* path.cc (path_conv::clear_normalized_path): Define new method.
* dtable.cc (build_fhandler_from_name): Clear normalized path when finished to
conserve space.
* fhandler_proc.cc (fhandler_proc::fstat): Prime with information from
fhandler_base::fstat. Use defines rather than constants for permission
settings.
Robert Collins [Thu, 2 May 2002 11:26:22 +0000 (11:26 +0000)]
2002-05-02 Robert Collins <rbtcollins@hotmail.com>
* thread.cc (__pthread_cond_dowait): Fix a race on signalling from a
thread woken by the same condition variable it's signalling on. Thanks
to Michael Beach for the report and test case.
* path.h (pathconv_arg): Add PC_POSIX.
(path_conv): Add normalized_path field.
* path.cc (path_conv::~path_conv): New destructor.
(path_conv::check): Set normalized_path, where appropriate.
* dtable.cc (build_fhandler_from_name): Use normalized path from path_conv.
* syscalls.cc (chroot): Ditto.
* cygheap.h: Remove path_prefix_p declaration. Christopher Faylor
<cgf@redhat.com> (minor fixups)
* Makefile.in: Add fhandler_proc.o, fhandler_registry.o, fhandler_process.o and
fhandler_virtual.o.
* dtable.cc (dtable::build_fhandler): Add entries for FH_PROC, FH_REGISTRY and
FH_PROCESS. Set unix_name to the normalized posix path.
* fhandler.h: Add constants for FH_PROC, FH_REGISTRY and FH_PROCESS. Add class
declarations for fhandler_virtual, fhandler_proc, fhandler_registry and
fhandler_virtual. Update fhandler_union accordingly.
* fhandler_proc.cc: New file. Add implementation for fhandler_proc.
* fhandler_virtual.cc: New file. Add implementation for fhandler_virtual.
* fhandler_process.cc: New file. Add implementation for fhandler_process.
* fhandler_registry.cc: New file. Add implementation for fhandler_registry.
* path.cc: Add isproc and isvirtual_dev macros.
* path.cc (path_conv::check): Add check for virtual devices.
* path.cc (mount_info::conv_to_win32_path): Convert paths in /proc to empty
Win32 paths.
* path.cc (chdir): Replace check for FH_CYGDRIVE with more generic
isvirtual_dev macro. Force setting of posix path for virtual fhandlers.
* path.h: Add externally visible path_prefix_p and normalized_posix_path
prototypes.
DJ Delorie [Tue, 30 Apr 2002 03:30:24 +0000 (03:30 +0000)]
* config/mh-cxux: remove dead code
* config/mh-dgux386: remove dead code
* config/mh-hp300: remove dead code
* config/mh-hpux: remove dead code
* config/mh-hpux8: remove dead code
* config/mh-irix5: remove dead code
* config/mh-irix6: remove dead code
* config/mh-ncr3000: remove dead code
* config/mh-ncrsvr43: remove dead code
* config/mh-necv4: remove dead code
* config/mh-sco: remove dead code
* config/mh-solaris: remove dead code
* config/mh-sysv: remove dead code
* config/mh-sysv4: remove dead code
* config/mh-sysv5: remove dead code
* config/mh-irix4: remove, contains only dead code
* configure.in: delete reference to absent file
Jonathan Larmour [Mon, 29 Apr 2002 21:49:56 +0000 (21:49 +0000)]
* libc/sys/arm/syscalls.c (_rename): New function. Just a stub.
(_system): New function. Ditto.
* libc/stdlib/system.c (_system_r): Call _system if HAVE_SYSTEM.
* configure.host: define HAVE_SYSTEM and HAVE_RENAME for xscale
targets.
* mkgroup.c (main): Change call to exit() to a return statement.
* mkpasswd.c (main): Ditto.
* mkpasswd.c (usage): Simplify usage output. Generalize to allow use
for help. Correct '?' typo to 'h'.
(longopts): Add version option.
(opts): Add 'v' version option.
(print_version): New function.
(main): Accommodate new version option. Accommodate usage parameter
changes.
Jeff Johnston [Fri, 26 Apr 2002 20:18:52 +0000 (20:18 +0000)]
2002-04-26 Jeff Johnston <jjohnstn@redhat.com>
* configure.in (CC_FOR_NEWLIB): New variable that
bases on $(CC) and adds targ-include and libc/include as
-isystem directives if they are not already part of $(CC).
* Makefile.am (AM_MAKEFLAGS): Change setting of CC to equal
$(CC_FOR_NEWLIB).
* configure: Regenerated.
* Makefile.in: Ditto.
* configure.in (CC_FOR_BUILD): Set to gcc whether
cross-compiling or not.
(CC): Add -isystem's for targ-include and libc/include when they
do not already appear in CC.
Jeff Johnston [Fri, 19 Apr 2002 23:52:48 +0000 (23:52 +0000)]
2002-04-19 Alexandre Oliva <aoliva@redhat.com>
* libc/include/sys/config.h: Remove include of <limits.h>.
(__INT_MAX__, __LONG_MAX__): Define like GCC's limits.h would
define INT_MAX and LONG_MAX. Use them in tests.
Jeff Johnston [Fri, 19 Apr 2002 19:16:22 +0000 (19:16 +0000)]
2002-04-19 Jeff Johnston <jjohnstn@redhat.com>
* configure.host: Add support for powerpc-eabialtivec*.
* libc/include/malloc.h: Add include of <machine/malloc.h>.
* libc/include/stdlib.h: Add include of <machine/stdlib.h>.
* libc/include/machine/malloc.h: New file.
* libc/include/machine/stdlib.h: Ditto.
* libc/include/machine/setjmp.h: Add support for powerpc altivec.
* libc/machine/powerpc/Makefile.am: Add conditional objects and
sources based on configuration.
* libc/machine/powerpc/Makefile.in: Regenerated.
* libc/machine/powerpc/configure: Ditto.
* libc/machine/powerpc/configure.in: Add check for
powerpc-eabialtivec* in which case add in additional source files.
* libc/machine/powerpc/setjmp.S: Add altivec support.
* libc/machine/powerpc/vec_calloc.c: New file.
* libc/machine/powerpc/vec_free.c: Ditto.
* libc/machine/powerpc/vec_malloc.c: Ditto.
* libc/machine/powerpc/vec_mallocr.c: Ditto.
* libc/machine/powerpc/vec_realloc.c: Ditto.
* libc/machine/powerpc/machine/malloc.h: Ditto.
* libc/machine/powerpc/machine/stdlib.h: Ditto.
* libc/machine/powerpc/vfprintf.c: New file that is vfprintf.c
with added altivec format specifiers.
* libc/machine/powerpc/vfscanf.c: New file that is vfscanf.c with
added altivec format specifiers.
DJ Delorie [Fri, 19 Apr 2002 17:36:40 +0000 (17:36 +0000)]
sync from gcc
2002-04-18 Tom Tromey <tromey@redhat.com>
* configure.in: Disallow configuring libgcj when it is already
installed and we're using Solaris 2.8 linker. Do enable libgcj on
Solaris 2.8 by default. For PR libgcj/6158.
* config/mh-a68bsd: clean out dead code
* config/mh-apollo68: clean out dead code
* config/mh-cxux: clean out dead code
* config/mh-decstation: clean out dead code
* config/mh-dgux: clean out dead code
* config/mh-dgux386: clean out dead code
* config/mh-hp300: clean out dead code
* config/mh-hpux: clean out dead code
* config/mh-hpux8: clean out dead code
* config/mh-interix: clean out dead code
* config/mh-irix4: clean out dead code
* config/mh-lynxrs6k: clean out dead code
* config/mh-mingw32: clean out dead code
* config/mh-ncr3000: clean out dead code
* config/mh-ncrsvr43: clean out dead code
* config/mh-necv4: clean out dead code
* config/mh-openedition: clean out dead code
* config/mh-riscos: clean out dead code
* config/mh-sco: clean out dead code
* config/mh-sysv4: clean out dead code
* config/mh-lynxos: removed, contained only dead code
* config/mh-vaxult2: removed, contained only dead code
* config/mh-sun3: removed, contained only dead code
* configure.in: remove references to dead files