mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
13 lines
227 B
C
13 lines
227 B
C
![]() |
#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;
|
||
|
}
|