Commit graph

2138 commits

Author SHA1 Message Date
Fredrick Brennan 74c554c395 Fix build error on stable Rust 2018-03-03 11:26:40 +00:00
Fredrick Brennan 5f9538d1e2 Add passwd/group APIs needed for nix-rust/nix#864 2018-03-03 11:13:02 +00:00
bors 68d4848fe6 Auto merge of #937 - bdrewery:freebsd-ino64-compat, r=alexcrichton
Use pre-ino64 FreeBSD symbols to resolve binary compatibility.

This follows the same method as other platforms like OSX and NetBSD.

This will fix rustup and building from git (once libc is updated for bootstrap)
on FreeBSD12 post-ino64 in f713b08c02.
It also avoids having to hotpatch the stage0 compiler, and HOME/.cargo
libc files on FreeBSD12 to build rust.

The only real pitfall is that this will prevent interaction with inodes that
have an ino_t above the 32-bit limit due to truncation.  On the other hand
Rust won't work at all on 12 without doing this currently.  In general
it should not be a problem for users and if they need 64-bit ino_t they
can use a patched libc, rather than the current state of affairs in
requiring a patched libc to use Rust on 12.

A better, or complementary, approach would be something like proposed in
https://github.com/rust-lang/rfcs/pull/2048 to allow targetting a specific
version of FreeBSD. This would allow Rust to default to this compatibility
mode by targetting FreeBSD10 and still allow targetting FreeBSD12 for 64-bit
ino_t.

The symbol versions used were taken from the old version in
f713b08c02 (diff-61a32fcfb7ecd4517665fed591813c57)
and
f713b08c02 (diff-7f67ccf8b5f44ff2f54eaab0207abb8d).

The scope of functions versioned here differs from other platforms as
not all structs were modified that were on others, such as DIR for
`opendir`, `telldir`, etc.  Only functions using dirent, stat, glob_t,
and dev_t need the changes.

Fixes https://github.com/rust-lang/rust/issues/42681
2018-03-02 01:19:11 +00:00
Bryan Drewery 78f93220d7 Use pre-ino64 FreeBSD symbols to resolve binary compatibility.
This follows the same method as other platforms like OSX and NetBSD.

This will fix rustup and building from git (once libc is updated for bootstrap)
on FreeBSD12 post-ino64 in f713b08c02.
It also avoids having to hotpatch the stage0 compiler, and HOME/.cargo
libc files on FreeBSD12 to build rust.

The only real pitfall is that this will prevent interaction with inodes that
have an ino_t above the 32-bit limit due to truncation.  On the other hand
Rust won't work at all on 12 without doing this currently.  In general
it should not be a problem for users and if they need 64-bit ino_t they
can use a patched libc, rather than the current state of affairs in
requiring a patched libc to use Rust on 12.

A better, or complementary, approach would be something like proposed in
https://github.com/rust-lang/rfcs/pull/2048 to allow targetting a specific
version of FreeBSD. This would allow Rust to default to this compatibility
mode by targetting FreeBSD10 and still allow targetting FreeBSD12 for 64-bit
ino_t.

The symbol versions used were taken from the old version in
f713b08c02 (diff-61a32fcfb7ecd4517665fed591813c57)
and
f713b08c02 (diff-7f67ccf8b5f44ff2f54eaab0207abb8d).

The scope of functions versioned here differs from other platforms as
not all structs were modified that were on others, such as DIR for
`opendir`, `telldir`, etc.  Only functions using dirent, stat, glob_t,
and dev_t need the changes.

Fixes https://github.com/rust-lang/rust/issues/42681
2018-03-01 15:26:26 -08:00
bors f0938610e5 Auto merge of #936 - bdrewery:freebsd-kevent-compat, r=alexcrichton
Link against kevent@FBSD_1.0 to fix ABI compat with FreeBSD12.

struct kevent was modified in FreeBSD12.  The @FBSD_1.0 symbol supports the old
structure ABI still.

This allows the `mio` crate tests to now pass on FreeBSD12.
2018-03-01 20:50:57 +00:00
Bryan Drewery 969ad2b73c Link against kevent@FBSD_1.0 to fix ABI compat with FreeBSD12.
struct kevent was modified in FreeBSD12.  The @FBSD_1.0 symbol supports the old
structure ABI still.

This allows the `mio` crate tests to now pass on FreeBSD12.
2018-03-01 12:36:00 -08:00
bors 677b645353 Auto merge of #935 - bgermann:master, r=alexcrichton
Add Solaris constants needed by net2

