/* Copyright (c) 2001-2009 by SoftIntegration, Inc. All Rights Reserved */
#include <unistd.h>
#include <sys/types.h>
#include <stdio.h>
                     

int ftruncate(int fildes, off_t length) {
    void *fptr;
    int retval;

    fptr = dlsym(_ChUnistd_handle, "ftruncate_chdl");
    if(fptr == NULL)  {
       printf("Error: %s(): dlsym(): %s\n", __func__, dlerror());
       return -1;
    }
    dlrunfun(fptr, &retval, ftruncate, fildes, length);
    return retval;
}
