Commit Graph

3656 Commits

Author SHA1 Message Date
Yuki Okushi 77f0f79f11
Update license year 2020-04-12 03:13:36 +09:00
Yuki Okushi 545c62f7d4
Remove license headers 2020-04-11 23:35:45 +09:00
Yuki Okushi 4c07b66112
Merge pull request #1731 from JohnTitor/fmt
Run rustfmt
2020-04-11 23:32:04 +09:00
Yuki Okushi 27f89544a8
Run rustfmt 2020-04-11 22:13:58 +09:00
Yuki Okushi 9782b7ff8f
Merge pull request #1716 from pfmooney/illumos-target
Split up Solaris and illumos targets
2020-04-11 19:09:29 +09:00
Yuki Okushi 035a480942
Merge pull request #1728 from alexcrichton/add-ucontext
Add definition of ucontext_t for aarch64-unknown-linux-gnu
2020-04-11 11:52:28 +09:00
Yuki Okushi d075426eff
Merge pull request #1727 from GuillaumeDIDIER/feature/map_huge_table_size
Add defines for HUGETLB size - solves #1700
2020-04-11 09:51:03 +09:00
Alex Crichton 17d5bc841b Add definition of ucontext_t for aarch64-unknown-linux-gnu 2020-04-10 11:15:06 -07:00
Guillume DIDIER c646f96fdf This adds the defines from include/uapi/asm-generic/hugetlb_encode.h and the corresponding defines in include/uapi/linux/mman.h to linux_like/linux/gnu/mod.rs and the equivalent for musl in linux_like/linux/musl/mod.rs
Solves #1700

Removes two defines from musl/b32/hexagon.rs that are now provided two mudules "up"
2020-04-09 18:10:27 +02:00
Yuki Okushi a1c40924ae
Merge pull request #1721 from brian-gavin/feat/strsignal
Add strsignal(3) to unix
2020-04-08 17:05:09 +09:00
Yuki Okushi 5485e3a0ce
Merge pull request #1724 from JohnTitor/use-fork-ctest
Use fork ctest until the maintainer gets back
2020-04-08 16:18:23 +09:00
Yuki Okushi a8978051d6
Use fork ctest until the maintainer gets back 2020-04-08 07:11:14 +09:00
Brian Gavin 106dcc2d1a Add strsignal(3) to unix
This does not add sys_siglist because the docs specify that the function
should be used instead, whenever possible.
2020-04-07 17:00:20 -04:00
Yuki Okushi 8764410c8e
Merge pull request #1720 from glebpom/linux-udp-constants
Add Linux UDP constants
2020-04-08 03:29:50 +09:00
Yuki Okushi 93f7d8336f
Merge pull request #1722 from JohnTitor/freebsd-12
Update freebsd 12 image
2020-04-08 03:26:33 +09:00
Yuki Okushi aaea7a6aa3
Update freebsd 12 image 2020-04-08 01:56:43 +09:00
Yuki Okushi f1ad2f5806
Merge pull request #1717 from jclulow/illumos-cfmakeraw
fix cfmakeraw() for illumos and Solaris
2020-04-08 01:37:32 +09:00
Gleb Pomykalov 126dc0cdb1 Upgrade ubuntu to 20.04 on mips to have UDP_GRO constant 2020-04-07 11:19:59 +03:00
Gleb Pomykalov 1b4ef504fd Add Linux UDP constants 2020-04-06 21:15:06 +03:00
Yuki Okushi 1d9e5fbc04
Merge pull request #1699 from cpu/cpu-fanotify-linux-bindings
linux: add fanotify(7) API bindings.
2020-04-05 13:53:37 +09:00
Yuki Okushi c25fa2f7d4
Merge pull request #1718 from JohnTitor/rustup
Set rustup profile to minimal on CI
2020-04-05 13:27:57 +09:00
Daniel McCarney 5c7a82a1c8 linux: add fanotify(7) API bindings.
The `fanotify` API[0] is a linux-specific API for notification and interception
of filesystem events. In some ways it is similar to `inotify`, but with
different advantages/tradeoffs. It is particularly well suited to full
filesystem/mount monitoring (vs per directory) and for allowing/denying access
to files (`inotify` lacks this capability).

The `fanotify` API has been updated several times since it was enabled in Linux
2.6.37. Presently I've only included support for the original `fanotify`
features, and the `FAN_MARK_FILESYSTEM` addition made in Linux 4.20. There are
subsequent updates in 5.0 and 5.1 not covered in this initial commit.

