src/test/test18.c File Reference

#include <sys/types.h>
#include <sys/stat.h>
#include <sys/wait.h>
#include <errno.h>
#include <fcntl.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <stdio.h>
#include <limits.h>
#include <assert.h>
#include <sys/uio.h>

Go to the source code of this file.

Defines

#define NOCRASH   1
#define PDPNOHANG   1
#define MAXERR   5
#define USER_ID   12
#define GROUP_ID   1
#define FF   3
#define USER   1
#define GROUP   0
#define ARSIZE   256
#define PIPESIZE   3584
#define MAXOPEN   (OPEN_MAX-3)
#define MAXLINK   0177
#define MASK   0777
#define READ_EOF   0
#define OK   0
#define FAIL   -1
#define R   0
#define W   1
#define RW   2
#define RWX   7
#define NIL   ""
#define UMASK   "umask"
#define CREAT   "creat"
#define WRITE   "write"
#define WRITEV   "writev"
#define READ   "read"
#define READV   "readv"
#define OPEN   "open"
#define CLOSE   "close"
#define LSEEK   "lseek"
#define ACCESS   "access"
#define CHDIR   "chdir"
#define CHMOD   "chmod"
#define LINK   "link"
#define UNLINK   "unlink"
#define PIPE   "pipe"
#define STAT   "stat"
#define FSTAT   "fstat"
#define DUP   "dup"
#define UTIME   "utime"
#define TEST8_BUFSZCOUNT   3
#define TEST8_BUFSZMAX   65536
#define TEST8_IOVCOUNT   4

Functions

 _PROTOTYPE (int main,(int argc, char **argv))
 _PROTOTYPE (void test,(void))
 _PROTOTYPE (void write_standards,(int filedes, char a[]))
 _PROTOTYPE (void try_open,(char *fname, int mode, int test))
 _PROTOTYPE (static int iovec_is_equal,(struct iovec *x, struct iovec *y, size_t size))
 _PROTOTYPE (static size_t iovec_setup,(int pattern, struct iovec *iovec, char *buffer, int count))
 _PROTOTYPE (static int power,(int base, int exponent))
 _PROTOTYPE (void e,(char *string))
 _PROTOTYPE (void str,(char *s))
 _PROTOTYPE (void err,(int number, char *scall, char *name))
 _PROTOTYPE (void put_file_in_dir,(char *dirname, int mode))
 _PROTOTYPE (void init_array,(char *a))
 _PROTOTYPE (void clear_array,(char *b))
 _PROTOTYPE (int comp_array,(char *a, char *b, int range))
 _PROTOTYPE (void try_close,(int filedes, char *name))
 _PROTOTYPE (void try_unlink,(char *fname))
 _PROTOTYPE (void Remove,(int fdes, char *fname))
 _PROTOTYPE (int get_mode,(char *name))
 _PROTOTYPE (void check,(char *scall, int number))
 _PROTOTYPE (void put,(int nr))
 _PROTOTYPE (int open_alot,(void))
 _PROTOTYPE (int close_alot,(int number))
 _PROTOTYPE (void chmod_8_dirs,(int sw))
int main (int argc, char **argv)
void test ()
void test01 ()
void test02 ()
void test03 ()
void write_standards (int filedes, a)
void test04 ()
void read_standards (int filedes, a)
void read_more (int filedes, a)
void test05 ()
void try_open (char *fname, int mode, int test)
void test06 ()
void test07 ()
void access_standards ()
void try_access (char *fname, int mode, int test)
void test08 ()
void e (char *string)
void nlcr ()
void str (char *s)
void err (int number, char *scall, char *name)
void make_and_fill_dirs ()
void put_file_in_dir (char *dirname, int mode)
void init_array (char *a)
void clear_array (char *b)
int comp_array (char *a, char *b, int range)
void try_close (int filedes, char *name)
void try_unlink (char *fname)
void Remove (int fdes, char *fname)
int get_mode (char *name)
void check (char *scall, int number)
void put (int nr)
int open_alot ()
int close_alot (int number)
void clean_up_the_mess ()
void chmod_8_dirs (int sw)
void quit ()

Variables

int errct
char * file []
char * fnames []
char * dir []


Define Documentation

#define ACCESS   "access"

Definition at line 56 of file test18.c.

