OpenCoverage

input_avail.c

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/bash/src/lib/sh/input_avail.c
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6-
7-
8-
9-
10-
11-
12-
13-
14-
15int-
16input_avail (fd)-
17 int fd;-
18{-
19 int result, chars_avail;-
20-
21 fd_set readfds, exceptfds;-
22 struct timeval timeout;-
23-
24-
25 if (fd < 0
fd < 0Description
TRUEnever evaluated
FALSEevaluated 3 times by 1 test
Evaluated by:
  • Self test
)
0-3
26 return
never executed: return -1;
-1;
never executed: return -1;
0
27-
28 chars_avail = 0;-
29-
30-
31 -
32 do { int __d0, __d1; __asm__ __volatile__ ("cld; rep; " "stosq" : "=c" (__d0), "=D" (__d1) : "a" (0), "0" (sizeof (fd_set) / sizeof (__fd_mask)), "1" (&((-
33 &readfds-
34 )->fds_bits)[0]) : "memory"); } while (0)-
35 ;-
36 -
37 do { int __d0, __d1; __asm__ __volatile__ ("cld; rep; " "stosq" : "=c" (__d0), "=D" (__d1) : "a" (0), "0" (sizeof (fd_set) / sizeof (__fd_mask)), "1" (&((-
38 &exceptfds-
39 )->fds_bits)[0]) : "memory"); } while (0)-
40 ;-
41 -
42 ((void) (((-
43 &readfds-
44 )->fds_bits)[((-
45 fd-
46 ) / (8 * (int) sizeof (__fd_mask)))] |= ((__fd_mask) (1UL << ((-
47 fd-
48 ) % (8 * (int) sizeof (__fd_mask)))))))-
49 ;-
50 -
51 ((void) (((-
52 &exceptfds-
53 )->fds_bits)[((-
54 fd-
55 ) / (8 * (int) sizeof (__fd_mask)))] |= ((__fd_mask) (1UL << ((-
56 fd-
57 ) % (8 * (int) sizeof (__fd_mask)))))))-
58 ;-
59 timeout.tv_sec = 0;-
60 timeout.tv_usec = 0;-
61 result = select (fd + 1, &readfds, (fd_set *)-
62 ((void *)0)-
63 , &exceptfds, &timeout);-
64 return
executed 3 times by 1 test: return ((result <= 0) ? 0 : 1);
Executed by:
  • Self test
((result <= 0) ? 0 : 1);
executed 3 times by 1 test: return ((result <= 0) ? 0 : 1);
Executed by:
  • Self test
3
65-
66-
67-
68 result = -1;
dead code: result = -1;
-
69-
70 -
71 (*
dead code: (*__errno_location ()) = 0;
__errno_location ())
dead code: (*__errno_location ()) = 0;
-
72 = 0;
dead code: (*__errno_location ()) = 0;
-
73 result = ioctl (fd,
dead code: result = ioctl (fd, 0x541B , &chars_avail);
-
74 0x541B
dead code: result = ioctl (fd, 0x541B , &chars_avail);
-
75 , &chars_avail);
dead code: result = ioctl (fd, 0x541B , &chars_avail);
-
76 if
dead code: if (result == -1 && (*__errno_location ()) == 5 ) return -1;
(result == -1 &&
dead code: if (result == -1 && (*__errno_location ()) == 5 ) return -1;
-
77 (*__errno_location ())
dead code: if (result == -1 && (*__errno_location ()) == 5 ) return -1;
-
78 ==
dead code: if (result == -1 && (*__errno_location ()) == 5 ) return -1;
-
79 5
dead code: if (result == -1 && (*__errno_location ()) == 5 ) return -1;
-
80 )
dead code: if (result == -1 && (*__errno_location ()) == 5 ) return -1;
-
81 return -1;
dead code: if (result == -1 && (*__errno_location ()) == 5 ) return -1;
-
82 return
dead code: return (chars_avail);
(chars_avail);
dead code: return (chars_avail);
-
83-
84-
85 return
dead code: return 0;
0;
dead code: return 0;
-
86}-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.1.2