@@ -351,18 +351,6 @@ internal static string NonWindowsGetUserName()
351351 }
352352 }
353353
354- internal static string NonWindowsGetMachineName ( )
355- {
356- if ( ! IsWindows )
357- {
358- return LinuxPlatform . HostName ;
359- }
360- else
361- {
362- throw new PlatformNotSupportedException ( ) ;
363- }
364- }
365-
366354 // Hostname in this context seems to be the FQDN
367355 internal static string NonWindowsGetHostName ( )
368356 {
@@ -470,22 +458,6 @@ public static string[] CommandLineToArgv(string command)
470458
471459 internal static class LinuxPlatform
472460 {
473- public static string HostName
474- {
475- get
476- {
477- StringBuilder value = new StringBuilder ( 1024 ) ;
478- uint valueLen = ( uint ) value . Capacity ;
479- string computerName = Native . GetComputerName ( ) ;
480- if ( string . IsNullOrEmpty ( computerName ) )
481- {
482- int lastError = Marshal . GetLastWin32Error ( ) ;
483- throw new InvalidOperationException ( "LinuxPlatform.HostName error: " + lastError ) ;
484- }
485- return computerName ;
486- }
487- }
488-
489461 private static string _userName ;
490462 public static string UserName
491463 {
@@ -696,10 +668,6 @@ internal static class Native
696668 [ return : MarshalAs ( UnmanagedType . LPStr ) ]
697669 internal static extern string GetUserName ( ) ;
698670
699- [ DllImport ( psLib , CharSet = CharSet . Ansi , SetLastError = true ) ]
700- [ return : MarshalAs ( UnmanagedType . LPStr ) ]
701- internal static extern string GetComputerName ( ) ;
702-
703671 [ DllImport ( psLib , CharSet = CharSet . Ansi , SetLastError = true ) ]
704672 internal static extern int GetLinkCount ( [ MarshalAs ( UnmanagedType . LPStr ) ] string filePath , out int linkCount ) ;
705673
0 commit comments