dfs_read

Reads the sectors requested from a file using DFS, sleeping until completion.

Library:LibC
Classification:Novell
Service:Direct File System

Syntax

  #include <dfs.h>  
   
  int dfs_read (
     int        fildes,
     uint32_t   startingSector,
     size_t     sectorCount,
     void      *buffer );
  

Parameters

fildes

(IN) Specifies the file handle returned from a prior call to open for the indicated file.

startingSector

(IN) Specifies the starting sector number (logical offset from beginning of the file) in the file where the read operation is to begin.

sectorCount

(IN) Specifies the number of sectors to be read into the buffer.

buffer

(OUT) Points to a contiguous buffer area large enough to contain the number of sectors indicated to be read.

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.

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.

For possible DFS errors, see Section 13.4.5, DFS Return Values.

Remarks

This function performs a read of one or more sectors using a logical zero-based sector offset into the indicated file. Since this function is blocking, control is returned to the caller after all reads relating to the requested read function have been completed. If a status indicating a hole was detected during the requested read operation, the buffer is zeroed. It is not possible to read beyond the end of the allocated area of a file.

See Also