diff options
author | Gary Benson <gbenson@redhat.com> | 2015-04-02 13:38:28 +0100 |
---|---|---|
committer | Gary Benson <gbenson@redhat.com> | 2015-04-02 13:38:28 +0100 |
commit | 9b15c1f0419ae693fdcf6cca399e9a916e14c48e (patch) | |
tree | 9e17d419e6ef53e2a22b4e993b71d8af96382186 /gdb/target.h | |
parent | 3d5ff6205b2e62388280661769cc0555a58a1358 (diff) | |
download | gdb-9b15c1f0419ae693fdcf6cca399e9a916e14c48e.zip gdb-9b15c1f0419ae693fdcf6cca399e9a916e14c48e.tar.gz gdb-9b15c1f0419ae693fdcf6cca399e9a916e14c48e.tar.bz2 |
Introduce target_fileio_fstat
This commit introduces a new target method target_fileio_fstat
which can be used to retrieve information about files opened with
target_fileio_open.
gdb/ChangeLog:
* target.h (struct target_ops) <to_fileio_fstat>: New field.
(target_fileio_fstat): New declaration.
* target.c (target_fileio_fstat): New function.
* inf-child.c (inf_child_fileio_fstat): Likewise.
(inf_child_target): Initialize to_fileio_fstat.
* remote.c (init_remote_ops): Likewise.
Diffstat (limited to 'gdb/target.h')
-rw-r--r-- | gdb/target.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/gdb/target.h b/gdb/target.h index 19254d6..c4440ce 100644 --- a/gdb/target.h +++ b/gdb/target.h @@ -846,6 +846,12 @@ struct target_ops int fd, gdb_byte *read_buf, int len, ULONGEST offset, int *target_errno); + /* Get information about the file opened as FD and put it in + SB. Return 0 on success, or -1 if an error occurs (and set + *TARGET_ERRNO). */ + int (*to_fileio_fstat) (struct target_ops *, + int fd, struct stat *sb, int *target_errno); + /* Close FD on the target. Return 0, or -1 if an error occurs (and set *TARGET_ERRNO). */ int (*to_fileio_close) (struct target_ops *, int fd, int *target_errno); @@ -1933,6 +1939,12 @@ extern int target_fileio_pwrite (int fd, const gdb_byte *write_buf, int len, extern int target_fileio_pread (int fd, gdb_byte *read_buf, int len, ULONGEST offset, int *target_errno); +/* Get information about the file opened as FD on the target + and put it in SB. Return 0 on success, or -1 if an error + occurs (and set *TARGET_ERRNO). */ +extern int target_fileio_fstat (int fd, struct stat *sb, + int *target_errno); + /* Close FD on the target. Return 0, or -1 if an error occurs (and set *TARGET_ERRNO). */ extern int target_fileio_close (int fd, int *target_errno); |