Lines Matching refs:fd
50 unix_read(int fd, void* buff, int len)
53 do { ret = read(fd, buff, len); } while (ret < 0 && errno == EINTR);
58 unix_write(int fd, const void* buff, int len)
61 do { ret = write(fd, buff, len); } while (ret < 0 && errno == EINTR);
69 int fd = open(filename, O_RDONLY);
70 if (fd >= 0) {
71 len = unix_read(fd, buff, buffsize-1);
72 close(fd);
82 int fd;
90 buff->fd = open(path, O_WRONLY|O_CREAT|O_TRUNC, 0755);
107 unix_write( buff->fd, buff->data, buff->count );
117 unix_write( buff->fd, buff->data, buff->count );
161 close_on_exec(int fd)
163 fcntl(fd, F_SETFD, FD_CLOEXEC);
188 int fd, ret, len;
190 fd = open("/proc/uptime",O_RDONLY);
191 if (fd >= 0) {
193 ret = unix_read(fd, buff, 64);
194 close(fd);
217 int fd;
222 fd = open(procfile,O_RDONLY);
223 if (fd >= 0) {
224 close_on_exec(fd);
227 ret = unix_read(fd, buff, sizeof(buff));
235 close(fd);
258 int fd;
266 fd = open(filename,O_RDONLY);
267 if (fd >= 0) {
268 len = unix_read(fd, buff, sizeof(buff)-1);
269 close(fd);
342 int fd = open( LOG_ACCT, O_WRONLY|O_CREAT|O_TRUNC,0644);
343 if (fd >= 0) {
344 close(fd);