]>
sourceware.org Git - newlib-cygwin.git/log
Corinna Vinschen [Sun, 11 Mar 2018 13:54:20 +0000 (14:54 +0100)]
Cygwin: AF_UNIX: use get_unique_id to create pipe name
It's the same as get_plain_ino in this case, but it's cleaner
and easier to understand.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Corinna Vinschen [Sat, 10 Mar 2018 20:12:27 +0000 (21:12 +0100)]
Cygwin: AF_UNIX: fix dup
Reorder so fhandler_socket::dup is called first. Add missing
duplication of backing_file_handle.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Corinna Vinschen [Sat, 10 Mar 2018 20:09:28 +0000 (21:09 +0100)]
Cygwin: AF_UNIX: Add fixup_after_exec method
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Corinna Vinschen [Sat, 10 Mar 2018 20:07:46 +0000 (21:07 +0100)]
Cygwin: AF_UNIX: fix creating abstract socket symlink name
Add missing NUL termination when creating symlink representing
abstract socket.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Corinna Vinschen [Fri, 9 Mar 2018 20:13:28 +0000 (21:13 +0100)]
Cygwin: don't skip O_TMPFILE files in readdir
Bad idea. A file hidden from directory listings is not seen by
rm either, so it never calls unlink for the file and a recursive
removal of the parent directory fails with "directory not empty".
Fix comments accordingly.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Corinna Vinschen [Fri, 9 Mar 2018 13:19:36 +0000 (14:19 +0100)]
Cygwin: AF_UNIX: Implemant socketpair
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Corinna Vinschen [Fri, 9 Mar 2018 13:17:39 +0000 (14:17 +0100)]
Cygwin: fix socketpair prototype
Last parameter is a vector of 2 ints, not a pointer to int
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Thomas Wolff [Wed, 7 Mar 2018 23:29:25 +0000 (00:29 +0100)]
describe new locale modifier @cjkwide for user guide
Corinna Vinschen [Wed, 7 Mar 2018 20:56:42 +0000 (21:56 +0100)]
Cygwin: AF_UNIX: implement getsockopt SO_RCVBUF/SO_SNDBUF
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Corinna Vinschen [Wed, 7 Mar 2018 20:55:34 +0000 (21:55 +0100)]
Cygwin: AF_UNIX: define AF_UNIX_CONNECT_TIMEOUT
Use macro AF_UNIX_CONNECT_TIMEOUT instead of numerical constant
for connect timeout.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Corinna Vinschen [Wed, 7 Mar 2018 20:54:46 +0000 (21:54 +0100)]
Cygwin: Define FSCTL_PIPE_FLUSH
This fsctl might come in handy at one point...
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Corinna Vinschen [Wed, 7 Mar 2018 20:53:56 +0000 (21:53 +0100)]
Cygwin: AF_UNIX: Implement read, readv, recvfrom, write, writev, sendto
All of these functions just call recvfrom/sendmsg which are still TODO
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Corinna Vinschen [Wed, 7 Mar 2018 20:52:29 +0000 (21:52 +0100)]
Cygwin: reorder read/write calls in fhandler_socket_unix
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Corinna Vinschen [Wed, 7 Mar 2018 15:23:44 +0000 (16:23 +0100)]
Cygwin: AF_UNIX: fix accept behaviour
* Use correct cygwait/WFSO invocation to not die on cancel and signals
uncontrolled.
* Manage io handles under io_lock.
* Copy peer address to user space under SEH to avoid a resource leak.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Corinna Vinschen [Wed, 7 Mar 2018 15:19:32 +0000 (16:19 +0100)]
Cygwin: AF_UNIX: make sure connect wait thread is cleanly interruptible
Using TerminateThread potentially leaks resources. In our case,
the connect wait thread may be forcefully terminated after
having successfully opened a client side pipe handle. If this
occurs, we have a stale pipe server instance, so the pipe will
never be closed as long as the process lives.
Avoid this by changing the npfs handle to non-blocking, so we can
wait on a termination event object from inside the thread itself
and cleanly exit from the thread instead of terminating.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Corinna Vinschen [Wed, 7 Mar 2018 15:12:55 +0000 (16:12 +0100)]
Cygwin: AF_UNIX: some pipe errors may have multiple status codes
Depending on the exact circumstances, some erros are indicated
by different status codes. Add helper macros to handle them
together.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Corinna Vinschen [Wed, 7 Mar 2018 15:08:15 +0000 (16:08 +0100)]
Cygwin: AF_UNIX: fix SEGV when sending an empty socket name from connect
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Corinna Vinschen [Wed, 7 Mar 2018 14:48:21 +0000 (15:48 +0100)]
Cygwin: AF_UNIX: fix creation of npfs handle
The handle to the device is never needed. As the name impies,
FSCTL_PIPE_WAIT works on the file system, not on the device level.
Drop opening the device and make sure to open only one handle to NPFS.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Corinna Vinschen [Wed, 7 Mar 2018 15:00:36 +0000 (16:00 +0100)]
Cygwin: AF_UNIX: Add create_event helper and use throughout
Minimize overhead in creating a nameless event object.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Corinna Vinschen [Wed, 7 Mar 2018 14:43:26 +0000 (15:43 +0100)]
Cygwin: AF_UNIX: fix comments and move a macro
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Corinna Vinschen [Tue, 6 Mar 2018 17:55:03 +0000 (18:55 +0100)]
Cygwin: AF_UNIX: Implement listen, accept4, connect, and others
* Implement helper functions
* Improve bind
* Implement setting blocking, ioctl(FIONBIO), fcntl(F_SETFL)
* Implement close_on_exec and fixup_after_fork
* Allow overriding sun_path and peer_sun_path
* Improve comments
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Corinna Vinschen [Tue, 6 Mar 2018 17:42:12 +0000 (18:42 +0100)]
Cygwin: AF_UNIX: fix a couple of thinkos and typos
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Corinna Vinschen [Tue, 6 Mar 2018 17:37:09 +0000 (18:37 +0100)]
Cygwin: AF_UNIX: create/open pipes relativ to NPFS rootdir handle
Only store and manipulate pipe basename.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Corinna Vinschen [Tue, 6 Mar 2018 17:28:15 +0000 (18:28 +0100)]
Cygwin: AF_UNIX: initialize rmem/wmem to 256K and use in pipe creation
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Corinna Vinschen [Tue, 6 Mar 2018 17:24:13 +0000 (18:24 +0100)]
Cygwin: ntdll.h: Add some missing pipe-related definitions
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Corinna Vinschen [Tue, 6 Mar 2018 17:23:48 +0000 (18:23 +0100)]
Cygwin: sys/socket.h: define MSG_CMSG_CLOEXEC
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Corinna Vinschen [Tue, 6 Mar 2018 17:23:23 +0000 (18:23 +0100)]
Cygwin: export hires counter ntod
Needed it new AF_UNIX socket code
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Sebastian Huber [Thu, 8 Feb 2018 12:02:41 +0000 (13:02 +0100)]
RTEMS: Use int for _CLOCKID_T_
Linux and FreeBSD use int as well. In addition, this fixes an Ada
incompatiblity problem on 64-bit targets. See also GCC:
gcc/ada/libgnarl/s-osinte__rtems.ads
Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
Sebastian Huber [Thu, 8 Feb 2018 12:00:42 +0000 (13:00 +0100)]
Make _CLOCKID_T_ system configurable
Let systems optionally provide the _CLOCKID_T_ type via
<machine/_types.h>.
Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
Corinna Vinschen [Mon, 5 Mar 2018 17:08:47 +0000 (18:08 +0100)]
Cygwin: move sun_name_t constructors into fhandler_socket_unix.cc
They are only used there anyway and it allows to use the AF_UNIX
macro without tweaking header files. While at it, improve
both constructors. The default constructor now creates the name
of an unnamed socket, the constructor taking parameters carefully
checks its input.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Corinna Vinschen [Mon, 5 Mar 2018 16:59:04 +0000 (17:59 +0100)]
Cygwin: sockets: add bind state, and split out connect state to allow atomic operation
The connect state was stored in a bitfield which is not safe
to do atomic operations on.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Corinna Vinschen [Mon, 5 Mar 2018 16:50:52 +0000 (17:50 +0100)]
Cygwin: drop debug_printf statement from start_transaction
start_transaction is now defined in ntdll.h and we can't rely
on debug_printf being available
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Corinna Vinschen [Mon, 5 Mar 2018 16:49:50 +0000 (17:49 +0100)]
Cygwin: cygwait.cc: fix formatting of debug statement
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Thomas Wolff [Fri, 2 Mar 2018 19:21:09 +0000 (20:21 +0100)]
Locale modifier @cjkwide to adjust ambiguous-width in non-CJK locales
Locale modifier @cjkwide makes Unicode "ambiguous width" characters
wide. So ambiguous width characters can be enforced to have width 2
even in non-CJK locales. This gives e.g. users of "Powerline symbols"
the opportunity to adjust their width to the desired behaviour (and the
behaviour apparently expected by some tools) without having to set a CJK
locale and without losing consistence of terminal character width with
wcwidth/wcswidth locale width.
Corinna Vinschen [Fri, 2 Mar 2018 22:40:36 +0000 (23:40 +0100)]
Cygwin: AF_UNIX: drop try/except block in bind method
The caller already does it anyway.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Corinna Vinschen [Fri, 2 Mar 2018 22:39:15 +0000 (23:39 +0100)]
Cygwin: AF_UNIX: create pipes with file attribute R/W access
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Corinna Vinschen [Fri, 2 Mar 2018 22:33:05 +0000 (23:33 +0100)]
Cygwin: accept4: Fix resource leak
The new implementation neglected to release the file descriptor
in case of error.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Corinna Vinschen [Fri, 2 Mar 2018 17:22:45 +0000 (18:22 +0100)]
Cygwin: remove outdated comment
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Corinna Vinschen [Fri, 2 Mar 2018 17:14:11 +0000 (18:14 +0100)]
Cygwin: fhandler_socket_unix: implement socket, bind, and close
...plus lots of helper functions. Add comment to explain how everything
works. This comment will be improved while implementing the yet missing
parts.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Corinna Vinschen [Fri, 2 Mar 2018 17:11:57 +0000 (18:11 +0100)]
Cygwin: add transform_chars_af_unix helper
This function is going to be used for transposing sun_path of
abstract sockets. This also adds a transposition of the NUL
character to tfx_chars since NUL-bytes in abstract socket names
are perfectly valid.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Corinna Vinschen [Fri, 2 Mar 2018 17:09:35 +0000 (18:09 +0100)]
Cygwin: small_s[w]printf: add '_' modifier to print lower case hex digits
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Corinna Vinschen [Fri, 2 Mar 2018 17:07:39 +0000 (18:07 +0100)]
Cygwin: drop CYGWIN_SOCKET_UUID, define CYGWIN_SOCKET_GUID as GUID pointer
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Corinna Vinschen [Fri, 2 Mar 2018 17:03:11 +0000 (18:03 +0100)]
Cygwin: ntdll.h: add definitions required for pipe-based AF_UNIX
Also remove redundant declaration of RtlInitEmptyUnicodeString
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Our Air Quality [Wed, 28 Feb 2018 12:31:48 +0000 (23:31 +1100)]
Add global stdio streams support for reent small.
Corinna Vinschen [Thu, 1 Mar 2018 17:14:23 +0000 (18:14 +0100)]
Cygwin: convert sun_name_t into class
Add constructors and new/delete operators to make sure sun_name_t
objects are allocated on the cygheap.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Corinna Vinschen [Thu, 1 Mar 2018 15:54:57 +0000 (16:54 +0100)]
Cygwin: add AF_UNIX reparse points to path handling
* check_reparse_point_target returns a path flag mask, rather than
just 1. Return PATH_SYMLINK | PATH_REP for symlinks and directory
mount points, PATH_SOCKET | PATH_REP for AF_UNIX sockets.
* Define Cygwin AF_UNIX socket reparse tag and GUID in ntdll.h.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Corinna Vinschen [Thu, 1 Mar 2018 15:51:12 +0000 (16:51 +0100)]
Cygwin: move transaction helpers into ntdll.h
We'll need them elsewhere in future.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de
Corinna Vinschen [Thu, 1 Mar 2018 15:50:41 +0000 (16:50 +0100)]
Cygwin: ntdll.h: drop macros available in mingw-w64 headers
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Corinna Vinschen [Thu, 1 Mar 2018 15:44:09 +0000 (16:44 +0100)]
Cygwin: path.cc: clean up includes
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Corinna Vinschen [Thu, 1 Mar 2018 15:41:45 +0000 (16:41 +0100)]
Cygwin: path_conv: rename is_rep_symlink to is_known_reparse_point
...in preparation of reusing this flag for other types of
reparse points, not only symlinks.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Corinna Vinschen [Wed, 28 Feb 2018 18:06:41 +0000 (19:06 +0100)]
Cygwin: improve storage and handling of AF_UNIX socket path
Define new struct sun_name_t and use throughout internally.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Corinna Vinschen [Wed, 28 Feb 2018 18:01:29 +0000 (19:01 +0100)]
Cygwin: fhandler_socket_unix: store peer credentials in ucred member
* Split out cygwin/_ucred.h file
* drop local credentials
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Corinna Vinschen [Wed, 28 Feb 2018 17:56:13 +0000 (18:56 +0100)]
Cygwin: cleanup header including within network-releated files
* Rearrange includes and drop unneccessary ones.
* Don't pull in cygwin/socket.h into sys/un.h just to get
sa_family_t. Include sys/types.h and use __sa_family_t instead.
* start including Windows headers using the w32api/ path prefix
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Corinna Vinschen [Tue, 27 Feb 2018 14:30:00 +0000 (15:30 +0100)]
Cygwin: sockets: Fix fstat on unnamed sockets
Calling fhandler_socket::fstat from fhandler_socket::fstat recursively
is not a good idea...
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Corinna Vinschen [Mon, 26 Feb 2018 19:39:48 +0000 (20:39 +0100)]
Cygwin: reduce size of fhandler_cygdrive
fhandler_cygdrive has a size of 696 bytes on x86_64, while the next
biggest fhandler type, fhandler_pty_master, is 584 bytes. The members
responsible for the size are private to opendir/readdir/closedir usage.
fhandler_disk_file stores private readdir data in DIR->__d_internal
instead. Use equivalent method with fhandler_cygdrive. This drops
the size to 464 bytes.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Corinna Vinschen [Mon, 26 Feb 2018 17:02:36 +0000 (18:02 +0100)]
Cygwin: sockets: Add missing cleanup if socket/socketpair creation fails
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Corinna Vinschen [Mon, 26 Feb 2018 16:58:46 +0000 (17:58 +0100)]
Cygwin: fhandler_socket_unix: Tiny cleanup
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Corinna Vinschen [Mon, 26 Feb 2018 16:56:47 +0000 (17:56 +0100)]
Cygwin: sockets: move type and proto checks into fhandler_socket classes
Encapsulation required
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Corinna Vinschen [Mon, 26 Feb 2018 16:53:50 +0000 (17:53 +0100)]
Cygwin: fhandler_socket: define socketpair as virtual function
...in preparation of moving the type and protocol test into the
actual classes.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
David Macek [Fri, 23 Feb 2018 13:22:44 +0000 (14:22 +0100)]
doc/faq-using.xml: Add BeyondTrust and Cylance to BLODA
Cylance:
- https://github.com/git-for-windows/git/issues/1244
- https://cygwin.com/ml/cygwin/2017-04/msg00238.html
BeyondTrust:
- https://cygwin.com/ml/cygwin/2017-04/msg00092.html
- https://cygwin.com/ml/cygwin/2017-05/msg00422.html
Corinna Vinschen [Fri, 23 Feb 2018 20:00:17 +0000 (21:00 +0100)]
Cygwin: Define SO_PASSCRED and SCM_CREDENTIALS
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Corinna Vinschen [Fri, 23 Feb 2018 19:59:21 +0000 (20:59 +0100)]
Cygwin: Create empty fhandler_socket_unix
* Make distinct from AF_LOCAL for testing purposes. This will have
to be reverted as soon as fhandler_socket_unix goes life.
* Move saw_reuseaddr flag back to fhandler_socket status
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Corinna Vinschen [Fri, 23 Feb 2018 19:59:55 +0000 (20:59 +0100)]
Cygwin: fix upcalls in some fhandler_socket_local methods
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Corinna Vinschen [Fri, 23 Feb 2018 18:45:59 +0000 (19:45 +0100)]
Cygwin: Introduce FH_SOCKET for generic socket file ops
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Corinna Vinschen [Fri, 23 Feb 2018 14:24:18 +0000 (15:24 +0100)]
Cygwin: encapsulate Winsock based fhandler_socket classes
Insert another class fhandler_socket_wsock between fhandler_socket
and fhandler_socket_inet/fhandler_socket_local.
Also, add a new method fhandler::is_wsock_socket to allow asking
for sockets in general (is_socket) vs. Winsock-based sockets
(is_wsock_socket).
This allows to develop a new handler_socket_unix class as derived
class from fhandler_socket without any trace of wsock code left
in fhandler_socket.
While this is basically a temporary measure at this time, it may
prove useful for later interoperability with the upcoming Windows 10
AF_UNIX implementation at one point.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Corinna Vinschen [Fri, 23 Feb 2018 13:56:30 +0000 (14:56 +0100)]
Cygwin: eliminate unused fhandler method hclose
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Corinna Vinschen [Fri, 23 Feb 2018 12:34:08 +0000 (13:34 +0100)]
Cygwin: fix fhandler_socket_local::fchmod
Rather than just returning 0, return the result of calling
the base class fchmod.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Corinna Vinschen [Fri, 23 Feb 2018 12:33:23 +0000 (13:33 +0100)]
Cygwin: socket.h: Add SIOCINQ, equivalent to FIONREAD
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Corinna Vinschen [Fri, 23 Feb 2018 12:32:51 +0000 (13:32 +0100)]
Cygwin: drop unused device nodes and clean up socket devices
* Rename DEV_TCP_MAJOR to DEV_SOCK_MAJOR
* Drop FH_TCP, FH_UDP, FH_ICMP in favor of single FH_INET
* Drop FH_UNIX, FH_STREAM, FH_DGRAM in favor of single FH_LOCAL
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Corinna Vinschen [Thu, 22 Feb 2018 15:59:55 +0000 (16:59 +0100)]
Cygwin: fhandler_socket: Move select functions into derived classes
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Corinna Vinschen [Thu, 22 Feb 2018 15:54:08 +0000 (16:54 +0100)]
Cygwin: fhandler_socket: Rearrange methods
Follow the same pattern in all fhandler_socket classes.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Corinna Vinschen [Thu, 22 Feb 2018 15:37:12 +0000 (16:37 +0100)]
Cygwin: fhandler_socket: Add derived fcntl methods
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Corinna Vinschen [Thu, 22 Feb 2018 15:30:08 +0000 (16:30 +0100)]
Cygwin: fhandler_socket: Add derived ioctl methods
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Corinna Vinschen [Thu, 22 Feb 2018 15:28:14 +0000 (16:28 +0100)]
Cygwin: fhandler_socket: Move shutdown and close methods into derived classes
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Corinna Vinschen [Thu, 22 Feb 2018 15:25:28 +0000 (16:25 +0100)]
Cygwin: make socketpair an AF_LOCAL-only method
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
David Macek [Wed, 21 Feb 2018 17:09:47 +0000 (18:09 +0100)]
doc/ntsec.xml: Fix typo
Corinna Vinschen [Wed, 21 Feb 2018 21:00:04 +0000 (22:00 +0100)]
Cygwin: inline get_socket_flags()
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Corinna Vinschen [Wed, 21 Feb 2018 20:43:44 +0000 (21:43 +0100)]
Cygwin: fix whitespaces in socket code
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Corinna Vinschen [Wed, 21 Feb 2018 20:40:01 +0000 (21:40 +0100)]
Cygwin: split out fhandler_socket into inet and local classes
First cut, still incomplete
* fhandler_socket is now base class for other socket classes
* fhandler_socket_inet handles AF_INET and AF_INET6 sockets
* fhandler_socket_local handles AF_LOCAL/AF_UNIX sockets
* finally get rid of fdsock by using set_socket_handle in accept4
* align file-related calls (fstat, fstatvfs, fchown, fchmod, facl)
to Linux.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Corinna Vinschen [Tue, 20 Feb 2018 17:14:57 +0000 (18:14 +0100)]
Cygwin: net.cc: drop redundant declarations
Replace cygwin_inet_aton call with cygwin_inet_pton
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Corinna Vinschen [Tue, 20 Feb 2018 17:01:40 +0000 (18:01 +0100)]
Cygwin: set/getsockopt: Move implementation into fhandler_socket class
This requires to export find_winsock_errno from net.cc.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Corinna Vinschen [Tue, 20 Feb 2018 16:59:45 +0000 (17:59 +0100)]
Cygwin: clean error mapping
- Move definition of windows to POSIX error mapping struct into
cygerrno.h
- Move declaration of winsock errno functions to cygerrno.h
- Input to error mapping functions is DWORD
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Corinna Vinschen [Tue, 20 Feb 2018 14:05:23 +0000 (15:05 +0100)]
Cygwin: Make sure fraction of seconds constants enforce 64 bit computation
Dropping the 'LL' specifier leads to 32 bit truncation during timestamp
computation. Revert it. Exempt MSPERSEC which is used for 32 bit values.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Corinna Vinschen [Fri, 16 Feb 2018 16:34:57 +0000 (17:34 +0100)]
Cygwin: fix declaration of fhandler_socket::socketpair
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Corinna Vinschen [Fri, 16 Feb 2018 16:21:48 +0000 (17:21 +0100)]
Cygwin: fix utils path handling in case cygdrive path is just '/'
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Corinna Vinschen [Fri, 16 Feb 2018 15:57:24 +0000 (16:57 +0100)]
Cygwin: net: Improve standars conformance comments
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Corinna Vinschen [Fri, 16 Feb 2018 15:41:42 +0000 (16:41 +0100)]
Cygwin: fhandler_socket: Add :: to potentially colliding WinSock calls
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Corinna Vinschen [Fri, 16 Feb 2018 15:36:19 +0000 (16:36 +0100)]
Cygwin: socketpair: Move socketpair creation inside fhandler_socket class
Add fhandler_socket::socketpair method
Deliberately disable AF_INET socketpairs for now
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Corinna Vinschen [Fri, 16 Feb 2018 15:23:32 +0000 (16:23 +0100)]
Cygwin: sockets: move common settings into set_socket_handle()
Move setting address family, socket type and descriptor flags
into fhandler_socket::set_socket_handle method.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Jaap de Wolff [Mon, 12 Feb 2018 11:23:45 +0000 (12:23 +0100)]
add forward declaration to main() to prevent warnings
Jaap de Wolff [Mon, 12 Feb 2018 11:23:44 +0000 (12:23 +0100)]
adapt prototypes arm/syscalls.c to usual prototypes, and do not rely on implicit conversions
Jaap de Wolff [Mon, 12 Feb 2018 11:23:43 +0000 (12:23 +0100)]
add forward declaration to __cxa_atexit to aeabi_atexit, to prevent warnings
Jaap de Wolff [Mon, 12 Feb 2018 11:23:42 +0000 (12:23 +0100)]
Add prototype to _malloc_lock() and *unlock() to malloc.h, and inlude this from nano-mallocr.c
Jaap de Wolff [Mon, 12 Feb 2018 11:23:41 +0000 (12:23 +0100)]
Add define _COMPILING_NEWLIB for arm to configure.host, as it is obviously needed
Signed-off-by: Jaap de Wolff <jaap@stretch.de-wolff.org>
Corinna Vinschen [Wed, 14 Feb 2018 21:21:58 +0000 (22:21 +0100)]
Cygwin: socket: move socket creation inside fhandler_socket class
Add fhandler_socket::socket method
Add fhandler_socket::set_socket_handle method, basically duplicating
what fdsock is doing. This is the first step in getting rid of fdsock.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Corinna Vinschen [Wed, 14 Feb 2018 11:55:24 +0000 (12:55 +0100)]
Cygwin: improve O_TMPFILE handling
Windows does not remove FILE_ATTRIBUTE_TEMPORARY by itself after a
file has been closed. It's just some attribute which can be set or
removed at will, despite its purpose.
Apparently there are tools out there which use FILE_ATTRIBUTE_TEMPORARY
accidentally or wrongly, even Microsoft's own tools are affected. In
the end, the filesystem is potentially full of files with this attribute
set.
Implement O_TMPFILE files with FILE_ATTRIBUTE_TEMPORARY and
FILE_ATTRIBUTE_HIDDEN set. This combination is pretty unlikely.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Corinna Vinschen [Wed, 14 Feb 2018 09:20:42 +0000 (10:20 +0100)]
Cygwin: fix file-related functions on unix sockets
* Fix an incorrect condition to recognize AF_LOCAL sockets in
file-related functions (fchmod, fchown, fstat, fsttavfs, facl, link).
* Return successfully when called on unnamed or abstract AF_LOCAL sockets,
except link, just as on Linux.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Corinna Vinschen [Wed, 14 Feb 2018 09:31:02 +0000 (10:31 +0100)]
Cygwin: improve a comment in fhandler_socket::getsockname
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Corinna Vinschen [Mon, 12 Feb 2018 21:10:08 +0000 (22:10 +0100)]
Cygwin: /proc/<pid>/stat: Fix time handling
* Use 64 bit timestamps
* Use System boot and process start time to compute starttime value per
Linux proc.5 description.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Corinna Vinschen [Mon, 12 Feb 2018 21:08:42 +0000 (22:08 +0100)]
Cygwin: Drop HZ usage in favor of MSPERSEC and CLOCKS_PER_SEC
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This page took 0.071981 seconds and 5 git commands to generate.