diff options
Diffstat (limited to 'gcc/ada/adaint.c')
| -rw-r--r-- | gcc/ada/adaint.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/gcc/ada/adaint.c b/gcc/ada/adaint.c index 0b27ada..4c1430d 100644 --- a/gcc/ada/adaint.c +++ b/gcc/ada/adaint.c @@ -720,6 +720,21 @@ __gnat_file_length (int fd) return (statbuf.st_size); } +/* Return the number of bytes in the specified named file. */ + +long +__gnat_named_file_length (char *name) +{ + int ret; + struct stat statbuf; + + ret = __gnat_stat (name, &statbuf); + if (ret || !S_ISREG (statbuf.st_mode)) + return 0; + + return (statbuf.st_size); +} + /* Create a temporary filename and put it in string pointed to by TMP_FILENAME. */ |
