home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Education Sampler 1992 [NeXTSTEP]
/
Education_1992_Sampler.iso
/
NeXT
/
GnuSource
/
cc-61.0.1
/
cc
/
SYSCALLS.c
< prev
next >
Wrap
C/C++ Source or Header
|
1991-06-03
|
22KB
|
478 lines
/*
Copyright (C) 1988 Free Software Foundation
Modified for protoize by Ron Guilmette (rfg@ics.uci.edu)
Based on the std.c file originally by Doug Lea (dl@rocky.oswego.edu)
This file is part of GNU CC.
GNU CC is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU CC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
/*
*** IMPORTANT NOTE:
At the bottom of this file is a set of function declarations which
must someday get "prototyped". Right now, I don't have time to add
in all of the prototypes for these.
If you are reading this file, then it means that you have a lot of
spare time on your hands. Why don't you use some of that time to
help make the world safe for prototypes, and add some prototypes
for the functions at the end of this file. When you are done (or
when you get bored and want to give up) please send me any new
prototypes that you have added to me (rfg@ics.uci.edu) so that I
can incorporate them into my next release of protoize.
If you would like to get this file to incorporate *every* single
system call for your particular flavor of *NIX, please send me mail.
I have some tools that can help you to extract a complete set of
declarations from your system's own include files.
*/
/* It doesn't really matter here what the following things are defined to
be. For most of them, it doesn't even matter if they are fully defined
at all because the prototypes just declare parameters which are pointers
to these types (in most cases). All that matters here is that these names
get defined as names of structs. */
struct direct;
struct tm;
struct stat;
struct rlimit;
struct rusage;
struct sockaddr;
struct sockaddr_in;
struct timeval {};
struct exportent;
struct fstab;
struct hostent;
struct in_addr {};
struct ldfile;
struct mallinfo {};
struct mint;
struct nmtent;
struct netent;
struct pmaplist;
struct protoent;
struct rpcent;
struct servent;
struct authdes_cred;
struct rpc_err;
union wait;
/* It doesn't really matter here what the following things are defined to
be. All that matters here is that these names get defined as names of
enums. */
enum auth_stat { ____Anonymous_0 };
enum clnt_stat { ____Anonymous_1 };
/* It doesn't really matter here what the following things are typedef'ed
to, so long as they become defined typedef names. Note however that due
to a bug somewhere in the compiler of in aux_info_gen, none of these
types may be declared as array types or else their typedef'ed names will
get lost and will not be written to the SYSCALLS.c.X file. */
typedef int *jmp_buf;
typedef int *sigjmp_buf;
typedef int div_t;
typedef int ldiv_t;
typedef int FILE;
typedef int DIR;
typedef int xdrproc_t;
typedef int CALL;
typedef int CLIENT;
typedef int AUTH;
typedef int SCREEN;
typedef int SVCXPRT;
typedef int TERMINAL;
typedef int WINDOW;
typedef int bool;
typedef int bool_t;
typedef int DBM;
typedef int byte8e_ptr_type;
typedef int datum;
typedef int chtype;
typedef int fp_rnd;
typedef int ps_data_device_ptr_type;
typedef int ps_data_user_ptr_type;
typedef int des_block;
typedef int resultproc_t;
#ifdef USG
#include <sys/types.h>
#ifndef DGUX
typedef unsigned int u_int;
#endif
#define SIGHAN_T void
#define WAIT_ARG_TYPE int
#else
#define mode_t int
#define uid_t int
#define gid_t int
#define time_t long
#define pid_t int
#define SIGHAN_T int
#define WAIT_ARG_TYPE union wait
/* size_t should be a typedef, even for BSD, because ANSI requires that there
be such a typedef available in <stddef.h>. The GNU C compiler insists that
this type be defined to `unsigned long' rather than `unsigned int'. If
this conflicts with the type of size_t given in your <sys/types.h> file,
then you have two choices: (1) change your <sys/types.h> file, or (2)
don't use GCC. */
typedef unsigned long size_t;
typedef unsigned short u_short;
typedef unsigned int u_int;
typedef unsigned long u_long;
#endif
extern void __eprintf (const char *);
extern void _exit (int);
extern int _filbuf (FILE *);
extern int _flsbuf (unsigned int, FILE *);
extern int _longjmp (jmp_buf, int);
extern int _setjmp (jmp_buf);
extern void abort (void);
extern int abs (int);
extern int access (const char *, int);
extern int acct (const char *);
extern double acos (double);
extern int addexportent (FILE *, char *, char *);
extern unsigned alarm (unsigned);
extern void * alloca (int);
extern int and (void);
extern int ascftime (char *, char *, struct tm *);
extern char * asctime (struct tm *);
extern double asin (double);
extern double atan2 (double, double);
extern double atan (double);
extern int atexit (void (*) (void));
extern double atof (const char *);
extern int atoi (const char *);
extern long atol (const char *);
extern void auth_destroy (AUTH *);
extern AUTH * authdes_create (char *, unsigned, struct sockaddr *, des_block *);
extern void authdes_getcred (struct authdes_cred *, short *, short *, short *, int *);
extern AUTH * authnone_create (void);
extern AUTH * authunix_create (char *, int, int, int, int *);
extern AUTH * authunix_create_default (void);
extern int bcmp (const void *, const void *, int);
extern void bcopy (const void *, void *, int);
extern void (* berk_signal (int, void (*) (int, ...))) (int, ...);
extern void * brk (void *);
extern char * bsearch (char *, char *, unsigned, size_t, int (*) (const void *, const void *));
extern void bzero (void *, size_t);
extern void * calloc (unsigned, size_t);
extern void callrpc (char *, u_long, u_long, u_long, xdrproc_t, char *, xdrproc_t, char *);
extern double ceil (double);
extern void cfree (void *);
extern int cftime (char *, const char *, time_t *);
extern int chdir (const char *);
extern int chmod (const char *, mode_t);
extern int chown (const char *, uid_t, gid_t);
extern void clearerr (FILE *);
extern enum clnt_stat clnt_broadcast (u_long, u_long, u_long, xdrproc_t, char *, xdrproc_t, char *, resultproc_t);
extern enum clnt_stat clnt_call (CLIENT *, u_long, xdrproc_t, char *, xdrproc_t, char *, struct timeval);
extern bool_t clnt_control (CLIENT *, int, char *);
extern CLIENT * clnt_create (char *, u_long, u_long, char *);
extern void clnt_destroy (CLIENT *);
extern int clnt_freeres (CLIENT *, xdrproc_t, char *);
extern void clnt_geterr (CLIENT *, struct rpc_err *);
extern void clnt_pcreateerror (char *);
extern void clnt_perrno (enum clnt_stat);
extern void clnt_perror (CLIENT *, char *);
extern char * clnt_spcreateerror (char *);
extern char * clnt_sperrno (enum clnt_stat);
extern char * clnt_sperror (CLIENT *, char *);
extern CLIENT * clntraw_create (u_long, u_long);
extern CLIENT * clnttcp_create (struct sockaddr_in *, u_long, u_long, int *, u_int, u_int *);
extern CLIENT * clntudp_create (struct sockaddr_in *, u_long, u_long, struct timeval, int *);
extern long clock (void);
extern int close (int);
extern void closedir (DIR *);
extern double cos (double);
extern double cosh (double);
extern int creat (const char *, mode_t);
extern char * crypt (const char *, const char *);
extern char * ctermid (char *);
extern char * ctime (time_t *);
extern char * cuserid (char *);
extern int dial (CALL);
extern double difftime (time_t, time_t);
extern div_t div (int, int);
extern double drand48 (void);
extern double drem (double, double);
extern int dup2 (int, int);
extern int dup (int);
extern int dysize (int);
extern char * ecvt (double, int, int *, int *);
extern char * encrypt (char *, int);
extern double erand (short *);
extern double erf (double);
extern double erfc (double);
extern int execl (const char *, const char *, ...);
extern int execle (const char *, const char *, ...);
extern int execlp (const char *, const char *, ...);
extern int exect (const char *, const char **, char **);
extern int execv (const char *, const char **);
extern int execve (const char *, const char **, char **);
extern int execvp (const char *, const char **);
extern void exit (int);
extern double exp (double);
extern double fabs (double);
extern int fchmod (int, mode_t);
extern int fchown (int, uid_t, gid_t);
extern int fclose (FILE *);
extern int fcntl (int, int, ...);
extern char * fcvt (double, int, int *, int *);
extern FILE * fdopen (int, const char *);
extern int feof (FILE *);
extern int ferror (FILE *);
extern int fflush (FILE *);
extern int ffs (int);
extern int fgetc (FILE *);
extern char * fgets (char *, int, FILE *);
extern int flock (int, int);
extern double floor (double);
extern double fmod (double);
extern FILE * fopen (const char *, const char *);
extern pid_t fork (void);
extern int fprintf (FILE *, const char *, ...);
extern int fputc (int, FILE *);
extern int fputs (const char *, FILE *);
extern int fread (void *, size_t, int, FILE *);
extern void free (void *);
extern FILE * freopen (const char *, const char *, FILE *);
extern double frexp (double, int);
extern int fscanf (FILE *, const char *, ...);
extern int fseek (FILE *, long, int);
extern int fstat (int, struct stat *);
extern int fsync (int);
extern long ftell (FILE *);
extern long ftok (const char *, int);
extern int ftruncate (int, unsigned long);
extern int fwrite (void *, size_t, int, FILE *);
extern double gamma (double);
extern char * gcvt (double, int, char *);
extern char * getcwd (char *, int);
extern int getdomainname (char *, int);
extern int getdtablesize (void);
extern gid_t getegid (void);
extern char * getenv (const char *);
extern uid_t geteuid (void);
extern gid_t getgid (void);
extern int getgroups (int, int *);
extern long gethostid (void);
extern int gethostname (char *, int);
extern char * getlogin (void);
extern int getopt (int, char **, char *);
extern int getpagesize (void);
extern char * getpass (const char *);
extern pid_t getpgrp2 (pid_t);
extern pid_t getpgrp (void);
extern pid_t getpid (void);
extern pid_t getppid (void);
extern int getpriority (int, int);
extern int getpw (int, char *);
extern void getrlimit (int, struct rlimit *);
extern void getrusage (int, struct rusage *);
extern char * gets (char *);
extern uid_t getuid (void);
extern char * getwd (char *);
extern struct tm * gmtime (time_t *);
extern int host2netname (char *, char *, char *);
extern double hypot (double, double);
extern char * index (const char *, int);
extern char * initstate (unsigned, char *, int);
extern int ioctl (int, int, char *);
extern int isatty (int);
extern int isinf (double);
extern double j0 (double);
extern double j1 (double);
extern double jn (int, double);
extern long jrand48 (short *);
extern int kill (pid_t, int);
extern int killpg (int, int);
extern long labs (long);
extern void lcong48 (short *);
extern double ldexp (double, int);
extern ldiv_t ldiv (int, int);
extern int link (const char *, const char *);
extern struct tm * localtime (time_t *);
extern int lock (int, int, long);
extern double log10 (double);
extern double log (double);
extern void longjmp (jmp_buf, int);
extern long lrand48 (void);
extern long lseek (int, long, int);
extern struct mallinfo mallinfo (void);
extern void * malloc (size_t);
extern void * memalign (unsigned, unsigned);
extern void * memccpy (void *, const void *, int, size_t);
extern void * memchr (const void *, int, size_t);
extern int memcmp (const void *, const void *, size_t);
extern void * memcpy (void *, const void *, size_t);
extern void * memset (void *, int, size_t);
extern int mkdir (const char *, mode_t);
extern int mknod (const char *, mode_t, int);
extern int mkstemp (char *);
extern char * mktemp (char *);
extern time_t mktime (struct tm *);
extern double modf (double, int);
extern long mrand48 (void);
extern int nice (int);
extern long nrand48 (short *);
extern int open (const char *, int, ...);
extern DIR * opendir (char *);
extern void pause (void);
extern int pclose (FILE *);
extern void perror (const char *);
extern int pipe (int *);
extern FILE * popen (char *, char *);
extern double pow (double, double);
extern int printf (const char *, ...);
extern void profil (char *, int, int, int);
extern int psignal (unsigned, char *);
extern int ptrace (int, int, int, int);
extern int putenv (const char *);
extern int puts (const char *);
extern int qsort (void *, int, unsigned, int (*) (const void *, const void *));
extern int raise (int);
extern int rand (void);
extern long random (void);
extern int read (int, void *, size_t);
extern struct direct * readdir (DIR *);
extern int readlink (const char *, char *, int);
extern void * realloc (void *, size_t);
extern int remove (const char *);
extern int rename (const char *, const char *);
extern void rewind (FILE *);
extern char * rindex (const char *, int);
extern int rmdir (const char *);
extern void * sbrk (int);
extern int scanf (const char *, ...);
extern short * seed48 (short *);
extern void seekdir (DIR *, long);
extern int send (int, char *, int, int);
extern FILE * setexportent (void);
extern int setgid (gid_t);
extern int sethostname (char *, int);
extern int setjmp (jmp_buf);
extern int setkey (const char *);
extern FILE * setmntent (char *, char *);
extern int setpgid (pid_t, pid_t);
extern int setpgrp2 (pid_t, pid_t);
extern int setpgrp (pid_t);
extern int setpriority (int, int, int);
extern int setregid (gid_t, gid_t);
extern int setreuid (uid_t, uid_t);
extern void setrlimit (int, struct rlimit *);
extern pid_t setsid (void);
extern char * setstate (char *);
extern int setuid (uid_t);
extern int sigblock (int);
extern int sighold (int);
extern int sigignore (int);
extern int siginterrupt (int, int);
extern void siglongjmp (sigjmp_buf, int);
extern SIGHAN_T (* signal (int, SIGHAN_T (*) (int, ...))) (int, ...);
extern int sigpause (int);
extern int sigrelse (int);
extern void (* sigset (int, void (*) (int, ...))) (int, ...);
extern int sigsetjmp (sigjmp_buf, int);
extern int sigsetmask (int);
extern double sin (double);
extern double sinh (double);
extern unsigned sleep (unsigned);
extern char * sprintf (char *, const char *, ...);
extern double sqrt (double);
extern void srand48 (long);
extern int srand (int);
extern int srand (int);
extern void srandom (int);
extern int sscanf (char *, const char *, ...);
extern int stat (const char *, struct stat *);
extern int stime (long *);
extern char * strcat (char *, const char *);
extern char * strchr (const char *, int);
extern int strcmp (const char *, const char *);
extern char * strcpy (char *, const char *);
extern size_t strcspn (const char *, const char *);
extern char * strdup (const char *);
extern size_t strftime (char *, size_t, char *, struct tm *);
extern size_t strlen (const char *);
extern char * strncat (char *, const char *, size_t);
extern int strncmp (const char *, const char *, size_t);
extern char * strncpy (char *, const char *, size_t);
extern char * strpbrk (const char *, const char *);
extern char * strrchr (const char *, int);
extern size_t strspn (const char *, const char *);
extern double strtod (const char *, char **);
extern char * strtok (char *, const char *);
extern long strtol (const char *, char **, int);
extern void swab (void *, void *, int);
extern int symlink (const char *, const char *);
extern int syscall (int, ...);
extern int system (const char *);
extern double tan (double);
extern double tanh (double);
extern pid_t tcgetpgrp (int);
extern int tcsetpgrp (int, pid_t);
extern long telldir (DIR *);
extern char * tempnam (char *, char *);
extern int tgetent (char *, char *);
extern int tgetflag (char *);
extern int tgetnum (char *);
extern char * tgetstr (char *, char * *);
extern char * tgoto (char *, int, int);
extern time_t time (time_t *);
extern char * timezone (int, int);
extern FILE * tmpfile (void);
extern char * tmpnam (char *);
extern int truncate (const char *, unsigned long);
extern char * ttyname (int);
extern int ttyslot (void);
extern void tzset (void);
extern unsigned ualarm (unsigned, unsigned);
extern long ulimit (int, long);
extern mode_t umask (mode_t);
extern void undial (int);
extern int ungetc (int, FILE *);
extern int unlink (const char *);
extern unsigned usleep (unsigned);
extern int vadvise (int);
extern void * valloc (size_t);
extern pid_t vfork (void);
extern int vfprintf (FILE *, const char *, ...);
extern int vhangup (void);
extern int vprintf (char *, ...);
extern int vsprintf (char *, const char *, ...);
extern pid_t wait3 (union wait *, int, struct rusage *);
extern pid_t wait (WAIT_ARG_TYPE *);
extern pid_t waitpid (pid_t, int *, int);
extern int write (int, const void *, size_t);
extern double y0 (double);
extern double y1 (double);
extern double yn (int, double);
extern int yp_bind (char *);
extern void yp_unbind (char *);