osprey/cygnus/libiberty/mpw.c File Reference

#include "mpw.h"
#include <stdlib.h>
#include <sys/time.h>
#include <sys/resource.h>
#include <Types.h>
#include <Files.h>
#include <Timer.h>
#include "utime.h"

Include dependency graph for mpw.c:

Go to the source code of this file.

Defines

#define ZEROBLKSIZE   4096
#define LOCKBIT   (1<<0)
#define DIRBIT   (1<<4)

Functions/Subroutines

void mpwify_filename (char *unixname, char *macname)
char * mpw_basename (char *name)
char * mpw_mixed_basename (char *name)
FILEmpw_fopen (char *name, char *mode)
int mpw_fseek (FILE *fp, int offset, int whence)
int mpw_fread (char *ptr, int size, int nitems, FILE *stream)
int mpw_fwrite (char *ptr, int size, int nitems, FILE *stream)
int link ()
int fork ()
int vfork ()
int pipe (int *fd)
int execvp (char *file, char **argv)
int execv (char *path, char **argv)
int kill (int pid, int sig)
int wait (int *status)
int sleep (int seconds)
void putenv (char *str)
int chmod (char *path, int mode)
int getuid ()
int getgid ()
void mpw_abort ()
int getrusage (int who, struct rusage *rusage)
int sbrk ()
int isatty (int fd)
int utime (char *filename, struct utimbuf *times)
int mkdir (char *path, int mode)
int rmdir ()
 chown ()
static int _stat (char *name, long dirid, struct stat *buf)
int stat (char *path, struct stat *buf)
int fstat (int fd, struct stat *buf)
 chdir ()
char * getcwd (char *buf, int size)
char * getpwd ()
int mpw_open (char *filename, int arg2, int arg3)
int mpw_access (char *filename, unsigned int cmd)
int mpw_creat (char *path, int mode)
 mpw_special_init (char *name)
int umask (int mask)
void warn_if_spin_delay (char *file, int line)
void record_for_spin_delay (char *file, int line)
void mpw_start_progress (char *str, int n, char *file, int line)
void mpw_progress (int n)
void mpw_progress_measured (int n, char *file, int line)
void mpw_end_progress (char *str, char *file, int line)

Variables

int sys_nerr = 0
int DebugPI = -1
char zeros [ZEROBLKSIZE]
char * myenviron [] = {NULL}
char ** environ = myenviron
int __uid = 0
int __gid = 0
static int current_umask
int cursor_inited
int measure_spin
int dump_spin_data
long warning_threshold = 400000
long bucket_size = 1024
long bucket_power = 10
long numbuckets = 300
int * delay_counts
int overflow_count
char * current_progress
static UnsignedWide last_microseconds
static char * last_spin_file = ""
static int last_spin_line


Define Documentation

#define DIRBIT   (1<<4)

Definition at line 510 of file mpw.c.

Referenced by _stat().

#define LOCKBIT   (1<<0)

Definition at line 509 of file mpw.c.

Referenced by _stat().

#define ZEROBLKSIZE   4096

Definition at line 217 of file mpw.c.

Referenced by mpw_fseek().


Function Documentation

static int _stat ( char *  name,
long  dirid,
struct stat buf 
) [static]

chdir (  ) 

Definition at line 645 of file mpw.c.

References ENOSYS, and errno.

Referenced by _PXFCHDIR(), chdir_(), main(), and recompile_files().

int chmod ( char *  path,
int  mode 
)

chown (  ) 

Definition at line 485 of file mpw.c.

References ENOSYS, and errno.

Referenced by _PXFCHOWN().

int execv ( char *  path,
char **  argv 
)

Definition at line 314 of file mpw.c.

References fprintf(), and mpw_abort().

Referenced by _PXFEXECV(), main(), my_execv(), pex_unix_exec_child(), pexecute(), and scan_prog_file().

int execvp ( char *  file,
char **  argv 
)

Definition at line 306 of file mpw.c.

References fprintf(), and mpw_abort().

Referenced by _PXFEXECVP(), chain_open(), exec_smake(), Execute(), pex_unix_exec_child(), pexecute(), and process_command().

