Lines Matching refs:fd
47 int count, fd;
49 fd = open(fname, O_RDONLY);
50 if(fd < 0) {
55 count = read_attribute_sensor(fd, buf, sizeof(buf));
57 close(fd);
64 close(fd);
70 int read_attribute_sensor(int fd, char* data, unsigned int size)
75 if (fd > 0) {
76 count = pread(fd, data, size, 0);
87 * @note this function one closes FD after the write
88 * @param fd
94 int enable_sysfs_sensor(int fd, int en)
102 nb = write(fd, &c, 1);
109 close(fd);
116 int write_attribute_sensor(int fd, long data)
122 if (fd >= 0) {
125 num_b = write(fd, buf, strlen(buf) + 1);
128 LOGE("HAL:write fd %d returned '%s' (%d)", fd, strerror(err), err);
130 LOGV_IF(EXTRA_VERBOSE, "HAL:fd=%d write attribute to %ld", fd, data);
132 close(fd);