aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/hw.model.c
blob: c2507daeee3c4cce2ffe9daae4d48b0a15799bcf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/*
   This software is in the public domain, furnished "as is", without technical
   support, and with no warranty, express or implied, as to its usefulness for
   any purpose.
*/
#include <sys/sysctl.h>
#include <stdio.h>

int main()
{
    char buf[32];
    size_t sz = sizeof(buf);
    int r = sysctlbyname("hw.model", buf, &sz, NULL, 0);
    if (r == 0) 
        printf("%.*s", sz, buf);
    return r;
}