Lines Matching refs:fd

26 	int fd;  member
61 int fd; in rmtfs_mem_open_rfsa() local
65 fd = open(path, O_RDWR); in rmtfs_mem_open_rfsa()
66 if (fd < 0) { in rmtfs_mem_open_rfsa()
71 rmem->fd = fd; in rmtfs_mem_open_rfsa()
73 ret = fstat(fd, &sb); in rmtfs_mem_open_rfsa()
77 close(fd); in rmtfs_mem_open_rfsa()
119 close(fd); in rmtfs_mem_open_rfsa()
131 int fd; in rmtfs_mem_open_uio() local
135 fd = open(path, O_RDWR); in rmtfs_mem_open_uio()
136 if (fd < 0) { in rmtfs_mem_open_uio()
141 rmem->fd = fd; in rmtfs_mem_open_uio()
143 ret = fstat(fd, &sb); in rmtfs_mem_open_uio()
147 close(fd); in rmtfs_mem_open_uio()
179 rmem->base = mmap(0, rmem->size, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0); in rmtfs_mem_open_uio()
196 close(fd); in rmtfs_mem_open_uio()
207 int fd; in rmtfs_mem_open_rfsa() local
215 rmem->fd = open(path, O_RDWR); in rmtfs_mem_open_rfsa()
216 if (rmem->fd < 0) { in rmtfs_mem_open_rfsa()
223 fd = open(path, O_RDONLY); in rmtfs_mem_open_rfsa()
224 if (fd < 0) { in rmtfs_mem_open_rfsa()
229 read(fd, val, sizeof(val)); in rmtfs_mem_open_rfsa()
235 close(fd); in rmtfs_mem_open_rfsa()
238 fd = open(path, O_RDONLY); in rmtfs_mem_open_rfsa()
239 if (fd < 0) { in rmtfs_mem_open_rfsa()
244 read(fd, val, sizeof(val)); in rmtfs_mem_open_rfsa()
250 close(fd); in rmtfs_mem_open_rfsa()
255 close(fd); in rmtfs_mem_open_rfsa()
272 int fd; in rmtfs_mem_open() local
295 fd = open("/dev/mem", O_RDWR|O_SYNC); in rmtfs_mem_open()
296 if (fd < 0) { in rmtfs_mem_open()
301 base = mmap(0, rmem->size, PROT_READ|PROT_WRITE, MAP_SHARED, fd, rmem->address); in rmtfs_mem_open()
308 rmem->fd = fd; in rmtfs_mem_open()
315 close(fd); in rmtfs_mem_open()
367 len = pread(rmem->fd, buf, len, offset); in rmtfs_mem_read()
386 len = pwrite(rmem->fd, buf, len, offset); in rmtfs_mem_write()
397 close(rmem->fd); in rmtfs_mem_close()