#define ARSIZE   256

Definition at line 30 of file test18.c.

#define CHDIR   "chdir"

Definition at line 57 of file test18.c.

#define CHMOD   "chmod"

Definition at line 58 of file test18.c.

#define CLOSE   "close"

Definition at line 54 of file test18.c.

#define CREAT   "creat"

Definition at line 48 of file test18.c.

#define DUP   "dup"

Definition at line 64 of file test18.c.

#define FAIL   -1

Definition at line 38 of file test18.c.

#define FF   3

Definition at line 26 of file test18.c.

#define FSTAT   "fstat"

Definition at line 63 of file test18.c.

#define GROUP   0

Definition at line 28 of file test18.c.

#define GROUP_ID   1

Definition at line 25 of file test18.c.

#define LINK   "link"

Definition at line 59 of file test18.c.

#define LSEEK   "lseek"

Definition at line 55 of file test18.c.

#define MASK   0777

Definition at line 34 of file test18.c.

#define MAXERR   5

Definition at line 22 of file test18.c.

#define MAXLINK   0177

Definition at line 33 of file test18.c.

#define MAXOPEN   (OPEN_MAX-3)

Definition at line 32 of file test18.c.

#define NIL   ""

Definition at line 46 of file test18.c.

#define NOCRASH   1

Definition at line 20 of file test18.c.

#define OK   0

Definition at line 37 of file test18.c.

#define OPEN   "open"

Definition at line 53 of file test18.c.

#define PDPNOHANG   1

Definition at line 21 of file test18.c.

#define PIPE   "pipe"

Definition at line 61 of file test18.c.

#define PIPESIZE   3584

Definition at line 31 of file test18.c.

#define R   0

Definition at line 40 of file test18.c.

#define READ   "read"

Definition at line 51 of file test18.c.

#define READ_EOF   0

Definition at line 35 of file test18.c.

#define READV   "readv"

Definition at line 52 of file test18.c.

#define RW   2

Definition at line 42 of file test18.c.

#define RWX   7

Definition at line 44 of file test18.c.

#define STAT   "stat"

Definition at line 62 of file test18.c.

#define TEST8_BUFSZCOUNT   3

Definition at line 872 of file test18.c.

#define TEST8_BUFSZMAX   65536

Definition at line 873 of file test18.c.

#define TEST8_IOVCOUNT   4

Definition at line 874 of file test18.c.

#define UMASK   "umask"

Definition at line 47 of file test18.c.

#define UNLINK   "unlink"

Definition at line 60 of file test18.c.

#define USER   1

Definition at line 27 of file test18.c.

#define USER_ID   12

Definition at line 24 of file test18.c.

#define UTIME   "utime"

Definition at line 65 of file test18.c.

#define W   1

Definition at line 41 of file test18.c.

#define WRITE   "write"

Definition at line 49 of file test18.c.

#define WRITEV   "writev"

Definition at line 50 of file test18.c.


Function Documentation

_PROTOTYPE ( void  chmod_8_dirs,
(int sw)   
)

_PROTOTYPE ( int  close_alot,
(int number)   
)

_PROTOTYPE ( int  open_alot,
(void)   
)

_PROTOTYPE ( void  put,
(int nr)   
)

_PROTOTYPE ( void  check,
(char *scall, int number)   
)

