Commit graph

5376 commits

Author SHA1 Message Date
Jakob Naucke b566c54f04
Update crate version to 0.2.114 2022-01-24 14:54:07 +01:00
bors 78e76aa33f Auto merge of #2644 - rtzoeller:dfly_cmsg_align_again, r=Amanieu
Fix _CMSG_ALIGN on DragonFly

The attempted fix in #2610 originally had `7` hard coded, but it was suggested I replace this with a size_of call. Unfortunately the suggestion omitted a subtraction from the size_of call, and I didn't catch it.

Tested by running the failing `nix` tests on DragonFly (and didn't change the code again after running the tests).
2022-01-24 02:29:50 +00:00
bors 4d0347364e Auto merge of #2642 - tamird:mreqn-all-linux, r=Amanieu
Define ip_mreqn on all Linux platforms

Updates #1558.
2022-01-24 01:24:36 +00:00
Tamir Duberstein da84eefd71
Define ip_mreqn on all Linux platforms
Updates #1558.
2022-01-23 15:52:27 -05:00
Ryan Zoeller a894685dbe Fix _CMSG_ALIGN on DragonFly
The last fix originally had 3 hard coded, but it was suggested I replace
this with a size_of call. Unfortunately the suggestion omitted a
subtraction from the size_of call, and I didn't catch it.
2022-01-23 03:19:04 -06:00
bors 8bba79c467 Auto merge of #2640 - skrap:master, r=Amanieu
add CI for armv7-unknown-linux-uclibceabihf

As discussed in https://github.com/rust-lang/libc/pull/2636, this is a framework for CI on targets with no prebuilt std.  They will build via `nightly` and `-Zbuild-std`, and run the unit tests via qemu-user (or whatever else the dockerfile specifies).

It seems like I could write some more documentation about how to add more targets of this type, but perhaps I can get a round of feedback on the mechanism here before I go and write that.
2022-01-21 22:11:26 +00:00
bors 7600416f1c Auto merge of #2543 - asomers:fspacectl, r=Amanieu
Add fspacectl, new in FreeBSD 14
2022-01-21 20:47:54 +00:00
Jonah Petri bc9e590053 add CI for armv7-unknown-linux-uclibceabihf 2022-01-21 13:25:00 -05:00
Alan Somers be392861b6 Add fspacectl, new in FreeBSD 14 2022-01-20 18:49:54 -07:00
bors 72e41512de Auto merge of #2638 - devnexen:shm_create_largepage_fbsd, r=Amanieu
freebsd 13 non thp userspace fn.
2022-01-21 00:46:52 +00:00
bors 599fa5c8bf Auto merge of #2637 - asomers:no-kern-stacktop, r=Amanieu
Fix the build on the latest FreeBSD 14 snapshot

* KERN_STACKTOP was recently removed upstream, and has never been included in a stable FreeBSD release
* The MNTK_ flags are for kernel use only and aren't visible to userland

cc `@GuillaumeGomez`
2022-01-20 23:43:24 +00:00
David CARLIER 0ee0aee6a7 freebsd 13 non thp userspace fn. 2022-01-20 14:00:05 +00:00
bors cf597c2d6f Auto merge of #2636 - skrap:master, r=Amanieu
uclibc: fix O_TMPFILE value, hide some unused fields to fix libc-test

This was a bit of a yak-shave.

First, O_TMPFILE was wrong because 020000000 is decimal, not octal.  🤦   This was, of course, causing all sorts of things to be horrible.

That led me to switch to a newer toolchain which actually defined O_TMPFILE, so that the libc tests pass on `armv7-unknown-linux-uclibceabihf`.

That revealed that certain field names had changed since the last time I ran the libc tests on this architecture, which revealed that some struct fields (e.g. `__unused`) were being marked as `pub` where all other architectures left them as private.

So, this patch might seem somewhat sprawling, but without all of these changes it's not possible to run libc-test!

To test:
* get https://toolchains.bootlin.com/downloads/releases/toolchains/armv7-eabihf/tarballs/armv7-eabihf--uclibc--bleeding-edge-2021.11-1.tar.bz2
* unpack somewhere, and call that `$TOOLCHAIN`
```
cd libc-test

PATH=$TOOLCHAIN/bin:$PATH \
  CC_armv7_unknown_linux_uclibc=armv7-buildroot-linux-uclibc-gcc \
  CARGO_TARGET_ARMV7_UNKNOWN_LINUX_UCLIBCEABIHF_LINKER=armv7-buildroot-linux-uclibc-gcc \
  CARGO_TARGET_ARMV7_UNKNOWN_LINUX_UCLIBCEABIHF_RUNNER="qemu-arm -L $TOOLCHAIN/arm-buildroot-linux-uclibcgnueabihf/sysroot/" \
  cargo +nightly test --target armv7-unknown-linux-uclibceabihf -Zbuild-std=core,std
```
2022-01-20 02:26:41 +00:00
Alan Somers 39b5891b72 Update the FreeBSD 14 CI image 2022-01-19 18:32:36 -07:00
bors f617891e40 Auto merge of #2635 - Thomasdezeeuw:v0.2.113, r=Amanieu
Release v0.2.113

To include https://github.com/rust-lang/libc/pull/2625.

Unblocks https://github.com/rust-lang/socket2/pull/284
2022-01-20 01:23:46 +00:00
Alan Somers c53bec491e Delete FreeBSD's MNTK_ constants
These are only for the kernel's internal use and aren't exposed to
userland.  They also aren't stable across versions, and may be changed
or deleted at any time.  For example, by
4dcdf3987c
2022-01-19 17:53:45 -07:00
Alan Somers ec4f56f9af Remove KERN_STACKTOP
It got removed by upstream.  This should not be considered a breaking
change, because KERN_STACKTOP has never been included in a released
version of FreeBSD.

1544f5add8
2022-01-19 17:29:30 -07:00
Jonah Petri 0fcf5b32c5 uclibc: fix O_TMPFILE value, un-pub some unused fields to fix libc-test 2022-01-19 15:26:14 -05:00
bors 6987bba752 Auto merge of #2634 - skrap:master, r=Amanieu
uclibc: Don't specialize PTRACE_O_MASK for uclibc

This constant comes from the kernel headers, so its value should not depend on the libc type.

To test: see instructions in https://github.com/rust-lang/libc/pull/2566
2022-01-19 18:43:46 +00:00
Thomas de Zeeuw 178147edf9 Release v0.2.113 2022-01-19 19:35:23 +01:00
Jonah Petri c4d87be1de uclibc: PTRACE_O_MASK comes from the kernel, not from libc, so don't specialize it for uclibc 2022-01-19 09:33:25 -05:00
bors 3b15a77cdf Auto merge of #2615 - lancethepants:TIOCGWINSZ, r=Amanieu
define TIOCGWINSZ as c_ulong under arm-uclibc.

I'm trying to bring up a new target for rust, `armv7-unknown-linux-uclibceabi (softfloat)`. https://github.com/rust-lang/rust/pull/92383 Looks like a lot of work has already been hashed out from the recent addition of `armv7-unknown-linux-uclibceabihf`. The only issue I'm currently seeing is when I encounter `TIOCGWINSZ` in a couple places. This is the error I see.
```
   Compiling termize v0.1.1 (/mmc/.cargo/registry/src/github.com-1285ae84e5963aae/termize-0.1.1)
error[E0277]: the trait bound `u32: From<i32>` is not satisfied
  --> src/platform/unix.rs:12:43
   |
12 |     let mut result = ioctl(STDOUT_FILENO, TIOCGWINSZ.into(), &mut window);
   |                      -----                ^^^^^^^^^^^^^^^^^ the trait `From<i32>` is not implemented for `u32`
   |                      |
   |                      required by a bound introduced by this call
   |
   = help: the following implementations were found:
             <u32 as From<Ipv4Addr>>
             <u32 as From<NonZeroU32>>
             <u32 as From<bool>>
             <u32 as From<char>>
           and 2 others
   = note: required because of the requirements on the impl of `Into<u32>` for `i32`

error[E0277]: the trait bound `u32: From<i32>` is not satisfied
```
I see the error in the `termize` crate, and also `shell.rs` in the cargo source.

My current fix is to define TIOCGWINSZ as c_ulong under arm-uclibc.

I don't want to break anything with the established `armv7-unknown-linux-uclibceabihf` target so perhaps `@skrap` could chime in and take a look. Maybe a better solutions exists.
2022-01-18 19:21:00 +00:00
lancethepants dc36824353 Undefine FIOASYNC for sparc64. 2022-01-18 08:09:55 -07:00
bors 8cba30b000 Auto merge of #2625 - tamird:ip_mreqn, r=Amanieu
Add `ip_mreqn` on more platforms

See individual commits; please do not squash on merge. `@Thomasdezeeuw`
2022-01-17 15:55:09 +00:00
Tamir Duberstein 037d7415a7
Add ip_mreqn on Android
This was added to Android's libc (bionic) in 2013. See
655a7c081f.
2022-01-17 15:39:52 +00:00
Tamir Duberstein 3bbc552727
Add ip_mreqn on FreeBSD
This was added in FreeBSD 13.0.0. See
https://github.com/freebsd/freebsd-src/commit/0dfc145a.
2022-01-17 15:37:50 +00:00
Tamir Duberstein 6fbe3b78f1
Add ip_mreqn on Apple platforms
Available since macOS 10.7. See
https://developer.apple.com/documentation/kernel/ip_mreqn.
2022-01-17 14:05:15 +00:00
lancethepants 33842946b6 Consolidate all Ioctl constants and functions by architecture. 2022-01-17 00:45:24 -07:00
bors df679e8075 Auto merge of #2631 - devnexen:fbsd13_upd_shm, r=Amanieu
shm api update from FreeBSD 13
2022-01-17 03:06:28 +00:00
bors f0ba214ebb Auto merge of #2630 - kaniini:chore/s390x-musl-fixes, r=Amanieu
Fix definitions for the s390x-musl target.

When I was creating the original s390x musl definitions, I copied a little too closely from glibc for the ioctl(2) constants.  This was then exacerbated in c7c238d812 with the creation of an erroneous definition.
2022-01-17 02:00:08 +00:00
bors 5617b46596 Auto merge of #2629 - devnexen:apple_execinfo_upd, r=Amanieu
macOs update backtrace api.
2022-01-17 00:58:07 +00:00
bors e469fc25f7 Auto merge of #2628 - devnexen:netbsd_prot_mprotect, r=Amanieu
netbsd add PROT_MPROTECT macros.
2022-01-16 23:33:36 +00:00
bors 805321e233 Auto merge of #2626 - Mek101:master, r=Amanieu
Add android ioctl constansts: BLKSSZGET and BLKPBSZGET

Adds the linux ioctl constants to android
2022-01-16 22:29:09 +00:00
David CARLIER 0a57541a71 shm api update from FreeBSD 13 2022-01-16 09:00:40 +00:00
Ariadne Conill ecb5345b19 Fix definitions of FIONBIO/FIONCLEX/FIOCLEX constants on s390x-musl.
On musl, these constants must be ints, not ulongs.  On glibc, they are
ulong, and as such, were erroneously included as ulongs in the initial
s390x-musl definitions.
2022-01-16 04:08:21 +00:00
Ariadne Conill 23a3e1f293 Fix ioctl definition on s390x-musl targets.
ioctl(2) always takes an int as the request, not a ulong, on musl.
I copied a little too closely from the glibc definitions when creating
the original s390x-musl ones.
2022-01-16 04:05:33 +00:00
David CARLIER 6cce830b96 macOs update backtrace api. 2022-01-15 11:59:06 +00:00
David Carlier 5d9ec7b499 netbsd add PROT_MPROTECT macros. 2022-01-15 06:41:37 +00:00
Mek101 9c55170044 Add android ioctl constansts: BLKSSZGET and BLKPBSZGET 2022-01-13 21:17:32 +01:00
bors e470e3b6a1 Auto merge of #2624 - rtzoeller:umount_nofollow, r=Amanieu
Define UMOUNT_NOFOLLOW on Linux-like platforms

Requested-by: https://github.com/nix-rust/nix/issues/1631
2022-01-13 13:00:48 +00:00
Ryan Zoeller 4b462354e1 Define UMOUNT_NOFOLLOW on Linux-like platforms 2022-01-12 21:34:49 -06:00
bors 26b68f834c Auto merge of #2622 - devnexen:fuse_super_magic, r=Amanieu
linux GLIBC add FUSE_SUPER_MAGIC

close #2621
2022-01-12 17:07:42 +00:00
bors c1ffba4263 Auto merge of #2620 - rtzoeller:android_posix_vdisable, r=Amanieu
Android defines _POSIX_VDISABLE

c44b1d0676/libc/include/bits/posix_limits.h (L95)
2022-01-12 16:03:36 +00:00
David Carlier fc9854f0d3 linux GLIBC add FUSE_SUPER_MAGIC
close #2621
2022-01-12 15:19:59 +00:00
Ryan Zoeller e6bd49cf31 Android defines _POSIX_VDISABLE 2022-01-10 22:43:43 -06:00
bors c1b386055f Auto merge of #2617 - devnexen:fbsd14_cpuset_upd, r=Amanieu
freebsd add CPU_COUNT macro
2022-01-09 00:39:21 +00:00
bors 847f7174ef Auto merge of #2618 - devnexen:linux_gnu_malloc_trim, r=Amanieu
linux GLIBC add malloc_trim fn.
2022-01-08 19:04:09 +00:00
David Carlier 95e74dd173 linux GLIBC add malloc_trim fn. 2022-01-08 15:54:31 +00:00
David CARLIER 21aadd4142 freebsd add CPU_COUNT macro 2022-01-06 20:45:14 +00:00
bors 1f1ebd5b80 Auto merge of #2616 - nanpuyue:fix-freebsd-ttycom, r=Amanieu
fix(freebsd): incorrect constant type from ttycom.h

ref: https://github.com/rust-lang/libc/pull/493

the value and type of the constant are obtained by executing the following script

ttycom.sh:
```
#/bin/sh

cat <<EOF
#include <stdio.h>
#include <sys/ttycom.h>
#include <sys/time.h>
#include <termios.h>

void main() {
EOF

grep -o TIOC[A-Z_]* /usr/include/sys/ttycom.h | sort -u |\
 xargs -I{} echo '    printf("pub const {}: u%lu = 0x%lx;\n", sizeof({})*8, {});'

echo '}'
```

```
./ttycom.sh > main.c
clang main.c
./a.out
```
2022-01-05 23:35:48 +00:00