Commit Graph

466 Commits

Author SHA1 Message Date
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
Christopher Faylor 95ec0f241f * mmap.cc (munmap): Check that mmap and munmap length match. 2000-11-28 21:25:45 +00:00
Corinna Vinschen e1a993d549 * fhandler.cc (fhandler_disk_file::open): Check for buggy CreateFile
condition.
        * path.cc (path_conv::check): Get file system type in call to
        GetVolumeInformation to check for file systems with buggy CreateFile.
        * path.h (enum path_types): Add PATH_HASBUGGYOPEN.
        (class path_conv): Add methods `has_buggy_open' and
        `set_has_buggy_open'.
2000-11-28 18:45:42 +00:00
Christopher Faylor fe1c7fe7a6 * fhandler.cc (is_at_eof): New function.
(fhandler_base::raw_read): Detect special case where last error ==
ERROR_NOACCESS but the file is at EOF.  Most UNIXes do not consider this to be
an error.
2000-11-26 21:45:16 +00:00
Christopher Faylor e0cdea91fe * include/cygwin/version.h: Bump DLL minor version number to 7. 2000-11-26 19:46:17 +00:00
Corinna Vinschen 2e68f6b47e * include/cygwin/version.h: Bump minor API version due to adding
inet_aton.
2000-11-25 10:29:49 +00:00
Corinna Vinschen 0bec01198b * net.cc (cygwin_inet_aton): New function.
* cygwin.din: Export cygwin_inet_aton as inet_aton.
2000-11-25 10:23:55 +00:00
Christopher Faylor 93c1e56b2d * path.cc (mount_info::read_cygdrive_info_from_registry): Read system cygdrive
prefix with KEY_READ.
(mount_info::get_cygdrive_info): Ditto.
2000-11-24 18:04:44 +00:00
Christopher Faylor 0217c5bb3b * Makefile.in: new-temp.a -> new-templib.a 2000-11-22 16:19:53 +00:00
Christopher Faylor 9784d54da8 * spawn.cc (spawn_guts): Quoting was still wrong. Keep trying to fix it. 2000-11-20 22:10:13 +00:00
Christopher Faylor 099efae038 * spawn.cc (spawn_guts): YA tweak for dealing with arcane rules of quoting in
"normal" Microsoft programs.
* child_info.h: Bump fork magic number.
* include/sys/mount.h: Add an entry for mixed mode.
2000-11-20 19:35:45 +00:00
Corinna Vinschen 46ba13261b * path.cc (normalize_posix_path): Special care for root directory
in case of files beginning with a dot.
2000-11-17 18:39:47 +00:00
Corinna Vinschen 1126c2b042 * syslog.cc (syslog): Add users SID to NT syslog entry. 2000-11-17 11:30:14 +00:00
Christopher Faylor 879c443594 Fix typo. 2000-11-17 05:15:17 +00:00
Christopher Faylor 5758fdf31d * fhandler_console.cc: New member variable `dwBufferSize' for `info'.
(fillin_info): Set `dwBufferSize' to the size of the console buffer.
(clear_screen): Use width of console buffer to calculate how many spaces to
clear.
2000-11-17 03:01:14 +00:00
Christopher Faylor 992b0a24d0 * Makefile.in: Make import library creation 'make -j2' friendly. 2000-11-16 20:32:27 +00:00
Corinna Vinschen eb79d041f8 * uinfo.cc (uinfo_init): Call `cygwin_set_impersonation_token' to
reset `cygheap->user.token' to INVALID_HANDLE_VALUE.
2000-11-16 09:53:26 +00:00
Christopher Faylor 0dc9dc8b3a Update ChangeLog. 2000-11-16 05:21:03 +00:00
Christopher Faylor 0d675c5d7f * sigproc.cc (wait_sig): Remove unneeded for loop iteration.
* exceptions.cc (interrupt_setup): Don't set signal mask here or races occur
with main thread.  Set it in sigdelayed instead.
(sigreturn): Reflect change in stack order of ebp and flags.
(sigdelayed): Set stack frame correctly.  Call set_process_mask here with flags
for last trapped signal.
(signal_dispatch): Add newmask.
* sigproc.cc (wait_sig): Eliminate ill-considered attempt to halt looping
signal processors.
2000-11-16 05:16:59 +00:00
Corinna Vinschen cb6f4dbd0c * uinfo.cc (internal_getlogin): Change parameter list to reflect
that `token' is member of cygheap_user now.
        (uinfo_init): Use modified internal_getlogin.
        * syscalls.cc (seteuid): Ditto.
2000-11-15 21:14:27 +00:00
Corinna Vinschen 66c161baac * cygheap.h: Move `token' and `impersonated' from class _pinfo
to class cygheap_user.
        * pinfo.h: Ditto.
        * fork.cc (fork_child): Change usage of `token' and `impersonated'
        accordingly.
        (fork_parent): Ditto.
        * security.cc (cygwin_set_impersonation_token): Ditto.
        * sigproc.cc (proc_subproc): Ditto.
        * spawn.cc (spawn_guts): Ditto.
        * syscalls.cc (seteuid): Ditto.
        * uinfo.cc (uinfo_init): Ditto.
