Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
阿啄debugIT
libfastcommon
提交
a8b9d024
L
libfastcommon
项目概览
阿啄debugIT
/
libfastcommon
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
L
libfastcommon
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
a8b9d024
编写于
2月 01, 2016
作者:
Y
yuqing
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
define nsec of file stat in Linux and FreeBSD
上级
08d39328
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
21 addition
and
0 deletion
+21
-0
src/common_define.h
src/common_define.h
+12
-0
src/tests/test_mblock.c
src/tests/test_mblock.c
+9
-0
未找到文件。
src/common_define.h
浏览文件 @
a8b9d024
...
@@ -116,6 +116,18 @@ extern int pthread_mutexattr_settype(pthread_mutexattr_t *attr, int kind);
...
@@ -116,6 +116,18 @@ extern int pthread_mutexattr_settype(pthread_mutexattr_t *attr, int kind);
#define IS_UPPER_HEX(ch) ((ch >= '0' && ch <= '9') || (ch >= 'A' && ch <= 'F'))
#define IS_UPPER_HEX(ch) ((ch >= '0' && ch <= '9') || (ch >= 'A' && ch <= 'F'))
#define STRERROR(no) (strerror(no) != NULL ? strerror(no) : "Unkown error")
#define STRERROR(no) (strerror(no) != NULL ? strerror(no) : "Unkown error")
#if defined(OS_LINUX)
#if defined __USE_MISC || defined __USE_XOPEN2K8
#define st_atimensec st_atim.tv_nsec
#define st_mtimensec st_mtim.tv_nsec
#define st_ctimensec st_ctim.tv_nsec
#endif
#elif defined(OS_FREEBSD)
#define st_atimensec st_atimespec.tv_nsec
#define st_mtimensec st_mtimespec.tv_nsec
#define st_ctimensec st_ctimespec.tv_nsec
#endif
#ifdef __cplusplus
#ifdef __cplusplus
extern
"C"
{
extern
"C"
{
#endif
#endif
...
...
src/tests/test_mblock.c
浏览文件 @
a8b9d024
...
@@ -4,7 +4,9 @@
...
@@ -4,7 +4,9 @@
#include <math.h>
#include <math.h>
#include <time.h>
#include <time.h>
#include <inttypes.h>
#include <inttypes.h>
#include <sys/types.h>
#include <sys/time.h>
#include <sys/time.h>
#include <sys/stat.h>
#include "logger.h"
#include "logger.h"
#include "shared_func.h"
#include "shared_func.h"
#include "sched_thread.h"
#include "sched_thread.h"
...
@@ -87,6 +89,7 @@ int main(int argc, char *argv[])
...
@@ -87,6 +89,7 @@ int main(int argc, char *argv[])
{
{
FastProcessInfo
*
processes
;
FastProcessInfo
*
processes
;
struct
fast_sysinfo
info
;
struct
fast_sysinfo
info
;
struct
stat
st
;
get_processes
(
&
processes
,
&
count
);
get_processes
(
&
processes
,
&
count
);
printf
(
"process count: %d
\n
"
,
count
);
printf
(
"process count: %d
\n
"
,
count
);
...
@@ -117,7 +120,13 @@ int main(int argc, char *argv[])
...
@@ -117,7 +120,13 @@ int main(int argc, char *argv[])
printf
(
"freeswap: %ld
\n
"
,
info
.
freeswap
);
printf
(
"freeswap: %ld
\n
"
,
info
.
freeswap
);
printf
(
"procs: %d
\n
"
,
info
.
procs
);
printf
(
"procs: %d
\n
"
,
info
.
procs
);
}
}
stat
(
"/dev/null"
,
&
st
);
printf
(
"file access time: %d.%ld
\n
"
,
(
int
)
st
.
st_atime
,
st
.
st_atimensec
);
printf
(
"file modify time: %d.%ld
\n
"
,
(
int
)
st
.
st_mtime
,
st
.
st_mtimensec
);
printf
(
"file change time: %d.%ld
\n
"
,
(
int
)
st
.
st_ctime
,
st
.
st_ctimensec
);
}
}
#endif
#endif
if
((
result
=
iniLoadFromFile
(
filename
,
&
iniContext
))
!=
0
)
{
if
((
result
=
iniLoadFromFile
(
filename
,
&
iniContext
))
!=
0
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录