This commit adds the relevant constants and types from
`uapi/linux/fanotify.h`[1] and two new functions (`fanotify_init`[2] and
`fanotify_wrap`[3]) to `src/unix/linux_like/linux/mod.rs`. While I believe this
API is also present on Android I have presently limited my attention to Linux.

Although this commit focuses on Linux 4.20.x's `fanotify` API/constants I have
skipped adding constants for `FAN_ALL_CLASS_BITS`, `FAN_ALL_INIT_FLAGS`,
`FAN_ALL_MARK_FLAGS`, `FAN_ALL_EVENTS`, `FAN_ALL_PERM_EVENTS` and
`FAN_ALL_OUTGOING_EVENTS` even though they are present in this kernel version's
headers. These defines were deprecated[4] in later releases with instructions to
not use them in new programs or extend them with new values. It would be a shame
for new Rust programs to use deprecated #defines!

[0]: http://man7.org/linux/man-pages/man7/fanotify.7.html
[1]: d54f4fba88/include/uapi/linux/fanotify.h
[2]: http://man7.org/linux/man-pages/man2/fanotify_init.2.html
[3]: http://man7.org/linux/man-pages/man2/fanotify_mark.2.html
[4]: 23c9deeb32 (diff-4c9ca62be6bf38cc08f7ea9daf16e379)
2020-04-04 16:07:09 -04:00
Yuki Okushi 7b144078bc
Set rustup profile to minimal on CI 2020-04-05 01:56:42 +09:00
Joshua M. Clulow 5b6a3335ca fix cfmakeraw() for illumos and Solaris
This change fixes two issues.  First, the current cfmakeraw()
implementation in this crate appears to be making a stack copy of the
input "struct termios" before modifying it, rather than correctly
modifying the original through the pointer.  Before this modification
the routine did not, thus, set the flags for raw mode.

Second, we address the default settings of the MIN and TIME terminal
options.  On at least FreeBSD and Linux systems, the modern default
value for MIN appears to be 1; i.e., block and wait for at least one
input byte.  On most Solaris and illumos systems, the MIN control
character slot overlaps with EOF, and thus has a default value of 4.
This breaks at least the examples in the "termion" crate, and probably
quite a lot of other software written first and foremost for Linux
systems.  We need to force the MIN value to 1 while switching to raw
mode.
2020-04-04 16:53:26 +00:00
Patrick Mooney 48594dc7c1 Update ctest for illumos and Solaris 2020-04-03 13:16:58 +00:00
Patrick Mooney 3d65979233 Split up Solaris and illumos targets 2020-04-03 03:33:18 +00:00
Yuki Okushi 08e8a3ae8f
Merge pull request #1712 from pfmooney/cfg_attr-cleanup
Clean up unnecessary link_name attributes
2020-04-01 14:02:46 +09:00
Yuki Okushi 53bdd78e19
Merge pull request #1710 from nielx/upstream/stat-cleanup
Haiku: add futimens and utimensat, remove futimes and cleanup.
2020-04-01 13:07:39 +09:00
Yuki Okushi 9bb9635ee7
Merge pull request #1714 from Mark-Simulacrum/add-triagebot
Add triagebot configuration
2020-04-01 02:16:52 +09:00
Mark Rousskov 3aecffc96f Add triagebot configuration
This enables assignment through triagebot on this repository, in preparation for
the migration from highfive to triagebot for PR assignment.
2020-03-31 11:18:38 -04:00
Patrick Mooney 1a15af9af5 Clean up unnecessary cfg_attr attributes 2020-03-29 14:29:18 -05:00
Niels Sascha Reedijk ccda4ada09 Haiku: add futimens and utimensat, remove futimes and cleanup.
* Function futimes is not available in Haiku.
 * Functions futimens and utimensat are.
 * Cleanup some leftover cfg_attr attributes.
2020-03-28 08:35:29 +00:00
Yuki Okushi bcbfeb5516
Merge pull request #1708 from pickfire/lockf
Add Lockf POSIX to UNIX targets
2020-03-27 23:00:46 +09:00
Yuki Okushi 8fdf28e3cd
Merge pull request #1705 from tormol/accept4all
Add accept4() for NetBSD, Illumos and Solaris
2020-03-27 21:12:47 +09:00
Yuki Okushi 55a5eb8081
Merge pull request #1704 from slp/copy_file_range
Add copy_file_range to linux_like
2020-03-27 10:29:00 +09:00
Ivan Tham dd81021828 Add lockf
Fix #1631
2020-03-26 18:03:55 +08:00
Sergio Lopez 82f070702c Add copy_file_range to linux_like/linux/gnu
This is a Linux-only feature that was already present as a
syscall. Add it just to linux/gnu for the moment, as the musl version
bundled in the Rust's x86_64-unknown-linux-musl toolchain doesn't
include it yet.