int fork ( void   ) 

Definition at line 282 of file mpw.c.

int fstat ( int  fd,
struct stat buf 
)

Definition at line 603 of file mpw.c.

char* getcwd ( char *  buf,
int  size 
)

Definition at line 652 of file mpw.c.

References malloc, NULL, and strcpy.

int getgid ( void   ) 

Definition at line 378 of file mpw.c.

char* getpwd ( void   ) 

Definition at line 663 of file mpw.c.

int getrusage ( int  who,
struct rusage rusage 
)

Definition at line 408 of file mpw.c.

Referenced by clock(), dtime_(), execute(), get_cpu(), Get_Resources(), get_run_time(), get_time(), main(), and pex_wait().

int getuid ( void   ) 

Definition at line 371 of file mpw.c.

int isatty ( int  fd  ) 

Definition at line 428 of file mpw.c.

int kill ( int  pid,
int  sig 
)

Definition at line 323 of file mpw.c.

int link (  ) 

Definition at line 275 of file mpw.c.

References fprintf(), and mpw_abort().

Referenced by _PXFLINK(), G77_link_0(), and run_prof().

int mkdir ( char *  path,
int  mode 
)

Definition at line 471 of file mpw.c.

References ENOSYS, and errno.

Referenced by create_file(), make_class_file_name(), save_cpp_output(), and update_rii_file().

void mpw_abort ( void   ) 

Definition at line 390 of file mpw.c.

References exit(), fflush(), and printf().

int mpw_access ( char *  filename,
unsigned int  cmd 
)

Definition at line 693 of file mpw.c.

References DebugPI, EACCES, errno, fprintf(), mpwify_filename(), R_OK, stat::st_mode, stat, W_OK, and X_OK.

char* mpw_basename ( char *  name  ) 

Definition at line 127 of file mpw.c.

References base.

int mpw_creat ( char *  path,
int  mode 
)

Definition at line 733 of file mpw.c.

References creat.

void mpw_end_progress ( char *  str,
char *  file,
int  line 
)

FILE* mpw_fopen ( char *  name,
char *  mode 
)

Definition at line 169 of file mpw.c.

References errno, fopen, fp, fprintf(), free(), malloc, mpwify_filename(), NULL, pname, PROGRESS, strchr, strcpy, and strlen().

int mpw_fread ( char *  ptr,
int  size,
int  nitems,
FILE stream 
)

Definition at line 251 of file mpw.c.

References fread, and PROGRESS.

int mpw_fseek ( FILE fp,
int  offset,
int  whence 
)

Definition at line 222 of file mpw.c.

References fflush(), fseek, ftell(), fwrite, PROGRESS, SEEK_END, SEEK_SET, ZEROBLKSIZE, and zeros.

int mpw_fwrite ( char *  ptr,
int  size,
int  nitems,
FILE stream 
)

Definition at line 263 of file mpw.c.

References fwrite, and PROGRESS.

char* mpw_mixed_basename ( char *  name  ) 

Definition at line 149 of file mpw.c.

References base.

int mpw_open ( char *  filename,
int  arg2,
int  arg3 
)

Definition at line 669 of file mpw.c.

References DebugPI, errno, fd, fprintf(), mpwify_filename(), and open.

void mpw_progress ( int  n  ) 

Definition at line 875 of file mpw.c.

void mpw_progress_measured ( int  n,
char *  file,
int  line 
)

Definition at line 881 of file mpw.c.

References measure_spin, record_for_spin_delay(), and warn_if_spin_delay().

mpw_special_init ( char *  name  ) 

Definition at line 747 of file mpw.c.

References strstr().

Referenced by mpw_start_progress().

void mpw_start_progress ( char *  str,
int  n,
char *  file,
int  line 
)

void mpwify_filename ( char *  unixname,
char *  macname 
)

Definition at line 45 of file mpw.c.

References DebugPI, fprintf(), getenv(), i, strchr, strlen(), and strncmp().

Referenced by mpw_access(), mpw_fopen(), mpw_open(), pexecute(), and stat().

