Home | Info | Community | Development | myReactOS | Contact Us
Definition at line 31 of file hostname.c.
{ if (1 == argc) { TCHAR ComputerName [MAX_COMPUTERNAME_LENGTH + 1]; DWORD ComputerNameSize = sizeof ComputerName / sizeof ComputerName[0]; ZeroMemory (ComputerName, sizeof ComputerName ); if (GetComputerName(ComputerName, & ComputerNameSize)) { printf ("%s\n", ComputerName); return EXIT_SUCCESS; } fprintf (stderr, "%s: Win32 error %ld.\n", argv[0], GetLastError()); return EXIT_FAILURE; }else{ if (0 == strcmp(argv[1],"-s")) { fprintf(stderr,"%s: -s not supported.\n",argv[0]); return EXIT_FAILURE; }else{ printf("Print the current host's name.\n\nhostname\n"); } } return EXIT_SUCCESS; }