/* [<][>][^][v][top][bottom][index][help] */
DEFINITIONS
This source file includes following definitions.
- auxsyslib_sys_abort
- auxsyslib__25sys_realpath
- auxsyslib_fmod
- auxsyslib_frexp
- auxsyslib_modf
- auxsyslib_ldexp
- auxsyslib_log10
- auxsyslib__25sys_getloadavg
- auxsyslib__25sys_gettimeofday
- auxsyslib_sys_mkfifo
- auxsyslib_sys_utime
- auxsyslib_sys_setgid
- auxsyslib_sys_setpgid
- auxsyslib__25sys_getpgid
- auxsyslib_sys_getpgrp
- auxsyslib_sys_setsid
- auxsyslib_sys_setuid
- auxsyslib_sys_getgroups
- auxsyslib_sys_getlogin
- auxsyslib_sys_times
- auxsyslib_sys_uname
- auxsyslib__25sys_gethostname
- auxsyslib__25sys_getdomainname
- auxsyslib__25sys_putenv
- auxsyslib__25sys_setenv
- auxsyslib__25sys_unsetenv
- auxsyslib_sys_ctermid
- auxsyslib_sys_chown
- auxsyslib__25sys_lchown
- auxsyslib_sys_localeconv
- Scm_Init_auxsyslib
1 /* Generated by genstub. Do not edit. */
2 #include <gauche.h>
3 #if defined(__CYGWIN__) || defined(__MINGW32__)
4 #define SCM_CGEN_CONST /*empty*/
5 #else
6 #define SCM_CGEN_CONST const
7 #endif
8
9 #include "auxsysconf.h"
10 #if TIME_WITH_SYS_TIME
11 # include <sys/time.h>
12 # include <time.h>
13 #else
14 # if HAVE_SYS_TIME_H
15 # include <sys/time.h>
16 # else
17 # include <time.h>
18 # endif
19 #endif
20
21 #ifdef HAVE_SYS_LOADAVG_H
22 # include <sys/loadavg.h>
23 #endif /*HAVE_SYS_LOADAVG_H*/
24
25 #include <stdlib.h>
26 #include <math.h>
27 #include <locale.h>
28 #include <sys/types.h>
29 #include <sys/stat.h>
30 #include <unistd.h>
31 #include <utime.h>
32 #ifndef __MINGW32__
33 # include <sys/times.h>
34 # include <sys/utsname.h>
35 #endif /*!__MINGW32__ */
36
37 static ScmObj auxsyslib_sys_abort(ScmObj *SCM_FP, int SCM_ARGCNT, void *data_)
38 {
39 SCM_ENTER_SUBR("sys-abort");
40 {
41 abort();
42 SCM_RETURN(SCM_UNDEFINED);
43 }
44 }
45
46 static SCM_DEFINE_STRING_CONST(auxsyslib_sys_abort__NAME, "sys-abort", 9, 9);
47 static SCM_DEFINE_SUBR(auxsyslib_sys_abort__STUB, 0, 0, SCM_OBJ(&auxsyslib_sys_abort__NAME), auxsyslib_sys_abort, NULL, NULL);
48
49 #if defined HAVE_REALPATH
50 static ScmObj auxsyslib__25sys_realpath(ScmObj *SCM_FP, int SCM_ARGCNT, void *data_)
51 {
52 ScmObj path_scm;
53 const char * path;
54 SCM_ENTER_SUBR("%sys-realpath");
55 path_scm = SCM_ARGREF(0);
56 if (!SCM_STRINGP(path_scm)) Scm_Error("const C string required, but got %S", path_scm);
57 path = SCM_STRING_CONST_CSTRING(path_scm);
58 {
59 {
60 const char * SCM_RESULT;
61 #define REALPATH_PATH_MAX 1024 /* TODO: needs to be configured */
62 char buf[REALPATH_PATH_MAX];
63 if (realpath(path, buf) == NULL) {
64 Scm_SysError("realpath failed");
65 }
66 SCM_RESULT = buf;
67 SCM_RETURN(SCM_MAKE_STR_COPYING(SCM_RESULT));
68 }
69 }
70 }
71
72 static SCM_DEFINE_STRING_CONST(auxsyslib__25sys_realpath__NAME, "%sys-realpath", 13, 13);
73 static SCM_DEFINE_SUBR(auxsyslib__25sys_realpath__STUB, 1, 0, SCM_OBJ(&auxsyslib__25sys_realpath__NAME), auxsyslib__25sys_realpath, NULL, NULL);
74
75 #endif /*defined HAVE_REALPATH*/
76 static ScmObj auxsyslib_fmod(ScmObj *SCM_FP, int SCM_ARGCNT, void *data_)
77 {
78 ScmObj x_scm;
79 double x;
80 ScmObj y_scm;
81 double y;
82 SCM_ENTER_SUBR("fmod");
83 x_scm = SCM_ARGREF(0);
84 if (!SCM_REALP(x_scm)) Scm_Error("real number required, but got %S", x_scm);
85 x = Scm_GetDouble(x_scm);
86 y_scm = SCM_ARGREF(1);
87 if (!SCM_REALP(y_scm)) Scm_Error("real number required, but got %S", y_scm);
88 y = Scm_GetDouble(y_scm);
89 {
90 {
91 double SCM_RESULT;
92 SCM_RESULT = fmod(x, y);
93 SCM_RETURN(Scm_MakeFlonum(SCM_RESULT));
94 }
95 }
96 }
97
98 static SCM_DEFINE_STRING_CONST(auxsyslib_fmod__NAME, "fmod", 4, 4);
99 static SCM_DEFINE_SUBR(auxsyslib_fmod__STUB, 2, 0, SCM_OBJ(&auxsyslib_fmod__NAME), auxsyslib_fmod, NULL, NULL);
100
101 static ScmObj auxsyslib_frexp(ScmObj *SCM_FP, int SCM_ARGCNT, void *data_)
102 {
103 ScmObj d_scm;
104 double d;
105 SCM_ENTER_SUBR("frexp");
106 d_scm = SCM_ARGREF(0);
107 if (!SCM_REALP(d_scm)) Scm_Error("real number required, but got %S", d_scm);
108 d = Scm_GetDouble(d_scm);
109 {
110 double SCM_RESULT0;
111 int SCM_RESULT1;
112 {
113 SCM_RESULT0 = frexp(d, &SCM_RESULT1);
114 }
115 SCM_RETURN(Scm_Values2(Scm_MakeFlonum(SCM_RESULT0),Scm_MakeInteger(SCM_RESULT1)));
116 }
117 }
118
119 static SCM_DEFINE_STRING_CONST(auxsyslib_frexp__NAME, "frexp", 5, 5);
120 static SCM_DEFINE_SUBR(auxsyslib_frexp__STUB, 1, 0, SCM_OBJ(&auxsyslib_frexp__NAME), auxsyslib_frexp, NULL, NULL);
121
122 static ScmObj auxsyslib_modf(ScmObj *SCM_FP, int SCM_ARGCNT, void *data_)
123 {
124 ScmObj x_scm;
125 double x;
126 SCM_ENTER_SUBR("modf");
127 x_scm = SCM_ARGREF(0);
128 if (!SCM_REALP(x_scm)) Scm_Error("real number required, but got %S", x_scm);
129 x = Scm_GetDouble(x_scm);
130 {
131 double SCM_RESULT0;
132 double SCM_RESULT1;
133 {
134 SCM_RESULT0 = modf(x, &SCM_RESULT1);
135 }
136 SCM_RETURN(Scm_Values2(Scm_MakeFlonum(SCM_RESULT0),Scm_MakeFlonum(SCM_RESULT1)));
137 }
138 }
139
140 static SCM_DEFINE_STRING_CONST(auxsyslib_modf__NAME, "modf", 4, 4);
141 static SCM_DEFINE_SUBR(auxsyslib_modf__STUB, 1, 0, SCM_OBJ(&auxsyslib_modf__NAME), auxsyslib_modf, NULL, NULL);
142
143 static ScmObj auxsyslib_ldexp(ScmObj *SCM_FP, int SCM_ARGCNT, void *data_)
144 {
145 ScmObj x_scm;
146 double x;
147 ScmObj exp_scm;
148 int exp;
149 SCM_ENTER_SUBR("ldexp");
150 x_scm = SCM_ARGREF(0);
151 if (!SCM_REALP(x_scm)) Scm_Error("real number required, but got %S", x_scm);
152 x = Scm_GetDouble(x_scm);
153 exp_scm = SCM_ARGREF(1);
154 if (!SCM_EXACTP(exp_scm)) Scm_Error("C integer required, but got %S", exp_scm);
155 exp = Scm_GetInteger(exp_scm);
156 {
157 {
158 double SCM_RESULT;
159 SCM_RESULT = ldexp(x, exp);
160 SCM_RETURN(Scm_MakeFlonum(SCM_RESULT));
161 }
162 }
163 }
164
165 static SCM_DEFINE_STRING_CONST(auxsyslib_ldexp__NAME, "ldexp", 5, 5);
166 static SCM_DEFINE_SUBR(auxsyslib_ldexp__STUB, 2, 0, SCM_OBJ(&auxsyslib_ldexp__NAME), auxsyslib_ldexp, NULL, NULL);
167
168 static ScmObj auxsyslib_log10(ScmObj *SCM_FP, int SCM_ARGCNT, void *data_)
169 {
170 ScmObj x_scm;
171 double x;
172 SCM_ENTER_SUBR("log10");
173 x_scm = SCM_ARGREF(0);
174 if (!SCM_REALP(x_scm)) Scm_Error("real number required, but got %S", x_scm);
175 x = Scm_GetDouble(x_scm);
176 {
177 {
178 double SCM_RESULT;
179 SCM_RESULT = log10(x);
180 SCM_RETURN(Scm_MakeFlonum(SCM_RESULT));
181 }
182 }
183 }
184
185 static SCM_DEFINE_STRING_CONST(auxsyslib_log10__NAME, "log10", 5, 5);
186 static SCM_DEFINE_SUBR(auxsyslib_log10__STUB, 1, 0, SCM_OBJ(&auxsyslib_log10__NAME), auxsyslib_log10, NULL, NULL);
187
188 #if defined HAVE_GETLOADAVG
189 static ScmObj auxsyslib__25sys_getloadavg(ScmObj *SCM_FP, int SCM_ARGCNT, void *data_)
190 {
191 ScmObj nsamples_scm;
192 int nsamples;
193 ScmObj SCM_OPTARGS = SCM_ARGREF(SCM_ARGCNT-1);
194 SCM_ENTER_SUBR("%sys-getloadavg");
195 if (Scm_Length(SCM_OPTARGS) > 1)
196 Scm_Error("too many arguments: up to 1 is expected, %d given.", Scm_Length(SCM_OPTARGS));
197 if (SCM_NULLP(SCM_OPTARGS)) nsamples_scm = Scm_MakeInteger(3);
198 else {
199 nsamples_scm = SCM_CAR(SCM_OPTARGS);
200 SCM_OPTARGS = SCM_CDR(SCM_OPTARGS);
201 }
202 if (!SCM_EXACTP(nsamples_scm)) Scm_Error("C integer required, but got %S", nsamples_scm);
203 nsamples = Scm_GetInteger(nsamples_scm);
204 {
205 #define MAX_LOAD_SAMPLES 3
206 double samples[MAX_LOAD_SAMPLES];
207 int count, i;
208 ScmObj h = SCM_NIL, t = SCM_NIL;
209 if (nsamples <= 0 || nsamples > MAX_LOAD_SAMPLES) {
210 Scm_Error("sys-getloadavg: argument out of range: %d", samples);
211 }
212 count = getloadavg(samples, nsamples);
213 if (count < 0) SCM_RETURN(SCM_FALSE);
214 for (i=0; i<count; i++) {
215 ScmObj n = Scm_MakeFlonum(samples[i]);
216 SCM_APPEND1(h, t, n);
217 }
218 SCM_RETURN(h);
219 }
220 }
221
222 static SCM_DEFINE_STRING_CONST(auxsyslib__25sys_getloadavg__NAME, "%sys-getloadavg", 15, 15);
223 static SCM_DEFINE_SUBR(auxsyslib__25sys_getloadavg__STUB, 0, 1, SCM_OBJ(&auxsyslib__25sys_getloadavg__NAME), auxsyslib__25sys_getloadavg, NULL, NULL);
224
225 #endif /*defined HAVE_GETLOADAVG*/
226 #if defined HAVE_GETTIMEOFDAY
227 static ScmObj auxsyslib__25sys_gettimeofday(ScmObj *SCM_FP, int SCM_ARGCNT, void *data_)
228 {
229 SCM_ENTER_SUBR("%sys-gettimeofday");
230 {
231 int SCM_RESULT0;
232 int SCM_RESULT1;
233 {
234 struct timeval tv;
235 int r; SCM_SYSCALL(r, gettimeofday(&tv, NULL));
236 if (r < 0) Scm_SysError("gettimeofday failed");
237 SCM_RESULT0 = tv.tv_sec;
238 SCM_RESULT1 = tv.tv_usec;
239 }
240 SCM_RETURN(Scm_Values2(Scm_MakeInteger(SCM_RESULT0),Scm_MakeInteger(SCM_RESULT1)));
241 }
242 }
243
244 static SCM_DEFINE_STRING_CONST(auxsyslib__25sys_gettimeofday__NAME, "%sys-gettimeofday", 17, 17);
245 static SCM_DEFINE_SUBR(auxsyslib__25sys_gettimeofday__STUB, 0, 0, SCM_OBJ(&auxsyslib__25sys_gettimeofday__NAME), auxsyslib__25sys_gettimeofday, NULL, NULL);
246
247 #endif /*defined HAVE_GETTIMEOFDAY*/
248 #if !defined(__MINGW32__)
249 static ScmObj auxsyslib_sys_mkfifo(ScmObj *SCM_FP, int SCM_ARGCNT, void *data_)
250 {
251 ScmObj path_scm;
252 const char * path;
253 ScmObj mode_scm;
254 int mode;
255 SCM_ENTER_SUBR("sys-mkfifo");
256 path_scm = SCM_ARGREF(0);
257 if (!SCM_STRINGP(path_scm)) Scm_Error("const C string required, but got %S", path_scm);
258 path = SCM_STRING_CONST_CSTRING(path_scm);
259 mode_scm = SCM_ARGREF(1);
260 if (!SCM_EXACTP(mode_scm)) Scm_Error("C integer required, but got %S", mode_scm);
261 mode = Scm_GetInteger(mode_scm);
262 {
263 {
264 int SCM_RESULT;
265 SCM_SYSCALL(SCM_RESULT, mkfifo(path, mode));
266 if (SCM_RESULT < 0) Scm_SysError("mkfifo failed on %s", path);
267 SCM_RETURN(Scm_MakeInteger(SCM_RESULT));
268 }
269 }
270 }
271
272 static SCM_DEFINE_STRING_CONST(auxsyslib_sys_mkfifo__NAME, "sys-mkfifo", 10, 10);
273 static SCM_DEFINE_SUBR(auxsyslib_sys_mkfifo__STUB, 2, 0, SCM_OBJ(&auxsyslib_sys_mkfifo__NAME), auxsyslib_sys_mkfifo, NULL, NULL);
274
275 #endif /*!defined(__MINGW32__)*/
276 static ScmObj auxsyslib_sys_utime(ScmObj *SCM_FP, int SCM_ARGCNT, void *data_)
277 {
278 ScmObj path_scm;
279 const char * path;
280 ScmObj atime_scm;
281 ScmObj atime;
282 ScmObj mtime_scm;
283 ScmObj mtime;
284 ScmObj SCM_OPTARGS = SCM_ARGREF(SCM_ARGCNT-1);
285 SCM_ENTER_SUBR("sys-utime");
286 if (Scm_Length(SCM_OPTARGS) > 2)
287 Scm_Error("too many arguments: up to 2 is expected, %d given.", Scm_Length(SCM_OPTARGS));
288 path_scm = SCM_ARGREF(0);
289 if (!SCM_STRINGP(path_scm)) Scm_Error("const C string required, but got %S", path_scm);
290 path = SCM_STRING_CONST_CSTRING(path_scm);
291 if (SCM_NULLP(SCM_OPTARGS)) atime_scm = SCM_FALSE;
292 else {
293 atime_scm = SCM_CAR(SCM_OPTARGS);
294 SCM_OPTARGS = SCM_CDR(SCM_OPTARGS);
295 }
296 atime = (atime_scm);
297 if (SCM_NULLP(SCM_OPTARGS)) mtime_scm = SCM_FALSE;
298 else {
299 mtime_scm = SCM_CAR(SCM_OPTARGS);
300 SCM_OPTARGS = SCM_CDR(SCM_OPTARGS);
301 }
302 mtime = (mtime_scm);
303 {
304 struct utimbuf tim; int r;
305 if (SCM_FALSEP(atime)&&SCM_FALSEP(mtime)) {
306 SCM_SYSCALL(r, utime(path, NULL));
307 } else {
308 tim.actime = SCM_FALSEP(atime)?time(NULL):Scm_GetUInteger(atime);
309 tim.modtime = SCM_FALSEP(mtime)?time(NULL):Scm_GetUInteger(mtime);
310 SCM_SYSCALL(r, utime(path, &tim));
311 }
312 if (r < 0) Scm_SysError("utime failed on %s", path);
313 SCM_RETURN(SCM_UNDEFINED);
314 }
315 }
316
317 static SCM_DEFINE_STRING_CONST(auxsyslib_sys_utime__NAME, "sys-utime", 9, 9);
318 static SCM_DEFINE_SUBR(auxsyslib_sys_utime__STUB, 1, 1, SCM_OBJ(&auxsyslib_sys_utime__NAME), auxsyslib_sys_utime, NULL, NULL);
319
320 #if !defined(__MINGW32__)
321 static ScmObj auxsyslib_sys_setgid(ScmObj *SCM_FP, int SCM_ARGCNT, void *data_)
322 {
323 ScmObj gid_scm;
324 int gid;
325 SCM_ENTER_SUBR("sys-setgid");
326 gid_scm = SCM_ARGREF(0);
327 if (!SCM_EXACTP(gid_scm)) Scm_Error("C integer required, but got %S", gid_scm);
328 gid = Scm_GetInteger(gid_scm);
329 {
330 {
331 int SCM_RESULT;
332 SCM_SYSCALL(SCM_RESULT, setgid(gid));
333 if (SCM_RESULT < 0) Scm_SysError("setgid failed");
334 SCM_RETURN(Scm_MakeInteger(SCM_RESULT));
335 }
336 }
337 }
338
339 static SCM_DEFINE_STRING_CONST(auxsyslib_sys_setgid__NAME, "sys-setgid", 10, 10);
340 static SCM_DEFINE_SUBR(auxsyslib_sys_setgid__STUB, 1, 0, SCM_OBJ(&auxsyslib_sys_setgid__NAME), auxsyslib_sys_setgid, NULL, NULL);
341
342 #endif /*!defined(__MINGW32__)*/
343 #if !defined(__MINGW32__)
344 static ScmObj auxsyslib_sys_setpgid(ScmObj *SCM_FP, int SCM_ARGCNT, void *data_)
345 {
346 ScmObj pid_scm;
347 int pid;
348 ScmObj pgid_scm;
349 int pgid;
350 SCM_ENTER_SUBR("sys-setpgid");
351 pid_scm = SCM_ARGREF(0);
352 if (!SCM_EXACTP(pid_scm)) Scm_Error("C integer required, but got %S", pid_scm);
353 pid = Scm_GetInteger(pid_scm);
354 pgid_scm = SCM_ARGREF(1);
355 if (!SCM_EXACTP(pgid_scm)) Scm_Error("C integer required, but got %S", pgid_scm);
356 pgid = Scm_GetInteger(pgid_scm);
357 {
358 {
359 int SCM_RESULT;
360 SCM_SYSCALL(SCM_RESULT, setpgid(pid, pgid));
361 if (SCM_RESULT < 0) Scm_SysError("setpgid failed");
362 SCM_RETURN(Scm_MakeInteger(SCM_RESULT));
363 }
364 }
365 }
366
367 static SCM_DEFINE_STRING_CONST(auxsyslib_sys_setpgid__NAME, "sys-setpgid", 11, 11);
368 static SCM_DEFINE_SUBR(auxsyslib_sys_setpgid__STUB, 2, 0, SCM_OBJ(&auxsyslib_sys_setpgid__NAME), auxsyslib_sys_setpgid, NULL, NULL);
369
370 #endif /*!defined(__MINGW32__)*/
371 #if defined HAVE_GETPGID
372 static ScmObj auxsyslib__25sys_getpgid(ScmObj *SCM_FP, int SCM_ARGCNT, void *data_)
373 {
374 ScmObj pid_scm;
375 int pid;
376 SCM_ENTER_SUBR("%sys-getpgid");
377 pid_scm = SCM_ARGREF(0);
378 if (!SCM_EXACTP(pid_scm)) Scm_Error("C integer required, but got %S", pid_scm);
379 pid = Scm_GetInteger(pid_scm);
380 {
381 {
382 int SCM_RESULT;
383 SCM_SYSCALL(SCM_RESULT, (int)getpgid(pid));
384 if (SCM_RESULT < 0) Scm_SysError("getpgid failed");
385 SCM_RETURN(Scm_MakeInteger(SCM_RESULT));
386 }
387 }
388 }
389
390 static SCM_DEFINE_STRING_CONST(auxsyslib__25sys_getpgid__NAME, "%sys-getpgid", 12, 12);
391 static SCM_DEFINE_SUBR(auxsyslib__25sys_getpgid__STUB, 1, 0, SCM_OBJ(&auxsyslib__25sys_getpgid__NAME), auxsyslib__25sys_getpgid, NULL, NULL);
392
393 #endif /*defined HAVE_GETPGID*/
394 #if !defined(__MINGW32__)
395 static ScmObj auxsyslib_sys_getpgrp(ScmObj *SCM_FP, int SCM_ARGCNT, void *data_)
396 {
397 SCM_ENTER_SUBR("sys-getpgrp");
398 {
399 {
400 int SCM_RESULT;
401 SCM_SYSCALL(SCM_RESULT, (int)getpgrp());
402 if (SCM_RESULT < 0) Scm_SysError("getpgrp failed");
403 SCM_RETURN(Scm_MakeInteger(SCM_RESULT));
404 }
405 }
406 }
407
408 static SCM_DEFINE_STRING_CONST(auxsyslib_sys_getpgrp__NAME, "sys-getpgrp", 11, 11);
409 static SCM_DEFINE_SUBR(auxsyslib_sys_getpgrp__STUB, 0, 0, SCM_OBJ(&auxsyslib_sys_getpgrp__NAME), auxsyslib_sys_getpgrp, NULL, NULL);
410
411 #endif /*!defined(__MINGW32__)*/
412 #if !defined(__MINGW32__)
413 static ScmObj auxsyslib_sys_setsid(ScmObj *SCM_FP, int SCM_ARGCNT, void *data_)
414 {
415 SCM_ENTER_SUBR("sys-setsid");
416 {
417 {
418 int SCM_RESULT;
419 SCM_SYSCALL(SCM_RESULT, setsid());
420 if (SCM_RESULT < 0) Scm_SysError("setsid failed");
421 SCM_RETURN(Scm_MakeInteger(SCM_RESULT));
422 }
423 }
424 }
425
426 static SCM_DEFINE_STRING_CONST(auxsyslib_sys_setsid__NAME, "sys-setsid", 10, 10);
427 static SCM_DEFINE_SUBR(auxsyslib_sys_setsid__STUB, 0, 0, SCM_OBJ(&auxsyslib_sys_setsid__NAME), auxsyslib_sys_setsid, NULL, NULL);
428
429 #endif /*!defined(__MINGW32__)*/
430 #if !defined(__MINGW32__)
431 static ScmObj auxsyslib_sys_setuid(ScmObj *SCM_FP, int SCM_ARGCNT, void *data_)
432 {
433 ScmObj uid_scm;
434 int uid;
435 SCM_ENTER_SUBR("sys-setuid");
436 uid_scm = SCM_ARGREF(0);
437 if (!SCM_EXACTP(uid_scm)) Scm_Error("C integer required, but got %S", uid_scm);
438 uid = Scm_GetInteger(uid_scm);
439 {
440 {
441 int SCM_RESULT;
442 SCM_SYSCALL(SCM_RESULT, setuid(uid));
443 if (SCM_RESULT < 0) Scm_SysError("setuid failed");
444 SCM_RETURN(Scm_MakeInteger(SCM_RESULT));
445 }
446 }
447 }
448
449 static SCM_DEFINE_STRING_CONST(auxsyslib_sys_setuid__NAME, "sys-setuid", 10, 10);
450 static SCM_DEFINE_SUBR(auxsyslib_sys_setuid__STUB, 1, 0, SCM_OBJ(&auxsyslib_sys_setuid__NAME), auxsyslib_sys_setuid, NULL, NULL);
451
452 #endif /*!defined(__MINGW32__)*/
453 #if !defined(__MINGW32__)
454 static ScmObj auxsyslib_sys_getgroups(ScmObj *SCM_FP, int SCM_ARGCNT, void *data_)
455 {
456 SCM_ENTER_SUBR("sys-getgroups");
457 {
458
459 #ifndef NGROUPS
460 #define NGROUPS 32
461 #endif
462 gid_t glist[NGROUPS], *pglist = glist;
463 int size = NGROUPS;
464 for (;;) {
465 int i, n = getgroups(size, pglist);
466 if (n >= 0) {
467 ScmObj head = SCM_NIL, tail = SCM_NIL;
468 for (i=0; i<n; i++) SCM_APPEND1(head, tail, Scm_MakeInteger(pglist[i]));
469 SCM_RETURN(head);
470 }
471 if (errno == EINVAL) {
472 size += NGROUPS;
473 pglist = (gid_t *)SCM_MALLOC(size * sizeof(gid_t));
474 } else {
475 Scm_SysError("getgroups failed");
476 }
477 }
478 /* NOTREACHED */
479 }
480 }
481
482 static SCM_DEFINE_STRING_CONST(auxsyslib_sys_getgroups__NAME, "sys-getgroups", 13, 13);
483 static SCM_DEFINE_SUBR(auxsyslib_sys_getgroups__STUB, 0, 0, SCM_OBJ(&auxsyslib_sys_getgroups__NAME), auxsyslib_sys_getgroups, NULL, NULL);
484
485 #endif /*!defined(__MINGW32__)*/
486 static ScmObj auxsyslib_sys_getlogin(ScmObj *SCM_FP, int SCM_ARGCNT, void *data_)
487 {
488 SCM_ENTER_SUBR("sys-getlogin");
489 {
490 {
491 const char * SCM_RESULT;
492 SCM_RESULT = getlogin();
493 SCM_RETURN(SCM_MAKE_MAYBE(SCM_MAKE_STR_COPYING, SCM_RESULT));
494 }
495 }
496 }
497
498 static SCM_DEFINE_STRING_CONST(auxsyslib_sys_getlogin__NAME, "sys-getlogin", 12, 12);
499 static SCM_DEFINE_SUBR(auxsyslib_sys_getlogin__STUB, 0, 0, SCM_OBJ(&auxsyslib_sys_getlogin__NAME), auxsyslib_sys_getlogin, NULL, NULL);
500
501 #if !defined(__MINGW32__)
502 static ScmObj auxsyslib_sys_times(ScmObj *SCM_FP, int SCM_ARGCNT, void *data_)
503 {
504 SCM_ENTER_SUBR("sys-times");
505 {
506 struct tms info;
507 ScmObj h = SCM_NIL, t;
508 clock_t r = times(&info);
509 if (r == (clock_t)-1) Scm_SysError("times failed");
510 SCM_APPEND1(h, t, Scm_MakeInteger(info.tms_utime));
511 SCM_APPEND1(h, t, Scm_MakeInteger(info.tms_stime));
512 SCM_APPEND1(h, t, Scm_MakeInteger(info.tms_cutime));
513 SCM_APPEND1(h, t, Scm_MakeInteger(info.tms_cstime));
514 #ifdef _SC_CLK_TCK
515 SCM_APPEND1(h, t, Scm_MakeInteger(sysconf(_SC_CLK_TCK)));
516 #else
517 #ifdef CLK_TCK
518 SCM_APPEND1(h, t, Scm_MakeInteger(CLK_TCK)); /* older name */
519 #else
520 SCM_APPEND1(h, t, Scm_MakeInteger(1)); /* or maybe 100, we don't know ...*/
521 #endif
522 #endif
523 SCM_RETURN(h);
524 }
525 }
526
527 static SCM_DEFINE_STRING_CONST(auxsyslib_sys_times__NAME, "sys-times", 9, 9);
528 static SCM_DEFINE_SUBR(auxsyslib_sys_times__STUB, 0, 0, SCM_OBJ(&auxsyslib_sys_times__NAME), auxsyslib_sys_times, NULL, NULL);
529
530 #endif /*!defined(__MINGW32__)*/
531 #if !defined(__MINGW32__)
532 static ScmObj auxsyslib_sys_uname(ScmObj *SCM_FP, int SCM_ARGCNT, void *data_)
533 {
534 SCM_ENTER_SUBR("sys-uname");
535 {
536 struct utsname info;
537 ScmObj head = SCM_NIL, tail;
538 if (uname(&info) < 0) Scm_SysError("uname failed");
539 SCM_APPEND1(head, tail, SCM_MAKE_STR_COPYING(info.sysname));
540 SCM_APPEND1(head, tail, SCM_MAKE_STR_COPYING(info.nodename));
541 SCM_APPEND1(head, tail, SCM_MAKE_STR_COPYING(info.release));
542 SCM_APPEND1(head, tail, SCM_MAKE_STR_COPYING(info.version));
543 SCM_APPEND1(head, tail, SCM_MAKE_STR_COPYING(info.machine));
544 return head;
545 }
546 }
547
548 static SCM_DEFINE_STRING_CONST(auxsyslib_sys_uname__NAME, "sys-uname", 9, 9);
549 static SCM_DEFINE_SUBR(auxsyslib_sys_uname__STUB, 0, 0, SCM_OBJ(&auxsyslib_sys_uname__NAME), auxsyslib_sys_uname, NULL, NULL);
550
551 #endif /*!defined(__MINGW32__)*/
552 #ifndef HOSTNAMELEN
553 #define HOSTNAMELEN 1024
554 #endif
555 #if defined HAVE_GETHOSTNAME
556 static ScmObj auxsyslib__25sys_gethostname(ScmObj *SCM_FP, int SCM_ARGCNT, void *data_)
557 {
558 SCM_ENTER_SUBR("%sys-gethostname");
559 {
560 {
561 const char * SCM_RESULT;
562 char buf[HOSTNAMELEN]; int r;
563 SCM_SYSCALL(r, gethostname(buf, HOSTNAMELEN));
564 if (r < 0) Scm_SysError("gethostname failed");
565 SCM_RESULT = buf;
566 SCM_RETURN(SCM_MAKE_STR_COPYING(SCM_RESULT));
567 }
568 }
569 }
570
571 static SCM_DEFINE_STRING_CONST(auxsyslib__25sys_gethostname__NAME, "%sys-gethostname", 16, 16);
572 static SCM_DEFINE_SUBR(auxsyslib__25sys_gethostname__STUB, 0, 0, SCM_OBJ(&auxsyslib__25sys_gethostname__NAME), auxsyslib__25sys_gethostname, NULL, NULL);
573
574 #endif /*defined HAVE_GETHOSTNAME*/
575 #if defined HAVE_GETDOMAINNAME
576 static ScmObj auxsyslib__25sys_getdomainname(ScmObj *SCM_FP, int SCM_ARGCNT, void *data_)
577 {
578 SCM_ENTER_SUBR("%sys-getdomainname");
579 {
580 {
581 const char * SCM_RESULT;
582 char buf[HOSTNAMELEN]; int r;
583 SCM_SYSCALL(r, getdomainname(buf, HOSTNAMELEN));
584 if (r < 0) Scm_SysError("getdomainname failed");
585 SCM_RESULT = buf;
586 SCM_RETURN(SCM_MAKE_STR_COPYING(SCM_RESULT));
587 }
588 }
589 }
590
591 static SCM_DEFINE_STRING_CONST(auxsyslib__25sys_getdomainname__NAME, "%sys-getdomainname", 18, 18);
592 static SCM_DEFINE_SUBR(auxsyslib__25sys_getdomainname__STUB, 0, 0, SCM_OBJ(&auxsyslib__25sys_getdomainname__NAME), auxsyslib__25sys_getdomainname, NULL, NULL);
593
594 #endif /*defined HAVE_GETDOMAINNAME*/
595 #if defined HAVE_PUTENV
596 static ScmObj auxsyslib__25sys_putenv(ScmObj *SCM_FP, int SCM_ARGCNT, void *data_)
597 {
598 ScmObj name_scm;
599 ScmString* name;
600 ScmObj value_scm;
601 ScmString* value;
602 SCM_ENTER_SUBR("%sys-putenv");
603 name_scm = SCM_ARGREF(0);
604 if (!SCM_STRINGP(name_scm)) Scm_Error("string required, but got %S", name_scm);
605 name = SCM_STRING(name_scm);
606 value_scm = SCM_ARGREF(1);
607 if (!SCM_STRINGP(value_scm)) Scm_Error("string required, but got %S", value_scm);
608 value = SCM_STRING(value_scm);
609 {
610 char *buf;
611 u_int namelen, valuelen, len;
612 const char *cname = Scm_GetStringContent(name, &namelen, NULL, NULL);
613 const char *cvalue = Scm_GetStringContent(value, &valuelen, NULL, NULL);
614 len = namelen + valuelen + 2;
615 buf = (char*)malloc(len);
616 memcpy(buf, cname, namelen);
617 buf[namelen] = '=';
618 memcpy(buf+namelen+1, cvalue, valuelen);
619 buf[len-1] = '\0';
620 putenv(buf);
621 SCM_RETURN(SCM_UNDEFINED);
622 }
623 }
624
625 static SCM_DEFINE_STRING_CONST(auxsyslib__25sys_putenv__NAME, "%sys-putenv", 11, 11);
626 static SCM_DEFINE_SUBR(auxsyslib__25sys_putenv__STUB, 2, 0, SCM_OBJ(&auxsyslib__25sys_putenv__NAME), auxsyslib__25sys_putenv, NULL, NULL);
627
628 #endif /*defined HAVE_PUTENV*/
629 #if defined HAVE_SETENV
630 static ScmObj auxsyslib__25sys_setenv(ScmObj *SCM_FP, int SCM_ARGCNT, void *data_)
631 {
632 ScmObj name_scm;
633 const char * name;
634 ScmObj value_scm;
635 const char * value;
636 ScmObj overwrite_scm;
637 int overwrite;
638 SCM_ENTER_SUBR("%sys-setenv");
639 name_scm = SCM_ARGREF(0);
640 if (!SCM_STRINGP(name_scm)) Scm_Error("const C string required, but got %S", name_scm);
641 name = SCM_STRING_CONST_CSTRING(name_scm);
642 value_scm = SCM_ARGREF(1);
643 if (!SCM_STRINGP(value_scm)) Scm_Error("const C string required, but got %S", value_scm);
644 value = SCM_STRING_CONST_CSTRING(value_scm);
645 overwrite_scm = SCM_ARGREF(2);
646 if (!SCM_BOOLP(overwrite_scm)) Scm_Error("boolean required, but got %S", overwrite_scm);
647 overwrite = SCM_BOOL_VALUE(overwrite_scm);
648 {
649 setenv(name, value, overwrite);
650 SCM_RETURN(SCM_UNDEFINED);
651 }
652 }
653
654 static SCM_DEFINE_STRING_CONST(auxsyslib__25sys_setenv__NAME, "%sys-setenv", 11, 11);
655 static SCM_DEFINE_SUBR(auxsyslib__25sys_setenv__STUB, 3, 0, SCM_OBJ(&auxsyslib__25sys_setenv__NAME), auxsyslib__25sys_setenv, NULL, NULL);
656
657 #endif /*defined HAVE_SETENV*/
658 #if defined HAVE_UNSETENV
659 static ScmObj auxsyslib__25sys_unsetenv(ScmObj *SCM_FP, int SCM_ARGCNT, void *data_)
660 {
661 ScmObj name_scm;
662 const char * name;
663 SCM_ENTER_SUBR("%sys-unsetenv");
664 name_scm = SCM_ARGREF(0);
665 if (!SCM_STRINGP(name_scm)) Scm_Error("const C string required, but got %S", name_scm);
666 name = SCM_STRING_CONST_CSTRING(name_scm);
667 {
668 unsetenv(name);
669 SCM_RETURN(SCM_UNDEFINED);
670 }
671 }
672
673 static SCM_DEFINE_STRING_CONST(auxsyslib__25sys_unsetenv__NAME, "%sys-unsetenv", 13, 13);
674 static SCM_DEFINE_SUBR(auxsyslib__25sys_unsetenv__STUB, 1, 0, SCM_OBJ(&auxsyslib__25sys_unsetenv__NAME), auxsyslib__25sys_unsetenv, NULL, NULL);
675
676 #endif /*defined HAVE_UNSETENV*/
677 #if !defined(__MINGW32__)
678 static ScmObj auxsyslib_sys_ctermid(ScmObj *SCM_FP, int SCM_ARGCNT, void *data_)
679 {
680 SCM_ENTER_SUBR("sys-ctermid");
681 {
682 {
683 const char * SCM_RESULT;
684 char buf[L_ctermid+1]; SCM_RESULT = ctermid(buf);
685 SCM_RETURN(SCM_MAKE_STR_COPYING(SCM_RESULT));
686 }
687 }
688 }
689
690 static SCM_DEFINE_STRING_CONST(auxsyslib_sys_ctermid__NAME, "sys-ctermid", 11, 11);
691 static SCM_DEFINE_SUBR(auxsyslib_sys_ctermid__STUB, 0, 0, SCM_OBJ(&auxsyslib_sys_ctermid__NAME), auxsyslib_sys_ctermid, NULL, NULL);
692
693 #endif /*!defined(__MINGW32__)*/
694 #if !defined(__MINGW32__)
695 static ScmObj auxsyslib_sys_chown(ScmObj *SCM_FP, int SCM_ARGCNT, void *data_)
696 {
697 ScmObj path_scm;
698 const char * path;
699 ScmObj owner_scm;
700 int owner;
701 ScmObj group_scm;
702 int group;
703 SCM_ENTER_SUBR("sys-chown");
704 path_scm = SCM_ARGREF(0);
705 if (!SCM_STRINGP(path_scm)) Scm_Error("const C string required, but got %S", path_scm);
706 path = SCM_STRING_CONST_CSTRING(path_scm);
707 owner_scm = SCM_ARGREF(1);
708 if (!SCM_EXACTP(owner_scm)) Scm_Error("C integer required, but got %S", owner_scm);
709 owner = Scm_GetInteger(owner_scm);
710 group_scm = SCM_ARGREF(2);
711 if (!SCM_EXACTP(group_scm)) Scm_Error("C integer required, but got %S", group_scm);
712 group = Scm_GetInteger(group_scm);
713 {
714 {
715 int SCM_RESULT;
716 SCM_SYSCALL(SCM_RESULT, chown(path, owner, group));
717 if (SCM_RESULT < 0) Scm_SysError("chown failed on %s", path);
718 SCM_RETURN(Scm_MakeInteger(SCM_RESULT));
719 }
720 }
721 }
722
723 static SCM_DEFINE_STRING_CONST(auxsyslib_sys_chown__NAME, "sys-chown", 9, 9);
724 static SCM_DEFINE_SUBR(auxsyslib_sys_chown__STUB, 3, 0, SCM_OBJ(&auxsyslib_sys_chown__NAME), auxsyslib_sys_chown, NULL, NULL);
725
726 #endif /*!defined(__MINGW32__)*/
727 #if defined HAVE_LCHOWN
728 static ScmObj auxsyslib__25sys_lchown(ScmObj *SCM_FP, int SCM_ARGCNT, void *data_)
729 {
730 ScmObj path_scm;
731 const char * path;
732 ScmObj owner_scm;
733 int owner;
734 ScmObj group_scm;
735 int group;
736 SCM_ENTER_SUBR("%sys-lchown");
737 path_scm = SCM_ARGREF(0);
738 if (!SCM_STRINGP(path_scm)) Scm_Error("const C string required, but got %S", path_scm);
739 path = SCM_STRING_CONST_CSTRING(path_scm);
740 owner_scm = SCM_ARGREF(1);
741 if (!SCM_EXACTP(owner_scm)) Scm_Error("C integer required, but got %S", owner_scm);
742 owner = Scm_GetInteger(owner_scm);
743 group_scm = SCM_ARGREF(2);
744 if (!SCM_EXACTP(group_scm)) Scm_Error("C integer required, but got %S", group_scm);
745 group = Scm_GetInteger(group_scm);
746 {
747 {
748 int SCM_RESULT;
749 SCM_SYSCALL(SCM_RESULT, lchown(path, owner, group));
750 if (SCM_RESULT < 0) Scm_SysError("lchown failed on %S", path);
751 SCM_RETURN(Scm_MakeInteger(SCM_RESULT));
752 }
753 }
754 }
755
756 static SCM_DEFINE_STRING_CONST(auxsyslib__25sys_lchown__NAME, "%sys-lchown", 11, 11);
757 static SCM_DEFINE_SUBR(auxsyslib__25sys_lchown__STUB, 3, 0, SCM_OBJ(&auxsyslib__25sys_lchown__NAME), auxsyslib__25sys_lchown, NULL, NULL);
758
759 #endif /*defined HAVE_LCHOWN*/
760 static SCM_DEFINE_STRING_CONST(sym_decimal_point__NAME, "decimal_point", 13, 13);
761 static ScmObj sym_decimal_point = SCM_UNBOUND;
762 static SCM_DEFINE_STRING_CONST(sym_thousands_sep__NAME, "thousands_sep", 13, 13);
763 static ScmObj sym_thousands_sep = SCM_UNBOUND;
764 static SCM_DEFINE_STRING_CONST(sym_grouping__NAME, "grouping", 8, 8);
765 static ScmObj sym_grouping = SCM_UNBOUND;
766 static SCM_DEFINE_STRING_CONST(sym_int_curr_symbol__NAME, "int_curr_symbol", 15, 15);
767 static ScmObj sym_int_curr_symbol = SCM_UNBOUND;
768 static SCM_DEFINE_STRING_CONST(sym_currency_symbol__NAME, "currency_symbol", 15, 15);
769 static ScmObj sym_currency_symbol = SCM_UNBOUND;
770 static SCM_DEFINE_STRING_CONST(sym_mon_decimal_point__NAME, "mon_decimal_point", 17, 17);
771 static ScmObj sym_mon_decimal_point = SCM_UNBOUND;
772 static SCM_DEFINE_STRING_CONST(sym_mon_thousands_sep__NAME, "mon_thousands_sep", 17, 17);
773 static ScmObj sym_mon_thousands_sep = SCM_UNBOUND;
774 static SCM_DEFINE_STRING_CONST(sym_mon_grouping__NAME, "mon_grouping", 12, 12);
775 static ScmObj sym_mon_grouping = SCM_UNBOUND;
776 static SCM_DEFINE_STRING_CONST(sym_positive_sign__NAME, "positive_sign", 13, 13);
777 static ScmObj sym_positive_sign = SCM_UNBOUND;
778 static SCM_DEFINE_STRING_CONST(sym_negative_sign__NAME, "negative_sign", 13, 13);
779 static ScmObj sym_negative_sign = SCM_UNBOUND;
780 static SCM_DEFINE_STRING_CONST(sym_int_frac_digits__NAME, "int_frac_digits", 15, 15);
781 static ScmObj sym_int_frac_digits = SCM_UNBOUND;
782 static SCM_DEFINE_STRING_CONST(sym_frac_digits__NAME, "frac_digits", 11, 11);
783 static ScmObj sym_frac_digits = SCM_UNBOUND;
784 static SCM_DEFINE_STRING_CONST(sym_p_cs_precedes__NAME, "p_cs_precedes", 13, 13);
785 static ScmObj sym_p_cs_precedes = SCM_UNBOUND;
786 static SCM_DEFINE_STRING_CONST(sym_p_sep_by_space__NAME, "p_sep_by_space", 14, 14);
787 static ScmObj sym_p_sep_by_space = SCM_UNBOUND;
788 static SCM_DEFINE_STRING_CONST(sym_n_cs_precedes__NAME, "n_cs_precedes", 13, 13);
789 static ScmObj sym_n_cs_precedes = SCM_UNBOUND;
790 static SCM_DEFINE_STRING_CONST(sym_n_sep_by_space__NAME, "n_sep_by_space", 14, 14);
791 static ScmObj sym_n_sep_by_space = SCM_UNBOUND;
792 static SCM_DEFINE_STRING_CONST(sym_p_sign_posn__NAME, "p_sign_posn", 11, 11);
793 static ScmObj sym_p_sign_posn = SCM_UNBOUND;
794 static SCM_DEFINE_STRING_CONST(sym_n_sign_posn__NAME, "n_sign_posn", 11, 11);
795 static ScmObj sym_n_sign_posn = SCM_UNBOUND;
796 static ScmObj auxsyslib_sys_localeconv(ScmObj *SCM_FP, int SCM_ARGCNT, void *data_)
797 {
798 SCM_ENTER_SUBR("sys-localeconv");
799 {
800 struct lconv *lc = localeconv();
801 ScmObj h = SCM_NIL, t = SCM_NIL;
802
803 #define APPCONS(a, b) SCM_APPEND1(h, t, Scm_Cons(a, b))
804
805 APPCONS(sym_decimal_point, SCM_MAKE_STR_COPYING(lc->decimal_point));
806 APPCONS(sym_thousands_sep, SCM_MAKE_STR_COPYING(lc->thousands_sep));
807 APPCONS(sym_grouping, SCM_MAKE_STR_COPYING(lc->grouping));
808 APPCONS(sym_int_curr_symbol, SCM_MAKE_STR_COPYING(lc->int_curr_symbol));
809 APPCONS(sym_currency_symbol, SCM_MAKE_STR_COPYING(lc->currency_symbol));
810 APPCONS(sym_mon_decimal_point, SCM_MAKE_STR_COPYING(lc->mon_decimal_point));
811 APPCONS(sym_mon_thousands_sep, SCM_MAKE_STR_COPYING(lc->mon_thousands_sep));
812 APPCONS(sym_mon_grouping, SCM_MAKE_STR_COPYING(lc->mon_grouping));
813 APPCONS(sym_positive_sign, SCM_MAKE_STR_COPYING(lc->positive_sign));
814 APPCONS(sym_negative_sign, SCM_MAKE_STR_COPYING(lc->negative_sign));
815 APPCONS(sym_int_frac_digits, SCM_MAKE_INT(lc->int_frac_digits));
816 APPCONS(sym_frac_digits, SCM_MAKE_INT(lc->frac_digits));
817 APPCONS(sym_p_cs_precedes, SCM_MAKE_BOOL(lc->p_cs_precedes));
818 APPCONS(sym_p_sep_by_space, SCM_MAKE_BOOL(lc->p_sep_by_space));
819 APPCONS(sym_n_cs_precedes, SCM_MAKE_BOOL(lc->n_cs_precedes));
820 APPCONS(sym_n_sep_by_space, SCM_MAKE_BOOL(lc->n_sep_by_space));
821 APPCONS(sym_p_sign_posn, SCM_MAKE_INT(lc->p_sign_posn));
822 APPCONS(sym_n_sign_posn, SCM_MAKE_INT(lc->n_sign_posn));
823 #undef APPCONS
824 return h;
825 }
826 }
827
828 static SCM_DEFINE_STRING_CONST(auxsyslib_sys_localeconv__NAME, "sys-localeconv", 14, 14);
829 static SCM_DEFINE_SUBR(auxsyslib_sys_localeconv__STUB, 0, 0, SCM_OBJ(&auxsyslib_sys_localeconv__NAME), auxsyslib_sys_localeconv, NULL, NULL);
830
831 void Scm_Init_auxsyslib(ScmModule *module)
832 {
833
834 SCM_DEFINE(module, "sys-localeconv", SCM_OBJ(&auxsyslib_sys_localeconv__STUB));
835 sym_n_sign_posn = Scm_Intern(&sym_n_sign_posn__NAME);
836 sym_p_sign_posn = Scm_Intern(&sym_p_sign_posn__NAME);
837 sym_n_sep_by_space = Scm_Intern(&sym_n_sep_by_space__NAME);
838 sym_n_cs_precedes = Scm_Intern(&sym_n_cs_precedes__NAME);
839 sym_p_sep_by_space = Scm_Intern(&sym_p_sep_by_space__NAME);
840 sym_p_cs_precedes = Scm_Intern(&sym_p_cs_precedes__NAME);
841 sym_frac_digits = Scm_Intern(&sym_frac_digits__NAME);
842 sym_int_frac_digits = Scm_Intern(&sym_int_frac_digits__NAME);
843 sym_negative_sign = Scm_Intern(&sym_negative_sign__NAME);
844 sym_positive_sign = Scm_Intern(&sym_positive_sign__NAME);
845 sym_mon_grouping = Scm_Intern(&sym_mon_grouping__NAME);
846 sym_mon_thousands_sep = Scm_Intern(&sym_mon_thousands_sep__NAME);
847 sym_mon_decimal_point = Scm_Intern(&sym_mon_decimal_point__NAME);
848 sym_currency_symbol = Scm_Intern(&sym_currency_symbol__NAME);
849 sym_int_curr_symbol = Scm_Intern(&sym_int_curr_symbol__NAME);
850 sym_grouping = Scm_Intern(&sym_grouping__NAME);
851 sym_thousands_sep = Scm_Intern(&sym_thousands_sep__NAME);
852 sym_decimal_point = Scm_Intern(&sym_decimal_point__NAME);
853 #if defined HAVE_LCHOWN
854 SCM_DEFINE(module, "%sys-lchown", SCM_OBJ(&auxsyslib__25sys_lchown__STUB));
855 #endif /* defined HAVE_LCHOWN */
856 #if !defined(__MINGW32__)
857 SCM_DEFINE(module, "sys-chown", SCM_OBJ(&auxsyslib_sys_chown__STUB));
858 #endif /* !defined(__MINGW32__) */
859 #if !defined(__MINGW32__)
860 SCM_DEFINE(module, "sys-ctermid", SCM_OBJ(&auxsyslib_sys_ctermid__STUB));
861 #endif /* !defined(__MINGW32__) */
862 #if defined HAVE_UNSETENV
863 SCM_DEFINE(module, "%sys-unsetenv", SCM_OBJ(&auxsyslib__25sys_unsetenv__STUB));
864 #endif /* defined HAVE_UNSETENV */
865 #if defined HAVE_SETENV
866 SCM_DEFINE(module, "%sys-setenv", SCM_OBJ(&auxsyslib__25sys_setenv__STUB));
867 #endif /* defined HAVE_SETENV */
868 #if defined HAVE_PUTENV
869 SCM_DEFINE(module, "%sys-putenv", SCM_OBJ(&auxsyslib__25sys_putenv__STUB));
870 #endif /* defined HAVE_PUTENV */
871 #if defined HAVE_GETDOMAINNAME
872 SCM_DEFINE(module, "%sys-getdomainname", SCM_OBJ(&auxsyslib__25sys_getdomainname__STUB));
873 #endif /* defined HAVE_GETDOMAINNAME */
874 #if defined HAVE_GETHOSTNAME
875 SCM_DEFINE(module, "%sys-gethostname", SCM_OBJ(&auxsyslib__25sys_gethostname__STUB));
876 #endif /* defined HAVE_GETHOSTNAME */
877 #if !defined(__MINGW32__)
878 SCM_DEFINE(module, "sys-uname", SCM_OBJ(&auxsyslib_sys_uname__STUB));
879 #endif /* !defined(__MINGW32__) */
880 #if !defined(__MINGW32__)
881 SCM_DEFINE(module, "sys-times", SCM_OBJ(&auxsyslib_sys_times__STUB));
882 #endif /* !defined(__MINGW32__) */
883 SCM_DEFINE(module, "sys-getlogin", SCM_OBJ(&auxsyslib_sys_getlogin__STUB));
884 #if !defined(__MINGW32__)
885 SCM_DEFINE(module, "sys-getgroups", SCM_OBJ(&auxsyslib_sys_getgroups__STUB));
886 #endif /* !defined(__MINGW32__) */
887 #if !defined(__MINGW32__)
888 SCM_DEFINE(module, "sys-setuid", SCM_OBJ(&auxsyslib_sys_setuid__STUB));
889 #endif /* !defined(__MINGW32__) */
890 #if !defined(__MINGW32__)
891 SCM_DEFINE(module, "sys-setsid", SCM_OBJ(&auxsyslib_sys_setsid__STUB));
892 #endif /* !defined(__MINGW32__) */
893 #if !defined(__MINGW32__)
894 SCM_DEFINE(module, "sys-getpgrp", SCM_OBJ(&auxsyslib_sys_getpgrp__STUB));
895 #endif /* !defined(__MINGW32__) */
896 #if defined HAVE_GETPGID
897 SCM_DEFINE(module, "%sys-getpgid", SCM_OBJ(&auxsyslib__25sys_getpgid__STUB));
898 #endif /* defined HAVE_GETPGID */
899 #if !defined(__MINGW32__)
900 SCM_DEFINE(module, "sys-setpgid", SCM_OBJ(&auxsyslib_sys_setpgid__STUB));
901 #endif /* !defined(__MINGW32__) */
902 #if !defined(__MINGW32__)
903 SCM_DEFINE(module, "sys-setgid", SCM_OBJ(&auxsyslib_sys_setgid__STUB));
904 #endif /* !defined(__MINGW32__) */
905 SCM_DEFINE(module, "sys-utime", SCM_OBJ(&auxsyslib_sys_utime__STUB));
906 #if !defined(__MINGW32__)
907 SCM_DEFINE(module, "sys-mkfifo", SCM_OBJ(&auxsyslib_sys_mkfifo__STUB));
908 #endif /* !defined(__MINGW32__) */
909 #if defined HAVE_GETTIMEOFDAY
910 SCM_DEFINE(module, "%sys-gettimeofday", SCM_OBJ(&auxsyslib__25sys_gettimeofday__STUB));
911 #endif /* defined HAVE_GETTIMEOFDAY */
912 #if defined HAVE_GETLOADAVG
913 SCM_DEFINE(module, "%sys-getloadavg", SCM_OBJ(&auxsyslib__25sys_getloadavg__STUB));
914 #endif /* defined HAVE_GETLOADAVG */
915 SCM_DEFINE(module, "log10", SCM_OBJ(&auxsyslib_log10__STUB));
916 SCM_DEFINE(module, "ldexp", SCM_OBJ(&auxsyslib_ldexp__STUB));
917 SCM_DEFINE(module, "modf", SCM_OBJ(&auxsyslib_modf__STUB));
918 SCM_DEFINE(module, "frexp", SCM_OBJ(&auxsyslib_frexp__STUB));
919 SCM_DEFINE(module, "fmod", SCM_OBJ(&auxsyslib_fmod__STUB));
920 #if defined HAVE_REALPATH
921 SCM_DEFINE(module, "%sys-realpath", SCM_OBJ(&auxsyslib__25sys_realpath__STUB));
922 #endif /* defined HAVE_REALPATH */
923 SCM_DEFINE(module, "sys-abort", SCM_OBJ(&auxsyslib_sys_abort__STUB));
924 }