Searched refs:fd (Results 1 - 25 of 43) sorted by relevance

12

/netgear-R7800-V1.0.2.28/package/dni-libmtd/src/
H A Dlibmtd.h163 * @fd: MTD device node file descriptor
169 int mtd_lock(const struct mtd_dev_info *mtd, int fd, int eb);
175 * @fd: MTD device node file descriptor
181 int mtd_unlock(const struct mtd_dev_info *mtd, int fd, int eb);
187 * @fd: MTD device node file descriptor
190 * This function erases eraseblock @eb of MTD device described by @fd. Returns
193 int mtd_erase(libmtd_t desc, const struct mtd_dev_info *mtd, int fd, int eb);
197 * @fd: MTD device node file descriptor
206 int mtd_regioninfo(int fd, int regidx, struct region_info_user *reginfo);
211 * @fd
[all...]
H A Dlibmtd_legacy.c72 int fd, ret; local
74 fd = open(MTD_PROC_FILE, O_RDONLY);
75 if (fd == -1)
80 ret = read(fd, pi->buf, PROC_MTD_MAX_LEN);
96 close(fd);
101 close(fd);
159 int fd; local
161 fd = open(MTD_PROC_FILE, O_RDONLY);
162 if (fd == -1) {
168 close(fd);
236 int fd, ret; local
[all...]
H A Dlibmtd.c78 int fd, rd, tmp, tmp1; local
80 fd = open(file, O_RDONLY | O_CLOEXEC);
81 if (fd == -1)
84 rd = read(fd, buf, buf_len);
99 tmp1 = read(fd, &tmp, 1);
111 if (close(fd)) {
119 close(fd);
201 int fd, rd; local
204 fd = open(file, O_RDONLY | O_CLOEXEC);
205 if (fd
253 int fd, rd; local
491 int fd, num = -1; local
816 mtd_xlock(const struct mtd_dev_info *mtd, int fd, int eb, int req, const char *sreq) argument
837 mtd_lock(const struct mtd_dev_info *mtd, int fd, int eb) argument
842 mtd_unlock(const struct mtd_dev_info *mtd, int fd, int eb) argument
847 mtd_erase(libmtd_t desc, const struct mtd_dev_info *mtd, int fd, int eb) argument
894 mtd_regioninfo(int fd, int regidx, struct region_info_user *reginfo) argument
911 mtd_is_locked(const struct mtd_dev_info *mtd, int fd, int eb) argument
952 mtd_torture(libmtd_t desc, const struct mtd_dev_info *mtd, int fd, int eb) argument
1008 mtd_is_bad(const struct mtd_dev_info *mtd, int fd, int eb) argument
1027 mtd_mark_bad(const struct mtd_dev_info *mtd, int fd, int eb) argument
1048 mtd_read(const struct mtd_dev_info *mtd, int fd, int eb, int offs, void *buf, int len) argument
1082 legacy_auto_oob_layout(const struct mtd_dev_info *mtd, int fd, int ooblen, void *oob) argument
1118 mtd_write(libmtd_t desc, const struct mtd_dev_info *mtd, int fd, int eb, int offs, void *data, int len, void *oob, int ooblen, uint8_t mode) argument
1190 do_oob_op(libmtd_t desc, const struct mtd_dev_info *mtd, int fd, uint64_t start, uint64_t length, void *data, unsigned int cmd64, unsigned int cmd) argument
1267 mtd_read_oob(libmtd_t desc, const struct mtd_dev_info *mtd, int fd, uint64_t start, uint64_t length, void *data) argument
1274 mtd_write_oob(libmtd_t desc, const struct mtd_dev_info *mtd, int fd, uint64_t start, uint64_t length, void *data) argument
1281 mtd_write_img(const struct mtd_dev_info *mtd, int fd, int eb, int offs, const char *img_name) argument
[all...]
H A Dmtd.c68 int fd, rfd, ret = -1; local
84 if ((fd = open(mtd_device, O_RDWR | O_SYNC)) == -1) {
200 ret = mtd_is_bad(&mtd, fd, offs / ebsize_aligned);
215 if (mtd_erase(mtd_desc, &mtd, fd, offs / ebsize_aligned)) {
227 ret = mtd_write(mtd_desc, &mtd, fd, mtdoffset / mtd.eb_size,
243 if (mtd_erase(mtd_desc, &mtd, fd, i / mtd.eb_size)) {
251 if (mtd_mark_bad(&mtd, fd, i / mtd.eb_size)) {
262 if (mtd_mark_bad(&mtd, fd, mtdoffset / mtd.eb_size)) {
282 close(fd);
295 int fd, rle local
[all...]
/netgear-R7800-V1.0.2.28/package/mtd/src/
H A Dtrx.c54 ssize_t pread(int fd, void *buf, size_t count, off_t offset);
55 ssize_t pwrite(int fd, const void *buf, size_t count, off_t offset);
58 trx_fixup(int fd, const char *name) argument
66 if (ioctl(fd, MEMGETINFO, &mtdInfo) < 0) {
108 int fd; local
129 fd = mtd_check_open(mtd);
130 if(fd < 0) {
137 close(fd);
141 close(fd);
148 int fd; local
[all...]
H A Dmtd.h18 extern int mtd_erase_block(int fd, int offset);
19 extern int mtd_write_buffer(int fd, const char *buf, int offset, int length);
21 extern int mtd_replace_jffs2(const char *mtd, int fd, int ofs, const char *filename);
25 extern int trx_fixup(int fd, const char *name) __attribute__ ((weak));
H A Dimagetag.c39 ssize_t pread(int fd, void *buf, size_t count, off_t offset);
40 ssize_t pwrite(int fd, const void *buf, size_t count, off_t offset);
57 uint32_t compute_crc32(uint32_t crc, off_t start, size_t compute_len, int fd) argument
64 while (fd && (compute_len >= sizeof(readbuf))) {
65 res = pread(fd, readbuf, sizeof(readbuf), offset);
72 if (fd && (compute_len > 0)) {
73 res = pread(fd, readbuf, compute_len, offset);
81 trx_fixup(int fd, const char *name) argument
95 if (ioctl(fd, MEMGETINFO, &mtdInfo) < 0) {
121 headercrc = compute_crc32(CRC_START, offset, offsetof(struct bcm_tag, headerCRC), fd);
155 int fd; local
201 int fd; local
[all...]
H A Dmtd.c93 int fd; local
95 fd = mtd_open(mtd, false);
96 if(fd < 0) {
101 if(ioctl(fd, MEMGETINFO, &mtdInfo)) {
103 close(fd);
109 return fd;
112 int mtd_erase_block(int fd, int offset) argument
118 ioctl(fd, MEMUNLOCK, &mtdEraseInfo);
119 if (ioctl (fd, MEMERASE, &mtdEraseInfo) < 0)
125 int mtd_write_buffer(int fd, cons argument
148 int fd; local
185 int fd; local
224 int fd; local
255 int fd; local
294 int fd, result; local
[all...]
H A Dseama.c50 ssize_t pread(int fd, void *buf, size_t count, off_t offset);
51 ssize_t pwrite(int fd, const void *buf, size_t count, off_t offset);
117 int fd; local
129 fd = mtd_check_open(mtd);
130 if(fd < 0) {
147 res = pread(fd, buf, mtdsize, block_offset);
156 if (mtd_erase_block(fd, block_offset)) {
165 if (pwrite(fd, buf, erasesize, block_offset) != erasesize) {
174 close (fd);
/netgear-R7800-V1.0.2.28/target/linux/ar7/src/
H A Dadam2patcher.c31 int fd; local
40 if (((fd = open(argv[1], O_RDWR)) < 0)
41 || ((ptr = mmap(0, 128 * 1024, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0)) == (void *) (-1))) {
58 close(fd);
/netgear-R7800-V1.0.2.28/package/disktype/src/
H A Dmain.c60 int fd, filekind; local
85 fd = open(filename, O_RDONLY);
86 if (fd < 0) {
92 s = init_file_source(fd, filekind);
H A Dfile.c53 int fd; member in struct:file_source
64 static int check_position(int fd, u8 pos);
71 SOURCE *init_file_source(int fd, int filekind) argument
85 fs->fd = fd;
97 result = lseek(fd, 0, SEEK_END);
116 if (ioctl(fd, BLKGETSIZE64, (void *)&devsize) >= 0) {
129 if (ioctl(fd, BLKGETSIZE, (void *)&blockcount) >= 0) {
147 if (ioctl(fd, DIOCGDINFO, &dl) >= 0) {
166 if (ioctl(fd, DKIOCGETBLOCKSIZ
236 int fd = ((FILE_SOURCE *)s)->fd; local
274 int fd = ((FILE_SOURCE *)s)->fd; local
285 check_position(int fd, u8 pos) argument
[all...]
/netgear-R7800-V1.0.2.28/tools/sstrip/src/
H A Dsstrip.c146 static int readelfheader ## CLASS (int fd, Elf ## CLASS ## _Ehdr *ehdr) \
148 if (read(fd, ((char *)ehdr)+EI_NIDENT, sizeof(*ehdr) - EI_NIDENT) \
170 static int readphdrtable ## CLASS (int fd, Elf ## CLASS ## _Ehdr const *ehdr, \
183 if (read(fd, *phdrs, size) != (ssize_t)size) \
264 static int commitchanges ## CLASS (int fd, Elf ## CLASS ## _Ehdr const *ehdr, \
272 if (lseek(fd, 0, SEEK_SET)) \
275 if (write(fd, ehdr, sizeof *ehdr) != sizeof *ehdr) \
280 if (lseek(fd, EGET(ehdr->e_phoff), SEEK_SET) == (off_t)-1) { \
285 if (write(fd, phdrs, n) != (ssize_t)n) { \
298 if (ftruncate(fd, newsiz
312 readelfheaderident(int fd, Elf32_Ehdr *ehdr) argument
371 truncatezeros(int fd, unsigned long *newsize) argument
403 int fd; local
[all...]
/netgear-R7800-V1.0.2.28/target/linux/rb532/src/
H A Dpatch-cmdline.c36 int fd, found = 0, len, ret = -1; local
49 if (((fd = open(argv[1], O_RDWR)) < 0) ||
50 (ptr = (char *) mmap(0, SEARCH_SPACE + CMDLINE_MAX, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0)) == (void *) (-1)) {
75 if (fd > 0)
76 close(fd);
/netgear-R7800-V1.0.2.28/tools/patch-cmdline/src/
H A Dpatch-cmdline.c36 int fd, found = 0, len, ret = -1; local
49 if (((fd = open(argv[1], O_RDWR)) < 0) ||
50 (ptr = (char *) mmap(0, SEARCH_SPACE + CMDLINE_MAX, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0)) == (void *) (-1)) {
75 if (fd > 0)
76 close(fd);
/netgear-R7800-V1.0.2.28/tools/firmware-utils/src/
H A DR7600.c86 int fd; local
97 if ((fd = open(argv[1], O_RDONLY)) < 0
98 || (len = lseek(fd, 0, SEEK_END)) < 0
99 || (input_file = mmap(0, len, PROT_READ, MAP_SHARED, fd, 0)) == (void *) (-1)
100 || close(fd) < 0)
126 if ((fd = open(argv[2], O_CREAT|O_WRONLY|O_TRUNC,0644)) < 0
127 || write(fd, buf, buflen) != buflen
128 || close(fd) < 0)
H A DR7800.c86 int fd; local
97 if ((fd = open(argv[1], O_RDONLY)) < 0
98 || (len = lseek(fd, 0, SEEK_END)) < 0
99 || (input_file = mmap(0, len, PROT_READ, MAP_SHARED, fd, 0)) == (void *) (-1)
100 || close(fd) < 0)
126 if ((fd = open(argv[2], O_CREAT|O_WRONLY|O_TRUNC,0644)) < 0
127 || write(fd, buf, buflen) != buflen
128 || close(fd) < 0)
H A Dadd_header.c86 int fd; local
97 if ((fd = open(argv[2], O_RDONLY)) < 0
98 || (len = lseek(fd, 0, SEEK_END)) < 0
99 || (input_file = mmap(0, len, PROT_READ, MAP_SHARED, fd, 0)) == (void *) (-1)
100 || close(fd) < 0)
125 if ((fd = open(argv[3], O_CREAT|O_WRONLY|O_TRUNC,0644)) < 0
126 || write(fd, buf, buflen) != buflen
127 || close(fd) < 0)
H A Dwndr3700.c89 int fd; local
108 if ((fd = open(argv[1], O_RDONLY)) < 0
109 || (len = lseek(fd, 0, SEEK_END)) < 0
110 || (input_file = mmap(0, len, PROT_READ, MAP_SHARED, fd, 0)) == (void *) (-1)
111 || close(fd) < 0)
137 if ((fd = open(argv[2], O_CREAT|O_WRONLY|O_TRUNC,0644)) < 0
138 || write(fd, buf, buflen) != buflen
139 || close(fd) < 0)
H A Dmotorola-bin.c120 int fd; local
131 if ((fd = open(argv[2], O_RDONLY)) < 0
132 || (len = lseek(fd, 0, SEEK_END)) < 0
133 || (trx = mmap(0, len, PROT_READ, MAP_SHARED, fd, 0)) == (void *) (-1)
134 || close(fd) < 0)
172 if ((fd = open(argv[3], O_CREAT|O_WRONLY|O_TRUNC,0644)) < 0
173 || write(fd, trx + sizeof(struct motorola), len - sizeof(struct motorola)) != len - sizeof(struct motorola)
174 || close(fd) < 0)
213 if ((fd = open(argv[3], O_CREAT|O_WRONLY|O_TRUNC,0644)) < 0
214 || write(fd, firmwar
[all...]
H A Dptgen.c131 int i, fd, ret = -1, start, len; local
157 if ((fd = open(filename, O_WRONLY|O_CREAT|O_TRUNC, 0644)) < 0) {
162 lseek(fd, 446, SEEK_SET);
163 if (write(fd, pte, sizeof(struct pte) * 4) != sizeof(struct pte) * 4) {
167 lseek(fd, 510, SEEK_SET);
168 if (write(fd, "\x55\xaa", 2) != 2) {
175 close(fd);
H A Dairlink.c186 int c, fd; local
234 fd = open(argv[argc - 1], O_RDWR);
235 if (fd < 0) {
241 long i, len = lseek(fd, 0, SEEK_END);
242 lseek(fd, 0, SEEK_SET);
244 read(fd, buf, len);
255 lseek(fd, 0x10, SEEK_SET);
256 write(fd, buf + 0x10, 0x4);
267 lseek(fd, 0x18, SEEK_SET);
268 write(fd, bu
[all...]
/netgear-R7800-V1.0.2.28/tools/padjffs2/src/
H A Dpadjffs2.c43 int fd; local
54 fd = open(name, O_RDWR);
55 if (fd < 0) {
60 in_len = lseek(fd, 0, SEEK_END);
95 t = write(fd, buf, len);
105 t = write(fd, eof_mark, 4);
116 close(fd);
/netgear-R7800-V1.0.2.28/scripts/config/lxdialog/
H A Dtextbox.c30 static int hscroll, fd, file_size, bytes_read; variable
47 if ((fd = open(file, O_RDONLY)) == -1) {
54 if ((file_size = lseek(fd, 0, SEEK_END)) == -1) {
60 if (lseek(fd, 0, SEEK_SET) == -1) {
71 if ((bytes_read = read(fd, buf, BUF_SIZE)) == -1) {
128 close(fd);
135 if ((fpos = lseek(fd, 0, SEEK_CUR)) == -1) {
141 if (lseek(fd, 0, SEEK_SET) == -1) {
148 read(fd, buf, BUF_SIZE)) == -1) {
167 if ((fpos = lseek(fd,
[all...]
/netgear-R7800-V1.0.2.28/package/dni-mtdoops/src/tools/
H A Dpanic_log.c41 int fd; local
43 fd = open(oops_mtd, O_RDWR);
44 if (fd < 0) {
49 if (ioctl(fd, MEMGETINFO, &mtdInfo)){
54 close(fd);

Completed in 76 milliseconds

12