osfHeaders.h

Go to the documentation of this file.
00001 /*
00002  * See the dyninst/COPYRIGHT file for copyright information.
00003  * 
00004  * We provide the Paradyn Tools (below described as "Paradyn")
00005  * on an AS IS basis, and do not warrant its validity or performance.
00006  * We reserve the right to update, modify, or discontinue this
00007  * software at any time.  We shall have no obligation to supply such
00008  * updates or modifications or any other form of support to you.
00009  * 
00010  * By your use of Paradyn, you understand and agree that we (or any
00011  * other person or entity with proprietary rights in Paradyn) are
00012  * under no obligation to provide either maintenance services,
00013  * update services, notices of latent defects, or correction of
00014  * defects for Paradyn.
00015  * 
00016  * This library is free software; you can redistribute it and/or
00017  * modify it under the terms of the GNU Lesser General Public
00018  * License as published by the Free Software Foundation; either
00019  * version 2.1 of the License, or (at your option) any later version.
00020  * 
00021  * This library is distributed in the hope that it will be useful,
00022  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00023  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00024  * Lesser General Public License for more details.
00025  * 
00026  * You should have received a copy of the GNU Lesser General Public
00027  * License along with this library; if not, write to the Free Software
00028  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
00029  */
00030 
00031 
00032 // $Id: osfHeaders.h,v 1.18 2007/05/30 19:20:00 legendre Exp $
00033 
00034 #if !defined(_osf_headers_h)
00035 #define _osf_headers_h
00036 #if defined(__cplusplus)
00037 extern "C" {
00038 #endif /* defined(__cplusplus) */
00039 //#ifndef _XOPEN_SOURCE
00040 //#define _XOPEN_SOURCE 500
00041 //#else
00042 //#undef _XOPEN_SOURCE
00043 //#define _XOPEN_SOURCE 500
00044 //#endif
00045 #include <assert.h>
00046 #include <stdio.h>
00047 #include <string.h>
00048 #include <errno.h>
00049 #include <assert.h>
00050 #include <fcntl.h>
00051 #include <memory.h>
00052 #include <netinet/in.h>
00053 #include <netdb.h>
00054 #include <sys/types.h>
00055 #include <sys/mman.h>
00056 #include <sys/time.h>
00057 #include <unistd.h>
00058 #include <sys/file.h>
00059 #include <sys/socket.h>
00060 #include <rpc/types.h>
00061 #include <rpc/xdr.h>
00062 #include <sys/errno.h>
00063 #include <sys/wait.h>
00064 #include <signal.h>
00065 #include <sys/ptrace.h>
00066 #include <sys/resource.h>
00067 #include <stdarg.h>
00068 #include <stdlib.h>
00069 #include <sys/utsname.h>
00070 #include <sys/select.h>
00071 #include <sys/un.h>
00072 #include <sys/stat.h>
00073 
00074 extern int fork();
00075 extern int vfork();
00076 
00077 /* this definition seems to be missing from <sys/ptrace.h> on Alpha */
00078 extern int ptrace (long request, long process, ulong_t *addr, ulong_t data);
00079 
00080 typedef int (*P_xdrproc_t)(XDR*, ...);
00081 
00082 #if defined(__cplusplus)
00083 };
00084 #endif /* defined(__cplusplus) */
00085 
00086 extern char *sys_errlist[];
00087 
00088 /* POSIX */
00089 extern void P_abort (void);
00090 extern int P_close (int FILEDES);
00091 extern int P_dup2 (int OLD, int NEW);
00092 extern int P_execvp (const char *FILENAME, char *const ARGV[]);
00093 extern int P_execve (const char* FILENAME,
00094              char* const ARGV[], char* const ENVP[]);
00095 extern void P__exit (int STATUS);
00096 extern int P_fcntl (int FILEDES, int command, int arg2);
00097 extern FILE * P_fdopen (int FILEDES, const char *OPENTYPE);
00098 extern FILE * P_fopen (const char *FILENAME, const char *OPENTYPE);
00099 extern int P_fstat (int FILEDES, struct stat *BUF);
00100 extern pid_t P_getpid (void);
00101 extern int P_kill(pid_t PID, int SIGNUM);
00102 extern off_t P_lseek (int FILEDES, off_t OFFSET, int WHENCE);
00103 extern int P_pclose (FILE *STREAM);
00104 extern FILE * P_popen (const char *COMMAND, const char *MODE);
00105 extern int P_open(const char *FILENAME, int FLAGS, mode_t MODE);
00106 extern size_t P_read (int FILEDES, void *BUFFER, size_t SIZE);
00107 extern int P_uname(struct utsname *unm);
00108 extern pid_t P_wait(int *status_ptr);
00109 extern int P_waitpid(pid_t pid, int *statusp, int options);
00110 extern size_t P_write (int FILEDES, const void *BUFFER, size_t SIZE);
00111 extern int P_chdir(const char *path);
00112 
00113 extern int P_putenv(char *str);
00114 
00115 /* SYSTEM-V shared memory */
00116 #include <sys/ipc.h>
00117 #include <sys/shm.h> /* shmid_ds */
00118 extern int P_shmget(key_t, int, int);
00119 extern void *P_shmat(int, void *, int);
00120 extern int P_shmdt(void *);
00121 extern int P_shmctl(int, int, struct shmid_ds *);
00122 
00123 /* ANSI */
00124 extern void P_exit (int STATUS);
00125 extern int P_fflush(FILE *stream);
00126 extern char * P_fgets (char *S, int COUNT, FILE *STREAM);
00127 extern void * P_malloc (size_t SIZE);
00128 extern void * P_memcpy (void *A1, const void *A2, size_t SIZE);
00129 extern void * P_memset (void *BLOCK, int C, unsigned SIZE);
00130 extern void P_perror (const char *MESSAGE);
00131 typedef void (*P_sig_handler)(int);
00132 extern P_sig_handler P_signal(int SIGNUM, P_sig_handler ACTION);
00133 extern char * P_strcat (char *TO, const char *FROM);
00134 extern char * P_strchr (const char *STR, int C);
00135 extern int P_strcmp (const char *S1, const char *S2);
00136 extern char * P_strcpy (char *TO, const char *FROM);
00137 extern char *P_strdup(const char *S);
00138 extern size_t P_strlen (const char *S);
00139 extern char * P_strncat (char *TO, const char *FROM, size_t SIZE);
00140 extern int P_strncmp (const char *S1, const char *S2, size_t SIZE);
00141 extern char * P_strncpy (char *TO, const char *FROM, size_t SIZE);
00142 extern char * P_strrchr (const char *STR, int C);
00143 extern char * P_strstr (const char *HAYSTACK, const char *NEEDLE);
00144 extern double P_strtod (const char *STR, char **TAILPTR);
00145 extern char * P_strtok (char *NEWSTRING, const char *DELIMITERS);
00146 extern long int P_strtol (const char *STR, char **TAILPTR, int BASE);
00147 extern unsigned long int P_strtoul(const char *STR, char **TAILPTR, int BASE);
00148 
00149 /* BSD */
00150 extern int P_accept (int SOCK, struct sockaddr *ADDR, size_t *LENGTH_PTR);
00151 extern int P_bind(int socket, struct sockaddr *addr, size_t len);
00152 extern int P_connect(int socket, struct sockaddr *addr, size_t len);
00153 extern struct hostent * P_gethostbyname (const char *NAME);
00154 /* extern int P_gethostname(char *name, size_t size); */
00155 /* extern int P_getrusage(int, struct rusage*); */
00156 extern struct servent * P_getservbyname (const char *NAME, const char *PROTO);
00157 extern int P_getsockname (int SOCKET, struct sockaddr *ADDR, size_t *LENGTH_PTR);
00158 /* extern int P_gettimeofday (struct timeval *TP, struct timezone *TZP); */
00159 extern int P_listen (int socket, unsigned int n);
00160 caddr_t P_mmap(caddr_t addr, size_t len, int prot, int flags, int fd, off_t off);
00161 extern int P_munmap(caddr_t, int);
00162 extern int P_socket (int NAMESPACE, int STYLE, int PROTOCOL);
00163 extern int P_socketpair(int namesp, int style, int protocol, int filedes[2]);
00164 extern int P_pipe(int fd[2]);
00165 extern int P_strcasecmp(const char *s1, const char *s2);
00166 extern int P_strncasecmp (const char *S1, const char *S2, size_t N);
00167 extern void P_endservent(void);
00168 
00169 inline int P_ptrace(int req, int pid, Address addr, Address data, int /*word_len*/)
00170   { return(ptrace(req, pid, (ulong_t *)addr, (ulong_t)data));}
00171 
00172 extern int P_rexec(char **ahost, u_short inport, char *user, char *passwd, char *cmd, int *fd2p);
00173 
00174 extern int P_select(int wid, fd_set *rd, fd_set *wr, fd_set *ex, struct timeval *tm);
00175 
00176 extern "C" char *cplus_demangle(char *, int);
00177 
00178 char * P_cplus_demangle( const char * symbol, 
00179                          bool  nativeCompiler, 
00180                          bool includeTypes = false ); 
00181 /* see osfKludges for implementation */
00182 
00183 extern void   P_xdr_destroy(XDR*);
00184 extern bool_t P_xdr_u_char(XDR*, u_char*);
00185 extern bool_t P_xdr_int(XDR*, int*);
00186 extern bool_t P_xdr_double(XDR*, double*);
00187 extern bool_t P_xdr_u_int(XDR*, u_int*);
00188 extern bool_t P_xdr_float(XDR*, float*);
00189 extern bool_t P_xdr_char(XDR*, char*);
00190 extern bool_t P_xdr_string(XDR*, char **, const u_int maxsize);
00191 extern void P_xdrrec_create(XDR*, const u_int send_sz, const u_int rec_sz,
00192                 const caddr_t handle, 
00193                 xdr_rd_func read_r, xdr_wr_func write_f);
00194 extern bool_t P_xdrrec_endofrecord(XDR*, int now);
00195 extern bool_t P_xdrrec_skiprecord(XDR*);
00196 inline bool_t P_xdrrec_eof(XDR *x) { return (xdrrec_eof(x)); }
00197 
00198 #endif
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 12 Jul 2013 for SymtabAPI by  doxygen 1.6.1