Rev 5369 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 5369 | Rev 9952 | ||
---|---|---|---|
Line 13... | Line 13... | ||
13 | * they apply. |
13 | * they apply. |
14 | */ |
14 | */ |
15 | #include |
15 | #include |
16 | #include |
16 | #include |
17 | #include |
17 | #include |
18 | #include |
18 | #include |
19 | #include |
19 | #include |
20 | #include "glue.h" |
20 | #include "glue.h" |
21 | #include "io.h" |
21 | #include "io.h" |
Line 22... | Line 22... | ||
22 | 22 | ||
23 | int |
23 | int |
24 | _DEFUN (fstat, (fd, buf), |
24 | _DEFUN (fstat, (fd, buf), |
25 | int fd _AND |
25 | int fd _AND |
26 | struct stat *buf) |
26 | struct stat *buf) |
27 | { |
27 | { |
28 | fileinfo_t info; |
28 | ksys_file_info_t info; |
Line 29... | Line 29... | ||
29 | struct tm time; |
29 | struct tm time; |
Line 30... | Line 30... | ||
30 | 30 | ||
31 | __io_handle *ioh; |
31 | __io_handle *ioh; |
32 | 32 | ||
33 | if( (fd < 0) || (fd >=64) ) |
33 | if( (fd < 0) || (fd >=64) ) |
34 | { |
34 | { |
Line 35... | Line 35... | ||
35 | errno = EBADF; |
35 | errno = EBADF; |
Line 36... | Line 36... | ||
36 | return (-1); |
36 | return -1; |
37 | }; |
37 | } |
Line 45... | Line 45... | ||
45 | } |
45 | } |
46 | else |
46 | else |
47 | { |
47 | { |
Line 48... | Line 48... | ||
48 | 48 | ||
49 | ioh = &__io_tab[fd]; |
49 | ioh = &__io_tab[fd]; |
Line 50... | Line 50... | ||
50 | get_fileinfo(ioh->name, &info); |
50 | _ksys_file_info(ioh->name, &info); |
51 | 51 | ||
52 | if (info.attr & 0x10) |
52 | if (info.attr & 0x10) |
53 | buf->st_mode = S_IFDIR; |
53 | buf->st_mode = S_IFDIR; |