Age | Commit message (Collapse) | Author |
|
`pause` will always return `-1` as a result and sets `errno` to
`EINTR`, which indicates that a signal was caught by the process. Since
this is the point of `pause` return an error here makes little sense.
Closes #827.
|
|
|
|
|
|
799: Fix nix on Dragonfly r=Susurrus a=mneumann
This commit replaces pull request https://github.com/nix-rust/nix/pull/684. It fixes building `nix` on DragonFly. All tests pass. This requires most recent libc to build: https://github.com/rust-lang/libc/pull/851.
|
|
* DragonFly does not have a O_DSYNC flag
* Fix type_of_cmsg_data on DragonFly
* No fexecve() on DragonFly
* Do not run aio test cases on DragonFly
* Keep target lists in alphabetical order
* Unscrable #[cfg] directives and use cfg_if! macro instead
* Fix errno on DragonFly
Below follows an explanation why we have to use a C extension
to get errno working on DragonFly:
DragonFly uses a thread-local errno variable, but #[thread_local] is
feature-gated and not available in stable Rust as of this writing (Rust
1.21.0). We have to use a C extension (src/errno_dragonfly.c) to access
it.
Tracking issue for `thread_local` stabilization:
https://github.com/rust-lang/rust/issues/29594
Once this becomes stable, we can remove build.rs, src/errno_dragonfly.c,
remove the build-dependency from Cargo.toml, and use:
extern {
#[thread_local]
static errno: c_int;
}
Now all targets will use the build.rs script, but only on DragonFly this
will do something. Also, there are no additional dependencies for
targets other than DragonFly (no gcc dep).
|
|
806: Cleanup all doc warnings r=asomers a=Susurrus
With the impending switch to Pulldown as the default doc generator, warnings
have been enabled for incompatible syntax. This fixes all of said warnings.
|
|
With the impending switch to Pulldown as the default doc generator, warnings
have been enabled for incompatible syntax. This fixes all of said warnings.
|
|
The switch to Pulldown for the Markdown parser for Rustdoc has revealed
that there were a large number of doctests that weren't being run. These
tests failed to compile before, but will also fail to run because they
attach to arbitrary user and group IDs, which likely don't exist on the
system. These are therefore marked as `no_run`.
|
|
777: Use the real pipe2(2) on most targets r=asomers a=asomers
FreeBSD added pipe2(2) in version 10.0.
|
|
All supported non-Apple platforms now use the native syscall. Only ios
and macos lack it. Deprecate pipe2 on those platforms, because it's
impossible to guarantee atomicity with a userland implementation. It
was added in:
* DragonflyBSD 4.2
* FreeBSD 10.0
* NetBSD 6.0
* OpenBSD 5.7
|
|
cc #664 (unsure if this is everything needed)
|
|
The libc_bitflags! macro was replaced with a non-recursive one supporting
only public structs. I could not figure out how to make the old macro work
with the upgrade, so I reworked part of the bitflags! macro directly to suit
our needs, much as the original recursive macro was made. There are no uses
of this macro for non-public structs, so this is not a problem for internal code.
|
|
This adds execveat() to `nix::unistd`. It uses the execveat(2) Linux
kernel syscall, which is available since 3.19.
This is a Linux-specific extension which is not covered by POSIX and
does not have any userland libc wrapper.
Ref: http://man7.org/linux/man-pages/man2/execveat.2.html
|
|
|
|
|
|
|
|
Don't need to call as_c_str()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
But leave in place Linux links for non-standard functions. Also, add
brief docs for some functions that were lacking them.
|
|
This module merely contained FFI declarations, and only enough to
implement memfd_create() and pivot_root() wrapper functions in
nix. Since these declarations are redundant with equivalent FFI
declarations in libc, we'll remove them here. In the future, any
syscall-related wrapper function will be implemented directly and
utilize libc for FFI declarations as we cannot generically expose
a type-safe `syscall()` because of its variadic argument list.
|
|
This adds fexecve() to `nix::unistd`. It is available in libc since 0.2.29.
Ref: http://pubs.opengroup.org/onlinepubs/9699919799/functions/fexecve.html
|
|
Changed SeekData and SeekHole hardcoded values to libc ones and
added availability only to linux freebsd and dragonflybsd.
Removed impl Whence and assigned the libc values directly in the enum definition.
|
|
|
|
Some tests were invoking non-async-signal-safe functions from the child
process after a `fork`. Since they might be invoked in parallel, this
could lead to problems.
|
|
It was broken when enabled, and currently the libc definition is only
available for windows. This will be re-added when a new libc is released
that supports it across all available platforms
|
|
677: PtyMaster::drop should panic on EBADF r=asomers
Fixes #659
|
|
Also, document the double-close risk with unistd::close
Fixes #659
|
|
630: Add wrappers for sysconf(3), pathconf(2), and fpathconf(2) r=asomers
|
|
|
|
|
|
|
|
This introduces a wrapper for fchdir(2), allowing a process to change
directory based on an open file descriptor.
The underlying function is available in libc crate since 0.2.20.
|
|
Baed on discussions on the related PR, sethostname now takes
an `S: AsRef<OsStr>` in order to allow for a greater range of inputs
that allow for a more fluid interface.
Signed-off-by: Paul Osborne <osbpau@gmail.com>
|
|
Previously gethostname just mutated a buffer. We now provide
a slightly more usable (but still allocation free) API that ensures
that the returned buffer is NUL-terminated. We give back a `&CStr`
instead of requiring that the user do all of the conversions from
`&[u8]` when we know we are dealing with a `&CStr`.
Signed-off-by: Paul Osborne <osbpau@gmail.com>
|
|
Although the underlying C API does take a pointer to a set of
characters, it is a requirement of almost every operating system
that these bytes not contain a premature NUL character or other
special characters. In other words, you want a `&str`. Changing
this to make the API make a bit more sense.
Signed-off-by: Paul Osborne <osbpau@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
These make the language consistent in the 3rd person, fix a few
minor mistakes, and remove some superflous prose.
Signed-off-by: Paul Osborne <osbpau@gmail.com>
|
|
The previous one was entirely too generic.
Signed-off-by: Paul Osborne <osbpau@gmail.com>
|
|
Signed-off-by: Paul Osborne <osbpau@gmail.com>
|
|
Signed-off-by: Paul Osborne <osbpau@gmail.com>
|