Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Apr 15 19:05
    sunfishcode commented #1421
  • Apr 15 10:02
    barafael commented #1006
  • Apr 15 08:16
    nemarci opened #1426
  • Apr 14 10:15
    sanpii edited #1425
  • Apr 14 10:13
    sanpii opened #1425
  • Apr 12 14:11
    Zapeth opened #1424
  • Apr 11 23:45
    anth1y synchronize #1423
  • Apr 11 23:39
    anth1y synchronize #1423
  • Apr 11 23:37
    anth1y opened #1423
  • Apr 11 21:55
    anth1y closed #1418
  • Apr 11 21:55
    anth1y commented #1418
  • Apr 11 21:47
    anth1y synchronize #1418
  • Apr 11 07:58
    blaind synchronize #1422
  • Apr 11 07:50
    blaind synchronize #1422
  • Apr 11 07:43
    blaind opened #1422
  • Apr 10 15:05
    00xc synchronize #1356
  • Apr 10 08:10
    RalfJung commented #1421
  • Apr 10 03:15
    WiSaGaN synchronize #1420
  • Apr 10 03:12
    asomers commented #1421
  • Apr 10 02:48
    asomers closed #1403
Geert Stappers
@stappersg_gitlab
More a doc.rs thing, but asking here (to break 1 month silence ;-)
How to get more recent version of https://docs.rs/nix/0.17.0/nix/ifaddrs/ when a new nix is released. Use case: A stable URL like https://docs.rs/nix/lastest/nix/ifaddrs/
Alan Somers
@asomers
@stappersg_gitlab Nix has no control over that.
@1000teslas_gitlab None of Nix's types currently support serde, but it would be a reasonable thing to add.
Ugator
@Ugator
I'm probably missing something obvious... Looking at the example in "nix/sys/socket/enum.ControlMessageOwned" How could I extract the original message ("Ohayƍ!") after receiving it? Or, put another way, how do I access RecvMsg.mhdr fields?
Alan Somers
@asomers
In that example, "Ohayo" should end up in buffer. It gets put there by recvmsg
WaveMo
@WaveMo

I want to use nix::mount::mount() to replace with libc::mount(). Now I have the followed code :

libc::mount(ptr::null(), path.as_ptr(), ptr::null(), libc:: MS_SLAVE, ptr::null())

I just want to know how to replace the ptr::null() in nix library, I try to use 'None' to do it, but failed. Please help me, thanks.

