mirror of
https://github.com/vlang/v.git
synced 2025-09-16 16:02:29 +03:00
run vfmt on http, net, sync, strconv
This commit is contained in:
parent
28ecfb231d
commit
848cd3cb3e
18 changed files with 523 additions and 404 deletions
|
@ -1,16 +1,15 @@
|
|||
module net
|
||||
|
||||
fn C.gethostname() int
|
||||
|
||||
// hostname returns the host name reported by the kernel.
|
||||
pub fn hostname() ?string {
|
||||
mut name := [256]byte
|
||||
mut name := [256]byte
|
||||
// https://www.ietf.org/rfc/rfc1035.txt
|
||||
// The host name is returned as a null-terminated string.
|
||||
res := C.gethostname(&name, 256)
|
||||
if res != 0 {
|
||||
return error('net.hostname: failed with $res')
|
||||
}
|
||||
return tos_clone(name)
|
||||
return tos_clone(name)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue