My slstatus configuration
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

19 lines
291 B

  1. /* See LICENSE file for copyright and license details. */
  2. #include <errno.h>
  3. #include <stdio.h>
  4. #include <string.h>
  5. #include <unistd.h>
  6. #include "../util.h"
  7. const char *
  8. hostname(void)
  9. {
  10. if (gethostname(buf, sizeof(buf)) < 0) {
  11. warn("gethostbyname:");
  12. return NULL;
  13. }
  14. return buf;
  15. }