The added constants are
IPV6_UNICAST_HOPS,
IPV6_MULTICAST_IF,
IPV6_MULTICAST_HOPS,
IP_MULTICAST_IF.
2018-03-01 15:05:18 +00:00
bgermann c299cc49d3 Add Solaris constants needed by net2
The added constants are
IPV6_UNICAST_HOPS,
IPV6_MULTICAST_IF,
IPV6_MULTICAST_HOPS,
IP_MULTICAST_IF.
2018-03-01 12:48:24 +01:00
bors 2bfacc8633 Auto merge of #933 - raphlinus:ipv6_fuchsia, r=alexcrichton
Add IPV6_UNICAST_HOPS to fuchsia module

Recent change #925 added constants for IPV6 multicast, but seems to have inadvertently left off IPV6_UNICAST_HOPS from the fuchsia module.

Fixes #932
2018-02-28 23:48:15 +00:00
Raph Levien 709709db15 Add IPV6_UNICAST_HOPS to fuchsia module
Recent change #925 added constants for IPV6 multicast, but seems
to have inadvertently left off IPV6_UNICAST_HOPS from fuchsia.

Fixes #932
2018-02-28 15:41:50 -08:00
bors 8bed48a751 Auto merge of #931 - bdrewery:posix_spawn_freebsd, r=alexcrichton
Add posix_spawn bindings for FreeBSD
2018-02-28 17:30:10 +00:00
bors 92d3739070 Auto merge of #930 - gnzlbg:fix_musl, r=alexcrichton
Fix --no-default-features builds

Closes #928 #929 #684
2018-02-28 15:45:08 +00:00
gnzlbg 78320c7c75 retry 2018-02-28 15:27:38 +01:00
gnzlbg 2938d1c4c2 fix style 2018-02-28 10:58:01 +01:00
gnzlbg 5c95d8d03b wrap target_vendor with stdbuild 2018-02-28 08:34:12 +01:00
gnzlbg f9c396803c perform ctest with and without std 2018-02-27 17:36:45 +01:00
gnzlbg 5b890a31bd fix ci script 2018-02-27 17:08:14 +01:00
gnzlbg 4c0b6ea61e fix style 2018-02-27 16:13:49 +01:00
gnzlbg 988843834f test --no-default-features and fix musl builds 2018-02-27 15:47:18 +01:00
bors bb2a95c9f2 Auto merge of #927 - bluejekyll:master, r=alexcrichton
Bump to 0.2.37

This includes:
- more multicast fields
- netfilter/nftables fields
2018-02-27 09:36:10 +00:00
Benjamin Fry 5a50bec431 0.2.37 for release 2018-02-26 21:23:21 -08:00
Bryan Drewery 92d50c9c79 Add posix_spawn bindings for FreeBSD 2018-02-26 16:45:41 -08:00
bors 8650afb555 Auto merge of #926 - faern:add-netfilter-fields, r=alexcrichton
Add netfilter/nftables fields

Adding a few missing `NF_` constants to more complete the story around that header. Then most importantly add a lot of `NFT_` constants needed in my nftables library. Some were added back in #911, but as the library grew I realized I needed more constants.
2018-02-26 03:28:23 +00:00
bors 42377bb76d Auto merge of #925 - bluejekyll:master, r=alexcrichton
add IPV6_MULTICAST_IF and IPV6_MULTICAST_HOPS

These were missing from the net2 crate. Adding them here so that the higher functions can be added to net2 later. They are necessary for declaring the interface for ipv6 multicast packets (route), and limits on the number of hops an ipv6 packet can travel

Linux reference: https://github.com/torvalds/linux/blob/master/include/uapi/linux/in6.h#L168-L170
macOS reference: https://github.com/apple/darwin-xnu/blob/master/bsd/netinet6/in6.h#L538-L540
2018-02-26 03:07:07 +00:00
Benjamin Fry 0e421c9611 add IPV6_UNICAST_HOPS 2018-02-25 15:23:46 -08:00
Linus Färnstrand b89d662117 Add missing NFT_ constants from nf_tables.h 2018-02-25 22:45:43 +01:00
Linus Färnstrand 750fcf5c5a Add missing netfilter constants
Was able to move some of them up one level so they are valid on more
platforms with less duplication
2018-02-25 22:45:43 +01:00
Linus Färnstrand c8fb675939 Add INT_MIN and INT_MAX 2018-02-25 22:22:09 +01:00
Benjamin Fry 7ed5599a64 add IPV6_MULTICAST_IF and IPV6_MULTICAST_HOPS 2018-02-25 10:58:44 -08:00
bors c4736915ea Auto merge of #924 - kristate:android_eth_p_fix, r=alexcrichton
Add ETH_* constants on Android

Adding ETH_* constants that were found here on Linux but not on Android.

