如题,看如下测试代码: #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <sys/types.h> #include <sys/fcntl.h> #include <stdlib.h> int main(int argc, char *argv[]) { int fd=open("data", O_RDWR|O_CREAT, 0777); if(fd<0) { perror("open error!/n"); exit(-1); } int var =fcntl(fd, F_GETFL); var|=O_SYNC; int ret=fcntl(fd, F_SETFL); if(ret<0) { perror("fcntl"); exit(-1); } var=fcntl(fd, F_GETFL); if(var&O_SYNC) { printf("O_SYNC/n"); } close(fd); return 0; }#include <stdio.h> #include 你的当前访问异常,请进行认证后继续阅读剩余内容。 提交