6377 Commits
Author SHA1 Message Date
bors f4cae6738d Auto merge of #2999 - SteveLauC:major/minor-on-BSDs, r=<try>
add major/minor on BSDs/illumos

This PR adds `major/minor` on BSDs and `major/minor/makedev` on illumos.

Ref:
* [FreeBSD 11](https://github.com/freebsd/freebsd-src/blob/3e9337c6b211e778829ed3af783cd41447a8721b/sys/sys/types.h#L372-L374)
   ```c
   #define	major(x)	((int)(((u_int)(x) >> 8)&0xff))	/* major number */
   #define	minor(x)	((int)((x)&0xffff00ff))		/* minor number */
   ```
* [FreeBSD 12/13/14](https://github.com/freebsd/freebsd-src/blob/3d98e253febf816e6e2aea7d3b1c013c421895de/sys/sys/types.h#L332-L341)
  ```c
  static __inline int
  __major(dev_t _d)
  {
      return (((_d >> 32) & 0xffffff00) | ((_d >> 8) & 0xff));
  }

  static __inline int
  __minor(dev_t _d)
  {
      return (((_d >> 24) & 0xff00) | (_d & 0xffff00ff));
  }
  ```
* [DragonFly](https://github.com/DragonFlyBSD/DragonFlyBSD/blob/d7a10f947f5344fc95e874ca3b83e9e8d0986b25/sys/sys/types.h#L170-L171)
  ```c
  #define	major(x)	((int)(((u_int)(x) >> 8)&0xff)) /* major number */
  #define	minor(x)	((int)((x)&0xffff00ff))         /* minor number */
  ```
* [NetBSD](https://github.com/NetBSD/src/blob/a25a6fec1b0a676fc5b36fa01b2990e775775d90/sys/sys/types.h#L264-L266)
   ```c
  #define	major(x)	((devmajor_t)(((uint32_t)(x) & 0x000fff00) >>  8))
  #define	minor(x)	((devminor_t)((((uint32_t)(x) & 0xfff00000) >> 12) | \
				                      (((uint32_t)(x) & 0x000000ff) >>  0)))
   ```
* [OpenBSD](https://github.com/openbsd/src/blob/05cbc9aa8d8372e83274c75e35add6b8073c26f5/sys/sys/types.h#L211-L212)
   ```c
   #define	major(x)	(((unsigned)(x) >> 8) & 0xff)
   #define	minor(x)	((unsigned)((x) & 0xff) | (((x) & 0xffff0000) >> 8))
   ```
* illumos:

  1. [mkdev.c](https://github.com/illumos/illumos-gate/blob/8b26092d555bd1deaacf79ea64da374602aefb65/usr/src/lib/libc/port/gen/mkdev.c#L40-L146)
  2. [mkdev.h](https://github.com/illumos/illumos-gate/blob/8b26092d555bd1deaacf79ea64da374602aefb65/usr/src/uts/common/sys/mkdev.h#L97-L99)
2023-05-06 07:25:56 +00:00
Steve Lau 6c19c7cad6 fix clippy 2023-05-06 15:18:20 +08:00
bors 461807bbd1 Auto merge of #3237 - loongarch-rs:loongarch64, r=JohnTitor
linux_like: Add missing constants for loongarch64
2023-05-06 05:26:05 +00:00
bors e5d9339601 Auto merge of #3206 - roblabla:rtmsghdr-apple, r=JohnTitor
Add PF_ROUTE-related structures on Apple systems

This commit adds the following structures from [net/route.h](https://github.com/roblabla/MacOSX-SDKs/blob/master/MacOSX13.3.sdk/usr/include/net/route.h):

- rt_msghdr
- rt_msghdr2
- rt_metrics

and the following structures from [net/if.h](https://github.com/roblabla/MacOSX-SDKs/blob/master/MacOSX13.3.sdk/usr/include/net/if.h):

- ifa_msghdr
- ifma_msghdr
- ifma_msghdr2
2023-05-06 04:21:43 +00:00
bors cc8a87be05 Auto merge of #3224 - stevenengler:wait-for-one, r=JohnTitor
Add `MSG_WAITFORONE` to freebsd and openbsd

Adds `MSG_WAITFORONE` to freebsd, openbsd, and ~illumos~, as requested in https://github.com/nix-rust/nix/pull/2014.

I got the values from:

- freebsd: http://fxr.watson.org/fxr/source/sys/socket.h#L473
- openbsd: https://github.com/openbsd/src/blob/2852e11abfc574a216ce741308fb0c6968d9617a/sys/sys/socket.h#L512
- illumos: https://github.com/illumos/illumos-gate/blob/717646f7112314de3f464bc0b75f034f009c861e/usr/src/boot/sys/sys/socket.h#L434

This flag is also supposedly supported on [solaris](https://docs.oracle.com/cd/E88353_01/html/E37843/recvmmsg-3c.html), but I don't know how to find the value. If anyone knows what it is, I'll add it to the PR.
2023-05-06 03:20:37 +00:00
bors 7f9adf8738 Auto merge of #3231 - devnexen:fbsd_procctl_x8664, r=JohnTitor
freebsd add few more procctl x86_64 constants.
2023-05-06 02:18:48 +00:00
WANG Rui 1d1051684b linux_like: Add missing constants for loongarch64 2023-05-06 10:11:06 +08:00
bors 0b758afcdc Auto merge of #3232 - devnexen:redox_poll_consts, r=JohnTitor
redox add few more poll constants
2023-05-03 23:52:09 +00:00
David Carlier 82fdf04f81 redox add few more poll constants 2023-05-03 19:08:41 +01:00
bors fff5dbe033 Auto merge of #3228 - redox-os:redox-pw, r=JohnTitor
redox: add grp.h and pwd.h functions for the users crate
2023-05-01 05:41:31 +00:00
bors 66e988b9b9 Auto merge of #3230 - nikarh:vita-rand, r=JohnTitor
Added getentropy to vita target

This is a late addition to https://github.com/rust-lang/libc/pull/3209. This definition is required in order to implement random in std correctly.

As the previous PR, getentropy is a standard C function, should be implemented by newlib provider, and is not Sony's intellectual property.
2023-05-01 04:32:59 +00:00
David CARLIER e979ba6138 freebsd add few more procctl x86_64 constants. 2023-04-28 23:51:41 +01:00
Nikolay Arhipov 0b2ed16135 Added getentropy to vita target 2023-04-28 13:19:47 +03:00
Jeremy Soller f4ed4a7865 redox: add grp.h and pwd.h functions for the users crate 2023-04-26 11:37:35 -06:00
bors 0485ee3ec3 Auto merge of #3227 - JohnTitor:unignore-on-sparc64, r=JohnTitor
Unignore some items test on sparc64
2023-04-26 15:54:55 +00:00
bors 8a3a8be77d Auto merge of #3226 - ChrisDenton:std-no-legacy, r=JohnTitor
Don't link `legacy_stdio_definitions` from std

std on windows-msvc does not use `printf` or `fprintf` so never needs the `legacy_stdio_definitions.lib` import library and will always work fine without it.
2023-04-26 14:44:23 +00:00
Yuki Okushi 2062d0ac9e Unignore some items test on sparc64
Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2023-04-26 23:05:58 +09:00
bors 4c27d5da3a Auto merge of #3209 - nikarh:vita, r=JohnTitor
armv7 PSVita OS support via newlib

Added support for ps vita via newlib.
Similar to #2480, but for a different device.

I'm working on adding support of std for vita, and this is essentially a prerequisite.
2023-04-26 13:32:45 +00:00
bors f5541af868 Auto merge of #3222 - jessicah:fix-haiku-memmem, r=JohnTitor
haiku: fix incorrect linked library.

Introduced in fb2a763; using a non-existent "libunix". This is in libgnu.
2023-04-26 10:22:22 +00:00
Chris Denton 34866c136d Don't link legacy_stdio_definitions from std
std on Windows does not use `printf` or `fprintf` so never needs the `legacy_stdio_definitions.lib` import library.
2023-04-26 06:00:33 +01:00
Steven Engler 4e1f0e1207 Removed MSG_WAITFORONE from illumos 2023-04-25 15:46:46 -04:00
Steven Engler 3be2573919 Added MSG_WAITFORONE to freebsd, openbsd, and illumos 2023-04-25 15:32:32 -04:00
roblabla 404ad40329 Add PF_ROUTE structures on Apple systems
This commit adds the following structures from net/route.h:

- rt_msghdr
- rt_msghdr2
- rt_metrics

and the following structures from net/if.h:

- ifa_msghdr
- ifma_msghdr
- ifma_msghdr2
2023-04-25 17:15:19 +02:00
Jessica Hamilton 2bc73cc379 haiku: fix incorrect linked library.
Introduced in fb2a763; using a non-existent "libunix". This is in
libgnu.
2023-04-25 18:45:04 +12:00
bors 5744793b48 Auto merge of #3220 - JohnTitor:sparc64-2022-12-09, r=JohnTitor
Use the latest Debian for SPARC64
2023-04-24 19:47:52 +00:00