test27.c File Reference

#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdlib.h>
#include <errno.h>
#include <limits.h>
#include <string.h>
#include <time.h>
#include <stdio.h>
#include "error, this case requires dynamic checks and is not handled"

Include dependency graph for test27.c:

Go to the source code of this file.

Defines

#define MODE_MASK   (S_IRWXU | S_IRWXG | S_IRWXO | S_ISUID | S_ISGID)
#define MAX_ERROR   4
#define ITERATIONS   2
#define System(cmd)   if (system(cmd) != 0) printf("``%s'' failed\n", cmd)
#define Chdir(dir)   if (chdir(dir) != 0) printf("Can't goto %s\n", dir)

Functions

 _PROTOTYPE (void main,(int argc, char *argv[]))
 _PROTOTYPE (void test27a,(void))
 _PROTOTYPE (void e,(int __n))
void main (int argc, argv)
void test27a ()
void test27b ()
void test27c ()
void makelongnames ()
void e (int n)
void quit ()

Variables

int errct = 0
int subtest = 1
int superuser
char MaxName [NAME_MAX+1]
char MaxPath [PATH_MAX]
char ToLongName [NAME_MAX+2]
char ToLongPath [PATH_MAX+1]


Define Documentation

#define Chdir dir   )     if (chdir(dir) != 0) printf("Can't goto %s\n", dir)
 

Definition at line 20 of file test27.c.

#define ITERATIONS   2
 

Definition at line 17 of file test27.c.

#define MAX_ERROR   4
 

Definition at line 16 of file test27.c.

#define MODE_MASK   (S_IRWXU | S_IRWXG | S_IRWXO | S_ISUID | S_ISGID)
 

Definition at line 15 of file test27.c.

Referenced by test27a().

#define System cmd   )     if (system(cmd) != 0) printf("``%s'' failed\n", cmd)
 

Definition at line 19 of file test27.c.


Function Documentation

_PROTOTYPE void  e,
(int __n) 
 

_PROTOTYPE void  test27a,
(void) 
 

_PROTOTYPE void  main,
(int argc, char *argv[]) 
 

void e int  n  ) 
 

Definition at line 319 of file test27.c.

References chdir, errct, errno, exit(), MAX_ERROR, perror(), printf, subtest, and system().

void main int  argc,
argv 
 

Definition at line 38 of file test27.c.

References atoi, Chdir, fflush(), getuid, i, ITERATIONS, m, makelongnames(), printf, stdout, superuser, sync, System, test27a(), test27b(), and test27c().

void makelongnames  ) 
 

Definition at line 298 of file test27.c.

References i, MaxName, MaxPath, memset(), and PATH_MAX.

void quit  ) 
 

Definition at line 336 of file test27.c.

References Chdir, errct, exit(), printf, and System.

void test27a  ) 
 

Definition at line 61 of file test27.c.

References close, e, fstat, getegid, geteuid, mkfifo, MODE_MASK, O_APPEND, O_RDWR, open, pipe, S_ISBLK, S_ISCHR, S_ISDIR, S_ISFIFO, S_ISREG, stat::st_atime, stat::st_ctime, stat::st_dev, stat::st_gid, stat::st_ino, stat::st_mode, stat::st_mtime, stat::st_nlink, stat::st_size, stat::st_uid, stat, subtest, System, time, time_t, and write.

Referenced by main().

void test27b  ) 
 

Definition at line 221 of file test27.c.

References close, e, fstat, MaxName, MaxPath, mkdir, O_RDONLY, open, rmdir, st, stat, subtest, and System.

Referenced by main().

void test27c  ) 
 

Definition at line 242 of file test27.c.

References Chdir, e, EACCES, EBADF, ENAMETOOLONG, ENOENT, ENOTDIR, errno, fstat, i, st, stat, subtest, superuser, System, ToLongName, and ToLongPath.

Referenced by main().


Variable Documentation

int errct = 0
 

Definition at line 22 of file test27.c.

char MaxName[NAME_MAX+1]
 

Definition at line 25 of file test27.c.

char MaxPath[PATH_MAX]
 

Definition at line 26 of file test27.c.

int subtest = 1
 

Definition at line 23 of file test27.c.

int superuser
 

Definition at line 24 of file test27.c.

char ToLongName[NAME_MAX+2]
 

Definition at line 27 of file test27.c.

char ToLongPath[PATH_MAX+1]
 

Definition at line 28 of file test27.c.


Generated on Fri Apr 14 23:22:16 2006 for minix by  doxygen 1.4.6