| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* winsup/cygwin/environ.cc (conv_envvars): Static array
removed.
(conv_start_chars): Likewise.
(getwinenv): Function gutted to just return NULL.
No environment vars require conversion.
(match_first_char): Static function removed.
(build_env): Removed logic for eliminating those variables
that require donversion, since there are no such variables
and the needed functions and arrays are gone.
* winsup/cygwin/environ.cc (find_exec): Recognize
semicolon as PATH separator.
|
|
|
|
|
|
| |
* newlib/libc/stdio/findfp.c (__sinit): Add the Cygwin-specific __SCLE
(stream convert line endings) flag when calling the std function to
initializing the reent structure's _stdin, _stdout and _stderr members.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This removes (ab)uses of SetConsoleScreenBufferSize
which sometimes cause cmd.exe to badly misbehave.
It probably doesn't like the closely spaced timing of
shrinking the window down to one line followed by a restore
of the size. Instead we just output newlines to clear
the window.
* winsup/cygwin/fhandler.h (dev_console::scroll_window):
Member function declaration removed.
(dev_console::clear_should_scroll): New member
function declared.
* winsup/cygwin/fhandler_console.cc
(dev_console::scroll_window): Member function removed.
(dev_console::clear_should_scroll): New member function.
Performs only the test that was performed by scroll_window,
not the actual scrolling. The scrolling is now done in
the caller in the fhandler_console class.
(fhandler_console::clear_screen): Call con.clear_should_scroll
instead of con.scroll_window. If this returns false, act
as before. Otherwise, clear the screen by scrolling the
window. This is done not by making SetConsoleScreenBufferSize
calls to shrink and restore the window, but by earnestly
emitting a number of carriage returns equal to the vertical
screen size and then restoring the cursor position.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The previous work for simulating the beyond-right-edge of
screen cursor position is incomplete without integrating this
into the cursor positioning routines. By making the cursor
routines aware of the eat_newline flag, we allow cursor
movements to work correctly with regard to this simulated
position.
* winsup/cygwin/fhandler_console.cc
(fhandler_console::cursor_set): If the X position is beyond
the right edge of the screen, then set the cursor to the
start of the following line, rather than clipping to the
right edge, set the eat_newline flag, indicating that the
the true position is actually one character beyond the
previous line. In all other cases, clear the eat_newline
flag.
(fhandler_console::cursor_rel): Do not apply the delta vector
to the raw Win32 cursor position; call cursor_get and apply
it to the virtual cursor position which takes into account
the eat_newline flag.
(fhandler_console::cursor_get): Take into account the
eat_newline flag. If it is set, then report an adjusted
position that is one column beyond the end of the previous
line.
|
|
|
|
|
| |
* winsup/cygwin/globals.cc (allow_winsymlinks): Change
initial value from WSYM_sysfile to WSYM_lnk.
|
|
|
|
|
|
|
|
|
| |
* winsup/cygwin/environ.cc (set_winsymlinks): Refer to
CYGNAL variable in diagnostic message.
(parse_options): Pass "CYGNAL" to setenv.
(_addenv, environ_init): Call parse_options if variable name
is "CYGNAL" rather than "CYGWIN". Comments updated.
(spenvs): Change CYGWIN_DEBUG to CYGNAL_DEBUG.
|
|
|
|
|
| |
* winsup/cygwin/spawn.cc (spawnve): Rewrite /bin/sh -c cmd
invocations to use cmd.exe /c cmd instead.
|
|
|
|
|
|
|
|
| |
* newlib/libc/stdio/flags.c (__sflags): Enable for
Cygwin the piece of code which adds the O_TEXT
mode if O_BINARY is not present. And, also, fix that
piece of code's incorrect use of the | operator to
test a flag instead of &.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* winsup/cygwin/path.cc (normalize_win32_path): When
a drive-relative path is normalized, look up the remembered
working directory of that drive in the environment.
A drive-relative path is, for example, "C:file.txt".
Or just "C:", with no component. If there is no path
for the drive in the environment, then the root directory
is used, and the "C:" part thus becomes "C:\", causing
the path to refer to "C:\file.txt". Otherwise the path is
inserted, with a backslash, like "C:\users\bob\file.txt".
The Windows convention for storing these per-drive paths
in the environment is to use environment variables based
on drive letters. For instance the path for the C drive is
stored in the environment variable "!C:" (bang, letter, colon).
The path includes the C:\ prefix.
(cwdstuff::override_win32_cwd): Add the behavior of associating
the current working directory with its drive (if it is a
current working directory based on a drive). For instance
if the overriding cwd is "C:\Users", then the "C:\Users"
path is stored into the "!C:" environment variable.
|
|
|
|
|
|
|
|
|
|
|
|
| |
We don't want the behavior in Cygnal whereby a native
path like C:\path\to\app is converted to /app
in getcwd and other situations, or C:\random\path
is converted to /cygdrive/c/random/path.
* winsup/cygwin/mount.cc (mount_info::conv_to_posix_path):
Remove entire section of code which scans mount points,
mapping native paths to their mount points paths.
All we do is "slashify" and exit.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- /proc and /dev are are still available, accessed as
proc:/ and dev:/
- All other paths are native, and do not "see" virtual Cygwin
items; /cygdrive is just C:\cygdrive (if the current drive
is C).
- chdir() to a virtual directory like dev:/ or proc:/ results
in errno EOPNOTSUPP.
* winsup/cygwin/mount.cc (mount_info::conv_to_win32_path):
Takes new bool argument, hide_cygwin_virtuals. If true all
that the function does is "backslashify" the path.
(mount_info::add_item): Special hack inserted here so that
we can create the virtual root directory which holds dev
and proc and whatnot, and is passed here as "/". We cannot let
this go through normalize_posix_path any more because it
will turn to C:\.
* winsup/cygwin/mount.h (mount_info::conv_to_win32_path):
Declaration updated.
* winsup/cygwin/path.cc (is_posix_space): New static function:
tests for paths in special spaces, currently "dev:/" and
"proc:/". Used by normalize_posix_path.
(normalize_posix_path): Any path that doesn't satisfy the
is_posix_space test is treated as Win32.
Since the bulk of the code is now only used for these
spaces, the relative path handling is not required
and a the corresponding block of code is removed.
Paths satisfying is_posix_space are transformed.
I.e. the underlying path resolution machine in the path_conv
class still recognizes /proc and /dev. It's just that these
will not occur, because normalize_posix_path will convert
them to references with drive names.
(path_conv::check): Pass the is_msdos flag down to
mount_info::conv_to_win32_path as the new argument. Thus
if normalize_posix_path indicates a native path, this function
will hide the virtual spaces. Also, we add PATH_NOPOSIX and
PATH_NOACL to the object's path_flags. This is used in
chdir.
(normalize_win32_path): A small piece of logic works against
our plan here: it checks for the leading forward slash on the
path, and prevents such paths from being converted to Win32
paths with a drive reference. We eliminate this test, and
treat paths unconditionally.
(chdir): Here, if the path is not native, we return
EOPNOTSUPP. Thus it is impossible to chdir into Cygwin
virtual directories like /dev (now referenced as dev:/).
They can be listed but not turned into the current directory.
Eventually we want chdir to actually set the Win32 current
directory of the process; that can't work for virtual
dirs.
* winsup/cygwin/path.h (path_conv::is_native): New inline
accessor which tests for the PATH_NOPOSIX flag.
|
|
|
|
|
|
|
|
|
|
| |
* winsup/cygwin/spawn.cc (init_cmd_exe_path): Restructure code
to initialize rather than assign nchars. Include backslash in
cmd.exe name; then it can be omitted from the size calculation
and sprintf. Do not allocate an excess byte for the string.
Thanks to user forsvarir of the code review stackechange.
Also reformatted to the GNU style used inside Cygwin.
(init_cmd_exe_path): Remove spurious whitespace.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Instead of relying on the COMSPEC environment variable,
what we can do is assume that the program is called "cmd.exe",
and then look for it in the directory reported by the
GetSystemDirectoryA Win32 function in kernel32.dll.
* winsup/cygwin/path.h (get_cmd_exe_path): New function declared.
* winsup/cygwin/spawn.cc (av::setup): Use get_cmd_exe_path
instead of getenv("COMSPEC").
(cmd_exe_path): New static variable.
(init_cmd_exe_path): New static function.
(get_cmd_exe_path): New function.
* winsup/cygwin/syscalls.cc (system, getusershell, popen): Use
get_cmd_exe_path instead of getenv("COMSPEC").
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It is with some reluctance I make this change, due to the security
implications of relying on environment variables. But we can't have a
hard-coded path.
* winsup/cygwin/include/paths.h (_PATH_CMDEXE): Macro removed.
* winsup/cygwin/spawn.cc (av::setup): Use COMSPEC environment
variable instead of hard-coded path. If missing, bail with
errno set to EOPNOTSUPP.
* winsup/cygwin/syscalls.cc (system): Use COMSPEC environment
variable. If missing, return -1.
(getusershell): Eliminate static array of shell names. If
shell_index is zero, return value of COMSPEC env var,
if it exists, and increment shell_index to 1.
(popen): Use COMSPEC and if that is missing, set errno to
EOPNOTSUPP and return NULL.
|
|
|
|
|
|
|
|
|
| |
We must only set or clear the eat_newline flag if we output
something.
* winsup/cygwin/fhandler_console.cc
(fhandler_console::write_normal): Move the flag setting
code inside the if statement which performs output.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch addresses an issue whereby the window of
a process created with CreateProcess fails to come
to the foreground.
This occurs when the calling process itself hasn't run any
Windows event processing loop. A repro test case is to make a
program with a main, and and call CreateProcess to spawn
calc.exe or notepad.exe before doing anything else.
It turns out that a dummy call to TranslateMessage makes this
issue goes away. If such a call is made before CreateProcess,
then the spawned process' window comes up in the foreground
as expected.
* winsup/cygwin/Makefile.in (DLL_IMPORTS): We need to link
in user32.dll to call TranslateMessage. Condense the
multiple ${shell ...} call repetition with a foreach.
* winsup/cygwin/spawn.cc (child_info_spawn::worker): Do the
dummy TranslateMessage call before the section of code that
calls CreateProcess or CreateProcessAsUser.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
On the majority of VT100-like terminals, when you print a
character in the last column, the cursor sits in a kind of
"limbo", as if the cursor position were one column past the
edge of the screen. Thus when a line feed is output next,
the cursor is then at the start of the next line.
The Win32 console write doesn't do this; the cursor position
wraps to the start of the next line. If a newline is put out,
it translates to an extra newline going to the next-next line.
This spoils the behavior of programs which depend on the VT100
behavior.
In this patch, the VT100 behavior is simulated as follows. A
new flag in the dev_console structure is set when a character
is output to the last column. This flag is then observed in
order to discard a newline (or rather any character which is
mapped mapped to the DWN action).
* winsup/cygwin/fhandler.h (class dev_console): New boolean
data member, eat_newline. This indicates that if a character
is output which moves down to the next line, it should be
discarded rather than sent to the console.
* winsup/cygwin/fhandler_console.cc
(fhandler_console::write_normal): Set the eat_newline flag
if the text output ends up at column zero. Honor the
eat_newline flag when processing a DWN character, and clear
it when processing certain other control characters.
|
|
|
|
|
|
|
|
| |
This allows applications to distinguish whether they
are running on the stock Cygwin or Cygnal.
* winsup/cygwin/uname.cc (uname): sysname is now filled
in with CYGNAL_ prefix rather than CYGWIN_.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* winsup/cygwin/include/paths.h (_PATH_CMDEXE): New
preprocessor symbol.
* winsup/cygwin/spawn.cc (av_setup): Use _PATH_CMDEXE
rather than "/bin/sh".
* winsup/cygwin/syscalls.cc (system): Spawn _PATH_CMDEXE
with /c option rather than /bin/sh.
(ETC_SHELLS): Preprocessor symbol removed.
(shell_fp): Global variable removed.
(getusershell): Don't open ETC_SHELLS, just march through
static array of shell names. That array contains only one
entry: _PATH_CMDEXE.
(setusershell, endusershell): Remove references to shell_fp.
(popen): Exec _PATH_CMDEXE rather than "/bin/sh", and the
option is /c.
|
|
|
|
|
|
|
|
|
| |
* winsup/cygwin/spawn.cc (child_info_spawn::worker): Do not
call fhandler_console::need_invisible. It's not working
properly. In an application which has no console because it
was compiled -mwindows, calling this funcion causes a visible
console window to appear. We don't need this in Cygnal;
the Microsoft spawn functions don't pop up such windows.
|
|
|
|
|
|
| |
* winsup/cygwin/spawn.cc (child_info_spawn::worker): Add
STARTF_USESHOWWINDOW to dwFlags of the STARTUPINFOW structure,
and set wShowWindow to SW_SHOWNORMAL.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Bump GPLv2+ to GPLv3+ for some files, clarify BSD 2-clause.
Everything else stays under GPLv3+.
New Linking Exception exempts resulting executables from LGPLv3 section 4.
Add CONTRIBUTORS file to keep track of licensing.
Remove 'Copyright Red Hat Inc' comments.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
|
|
|
|
| |
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
|
|
|
|
| |
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
fhandler_base::open_fs has two problems:
- When newly creating a file, the file info in the path_conv is
incorrect. It points to info for the parent dir, not to info
for the file itself (which, naturally, wasn't available before).
- Fetching the file's inode number only worked for non-NFS.
Both problems should be fixed now by reloading file info if the file
has just been created, as well as using the new FS-agnostic
path_conv::get_ino method.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
|
|
|
|
|
|
|
| |
This avoids having to call nfs_fetch_fattr3/file_get_fai depending
on FS type as well as having to extract the info FS dependent.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
|
|
|
|
|
|
|
|
|
|
|
| |
Rather than having to check for the FS type in the caller and having
to call different functions whether FS is NFS or not, encapsulate the
info in path_conv_handle/path_conv methods to allow FS type agnostic
calling from upper level functions.
This patch only implements the methods.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
|
|
|
|
|
|
|
| |
gettimeofday is currently guarded with __MISC_VISIBLE || __XSI_VISIBLE.
However, gettimeofday should be always visible, as in GLibc.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
|
|
|
|
|
| |
Re-enable the use of __malloc_lock and __malloc_unlock newlib-nano, tied
the newlib-multithread.
|
|
|
|
| |
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
|
|
|
|
| |
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
|
| |
|
|
|
|
| |
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
|
|
|
|
| |
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
|
|
|
|
| |
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Commit a23e6a35d896a075640db714b28ce74bb6b8d7ff introduced a timer
object to the WFMO handling in select_stuff::wait to allow sub-tickcount
timeout values in select.
Problems with this patch: The timer was created and destroyed on every
invocation of select_stuff::wait, thus potentially multiple times per
select. Also, since the timer was prepended to the WFMO hande list,
the timer handle could shadow actual events on other objects, given that
WFMO checks the objects in the order they have been specified in the
HANDLE array. The timer was also created/destroyed and added to the
HANDLE array even if it was not required.
This patch drops the local timer HANDLE and recycles the cw_timer HANDLE
in the cygtls area instead. Thus we typically don't need to create the
timer in select at all, and we never have to destroy it.
The timer HANDLE is now also appended as last object to the HANDLE array,
and it's only added if actually needed.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
|
|
|
|
|
|
|
|
|
|
|
| |
The check for current timestamp > start timestamp has an unwelcome
side effect: The loop is not left as long as the current timestamp
hasn't been incremented. This leads to busy loops of about one tick
(10 to 16 ms per MSDN).
This fixes https://cygwin.com/ml/cygwin/2016-05/msg00327.html
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
'man termios' says:
"A read(2) returns at most one line of input" in canonical mode.
On cygwin 2.5.1, read(2) returns all data in buffer if the buffer
size specified is large enough. This behaviour is correct in
noncanonical mode, but is not correct in canonical mode.
While checking this problem, I found a bug of tcflush(). tcflush()
flushes only partial data in the buffer. The patch also fixes this bug.
The patch has also been tested against the problem reported in
https://cygwin.com/ml/cygwin/2016-05/msg00318.html.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
|
|
|
|
| |
But don’t let it remove source files.
|
|
|
|
|
|
|
|
|
|
|
|
| |
The rule to make tlsoffset{64}.h has a flaw. If cygtls.h can't be
built for whatever reason, it *still* regenerates tlsoffsets{64}.h,
just with size 0. If the bug is not in cygtls.h itself, this behaviour
breaks further building, because fixing the problem won't result in
regenerating tlsoffset{64}.h. Manual intervention is required.
Fix that by removing tlsoffsets{64}.h if gentls_offsets fails.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
|
|
|
|
|
|
|
| |
Using libattr's <xattr/xattr.h> requires consumers to explicitly include
<sys/types.h> first, but glibc's header in sys/ already contains the include.
Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
|
|
|
|
|
|
|
|
| |
Temporarily revert to use PROCESS_QUERY_INFORMATION instead of
PROCESS_QUERY_LIMITED_INFORMATION to make sure every aspect of the
next release is still XP/2003 compatible.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
|
|
|
|
|
|
|
|
|
| |
texts."
This reverts commit 252a07b0ad3353abcd0fcd9b1b65ff977acd679e.
This change introduced a hang in certain scenarios, for an example
see https://cygwin.com/ml/cygwin/2016-05/msg00318.html
|
|
|
|
|
|
|
|
| |
We're appending a dot to the filename before calling LoadLibrary to
override ".dll" automagic. This only worked for paths, not for simple
filenames since it required a slash in the pathname. Fix that.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
|
|
|
|
| |
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
|
|
|
|
|
|
|
|
|
|
| |
So far drive letter paths have been handled special since path_conv
leaves the incoming path untouched except for converting backslashes
to forward slashes. However, if the incoming path starts with a
long path prefix, the same problem occurs. Therefore handle all
paths starting with a backslahs the same way.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
|
|
|
|
|
|
|
| |
Using INT_MAX requires to include limits.h on most targets.
Math.h must not rely on that.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
|
|
|
|
| |
addresses for data sections are not currently supported.
|
|
|
|
|
|
|
|
|
|
|
| |
ARCompact processors (ARC 600 and ARC 700) require three "nop"s after the
"flag 1" instruction. Later ARC processors do not have this requirement, so
it is possible to reduce size of "_exit_halt" for them.
libgloss/
2016-05-24 Anton Kolesov <Anton.Kolesov@synopsys.com>
* arc/crt0.S (_exit_halt): Insert nops only for ARCompact.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Initially crt0.S used a special function, declared as weak as a default
exception handler in interrupt vector table. To let user override individual
handlers, this function had multiple names - one for each IVT entry, which,
however, was terribly confusing for the debugger and user - because it
wasn't clear which symbol will be used as a function name in debugger.
Defining multiple separate functions - one for each handler, would resolve
the mess, but would increase code size of crt0.o.
To clean this up, this patch defines exception handlers as weak symbols as
well, but those are defined as just symbols, not functions, hence there
would be less confusion over what is what. At the same time, users still can
redefine exception handlers symbol by creating functions with respective
names.
libgloss/
2016-05-24 Anton Kolesov <Anton.Kolesov@synopsys.com>
* arc/crt0.S: Convert memory_error and friends to non-function
symbols.
|