Signed-off-by: Sergio Lopez <slp@redhat.com>
2020-03-25 13:16:36 +01:00
Yuki Okushi 783ddd8ee0
Merge pull request #1706 from cpu/cpu-run-docker-sh-custom-cargohome
ci: allow overriding run-docker.sh CARGO_HOME.
2020-03-25 04:48:22 +09:00
Daniel 20cd625558 ci: allow overriding run-docker.sh CARGO_HOME.
The `ci/run-docker.sh` utility script adds a `--volume` argument to the
`docker` command to mount the Cargo home directory of the host machine
into the container at `/cargo`.

Prior to this patch the host's Cargo home directory is assumed to be the
`dirname` of the `dirname` of the `cargo` command's path. That works in
most cases where the host machine installed rust with vanilla
`rustup`. It may fail if the host machine used a different method.

For example if the host machine used the Archlinux rustup package[0]
then `cargo` is installed to `/usr/bin/cargo` and the `run-docker.sh`
script incorrectly mounts `/usr/` to the `/cargo` directory of the test
container.

This patch allows specifying an explicit `CARGO_HOME` to the
`ci/run-docker.sh` script so that users with a non-standard cargo dir
can use the utility without modification. By default if no `CARGO_HOME`
is set then the legacy behaviour is used and `CARGO_HOME` defaults to
the `dirname` of the `dirname` of the `cargo` command is used.

[0]: https://wiki.archlinux.org/index.php/rust#Arch_Linux_package
2020-03-21 11:49:14 -04:00
Torbjørn Birch Moltu e3bbec2745 Add accept4() for NetBSD, Illumos and Solaris
References:
* NetBSD (became available with 8.0):
  http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/sys/socket.h?annotate=1.129&only_with_tag=MAIN
  http://cvsweb.netbsd.org/bsdweb.cgi/src/lib/libc/sys/accept4.c?annotate=1.2&only_with_tag=MAIN
* Illumos:
  https://illumos.org/man/3socket/accept
  https://github.com/illumos/illumos-gate/blob/master/usr/src/uts/common/sys/socket.h
  https://github.com/illumos/illumos-gate/blob/master/usr/src/lib/libsocket/socket/weaks.c
* Solaris:
  https://docs.oracle.com/cd/E88353_01/html/E37843/accept-3c.html
2020-03-21 13:16:31 +01:00
Yuki Okushi d2963c22c6
Merge pull request #1702 from alexcrichton/macos-ucontet
Add definition of ucontext_t for macOS
2020-03-21 09:11:55 +09:00
Alex Crichton 472e72a268 Add definition of ucontext_t for macOS 2020-03-20 07:31:57 -07:00
Yuki Okushi 276eaa2d2f
Merge pull request #1698 from lzutao/non-msvc-wmemchr
Remove MSVC's wmemchr declaration
2020-03-18 19:59:02 +09:00
Lzu Tao 0327cc0b3c Remove MSVC's wmemchr declaration 2020-03-18 11:57:28 +07:00
Yuki Okushi 39f43b5b15
Merge pull request #1691 from andrenth/bump
Bump version to 0.2.68
2020-03-18 05:11:48 +09:00
Yuki Okushi 1300d57d3e
Merge pull request #1696 from JohnTitor/mcast
Add constants from `linux/in.h`
2020-03-18 03:36:01 +09:00
Yuki Okushi b7cb4d2c7b
Add constants from `linux/in.h` 2020-03-17 09:48:45 +09:00
Yuki Okushi 598939dd5e
Merge pull request #1653 from ArniDagur/shadow_reenterant
Add reenterant shadow.h functions
2020-03-17 01:46:31 +09:00
Árni Dagur 6ffc752f7c Add renterant shadow functions 2020-03-15 19:08:24 -04:00
Yuki Okushi d6159ebcce
Merge pull request #1695 from JohnTitor/s390x
Enable `s390x-unknown-linux-gnu` on CI
2020-03-16 02:07:40 +09:00