欢迎关注VxWorks567
如转发,请标明出处!
Basic I/O system的7个函数:creat(), remove(), open(), close(), read(), write(), ioctl()。creat()与remove()主要用于文件系统。函数声明如下
int creat (char *name, int flag);
int remove(char *name);
#define O_RDONLY 0x0000
#define O_WRONLY 0x0001
#define O_RDWR 0x0002
#define O_APPEND 0x0008
#define O_CREAT 0x0200
#define O_TRUNC 0x0400
#define O_EXCL 0x0800
#define O_SYNC 0x2000
#define O_NONBLOCK 0x4000
#define O_NOCTTY 0x8000
#define O_DSYNC 0x10000
#define O_RSYNC 0x20000
int open
(
char *name,
int flags,
int mode
);
int close (int fd);
int read (int fd, char *buffer, int maxBytes);
int write (int fd, char *buffer, int nBytes);
#define FIONREAD 1
#define FIOFLUSH 2
#define FIOOPTIONS 3
#define FIOBAUDRATE 4
#define FIODISKFORMAT 5
#define FIODISKINIT 6
#define FIOSEEK 7
#define FIOWHERE 8
#define FIODIRENTRY 9
#define FIORENAME 10
#define FIOREADYCHANGE 11
#define FIONWRITE 12
#define FIODISKCHANGE 13
#define FIOCANCEL 14
#define FIOSQUEEZE 15
#define FIONBIO 16
#define FIONMSGS 17
#define FIOGETNAME 18
#define FIOGETOPTIONS 19
#define FIOSETOPTIONS FIOOPTIONS
#define FIOISATTY 20
#define FIOSYNC 21
#define FIOPROTOHOOK 22
#define FIOPROTOARG 23
#define FIORBUFSET 24
#define FIOWBUFSET 25
#define FIORFLUSH 26
#define FIOWFLUSH 27
#define FIOSELECT 28
#define FIOUNSELECT 29
#define FIONFREE 30
#define FIOMKDIR 31
#define FIORMDIR 32
#define FIOLABELGET 33
#define FIOLABELSET 34
#define FIOATTRIBSET 35
#define FIOCONTIG 36
#define FIOREADDIR 37
#define FIOFSTATGET_OLD 38
#define FIOUNMOUNT 39
#define FIOSCSICOMMAND 40
#define FIONCONTIG 41
#define FIOTRUNC 42
#define FIOGETFL 43
#define FIOTIMESET 44
#define FIOINODETONAME 45
#define FIOFSTATFSGET 46
#define FIOMOVE 47
#define FIOCHKDSK 48
#define FIOCONTIG64 49
#define FIONCONTIG64 50
#define FIONFREE64 51
#define FIONREAD64 52
#define FIOSEEK64 53
#define FIOWHERE64 54
#define FIOTRUNC64 55
#define FIOCOMMITFS 56
#define FIODATASYNC 57
#define FIOLINK 58
#define FIOUNLINK 59
#define FIOACCESS 60
#define FIOPATHCONF 61
#define FIOFCNTL 62
#define FIOCHMOD 63
#define FIOFSTATGET 64
#define FIOUPDATE 65
#define FIOCOMMITPOLICYGETFS 66
#define FIOCOMMITPOLICYSETFS 67
#define FIOCOMMITPERIODGETFS 68
#define FIOCOMMITPERIODSETFS 69
#define FIOFSTATFSGET64 70
#define FIODISCARDGET 70
#define FIODISCARD 71
#define FIOREADDIRPLUS 72
int ioctl (int fd, int function,...);
我是泰山 专注VX 0x10年
一起学习 共同进步