Skip to content

Commit 8234fa3

Browse files
committed
[sysinfo] print stack size
1 parent c511e97 commit 8234fa3

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ if (UNIX AND NOT APPLE)
5151
endif()
5252

5353
add_executable(sysinfo "sysinfo.c")
54+
target_link_libraries(sysinfo pthread)
5455

5556
add_executable(uv_echo "uv_echo.c")
5657
target_link_libraries(uv_echo uv)

sysinfo.c

+9
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,14 @@ int
44
main(void)
55
{
66
printf("pagesize = %d\n", getpagesize());
7+
8+
{
9+
size_t stacksize;
10+
pthread_attr_t attr;
11+
pthread_attr_init(&attr);
12+
pthread_attr_getstacksize(&attr, &stacksize);
13+
printf("pthread stack size = %zu bytes \n", stacksize);
14+
}
15+
716
return 0;
817
}

0 commit comments

Comments
 (0)