/external/e2fsprogs/tests/progs/ |
D | random_exercise.c | 50 int fd; in get_random_fd() local 53 fd = ((int) random()) % MAXFDS; in get_random_fd() 54 if (fd > 2) in get_random_fd() 55 return fd; in get_random_fd() 59 unsigned int get_inode_num(int fd) in get_inode_num() argument 63 if (fstat(fd, &st) < 0) { in get_inode_num() 74 int fd; in create_random_file() local 83 fd = open(template, O_RDONLY, 0600); in create_random_file() 85 template, fd); in create_random_file() 88 fd = open(template, O_CREAT|O_RDWR, 0600); in create_random_file() [all …]
|
/external/qemu/ |
D | iolooper-select.c | 46 iolooper_add_fd( IoLooper* iol, int fd ) in iolooper_add_fd() argument 48 if (iol->max_fd_valid && fd > iol->max_fd) { in iolooper_add_fd() 49 iol->max_fd = fd; in iolooper_add_fd() 54 iolooper_del_fd( IoLooper* iol, int fd ) in iolooper_del_fd() argument 56 if (iol->max_fd_valid && fd == iol->max_fd) in iolooper_del_fd() 61 iolooper_modify( IoLooper* iol, int fd, int oldflags, int newflags ) in iolooper_modify() argument 63 if (fd < 0) in iolooper_modify() 70 iolooper_add_read(iol, fd); in iolooper_modify() 72 iolooper_del_read(iol, fd); in iolooper_modify() 76 iolooper_add_write(iol, fd); in iolooper_modify() [all …]
|
D | loader.c | 56 int fd, size; in get_image_size() local 57 fd = open(filename, O_RDONLY | O_BINARY); in get_image_size() 58 if (fd < 0) in get_image_size() 60 size = lseek(fd, 0, SEEK_END); in get_image_size() 61 close(fd); in get_image_size() 69 int fd, size; in load_image() local 70 fd = open(filename, O_RDONLY | O_BINARY); in load_image() 71 if (fd < 0) in load_image() 73 size = lseek(fd, 0, SEEK_END); in load_image() 74 lseek(fd, 0, SEEK_SET); in load_image() [all …]
|
/external/bluetooth/bluez/compat/ |
D | fakehid.c | 63 static int send_event(int fd, uint16_t type, uint16_t code, int32_t value) in send_event() argument 67 if (fd <= fileno(stderr)) in send_event() 75 return write(fd, &event, sizeof(event)); in send_event() 81 int fd, aux; in uinput_create() local 83 fd = open("/dev/uinput", O_RDWR); in uinput_create() 84 if (fd < 0) { in uinput_create() 85 fd = open("/dev/input/uinput", O_RDWR); in uinput_create() 86 if (fd < 0) { in uinput_create() 87 fd = open("/dev/misc/uinput", O_RDWR); in uinput_create() 88 if (fd < 0) { in uinput_create() [all …]
|
/external/valgrind/main/callgrind/ |
D | command.c | 58 Int fd, size; in setup_control() local 64 fd = -1; in setup_control() 118 fd = -1; in setup_control() 122 fd = (Int) sr_Res(res); in setup_control() 123 if (fd>=0) { in setup_control() 127 WRITE_STR3(fd, in setup_control() 134 VG_(write)(fd, (void*)buf, VG_(strlen)(buf)); in setup_control() 136 WRITE_STR3(fd, "base: ", dir, "\n"); in setup_control() 137 WRITE_STR3(fd, "dumps: ", out_file, "\n"); in setup_control() 138 WRITE_STR3(fd, "control: ", command_file, "\n"); in setup_control() [all …]
|
/external/iproute2/ip/ |
D | tunnel.c | 69 int fd; in tnl_ioctl_get_ifindex() local 73 fd = socket(preferred_family, SOCK_DGRAM, 0); in tnl_ioctl_get_ifindex() 74 err = ioctl(fd, SIOCGIFINDEX, &ifr); in tnl_ioctl_get_ifindex() 79 close(fd); in tnl_ioctl_get_ifindex() 86 int fd; in tnl_ioctl_get_iftype() local 90 fd = socket(preferred_family, SOCK_DGRAM, 0); in tnl_ioctl_get_iftype() 91 err = ioctl(fd, SIOCGIFHWADDR, &ifr); in tnl_ioctl_get_iftype() 96 close(fd); in tnl_ioctl_get_iftype() 104 int fd; in tnl_ioctl_get_ifname() local 108 fd = socket(preferred_family, SOCK_DGRAM, 0); in tnl_ioctl_get_ifname() [all …]
|
/external/qemu/android/ |
D | snapshot.c | 51 read_or_die(int fd, void *buf, size_t nbyte) in read_or_die() argument 55 ret = read(fd, buf, nbyte); in read_or_die() 70 seek_or_die(int fd, off_t offset, int whence) in seek_or_die() argument 72 off_t ret = lseek(fd, offset, whence); in seek_or_die() 117 snapshot_info_read( int fd, SnapshotInfo* info ) in snapshot_info_read() argument 119 uint64_t start_offset = seek_or_die(fd, 0, SEEK_CUR); in snapshot_info_read() 125 seek_or_die(fd, 12, SEEK_CUR); /* skip l1 info */ in snapshot_info_read() 126 read_or_die(fd, &id_str_size, sizeof(id_str_size)); in snapshot_info_read() 127 read_or_die(fd, &name_size, sizeof(name_size)); in snapshot_info_read() 128 read_or_die(fd, &info->date_sec, sizeof(info->date_sec)); in snapshot_info_read() [all …]
|
D | sync-utils.c | 37 int fd; member 41 syncsocket_init(int fd) in syncsocket_init() argument 46 socket_set_nonblock(fd); in syncsocket_init() 48 sync_socket->fd = fd; in syncsocket_init() 54 syncsocket_connect(int fd, SockAddress* sockaddr, int timeout) in syncsocket_connect() argument 60 socket_set_nonblock(fd); in syncsocket_connect() 63 connect_status = socket_connect(fd, sockaddr); in syncsocket_connect() 73 iolooper_add_write(looper, fd); in syncsocket_connect() 76 iolooper_del_write(looper, fd); in syncsocket_connect() 96 sync_socket->fd = fd; in syncsocket_connect() [all …]
|
/external/chromium/net/tools/flip_server/ |
D | epoll_server.cc | 63 void OnEvent(int fd, EpollEvent* event) { in OnEvent() argument 69 data_read = read(fd, &data, sizeof(data)); in OnEvent() 72 void OnShutdown(EpollServer *eps, int fd) {} in OnShutdown() argument 115 int fd = cb_iter->fd; in CleanupFDToCBMap() local 120 cb->OnShutdown(this, fd); in CleanupFDToCBMap() 190 void EpollServer::RegisterFD(int fd, CB* cb, int event_mask) { in RegisterFD() argument 192 VLOG(3) << "RegisterFD fd=" << fd << " event_mask=" << event_mask; in RegisterFD() 193 FDToCBMap::iterator fd_i = cb_map_.find(CBAndEventMask(NULL, 0, fd)); in RegisterFD() 203 other_cb->OnUnregistration(fd, true); in RegisterFD() 204 ModFD(fd, event_mask); in RegisterFD() [all …]
|
D | epoll_server.h | 72 virtual void OnRegistration(EpollServer* eps, int fd, int event_mask) = 0; 81 virtual void OnModification(int fd, int event_mask) = 0; 93 virtual void OnEvent(int fd, EpollEvent* event) = 0; 102 virtual void OnUnregistration(int fd, bool replaced) = 0; 110 virtual void OnShutdown(EpollServer* eps, int fd) = 0; 166 virtual void RegisterFD(int fd, CB* cb, int event_mask); 176 virtual void RegisterFDForWrite(int fd, CB* cb); 186 virtual void RegisterFDForReadWrite(int fd, CB* cb); 196 virtual void RegisterFDForRead(int fd, CB* cb); 208 virtual void UnregisterFD(int fd); [all …]
|
/external/bluetooth/bluez/tools/ |
D | hciattach.c | 66 int (*init) (int fd, struct uart_t *u, struct termios *ti); 67 int (*post) (int fd, struct uart_t *u, struct termios *ti); 143 int set_speed(int fd, struct termios *ti, int speed) in set_speed() argument 151 if (tcsetattr(fd, TCSANOW, ti) < 0) in set_speed() 160 int read_hci_event(int fd, unsigned char* buf, int size) in read_hci_event() argument 171 r = read(fd, buf, 1); in read_hci_event() 181 r = read(fd, buf + count, 3 - count); in read_hci_event() 194 r = read(fd, buf + count, remain - (count - 3)); in read_hci_event() 206 static int ericsson(int fd, struct uart_t *u, struct termios *ti) in ericsson() argument 249 if (write(fd, cmd, 5) != 5) { in ericsson() [all …]
|
D | ppporc.c | 69 static inline int read_n(int fd, char *buf, int len) in read_n() argument 74 if ((w = read(fd, buf, len)) < 0) { in read_n() 90 static inline int write_n(int fd, char *buf, int len) in write_n() argument 95 if ((w = write(fd, buf, len)) < 0) { in write_n() 114 int fd, err; in create_connection() local 116 if ((fd = socket(PF_BLUETOOTH, SOCK_STREAM, BTPROTO_RFCOMM)) < 0) in create_connection() 117 return fd; in create_connection() 122 if ((err = bind(fd, (struct sockaddr *)&local_addr, sizeof(local_addr))) < 0) { in create_connection() 123 close(fd); in create_connection() 131 if ((err = connect(fd, (struct sockaddr *)&remote_addr, sizeof(remote_addr))) < 0) { in create_connection() [all …]
|
/external/qemu/block/ |
D | raw-posix.c | 106 int fd; member 134 int fd, ret; in raw_open_common() local 151 s->fd = -1; in raw_open_common() 152 fd = qemu_open(filename, s->open_flags, 0644); in raw_open_common() 153 if (fd < 0) { in raw_open_common() 159 s->fd = fd; in raw_open_common() 197 close(fd); in raw_open_common() 243 ret = pread(s->fd, buf, count, offset); in raw_pread_aligned() 258 s->fd, bs->filename, offset, buf, count, in raw_pread_aligned() 263 ret = pread(s->fd, buf, count, offset); in raw_pread_aligned() [all …]
|
/external/zlib/examples/ |
D | gzlog.c | 291 int fd; /* file descriptor for .gz file, opened read/write */ member 350 int fd; in log_lock() local 354 while ((fd = open(log->path, O_CREAT | O_EXCL, 0644)) < 0) { in log_lock() 363 close(fd); in log_lock() 415 if (lseek(log->fd, 0, SEEK_SET) < 0 || in log_head() 416 read(log->fd, buf, HEAD + EXTRA) != HEAD + EXTRA || in log_head() 450 fsync(log->fd); in log_mark() 451 ret = lseek(log->fd, HEAD, SEEK_SET) < 0 || in log_mark() 452 write(log->fd, ext, EXTRA) != EXTRA ? -1 : 0; in log_mark() 453 fsync(log->fd); in log_mark() [all …]
|
/external/bluetooth/bluez/src/ |
D | textfile.c | 83 int fd; in create_file() local 89 fd = open(filename, O_RDWR | O_CREAT, mode); in create_file() 90 if (fd < 0) in create_file() 91 return fd; in create_file() 93 close(fd); in create_file() 141 static inline int write_key_value(int fd, const char *key, const char *value) in write_key_value() argument 155 if (write(fd, str, size) < 0) in write_key_value() 191 int fd, len, err = 0; in write_key() local 193 fd = open(pathname, O_RDWR); in write_key() 194 if (fd < 0) in write_key() [all …]
|
/external/dbus/dbus/ |
D | dbus-file-unix.c | 59 int fd; in _dbus_file_get_contents() local 70 fd = open (filename_c, O_RDONLY | O_BINARY); in _dbus_file_get_contents() 71 if (fd < 0) in _dbus_file_get_contents() 80 _dbus_verbose ("file fd %d opened\n", fd); in _dbus_file_get_contents() 82 if (fstat (fd, &sb) < 0) in _dbus_file_get_contents() 92 _dbus_close (fd, NULL); in _dbus_file_get_contents() 102 _dbus_close (fd, NULL); in _dbus_file_get_contents() 114 bytes_read = _dbus_read (fd, str, in _dbus_file_get_contents() 126 _dbus_close (fd, NULL); in _dbus_file_get_contents() 134 _dbus_close (fd, NULL); in _dbus_file_get_contents() [all …]
|
/external/bluetooth/bluez/test/ |
D | attest.c | 41 static int at_command(int fd, char *cmd, int to) in at_command() argument 48 len = write(fd, cmd, strlen(cmd)); in at_command() 53 FD_SET(fd, &rfds); in at_command() 58 if ((sel = select(fd + 1, &rfds, NULL, NULL, &timeout)) > 0) { in at_command() 60 if (FD_ISSET(fd, &rfds)) { in at_command() 62 len = read(fd, buf, sizeof(buf)); in at_command() 83 int fd; in open_device() local 85 fd = open(device, O_RDWR | O_NOCTTY | O_NONBLOCK); in open_device() 86 if (fd < 0) { in open_device() 92 tcflush(fd, TCIOFLUSH); in open_device() [all …]
|
/external/dhcpcd/ |
D | control.c | 45 static int fd = -1; variable 59 close(l->fd); in remove_control_data() 60 delete_event(l->fd); in remove_control_data() 81 bytes = read(l->fd, buffer, sizeof(buffer) - 1); in handle_control_data() 109 if ((f = accept(fd, (struct sockaddr *)&run, &len)) == -1) in handle_control() 112 l->fd = f; in handle_control() 116 add_event(l->fd, handle_control_data, l); in handle_control() 122 if ((fd = socket(AF_UNIX, SOCK_STREAM, 0)) == -1) in make_sock() 138 if (bind(fd, (struct sockaddr *)&sun, len) == -1 || in start_control() 141 set_cloexec(fd) == -1 || in start_control() [all …]
|
D | bpf.c | 54 int fd = -1; in open_socket() local 64 fd = open(_PATH_BPF, O_RDWR | O_NONBLOCK); in open_socket() 72 fd = open(device, O_RDWR | O_NONBLOCK); in open_socket() 73 } while (fd == -1 && errno == EBUSY); in open_socket() 77 if (fd == -1) in open_socket() 80 if (ioctl(fd, BIOCVERSION, &pv) == -1) in open_socket() 90 if (ioctl(fd, BIOCSETIF, &ifr) == -1) in open_socket() 94 if (ioctl(fd, BIOCGBLEN, &buf_len) == -1) in open_socket() 105 if (ioctl(fd, BIOCIMMEDIATE, &flags) == -1) in open_socket() 119 if (ioctl(fd, BIOCSETF, &pf) == -1) in open_socket() [all …]
|
/external/e2fsprogs/lib/blkid/ |
D | getsize.c | 61 static int valid_offset(int fd, blkid_loff_t offset) in valid_offset() argument 65 if (blkid_llseek(fd, offset, 0) < 0) in valid_offset() 67 if (read(fd, &ch, 1) < 1) in valid_offset() 75 blkid_loff_t blkid_get_dev_size(int fd) in blkid_get_dev_size() argument 96 if (ioctl(fd, DKIOCGETBLOCKCOUNT, &size64) >= 0) { in blkid_get_dev_size() 112 ioctl(fd, BLKGETSIZE64, &size64) >= 0) { in blkid_get_dev_size() 121 if (ioctl(fd, BLKGETSIZE, &size) >= 0) in blkid_get_dev_size() 127 if (ioctl(fd, DIOCGMEDIASIZE, &size64) >= 0) in blkid_get_dev_size() 132 if (ioctl(fd, FDGETPRM, &this_floppy) >= 0) in blkid_get_dev_size() 145 if ((fstat(fd, &st) >= 0) && (S_ISBLK(st.st_mode) || S_ISCHR(st.st_mode))) in blkid_get_dev_size() [all …]
|
/external/e2fsprogs/e2fsck/ |
D | rehash.c | 87 struct fill_dir_struct *fd = (struct fill_dir_struct *) priv_data; in fill_dir_block() local 98 if (offset + fs->blocksize > fd->inode->i_size) { in fill_dir_block() 99 fd->err = EXT2_ET_DIR_CORRUPTED; in fill_dir_block() 102 dir = (fd->buf+offset); in fill_dir_block() 108 fd->err = ext2fs_read_dir_block(fs, *block_nr, dir); in fill_dir_block() 109 if (fd->err) in fill_dir_block() 125 fd->err = EXT2_ET_DIR_CORRUPTED; in fill_dir_block() 131 if (!fd->compress && ((dirent->name_len&0xFF) == 1) && in fill_dir_block() 134 if (!fd->compress && ((dirent->name_len&0xFF) == 2) && in fill_dir_block() 136 fd->parent = dirent->inode; in fill_dir_block() [all …]
|
/external/sonivox/arm-wt-22k/host_src/ |
D | eas_hostmm.c | 92 int fd; member 125 file->fd = -1; in EAS_HWInit() 241 int fd; in EAS_HWOpenFile() local 256 if (file->fd < 0) in EAS_HWOpenFile() 260 if ((fd = open(locator->path, O_RDONLY)) < 0) { in EAS_HWOpenFile() 265 fd = dup(locator->fd); in EAS_HWOpenFile() 270 if (lseek(fd, 0, SEEK_END) < 0) { in EAS_HWOpenFile() 271 close(fd); in EAS_HWOpenFile() 274 if ((file->fileSize = lseek(fd, 0, SEEK_CUR)) == -1L) { in EAS_HWOpenFile() 275 close(fd); in EAS_HWOpenFile() [all …]
|
/external/qemu/distrib/sdl-1.2.12/src/video/fbcon/ |
D | SDL_fbelo.c | 134 int eloGetPacket(unsigned char* buffer, int* buffer_p, int* checksum, int fd) { in eloGetPacket() argument 138 if(fd == 0) { in eloGetPacket() 142 num_bytes = read(fd, in eloGetPacket() 187 int eloSendPacket(unsigned char* packet, int fd) in eloSendPacket() argument 199 result = write(fd, packet, ELO_PACKET_SIZE); in eloSendPacket() 215 int eloWaitForInput(int fd, int timeout) in eloWaitForInput() argument 222 FD_SET(fd, &readfds); in eloWaitForInput() 232 int eloWaitReply(unsigned char type, unsigned char *reply, int fd) { in eloWaitReply() argument 242 result = eloWaitForInput(fd, ELO_MAX_WAIT); in eloWaitReply() 245 ok = eloGetPacket(reply, &reply_p, &sum, fd); in eloWaitReply() [all …]
|
/external/dropbear/ |
D | svr-x11fwd.c | 41 static int bindport(int fd); 42 static int send_msg_channel_open_x11(int fd, struct sockaddr_in* addr); 48 int fd; in x11req() local 61 fd = socket(PF_INET, SOCK_STREAM, 0); in x11req() 62 if (fd < 0) { in x11req() 67 chansess->x11port = bindport(fd); in x11req() 73 if (listen(fd, 20) < 0) { in x11req() 78 setnonblocking(fd); in x11req() 83 chansess->x11listener = new_listener( &fd, 1, 0, chansess, x11accept, NULL); in x11req() 94 close(fd); in x11req() [all …]
|
/external/ipsec-tools/src/racoon/ |
D | session.c | 104 int (*callback)(void *ctx, int fd); 107 int fd; member 130 monitor_fd(int fd, int (*callback)(void *, int), void *ctx, int priority) in monitor_fd() argument 132 if (fd < 0 || fd >= FD_SETSIZE) { in monitor_fd() 137 FD_SET(fd, &preset_mask); in monitor_fd() 138 if (fd > nfds) in monitor_fd() 139 nfds = fd; in monitor_fd() 145 fd_monitors[fd].callback = callback; in monitor_fd() 146 fd_monitors[fd].ctx = ctx; in monitor_fd() 147 fd_monitors[fd].prio = priority; in monitor_fd() [all …]
|