4 * Copyright (c) Nokia 2004-2005. All rights reserved.
5 * This code is licensed under the same terms as Perl itself.
11 #include "symbian_stubs.h"
13 static int setENOSYS(void) { errno = ENOSYS; return -1; }
15 uid_t getuid(void) { return setENOSYS(); }
16 gid_t getgid(void) { return setENOSYS(); }
17 uid_t geteuid(void) { return setENOSYS(); }
18 gid_t getegid(void) { return setENOSYS(); }
20 int setuid(uid_t uid) { return setENOSYS(); }
21 int setgid(gid_t gid) { return setENOSYS(); }
22 int seteuid(uid_t uid) { return setENOSYS(); }
23 int setegid(gid_t gid) { return setENOSYS(); }
25 int execv(const char* path, char* const argv []) { return setENOSYS(); }
26 int execvp(const char* path, char* const argv []) { return setENOSYS(); }
29 FILE *popen(const char *command, const char *mode) { return 0; }
30 int pclose(FILE *stream) { return setENOSYS(); }
32 int pipe(int fd[2]) { return setENOSYS(); }
34 int setmode(int fd, long flags) { return -1; }
36 _sig_func_ptr signal(int signum, _sig_func_ptr handler) { return (_sig_func_ptr)setENOSYS(); }
37 int kill(pid_t pid, int signum) { return setENOSYS(); }
38 pid_t wait(int *status) { return setENOSYS(); }
41 void Perl_my_setenv(pTHX_ char *var, char *val) { }
43 void Perl_my_setenv(pTHX_ const char *var, const char *val) { }
46 bool Perl_do_exec(pTHX_ const char *cmd) { return FALSE; }
47 bool Perl_do_exec3(pTHX_ const char *cmd, int fd, int flag) { return FALSE; }
49 int Perl_do_spawn(pTHX_ char *cmd) { return symbian_do_spawn(cmd); }
50 int Perl_do_aspawn(pTHX_ SV *really, SV** mark, SV **sp) { return symbian_do_aspawn(really, mark, sp); }
52 static const struct protoent protocols[] = {
57 /* The protocol field (the last) is left empty to save both space
58 * and time because practically all services have both tcp and udp
59 * allocations in IANA. */
60 static const struct servent services[] = {
61 { "http", 0, 80, 0 }, /* Optimization. */
62 { "https", 0, 443, 0 },
63 { "imap", 0, 143, 0 },
64 { "imaps", 0, 993, 0 },
71 { "pop3", 0, 110, 0 },
72 { "sftp", 0, 115, 0 },
73 { "nntp", 0, 119, 0 },
75 { "snmp", 0, 161, 0 },
76 { "ldap", 0, 389, 0 },
77 { "rsync", 0, 873, 0 },
78 { "socks", 0, 1080, 0 }
81 struct protoent* getprotobynumber(int number) {
83 for (i = 0; i < sizeof(protocols)/sizeof(struct protoent); i++)
84 if (protocols[i].p_proto == number)
85 return (struct protoent*)(&(protocols[i]));
89 struct protoent* getprotobyname(const char* name) {
91 for (i = 0; i < sizeof(protocols)/sizeof(struct protoent); i++)
92 if (strcmp(name, protocols[i].p_name) == 0)
93 return (struct protoent*)(&(protocols[i]));
97 struct servent* getservbyname(const char* name, const char* proto) {
99 for (i = 0; i < sizeof(services)/sizeof(struct servent); i++)
100 if (strcmp(name, services[i].s_name) == 0)
101 return (struct servent*)(&(services[i]));
105 struct servent* getservbyport(int port, const char* proto) {
107 for (i = 0; i < sizeof(services)/sizeof(struct servent); i++)
108 if (services[i].s_port == port)
109 return (struct servent*)(&(services[i]));