Lines Matching refs:fd
91 int fd, ret;
96 fd = socket(PF_UNIX, type, 0);
97 if (fd < 0) {
122 ret = bind(fd, (struct sockaddr *) &addr, sizeof (addr));
139 return fd;
144 close(fd);
153 int fd;
157 fd = open(fn, O_RDONLY);
158 if(fd < 0) return 0;
162 if (fstat(fd, &sb) < 0) {
171 sz = lseek(fd, 0, SEEK_END);
174 if(lseek(fd, 0, SEEK_SET) != 0) goto oops;
179 if(read(fd, data, sz) != sz) goto oops;
180 close(fd);
187 close(fd);
203 int fd;
209 fd = open("/proc/mtd", O_RDONLY);
210 if (fd < 0)
214 pmtdsize = read(fd, buf, sizeof(buf) - 1);
246 close(fd);
374 int fd;
377 fd = open(name, O_RDWR);
379 if (fd >= 0) {
380 dup2(fd, 0);
381 dup2(fd, 1);
382 dup2(fd, 2);
383 if (fd > 2) {
384 close(fd);
396 int fd, n;
403 fd = open("/proc/cpuinfo", O_RDONLY);
404 if (fd < 0) return;
406 n = read(fd, data, 1023);
407 close(fd);
442 int fd;
444 fd = open("/proc/cmdline", O_RDONLY);
445 if (fd >= 0) {
446 int n = read(fd, cmdline, 1023);
453 close(fd);