Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ ftruncate(2) — DG/UX 4.00

Media Vault

Software Library

Restoration Projects

Artifacts Sought



                                                             ftruncate(2)



        _________________________________________________________________
        ftruncate                                             System Call
        Truncate a file.
        _________________________________________________________________


        SYNTAX

        int   ftruncate  (fildes, length)
        int             fildes;
        long            length;


        PARAMETERS

        fildes         A valid, active file descriptor.


        length         Maximum length of file after truncation.


        DESCRIPTION

        This call is similar to the truncate system call, except that
        ftruncate takes a file descriptor instead of a pathname to
        identify the file.

        Otherwise, the semantics of this call are identical to those of
        truncate.


        ACCESS CONTROL

        <Fildes> must be open for writing.


        RETURN VALUE

        0              The file was successfully truncated.


        -1             An error occurred. Errno is set to indicate the
                       error.


        EXCEPTIONS

        Errno may be set to one of the following error codes:


        EBADF          <Fildes> is not a valid, active descriptor.



        DG/UX 4.00                                                 Page 1
               Licensed material--property of copyright holder(s)





                                                             ftruncate(2)



        EINVAL         <Fildes> is not open for writing.


        EINVAL         <Fildes> references a socket, not a file.


        EINTR          Fcntl was interrupted while waiting for a lock.


        SEE ALSO

        The related manual sections:  creat(2), open(2), truncate(2).










































        DG/UX 4.00                                                 Page 2
               Licensed material--property of copyright holder(s)



Typewritten Software • bear@typewritten.org • Edmonds, WA 98026