2009-10-06から1日間の記事一覧

C言語の低レベル入出力

ファイル入出力 Cygwin用UARTサンプル #include<stdio.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <unistd.h> #include <string.h> #define BUFSIZE 256 int main(int argc,char *argv[]) { int fd; char buf[BUFSIZE]; int size; fd = open("/dev/com2",O_RDWR); if(fd<0){ printf("OPEN</string.h></unistd.h></fcntl.h></sys/stat.h></sys/types.h></stdio.h>…