int pipe ( int *  fd  ) 

void putenv ( char *  str  ) 

Definition at line 356 of file mpw.c.

void record_for_spin_delay ( char *  file,
int  line 
)

Definition at line 830 of file mpw.c.

References last_microseconds, last_spin_file, and last_spin_line.

Referenced by mpw_progress_measured(), and mpw_start_progress().

int rmdir (  ) 

Definition at line 478 of file mpw.c.

References ENOSYS, and errno.

Referenced by _PXFRMDIR().

int sbrk (  ) 

int sleep ( int  seconds  ) 

Definition at line 339 of file mpw.c.

References PROGRESS, start_time, and time.

Referenced by _PXFSLEEP(), internal_fix(), pex_unix_exec_child(), pexecute(), sleep_(), and start_fixer().

int stat ( char *  path,
struct stat buf 
)

Definition at line 578 of file mpw.c.

References _stat(), DebugPI, errno, fflush(), fprintf(), L, mpwify_filename(), and PROGRESS.

int umask ( int  mask  ) 

Definition at line 757 of file mpw.c.

Referenced by _PXFUMASK(), bfd_close(), bfd_close_all_done(), create_tmpdir(), and G77_umask_0().

int utime ( char *  filename,
struct utimbuf times 
)

Definition at line 438 of file mpw.c.

References utimbuf::actime, EACCES, ENOENT, err, errno, L, utimbuf::modtime, pname, and strcpy.

int vfork ( void   ) 

Definition at line 289 of file mpw.c.

int wait ( int *  status  ) 

Definition at line 331 of file mpw.c.

void warn_if_spin_delay ( char *  file,
int  line 
)


Variable Documentation

int __gid = 0

Definition at line 506 of file mpw.c.

Referenced by _stat().

int __uid = 0

Definition at line 505 of file mpw.c.

Referenced by _stat().

Definition at line 783 of file mpw.c.

Referenced by warn_if_spin_delay().

long bucket_size = 1024

Definition at line 781 of file mpw.c.

Referenced by mpw_end_progress().

Definition at line 791 of file mpw.c.

Referenced by mpw_start_progress(), and warn_if_spin_delay().

int current_umask [static]

Definition at line 754 of file mpw.c.

Referenced by umask().

Definition at line 769 of file mpw.c.

Referenced by mpw_start_progress().

int DebugPI = -1

Definition at line 42 of file mpw.c.

Referenced by fstat(), mpw_access(), mpw_open(), mpwify_filename(), and stat().

Definition at line 787 of file mpw.c.

Referenced by mpw_end_progress(), mpw_start_progress(), and warn_if_spin_delay().

Definition at line 777 of file mpw.c.

Referenced by mpw_end_progress(), mpw_start_progress(), and warn_if_spin_delay().

char** environ = myenviron

Definition at line 493 of file mpw.c.

UnsignedWide last_microseconds [static]

Definition at line 793 of file mpw.c.

Referenced by record_for_spin_delay(), and warn_if_spin_delay().

char* last_spin_file = "" [static]

Definition at line 795 of file mpw.c.

Referenced by record_for_spin_delay(), and warn_if_spin_delay().

int last_spin_line [static]

Definition at line 797 of file mpw.c.

Referenced by record_for_spin_delay(), and warn_if_spin_delay().

Definition at line 773 of file mpw.c.

Referenced by mpw_end_progress(), mpw_progress_measured(), and mpw_start_progress().

char* myenviron[] = {NULL}

Definition at line 491 of file mpw.c.

Definition at line 785 of file mpw.c.

Referenced by mpw_end_progress(), mpw_start_progress(), and warn_if_spin_delay().

Definition at line 789 of file mpw.c.

Referenced by mpw_start_progress(), and warn_if_spin_delay().

int sys_nerr = 0

Definition at line 38 of file mpw.c.

Definition at line 779 of file mpw.c.

Referenced by mpw_start_progress(), and warn_if_spin_delay().

char zeros[ZEROBLKSIZE]


Generated on Wed Apr 8 15:03:15 2009 for Open64 by  doxygen 1.5.6