* resource.cc (getrlimit): Set errno on EFAULT instead of returning it.
(setrlimit): Ditto.
Patch by David Sainty <David.Sainty@optimation.co.nz>:
* resource.cc (setrlimit): Prevent failing with an error when the
operation would not have changed anything.
Corinna Vinschen [Wed, 27 Dec 2000 00:13:57 +0000 (00:13 +0000)]
* cygwin.din: Add symbols for `getrlimit' and `setrlimit'.
* exceptions.cc (stackdump): Avoid creating stackdump when
`rlim_core' is 0.
* resource.cc: New global variable `rlim_core'.
(getrlimit): New function.
(setrlimit): Ditto.
include/cygwin/version.h: Bump minor API version to 32 due to
adding `getrlimit' and `setrlimit'.
include/sys/resource.h: Add defines, types and prototypes for
`getrlimit' and `setrlimit'.
* autoload.h: Make DLL initializers global to avoid inlining.
* exceptions.cc (interrupt_setup): Reorganize arguments to allow use of
regparm.
(interrupt_now): Ditto.
(interrupt_on_return): Ditto.
(call_handler): Ditto.
Jan Hubicka [Wed, 20 Dec 2000 13:24:13 +0000 (13:24 +0000)]
* tc-i386.h (i386_target_format): Define even for ELFs.
(QWORD_MNEM_SUFFIX): New macro.
(CpuK6,CpuAthlon,CpuSledgehammer, Cpu64, CpuNo64, CpuUnknownFlags):
New macros
(CpuMMX,CpuSSE,Cpu3dnow, CpuUnknown): Renumber.
(IgnoreSize, DefaultSize, No_?Suf, FWait, IsString, regKludge, IsPrefix,
ImmExt): Renumber.
(Size64, No_qSuf, NoRex64, Rex64): New macros.
(Reg64, Imm32S, Imm64, Disp32S, Disp64): New macros.
(Imm8, Imm8S, Imm16, Imm32, Imm1, BaseIndex, Disp8, Disp16, Disp32,
InOutPortReg,ShiftCount, Control, Debug, Test, FloatReg, FloatAcc,
SReg2, SReg3, Acc, JumpAbsolute, RegMMX, RegXMM, EsSeg, InvMem): Renumber.
(Reg, WordReg): Add Reg64.
(Imm): Add Imm32S and Imm64.
(EncImm): New.
(Disp): Add Disp64 and Disp32S.
(AnyMem): Add Disp32S.
(RegRex, RegRex64): New macros.
(rex_byte): New type.
* tc-i386.c (set_16bit_code_flag): Kill.
(fits_in_unsigned_long, fits_in_signed_long): New functions.
(reloc): New parameter "signed"; support x86_64.
(set_code_flag): New.
(DEFAULT_ARCH): New macro; default to "i386".
(default_arch): New static variable.
(struct _i386_insn): New fields Operand_PCrel; rex.
(flag_16bit_code): Kill; All tests replaced to "flag_code == CODE_64BIT";
(flag_code): New enum and static variable.
(use_rela_relocations): New static variable.
(flag_code_names): New static variable.
(cpu_arch_flags): Default to CpuUnknownFlags|CpuNo64.
(cpu_arch): Add "sledgehammer"; Add CPUAthlon to Athlon and CpuK6 to
K6 and Athlon.
(i386_align_code): Return plain "nop" for x86_64.
(mode_from_disp_size): Support Disp32S.
(smallest_imm_type): Support Imm32S and Imm64.
(offset_in_range): Support size of 8.
(set_cpu_arch): Do not clobber to Cpu64/CpuNo64.
(md_pseudo_table): Add "code64"; use set_code_flat.
(md_begin): Emit sane error message on hash failure.
(tc_i386_fix_adjustable): Support x86_64 relocations.
(md_assemble): Support QWORD_MNEM_SUFFIX, REX registers,
instructions supported on particular arch just partially,
output of 64bit immediates, handling of Imm32S and Disp32S type.
(i386_immedaite): Support x86_64 relocations; support 64bit constants.
(i386_displacement): Likewise.
(i386_index_check): Cleanup; support 64bit addresses.
(md_apply_fix3): Support x86_64 relocation and rela.
(md_longopts): Add "32" and "64".
(md_parse_option): Add OPTION_32 and OPTION_64.
(i386_target_format): Call even for ELFs; choose between
elf64-x86-64 and elf32-i386.
(i386_validate_fix): Refuse GOTOFF in 64bit mode.
(tc_gen_reloc): Support rela relocations and x86_64.
(intel_e09_1): Support QWORD.
Corinna Vinschen [Tue, 19 Dec 2000 19:52:57 +0000 (19:52 +0000)]
* environ.cc (struct parse_thing): Add entry for new CYGWIN option
`smbntsec'.
* path.cc (path_conv::check): Check path for being a remote path.
If so and `allow_smbntsec' is set to FALSE, set has_acls to FALSE.
* security.cc: Add global definition for `allow_smbntsec'.
* security.h: Add extern declaration for `allow_smbntsec'.
* fhandler.cc (fhandler_disk_file::open): Eliminate extern declaration
of `allow_ntsec'.
* syscalls.cc: Ditto.
* cygcheck.cc (cygwin_info): Add some more bounds checking. From Matt Harget
<matt@use.net>:
* utils/cygcheck.cc (keyeprint): Move declaration before other functions so it
could be used by all functions to report error messages. Add comment.
(add_path): Check for NULL return from malloc.
(find_on_path): Check initial uses of pointers for NULL.
(rva_to_offset): Ditto.
(init_paths): Add checking for return values of Win32 calls.
(get_dword): Ditto.
(get_word): Ditto.
(dll_info): Ditto, also add NULL pointer checks.
(scan_registry): Ditto.
(check_keys): Ditto.
(dump_sysinfo): Ditto. Add default case to switch. Add error reporting if
GetVolumeInformation fails, except when it returns ERROR_NOT_READY.
(track_down): Add checking for NULL pointers and return values of Win32 calls.
(cygwin_info): Ditto. Correct small memory leak.
* fhandler.h (fhandler_console): Add additional argument to char_command
method.
* fhandler_console.cc (fhandler_console::read): Revert previously misapplied
patch.
(fhandler_console::char_command): Add a second argument.
(fhandler_console::write): Recognize when a '?' is found after a <esc>[.
Jeff Johnston [Thu, 14 Dec 2000 00:25:06 +0000 (00:25 +0000)]
2000-12-13 Jeff Johnston <jjohnstn@redhat.com>
* libc/stdlib/ldtoa.c (_ldcheck): New routine
that categorizes a long double as NaN, Infinity, or other.
* libc/stdio/vfprintf.c [WANT_IO_LONG_DBL](_VFPRINTF_R): Removed
isinfl and isnanl static routines which were i386-specific. Changed
calls to the two removed routines to a single _ldcheck call.
* libc/stdio/vfieeefp.h (ldieee): Fixed missing semi-colons.
Jeff Johnston [Wed, 13 Dec 2000 19:32:45 +0000 (19:32 +0000)]
2000-12-13 Jeff Johnston <jjohnstn@redhat.com>
* Makefile.am: Fixed install-data-local target to use
$(mkinstalldirs) for the installed header files to ensure
the directories exist before copying.
* Makefile.in: Regenerated.
Jeff Johnston [Tue, 12 Dec 2000 01:24:09 +0000 (01:24 +0000)]
2000-12-11 Joel Sherrill <joel@OARcorp.com>
* Merge RTEMS specific .h files into main libc/include.
* libc/sys/rtems/include/signal.h: Removed.
* libc/sys/rtems/include/time.h: Removed.
* libc/sys/rtems/sys/features.h: Removed.
* libc/sys/rtems/sys/sched.h: Removed.
* libc/sys/rtems/sys/siginfo.h: Removed.
* libc/sys/rtems/sys/signal.h: Removed.
* libc/sys/rtems/sys/time.h: Removed.
* libc/sys/rtems/sys/times.h: Removed.
definitions for time_t and clock_t since these are
no longer in time.h.
* libc/include/pthread.h: New file.
* libc/include/sys/sched.h: New file.
* libc/include/sys/features.h: New file.
* libc/include/time.h: Removed duplicate definition of clock_t
and time_t, get them from <sys/types.h> instead. Add prototypes for POSIX clock and timer functionality.
* libc/sys/linux/sys/types.h: Changed to include
* libc/include/machine/types.h: Add _CLOCKID_T_ and _TIMER_T_.
* libc/include/sys/signal.h: Add more complete set of POSIX
signal functionality including real-time and threaded signals.
* libc/include/sys/types.h: Add clock_t, time_t, struct
timespec, and struct itimerspec. Centralizing these makes
things cleaner. RTEMS uses 64-bit dev_t.
Added numerous primitive definitions
for pthreads including macros, pthread_attr_t,
pthread_mutexattr_t, pthread_condattr_t, pthread_key_t,
pthread_once_t, and pthread_t.
* libc/include/sys/unistd.h: Added getlogin_r() prototype.
If RTEMS follow POSIX on read(), write() and sbrk() prototype.
Feature flags removed and moved to new file <sys/features.h>.
Full set of POSIX sysconf() constants
Corinna Vinschen [Mon, 11 Dec 2000 19:45:54 +0000 (19:45 +0000)]
* net.cc (cygwin_rexec): Eliminate superfluous call to
`set_socket_inheritance'.
* include/sys/socket.h: Add SUS defines for option values to `shutdown'.
Jan Hubicka [Mon, 11 Dec 2000 14:01:46 +0000 (14:01 +0000)]
* tc-i386.c (md_assemble): Refuse 's' and 'l' suffixes in the intel
mode; convert 'd' suffix to 's' or 'l'; remove all DWORD_MNEM_SUFFIX
references.
(intel_e09_1): Convert QWORD to 'l' suffix for FP operations; refuse
otherwise.
* tc-i386.h (DWORD_MNEM_SUFFIX): Kill.
(No_dSuf): Kill.
* i386.h (*_Suf): Remove No_dSuf.
(d_suf, wld_Suf,sld_Suf, sldx_Suf, bwld_Suf, d_FP, sld_FP, sldx_FP)
Remove.
(i386_optab): Remove 'd' in the suffixes.
* autoload.cc: Autoload CharToOemA.
* dcrt0.cc (dll_crt0_1): Translate command line to OEM if current codepage is
OEM.
* environ.cc: Add new option 'codepage' to CYGWIN environment variable.
* fhandler_clipboard.cc (fhandler_clipboard::read): Read clipboard in OEM mode
if current codepage is OEM.
* fhandler_console.cc (fhandler_console::read): Only translate console input if
current codepage is ANSI.
* fhandler_console.cc (fhandler_console::write_normal): Translate output data
if current codepage is ANSI.
* pinfo.cc (codepage_init): New function. Setup current codepage from CYGWIN
environment variable and set codepage for file APIs.
* security.cc (read_sd): Translate file name to it if current codepage is OEM.
* winsup.h: (sys_wcstombs,sys_mbstowcs): Use current codepage for translations
between multibyte and widechar string and vice versa.
* path.cc (normalize_win32_path): Check for explicit use of two slashes at the
beginning of a path. These should be treated specially regardless of whether
they are UNC paths or old-style //a paths. Avoid adding cwd to a path if the
path already begins with '/'.
* path.cc (normalize_win32_path): Reorganize logic to accomodate chroot.
Always check for MAX_PATH overrun. Avoid adding one too many backslashes when
src path begins with a slash. From Corinna Vinschen.
* winsup.h: Force demangling for dll_crt0 for newer compilers.
* Makefile.am: $(INSTALL), $(INSTALL_DATA), and $(INSTALL_PROGRAM)
can be a relative path to $(top_srcdir)/install.sh so ensure the
autoconf detected settings are properly passed recursively.
Similarly, add AM_MAKEFLAGS to FLAGS_TO_PASS so they also get passed
properly to subdirectories.
* Makefile.in: Regenerated.
* mkpasswd.c: make default home directory /home/$user if one
can't be found in user registry. Allow user to override
that with command line arg.
(longopts): Fix typo in `local-groups' option.
(main): Initialize `passed_home_path' before first usage.
Jeff Johnston [Wed, 6 Dec 2000 23:50:11 +0000 (23:50 +0000)]
2000-12-06 Jeff Johnston <jjohnstn@redhat.com>
* libc/stdlib/Makefile.am: Added ldtoa.c to list of sources.
* libc/stdlib/Makefile.in: Regenerated.
* libc/stdio/floatio.h: Added suitable MAXEXP for long double.
* libc/stdio/vfieeefp.h: Added long double bit structures.
* libc/stdio/vfprintf.c[WANT_IO_LONG_DBL]: Added long double support.
[WANT_IO_LONG_DBL](isinfl, isnanl): New static long double routines.
(exponent): Changed expbuf to reasonable maximum instead of MAXEXP.
* libc/stdio/vfscanf.c[WANT_IO_LONG_DBL]: Added long double support.
* libc/stdlib/ldtoa.c: New file containing _ldtoa_r and
_strtold routines used for conversions between character
and long double.
* Makefile.in: Change `-nostartfiles' to `-nostdlib' to avoid
automatic linking with default libraries when linking new-cygwin1.dll.
Link with libgcc.a and libstdc++.a explicitly.
Jeff Johnston [Mon, 4 Dec 2000 18:34:49 +0000 (18:34 +0000)]
2000-12-04 Joel Sherrill <joel@OARcorp.com>
* libc/sys/rtems/crt0.c: Add stubs for functions implicitly
referenced by code generated by gcc 2.8.1.
(a29k): Add stubs for V_SPILL, V_FILL, V_BSD_OS, V_EPI_OS to
satisfy gcc.
* Makefile.common: Eliminate checks for libgcc.a and libstdc++.a. Use CXX for
g++ compiles.
* configure.in: Find correct c++ compiler.
* configure: Regenerate.
* Makefile.in: Use CXX to build the DLL.
* configure.in: Find correct c++ compiler.
* configure: Regenerate.
* path.cc (normalize_posix_path): Put correct drive at beginning of \foo style
paths.
(chdir): Don't send non-posix path to cygcwd.set.