Comparison

util-src/pposix.c @ 1842:8337c0d4aee4

util.pposix: Compatibility with Solaris systems (thanks Filip)
author Matthew Wild <mwild1@gmail.com>
date Tue, 29 Sep 2009 14:22:02 +0100
parent 1579:95698f021c5d
child 2060:b23295b5428a
comparison
equal deleted inserted replaced
1841:0dc1daa94e7f 1842:8337c0d4aee4
89 89
90 /* Syslog support */ 90 /* Syslog support */
91 91
92 const char * const facility_strings[] = { 92 const char * const facility_strings[] = {
93 "auth", 93 "auth",
94 #if !(defined(sun) || defined(__sun))
94 "authpriv", 95 "authpriv",
96 #endif
95 "cron", 97 "cron",
96 "daemon", 98 "daemon",
99 #if !(defined(sun) || defined(__sun))
97 "ftp", 100 "ftp",
101 #endif
98 "kern", 102 "kern",
99 "local0", 103 "local0",
100 "local1", 104 "local1",
101 "local2", 105 "local2",
102 "local3", 106 "local3",
111 "uucp", 115 "uucp",
112 NULL 116 NULL
113 }; 117 };
114 int facility_constants[] = { 118 int facility_constants[] = {
115 LOG_AUTH, 119 LOG_AUTH,
120 #if !(defined(sun) || defined(__sun))
116 LOG_AUTHPRIV, 121 LOG_AUTHPRIV,
122 #endif
117 LOG_CRON, 123 LOG_CRON,
118 LOG_DAEMON, 124 LOG_DAEMON,
125 #if !(defined(sun) || defined(__sun))
119 LOG_FTP, 126 LOG_FTP,
127 #endif
120 LOG_KERN, 128 LOG_KERN,
121 LOG_LOCAL0, 129 LOG_LOCAL0,
122 LOG_LOCAL1, 130 LOG_LOCAL1,
123 LOG_LOCAL2, 131 LOG_LOCAL2,
124 LOG_LOCAL3, 132 LOG_LOCAL3,
363 int string2resource(const char *s) { 371 int string2resource(const char *s) {
364 if (!strcmp(s, "CORE")) return RLIMIT_CORE; 372 if (!strcmp(s, "CORE")) return RLIMIT_CORE;
365 if (!strcmp(s, "CPU")) return RLIMIT_CPU; 373 if (!strcmp(s, "CPU")) return RLIMIT_CPU;
366 if (!strcmp(s, "DATA")) return RLIMIT_DATA; 374 if (!strcmp(s, "DATA")) return RLIMIT_DATA;
367 if (!strcmp(s, "FSIZE")) return RLIMIT_FSIZE; 375 if (!strcmp(s, "FSIZE")) return RLIMIT_FSIZE;
376 if (!strcmp(s, "NOFILE")) return RLIMIT_NOFILE;
377 if (!strcmp(s, "STACK")) return RLIMIT_STACK;
378 #if !(defined(sun) || defined(__sun))
368 if (!strcmp(s, "MEMLOCK")) return RLIMIT_MEMLOCK; 379 if (!strcmp(s, "MEMLOCK")) return RLIMIT_MEMLOCK;
369 if (!strcmp(s, "NOFILE")) return RLIMIT_NOFILE;
370 if (!strcmp(s, "NPROC")) return RLIMIT_NPROC; 380 if (!strcmp(s, "NPROC")) return RLIMIT_NPROC;
371 if (!strcmp(s, "RSS")) return RLIMIT_RSS; 381 if (!strcmp(s, "RSS")) return RLIMIT_RSS;
372 if (!strcmp(s, "STACK")) return RLIMIT_STACK; 382 #endif
373 return -1; 383 return -1;
374 } 384 }
375 385
376 int lc_setrlimit(lua_State *L) { 386 int lc_setrlimit(lua_State *L) {
377 int arguments = lua_gettop(L); 387 int arguments = lua_gettop(L);