2000-11-15 21:04:02 +00:00
Corinna Vinschen cc35b56c95 * spawn.cc (spawn_guts): Revert patch to ignore chroot settings
on creating native Win32 environment.
2000-11-15 09:01:33 +00:00
Christopher Faylor 5ba05cab08 * fork.cc (slow_pid_reuse): Off-by-one. 2000-11-15 06:46:19 +00:00
Christopher Faylor 84aeff4126 Throughout use myself->ppid_handle rather than parent_alive.
* child_info.h (child_info): Eliminate parent_alive.
* dcrt0.cc (dll_crt0_1): Call fork_init for debugging pid creation.
* fork.cc (fork_child): Reflect change to fixup_mmaps_after_fork arguments.
(slow_pid_reuse): New function to grab last 'n' pids to prevent pid reuse.
(fork_parent): Move last_fork_proc into slow_pid_reuse.  Handle fork_pids
debugging.  Eliminate unnecessary call to set_child_mmap_ptr.
(fork_init): New debugging function.
* mmap.cc (fixup_mmaps_after_fork): Renamed from recreate_mmaps_after_fork.
Rely on copied data after a fork.
(set_child_mmap_ptr): Eliminate.
* pinfo.h (_pinfo): Eliminate parent_alive, mmap_ptr and reflect above changes.
* spawn.cc (spawn_guts): Eliminate vestiges of "old way" of sending new hProc
to parent process.
2000-11-15 06:27:48 +00:00
Corinna Vinschen fb0a875733 Fix formatting. 2000-11-15 00:13:44 +00:00
Corinna Vinschen 1f0f8e127c * cygheap.cc (cygheap_root::cygheap_root): New function.
(cygheap_root::~cygheap_root): Ditto.
        (cygheap_root::operator=): Ditto.
        (cygheap_user::~cygheap_user): Ditto.
        (cygheap_user::set_name): Ditto.
        (cygheap_user::set_logsrv): Ditto.
        (cygheap_user::set_domain): Ditto.
        (cygheap_user::set_sid): Ditto.
        * cygheap.h (cygheap_root): New class.
        (cygheap_user): Ditto.
        (init_cygheap): Change type of `root' member to cygheap_root.
        Add `user' member.
        * dir.cc (opendir): Use new `cygheap_root' class.
        * dcrt0.cc (dll_crt0_1): Use new `cygheap_user' class.
        * fork.cc (fork_parent): Ditto.
        * grp.cc (getgroups): Ditto.
        * passwd.cc (search_for): Ditto.
        * path.cc: Use new `cygheap_root' class throughout.
        * pinfo.h (_pinfo): Remove `use_psid'. Move `username', `psid',
        `logsrv', `domain', `orig_{uid,gid}' and `real_{uid,gid}' to
        cygheap_user class.
        * security.cc: Use new `cygheap_user' class throughout.
        * shared.cc (sec_user): Ditto.
        * sigproc.cc (proc_subproc): Remove copy statements for user
        related information moved to `cygheap_user' class.
        * spawn.cc (spawn_guts): Invalidate current chroot settings
        when creating Windows environment. Use new `cygheap_user' class.
        * syscalls.cc: Use new `cygheap_user' class throughout.
        * uinfo.cc: Ditto.
        * uinfo.cc (internal_getlogin): Change parameters to reflect the
        move of user information to cygheap.
2000-11-15 00:13:09 +00:00
Corinna Vinschen fe8c097112 * dir.cc (rewinddir): Always set __d_position = 0, so next
call to readdir() will restart the directory scan.
2000-11-14 16:06:52 +00:00
Christopher Faylor a4785603b8 * cygheap.h (init_cygheap): New struct holding values that live in the Cygwin
heap.
* child_info.h (child_info): Change pointer type of cygheap to init_cygheap.
* cygheap.cc (init_cheap): Point cygheap_max after contents of cygheap.  Move
some stuff into cygheap.h.
* dir.cc (opendir): Change to use root and rootlen in cygheap rather than in
myself.
(mkdir): Change to use umask in cygheap rather than in myself.
* path.cc: Ditto, throughout.
* syscalls.cc (_open): Ditto.  Change to use umask in cygheap rather than in
myself.
(chroot): Change to allocate root dir on the cygwin heap.
(umask): Change to use umask in cygheap rather than in myself.
(cygwin_bind): Ditto.
* sigproc.cc (proc_subproc): Don't copy umask or root stuff as this happens
automatically now.
* pinfo.h (_pinfo): Migrate stuff out of here and into init_cheap.
* dcrt0.cc (dll_crt0_1): Call cygheap_init later in startup for first cygwin
process.
2000-11-14 05:53:32 +00:00
Christopher Faylor 70a11195b9 * path.cc (get_device_number): Allow /dev/ttySn to designate a com port. 2000-11-13 04:06:41 +00:00
Christopher Faylor 49421cd9c5 * path.h: Add __attribute__ ((regparm(x))) to commonly used functions.
* pinfo.h: Ditto.
* sigproc.h: Ditto.
* sync.h: Ditto.
2000-11-12 04:57:41 +00:00
Christopher Faylor 6ccb6bcf3d * dcrt0.cc: New global variable `ignore_case_with_glob'.
(dll_crt0_1): Disable case-insensitive globbing before calling `main'.
* environ.cc (glob_init): New static function to set or clear
`ignore_case_with_glob'.
(known): Changed "glob" entry to call `glob_init'.
* glob.c (match): Use case-insensitive globbing if needed.
2000-11-11 05:36:34 +00:00
Corinna Vinschen edd7573015 * dir.cc (readdir): Avoid reading from the beginning when
readdir is called after a previous call has returned NULL.
2000-11-09 13:32:33 +00:00
Christopher Faylor c5d03f3dca * select.cc (peek_pipe): Deal with pending newline in pty_master. 2000-11-09 02:03:33 +00:00