aboutsummaryrefslogtreecommitdiff
path: root/sys/fio/fstatl.x
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2015-07-08 20:46:52 -0400
committerJoseph Hunkeler <jhunkeler@gmail.com>2015-07-08 20:46:52 -0400
commitfa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 (patch)
treebdda434976bc09c864f2e4fa6f16ba1952b1e555 /sys/fio/fstatl.x
downloadiraf-linux-fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4.tar.gz
Initial commit
Diffstat (limited to 'sys/fio/fstatl.x')
-rw-r--r--sys/fio/fstatl.x31
1 files changed, 31 insertions, 0 deletions
diff --git a/sys/fio/fstatl.x b/sys/fio/fstatl.x
new file mode 100644
index 00000000..3b4fdd26
--- /dev/null
+++ b/sys/fio/fstatl.x
@@ -0,0 +1,31 @@
+# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.
+
+include <config.h>
+include <syserr.h>
+include <error.h>
+include <fset.h>
+include <fio.h>
+
+# FSTATL -- Return a file status value of type long integer (l).
+
+long procedure fstatl (fd, what)
+
+int fd, what
+int ffilsz()
+include <fio.com>
+
+begin
+ fp = fiodes[fd]
+ if (fd <= 0 || fp == NULL)
+ iferr (call syserr (SYS_FILENOTOPEN))
+ call erract (EA_FATAL)
+
+ switch (what) {
+ case F_FILESIZE:
+ FILSIZE(fp) = ffilsz (fd)
+ return (FILSIZE(fp))
+ default:
+ iferr (call filerr (FNAME(fp), SYS_FSTATUNKPAR))
+ call erract (EA_FATAL)
+ }
+end