_PROTOTYPE ( int  get_mode,
(char *name  
)

_PROTOTYPE ( void  Remove,
(int fdes, char *fname)   
)

_PROTOTYPE ( void  try_unlink,
(char *fname)   
)

_PROTOTYPE ( void  try_close,
(int filedes, char *name  
)

_PROTOTYPE ( int  comp_array,
(char *a, char *b, int range)   
)

_PROTOTYPE ( void  clear_array,
(char *b  
)

_PROTOTYPE ( void  init_array,
(char *a  
)

_PROTOTYPE ( void  put_file_in_dir,
(char *dirname, int mode  
)

_PROTOTYPE ( void  err,
(int number, char *scall, char *name  
)

_PROTOTYPE ( void  str,
(char *s  
)

_PROTOTYPE ( void  e,
(char *string  
)

_PROTOTYPE ( static int  power,
(int base, int exponent)   
)

_PROTOTYPE ( static size_t  iovec_setup,
(int pattern, struct iovec *iovec, char *buffer, int count)   
)

_PROTOTYPE ( static int  iovec_is_equal,
(struct iovec *x, struct iovec *y, size_t size)   
)

_PROTOTYPE ( void  try_open,
(char *fname, int mode, int test)   
)

_PROTOTYPE ( void  write_standards,
(int filedes, char a[])   
)

_PROTOTYPE ( void  test,
(void)   
)

_PROTOTYPE ( int  main,
(int argc, char **argv)   
)

void access_standards (  ) 

Definition at line 798 of file test18.c.

void check ( char *  scall,
int  number 
)

Definition at line 1251 of file test18.c.

void chmod_8_dirs ( int  sw  ) 

Definition at line 1380 of file test18.c.

void clean_up_the_mess (  ) 

Definition at line 1345 of file test18.c.

void clear_array ( char *  b  ) 

Definition at line 1184 of file test18.c.

int close_alot ( int  number  ) 

Definition at line 1325 of file test18.c.

int comp_array ( char *  a,
char *  b,
int  range 
)

Definition at line 1194 of file test18.c.

void e ( char *  string  ) 

Definition at line 993 of file test18.c.

void err ( int  number,
char *  scall,
char *  name 
)

Definition at line 1016 of file test18.c.

int get_mode ( char *  name  ) 

Definition at line 1231 of file test18.c.

void init_array ( char *  a  ) 

Definition at line 1175 of file test18.c.

int main ( int argc  ,
char **  argv 
)

Definition at line 130 of file test18.c.

void make_and_fill_dirs (  ) 

Definition at line 1122 of file test18.c.

void nlcr (  ) 

Definition at line 1000 of file test18.c.

int open_alot (  ) 

Definition at line 1315 of file test18.c.

void put ( int  nr  ) 

Definition at line 1267 of file test18.c.

void put_file_in_dir ( char *  dirname,
int  mode 
)

Definition at line 1146 of file test18.c.

void quit ( void   ) 

Definition at line 1398 of file test18.c.

void read_more ( int  filedes,
a   
)

Definition at line 528 of file test18.c.

void read_standards ( int  filedes,
a   
)

Definition at line 501 of file test18.c.

void Remove ( int  fdes,
char *  fname 
)

Definition at line 1223 of file test18.c.

void str ( char *  s  ) 

Definition at line 1005 of file test18.c.

void test (  ) 

Definition at line 160 of file test18.c.

void test01 (  ) 

Definition at line 181 of file test18.c.

void test02 (  ) 

Definition at line 222 of file test18.c.

void test03 (  ) 

Definition at line 344 of file test18.c.

void test04 (  ) 

Definition at line 427 of file test18.c.

void test05 (  ) 

Definition at line 550 of file test18.c.

void test06 (  ) 

Definition at line 701 of file test18.c.

void test07 (  ) 

Definition at line 762 of file test18.c.

void test08 (  ) 

Definition at line 876 of file test18.c.

void try_access ( char *  fname,
int  mode,
int  test 
)

Definition at line 854 of file test18.c.

void try_close ( int  filedes,
char *  name 
)

Definition at line 1210 of file test18.c.

void try_open ( char *  fname,
int  mode,
int  test 
)

Definition at line 687 of file test18.c.

void try_unlink ( char *  fname  ) 

Definition at line 1217 of file test18.c.

void write_standards ( int  filedes,
a   
)

Definition at line 398 of file test18.c.


Variable Documentation

char * dir[8] (  ) 

Initial value:

 {"d---", "d--x", "d-w-", "d-wx", "dr--", "dr-x",
                                                    "drw-", "drwx"}

Definition at line 71 of file test18.c.

int errct

Definition at line 67 of file test18.c.

char* file[20]

Initial value:

 {"f0", "f1", "f2", "f3", "f4", "f5", "f6",
          "f7", "f8", "f9", "f10", "f11", "f12", "f13",
          "f14", "f15", "f16", "f17", "f18", "f19"}

Definition at line 69 of file test18.c.

char * fnames[8] (  ) 

Initial value:

 {"---", "--x", "-w-", "-wx", "r--",
                                                                   "r-x", "rw-", "rwx"}

Definition at line 70 of file test18.c.


Generated on Tue Mar 9 04:37:05 2010 for Minix by  doxygen 1.5.8