Commit Graph

498 Commits

Author SHA1 Message Date
Christopher Faylor 29c39fe3dd * cygwin.din: Add export for setlogmask().
* syslog.cc (setlogmask): New function.
2001-01-22 15:55:34 +00:00
Corinna Vinschen c807d3552a * resource.cc (setrlimit): Support RLIMIT_NOFILE. 2001-01-18 09:30:37 +00:00
Christopher Faylor 4e2a97b2ac * syscalls.cc (setdtablesize): Call with amount to increment not total amount.
Return success or failure error code.
2001-01-18 04:26:04 +00:00
Christopher Faylor a7cde2b98a * autoload.cc (LoadDLLinitfunc): Remove debugging statement.
* exceptions.cc (sig_handle_tty_stop): Move setting of PID_STOPPED to earlier
in interrupt.
((interrupt_setup): i.e., here.
(sig_handle): Don't queue multiple SIGSTOPS.
* fhandler.h (bg_check_types): Enumerate return value of bg_check for clarity.
* signal.cc (kill_pgrp): Minor cleanup.
* fhandler_termios.cc (fhandler_termios::bg_check): Use enumerated type for
function return.  Don't raise signal if a signal is already queued.
* fhandler_console.cc (fhandler_console::read): Use enumerated return type for
bg_check.
* select.cc: Ditto, throughout.
* read.cc: Ditto, throughout.
* termios.cc: Ditto, throughout.
(_read): YA interrupt detect simplification.
* wait.cc (wait4): Ditto.
2001-01-17 14:57:09 +00:00
Corinna Vinschen cb503978ab * cygheap.cc (cygheap_user::~cygheap_user): Temporarily
disable free'ing memory.
2001-01-17 12:47:47 +00:00
Corinna Vinschen 9fedfd57d4 * mmap.cc (mmap): Initialize fh to avoid compiler warnings. 2001-01-16 17:02:46 +00:00
Christopher Faylor 9470a80c8b * wait.cc (wait4): Rename variable for consistency. Allow restartable signal
behavior.
2001-01-16 02:29:47 +00:00
Corinna Vinschen 9334c89c1d * mmap.cc (mmap): Add more parameter checking. Change error output
in case of EINVAL. Treat mmapping /dev/zero like MAP_ANONYMOUS.
2001-01-15 22:18:14 +00:00
Corinna Vinschen c6dd43f263 * mmap.cc: include <unistd.h>. Define some bit operations for
the new page map.
        (mmap_record): Change type of base_address_ to caddr_t.
        Add map_map_ member. Add several methods to manipulate map_map_.
        (mmap_record::alloc_map): New method.
        (mmap_record::free_map): Ditto.
        (mmap_record::find_empty): Ditto.
        (mmap_record::map_map): Ditto.
        (mmap_record::unmap_map): Ditto.
        (list::add_record): Change return type to `mmap_record *'.
        Allocate page map.
        (list::match): New method.
        (mmap): Partly rewritten to take care for the new page map. Add some
        parameter checking.
        (munmap): Ditto.
2001-01-15 19:42:33 +00:00
Corinna Vinschen 66097f06dd * heap.cc (heap_init): Fix extern declaration of getpagesize.
* syscalls.cc (getpagesize): Fix another typo.
2001-01-15 12:53:30 +00:00
Corinna Vinschen dc3651b6cd * syscalls.cc (getpagesize): Save pagesize in global variable to
avoid calling GetSystemInfo too often.
        * heap.cc (getpagesize): Eliminate.
        (heap_init): Use getpagesize function from syscalls.cc.
2001-01-15 12:25:00 +00:00
Corinna Vinschen 4cf2c0e0cb * sysconf.cc (sysconf): return `getpagesize ()' on _SC_PAGESIZE
request to avoid implementing the same twice.
2001-01-15 10:58:19 +00:00
Christopher Faylor a3ec080b35 * syscalls.cc (_read): Use more lightweight method for determining if read has
been interrupted by a signal.
2001-01-14 19:08:30 +00:00
Christopher Faylor c3d62298ba * debug.h: Add regparm attributes to some functions.
* signal.cc (sigaction): Don't treat SIGCONT specially.
* exceptions.cc (interrupt_setup): Save sa_flags of interrupted signal for
later use.
(sig_handler): Default any stopping signal to SIGSTOP.
(call_signal_handler): New function.
(sigdelayed0): New function.
* sigproc.cc (sigproc_init): Initialize SIGSTOP sigaction for special behavior.
* sigproc.h: Define call_signal_handler.
* syscalls.cc (_read): Allow restartable signal behavior.
2001-01-12 05:38:25 +00:00
Corinna Vinschen c4efddf601 * fhandler.h (fhandler_base): New method `fixup_mmap_after_fork'.
(fhandler_disk_file: Ditto.
        (fhandler_dev_mem): Ditto.
        * fhandler_mem.cc (fhandler_dev_mem::open): Set OBJ_INHERIT attribute
        for device\physicalmemory handle.
        (fhandler_dev_mem::mmap): Ditto.
        * fhandler_mem.cc (fhandler_dev_mem::fixup_mmap_after_fork): New method.
        * mmap.cc (mmap_record): Add private `fdesc_' member. Change constructor
        accordingly.
        (get_fd): New method.
        (mmap): Use new mmap_record constructor.
        (fhandler_base::fixup_mmap_after_fork): New method.
        (fhandler_disk_file::fixup_mmap_after_fork): Ditto.
        (fixup_mmaps_after_fork): Call `fixup_mmap_after_fork' of appropriate
        fhandler class.
2001-01-11 12:33:12 +00:00
Christopher Faylor 7416e1d2f6 * sigproc.cc (wait_sig): Allow SIGCONT when stopped. 2001-01-10 13:53:38 +00:00
Corinna Vinschen 55ae1dff87 Patch suggested by Ren� M�ller Fonseca <fonseca@mip.sdu.dk>
* include/sys/socket.h: Change prototype to have 2nd parameter `const'.
        * net.cc (cygwin_bind): Change 2nd parameter to `const'.
2001-01-09 16:00:58 +00:00
Christopher Faylor 077ec4cb37 * pinfo.cc (codepage_init): Move function.
* environ.cc (codepage_init): To here.
* exceptoins.cc (SIG_NONMASKABLE): Remove SIGCONT from consideration since it
is supposed to be maskable.
* signal.cc (sigaction): Ditto.
* sigproc.cc (wait_sig): Ditto.
* winsup.h: Eliminate global declaration of codepage_init.
2001-01-08 04:02:02 +00:00
Corinna Vinschen f3236259b4 * 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.
2001-01-05 09:01:18 +00:00
Christopher Faylor a5e570bcc3 * thread.cc: Need LONG_MAX definition. 2001-01-04 18:33:39 +00:00
Christopher Faylor 4104f35e67 * thread.cc (MTinterface::CreateSemaphore): Correctly set semaphore max. 2001-01-03 18:50:25 +00:00
Christopher Faylor c79ec95060 * fhandler_console.cc (fhandler_console::read): Restore missing test for code
page before doing OemToCharBuff.
2001-01-03 14:45:47 +00:00
Christopher Faylor 1bdc5f1fab Wed Jan 3 09:20:20 2001 Jason Tishler <jt@dothill.com>
* include/cygwin/version.h: Fix typo in CYGWIN_VERSION_DLL_COMBINED
	macro.
2001-01-03 14:44:13 +00:00
Corinna Vinschen 8a93913d26 * 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'.
2000-12-27 00:13:57 +00:00
Christopher Faylor 2803e941b3 * 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.
2000-12-26 03:21:05 +00:00
Christopher Faylor 48c4679d55 * include/cygwin/version.h: Bump DLL minor version number to 8. 2000-12-25 18:37:44 +00:00
Corinna Vinschen d6a289bac1 Fix syntax. 2000-12-20 12:43:22 +00:00
Corinna Vinschen aa2b85cc90 * autoload.cc: Add load statemant for SetSecurityDescriptorControl.
* security.cc (alloc_sd): Always set SE_DACL_PROTECTED flag on
        Win2K and higher.
2000-12-20 12:42:43 +00:00
Christopher Faylor 7d72d04c77 * exceptions.cc (reset_signal_arrived): Make global to avoid inlining. 2000-12-20 06:03:16 +00:00
Christopher Faylor 2bfdcd8a5f * fhandler_serial.cc (fhandler_serial::raw_read): Always find number of bytes
ready to be read whether overlapped_armed or not.
2000-12-20 05:57:59 +00:00
Corinna Vinschen 3112d7a41c * syscalls.cc (remove): New function, overriding the newlib
implementation.
2000-12-19 20:43:41 +00:00
Corinna Vinschen 5827f4d98a * 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.
2000-12-19 19:52:57 +00:00
Christopher Faylor 085ec17c5d * fhandler_console.cc (read): Add support for xterm-style mouse event
reporting.
(fhandler_console::char_command): Honor mouse events.
(fhandler_console::open): Enable mouse input events.
(fhandler_console::input_tcsetattr): Ditto.
* select.cc (peek_console): Add check for mouse events.
2000-12-16 03:11:02 +00:00
Christopher Faylor 7fbcbc9592 * path.cc (normalize_posix_path): Calculate path name length overruns more
dynamically.
(normalize_win32_path): Ditto.
* Makefile.in: Avoid scanning the directory twice for *.d files.
2000-12-15 22:25:51 +00:00
Christopher Faylor 80d0051c37 * 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>[.
2000-12-15 04:42:20 +00:00
Corinna Vinschen 947411367d * net.cc (cygwin_rexec): Eliminate superfluous call to
`set_socket_inheritance'.
        * include/sys/socket.h: Add SUS defines for option values to `shutdown'.
2000-12-11 19:45:54 +00:00
Christopher Faylor 67bd6fb222 * include/sysexits: New file. 2000-12-10 22:19:50 +00:00
Christopher Faylor ee1d77e4b7 * 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.
2000-12-10 00:45:12 +00:00
Christopher Faylor 307cb8ba82 * 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 '/'.
2000-12-09 21:31:49 +00:00
Christopher Faylor 82c8d7ef8c * 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.
2000-12-09 03:29:33 +00:00
Corinna Vinschen 2a688c15ad * cygwin.din: Declare strtok_r for the import lib. Already in the DLL. 2000-12-07 19:43:37 +00:00
Corinna Vinschen 81e615de98 * winsup/cygwin/include/sys/uio.h: readv: Correct prototype
writev: ditto.
2000-12-06 22:42:26 +00:00
Corinna Vinschen fdb352765e * include/sys/uio.h: Include <sys/cdefs.h>. Use __BEGIN_DECL and
__END_DECL.
        Add declarations for `readv' and `writev'.
2000-12-05 16:08:48 +00:00
Corinna Vinschen 785e8cc89e * 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.
2000-12-04 20:05:41 +00:00
Christopher Faylor 191bacb0be * path.cc (normalize_win32_path): Handle UNC paths better.
(slash_unc_prefix_p): Allow backslash UNC paths.
2000-12-03 06:21:40 +00:00
Christopher Faylor b0a187e204 * Makefile.in: Remove some extra cruft. 2000-12-03 05:20:56 +00:00
Christopher Faylor 6c057e82df * 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.
2000-12-03 05:16:33 +00:00
Corinna Vinschen 6b6a8cefad * net.cc (get_inet_addr ): Close AF_UNIX socket file after reading. 2000-12-02 21:29:00 +00:00
Corinna Vinschen 09872ef885 * cygheap.cc (chgheap_root::operator =): Check root dir properly. 2000-11-29 22:27:15 +00:00
Corinna Vinschen 38c5dd446e * net.cc (cygwin_inet_aton): Return nonzero if the address
is valid, zero if not according to Linux man page.
2000-11-29 17:15:00 +00:00