Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
riscv-gcc-1
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
riscv-gcc-1
Commits
5ea0705a
Commit
5ea0705a
authored
Jun 11, 2011
by
Janne Blomqvist
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Figure out whether a file is seekable with lseek()
From-SVN: r174946
parent
ba94c7af
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
6 deletions
+11
-6
libgfortran/ChangeLog
+5
-0
libgfortran/io/unix.c
+6
-6
No files found.
libgfortran/ChangeLog
View file @
5ea0705a
2011-06-11 Janne Blomqvist <jb@gcc.gnu.org>
* io/unix.c (fd_to_stream): Figure out if a fd is seekable by
trying lseek().
2011-06-10 Daniel Carrera <dcarrera@gmail.com>
* caf/mpi.c (_gfortran_caf_sync_all,
...
...
libgfortran/io/unix.c
View file @
5ea0705a
...
...
@@ -952,15 +952,15 @@ fd_to_stream (int fd)
if
(
S_ISREG
(
statbuf
.
st_mode
))
s
->
file_length
=
statbuf
.
st_size
;
else
if
(
S_ISBLK
(
statbuf
.
st_mode
))
else
{
/* Hopefully more portable than ioctl(fd, BLKGETSIZE64, &size)? */
gfc_offset
cur
=
lseek
(
fd
,
0
,
SEEK_CUR
);
/* Some character special files are seekable but most are not,
so figure it out by trying to seek. On Linux, /dev/null is
an example of such a special file. */
s
->
file_length
=
lseek
(
fd
,
0
,
SEEK_END
);
lseek
(
fd
,
cur
,
SEEK_SET
);
if
(
s
->
file_length
>
0
)
lseek
(
fd
,
0
,
SEEK_SET
);
}
else
s
->
file_length
=
-
1
;
if
(
!
(
S_ISREG
(
statbuf
.
st_mode
)
||
S_ISBLK
(
statbuf
.
st_mode
))
||
options
.
all_unbuffered
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment