書式#include <unistd.h> 書式#include <fcntl.h> 書式#include <SYS / types.h>に 書式#include <sysの/ stat.h> 書式#include <fcntl.h> 書式#include <errno.hを> 書式#include <SYS / types.h>に 書式#include <sysの/ stat.h> 書式#include <unistd.h> 書式#include <stdio.hに> 書式#include <ERRNO.H> //エラー番号はグローバル変数であることが判明しました INTメイン(){ あなたは= fdが-1; FD =オープン( "./のMakefile"、O_RDONLY)。 //近い(FD); もし(とfcntl(FD、F_GETFL)) { printf( "%M errnoに%D%D \ nが" FD、errnoに)。 エラー番号= 3。 printf(errnoに、 "errnoに\ n%Dです")。 printf( "%M errnoに%D%D \ nが" FD、errnoに)。 printf( "fcntlの成功\ N"); } そうしないと { printf( "fcntlの失敗\ n個"); } クローズ(FD)。 //しばらく(1) // printfの( "ファイルの状態\ N"); 0を返します。 }