Add calloc for RT
[krb5.git] / src / include / fake-stdlib.h
1 #ifdef __STDC__
2 # define        P(s) s
3 #else
4 # define P(s) ()
5 #endif
6
7 #ifndef FD_SETSIZE
8 #include <sys/types.h>
9 #endif
10
11 #if defined(vax) || defined(__vax__)
12
13 /* following functions removed:
14    stdio
15    directory reading
16    DBM
17    signal(3)
18    alphasort(3), scandir(3)
19    accept(2)
20    bind(2)
21    connect(2)
22    getpeername(2)
23    getpriority(2)
24    getrlimit(2)
25    getrusage(2)
26    readv(2)
27    recvfrom(2)
28    recvmsg(2)
29    sendto(2)
30    sendmsg(2)
31    setrlimit(2)
32    sigvec(2)
33    sigreturn(2)
34    sigstack(2)
35    wait(2)
36    wait3(2)
37    writev(2)
38    ftime(2)
39    gtty(3)
40    inet_lnaof(3)
41    inet_netof(3)
42    in_addr(3)
43    inet_ntoa(3)
44    insque(3)
45    longjmp(3)
46    nlist(3)
47    ns_ntoa(3)
48    remque(3)
49    setjmp(3)
50    stty(3)
51    times(3)
52    vtimes(3)
53    adjtime(2)
54    fstat(2)
55    getitimer(2)
56    gettimeofday(2)
57    lstat(2)
58    select(2)
59    setitimer(2)
60    settimeofday(2)
61    stat(2)
62    utimes(2)
63    asctime(2)
64    monitor(3)
65    monstartup(3)
66    ctime(3)
67    gmtime(3)
68    localtime(3)
69  */
70
71 /* /usr/lib/lint/llib-lc */
72 /* /usr/lib/lint/llib-lc */
73 int access P((char *, int ));
74 int acct P((char *));
75 char *brk P((char *));
76 int chdir P((char *));
77 int chmod P((char *, int ));
78 int chown P((char *, int , int ));
79 int chroot P((char *));
80 int close P((int ));
81 int dup P((int ));
82 int dup2 P((int , int ));
83 int execve P((char *, char * [], char * []));
84 int _exit P((int ));
85 int fchmod P((int , int ));
86 int fchown P((int , int , int ));
87 int fcntl P((int , int , int ));
88 int flock P((int , int ));
89 int fork P((void ));
90 int fsync P((int ));
91 int ftruncate P((int , off_t ));
92 int getdtablesize P((void ));
93 gid_t getegid P((void ));
94 uid_t geteuid P((void ));
95 gid_t getgid P((void ));
96 int getgroups P((int , int *));
97 long gethostid P((void ));
98 int gethostname P((char *, int ));
99 int getpagesize P((void ));
100 int getpgrp P((int ));
101 int getpid P((void ));
102 int getppid P((void ));
103 uid_t getuid P((void ));
104 int ioctl P((int , u_long , char *));
105 int kill P((int , int ));
106 int killpg P((int , int ));
107 int listen P((int , int ));
108 int mount P((int , char *, int , caddr_t *));
109 int pipe P((int  [2 ]));
110 int profil P((char *, int , int , int ));
111 int ptrace P((int , int , int *, int ));
112 int quota P((int , int , int , char *));
113 int read P((int , char *, int ));
114 int reboot P((int ));
115 int recv P((int , char *, int , int ));
116 char *sbrk P((int ));
117 int setgroups P((int , int *));
118 int sethostid P((long ));
119 int sethostname P((char *, int ));
120 int setpgrp P((int , int ));
121 int setquota P((char *, char *));
122 int setregid P((int , int ));
123 int setreuid P((int , int ));
124 int shutdown P((int , int ));
125 void srandom P((int  ));
126 int swapon P((char *));
127 int sync P((void ));
128 int umask P((int ));
129 int umount P((char *));
130 int vfork P((void ));
131 int vhangup P((void ));
132 int write P((int , const char *, int ));
133 int abs P((int ));
134 int alarm P((unsigned ));
135 double atof P((char *));
136 int atoi P((char *));
137 long atol P((char *));
138 int bcmp P((char *, char *, int ));
139 int bcopy P((const char *, char *, int ));
140 int bzero P((char *, int ));
141 char *calloc P((unsigned , unsigned ));
142 void closelog P((void ));
143 int creat P((char *, int ));
144 char *crypt P((char *, char *));
145 char *ecvt P((double , int , int *, int *));
146 int encrypt P((char *, int ));
147 int endfsent P((void ));
148 int endgrent P((void ));
149 int endhostent P((void ));
150 int endnetent P((void ));
151 int endprotoent P((void ));
152 int endpwent P((void ));
153 int endservent P((void ));
154 int endttyent P((void ));
155 int endusershell P((void ));
156 int execl P((char *, char *, ...));
157 int execle P((char *, char *));
158 int execlp P((char *, char *, ...));
159 int execv P((char *, char * []));
160 int execvp P((char *, char * []));
161 int exect P((char *, char * [], char * []));
162 int exit P((int ));
163 char *fcvt P((double , int , int *, int *));
164 int ffs P((int ));
165 int free P((char *));
166 double frexp P((double , int *));
167 char *gcvt P((double , int , char *));
168 struct disktab *getdiskbyname P((char *));
169 char *getenv P((char *));
170 struct fstab *getfsent P((void ));
171 struct fstab *getfsspec P((char *));
172 struct fstab *getfsfile P((char *));
173 struct fstab *getfstype P((char *));
174 struct group *getgrent P((void ));
175 struct group *getgrgid P((int ));
176 struct group *getgrnam P((const char *));
177 char *getlogin P((void ));
178 int getopt P((int , char **, char *));
179 char *getpass P((char *));
180 int getpw P((int , char *));
181 struct passwd *getpwent P((void ));
182 struct passwd *getpwuid P((int ));
183 struct passwd *getpwnam P((const char *));
184 struct ttyent *getttynam P((const char *));
185 char *getusershell P((void ));
186 char *getwd P((char *));
187 u_long htonl P((u_long ));
188 u_short htons P((unsigned int ));
189 u_long inet_addr P((const char *));
190 u_long inet_network P((const char *));
191 int initgroups P((char *, int ));
192 char *initstate P((unsigned , char *, int ));
193 int isatty P((int ));
194 double ldexp P((double , int ));
195 int longjmperror P((void ));
196 #ifdef __STDC__
197 void *malloc P((size_t ));
198 #else
199 char *malloc P((unsigned ));
200 #endif
201 char *memccpy P((char *, char *, int , int ));
202 char *memchr P((char *, int , int ));
203 int memcmp P((char *, char *, int ));
204 char *memcpy P((char *, const char *, int ));
205 char *memset P((char *, int , int ));
206 char *mktemp P((char *));
207 int mkstemp P((char *));
208 double modf P((double , double *));
209 int moncontrol P((int ));
210 int nice P((int ));
211 struct ns_addr ns_addr P((char *));
212 u_long ntohl P((u_long ));
213 u_short ntohs P((unsigned int ));
214 void openlog P((const char *, int , int ));
215 int pause P((void ));
216 int perror P((const char * ));
217 int psignal P((unsigned , const char *));
218 int qsort P((char *, int , int , int (* )()));
219 int rand P((void ));
220 long random P((void ));
221 int rcmd P((char **, u_short , char *, char *, char *, int *));
222 char *re_comp P((char *));
223 int re_exec P((char *));
224 char *realloc P((char *, unsigned ));
225 int rexec P((char **, u_short , char *, char *, char *, int *));
226 int rresvport P((int *));
227 int ruserok P((char *, int , char *, char *));
228 int setegid P((gid_t ));
229 int seteuid P((uid_t ));
230 int setfsent P((void ));
231 int setgrent P((void ));
232 int setgid P((gid_t ));
233 int sethostent P((int ));
234 int setkey P((char *));
235 int setlogmask P((int ));
236 int setnetent P((int ));
237 int setprotoent P((int ));
238 int setpwent P((void ));
239 int setpwfile P((const char *));
240 int setrgid P((gid_t ));
241 int setruid P((uid_t ));
242 int setservent P((int ));
243 char *setstate P((char *));
244 int setttyent P((void ));
245 int setuid P((uid_t ));
246 int setusershell P((void ));
247 int siginterrupt P((int , int ));
248 int sleep P((unsigned ));
249 int srand P((int ));
250 int strlen P((const char *));
251 char *strncat P((char *, const char *, int ));
252 int strncmp P((const char *, const char *, int ));
253 char *strncpy P((char *, const char *, int ));
254 int swab P((char *, char *, int ));
255 void syslog P((int , const char *, ...));
256 int system P((char *));
257 long tell P((int ));
258 long time P((long *));
259 char *timezone P((int , int ));
260 char *tmpnam P((char *));
261 char *ttyname P((int ));
262 int ttyslot P((void ));
263 unsigned ualarm P((unsigned , unsigned ));
264 int usleep P((unsigned ));
265 int utime P((char *, time_t *));
266 char *valloc P((unsigned ));
267 int vlimit P((int , int ));
268 void abort P((void));
269
270 #endif /* VAX */
271
272 #if (defined(mips) && defined(ultrix)) || (defined(__mips__) && defined(__ultrix__)) || defined(__mips__) || defined(mips)
273
274 /* massaged from /usr/lib/lint/llib-lc, via watchbin/mkproto */
275 /* above functions removed, plus:
276    old DBM
277    sigset stuff
278    semctl
279    semget
280    semop
281    shmctl
282    shmget
283    uname
284    ustat
285    msg*
286    to*
287    is*
288    hsearch
289    ftok
290    getmnt
291    sprintf
292  */
293
294 /* /usr/lib/lint/llib-lc */
295 int access P((char * , int ));
296 int acct P((char * ));
297 #ifndef SYSTEM_FIVE
298 caddr_t brk P((caddr_t ));
299 #endif
300 caddr_t sbrk P((int  ));
301 #ifdef mips
302 int cachectl P((char * , int , int ));
303 int cacheflush P((char *, int , int ));
304 #endif
305 int chdir P((char * ));
306 int chmod P((char * , int  ));
307 int fchmod P((int  , int  ));
308 int chown P((char * , int  , int  ));
309 int fchown P((int  , int  , int ));
310 int chroot P((char * ));
311 int close P((int  ));
312 int creat P((char * , int  ));
313 int dup P((int  ));
314 int dup2 P((int , int  ));
315 int execve P((char * , char * [], char * []));
316 #ifndef SYSTEM_FIVE
317 int _exit P((int  ));
318 #endif
319 int exportfs P((char * , int  , int  ));
320 int fcntl P((int  , int  , int ));
321 int fork P((void ));
322 int getdirentries P((int  , char * , int  , long * ));
323 int getdomainname P((char * , int  ));
324 int setdomainname P((char * , int ));
325 #ifndef SYSTEM_FIVE
326 int getgid P((void ));
327 int getegid P((void ));
328 #endif
329 #ifndef SYSTEM_FIVE
330 int getpgrp P((int ));
331 #endif
332 int getpid P((void ));
333 int getppid P((void ));
334 #ifndef SYSTEM_FIVE
335 int getuid P((void ));
336 int geteuid P((void ));
337 #endif
338 #ifndef SYSTEM_FIVE
339 int ioctl P((int  , int  , char * ));
340 #endif
341 int kill P((int  , int  ));
342 int link P((char * , char * ));
343 off_t lseek P((int  , long  , int ));
344 #ifdef SYSTEM_FIVE
345 int madvise P((char * , int , int ));
346 int mmap P((char * , int  , int , int , int , off_t ));
347 int mincore P((char * , int  , char * ));
348 #endif
349 int mkdir P((char *, int  ));
350 int mknod P((char * , int , int ));
351 int mount P((char * , char * , int ));
352 int umount P((char * ));
353 #ifdef SYSTEM_FIVE
354 int mprotect P((char * , int , int ));
355 int mremap P((char * , int , int , int , int ));
356 int munmap P((char * , int ));
357 #endif
358 int nfs_svc P((int ));
359 void nfs_biod P((void ));
360 int open P((char * , int  , int  ));
361 int pipe P((int [2]));
362 #ifndef SYSTEM_FIVE
363 int profil P((char * , int , int , int ));
364 #endif
365 int ptrace P((int , int , int * , int  ));
366 #ifndef SYSTEM_FIVE
367 int read P((int , char * , int  ));
368 #endif
369 #ifndef SYSTEM_FIVE
370 int setpgrp P((int , int ));
371 #endif
372 #ifdef SYSTEM_FIVE
373 char *stk P((char * ));
374 char *sstk P((int  ));
375 #endif
376 void sync P((void ));
377 int umask P((int ));
378 int unlink P((char * ));
379 pid_t waitpid P((pid_t , int * , int ));
380 #ifndef SYSTEM_FIVE
381 int write P((int , char * , int  ));
382 #endif
383
384 void abort P((void ));
385 int abs P((int ));
386 #ifndef SYSTEM_FIVE
387 int alarm P((unsigned ));
388 #endif
389 char *crypt P((char * , char * ));
390 #ifndef SYSTEM_FIVE
391 void encrypt P((char * ));
392 #endif
393 #ifndef SYSTEM_FIVE
394 char *timezone P((int  , int  ));
395 #endif
396 char *ecvt P((double , int , int * , int * ));
397 char *fcvt P((double , int  , int * , int * ));
398 char *gcvt P((double , int , char * ));
399 int execl P((char * , char *, ...));
400 int execle P((char * , char * ));
401 int execv P((char * , char **));
402 int exect P((char *, char **, char ** ));
403 /* void exit P((int )); */
404 double frexp P((double , int * ));
405 double ldexp P((double , int  ));
406 double modf P((double , double * ));
407 struct disktab *getdiskbyname P((char * ));
408 char *getenv P((char * ));
409 struct fstab *getfsent P((void ));
410 struct fstab *getfsspec P((char * ));
411 struct fstab *getfsfile P((char * ));
412 struct fstab *getfstype P((char * ));
413 int endfsent P((void ));
414 int setfsent P((void ));
415 #ifndef SYSTEM_FIVE
416 struct group *getgrent P((void ));
417 struct group *getgrgid P((int ));
418 struct group *getgrnam P((const char * ));
419 int endgrent P((void ));
420 int setgrent P((void ));
421 #endif
422 char *getlogin P((void ));
423 struct hostent *gethostent P((void ));
424 struct hostent *gethostbyname P((char * ));
425 struct hostent *gethostbyaddr P((char * , int  , int  ));
426 void sethostent P((int ));
427 void endhostent P((void ));
428 struct netent *getnetent P((void ));
429 struct netent *getnetbyname P((char * ));
430 struct netent *getnetbyaddr P((int  , int ));
431 void setnetent P((int ));
432 void endnetent P((void ));
433 char *getpass P((char * ));
434 struct protoent *getprotoent P((void ));
435 struct protoent *getprotobyname P((char * ));
436 struct protoent *getprotobynumber P((int  ));
437 void setprotoent P((int ));
438 void endprotoent P((void ));
439 int getpw P((int , char * ));
440 #ifndef SYSTEM_FIVE
441 struct passwd *getpwent P((void ));
442 struct passwd *getpwuid P((int ));
443 struct passwd *getpwnam P((const char * ));
444 int endpwent P((void ));
445 int setpwent P((void ));
446 #endif
447 char *gets P((char * ));
448 struct servent *getservent P((void ));
449 struct servent *getservbyname P((char * , char * ));
450 struct servent *getservbyport P((int , char * ));
451 void setservent P((int ));
452 void endservent P((void ));
453 struct ttyent *getttyent P((void ));
454 struct ttyent *getttynam P((const char * ));
455 unsigned long inet_network P((const char * ));
456 int initgroups P((char * , int  ));
457 #ifdef __STDC__
458 void *malloc P((unsigned ));
459 #else
460 char *malloc P((unsigned ));
461 #endif
462 char *calloc P((unsigned , unsigned  ));
463 char *realloc P((char * , unsigned  ));
464 void free P((char * ));
465 char *alloca P((int  ));
466 int mkfifo P((char * , mode_t  ));
467 char *mktemp P((char * ));
468 #ifndef SYSTEM_FIVE
469 void monitor P((int (* )(), int (* )(), short * , int , int  ));
470 #endif
471 void monstartup P((int (* )(), int (* )()));
472 void moncontrol P((int ));
473 #ifndef SYSTEM_FIVE
474 void nice P((int ));
475 #endif
476 long pathconf P((char * , int  ));
477 long fpathconf P((int , int ));
478 int pause P((void ));
479 void perror P((char * ));
480 int printf P((const char *, ...));
481 int puts P((const char * ));
482 #ifndef SYSTEM_FIVE
483 int qsort P((char * , int  , int , int (* )()));
484 #endif
485 int rand P((void ));
486 void srand P((int ));
487 int rcmd P((char ** , u_short , char * , char * , char * , int * ));
488 int rresvport P((int * ));
489 int ruserok P((char * , int  , char * , char * ));
490 int rexec P((char ** , u_short  , char * , char * , char * , int * ));
491 int scanf P((const char *, ... ));
492 int sscanf P((const char * , const char *, ... ));
493 int setpgid P((pid_t  , pid_t  ));
494 int setuid P((int  ));
495 int seteuid P((int  ));
496 int setruid P((int  ));
497 int setgid P((int  ));
498 int setegid P((int  ));
499 int setrgid P((int  ));
500
501 int siginterrupt P((int  , int  ));
502 unsigned sleep P((unsigned  ));
503 int strcmp P((const char * , const char * ));
504 char *strcpy P((char * , const char * ));
505 int strlen P((const char * ));
506 char *strncat P((char * , const char * , int  ));
507 int strncmp P((const char * , const char * , int  ));
508 char *strncpy P((char * , const char * , int  ));
509 void swab P((char * , char * , int  ));
510 long sysconf P((int  ));
511 int system P((char * ));
512 char *ttyname P((int  ));
513 int isatty P((int  ));
514 int ttyslot P((void ));
515 int utime P((char * , time_t  []));
516
517 #ifndef SYSTEM_FIVE
518 int flock P((int  , int  ));
519 int fsync P((int  ));
520 int getdtablesize P((void ));
521 int getgroups P((int  , int * ));
522 int gethostid P((void ));
523 int sethostid P((int  ));
524 int gethostname P((char * , int  ));
525 int sethostname P((char * , int  ));
526 int getpagesize P((void ));
527 int getpriority P((int  , int  ));
528 int setpriority P((int  , int  , int  ));
529 int getsockname P((int  , char * , int * ));
530 int getsockopt P((int  , int  , int  , char * , int * ));
531 int setsockopt P((int  , int  , int  , const char * , int  ));
532 int killpg P((int  , int  ));
533 int listen P((int  , int  ));
534 int quota P((int  , int  , int  , caddr_t ));
535 int readlink P((char * , char * , int  ));
536 int reboot P((int  ));
537 int rename P((char * , char * ));
538 int rmdir P((char * ));
539 int send P((int  , char * , int , int  ));
540 int setgroups P((int  , int * ));
541 int setregid P((int  , int  ));
542 int setquota P((char * , char * ));
543 int setreuid P((int  , int  ));
544 pid_t setsid P((void ));
545 int shutdown P((int  , int  ));
546 int sigblock P((int  ));
547 int sigpause P((int  ));
548 int sigsetmask P((int  ));
549 int socket P((int , int  , int  ));
550 int socketpair P((int , int  , int  , int  [2 ]));
551 int swapon P((char * ));
552 int symlink P((char * , char * ));
553 int truncate P((char * , int  ));
554 int ftruncate P((int  , int  ));
555 int vfork P((void ));
556 void vhangup P((void ));
557 double atof P((char * ));
558 int atoi P((char * ));
559 long atol P((char * ));
560 void bcopy P((const char * , char * , int  ));
561 int bcmp P((char * , char * , int  ));
562 void bzero P((char * , int  ));
563 int ffs P((int  ));
564 char *getwd P((char * ));
565 void psignal P((unsigned  , char * ));
566 void srandom P((int  ));
567 long random P((void ));
568 char *initstate P((unsigned  , char * , int  ));
569 char *setstate P((char * ));
570 char *re_comp P((char * ));
571 int re_exec P((char * ));
572 void openlog P((const char * , int, int  )); /* our local version... */
573 void syslog P((int  , const char *, ... ));
574 void closelog P((void ));
575 char *valloc P((unsigned  ));
576 int vlimit P((int  , int  ));
577 #endif
578 int execlp P((char * , char *, ... ));
579 int execvp P((char * , char * []));
580 int plock P((int ));
581 char *shmat P((int  , char * , int  ));
582 int shmdt P((char * ));
583 void sys3b P((int  , int  , int  ));
584 long ulimit P((int  , long  ));
585 long a64l P((char * ));
586 char *l64a P((long  ));
587 void _assert P((char * , char * , int  ));
588 char *bsearch P((char * , char * , unsigned  , unsigned  , int (* )(char *, char *)));
589 long clock P((void ));
590 char *ctermid P((char * ));
591 char *cuserid P((char * ));
592 double drand48 P((void ));
593 double erand48 P((unsigned short  [3 ]));
594 long lrand48 P((void ));
595 long nrand48 P((unsigned short  [3 ]));
596 long mrand48 P((void ));
597 long jrand48 P((unsigned short  [3 ]));
598 void srand48 P((long s ));
599 unsigned short *seed48 P((unsigned short  [3 ]));
600 void lcong48 P((unsigned short  [7 ]));
601 char *getcwd P((char * , int  ));
602 int getopt P((int  , char ** , char * ));
603 int hcreate P((unsigned  ));
604 void hdestroy P((void ));
605 void l3tol P((long * , char * , int  ));
606 void ltol3 P((char * , long * , int  ));
607 char *lsearch P((char * , char * , unsigned * , unsigned  , int (* )(char *, char *)));
608 char *lfind P((char * , char * , unsigned * , unsigned  , int (* )(char *, char *)));
609 char *memccpy P((char * , char * , int  , int  ));
610 char *memchr P((char * , int  , int  ));
611 int memcmp P((char * , char * , int  ));
612 char *memcpy P((char * , const char * , int  ));
613 char *memset P((char * , int  , int  ));
614 int gsignal P((int  ));
615 double strtod P((char * , char ** ));
616 long strtol P((char * , char ** , int  ));
617 char *tmpnam P((char * ));
618 char *tempnam P((char * , char * ));
619 char *tsearch P((char * , char ** , int (* )(char *, char *)));
620 char *tfind P((char * , char ** , int (* )(char *, char *)));
621 char *tdelete P((char * , char ** , int (* )(char *, char *)));
622 void twalk P((char * , void (* )(char *, int, int)));
623 int syscall P((int  , int  , int  , int  ));
624 long tell P((int  ));
625
626 #ifdef SYSTEM_FIVE
627
628 unsigned alarm P((unsigned ));
629 int brk P((char * ));
630 void _exit P((int  ));
631 int getpgrp P((void ));
632 unsigned short getuid P((void ));
633 unsigned short geteuid P((void ));
634 unsigned short getgid P((void ));
635 unsigned short getegid P((void ));
636 int ioctl P((int  , int  , int  ));
637 int nice P((int  ));
638 void profil P((char * , int  , int  , int  ));
639 int read P((int  , char * , unsigned  ));
640 int setpgrp P((void ));
641 int write P((int  , char * , unsigned  ));
642 void setkey P((char * ));
643 void encrypt P((char * , int  ));
644 void tzset P((void ));
645 struct group *getgrent P((void ));
646 struct group *getgrgid P((int  ));
647 struct group *getgrnam P((char * ));
648 void setgrent P((void ));
649 void endgrent P((void ));
650 struct passwd *getpwent P((void ));
651 struct passwd *getpwuid P((int  ));
652 struct passwd *getpwnam P((const char * ));
653 void setpwent P((void ));
654 void endpwent P((void ));
655 void qsort P((char * , unsigned  , unsigned  , int (* )()));
656 #endif
657
658 #endif /* MIPS/Ultrix */
659
660 #ifdef ibm032
661 #ifndef memcpy
662 extern char *memcpy P((char *, const char *, int));
663 #endif
664 #ifndef memset
665 extern char *memset P((char *, int, int));
666 #endif
667 extern char *calloc P((unsigned int, unsigned int));
668 extern char *malloc P((unsigned int));
669 extern char *realloc P((char *, unsigned int));
670 extern void free P((char *));
671 extern void abort P((void));
672 extern char *getenv P((const char *));
673 #endif /* ibm032 */
674
675 #undef P