Source Reference is [linux/if_ether.h](https://android.googlesource.com/platform/bionic/+/master/libc/kernel/uapi/linux/if_ether.h) on Google OpenSource.

Thank-you.

/cc nix-rust/nix#865
2018-02-25 15:33:01 +00:00
kristopher tate 28224dfe81 android: removing some newer constants included since kernel v4.12.3; 2018-02-25 23:39:37 +09:00
kristopher tate 8ed59661a0 android: fixes style errors; 2018-02-25 23:39:37 +09:00
kristopher tate d160a59ac8 android: ETH_* constants from linux/if_ether.h ; ref nix-rust/nix#865 2018-02-25 23:39:37 +09:00
bors 2c978165b1 Auto merge of #922 - faern:add-netlink-structs, r=alexcrichton
Add netlink structs to all notbsd platforms

Adding the remaining structs from `<linux/netlink.h>`. Sadly very duplicated, but that's how it ended up when added to all "notbsd" platforms except musl. If there is a better way to structure it to reduce duplication I'm all ears!
2018-02-25 11:59:13 +00:00
Linus Färnstrand 95befb4b20 Bump NFT_*_MAXNAMELEN to 256 2018-02-25 02:05:28 +01:00
Linus Färnstrand fe499944e7 Move non-musl GENL_ constants to correct submodules 2018-02-25 00:23:50 +01:00
Linus Färnstrand 69ae346034 Add genetlink.h constants 2018-02-22 14:58:22 +01:00
Linus Färnstrand 393271185a Add NLA_ALIGN(TO) constant/function 2018-02-22 14:58:22 +01:00
Linus Färnstrand 6e211cdf61 Add netlink/genetlink structs to notbsd 2018-02-22 14:58:10 +01:00
bors 88c33d4580 Auto merge of #920 - glaubitz:sparc64, r=alexcrichton
Prefer hexadecimal representation of O_TMPFILE on linux-sparc64

While working on the libc bindings for sparc-linux, I stumbled across this typo in the O_TMPFILE definition on linux-sparc64.

Compare with:

> https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/unix/sysv/linux/sparc/bits/fcntl.h;hb=16efad5171ac1ac2c8728405f2703045f08c494b#l42
> https://sources.debian.org/src/glibc/2.26-6/sysdeps/unix/sysv/linux/sparc/bits/fcntl.h/#L42

CC @jrtc27
2018-02-17 23:55:53 +00:00
John Paul Adrian Glaubitz a9cddbcfcf Prefer hexadecimal representation of O_TMPFILE on linux-sparc64 2018-02-17 17:58:16 +01:00
bors a4fb64a9ff Auto merge of #919 - Susurrus:netbsd_termios_ioctl, r=alexcrichton
Add termios ioctl constants to NetBSD

These are all declared as `c_ulong` because that's what BSD's `ioctl()` function is declared with.
2018-02-14 18:27:39 +00:00
Bryant Mairs 3dd2162fe0 Add termios ioctl constants to NetBSD 2018-02-13 21:05:46 -08:00
bors bbda50d209 Auto merge of #916 - LuoZijun:patch-1, r=alexcrichton
Add `IFF_*` constants  to linux, android and fuchsia

Add constants to android and fuchsia:

*    IFF_TUN
*    IFF_TAP
*    IFF_NO_PI

Type problem: https://github.com/rust-lang/libc/issues/915

so change constants type `libc::c_short` to `libc::c_int` :

*    IFF_*
2018-02-07 03:48:57 +00:00
luozijun 0f4ae0b8f1 Add constants IFF_TUN, IFF_TAP and IFF_NO_PI on linux, android and fuchsia system 2018-02-07 11:12:29 +08:00
bors 9e8447d006 Auto merge of #912 - gnzlbg:macosx_shmem, r=alexcrichton
add some sysv shared memory to macosx
2018-02-03 23:08:27 +00:00
gnzlbg 53e4733180 add macosx sysv ipc shared memory 2018-02-03 14:43:38 +01:00
bors 782794985c Auto merge of #902 - gnzlbg:missing_linux_intrinsics, r=malbarbo
Missing linux intrinsics
2018-02-01 15:41:35 +00:00
gnzlbg ea58a8cb59 remove memfd_create 2018-02-01 14:42:49 +01:00
bors c9e67b8f15 Auto merge of #911 - faern:add-netfilter, r=alexcrichton
Add netfilter constants to Linux

Constants and enums from [`netfilter.h`] and [`nf_tables.h`].

I was not really sure what to do with the enums, for example `nf_tables_msg_types`. But since I could not find a C enum mapped into a Rust enum in this crate I assumed you wanted them as constants instead.

I also wanted to get the `nf_inet_addr` union in here. But I did not find any unions in this crate so I was not sure how you would prefer it represented.

There are of course a billion more netfilter constants and types to map. But this is a good start.

[`netfilter.h`]: ead751507d/include/uapi/linux/netfilter.h
[`nf_tables.h`]: ead751507d/include/uapi/linux/netfilter/nf_tables.h
2018-01-31 06:28:39 +00:00