dfs_close

Closes a file currently open in direct file mode.

Library:LibC
Classification:Novell
Service:Direct File System

Syntax

  #include <dfs.h>  
   
  int dfs_close (
     int   fildes ); 
  

Parameters

fildes

(IN) Specifies the file handle returned from a prior successful call to dfs_sopen or dfs_creat. After a file is closed, the file handle is no longer valid and should not be reused.

Return Values

If successful, returns 0. Otherwise, returns a nonzero error code:

Decimal

Constant

Description

4

EBADF

The fildes parameter isn't a valid file descriptor.

28

EIO

An I/O error occurred while reading from or writing to the file system

63

EINTR

A signal interrupted the call.

79

ENOTSUP

The NLM is loaded in protected address space. This operation is supported only in kernel address space.

106

ENOCONTEXT

The current thread has not context.

Remarks

Calling dfs_close causes the file to be closed (the handle becomes invalid). If dfs_close determines that this was the last valid handle (no other opens outstanding for the file), the Direct File Mode flag is reset, allowing a subsequent open file call to be either open (normal mode), or dfs_sopen (direct mode). Remember, if a file is in direct mode, any programs with normal mode opens into the file are able to read the file but not write to it (see Input and Output).

See Also