aboutsummaryrefslogtreecommitdiff
path: root/include/mingw.h (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* fsync: avoid a gratuitous difference from upstreamRon Yorston2018-04-031-0/+1
| | | | | Move the definition of O_NOCTTY to mingw.h so that fsync.c is the same as upstream.
* win32: improvements to get_terminal_width_heightRon Yorston2018-04-031-2/+0
| | | | | | | | - move winansi_get_terminal_width_height from winansi.c to ioctl.c, the only caller; - check both stdout and stderr for a connection to a console; - omit unnecessary code in get_terminal_width_height (because the WIN32 implementation ignores the file descriptor).
* win32: changes to kill(2)Ron Yorston2018-03-271-0/+2
| | | | | | | | | The names of the callbacks to kill processes with a given signal were confusing because they referred to the implementation rather than the intent. Create the new function kill_SIGTERM_by_handle which is more efficient when a handle to the process to be killed is already available.
* win32: save a few bytes in device file supportRon Yorston2018-03-231-2/+4
|
* win32: add a function to convert backslashes to slashesRon Yorston2018-03-181-2/+1
|
* win32: tidy up popen implementationRon Yorston2018-03-151-1/+0
| | | | | | | | | Make mingw_popen_fd sufficiently general that it can be used to implement the other two popen routines. mingw_popen now just creates a command line and passes it to mingw_popen_fd. The one call to mingw_popen2 has been replaced by a call to mingw_popen_fd.
* wget: add support for httpsRon Yorston2018-03-151-0/+1
| | | | | | | | | | | | | | | | Allow wget to support https URLs. Changes are: - Add mingw_popen2 which uses a named pipe to allow bidirectional communication with a child process; - Modify ssl_client to accept a WIN32 handle instead of a file descriptor as an argument; - Allow tls_get_random to open /dev/urandom; - Using the above changes implement a WIN32 version of spawn_ssl_client in wget. This closes GitHub issue #75. Also, enable authentication in wget.
* win32: restrict visibility of special devicesRon Yorston2018-03-151-0/+2
| | | | | | | | | | | | | | | Handling of the special devices /dev/zero and /dev/urandom was inconsistent: - they could be used as arguments to 'cat' but not 'od'; - they could not be used in shell redirection. Restrict the use of these devices to two places: - as input files to 'dd' with the 'if=' argument; - internally within 'shred'. See GitHub issue #98.
* Minor improvements to buildRon Yorston2018-03-021-1/+0
| | | | | | | | | | | | Exclude source files in libbb that aren't used by busybox-w32. This speeds up the build marginally. They can always be reinstated if necessary. Provide fake routines for everything in inode_hash.c so that it can be excluded. inode_hash.c is now unchanged from upstream. Use last_char_is in has_exe_suffix_or_dot. It doesn't save any bytes but it makes the code neater.
* Remove fake signal-handling codeRon Yorston2018-03-011-28/+0
| | | | | | | | | Microsoft Windows has only limited support for signals. busybox-w32 initially papered over this fact by adding definitions for unsupported signals and signal-handling functions. Remove this fake code and deal with the consequences by excluding anything that fails to compile as a result.
* win32: make has_exec_format staticRon Yorston2018-03-011-1/+0
| | | | The only other caller (in spawnveq) has been removed.
* win32: don't add extensions to filenames ending with a dotRon Yorston2018-02-281-1/+2
| | | | | | | A filename ending with a dot is a signal to spawnve not to try adding extensions but to use the name unmodified. The add_win32_extension function should follow the same rule.
* win32: move detection of file formats to stat(2)Ron Yorston2018-02-261-1/+2
| | | | | | | | | | | | | | | | | | | | | Move the code to detect shell scripts and binary executables from mingw_access to a separate function, has_exec_format. Call this function in do_lstat to decide whether to set the executable bits in the file mode. This will slow down stat but has a couple of advantages: - shell scripts are highlighted in ls output - the test applet can use stat(2) to detect executable files The new function is used to handle another corner case in spawnveq: binary executables without the usual .exe extension are only run by spawnve if the file name ends with '.'. Two minor changes: - file_is_win32_executable has been renamed add_win32_extension to clarify what it does - a call to file_is_executable has been removed from find_command in ash as it resulted in unhelpful error messages.
* win32: add support for batch filesRon Yorston2018-02-261-0/+1
| | | | | | | | Support batch files with .bat and .cmd extensions, similar to what's done for .exe and .com. Check extensions in the same order as Windows' spawn function: .com, .exe, .bat, .cmd.
* win32: make /dev/urandom more randomRon Yorston2018-02-231-0/+2
|
* win32: handle /dev/zero and /dev/urandom in open and read functionsRon Yorston2018-02-221-0/+5
| | | | | | | | | | | | | | | | | | | | | | | Currently /dev/zero is handled as a special case in dd. Add hacks to the open and read functions in mingw.c to handle the zero and urandom devices. - Opening /dev/zero or /dev/urandom actually opens the special Windows file 'nul' which behaves like /dev/null. This allows manipulation of the file descriptor with things like seek and close - When /dev/zero or /dev/urandom is opened the resulting file descriptor is stored and used to override the behaviour of read. - No attempt is made to track duplicated file descriptors, so using these devices for redirections in the shell isn't going to work and won't be permitted. (Could be, but won't.) - Limited control of the special file descriptors is provided by allowing the internal variables to be changed. - The numbers from /dev/urandom aren't very random.
* win32: import fsync(2) implementation from gnulibRon Yorston2018-02-211-1/+1
|
* win32: always use safe API calls to manipulate environmentRon Yorston2018-02-131-6/+0
| | | | | | | | | | | It turns out that with the new toolchain safe API calls work on all all platforms. Even the original code from commit fa147bd7e works on Windows XP when built with the new tools. - Remove the unsafe environment manipulation via the environ array - Microsoft's putenv takes a copy of its argument so the string can be freed - Rewrite some routines and add more error checking
* ps: add support for CPU and elapsed time columnsRon Yorston2017-09-011-0/+7
| | | | | | | | It may be necessary to run ps as administrator to get information about processes belonging to other users. The code to detect GetTickCount64 at run-time was imported from Git for Windows.
* win32: shrink code to detect .exe filesRon Yorston2017-08-301-0/+1
| | | | | | | | Add a function (has_exe_suffix) to replace explicit code to check if a filename ends with '.exe. or '.com'. Also shrink code that checks for '.exe' or '.com' on PATH in shell's find_command function.
* win32: make vfork fail at compile-timeRon Yorston2017-08-301-7/+1
| | | | | | | | | | | | Nothing in busybox-w32 uses fork. Remove the implementations of fork, vfork and xvfork so that, for example, enabling cpio pass-through causes an error at compile-time, not run-time. MinGW-w64 defines pid_t, so we don't have to. Ensure code containing xvfork in netcat is disabled when NC_EXTRA is disabled. Otherwise removing the implementation of vfork costs 64 bytes.
* mingw: accommodate for BusyBox' assumptions about isatty()Johannes Schindelin2017-08-241-0/+2
| | | | | | | | | | | | | | | On Windows, isatty(fd) determines whether the file descriptor refers to a character device. The thing is: even NUL or a printer is a character device. BusyBox thinks, however, that isatty() only returns non-zero for an interactive terminal. So let's shadow isatty() by a version that answers the question BusyBox wants to have answered. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Ron Yorston <rmy@pobox.com>
* win32: remove implementation of mempcpyRon Yorston2017-08-231-5/+0
| | | | | mingw-w64 has its own mempcpy. And even if it didn't upstream BusyBox has one too. So we definitely don't need our own.
* include/mingw.h: remove unnecessary definition of PRIuMAXRon Yorston2017-08-231-1/+0
|
* win32/mingw: fix signatures of the *execv*() family of functionsJohannes Schindelin2017-08-231-4/+4
| | | | | | | | | | The function signatures were inherited from Git's source code, but are inconsistent with the declarations in the POSIX standard. This requires quite a few changes in quite a few callers, unfortunately. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Ron Yorston <rmy@pobox.com>
* win32: remove unused functionsRon Yorston2017-08-231-2/+0
| | | | | The functions copy_environ and free_environ became unused following commit ac181bf54 "win32: simplify spawning applets".
* inode_hash: avoid warnings about unused parametersRon Yorston2017-08-231-0/+1
|
* find_mount_point: avoid warning about unused parameterRon Yorston2017-08-231-0/+2
|
* Post-merge fixesRon Yorston2017-08-221-0/+1
| | | | | - Update default configurations. - Changes required for rpm2cpio to compile
* ash: fixes to wait statusRon Yorston2017-08-031-3/+3
| | | | | Replace W* macros with versions from GNU C library. Change wait status values to match.
* Post-merge fixesRon Yorston2017-07-241-1/+2
|
* Provide vfprintf replacementRon Yorston2017-02-071-0/+1
| | | | | vfprintf is used in ash_vmsg. It should be passed through the codepage conversion in winansi.c.
* win32: implement nanosleep and enable float sleep by defaultRon Yorston2017-01-181-0/+2
| | | | Don't expect sleeping for fractions of a second to be very accurate.
* win32: return an error when lseek is applied to a pipeRon Yorston2016-05-241-3/+4
| | | | | | | | | | | tail failed to process input from a pipe correctly: $ echo -n 54321 | tail -c 3 543 It was trying to use lseek as an optimisation but WIN32 lseek doesn't return an error whan applied to a pipe. Fix this by providing a wrapper for lseek.
* ash: fix use of pid/handle in waitpid_childRon Yorston2016-05-181-0/+1
| | | | | | | | | | Previously spawn was returning a process handle which was treated as a pid in certain circumstances. This resulted in the following failing: find . -type f | sed xargs -n 1 sed -n '1 p' It should output the first line of each file but stopped after the first.
* win32: adjustments to spawn functionsRon Yorston2016-05-181-2/+0
| | | | | | | | Make mingw_spawn_applet and mingw_spawn_1 static. The return value from spawnve is an exit code in synchronous mode and a process handle in asynchronous mode. Pass these upwards without interpretation.
* winansi: revert to previous console behaviour for vi/lessRon Yorston2016-04-261-0/+1
| | | | | | | | | | | | Recent changes to make the Windows console behave more like a *nix terminal didn't work too well for vi/less. On *nix the terminal buffer can't be scrolled while such screen-based applications are running. In the Windows console this remained possible and led to confusion. Add a new routine to allow vi/less to revert to their previous behaviour where the cursor is positioned at the top of the buffer and the entire buffer is cleared.
* lineedit: move console viewport to cursor on keypressRon Yorston2016-04-261-0/+1
| | | | | | When a normal *nix terminal has been scrolled back through its buffer, any keypress will return to the cursor position. Add code to lineedit.c to do the same for the Windows console.
* mingw: post-merge build fixesRon Yorston2016-04-041-0/+1
|
* Silence a couple of compiler warningsRon Yorston2016-03-061-1/+1
|
* libbb: additional support for backslashes in pathsRon Yorston2015-11-131-1/+1
|
* win32: append '/' to bare drive name in opendirRon Yorston2015-09-301-0/+6
| | | | Make 'ls c:' and 'ls c:/*' do the right thing.
* win32: remove setitimer implementation and SIGALRM handlingRon Yorston2015-07-261-9/+1
| | | | | | | Commit 69f49ea imported a setitimer implementation from git. Since setitimer isn't used at all in BusyBox it can be removed. The same technique could be used to implement alarm but nothing in the WIN32 port uses that (yet).
* mingw: enable support for IPv6Ron Yorston2015-07-151-0/+1
| | | | Import inet_pton from gnulib and enable IPv6 support by default.
* win32: silence some compiler warningsRon Yorston2015-07-151-0/+5
|
* Allow different ways to manipulate environment for XP vs 64-bitRon Yorston2015-07-031-0/+8
| | | | | | | | | | | Commit fa147bd 'Use putenv to implement unsetenv/clearenv' allowed BusyBox to run on ReactOS but broke it on Windows XP so it was reverted. It turns out that the same change is required on 64-bit Windows. Reinstate the 'safe' environment manipulation code but make it a configuration option. Add a config file for 64-bit Windows that does the right thing.
* mingw: fixes to implementation of waitpid(2)Ron Yorston2015-05-291-1/+1
| | | | | The third argument should be int. We only support positive pid values.
* mingw: tidy up implementation of kill(2)Ron Yorston2015-05-291-0/+2
|
* mingw: add routine to pipe a file descriptor to/from a commandRon Yorston2015-05-271-0/+1
|
* mingw: define a macro for spawnRon Yorston2015-05-271-1/+2
|