Back to index

glibc  2.9
Defines | Functions
close.c File Reference
#include <errno.h>
#include <unistd.h>
#include <bits/stdio_lim.h>
#include "filedesc.h"

Go to the source code of this file.

Defines

#define _STDIO_H

Functions

int __close (int fd)

Define Documentation

#define _STDIO_H

Definition at line 24 of file close.c.


Function Documentation

int __close ( int  fd)

Definition at line 30 of file close.c.

{
  if ( !__FD_Is_valid( fd ) || !__FD_Table[ fd ].in_use )
    {
      __set_errno (EBADF);
      return -1;
    }

  __FD_Table[ fd ].in_use = 0;
  return 0;
}