Logo Search packages:      
Sourcecode: jack-tools version File versions  Download package

file.c

#ifndef _FILE_C
#define _FILE_C

#include <unistd.h>
#include <stdio.h>

int 
xpipe ( int filedes[2] ) 
{
  int err = pipe ( filedes ) ;
  if ( err ) {
    perror ( "pipe() failed" ) ;
    FAILURE ;
  }
  return err ;
}

ssize_t 
xwrite ( int filedes , const void *buffer , size_t size )
{
  ssize_t err = write ( filedes , buffer , size ) ;
  if ( err == -1 ) {
    perror ( "write() failed" ) ;
    FAILURE ; 
  }
  return err ;
}

ssize_t 
xread ( int filedes , void *buffer , size_t size )
{
  ssize_t err = read ( filedes , buffer , size ) ;
  if ( err == -1 ) {
    perror ( "read() failed" ) ;
    FAILURE ; 
  }
  return err ;
}

#endif

Generated by  Doxygen 1.6.0   Back to index