dfs_seteof

Sets the file size.

Library:LibC
Classification:Novell
Service:Direct File System

Syntax

  #include <dfs.h>  
   
  int dfs_seteof (
     int        fildes,
     size64_t   newSize,
     int        truncBlockFlag ); 
  

Parameters

fildes

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

newSize

(IN) Specifies the new file size in bytes.

truncBlockFlag

(IN) Specifies a nonzero value to indicate that any blocks truncated by the new file size should be freed up for future OS use. Specifies 0 to indicate that any truncated blocks should not be freed.

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

If the connection making the request is the only entity with the file open and if the truncBlockFlag is nonzero, setting a new file size that is one or more blocks less than the previous file size causes blocks (actually allocated) beyond the new defined file size to be truncated, or returned for future OS usage. If a new file size is specified that is greater than the previous file size, the newly defined file area is zero-filled, provided that actual file space is allocated. A new file size can be specified that is beyond the range of current allocated file space, or that is less than current allocated file space.

See Also