linux c获取系统信息
来源:互联网 发布:哈密顿算法 编辑:程序博客网 时间:2024/06/05 06:05
/*
============================================================================
Name : Demo.c
Author : jwang
Version :
Copyright : Your copyright notice
Description : System information in C, Ansi-style
============================================================================
*/
#include <sys/utsname.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
int main(void) {
char computer[256];
struct utsname uts;
if(gethostname(computer, 255) != 0 || uname(&uts) < 0){
fprintf(stderr, "could not get host information\n");
}
printf("computer host name is %s\n", computer);
printf("system is %s on %s hardware\n", uts.sysname, uts.machine);
printf("nodeName is %s\n", uts.nodename);
printf("version is %s, %s\n", uts.release, uts.version);
return 0;
}
============================================================================
Name : Demo.c
Author : jwang
Version :
Copyright : Your copyright notice
Description : System information in C, Ansi-style
============================================================================
*/
#include <sys/utsname.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
int main(void) {
char computer[256];
struct utsname uts;
if(gethostname(computer, 255) != 0 || uname(&uts) < 0){
fprintf(stderr, "could not get host information\n");
}
printf("computer host name is %s\n", computer);
printf("system is %s on %s hardware\n", uts.sysname, uts.machine);
printf("nodeName is %s\n", uts.nodename);
printf("version is %s, %s\n", uts.release, uts.version);
return 0;
}
- linux c获取系统信息
- Linux C 语言 获取系统时间信息
- linux c获取系统网卡信息
- Linux C 语言 获取系统时间信息
- Linux C 语言 获取系统时间信息
- Linux C 语言 获取系统时间信息
- linux C语言获取系统内存信息
- 获取linux系统的cup信息,内存信息c代码
- 获取linux系统信息
- 获取Linux系统信息
- C#,WMI获取系统信息
- Linux下获取系统信息
- 获取linux系统信息常用命令
- linux 获取系统信息常用命令
- linux C获取网络信息
- C语言获取Windows系统进程信息
- python获取linux的系统信息
- linux获取系统信息的常用命令
- 大龄程序员的出路在哪里?
- 安卓-生命周期简述
- 关系型数据库基础之:关系型数据库管理系统简介
- 1038 Biker's Trip Odometer
- 内存和CPU频率匹配方法的探讨 转载
- linux c获取系统信息
- PowerPC 学习笔记
- MooseFS 1.6.27
- 编写函数,使其在第一次调用时返回 0,然后再次调用时按顺序产生正整数(即 返回其当前的调用次数)。
- 4月2日整理
- Java 5和6的改进
- 孙鑫-JAVA学习笔记(1-3)
- This is class com.sumiplus.servlet.RedirectServlet, using the GET method
- 孙鑫-JAVA笔记(4-6)