header.c 601 B

1234567891011121314151617181920212223242526272829
  1. /*
  2. * Implementation of get_cpuid().
  3. *
  4. * Copyright 2014 IBM Corp.
  5. * Author(s): Alexander Yarygin <yarygin@linux.vnet.ibm.com>
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License (version 2 only)
  9. * as published by the Free Software Foundation.
  10. */
  11. #include <sys/types.h>
  12. #include <unistd.h>
  13. #include <stdio.h>
  14. #include <string.h>
  15. #include "../../util/header.h"
  16. int get_cpuid(char *buffer, size_t sz)
  17. {
  18. const char *cpuid = "IBM/S390";
  19. if (strlen(cpuid) + 1 > sz)
  20. return -1;
  21. strcpy(buffer, cpuid);
  22. return 0;
  23. }