#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>
int main()
{
fcntl(0, F_SETFL, O_NONBLOCK);
char buf[10];
gets(buf);
printf("aaaaaaaaaaaaaa\n");
}
使用fcntl干预默认操作属性。
#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>
int main()
{
fcntl(0, F_SETFL, O_NONBLOCK);
char buf[10];
gets(buf);
printf("aaaaaaaaaaaaaa\n");
}
使用fcntl干预默认操作属性。