Fix uname on FreeBSD
On FreeBSD, uname is an inline function. The uname that is present in
libc.so is for FreeBSD 1.0 compatibility. It expects a buffer of a
different size.
Fixes#1190
Reported-by: Alex Zepeda
On FreeBSD, uname is an inline function. The uname that is present in
libc.so is for FreeBSD 1.0 compatibility. It expects a buffer of a
different size.
Fixes#1190
Reported-by: Alex Zepeda
Add IP_RECVIF to BSD and IP_RECVDSTADDR to apple.
FreeBSD/OpenBSD do not support IP_PKTINFO for IPv4 but use IP_RECVIF for interface index and IP_RECVDSTADDR for destination address.
NetBSD and macOS also support IP_RECVIF and IP_RECVDSTADDR in addition to IP_PKTINFO.
(For IPv6, all use IPV6_PKTINFO)
Define missing F_RDLCK, F_WRLCK and F_UNLCK constants on linux-mips -and s390x
These are defined in the fcntl.h glibc header on MIPS and s390x
systems on Linux but missing in the libc crate, so add them as they
are required for the file locking API in rustc.
These are defined in the fcntl.h glibc header on s390x systems
on Linux but missing in the libc crate, so add them as they are
required for the file locking API in rustc.
These are defined in the fcntl.h glibc header on MIPS systems
on Linux but missing in the libc crate, so add them as they are
required for the file locking API in rustc.
make tm struct members public
This PR makes the members of `struct tm` public.
I see no reason why these fields should not be public fields. They are public in the other targets. I did a blame and it seems that they have been private since added a couple years ago.
53e0d387f8
add some socket functions and a SOCKET type for windows
This PR adds a few of the socket functions for windows. Some targets use the `stdcall` calling convention for these functions, so I put them in an `extern "system"` block ([see the nomicon](https://doc.rust-lang.org/nomicon/ffi.html#foreign-calling-conventions)).
add signal and raise bindings for windows
This PR adds `signal` and `raise` bindings for windows.
I don't know these functions or linux very well, so I leaned on other overrides of signal in the linux bindings, and the [cppreference page](https://en.cppreference.com/w/cpp/header/csignal) for adding the bindings.
I added some constants that were shown on the [microsoft signal page](https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/signal?view=vs-2017) and used the default values I found spelunking through my own copy of `signal.h` that came along with visual studio.
The automated tests pass and my toy apps use the `signal` and `raise` as expected. Let me know if there is anything else I need to do, or any extra tests to write.
EDIT:
currently working on getting a nice isolated msys2 environment I can use to dev against.
- [x] msys2 env setup and building