Skip to content

Commit 818a5e8

Browse files
committed
README.md: update gethostname api
1 parent ff453e5 commit 818a5e8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ call:
2626
// libc api (unsafe, requires handling return code/errno)
2727
pub unsafe extern fn gethostname(name: *mut c_char, len: size_t) -> c_int;
2828
29-
// nix api (returns a nix::Result)
30-
pub fn gethostname(name: &mut [u8]) -> Result<()>;
29+
// nix api (returns a nix::Result<CStr>)
30+
pub fn gethostname<'a>(buffer: &'a mut [u8]) -> Result<&'a CStr>;
3131
```
3232

3333
## Requirements

0 commit comments

Comments
 (0)