WaveMo
@WaveMo
The error is :
`` 39 | nix::mount::mount( | ^^^^^^^^^^^^^^^^^ cannot infer type for type parameterP1declared on the functionmount| ::: /root/.cargo/registry/src/mirrors.ustc.edu.cn-15f9db60536bad60/nix-0.19.0/src/mount.rs:57:27 | 57 | pub fn mount<P1: ?Sized + NixPath, P2: ?Sized + NixPath, P3: ?Sized + NixPath, P4: ?Sized + NixPath>( | ------- required by this bound innix::mount::mount| = note: cannot satisfy_: nix::NixPath`
Alan Somers
@asomers
Just put it in a turbofish
nix::mount::<str, str, str, str> or something like that.
WaveMo
@WaveMo
wow, Thanks
Matheus Xavier
@rootm4n
hey might be a stupid question but how do I check the mode of a file I just did a stat on what I mean is what would be the equivalent of doing say
Matheus Xavier
@rootm4n
#include <stdio.h>
#include <sys/stat.h>

int main(void) {
    struct stat stat_r;
    stat("somefile", &stat_r);

    if(S_ISREG(stat_r.st_mode)){
        printf("regular file");
        return;
    }
    if(S_ISDIR(stat_r.st_mode)){
        printf("directory");
        return;
    }
    if(S_ISBLK(stat_r.st_mode)){
        printf("block device");
        return;
    }
    if(S_ISCHR(stat_r.st_mode)){
        printf("character device");
        return;
    }
    if(S_ISSOCK(stat_r.st_mode)){
        printf("socket");
        return;
    }
}
Alan Somers
@asomers
It's the st_mode field of struct FileStat
Will Andrews
@wca
Hello, anybody around? I'm interested in the ioprio_set(2) Linux-specific system call. Is a wrapper for that sort of thing something that would be accepted in nix? It's pretty niche. src/sys/ioprio.rs I guess? Any pointers to something similar already implemented?
Alan Somers
@asomers
Yes, that seems reasonable. It's annoying that there's no glibc wrapper, though.
Will Andrews
@wca
@asomers hi! sounds good, and yeah. any suggestions on something similar already implemented in nix?
TheSexualPigeon
@TheSexualPigeon_twitter
Hello, sorry for the dumb question but i'm trying to use nix and i keep getting could not find sys /unistd in nix
when using : use nix::sys::singal::*; and use nix::unistd::alarm;
anyone know what i'm doing wrong / forgot to do. Thank you
Alan Somers
@asomers
@TheSexualPigeon_twitter could you post the full error message please?
Whoa, @wca ! I didn't notice your username when you asked that question. The answer is, yes, there are a few places that already use libc::syscall on Linux. fcntl::copy_file_range and unistd::gettid, for example.
Will Andrews
@wca
@asomers thx for the pointers :)
pinage404
@pinage404:matrix.org
[m]
hi, i have published this crate https://crates.io/crates/git-gamble and i would like to use it with Nix
but i don't really know how to do that, can you help me please ?
Alan Somers
@asomers
You don't know what? How to develop Nix? It isn't unusual; just do cargo test
pinage404
@pinage404:matrix.org
[m]
i would like to be able to do that, but i don't know how
{ pkgs ? import <nixpkgs> {} }:

pkgs.mkShell {
  buildInputs = with pkgs; [
    git-gamble
  ];
}
(it could be from something else than nixpkgs)
Alan Somers
@asomers
Are you talking about Nix OS, the Linux distribution? That's something completely different.
pinage404
@pinage404:matrix.org
[m]
yes
is not the topic of the channel ?
Alan Somers
@asomers
Nope. nix is a rust package that provides convenient bindings for *nix APIs. Nothing to do with the Linux distro.
pinage404
@pinage404:matrix.org
[m]
oh ! sorry
may i suggest to put the link of the package in the subject of this room
anth1y
@anth1y:matrix.org
[m]
hey folks, I'm looking to get involved with this project and would love to start where ever help is needed
Alan Somers
@asomers
Hi @anth1y:matrix.org . Are you a Nix user?
anth1y
@anth1y:matrix.org
[m]
trying to become one yes
hi @asomers
Alan Somers
@asomers
Cool. What is your project?
anth1y
@anth1y:matrix.org
[m]
Oh i dont have a project yet I just stumbled on nix because I love linux systems internals and definitely love rust
I'm a sre by trade
Alan Somers
@asomers
Well, Nix is pretty much in maintenance mode. We accept new features all the time, but there's no overarching direction we're moving towards.
If you want to chip in , there are a bunch of half-finished PRs and unaddressed issues.
anth1y
@anth1y:matrix.org
[m]
awesome I'll take a look at some things tomorrow thanks man
anth1y
@anth1y:matrix.org
[m]
@asomers: I decided to patch this nix-rust/nix#1202 but it seems like i dont have write perms to push my branch up ?
anth1y
@anth1y:matrix.org
[m]
ERROR: Permission to nix-rust/nix.git denied to anth1y.
anth1y
@anth1y:matrix.org
[m]
ignore those ...
anth1y
@anth1y:matrix.org
[m]
forgot to fork
Ben Widawsky
@widawsky_twitter
I'm trying to wrap an ioctl that has a flexible array member at the end. Are there any good examples of the best way to do this? I'd like to be able to iterate over that array member at the end.
Alan Somers
@asomers
No, I don't think I've seen Nix's ioctl used that way.
anth1y
@anth1y:matrix.org
[m]
@asomers i think this is ready to go nix-rust/nix#1411
@asomers: ^^