source: trunk/third/perl/epoc/epoc_stubs.c @ 14545

Revision 14545, 1.3 KB checked in by ghudson, 24 years ago (diff)
This commit was generated by cvs2svn to compensate for changes in r14544, which included commits to RCS files with non-trunk default branches.
Line 
1/*
2 *    Copyright (c) 1999 Olaf Flebbe o.flebbe@gmx.de
3 *   
4 *    You may distribute under the terms of either the GNU General Public
5 *    License or the Artistic License, as specified in the README file.
6 *
7 */
8
9#include <string.h>
10
11char *environ = 0;
12
13int getgid() {return 0;}
14int getegid() {return 0;}
15int geteuid() {return 0;}
16int getuid() {return 0;}
17int setgid() {return -1;}
18int setuid() {return -1;}
19
20
21int Perl_my_popen( int a, int b) {
22         return NULL;
23}
24int Perl_my_pclose( int a) {
25         return NULL;
26}
27
28int kill() {return -1;}
29signal() { }
30
31int execv() { return -1;}
32int execvp() { return -1;}
33
34void Perl_do_exec() {}
35
36/*------------------------------------------------------------------*/
37/* Two dummy functions implement getproto*                          */
38/*------------------------------------------------------------------*/
39#include <sys/types.h>
40#include <netdb.h>
41#include <netinet/in.h>
42
43
44static struct protoent protos[2] = {
45  {"tcp",  NULL, IPPROTO_TCP} ,
46  {"udp",  NULL, IPPROTO_UDP}};
47
48struct protoent *getprotobyname (const char *st) {
49   
50  if (!strcmp( st, "tcp")) {
51    return &protos[0];
52  }
53  if (!strcmp( st, "udp")) {
54    return &protos[1];
55  }
56  return NULL;
57}
58
59struct protoent *getprotobynumber ( int i) {
60  if (i == IPPROTO_TCP) {
61     return &protos[0];
62  }
63  if (i == IPPROTO_UDP) {
64    return &protos[1];
65  }
66  return NULL;
67}
68
69
Note: See TracBrowser for help on using the repository browser.