dfs_write

Writes sectors into a file using DFS, sleeping until completion.

Library:LibC
Classification:Novell
Service:Direct File System

Syntax

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

Parameters

fildes

(IN) Specifies the file handle returned from a prior dfs_sopen or dfs_creat call for the indicated file.

startingSector

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

sectorCount

(IN) Specifies the number of sectors to be written from the buffer.

buffer

(IN) Points to a contiguous buffer area large enough to contain the number of sectors to be written.

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 write 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 writes relating to the requested write function are completed. It is not possible to write beyond the end of the allocated area of a file, or in holes where no blocks are allocated. This function sets a new file size if a write is issued to allocated file space beyond the current file size.

See Also