Age | Commit message (Collapse) | Author |
|
Functions such as Group::from_anything use reserve_double_buffer_size
in a loop, expecting it to return ERANGE if the passed limit is
reached.
However, the returned vector is passed as pointer to a libc function
that writes data into memory and doesn't update the length of the
Vec. Because of this, the previous code would never return ERANGE and
the calling loops would never exit if they hit a case where the
required buffer was larger than the maximum buffer.
This fixes the problem by checking the capacity rather than the
length.
Signed-off-by: Steven Danna <steve@chef.io>
|
|
|
|
|
|
http://man7.org/linux/man-pages/man3/sysconf.3.html says that the
corresponding variable is obsolete, but I think that just means the
constant defined in limits.h is obsolete. Checking the value using
sysconf is still valid.
|
|
This adds the linkat function which is part of POSIX:
http://pubs.opengroup.org/onlinepubs/9699919799/functions/linkat.html
and widely implmented on Unix-Family platforms.
Add back trailing whitespace removed on previous force push
|
|
This was a collaborative work between Johannes Schilling
<dario@deaktualisierung.org>, Fredrick Brennan <copypaste@kittens.ph>
and myself.
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
|
|
|
|
ignore mkfifoat in OSX and andriod
|
|
|
|
1121: Fix #1093 r=asomers a=tathanhdinh
Hello,
This PR fixes the problem discovered in #1093.
Thanks for any comment.
1130: unistd: getgrouplist: Rework code to use `reserve_double_buffer_size` r=asomers a=otavio
The buffer resize logic can be simplified reusing the
`reserve_double_buffer_size` method.
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Co-authored-by: Ta Thanh Dinh <tathanhdinh@gmail.com>
Co-authored-by: Otavio Salvador <otavio@ossystems.com.br>
|
|
The buffer resize logic can be simplified reusing the
`reserve_double_buffer_size` method.
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
|
|
Use `reserve_double_buffer_size` up to NGROUPS_MAX as limit.
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
|
|
We are preparing the use of `reserve_double_buffer_size` but for this,
some logic need to be reworked so we are doing some rename preparing
for the next patch which adds its use.
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
|
|
|
|
We now have a `reserve_double_buffer_size` method which reserves the
double of buffer, up to a limit, allowing it to be reused on other
methods in future.
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
|
|
Only two instances remain:
* For the deprecated sys::socket::CmsgSpace::new. We should probably
just remove that method.
* For sys::termios::Termios::default_uninit. This will require some
more thought.
Fixes #1096
|
|
|
|
This adds the unlinkat function, which is part of POSIX:
http://pubs.opengroup.org/onlinepubs/9699919799/functions/unlinkat.html
and widely implmented on Unix-family platforms.
Implement unlinkat - Update comments to unlink at and breakup tests
Changes made based on comments from pull request #1058
Implement unlinkat - Update should_panic for more precise check
Updae should_panic attribute for more precise check. Also remove
some dead code and note the pull request ID.
Implement unlinkat - Update error handling to use unwrap_err
The previous patch failed testing on two targets that returned EPERM
as the Sys error instead of EISDIR. This patch changes from using the
should_panic attribute to using the unwrap_err and matching against
the result.
Implement Unlinkat - Passing tests should not print anything. Fix.
Implement unlinkat - Update location of commit comment in the CHANGELOG
Implement unlinkat - Remove newline
|
|
|
|
|
|
This is for the benefit of those platforms that do not provide setresuid
nor setresgid, like macOS.
|
|
Several symbols are now marked as deprecated on OSX. Fix the build by
marking these symbols' Nix wrappers as deprecated, too.
|
|
1) lutimes doesn't exist on OpenBSD so it needs to be under conditional
compilation.
The only "reference" that I could find related to this is the discussion
here: https://github.com/rust-lang/libc/pull/790 .
2) fexecve doesn't exist on OpenBSD so add conditional compilation for it
in unistd and in related tests.
The only "reference" that I could find is a mention that fexecve is
not implemented on OpenBSD in the manual pages for signal(3) and
sigaction(2):
Official repository (search for "fexecve"):
https://cvsweb.openbsd.org/src/lib/libc/sys/sigaction.2?rev=1.75&content-type=text/x-cvsweb-markup
Github mirror:
https://github.com/openbsd/src/blob/master/lib/libc/sys/sigaction.2#L619
3) AIO doesn't work on OpenBSD so put test_aio_drop under conditional
compilation.
4) Add relevant changelog entries.
P.S. On OpenBSD remains the issue of test_scm_rights which builds
correctly but fails at runtime.
|
|
|
|
try! is not available in Rust 2018
|
|
I previously advocated for the latter syntax on stylistic grounds. But
it generates less efficient code, because it creates a new lambda
function for each usage. The optimizer does not combine them. This
change saves about 6KB of code.
|
|
|
|
|
|
This patch adds a wrapper for the acct(2) syscall, with two functions
for enabling and disabling process accounting.
|
|
|
|
This also adds a test for truncate (obviously) but, while doing so, also
adds a test for the already-existing ftruncate.
|
|
Correct references to user ids to group ids.
|
|
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
|
|
|
|
851: Added `getsid` in `::nix::unistd` r=asomers a=ggriffiniii
Resolves Issue #850
|
|
830: Add alarm r=asomers a=Thomasdezeeuw
Fixed #828.
|
|
This module has two functions;
set: set an alarm, and
cancel: cancels a previously set alarm.
|
|
|
|
|
|
|
|
|
|
|
|
`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`.
|