Skip to content
Permalink
Browse files

Deprecate gethostname() in favor of $*KERNEL.hostname

Rework of #2065
  • Loading branch information...
ugexe committed Oct 19, 2018
1 parent c271ab7 commit f7fa51850d4e6617750ed9307c001efbadec1150
Showing with 8 additions and 1 deletion.
  1. +4 −0 src/core/Kernel.pm6
  2. +4 −1 src/core/OS.pm6
@@ -101,6 +101,10 @@ class Kernel does Systemic {
$!bits //= $.hardware ~~ m/_64|w|amd64/ ?? 64 !! 32; # naive approach
}

method hostname {
nqp::p6box_s(nqp::gethostname)
}

has @!signals; # Signal
#?if jvm
method signals (Kernel:D:) {
@@ -1,4 +1,7 @@
proto sub gethostname(*%) {*}
multi sub gethostname(--> Str:D){ nqp::p6box_s(nqp::gethostname) }
multi sub gethostname(--> Str:D){
Rakudo::Deprecations.DEPRECATED('$*KERNEL.hostname()');
$*KERNEL.hostname()
}

# vim: ft=perl6 expandtab sw=4

0 comments on commit f7fa518

Please sign in to comment.
You can’t perform that action at this time.