Lines Matching refs:fd
111 NativeConnection(int fd, int32_t maxPointers);
117 NativeConnection::NativeConnection(int fd, int32_t maxPointers) :
118 mFd(fd), mMaxPointers(maxPointers) {
132 int fd = ::open("/dev/uinput", O_WRONLY | O_NDELAY);
133 if (fd < 0) {
148 ioctl(fd, UI_SET_PHYS, uniqueId);
151 ioctl(fd, UI_SET_EVBIT, EV_KEY);
153 ioctl(fd, UI_SET_KEYBIT, KEYS[i].linuxKeyCode);
157 ioctl(fd, UI_SET_EVBIT, EV_MSC);
158 ioctl(fd, UI_SET_MSCBIT, MSC_ANDROID_TIME_SEC);
159 ioctl(fd, UI_SET_MSCBIT, MSC_ANDROID_TIME_USEC);
162 if (write(fd, &uinp, sizeof(uinp)) != sizeof(uinp)) {
163 ALOGE("Cannot write uinput_user_dev to fd %d: %s.", fd, strerror(errno));
164 close(fd);
167 if (ioctl(fd, UI_DEV_CREATE) != 0) {
169 close(fd);
173 ALOGV("Created uinput device, fd=%d.", fd);
174 return new NativeConnection(fd, maxPointers);