Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zircon: the type of zx_handle_t is now unsigned #45030

Merged
merged 2 commits into from
Oct 8, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/libstd/sys/unix/process/process_fuchsia.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
// except according to those terms.

use io;
use libc;
use libc::{self, size_t};
use mem;
use ptr;

Expand Down Expand Up @@ -148,8 +148,8 @@ impl Process {
use sys::process::zircon::*;

let mut proc_info: zx_info_process_t = Default::default();
let mut actual: zx_size_t = 0;
let mut avail: zx_size_t = 0;
let mut actual: size_t = 0;
let mut avail: size_t = 0;

unsafe {
zx_cvt(zx_object_wait_one(self.handle.raw(), ZX_TASK_TERMINATED,
Expand All @@ -171,8 +171,8 @@ impl Process {
use sys::process::zircon::*;

let mut proc_info: zx_info_process_t = Default::default();
let mut actual: zx_size_t = 0;
let mut avail: zx_size_t = 0;
let mut actual: size_t = 0;
let mut avail: size_t = 0;

unsafe {
let status = zx_object_wait_one(self.handle.raw(), ZX_TASK_TERMINATED,
Expand Down
25 changes: 12 additions & 13 deletions src/libstd/sys/unix/process/zircon.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,13 @@ use io;
use os::raw::c_char;
use u64;

use libc::{c_int, c_void};
use libc::{c_int, c_void, size_t};

pub type zx_handle_t = i32;
pub type zx_handle_t = u32;
pub type zx_vaddr_t = usize;
pub type zx_rights_t = u32;
pub type zx_status_t = i32;

pub type zx_size_t = usize;

pub const ZX_HANDLE_INVALID: zx_handle_t = 0;

pub type zx_time_t = u64;
Expand Down Expand Up @@ -115,36 +113,37 @@ extern {
pending: *mut zx_signals_t) -> zx_status_t;

pub fn zx_object_get_info(handle: zx_handle_t, topic: u32, buffer: *mut c_void,
buffer_size: zx_size_t, actual_size: *mut zx_size_t,
avail: *mut zx_size_t) -> zx_status_t;
buffer_size: size_t, actual_size: *mut size_t,
avail: *mut size_t) -> zx_status_t;
}

// From `enum special_handles` in system/ulib/launchpad/launchpad.c
// HND_LOADER_SVC = 0
// HND_EXEC_VMO = 1
pub const HND_SPECIAL_COUNT: usize = 2;
// HND_SEGMENTS_VMAR = 2
const HND_SPECIAL_COUNT: c_int = 3;

#[repr(C)]
pub struct launchpad_t {
argc: u32,
envc: u32,
args: *const c_char,
args_len: usize,
args_len: size_t,
env: *const c_char,
env_len: usize,
env_len: size_t,

handles: *mut zx_handle_t,
handles_info: *mut u32,
handle_count: usize,
handle_alloc: usize,
handle_count: size_t,
handle_alloc: size_t,

entry: zx_vaddr_t,
base: zx_vaddr_t,
vdso_base: zx_vaddr_t,

stack_size: usize,
stack_size: size_t,

special_handles: [zx_handle_t; HND_SPECIAL_COUNT],
special_handles: [zx_handle_t; HND_SPECIAL_COUNT as usize],
loader_message: bool,
}

Expand Down