From: Keith Bostic Date: Mon, 6 May 1991 04:19:59 +0000 (-0800) Subject: date and time created 91/05/05 13:19:59 by bostic X-Git-Tag: BSD-4_4-Snapshot-Development~10957 X-Git-Url: https://git.subgeniuskitty.com/unix-history/.git/commitdiff_plain/a8d10b60d4df3820e4f348447da35ab9589095b7 date and time created 91/05/05 13:19:59 by bostic SCCS-vsn: sys/stand.att/close.c 7.1 --- 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); +}