summaryrefslogtreecommitdiff
path: root/src/unix/bsd
Commit message (Collapse)AuthorAgeFilesLines
* Change branch references to HEAD where possible or main otherwiseJosh Triplett2023-05-155-9/+9
| | | | | | | This updates CI, documentation, and similar to work with a `main` branch. It also renames references to *other* repositories to work, as well, which additionally makes it easier to search for remaining references.
* Constify `CMSG_LEN` for all targets.John Millikin2023-05-085-5/+5
|
* freebsd: add missing SCM_ constantsVal Packett2023-05-071-0/+4
|
* freebsdlike: add rebootVal Packett2023-05-073-0/+28
|
* bsd: add setloginVal Packett2023-05-071-0/+1
|
* freebsdlike: add kenvVal Packett2023-05-072-0/+17
|
* Auto merge of #3233 - GuillaumeGomez:proc-darwin, r=Amanieubors2023-05-061-0/+12
|\ | | | | | | | | | | Add missing <proc.h> constants for darwin I need these values for the `sysinfo` crate.
| * Add missing <proc.h> constants for darwinGuillaume Gomez2023-05-051-0/+12
| |
* | Auto merge of #2999 - SteveLauC:major/minor-on-BSDs, r=JohnTitorbors2023-05-067-0/+72
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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)
| * | add major/minor on BSDs/illumosSteve Lau2023-05-067-0/+72
| | |
* | | Auto merge of #3206 - roblabla:rtmsghdr-apple, r=JohnTitorbors2023-05-061-0/+74
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * | | Add PF_ROUTE structures on Apple systemsroblabla2023-04-251-0/+74
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | | Auto merge of #3224 - stevenengler:wait-for-one, r=JohnTitorbors2023-05-062-0/+3
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * | | | Added `MSG_WAITFORONE` to freebsd, openbsd, and illumosSteven Engler2023-04-252-0/+3
| | |_|/ | |/| |
* | | | freebsd add few more procctl x86_64 constants.David CARLIER2023-04-281-0/+7
|/ / /
* | | Auto merge of #3210 - devnexen:fbsd_elf_aux_info_constants, r=JohnTitorbors2023-04-231-0/+9
|\ \ \ | | | | | | | | | | | | freebsd add elf_aux_info constants
| * | | freebsd add elf_aux_info constantsDavid CARLIER2023-04-201-0/+9
| | |/ | |/|
* | | Clean up some `extern`sYuki Okushi2023-04-231-24/+22
| | | | | | | | | | | | Signed-off-by: Yuki Okushi <jtitor@2k36.org>
* | | Auto merge of #3040 - 0-wiz-0:netbsd, r=JohnTitorbors2023-04-221-1/+9
|\ \ \ | |/ / |/| | | | | | | | | | | NetBSD: add two more errno values available in NetBSD-current since 2020
| * | netbsd add deprecation warning for ELASTThomas Klausner2023-04-211-0/+6
| | | | | | | | | | | | Requested in #3040
| * | netbsd add two more errnosThomas Klausner2022-12-191-1/+3
| | | | | | | | | | | | available in NetBSD-current since 2020
* | | freebsd i686 add ucontext/mcontextDavid Carlier2023-04-181-0/+155
| |/ |/| | | | | close #3196.
* | Auto merge of #3188 - valpackett:waitconst, r=JohnTitorbors2023-04-122-1/+15
|\ \ | | | | | | | | | | | | | | | | | | | | | netbsd,openbsd: add more waitid related constants `P_ALL`/`P_PID`/`WEXITED`/`WNOWAIT`/`WSTOPPED` in particular are what's required for rustix to support waitid and they were missing on OpenBSD; while here add NetBSD's custom ones. ping `@semarie`
| * | netbsd,openbsd: add more waitid related constantsVal Packett2023-04-062-1/+15
| | |
* | | Auto merge of #3167 - devnexen:fbsd_map_aligned, r=JohnTitorbors2023-04-091-0/+12
|\ \ \ | |/ / |/| | | | | freebsd add MAP_ALIGNED macro
| * | freebsd add MAP_ALIGNED macroDavid CARLIER2023-04-041-0/+12
| | |
* | | netbsd add MAP_ALIGNED macroDavid Carlier2023-04-041-0/+13
|/ /
* | Add missing kqueue constants across BSDsVal Packett2023-03-294-5/+28
| | | | | | | | While here, reorder some to match the C headers
* | apple: add time.h functionsshua2023-03-261-0/+17
| |
* | Add OpenBSD CLOCK_* constantsLaurent Cheylus2023-03-131-0/+6
| | | | | | | | | | | | | | | | - src/unix/bsd/netbsdlike/openbsd/mod.rs: add CLOCK_* constants from /usr/include/sys/_time.h - libc-test/semver/openbsd.txt: update file for new constants CLOCK_* Signed-off-by: Laurent Cheylus <foxy@free.fr>
* | Add posix_spawnattr_set_qos_class_npStiopa Koltsov2023-02-221-0/+8
| | | | | | | | https://opensource.apple.com/source/libpthread/libpthread-137.1.1/pthread/spawn.h
* | add p_name field in kinfo_proc struct on OpenBSDSébastien Marie2023-02-221-0/+1
| | | | | | | | | | | | | | pthread_get_name_np() and pthread_set_name_np() are now using a kernel storage and could be viewed from outside the process. Reference: https://github.com/openbsd/src/commit/cef5a146e600a27064f0ea2aa25fc5f8663cb9b7
* | FreeBSD: add Linux-compatible clock aliasesVal Packett2023-02-191-0/+3
| | | | | | | | | | They were added in https://reviews.freebsd.org/D30988 which landed for 13, but as they're just aliases, they will work on any version.
* | FreeBSD: add AT_RESOLVE_BENEATHVal Packett2023-02-191-0/+1
| |
* | Auto merge of #3121 - devnexen:fbsd_sctp4, r=JohnTitorbors2023-02-191-0/+46
|\ \ | | | | | | | | | freebsd further sctp support.
| * | freebsd further sctp support.David Carlier2023-02-181-0/+46
| | |
* | | FreeBSD: add strchrnulVal Packett2023-02-181-0/+2
| | |
* | | FreeBSD: add AT_EMPTY_PATHVal Packett2023-02-181-0/+1
|/ /
* | freebsd sctp support part 3David Carlier2023-02-121-0/+140
| |
* | Auto merge of #3114 - valpackett:fbsd, r=JohnTitorbors2023-02-125-50/+25
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | FreeBSD: move all new ABI to base module, add more O_ flags So according to #3023 all of that stuff didn't need to be hidden away in these conditionally built modules and we could've been exposing `eventfd`, `getrandom`, `getentropy`, `setproctitle_fast` etc. to crates.io consumers all this time… While in the test file, clean up the mess in `skip_fn` :) Other thing we need to expose is `O_PATH`, `O_RESOLVE_BENEATH` for crates like cap-std/openat. While here, add other open flags.
| * | FreeBSD: move newly introduced functions in all versions back to rootVal Packett2023-02-115-50/+19
| | | | | | | | | | | | | | | According to #3023, new ABI did not need to be hidden away under cfg(freebsdXX) flags, only changed ABI!
| * | Add more FreeBSD-specific path open option constantsVal Packett2023-02-111-0/+6
| | |
* | | Auto merge of #3113 - devnexen:nbsd_tcp_info, r=JohnTitorbors2023-02-121-0/+43
|\ \ \ | | | | | | | | | | | | netbsd tcp_info data addition.
| * | | netbsd tcp_info data addition.David Carlier2023-02-101-0/+43
| |/ /
* | | freebsd tcp_info data addition.David Carlier2023-02-101-0/+62
|/ /
* | Auto merge of #3105 - devnexen:macos_stack_np, r=JohnTitorbors2023-02-091-0/+4
|\ \ | | | | | | | | | apple add pthread_stack_frame_decode_np
| * | apple add pthread_stack_frame_decode_npDavid CARLIER2023-02-051-0/+4
| | |
* | | freebsd further sctp support.David Carlier2023-02-051-0/+419
|/ /
* | freebsd add initial sctp supportDavid Carlier2023-02-041-0/+250
| |
* | Auto merge of #3099 - devnexen:pidfile_fbsd, r=JohnTitorbors2023-02-031-0/+16
|\ \ | | | | | | | | | pidfile util api for freebsd addition.