/Documentation/timers/ |
D | hpet_example.c | 81 int fd; in hpet_open_close() local 88 fd = open(argv[0], O_RDONLY); in hpet_open_close() 89 if (fd < 0) in hpet_open_close() 92 close(fd); in hpet_open_close() 101 int fd; in hpet_info() local 108 fd = open(argv[0], O_RDONLY); in hpet_info() 109 if (fd < 0) { in hpet_info() 114 if (ioctl(fd, HPET_INFO, &info) < 0) { in hpet_info() 125 close(fd); in hpet_info() 133 int iterations, i, fd; in hpet_poll() local [all …]
|
/Documentation/usb/ |
D | gadget_printer.txt | 195 struct pollfd fd[1]; 198 fd[0].fd = open(PRINTER_FILE, O_RDWR); 199 if (fd[0].fd < 0) { 200 printf("Error %d opening %s\n", fd[0].fd, PRINTER_FILE); 201 close(fd[0].fd); 205 fd[0].events = POLLIN | POLLRDNORM; 213 retval = poll(fd, 1, 1000); 215 if (retval && (fd[0].revents & POLLRDNORM)) { 218 bytes_read = read(fd[0].fd, buf, BUF_SIZE); 222 fd[0].fd, PRINTER_FILE); [all …]
|
/Documentation/spi/ |
D | spidev_fdx.c | 17 static void do_read(int fd, int len) in do_read() argument 29 status = read(fd, buf, len); in do_read() 48 static void do_msg(int fd, int len) in do_msg() argument 67 status = ioctl(fd, SPI_IOC_MESSAGE(2), xfer); in do_msg() 79 static void dumpstat(const char *name, int fd) in dumpstat() argument 84 if (ioctl(fd, SPI_IOC_RD_MODE, &mode) < 0) { in dumpstat() 88 if (ioctl(fd, SPI_IOC_RD_LSB_FIRST, &lsb) < 0) { in dumpstat() 92 if (ioctl(fd, SPI_IOC_RD_BITS_PER_WORD, &bits) < 0) { in dumpstat() 96 if (ioctl(fd, SPI_IOC_RD_MAX_SPEED_HZ, &speed) < 0) { in dumpstat() 110 int fd; in main() local [all …]
|
D | spidev_test.c | 38 static void transfer(int fd) in transfer() argument 60 ret = ioctl(fd, SPI_IOC_MESSAGE(1), &tr); in transfer() 160 int fd; in main() local 164 fd = open(device, O_RDWR); in main() 165 if (fd < 0) in main() 171 ret = ioctl(fd, SPI_IOC_WR_MODE, &mode); in main() 175 ret = ioctl(fd, SPI_IOC_RD_MODE, &mode); in main() 182 ret = ioctl(fd, SPI_IOC_WR_BITS_PER_WORD, &bits); in main() 186 ret = ioctl(fd, SPI_IOC_RD_BITS_PER_WORD, &bits); in main() 193 ret = ioctl(fd, SPI_IOC_WR_MAX_SPEED_HZ, &speed); in main() [all …]
|
/Documentation/laptops/ |
D | hpfall.c | 38 int fd = open(unload_heads_path, O_RDONLY); in valid_disk() local 39 if (fd < 0) { in valid_disk() 44 close(fd); in valid_disk() 51 int fd = open(path, O_RDWR); in write_int() local 52 if (fd < 0) { in write_int() 57 if (write(fd, buf, strlen(buf)) != strlen(buf)) { in write_int() 61 close(fd); in write_int() 92 int fd, ret; in main() local 108 fd = open("/dev/freefall", O_RDONLY); in main() 109 if (fd < 0) { in main() [all …]
|
D | dslm.c | 29 static int check_powermode(int fd) in check_powermode() argument 34 if (ioctl(fd, HDIO_DRIVE_CMD, &args) in check_powermode() 36 && ioctl(fd, HDIO_DRIVE_CMD, &args)) { in check_powermode() 66 static void measure(int fd) in measure() argument 83 last_state = check_powermode(fd); in measure() 89 curr_state = check_powermode(fd); in measure() 134 int fd; in main() local 147 if (!(fd = open(disk, O_RDONLY|O_NONBLOCK))) { in main() 161 measure(fd); in main() 163 close(fd); in main()
|
/Documentation/watchdog/src/ |
D | watchdog-test.c | 15 int fd; variable 26 ioctl(fd, WDIOC_KEEPALIVE, &dummy); in keep_alive() 36 close(fd); in term() 45 fd = open("/dev/watchdog", O_WRONLY); in main() 47 if (fd == -1) { in main() 56 ioctl(fd, WDIOC_SETOPTIONS, &flags); in main() 62 ioctl(fd, WDIOC_SETOPTIONS, &flags); in main() 84 close(fd); in main()
|
D | watchdog-simple.c | 8 int fd = open("/dev/watchdog", O_WRONLY); in main() local 10 if (fd == -1) { in main() 15 ret = write(fd, "\0", 1); in main() 22 close(fd); in main()
|
/Documentation/ptp/ |
D | testptp.c | 55 static clockid_t get_clockid(int fd) in get_clockid() argument 58 #define FD_TO_CLOCKID(fd) ((~(clockid_t) (fd) << 3) | CLOCKFD) in get_clockid() argument 60 return FD_TO_CLOCKID(fd); in get_clockid() 137 int c, cnt, fd; in main() local 202 fd = open(device, O_RDWR); in main() 203 if (fd < 0) { in main() 208 clkid = get_clockid(fd); in main() 215 if (ioctl(fd, PTP_CLOCK_GETCAPS, &caps)) { in main() 286 if (ioctl(fd, PTP_EXTTS_REQUEST, &extts_request)) { in main() 293 cnt = read(fd, &event, sizeof(event)); in main() [all …]
|
/Documentation/ia64/ |
D | aliasing-test.c | 29 int fd, rc; in map_mem() local 33 fd = open(path, O_RDWR); in map_mem() 34 if (fd == -1) { in map_mem() 40 rc = ioctl(fd, PCIIOC_MMAP_IS_MEM); in map_mem() 45 addr = mmap(NULL, length, PROT_READ|PROT_WRITE, MAP_SHARED, fd, offset); in map_mem() 61 close(fd); in map_mem() 124 int fd, rc; in read_rom() local 127 fd = open(path, O_RDWR); in read_rom() 128 if (fd == -1) { in read_rom() 133 rc = write(fd, "1", 2); in read_rom() [all …]
|
/Documentation/ioctl/ |
D | cdrom.txt | 101 ioctl(fd, CDROMPAUSE, 0); 115 ioctl(fd, CDROMRESUME, 0); 130 ioctl(fd, CDROMPLAYMSF, &msf); 154 ioctl(fd, CDROMPLAYTRKIND, &ti); 175 ioctl(fd, CDROMREADTOCHDR, &header); 193 ioctl(fd, CDROMREADTOCENTRY, &entry); 218 ioctl(fd, CDROMSTOP, 0); 236 ioctl(fd, CDROMSTART, 0); 255 ioctl(fd, CDROMEJECT, 0); 274 ioctl(fd, CDROMCLOSETRAY, 0); [all …]
|
D | hdio.txt | 90 ioctl(fd, HDIO_GETGEO, &geom); 136 ioctl(fd, HDIO_GET_UNMASKINTR, &val); 150 ioctl(fd, HDIO_SET_UNMASKINTR, val); 171 ioctl(fd, HDIO_GET_MULTCOUNT, &val); 187 ioctl(fd, HDIO_SET_MULTCOUNT, val); 239 ioctl(fd, HDIO_GET_IDENTITY, identity); 269 ioctl(fd, HDIO_GET_KEEPSETTINGS, &val); 288 ioctl(fd, HDIO_SET_KEEPSETTINGS, val); 308 ioctl(fd, HDIO_GET_32BIT, &val); 326 ioctl(fd, HDIO_GET_NOWERR, &val); [all …]
|
/Documentation/accounting/ |
D | getdelays.c | 90 int fd; in create_nl_socket() local 93 fd = socket(AF_NETLINK, SOCK_RAW, protocol); in create_nl_socket() 94 if (fd < 0) in create_nl_socket() 98 if (setsockopt(fd, SOL_SOCKET, SO_RCVBUF, in create_nl_socket() 108 if (bind(fd, (struct sockaddr *) &local, sizeof(local)) < 0) in create_nl_socket() 111 return fd; in create_nl_socket() 113 close(fd); in create_nl_socket() 268 int fd = 0; in main() local 369 fd = open(logfile, O_WRONLY | O_CREAT | O_TRUNC, in main() 371 if (fd == -1) { in main() [all …]
|
/Documentation/filesystems/ |
D | inotify.txt | 16 int fd = inotify_init (); 31 int wd = inotify_add_watch (fd, path, mask); 33 Where "fd" is the return value from inotify_init(), path is the path to the 40 int ret = inotify_rm_watch (fd, wd); 49 size_t len = read (fd, buf, BUF_LEN); 55 Each inotify instance fd is also select()- and poll()-able. 58 ioctl on the fd returned by inotify_init(). 68 int inotify_add_watch (int fd, const char *path, __u32 mask); 69 int inotify_rm_watch (int fd, __u32 mask); 203 Q: What is the design decision behind not tying the watch to the open fd of [all …]
|
D | files.txt | 14 a put_files_struct() frees the file descriptor (fd) table. 21 elements - the fd sets (open_fds and close_on_exec, the 27 which the actual fd table is accessed. Initially the 58 3. For any update to the fd table, files->file_lock must 61 4. To look up the file structure given an fd, a reader 69 file = fcheck(fd); 77 of the fd (fget()/fget_light()) are lock-free, it is possible 83 file = fcheck_files(files, fd); 112 fd = locate_fd(files, file, start); 113 if (fd >= 0) { [all …]
|
D | dnotify_test.c | 18 int fd; in main() local 25 fd = open(".", O_RDONLY); in main() 26 fcntl(fd, F_SETSIG, SIGRTMIN + 1); in main() 27 fcntl(fd, F_NOTIFY, DN_MODIFY|DN_CREATE|DN_MULTISHOT); in main()
|
/Documentation/arm/SH-Mobile/ |
D | vrl4.c | 80 ssize_t do_read(int fd, void *buf, size_t count) in do_read() argument 86 l = read(fd, buf + offset, count - offset); in do_read() 101 ssize_t do_write(int fd, const void *buf, size_t count) in do_write() argument 107 l = write(fd, buf + offset, count - offset); in do_write() 120 ssize_t write_zero(int fd, size_t len) in write_zero() argument 126 if (do_write(fd, &x, 1) < 0) in write_zero()
|
/Documentation/misc-devices/mei/ |
D | mei-amt-version.c | 98 int fd; member 103 if (cl->fd != -1) in mei_deinit() 104 close(cl->fd); in mei_deinit() 105 cl->fd = -1; in mei_deinit() 122 me->fd = open("/dev/mei", O_RDWR); in mei_init() 123 if (me->fd == -1) { in mei_init() 132 result = ioctl(me->fd, IOCTL_MEI_CONNECT_CLIENT, &data); in mei_init() 163 rc = read(me->fd, buffer, len); in mei_recv_msg() 187 written = write(me->fd, buffer, len); in mei_send_msg() 196 FD_SET(me->fd, &set); in mei_send_msg() [all …]
|
/Documentation/networking/ |
D | packet_mmap.txt | 90 int fd = socket(PF_PACKET, mode, htons(ETH_P_ALL)); 99 is done by a simple call to close(fd). 184 setsockopt(fd, SOL_PACKET, PACKET_RX_RING, (void *) &req, sizeof(req)) 186 setsockopt(fd, SOL_PACKET, PACKET_TX_RING, (void *) &req, sizeof(req)) 399 mmap(0, size, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0); 457 pfd.fd = fd; 492 pfd.fd = fd; 502 setsockopt(fd, SOL_PACKET, PACKET_VERSION, &val, sizeof(val)); 503 getsockopt(fd, SOL_PACKET, PACKET_VERSION, &val, sizeof(val)); 578 int err, fd = socket(AF_PACKET, SOCK_RAW, htons(ETH_P_IP)); [all …]
|
D | tuntap.txt | 78 int fd, err; 80 if( (fd = open("/dev/net/tun", O_RDWR)) < 0 ) 94 if( (err = ioctl(fd, TUNSETIFF, (void *) &ifr)) < 0 ){ 95 close(fd); 99 return fd; 127 int fd, err, i; 143 if ((fd = open("/dev/net/tun", O_RDWR)) < 0) 145 err = ioctl(fd, TUNSETIFF, (void *)&ifr); 147 close(fd); 150 fds[i] = fd; [all …]
|
D | phonet.txt | 100 int fd; 102 fd = socket(PF_PHONET, SOCK_DGRAM, 0); 103 bind(fd, (struct sockaddr *)&addr, sizeof(addr)); 106 sendto(fd, msg, msglen, 0, (struct sockaddr *)&addr, sizeof(addr)); 107 len = recvfrom(fd, buf, sizeof(buf), 0, 122 ioctl(fd, SIOCPNADDRESOURCE, &res); 167 int fd; 169 fd = socket(PF_PHONET, SOCK_SEQPACKET, PN_PROTO_PIPE); 175 connect(fd, (struct sockaddr *)&spn, sizeof(spn)); 177 close(fd);
|
/Documentation/misc-devices/ |
D | max6875 | 70 i2c_smbus_write_byte_data(fd, 0x45, 1); 73 value = i2c_smbus_read_byte_data(fd, 0x45); 88 i2c_smbus_write_word_data(fd, 0x80, 0x5a03); 97 i2c_smbus_write_byte_data(fd, 0x81, 0x00); 100 value = i2c_smbus_read_byte(fd); 104 count = i2c_smbus_read_i2c_block_data(fd, 0x84, 16, buffer);
|
/Documentation/ |
D | rtc.txt | 245 int i, fd, retval, irqcount = 0; 261 fd = open(rtc, O_RDONLY); 263 if (fd == -1) { 271 retval = ioctl(fd, RTC_UIE_ON, 0); 287 retval = read(fd, &data, sizeof(unsigned long)); 304 FD_SET(fd, &readfds); 306 retval = select(fd+1, &readfds, NULL, NULL, &tv); 312 retval = read(fd, &data, sizeof(unsigned long)); 323 retval = ioctl(fd, RTC_UIE_OFF, 0); 331 retval = ioctl(fd, RTC_RD_TIME, &rtc_tm); [all …]
|
/Documentation/sound/oss/ |
D | MultiSound | 483 X int fd; 491 X if ((fd = open(argv[1], O_RDWR)) < 0) { 496 X if (ioctl(fd, SOUND_MIXER_READ_RECMASK, &recmask) < 0) { 499 X close(fd); 505 X close(fd); 509 X if (ioctl(fd, SOUND_MIXER_READ_RECSRC, &recsrc) < 0) { 512 X close(fd); 518 X if (ioctl(fd, SOUND_MIXER_WRITE_RECSRC, &recsrc) < 0) { 521 X close(fd); 525 X close(fd); [all …]
|
/Documentation/watchdog/ |
D | watchdog-api.txt | 79 ioctl(fd, WDIOC_KEEPALIVE, 0); 95 ioctl(fd, WDIOC_SETTIMEOUT, &timeout); 104 ioctl(fd, WDIOC_GETTIMEOUT, &timeout); 116 ioctl(fd, WDIOC_SETPRETIMEOUT, &pretimeout); 126 ioctl(fd, WDIOC_GETPRETIMEOUT, &timeout); 137 ioctl(fd, WDIOC_GETTIMELEFT, &timeleft); 148 ioctl(fd, WDIOC_GETSUPPORT, &ident); 209 ioctl(fd, WDIOC_GETSTATUS, &flags); 213 ioctl(fd, WDIOC_GETBOOTSTATUS, &flags); 222 ioctl(fd, WDIOC_GETTEMP, &temperature); [all …]
|