linux下檢視系統自身巨集定義
跨平臺程式,經常要用到區分系統的巨集定義,比如windows中的WIN32, WIN64, Linux中的 unix, linux等等系統自定義巨集
那麼在linux下面,怎麼檢視系統有哪些自定義巨集咧,用如下方法:
$ touch dummy.hxx
$ cpp -dM ./dummy.hxx
輸出如下:
[[email protected] server]$ cpp -dM ./dummy.hxx
#define __DBL_MIN_EXP__ (-1021)
#define __FLT_MIN__ 1.17549435e-38F
#define __CHAR_BIT__ 8
#define __WCHAR_MAX__ 2147483647
#define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 1
#define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_2 1
#define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 1
#define __DBL_DENORM_MIN__ 4.9406564584124654e-324
#define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8 1
#define __FLT_EVAL_METHOD__ 0
#define __unix__ 1
#define __x86_64 1
#define __DBL_MIN_10_EXP__ (-307)
#define __FINITE_MATH_ONLY__ 0
#define __GNUC_PATCHLEVEL__ 7
#define __DEC64_MAX_EXP__ 385
#define __SHRT_MAX__ 32767
#define __LDBL_MAX__ 1.18973149535723176502e+4932L
#define __UINTMAX_TYPE__ long unsigned int
#define __linux 1
#define __DEC32_EPSILON__ 1E-6DF
#define __unix 1
#define __LDBL_MAX_EXP__ 16384
#define __linux__ 1
要檢視全部,可以加less命令:
$ cpp -dM ./dummy.hxx | less
就可以游標向上翻或者向下翻,因為系統可能巨集定義比較多,一屏看不過來
以上原文地址:http://blog.csdn.net/xiaoheqin/article/details/52183073
另附上各作業系統的平臺巨集定義
AIX
Type | Macro | Description |
---|---|---|
Identification |
_AIX |
|
Version |
_AIX'VR' |
V = Version R = Revision |
Identification |
__TOS_AIX__ |
Defined by xlC |
Example
If _AIX
is defined, then the following macros can be used to determine the version. Notice that the macros
indicates the mentioned version or higher. For example, if _AIX43
is defined, then _AIX41
will
also be defined.
AIX Version | Macro |
---|---|
3.2.x |
_AIX3 _AIX32 |
4.1 |
_AIX41 |
4.3 |
_AIX43 |
Type | Macro | Format | Description |
---|---|---|---|
Identification |
__ANDROID__ |
||
Version |
__ANDROID_API__ |
V |
V = API Version Must be included from <android/api-level.h> |
Notice that Android is based on Linux, and that the linux macros also are defined for android.
Example
Android Version |
__ANDROID_API__ |
---|---|
1.0 | 1 |
1.1 | 2 |
1.5 | 3 |
1.6 | 4 |
2.0 | 5 |
2.0.1 | 6 |
2.1 | 7 |
2.2 | 8 |
2.3 | 9 |
2.3.3 | 10 |
3.0 | 11 |
Type | Macro |
---|---|
Identification |
UTS |
Type | Macro | Description |
---|---|---|
Identification |
AMIGA |
|
Identification |
__amigaos__ |
Defined by GNU C |
Type | Macro |
---|---|
Identification |
aegis |
Type | Macro |
---|---|
Identification |
apollo |
Bada
Based on Nucleus OS.
BeOS
Type | Macro |
---|---|
Identification |
__BEOS__ |
Type | Macro | Description |
---|---|---|
Identification |
__bg__ |
All Blue Gene systems Defined by XL C/C++ and GNU C |
Version |
__bgq__ |
Blue Gene/Q Defined for XL C/C++ and GNU C |
Identification |
__THW_BLUEGENE__ |
All Blue Gene systems Defined by XL C/C++ |
Version |
__TOS_BGQ__ |
Blue Gene/Q Defined by XL C/C++ |
Type | Macro | Format | Description |
---|---|---|---|
Identification |
__FreeBSD__ __NetBSD__ __OpenBSD__ __bsdi__ __DragonFly__ |
||
Version |
BSD |
YYYYMM |
YYYY = Year MM = Month Must be included from <sys/param.h> |
Version |
BSD4_2 BSD4_3 BSD4_4 |
Must be included from <sys/param.h> |
|
Identification |
_SYSTYPE_BSD |
Defined by DEC C |
Example
Version |
BSD |
Macro |
---|---|---|
4.3 Net2 | 199103 | |
4.4 | 199306 |
BSD4_4 |
4.4BSD-Lite2 | 199506 |
Type | Macro |
---|---|
Identification |
__bsdi__ |
Type | Macro |
---|---|
Identification |
__convex__ |
Type | Macro |
---|---|
Identification |
__CYGWIN__ |
DG/UX
Type | Macro |
---|---|
Identification |
DGUX |
Identification |
__DGUX__ |
Identification |
__dgux__ |
Type | Macro |
---|---|
Identification |
__DragonFly__ |
Type | Macro |
---|---|
Identification |
_SEQUENT_ |
Identification |
sequent |
eCos
Type | Macro |
---|---|
Identification |
__ECOS |
Type | Macro |
---|---|
Identification |
__EMX__ |
Type | Macro | Format | Description |
---|---|---|---|
Identification |
__FreeBSD__ |
||
Identification |
__FreeBSD_kernel__ |
From FreeBSD 8.3, 9.1, and 10.0.1 | |
Version |
相關推薦linux下檢視系統自身巨集定義跨平臺程式,經常要用到區分系統的巨集定義,比如windows中的WIN32, WIN64, Linux中的 unix, linux等等系統自定義巨集 那麼在linux下面,怎麼檢視系統有哪些自定義巨集咧,用如下方法: $ touch dummy.hxx Linux下檢視系統版本號和核心資訊的方法本文轉載,侵刪!感謝博主”huoyuanshen”(✈機票點我) 參考URL:http://www.ha97.com/2987.html 簡要:1,lsb_release -a 檢視linux系統版本 &n linux下檢視系統屬性 Linux下檢視和新增環境變數Linux下檢視和新增環境變數 #檢視tomcat安裝路徑 sudo find / -name *tomcat* $PATH:決定了shell將到哪些目錄中尋找命令或程式,PATH的值是一系列目錄,當您執行一個程式時,Linux在這些目錄下進行搜尋編譯連結。 編輯你的 PATH 宣告 linux下檢視系統socket讀寫緩衝區#include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <string.h> #include <errno.h> #include <sys/type linux 下檢視系統資源和負載,以及效能監控 命令相關: 1,檢視磁碟 df -h 2,檢視記憶體大小 free free [-m|g]按MB,GB顯示記憶體 vmstat 3,檢視cpu cat /proc/cpuinfo 只看cpu數量 grep "model name" /pro Linux 下檢視系統是32位 還是64 位的方法1. 從系統檢視 1.1 uname -a 命令 [[email protected] ~]# uname -a Linux qs-dmm-rh2 2.6.18-194.el5 #1 S Linux下檢視系統配置CPU 1. lscpu:顯示cpu架構資訊 [[email protected] ~]$ lscpu Architecture: x86_64 CPU op-mode(s): 32-bit, 64-bit Byte Or linux 下檢視系統資源和負載,以及效能監控1,檢視磁碟 df -h 2,檢視記憶體大小 free free [-m|g]按MB,GB顯示記憶體 vmstat 檢視虛擬記憶體 3,檢視cpu cat /proc/cpuinfo 只看cpu數量grep "model name" /proc/cpuinfo linux下檢視系統io情況方式一 vmstat 1 顯示格式如下 procs -----------memory---------- ---swap-- -----io---- --system-- -----cpu------ r b swpd free buff linux下檢視系統資源和負載,以及效能監控1,檢視磁碟 df -h 2,檢視記憶體大小 free free [-m|g]按MB,GB顯示記憶體 vmstat 3,檢視cpu cat /proc/cpuinfo 只看cpu數量grep "model name" /proc/cpuinfo | wc Linux下檢視系統資訊方法總結Linux下如何檢視系統啟動時間和執行時間1.檢視/proc/uptime檔案計算系統啟動時間: cat /proc/uptime 輸出: 5113396.94 575949.85第一數字即是系統已執行的時間5113396.94秒,運用系統工具date即可算出系統啟動時間 Linux下檢視系統配置常用命令系統 >> uname -a 檢視核心/作業系統/CPU資訊 >> head -n 1 /etc/issue 檢視作業系統版本 >> cat /proc/cpuinfo 檢視CPU資訊 >> hostname 檢視計算機名 &g linux下檢視系統配置引數檢視系統核心 uname -a 3.10.0-514.el7.x86_64 檢視作業系統版本號 dmidecode | grep “Product” 檢視系統記憶體 cat /proc/meminfo |more vm Win7+Ubuntu雙系統結構下,Ubuntu克隆至新硬碟,啟動成功 Linux下檢視硬碟UUID和修改硬碟UUID(轉)前言梗概: 750GB 機械硬碟下安裝 Win7 和 Ubuntu雙系統,之前Win7單獨重灌後,將grub引導覆蓋;利用EasyBCD恢復Ubuntu啟動。 最近發現之前Ubuntu分配空間太小,想將其安裝到一個大一點的SSD(固態硬碟)上。 Ubuntu情況如下, /dev/s 雙系統在Linux下檢視win的硬碟(Ubuntu 16.04 掛載Windows的 硬碟)一般情況下,Linux的桌面系統能夠直接檢視到計算機各個硬碟的檔案情況 但是,當我們想通過命令列檢視Windows下的硬碟的時候,會發現在 /media/ (一般Windows下的盤會掛載到這裡)檔案下是空的, 當你在影象化介面開啟Windows的硬碟之後,/media/ 下就會顯示之前沒有出現 linux下檢視磁碟分割槽的檔案系統格式原文連結:https://www.cnblogs.com/youbiyoufang/p/7607174.html-------------------------------------------------------------------------df -T 只可以 Linux下檢視當前核心系統支援的檔案系統[email protected] ~ $ mount /dev/sda5 on / type ext4 (rw,errors=remount-ro) proc on /proc type proc (rw,noexec,nosuid,nodev) sysfs on /sys type sysfs linux下SNMP的extend--自定義監控linux snmp extend snmp除了具有系統默認的監控項,還提供了一個強大的功能,可自定義監控項。在snmpd.conf配置文件中的exec選項(高版本的snmp中,extend替代了exec)提供了自定義的監控功能,可以將命令或者腳本的執行結果添加到snmp的查詢中。格式為:extend Linux下CenOS系統 安裝Mysql-5.7.19roo img .rpm undle -1 -c style root ima 1.輸入網址https://www.mysql.com/downloads/,進入downloads,選擇Community 2.選擇對應的版本和系統; LoadRunner如何監控Linux下的系統資源etc sys serve host 下載 系統資源 性能 str login 1. 安裝rsh,rsh-server [root@localhost /]# yum install rsh [root@localhost /]# yum install rsh-serve |