diff options
Diffstat (limited to 'runtime/ops/os.rs')
-rw-r--r-- | runtime/ops/os.rs | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/runtime/ops/os.rs b/runtime/ops/os.rs index 2aafdc7a3..35b49217c 100644 --- a/runtime/ops/os.rs +++ b/runtime/ops/os.rs @@ -20,8 +20,7 @@ fn init_ops(builder: &mut ExtensionBuilder) -> &mut ExtensionBuilder { op_exit::decl(), op_delete_env::decl(), op_get_env::decl(), - op_getgid::decl(), - op_getuid::decl(), + op_gid::decl(), op_hostname::decl(), op_loadavg::decl(), op_network_interfaces::decl(), @@ -29,6 +28,7 @@ fn init_ops(builder: &mut ExtensionBuilder) -> &mut ExtensionBuilder { op_set_env::decl(), op_set_exit_code::decl(), op_system_memory_info::decl(), + op_uid::decl(), ]) } @@ -284,12 +284,12 @@ fn op_system_memory_info( #[cfg(not(windows))] #[op] -fn op_getgid(state: &mut OpState) -> Result<Option<u32>, AnyError> { - super::check_unstable(state, "Deno.getGid"); +fn op_gid(state: &mut OpState) -> Result<Option<u32>, AnyError> { + super::check_unstable(state, "Deno.gid"); state .borrow_mut::<Permissions>() .sys - .check("getGid", Some("Deno.getGid()"))?; + .check("gid", Some("Deno.gid()"))?; // TODO(bartlomieju): #[allow(clippy::undocumented_unsafe_blocks)] unsafe { @@ -299,23 +299,23 @@ fn op_getgid(state: &mut OpState) -> Result<Option<u32>, AnyError> { #[cfg(windows)] #[op] -fn op_getgid(state: &mut OpState) -> Result<Option<u32>, AnyError> { - super::check_unstable(state, "Deno.getGid"); +fn op_gid(state: &mut OpState) -> Result<Option<u32>, AnyError> { + super::check_unstable(state, "Deno.gid"); state .borrow_mut::<Permissions>() .sys - .check("getGid", Some("Deno.getGid()"))?; + .check("gid", Some("Deno.gid()"))?; Ok(None) } #[cfg(not(windows))] #[op] -fn op_getuid(state: &mut OpState) -> Result<Option<u32>, AnyError> { - super::check_unstable(state, "Deno.getUid"); +fn op_uid(state: &mut OpState) -> Result<Option<u32>, AnyError> { + super::check_unstable(state, "Deno.uid"); state .borrow_mut::<Permissions>() .sys - .check("getUid", Some("Deno.getUid()"))?; + .check("uid", Some("Deno.uid()"))?; // TODO(bartlomieju): #[allow(clippy::undocumented_unsafe_blocks)] unsafe { @@ -325,11 +325,11 @@ fn op_getuid(state: &mut OpState) -> Result<Option<u32>, AnyError> { #[cfg(windows)] #[op] -fn op_getuid(state: &mut OpState) -> Result<Option<u32>, AnyError> { - super::check_unstable(state, "Deno.getUid"); +fn op_uid(state: &mut OpState) -> Result<Option<u32>, AnyError> { + super::check_unstable(state, "Deno.uid"); state .borrow_mut::<Permissions>() .sys - .check("getUid", Some("Deno.getUid()"))?; + .check("uid", Some("Deno.uid()"))?; Ok(None) } |