aboutsummaryrefslogtreecommitdiff
path: root/sys/fio/fstatl.x
blob: 3b4fdd261069225e40d92193d9535c5e9a6554a6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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