📄 crash.c
字号:
/** * crash.c - make RTLinux crash as simple as possible... */#include <pthread.h>#include <stdio.h>#define BUF_LEN 256void *start_it( void *arg ) { FILE *f; int i=0; char str[BUF_LEN] = "This is a test\n"; while (1) { if ( ( f = fopen( "/tmp/test", "w" ) ) ) { //fprintf( f, "hi\n" ); printf( "created file %i %p\n", ++i, f ); fwrite( str, BUF_LEN, 1, f ); fclose( f ); } else { return NULL; } } return NULL;}pthread_t start_t;int main(void) { if ( pthread_create( &start_t, NULL, start_it, NULL ) ) { printf( "Couldn't init thread\n" ); return -1; } pthread_join( start_t, NULL ); return 0;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -