From a8d10b60d4df3820e4f348447da35ab9589095b7 Mon Sep 17 00:00:00 2001 From: Keith Bostic Date: Sun, 5 May 1991 20:19:59 -0800 Subject: [PATCH] date and time created 91/05/05 13:19:59 by bostic SCCS-vsn: sys/stand.att/close.c 7.1 --- usr/src/sys/stand.att/close.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 usr/src/sys/stand.att/close.c diff --git a/usr/src/sys/stand.att/close.c b/usr/src/sys/stand.att/close.c new file mode 100644 index 0000000000..f3d1ecf693 --- /dev/null +++ b/usr/src/sys/stand.att/close.c @@ -0,0 +1,30 @@ +/*- + * Copyright (c) 1982, 1988 The Regents of the University of California. + * All rights reserved. + * + * %sccs.include.proprietary.c% + * + * @(#)close.c 7.1 (Berkeley) %G% + */ + +#include +#include "saio.h" + +close(fdesc) + int fdesc; +{ +#ifndef SMALL + struct iob *file; + + fdesc -= 3; + if (fdesc < 0 || fdesc >= SOPEN_MAX || + ((file = &iob[fdesc])->i_flgs&F_ALLOC) == 0) { + errno = EBADF; + return (-1); + } + if ((file->i_flgs&F_FILE) == 0) + devclose(file); + file->i_flgs = 0; +#endif + return (0); +} -- 2.20.1