{"action":"created","issue":{"url":"https://api.github.com/repos/nix-rust/nix/issues/941","repository_url":"https://api.github.com/repos/nix-rust/nix","labels_url":"https://api.github.com/repos/nix-rust/nix/issues/941/labels{/name}","comments_url":"https://api.github.com/repos/nix-rust/nix/issues/941/comments","events_url":"https://api.github.com/repos/nix-rust/nix/issues/941/events","html_url":"https://github.com/nix-rust/nix/issues/941","id":360577013,"node_id":"MDU6SXNzdWUzNjA1NzcwMTM=","number":941,"title":"Implement copy_file_range() system call for Linux","user":{"login":"ArniDagur","id":19227577,"node_id":"MDQ6VXNlcjE5MjI3NTc3","avatar_url":"https://avatars3.githubusercontent.com/u/19227577?v=4","gravatar_id":"","url":"https://api.github.com/users/ArniDagur","html_url":"https://github.com/ArniDagur","followers_url":"https://api.github.com/users/ArniDagur/followers","following_url":"https://api.github.com/users/ArniDagur/following{/other_user}","gists_url":"https://api.github.com/users/ArniDagur/gists{/gist_id}","starred_url":"https://api.github.com/users/ArniDagur/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ArniDagur/subscriptions","organizations_url":"https://api.github.com/users/ArniDagur/orgs","repos_url":"https://api.github.com/users/ArniDagur/repos","events_url":"https://api.github.com/users/ArniDagur/events{/privacy}","received_events_url":"https://api.github.com/users/ArniDagur/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-09-15T21:21:14Z","updated_at":"2018-09-16T00:01:07Z","closed_at":null,"author_association":"NONE","body":"[copy_file_range()](http://man7.org/linux/man-pages/man2/copy_file_range.2.html) has yet to be implemented."},"comment":{"url":"https://api.github.com/repos/nix-rust/nix/issues/comments/421657320","html_url":"https://github.com/nix-rust/nix/issues/941#issuecomment-421657320","issue_url":"https://api.github.com/repos/nix-rust/nix/issues/941","id":421657320,"node_id":"MDEyOklzc3VlQ29tbWVudDQyMTY1NzMyMA==","user":{"login":"ArniDagur","id":19227577,"node_id":"MDQ6VXNlcjE5MjI3NTc3","avatar_url":"https://avatars3.githubusercontent.com/u/19227577?v=4","gravatar_id":"","url":"https://api.github.com/users/ArniDagur","html_url":"https://github.com/ArniDagur","followers_url":"https://api.github.com/users/ArniDagur/followers","following_url":"https://api.github.com/users/ArniDagur/following{/other_user}","gists_url":"https://api.github.com/users/ArniDagur/gists{/gist_id}","starred_url":"https://api.github.com/users/ArniDagur/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ArniDagur/subscriptions","organizations_url":"https://api.github.com/users/ArniDagur/orgs","repos_url":"https://api.github.com/users/ArniDagur/repos","events_url":"https://api.github.com/users/ArniDagur/events{/privacy}","received_events_url":"https://api.github.com/users/ArniDagur/received_events","type":"User","site_admin":false},"created_at":"2018-09-16T00:01:07Z","updated_at":"2018-09-16T00:01:07Z","author_association":"NONE","body":"How I should handle the `flags` argument of `copy_file_range`? The man page says that \"the flags argument is provided to allow for future extensions and currently must be to 0\".\r\n\r\nHere's what I've got at the moment (haven't tested it yet but it compiles):\r\n```rust\r\n#[cfg(any(target_os = \"linux\", target_os = \"android\"))]\r\npub fn copy_file_range(fd_in: RawFd, off_in: Option<&mut libc::loff_t>,\r\n          fd_out: RawFd, off_out: Option<&mut libc::loff_t>,\r\n          len: usize) -> Result<usize> {\r\n    let off_in = off_in.map(|offset| offset as *mut _).unwrap_or(ptr::null_mut());\r\n    let off_out = off_out.map(|offset| offset as *mut _).unwrap_or(ptr::null_mut());\r\n\r\n    let ret = unsafe {\r\n        libc::syscall(libc::SYS_copy_file_range, fd_in, off_in, fd_out, off_out, len, 0 )\r\n    };\r\n    Errno::result(ret).map(|r| r as usize)\r\n}\r\n```"}}
{"actor":{"display_login":"ArniDagur"}}