1999-09-14 09:32:05 -04:00
|
|
|
/* This is an Scheme48/C interface file,
|
1999-09-15 20:20:37 -04:00
|
|
|
** automatically generated by a hacked version of cig 3.0.
|
1999-09-23 19:02:54 -04:00
|
|
|
step 4
|
1999-09-14 09:32:05 -04:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h> /* For malloc. */
|
|
|
|
#include "libcig.h"
|
|
|
|
|
|
|
|
#include <sys/signal.h>
|
|
|
|
#include <sys/types.h>
|
|
|
|
#include <sys/times.h>
|
|
|
|
#include <sys/time.h>
|
|
|
|
#include <fcntl.h> /* for O_RDWR */
|
|
|
|
#include <sys/stat.h>
|
|
|
|
#include <netdb.h>
|
|
|
|
#include <pwd.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
|
|
|
|
/* Make sure foreign-function stubs interface to the C funs correctly: */
|
|
|
|
#include "dirstuff1.h"
|
|
|
|
#include "select1.h"
|
|
|
|
#include "syscalls1.h"
|
|
|
|
#include "userinfo1.h"
|
|
|
|
|
|
|
|
extern int errno;
|
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
#define errno_on_zero_or_false(x) ((x) ? S48_FALSE : s48_enter_fixnum(errno))
|
|
|
|
#define errno_or_false(x) (((x) == -1) ? s48_enter_fixnum(errno) : S48_FALSE)
|
|
|
|
#define False_on_zero(x) ((x) ? s48_enter_fixnum(x) : S48_FALSE)
|
1999-09-14 09:32:05 -04:00
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value df_scheme_exec(s48_value g1, s48_value g2, s48_value g3)
|
1999-09-14 09:32:05 -04:00
|
|
|
{
|
1999-09-15 20:20:37 -04:00
|
|
|
extern int scheme_exec(const char *, s48_value , s48_value );
|
|
|
|
s48_value ret1;
|
1999-11-04 11:00:28 -05:00
|
|
|
S48_DECLARE_GC_PROTECT(1);
|
1999-09-14 09:32:05 -04:00
|
|
|
int r1;
|
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
|
1999-11-04 11:00:28 -05:00
|
|
|
|
|
|
|
S48_GC_PROTECT_1(ret1);
|
1999-09-15 20:20:37 -04:00
|
|
|
r1 = scheme_exec(s48_extract_string(g1), g2, g3);
|
|
|
|
ret1 = s48_enter_fixnum(r1);
|
1999-11-04 11:00:28 -05:00
|
|
|
S48_GC_UNPROTECT();
|
1999-09-14 09:32:05 -04:00
|
|
|
return ret1;
|
1999-09-15 20:20:37 -04:00
|
|
|
}
|
1999-09-14 09:32:05 -04:00
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value df_exit(s48_value g1)
|
1999-09-14 09:32:05 -04:00
|
|
|
{
|
|
|
|
extern void exit(int );
|
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
|
|
|
|
exit(s48_extract_fixnum(g1));
|
|
|
|
return S48_FALSE;
|
|
|
|
}
|
1999-09-14 09:32:05 -04:00
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value df__exit(s48_value g1)
|
1999-09-14 09:32:05 -04:00
|
|
|
{
|
|
|
|
extern void _exit(int );
|
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
|
|
|
|
_exit(s48_extract_fixnum(g1));
|
|
|
|
return S48_FALSE;
|
|
|
|
}
|
1999-09-14 09:32:05 -04:00
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value df_fork(s48_value mv_vec)
|
1999-09-14 09:32:05 -04:00
|
|
|
{
|
|
|
|
extern pid_t fork(void);
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value ret1;
|
1999-11-04 11:00:28 -05:00
|
|
|
S48_DECLARE_GC_PROTECT(2);
|
1999-09-14 09:32:05 -04:00
|
|
|
pid_t r1;
|
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
|
1999-11-04 11:00:28 -05:00
|
|
|
|
|
|
|
S48_GC_PROTECT_2(mv_vec,ret1);
|
1999-09-14 09:32:05 -04:00
|
|
|
r1 = fork();
|
|
|
|
ret1 = errno_or_false(r1);
|
1999-09-15 20:20:37 -04:00
|
|
|
S48_VECTOR_SET(mv_vec,0,s48_enter_fixnum(r1));
|
1999-11-04 11:00:28 -05:00
|
|
|
S48_GC_UNPROTECT();
|
1999-09-14 09:32:05 -04:00
|
|
|
return ret1;
|
1999-09-15 20:20:37 -04:00
|
|
|
}
|
1999-09-14 09:32:05 -04:00
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value df_chdir(s48_value g1)
|
1999-09-14 09:32:05 -04:00
|
|
|
{
|
|
|
|
extern int chdir(const char *);
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value ret1;
|
1999-11-04 11:00:28 -05:00
|
|
|
S48_DECLARE_GC_PROTECT(1);
|
1999-09-14 09:32:05 -04:00
|
|
|
int r1;
|
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
|
1999-11-04 11:00:28 -05:00
|
|
|
|
|
|
|
S48_GC_PROTECT_1(ret1);
|
1999-09-15 20:20:37 -04:00
|
|
|
r1 = chdir(s48_extract_string(g1));
|
1999-09-14 09:32:05 -04:00
|
|
|
ret1 = errno_or_false(r1);
|
1999-11-04 11:00:28 -05:00
|
|
|
S48_GC_UNPROTECT();
|
1999-09-14 09:32:05 -04:00
|
|
|
return ret1;
|
1999-09-15 20:20:37 -04:00
|
|
|
}
|
1999-09-14 09:32:05 -04:00
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value df_scheme_cwd(s48_value mv_vec)
|
1999-09-14 09:32:05 -04:00
|
|
|
{
|
|
|
|
extern int scheme_cwd(const char **);
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value ret1;
|
1999-11-04 11:00:28 -05:00
|
|
|
S48_DECLARE_GC_PROTECT(2);
|
1999-09-14 09:32:05 -04:00
|
|
|
int r1;
|
|
|
|
const char *r2;
|
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
|
1999-11-04 11:00:28 -05:00
|
|
|
|
|
|
|
S48_GC_PROTECT_2(mv_vec,ret1);
|
1999-09-14 09:32:05 -04:00
|
|
|
r1 = scheme_cwd(&r2);
|
|
|
|
ret1 = False_on_zero(r1);
|
1999-09-23 10:36:25 -04:00
|
|
|
SetAlienVal(S48_CAR(S48_VECTOR_REF(mv_vec,0)),(long) r2); S48_SET_CDR(S48_VECTOR_REF(mv_vec,0),strlen_or_false(r2));//str-and-len
|
1999-11-04 11:00:28 -05:00
|
|
|
S48_GC_UNPROTECT();
|
1999-09-14 09:32:05 -04:00
|
|
|
return ret1;
|
1999-09-15 20:20:37 -04:00
|
|
|
}
|
1999-09-14 09:32:05 -04:00
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value df_getgid(void)
|
1999-09-14 09:32:05 -04:00
|
|
|
{
|
|
|
|
extern gid_t getgid(void);
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value ret1;
|
1999-11-04 11:00:28 -05:00
|
|
|
S48_DECLARE_GC_PROTECT(1);
|
1999-09-14 09:32:05 -04:00
|
|
|
gid_t r1;
|
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
|
1999-11-04 11:00:28 -05:00
|
|
|
|
|
|
|
S48_GC_PROTECT_1(ret1);
|
1999-09-14 09:32:05 -04:00
|
|
|
r1 = getgid();
|
1999-09-15 20:20:37 -04:00
|
|
|
ret1 = s48_enter_fixnum(r1);
|
1999-11-04 11:00:28 -05:00
|
|
|
S48_GC_UNPROTECT();
|
1999-09-14 09:32:05 -04:00
|
|
|
return ret1;
|
1999-09-15 20:20:37 -04:00
|
|
|
}
|
1999-09-14 09:32:05 -04:00
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value df_getegid(void)
|
1999-09-14 09:32:05 -04:00
|
|
|
{
|
|
|
|
extern gid_t getegid(void);
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value ret1;
|
1999-11-04 11:00:28 -05:00
|
|
|
S48_DECLARE_GC_PROTECT(1);
|
1999-09-14 09:32:05 -04:00
|
|
|
gid_t r1;
|
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
|
1999-11-04 11:00:28 -05:00
|
|
|
|
|
|
|
S48_GC_PROTECT_1(ret1);
|
1999-09-14 09:32:05 -04:00
|
|
|
r1 = getegid();
|
1999-09-15 20:20:37 -04:00
|
|
|
ret1 = s48_enter_fixnum(r1);
|
1999-11-04 11:00:28 -05:00
|
|
|
S48_GC_UNPROTECT();
|
1999-09-14 09:32:05 -04:00
|
|
|
return ret1;
|
1999-09-15 20:20:37 -04:00
|
|
|
}
|
1999-09-14 09:32:05 -04:00
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value df_setgid(s48_value g1)
|
1999-09-14 09:32:05 -04:00
|
|
|
{
|
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value ret1;
|
1999-11-04 11:00:28 -05:00
|
|
|
S48_DECLARE_GC_PROTECT(1);
|
1999-09-14 09:32:05 -04:00
|
|
|
int r1;
|
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
|
1999-11-04 11:00:28 -05:00
|
|
|
|
|
|
|
S48_GC_PROTECT_1(ret1);
|
1999-09-15 20:20:37 -04:00
|
|
|
r1 = setgid(s48_extract_fixnum(g1));
|
1999-09-14 09:32:05 -04:00
|
|
|
ret1 = errno_or_false(r1);
|
1999-11-04 11:00:28 -05:00
|
|
|
S48_GC_UNPROTECT();
|
1999-09-14 09:32:05 -04:00
|
|
|
return ret1;
|
1999-09-15 20:20:37 -04:00
|
|
|
}
|
1999-09-14 09:32:05 -04:00
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value df_num_supp_groups(s48_value mv_vec)
|
1999-09-14 09:32:05 -04:00
|
|
|
{
|
|
|
|
extern int num_supp_groups(void);
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value ret1;
|
1999-11-04 11:00:28 -05:00
|
|
|
S48_DECLARE_GC_PROTECT(2);
|
1999-09-14 09:32:05 -04:00
|
|
|
int r1;
|
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
|
1999-11-04 11:00:28 -05:00
|
|
|
|
|
|
|
S48_GC_PROTECT_2(mv_vec,ret1);
|
1999-09-14 09:32:05 -04:00
|
|
|
r1 = num_supp_groups();
|
|
|
|
ret1 = errno_or_false(r1);
|
1999-09-15 20:20:37 -04:00
|
|
|
S48_VECTOR_SET(mv_vec,0,s48_enter_fixnum(r1));
|
1999-11-04 11:00:28 -05:00
|
|
|
S48_GC_UNPROTECT();
|
1999-09-14 09:32:05 -04:00
|
|
|
return ret1;
|
1999-09-15 20:20:37 -04:00
|
|
|
}
|
1999-09-14 09:32:05 -04:00
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value df_get_groups(s48_value g1, s48_value mv_vec)
|
1999-09-14 09:32:05 -04:00
|
|
|
{
|
1999-09-15 20:20:37 -04:00
|
|
|
extern int get_groups(s48_value );
|
|
|
|
s48_value ret1;
|
1999-11-04 11:00:28 -05:00
|
|
|
S48_DECLARE_GC_PROTECT(2);
|
1999-09-14 09:32:05 -04:00
|
|
|
int r1;
|
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
|
1999-11-04 11:00:28 -05:00
|
|
|
|
|
|
|
S48_GC_PROTECT_2(mv_vec,ret1);
|
1999-09-15 20:20:37 -04:00
|
|
|
r1 = get_groups(g1);
|
1999-09-14 09:32:05 -04:00
|
|
|
ret1 = errno_or_false(r1);
|
1999-09-15 20:20:37 -04:00
|
|
|
S48_VECTOR_SET(mv_vec,0,s48_enter_fixnum(r1));
|
1999-11-04 11:00:28 -05:00
|
|
|
S48_GC_UNPROTECT();
|
1999-09-14 09:32:05 -04:00
|
|
|
return ret1;
|
1999-09-15 20:20:37 -04:00
|
|
|
}
|
1999-09-14 09:32:05 -04:00
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value df_getuid(void)
|
1999-09-14 09:32:05 -04:00
|
|
|
{
|
|
|
|
extern uid_t getuid(void);
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value ret1;
|
1999-11-04 11:00:28 -05:00
|
|
|
S48_DECLARE_GC_PROTECT(1);
|
1999-09-14 09:32:05 -04:00
|
|
|
uid_t r1;
|
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
|
1999-11-04 11:00:28 -05:00
|
|
|
|
|
|
|
S48_GC_PROTECT_1(ret1);
|
1999-09-14 09:32:05 -04:00
|
|
|
r1 = getuid();
|
1999-09-15 20:20:37 -04:00
|
|
|
ret1 = s48_enter_fixnum(r1);
|
1999-11-04 11:00:28 -05:00
|
|
|
S48_GC_UNPROTECT();
|
1999-09-14 09:32:05 -04:00
|
|
|
return ret1;
|
1999-09-15 20:20:37 -04:00
|
|
|
}
|
1999-09-14 09:32:05 -04:00
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value df_geteuid(void)
|
1999-09-14 09:32:05 -04:00
|
|
|
{
|
|
|
|
extern uid_t geteuid(void);
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value ret1;
|
1999-11-04 11:00:28 -05:00
|
|
|
S48_DECLARE_GC_PROTECT(1);
|
1999-09-14 09:32:05 -04:00
|
|
|
uid_t r1;
|
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
|
1999-11-04 11:00:28 -05:00
|
|
|
|
|
|
|
S48_GC_PROTECT_1(ret1);
|
1999-09-14 09:32:05 -04:00
|
|
|
r1 = geteuid();
|
1999-09-15 20:20:37 -04:00
|
|
|
ret1 = s48_enter_fixnum(r1);
|
1999-11-04 11:00:28 -05:00
|
|
|
S48_GC_UNPROTECT();
|
1999-09-14 09:32:05 -04:00
|
|
|
return ret1;
|
1999-09-15 20:20:37 -04:00
|
|
|
}
|
1999-09-14 09:32:05 -04:00
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value df_setuid(s48_value g1)
|
1999-09-14 09:32:05 -04:00
|
|
|
{
|
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value ret1;
|
1999-11-04 11:00:28 -05:00
|
|
|
S48_DECLARE_GC_PROTECT(1);
|
1999-09-14 09:32:05 -04:00
|
|
|
int r1;
|
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
|
1999-11-04 11:00:28 -05:00
|
|
|
|
|
|
|
S48_GC_PROTECT_1(ret1);
|
1999-09-15 20:20:37 -04:00
|
|
|
r1 = setuid(s48_extract_fixnum(g1));
|
1999-09-14 09:32:05 -04:00
|
|
|
ret1 = errno_or_false(r1);
|
1999-11-04 11:00:28 -05:00
|
|
|
S48_GC_UNPROTECT();
|
1999-09-14 09:32:05 -04:00
|
|
|
return ret1;
|
1999-09-15 20:20:37 -04:00
|
|
|
}
|
1999-09-14 09:32:05 -04:00
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value df_getpid(void)
|
1999-09-14 09:32:05 -04:00
|
|
|
{
|
|
|
|
extern pid_t getpid(void);
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value ret1;
|
1999-11-04 11:00:28 -05:00
|
|
|
S48_DECLARE_GC_PROTECT(1);
|
1999-09-14 09:32:05 -04:00
|
|
|
pid_t r1;
|
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
|
1999-11-04 11:00:28 -05:00
|
|
|
|
|
|
|
S48_GC_PROTECT_1(ret1);
|
1999-09-14 09:32:05 -04:00
|
|
|
r1 = getpid();
|
1999-09-15 20:20:37 -04:00
|
|
|
ret1 = s48_enter_fixnum(r1);
|
1999-11-04 11:00:28 -05:00
|
|
|
S48_GC_UNPROTECT();
|
1999-09-14 09:32:05 -04:00
|
|
|
return ret1;
|
1999-09-15 20:20:37 -04:00
|
|
|
}
|
1999-09-14 09:32:05 -04:00
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value df_getppid(void)
|
1999-09-14 09:32:05 -04:00
|
|
|
{
|
|
|
|
extern pid_t getppid(void);
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value ret1;
|
1999-11-04 11:00:28 -05:00
|
|
|
S48_DECLARE_GC_PROTECT(1);
|
1999-09-14 09:32:05 -04:00
|
|
|
pid_t r1;
|
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
|
1999-11-04 11:00:28 -05:00
|
|
|
|
|
|
|
S48_GC_PROTECT_1(ret1);
|
1999-09-14 09:32:05 -04:00
|
|
|
r1 = getppid();
|
1999-09-15 20:20:37 -04:00
|
|
|
ret1 = s48_enter_fixnum(r1);
|
1999-11-04 11:00:28 -05:00
|
|
|
S48_GC_UNPROTECT();
|
1999-09-14 09:32:05 -04:00
|
|
|
return ret1;
|
1999-09-15 20:20:37 -04:00
|
|
|
}
|
1999-09-14 09:32:05 -04:00
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value df_getpgrp(void)
|
1999-09-14 09:32:05 -04:00
|
|
|
{
|
|
|
|
extern pid_t getpgrp(void);
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value ret1;
|
1999-11-04 11:00:28 -05:00
|
|
|
S48_DECLARE_GC_PROTECT(1);
|
1999-09-14 09:32:05 -04:00
|
|
|
pid_t r1;
|
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
|
1999-11-04 11:00:28 -05:00
|
|
|
|
|
|
|
S48_GC_PROTECT_1(ret1);
|
1999-09-14 09:32:05 -04:00
|
|
|
r1 = getpgrp();
|
1999-09-15 20:20:37 -04:00
|
|
|
ret1 = s48_enter_fixnum(r1);
|
1999-11-04 11:00:28 -05:00
|
|
|
S48_GC_UNPROTECT();
|
1999-09-14 09:32:05 -04:00
|
|
|
return ret1;
|
1999-09-15 20:20:37 -04:00
|
|
|
}
|
1999-09-14 09:32:05 -04:00
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value df_setpgid(s48_value g1, s48_value g2)
|
1999-09-14 09:32:05 -04:00
|
|
|
{
|
|
|
|
extern int setpgid(pid_t , pid_t );
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value ret1;
|
1999-11-04 11:00:28 -05:00
|
|
|
S48_DECLARE_GC_PROTECT(1);
|
1999-09-14 09:32:05 -04:00
|
|
|
int r1;
|
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
|
1999-11-04 11:00:28 -05:00
|
|
|
|
|
|
|
S48_GC_PROTECT_1(ret1);
|
1999-09-15 20:20:37 -04:00
|
|
|
r1 = setpgid(s48_extract_fixnum(g1), s48_extract_fixnum(g2));
|
1999-09-14 09:32:05 -04:00
|
|
|
ret1 = errno_or_false(r1);
|
1999-11-04 11:00:28 -05:00
|
|
|
S48_GC_UNPROTECT();
|
1999-09-14 09:32:05 -04:00
|
|
|
return ret1;
|
1999-09-15 20:20:37 -04:00
|
|
|
}
|
1999-09-14 09:32:05 -04:00
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value df_setsid(s48_value mv_vec)
|
1999-09-14 09:32:05 -04:00
|
|
|
{
|
|
|
|
extern pid_t setsid(void);
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value ret1;
|
1999-11-04 11:00:28 -05:00
|
|
|
S48_DECLARE_GC_PROTECT(2);
|
1999-09-14 09:32:05 -04:00
|
|
|
pid_t r1;
|
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
|
1999-11-04 11:00:28 -05:00
|
|
|
|
|
|
|
S48_GC_PROTECT_2(mv_vec,ret1);
|
1999-09-14 09:32:05 -04:00
|
|
|
r1 = setsid();
|
|
|
|
ret1 = errno_or_false(r1);
|
1999-09-15 20:20:37 -04:00
|
|
|
S48_VECTOR_SET(mv_vec,0,s48_enter_fixnum(r1));
|
1999-11-04 11:00:28 -05:00
|
|
|
S48_GC_UNPROTECT();
|
1999-09-14 09:32:05 -04:00
|
|
|
return ret1;
|
1999-09-15 20:20:37 -04:00
|
|
|
}
|
1999-09-14 09:32:05 -04:00
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value df_umask(s48_value g1)
|
1999-09-14 09:32:05 -04:00
|
|
|
{
|
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value ret1;
|
1999-11-04 11:00:28 -05:00
|
|
|
S48_DECLARE_GC_PROTECT(1);
|
1999-09-14 09:32:05 -04:00
|
|
|
mode_t r1;
|
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
|
1999-11-04 11:00:28 -05:00
|
|
|
|
|
|
|
S48_GC_PROTECT_1(ret1);
|
1999-09-15 20:20:37 -04:00
|
|
|
r1 = umask(s48_extract_fixnum(g1));
|
|
|
|
ret1 = s48_enter_fixnum(r1);
|
1999-11-04 11:00:28 -05:00
|
|
|
S48_GC_UNPROTECT();
|
1999-09-14 09:32:05 -04:00
|
|
|
return ret1;
|
1999-09-15 20:20:37 -04:00
|
|
|
}
|
1999-09-14 09:32:05 -04:00
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value df_process_times(s48_value mv_vec)
|
1999-09-14 09:32:05 -04:00
|
|
|
{
|
1999-10-08 14:41:05 -04:00
|
|
|
extern int process_times(clock_t *, clock_t *, clock_t *, clock_t *);
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value ret1;
|
1999-11-04 11:00:28 -05:00
|
|
|
S48_DECLARE_GC_PROTECT(2);
|
1999-09-14 09:32:05 -04:00
|
|
|
int r1;
|
1999-10-08 14:41:05 -04:00
|
|
|
clock_t r2;
|
|
|
|
clock_t r3;
|
|
|
|
clock_t r4;
|
|
|
|
clock_t r5;
|
1999-09-14 09:32:05 -04:00
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
|
1999-11-04 11:00:28 -05:00
|
|
|
|
|
|
|
S48_GC_PROTECT_2(mv_vec,ret1);
|
1999-09-14 09:32:05 -04:00
|
|
|
r1 = process_times(&r2, &r3, &r4, &r5);
|
|
|
|
ret1 = errno_or_false(r1);
|
1999-09-15 20:20:37 -04:00
|
|
|
S48_VECTOR_SET(mv_vec,0,s48_enter_fixnum(r2));
|
|
|
|
S48_VECTOR_SET(mv_vec,1,s48_enter_fixnum(r3));
|
|
|
|
S48_VECTOR_SET(mv_vec,2,s48_enter_fixnum(r4));
|
|
|
|
S48_VECTOR_SET(mv_vec,3,s48_enter_fixnum(r5));
|
1999-11-04 11:00:28 -05:00
|
|
|
S48_GC_UNPROTECT();
|
1999-09-14 09:32:05 -04:00
|
|
|
return ret1;
|
1999-09-15 20:20:37 -04:00
|
|
|
}
|
1999-09-14 09:32:05 -04:00
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value df_cpu_clock_ticks_per_sec(void)
|
1999-09-14 09:32:05 -04:00
|
|
|
{
|
|
|
|
extern int cpu_clock_ticks_per_sec(void);
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value ret1;
|
1999-11-04 11:00:28 -05:00
|
|
|
S48_DECLARE_GC_PROTECT(1);
|
1999-09-14 09:32:05 -04:00
|
|
|
int r1;
|
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
|
1999-11-04 11:00:28 -05:00
|
|
|
|
|
|
|
S48_GC_PROTECT_1(ret1);
|
1999-09-14 09:32:05 -04:00
|
|
|
r1 = cpu_clock_ticks_per_sec();
|
1999-10-08 14:41:05 -04:00
|
|
|
ret1 = s48_enter_integer(r1);
|
1999-11-04 11:00:28 -05:00
|
|
|
S48_GC_UNPROTECT();
|
1999-09-14 09:32:05 -04:00
|
|
|
return ret1;
|
1999-09-15 20:20:37 -04:00
|
|
|
}
|
1999-09-14 09:32:05 -04:00
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value df_chmod(s48_value g1, s48_value g2)
|
1999-09-14 09:32:05 -04:00
|
|
|
{
|
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value ret1;
|
1999-11-04 11:00:28 -05:00
|
|
|
S48_DECLARE_GC_PROTECT(1);
|
1999-09-14 09:32:05 -04:00
|
|
|
int r1;
|
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
|
1999-11-04 11:00:28 -05:00
|
|
|
|
|
|
|
S48_GC_PROTECT_1(ret1);
|
1999-09-15 20:20:37 -04:00
|
|
|
r1 = chmod(s48_extract_string(g1), s48_extract_fixnum(g2));
|
1999-09-14 09:32:05 -04:00
|
|
|
ret1 = errno_or_false(r1);
|
1999-11-04 11:00:28 -05:00
|
|
|
S48_GC_UNPROTECT();
|
1999-09-14 09:32:05 -04:00
|
|
|
return ret1;
|
1999-09-15 20:20:37 -04:00
|
|
|
}
|
1999-09-14 09:32:05 -04:00
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value df_fchmod(s48_value g1, s48_value g2)
|
1999-09-14 09:32:05 -04:00
|
|
|
{
|
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value ret1;
|
1999-11-04 11:00:28 -05:00
|
|
|
S48_DECLARE_GC_PROTECT(1);
|
1999-09-14 09:32:05 -04:00
|
|
|
int r1;
|
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
|
1999-11-04 11:00:28 -05:00
|
|
|
|
|
|
|
S48_GC_PROTECT_1(ret1);
|
1999-09-15 20:20:37 -04:00
|
|
|
r1 = fchmod(s48_extract_fixnum(g1), s48_extract_fixnum(g2));
|
1999-09-14 09:32:05 -04:00
|
|
|
ret1 = errno_or_false(r1);
|
1999-11-04 11:00:28 -05:00
|
|
|
S48_GC_UNPROTECT();
|
1999-09-14 09:32:05 -04:00
|
|
|
return ret1;
|
1999-09-15 20:20:37 -04:00
|
|
|
}
|
1999-09-14 09:32:05 -04:00
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value df_chown(s48_value g1, s48_value g2, s48_value g3)
|
1999-09-14 09:32:05 -04:00
|
|
|
{
|
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value ret1;
|
1999-11-04 11:00:28 -05:00
|
|
|
S48_DECLARE_GC_PROTECT(1);
|
1999-09-14 09:32:05 -04:00
|
|
|
int r1;
|
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
|
1999-11-04 11:00:28 -05:00
|
|
|
|
|
|
|
S48_GC_PROTECT_1(ret1);
|
1999-09-15 20:20:37 -04:00
|
|
|
r1 = chown(s48_extract_string(g1), s48_extract_fixnum(g2), s48_extract_fixnum(g3));
|
1999-09-14 09:32:05 -04:00
|
|
|
ret1 = errno_or_false(r1);
|
1999-11-04 11:00:28 -05:00
|
|
|
S48_GC_UNPROTECT();
|
1999-09-14 09:32:05 -04:00
|
|
|
return ret1;
|
1999-09-15 20:20:37 -04:00
|
|
|
}
|
1999-09-14 09:32:05 -04:00
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value df_fchown(s48_value g1, s48_value g2, s48_value g3)
|
1999-09-14 09:32:05 -04:00
|
|
|
{
|
|
|
|
extern int fchown(int , uid_t , gid_t );
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value ret1;
|
1999-11-04 11:00:28 -05:00
|
|
|
S48_DECLARE_GC_PROTECT(1);
|
1999-09-14 09:32:05 -04:00
|
|
|
int r1;
|
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
|
1999-11-04 11:00:28 -05:00
|
|
|
|
|
|
|
S48_GC_PROTECT_1(ret1);
|
1999-09-15 20:20:37 -04:00
|
|
|
r1 = fchown(s48_extract_fixnum(g1), s48_extract_fixnum(g2), s48_extract_fixnum(g3));
|
1999-09-14 09:32:05 -04:00
|
|
|
ret1 = errno_or_false(r1);
|
1999-11-04 11:00:28 -05:00
|
|
|
S48_GC_UNPROTECT();
|
1999-09-14 09:32:05 -04:00
|
|
|
return ret1;
|
1999-09-15 20:20:37 -04:00
|
|
|
}
|
1999-09-14 09:32:05 -04:00
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value df_access(s48_value g1, s48_value g2)
|
1999-09-14 09:32:05 -04:00
|
|
|
{
|
|
|
|
extern int access(const char *, int );
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value ret1;
|
1999-11-04 11:00:28 -05:00
|
|
|
S48_DECLARE_GC_PROTECT(1);
|
1999-09-14 09:32:05 -04:00
|
|
|
int r1;
|
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
|
1999-11-04 11:00:28 -05:00
|
|
|
|
|
|
|
S48_GC_PROTECT_1(ret1);
|
1999-10-08 14:41:05 -04:00
|
|
|
r1 = access(s48_extract_string(g1), s48_extract_integer(g2));
|
1999-09-14 09:32:05 -04:00
|
|
|
ret1 = ENTER_BOOLEAN(r1);
|
1999-11-04 11:00:28 -05:00
|
|
|
S48_GC_UNPROTECT();
|
1999-09-14 09:32:05 -04:00
|
|
|
return ret1;
|
1999-09-15 20:20:37 -04:00
|
|
|
}
|
1999-09-14 09:32:05 -04:00
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value df_link(s48_value g1, s48_value g2)
|
1999-09-14 09:32:05 -04:00
|
|
|
{
|
|
|
|
extern int link(const char *, const char *);
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value ret1;
|
1999-11-04 11:00:28 -05:00
|
|
|
S48_DECLARE_GC_PROTECT(1);
|
1999-09-14 09:32:05 -04:00
|
|
|
int r1;
|
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
|
1999-11-04 11:00:28 -05:00
|
|
|
|
|
|
|
S48_GC_PROTECT_1(ret1);
|
1999-09-15 20:20:37 -04:00
|
|
|
r1 = link(s48_extract_string(g1), s48_extract_string(g2));
|
1999-09-14 09:32:05 -04:00
|
|
|
ret1 = errno_or_false(r1);
|
1999-11-04 11:00:28 -05:00
|
|
|
S48_GC_UNPROTECT();
|
1999-09-14 09:32:05 -04:00
|
|
|
return ret1;
|
1999-09-15 20:20:37 -04:00
|
|
|
}
|
1999-09-14 09:32:05 -04:00
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value df_mkfifo(s48_value g1, s48_value g2)
|
1999-09-14 09:32:05 -04:00
|
|
|
{
|
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value ret1;
|
1999-11-04 11:00:28 -05:00
|
|
|
S48_DECLARE_GC_PROTECT(1);
|
1999-09-14 09:32:05 -04:00
|
|
|
int r1;
|
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
|
1999-11-04 11:00:28 -05:00
|
|
|
|
|
|
|
S48_GC_PROTECT_1(ret1);
|
1999-09-15 20:20:37 -04:00
|
|
|
r1 = mkfifo(s48_extract_string(g1), s48_extract_fixnum(g2));
|
1999-09-14 09:32:05 -04:00
|
|
|
ret1 = errno_or_false(r1);
|
1999-11-04 11:00:28 -05:00
|
|
|
S48_GC_UNPROTECT();
|
1999-09-14 09:32:05 -04:00
|
|
|
return ret1;
|
1999-09-15 20:20:37 -04:00
|
|
|
}
|
1999-09-14 09:32:05 -04:00
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value df_mkdir(s48_value g1, s48_value g2)
|
1999-09-14 09:32:05 -04:00
|
|
|
{
|
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value ret1;
|
1999-11-04 11:00:28 -05:00
|
|
|
S48_DECLARE_GC_PROTECT(1);
|
1999-09-14 09:32:05 -04:00
|
|
|
int r1;
|
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
|
1999-11-04 11:00:28 -05:00
|
|
|
|
|
|
|
S48_GC_PROTECT_1(ret1);
|
1999-09-15 20:20:37 -04:00
|
|
|
r1 = mkdir(s48_extract_string(g1), s48_extract_fixnum(g2));
|
1999-09-14 09:32:05 -04:00
|
|
|
ret1 = errno_or_false(r1);
|
1999-11-04 11:00:28 -05:00
|
|
|
S48_GC_UNPROTECT();
|
1999-09-14 09:32:05 -04:00
|
|
|
return ret1;
|
1999-09-15 20:20:37 -04:00
|
|
|
}
|
1999-09-14 09:32:05 -04:00
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value df_scm_readlink(s48_value g1, s48_value mv_vec)
|
1999-09-14 09:32:05 -04:00
|
|
|
{
|
1999-11-04 11:00:28 -05:00
|
|
|
extern s48_value scm_readlink(const char *, s48_value *);
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value ret1;
|
1999-11-04 11:00:28 -05:00
|
|
|
S48_DECLARE_GC_PROTECT(2);
|
|
|
|
s48_value r1;
|
|
|
|
s48_value r2;
|
1999-09-14 09:32:05 -04:00
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
|
1999-11-04 11:00:28 -05:00
|
|
|
|
|
|
|
S48_GC_PROTECT_2(mv_vec,ret1);
|
|
|
|
r1 = scm_readlink(s48_extract_string(g1), &r2);
|
|
|
|
ret1 = r1;
|
|
|
|
S48_VECTOR_SET(mv_vec,0,r2);
|
|
|
|
S48_GC_UNPROTECT();
|
1999-09-14 09:32:05 -04:00
|
|
|
return ret1;
|
1999-09-15 20:20:37 -04:00
|
|
|
}
|
1999-09-14 09:32:05 -04:00
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value df_rename(s48_value g1, s48_value g2)
|
1999-09-14 09:32:05 -04:00
|
|
|
{
|
|
|
|
extern int rename(const char *, const char *);
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value ret1;
|
1999-11-04 11:00:28 -05:00
|
|
|
S48_DECLARE_GC_PROTECT(1);
|
1999-09-14 09:32:05 -04:00
|
|
|
int r1;
|
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
|
1999-11-04 11:00:28 -05:00
|
|
|
|
|
|
|
S48_GC_PROTECT_1(ret1);
|
1999-09-15 20:20:37 -04:00
|
|
|
r1 = rename(s48_extract_string(g1), s48_extract_string(g2));
|
1999-09-14 09:32:05 -04:00
|
|
|
ret1 = errno_or_false(r1);
|
1999-11-04 11:00:28 -05:00
|
|
|
S48_GC_UNPROTECT();
|
1999-09-14 09:32:05 -04:00
|
|
|
return ret1;
|
1999-09-15 20:20:37 -04:00
|
|
|
}
|
1999-09-14 09:32:05 -04:00
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value df_rmdir(s48_value g1)
|
1999-09-14 09:32:05 -04:00
|
|
|
{
|
|
|
|
extern int rmdir(const char *);
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value ret1;
|
1999-11-04 11:00:28 -05:00
|
|
|
S48_DECLARE_GC_PROTECT(1);
|
1999-09-14 09:32:05 -04:00
|
|
|
int r1;
|
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
|
1999-11-04 11:00:28 -05:00
|
|
|
|
|
|
|
S48_GC_PROTECT_1(ret1);
|
1999-09-15 20:20:37 -04:00
|
|
|
r1 = rmdir(s48_extract_string(g1));
|
1999-09-14 09:32:05 -04:00
|
|
|
ret1 = errno_or_false(r1);
|
1999-11-04 11:00:28 -05:00
|
|
|
S48_GC_UNPROTECT();
|
1999-09-14 09:32:05 -04:00
|
|
|
return ret1;
|
1999-09-15 20:20:37 -04:00
|
|
|
}
|
1999-09-14 09:32:05 -04:00
|
|
|
|
1999-10-08 14:41:05 -04:00
|
|
|
s48_value df_scm_utime(s48_value g1, s48_value g2, s48_value g3)
|
1999-09-14 09:32:05 -04:00
|
|
|
{
|
1999-10-08 14:41:05 -04:00
|
|
|
extern int scm_utime(const char *, time_t , time_t );
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value ret1;
|
1999-11-04 11:00:28 -05:00
|
|
|
S48_DECLARE_GC_PROTECT(1);
|
1999-09-14 09:32:05 -04:00
|
|
|
int r1;
|
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
|
1999-11-04 11:00:28 -05:00
|
|
|
|
|
|
|
S48_GC_PROTECT_1(ret1);
|
1999-10-08 14:41:05 -04:00
|
|
|
r1 = scm_utime(s48_extract_string(g1), s48_extract_integer(g2), s48_extract_integer(g3));
|
1999-09-14 09:32:05 -04:00
|
|
|
ret1 = errno_or_false(r1);
|
1999-11-04 11:00:28 -05:00
|
|
|
S48_GC_UNPROTECT();
|
1999-09-14 09:32:05 -04:00
|
|
|
return ret1;
|
1999-09-15 20:20:37 -04:00
|
|
|
}
|
1999-09-14 09:32:05 -04:00
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value df_scm_utime_now(s48_value g1)
|
1999-09-14 09:32:05 -04:00
|
|
|
{
|
|
|
|
extern int scm_utime_now(const char *);
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value ret1;
|
1999-11-04 11:00:28 -05:00
|
|
|
S48_DECLARE_GC_PROTECT(1);
|
1999-09-14 09:32:05 -04:00
|
|
|
int r1;
|
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
|
1999-11-04 11:00:28 -05:00
|
|
|
|
|
|
|
S48_GC_PROTECT_1(ret1);
|
1999-09-15 20:20:37 -04:00
|
|
|
r1 = scm_utime_now(s48_extract_string(g1));
|
1999-09-14 09:32:05 -04:00
|
|
|
ret1 = errno_or_false(r1);
|
1999-11-04 11:00:28 -05:00
|
|
|
S48_GC_UNPROTECT();
|
1999-09-14 09:32:05 -04:00
|
|
|
return ret1;
|
1999-09-15 20:20:37 -04:00
|
|
|
}
|
1999-09-14 09:32:05 -04:00
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value df_scheme_stat(s48_value g1, s48_value g2, s48_value g3)
|
1999-09-14 09:32:05 -04:00
|
|
|
{
|
1999-09-15 20:20:37 -04:00
|
|
|
extern int scheme_stat(const char *, s48_value , int );
|
|
|
|
s48_value ret1;
|
1999-11-04 11:00:28 -05:00
|
|
|
S48_DECLARE_GC_PROTECT(1);
|
1999-09-14 09:32:05 -04:00
|
|
|
int r1;
|
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
|
1999-11-04 11:00:28 -05:00
|
|
|
|
|
|
|
S48_GC_PROTECT_1(ret1);
|
1999-09-15 20:20:37 -04:00
|
|
|
r1 = scheme_stat(s48_extract_string(g1), g2, EXTRACT_BOOLEAN(g3));
|
1999-09-14 09:32:05 -04:00
|
|
|
ret1 = False_on_zero(r1);
|
1999-11-04 11:00:28 -05:00
|
|
|
S48_GC_UNPROTECT();
|
1999-09-14 09:32:05 -04:00
|
|
|
return ret1;
|
1999-09-15 20:20:37 -04:00
|
|
|
}
|
1999-09-14 09:32:05 -04:00
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value df_scheme_fstat(s48_value g1, s48_value g2)
|
1999-09-14 09:32:05 -04:00
|
|
|
{
|
1999-09-15 20:20:37 -04:00
|
|
|
extern int scheme_fstat(int , s48_value );
|
|
|
|
s48_value ret1;
|
1999-11-04 11:00:28 -05:00
|
|
|
S48_DECLARE_GC_PROTECT(1);
|
1999-09-14 09:32:05 -04:00
|
|
|
int r1;
|
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
|
1999-11-04 11:00:28 -05:00
|
|
|
|
|
|
|
S48_GC_PROTECT_1(ret1);
|
1999-10-08 14:41:05 -04:00
|
|
|
r1 = scheme_fstat(s48_extract_integer(g1), g2);
|
1999-09-14 09:32:05 -04:00
|
|
|
ret1 = False_on_zero(r1);
|
1999-11-04 11:00:28 -05:00
|
|
|
S48_GC_UNPROTECT();
|
1999-09-14 09:32:05 -04:00
|
|
|
return ret1;
|
1999-09-15 20:20:37 -04:00
|
|
|
}
|
1999-09-14 09:32:05 -04:00
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value df_symlink(s48_value g1, s48_value g2)
|
1999-09-14 09:32:05 -04:00
|
|
|
{
|
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value ret1;
|
1999-11-04 11:00:28 -05:00
|
|
|
S48_DECLARE_GC_PROTECT(1);
|
1999-09-14 09:32:05 -04:00
|
|
|
int r1;
|
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
|
1999-11-04 11:00:28 -05:00
|
|
|
|
|
|
|
S48_GC_PROTECT_1(ret1);
|
1999-09-15 20:20:37 -04:00
|
|
|
r1 = symlink(s48_extract_string(g1), s48_extract_string(g2));
|
1999-09-14 09:32:05 -04:00
|
|
|
ret1 = errno_or_false(r1);
|
1999-11-04 11:00:28 -05:00
|
|
|
S48_GC_UNPROTECT();
|
1999-09-14 09:32:05 -04:00
|
|
|
return ret1;
|
1999-09-15 20:20:37 -04:00
|
|
|
}
|
1999-09-14 09:32:05 -04:00
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value df_truncate(s48_value g1, s48_value g2)
|
1999-09-14 09:32:05 -04:00
|
|
|
{
|
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value ret1;
|
1999-11-04 11:00:28 -05:00
|
|
|
S48_DECLARE_GC_PROTECT(1);
|
1999-09-14 09:32:05 -04:00
|
|
|
int r1;
|
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
|
1999-11-04 11:00:28 -05:00
|
|
|
|
|
|
|
S48_GC_PROTECT_1(ret1);
|
1999-09-15 20:20:37 -04:00
|
|
|
r1 = truncate(s48_extract_string(g1), s48_extract_fixnum(g2));
|
1999-09-14 09:32:05 -04:00
|
|
|
ret1 = errno_or_false(r1);
|
1999-11-04 11:00:28 -05:00
|
|
|
S48_GC_UNPROTECT();
|
1999-09-14 09:32:05 -04:00
|
|
|
return ret1;
|
1999-09-15 20:20:37 -04:00
|
|
|
}
|
1999-09-14 09:32:05 -04:00
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value df_ftruncate(s48_value g1, s48_value g2)
|
1999-09-14 09:32:05 -04:00
|
|
|
{
|
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value ret1;
|
1999-11-04 11:00:28 -05:00
|
|
|
S48_DECLARE_GC_PROTECT(1);
|
1999-09-14 09:32:05 -04:00
|
|
|
int r1;
|
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
|
1999-11-04 11:00:28 -05:00
|
|
|
|
|
|
|
S48_GC_PROTECT_1(ret1);
|
1999-09-15 20:20:37 -04:00
|
|
|
r1 = ftruncate(s48_extract_fixnum(g1), s48_extract_fixnum(g2));
|
1999-09-14 09:32:05 -04:00
|
|
|
ret1 = errno_or_false(r1);
|
1999-11-04 11:00:28 -05:00
|
|
|
S48_GC_UNPROTECT();
|
1999-09-14 09:32:05 -04:00
|
|
|
return ret1;
|
1999-09-15 20:20:37 -04:00
|
|
|
}
|
1999-09-14 09:32:05 -04:00
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value df_unlink(s48_value g1)
|
1999-09-14 09:32:05 -04:00
|
|
|
{
|
|
|
|
extern int unlink(const char *);
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value ret1;
|
1999-11-04 11:00:28 -05:00
|
|
|
S48_DECLARE_GC_PROTECT(1);
|
1999-09-14 09:32:05 -04:00
|
|
|
int r1;
|
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
|
1999-11-04 11:00:28 -05:00
|
|
|
|
|
|
|
S48_GC_PROTECT_1(ret1);
|
1999-09-15 20:20:37 -04:00
|
|
|
r1 = unlink(s48_extract_string(g1));
|
1999-09-14 09:32:05 -04:00
|
|
|
ret1 = errno_or_false(r1);
|
1999-11-04 11:00:28 -05:00
|
|
|
S48_GC_UNPROTECT();
|
1999-09-14 09:32:05 -04:00
|
|
|
return ret1;
|
1999-09-15 20:20:37 -04:00
|
|
|
}
|
1999-09-14 09:32:05 -04:00
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value df_fsync(s48_value g1)
|
1999-09-14 09:32:05 -04:00
|
|
|
{
|
|
|
|
extern int fsync(int );
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value ret1;
|
1999-11-04 11:00:28 -05:00
|
|
|
S48_DECLARE_GC_PROTECT(1);
|
1999-09-14 09:32:05 -04:00
|
|
|
int r1;
|
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
|
1999-11-04 11:00:28 -05:00
|
|
|
|
|
|
|
S48_GC_PROTECT_1(ret1);
|
1999-09-15 20:20:37 -04:00
|
|
|
r1 = fsync(s48_extract_fixnum(g1));
|
1999-09-14 09:32:05 -04:00
|
|
|
ret1 = errno_or_false(r1);
|
1999-11-04 11:00:28 -05:00
|
|
|
S48_GC_UNPROTECT();
|
1999-09-14 09:32:05 -04:00
|
|
|
return ret1;
|
1999-09-15 20:20:37 -04:00
|
|
|
}
|
1999-09-14 09:32:05 -04:00
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value df_sync(void)
|
1999-09-14 09:32:05 -04:00
|
|
|
{
|
|
|
|
|
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
|
1999-09-14 09:32:05 -04:00
|
|
|
sync();
|
1999-09-15 20:20:37 -04:00
|
|
|
return S48_FALSE;
|
|
|
|
}
|
1999-09-14 09:32:05 -04:00
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value df_close(s48_value g1)
|
1999-09-14 09:32:05 -04:00
|
|
|
{
|
|
|
|
extern int close(int );
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value ret1;
|
1999-11-04 11:00:28 -05:00
|
|
|
S48_DECLARE_GC_PROTECT(1);
|
1999-09-14 09:32:05 -04:00
|
|
|
int r1;
|
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
|
1999-11-04 11:00:28 -05:00
|
|
|
|
|
|
|
S48_GC_PROTECT_1(ret1);
|
1999-09-15 20:20:37 -04:00
|
|
|
r1 = close(s48_extract_fixnum(g1));
|
1999-09-14 09:32:05 -04:00
|
|
|
ret1 = errno_or_false(r1);
|
1999-11-04 11:00:28 -05:00
|
|
|
S48_GC_UNPROTECT();
|
1999-09-14 09:32:05 -04:00
|
|
|
return ret1;
|
1999-09-15 20:20:37 -04:00
|
|
|
}
|
1999-09-14 09:32:05 -04:00
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value df_dup(s48_value g1, s48_value mv_vec)
|
1999-09-14 09:32:05 -04:00
|
|
|
{
|
|
|
|
extern int dup(int );
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value ret1;
|
1999-11-04 11:00:28 -05:00
|
|
|
S48_DECLARE_GC_PROTECT(2);
|
1999-09-14 09:32:05 -04:00
|
|
|
int r1;
|
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
|
1999-11-04 11:00:28 -05:00
|
|
|
|
|
|
|
S48_GC_PROTECT_2(mv_vec,ret1);
|
1999-09-15 20:20:37 -04:00
|
|
|
r1 = dup(s48_extract_fixnum(g1));
|
1999-09-14 09:32:05 -04:00
|
|
|
ret1 = errno_or_false(r1);
|
1999-09-15 20:20:37 -04:00
|
|
|
S48_VECTOR_SET(mv_vec,0,s48_enter_fixnum(r1));
|
1999-11-04 11:00:28 -05:00
|
|
|
S48_GC_UNPROTECT();
|
1999-09-14 09:32:05 -04:00
|
|
|
return ret1;
|
1999-09-15 20:20:37 -04:00
|
|
|
}
|
1999-09-14 09:32:05 -04:00
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value df_dup2(s48_value g1, s48_value g2, s48_value mv_vec)
|
1999-09-14 09:32:05 -04:00
|
|
|
{
|
|
|
|
extern int dup2(int , int );
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value ret1;
|
1999-11-04 11:00:28 -05:00
|
|
|
S48_DECLARE_GC_PROTECT(2);
|
1999-09-14 09:32:05 -04:00
|
|
|
int r1;
|
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
|
1999-11-04 11:00:28 -05:00
|
|
|
|
|
|
|
S48_GC_PROTECT_2(mv_vec,ret1);
|
1999-09-15 20:20:37 -04:00
|
|
|
r1 = dup2(s48_extract_fixnum(g1), s48_extract_fixnum(g2));
|
1999-09-14 09:32:05 -04:00
|
|
|
ret1 = errno_or_false(r1);
|
1999-09-15 20:20:37 -04:00
|
|
|
S48_VECTOR_SET(mv_vec,0,s48_enter_fixnum(r1));
|
1999-11-04 11:00:28 -05:00
|
|
|
S48_GC_UNPROTECT();
|
1999-09-14 09:32:05 -04:00
|
|
|
return ret1;
|
1999-09-15 20:20:37 -04:00
|
|
|
}
|
1999-09-14 09:32:05 -04:00
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value df_lseek(s48_value g1, s48_value g2, s48_value g3, s48_value mv_vec)
|
1999-09-14 09:32:05 -04:00
|
|
|
{
|
|
|
|
extern off_t lseek(int , off_t , int );
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value ret1;
|
1999-11-04 11:00:28 -05:00
|
|
|
S48_DECLARE_GC_PROTECT(2);
|
1999-09-14 09:32:05 -04:00
|
|
|
off_t r1;
|
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
|
1999-11-04 11:00:28 -05:00
|
|
|
|
|
|
|
S48_GC_PROTECT_2(mv_vec,ret1);
|
1999-09-15 20:20:37 -04:00
|
|
|
r1 = lseek(s48_extract_fixnum(g1), s48_extract_fixnum(g2), s48_extract_fixnum(g3));
|
1999-09-14 09:32:05 -04:00
|
|
|
ret1 = errno_or_false(r1);
|
1999-09-15 20:20:37 -04:00
|
|
|
S48_VECTOR_SET(mv_vec,0,s48_enter_fixnum(r1));
|
1999-11-04 11:00:28 -05:00
|
|
|
S48_GC_UNPROTECT();
|
1999-09-14 09:32:05 -04:00
|
|
|
return ret1;
|
1999-09-15 20:20:37 -04:00
|
|
|
}
|
1999-09-14 09:32:05 -04:00
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value df_char_ready_fdes(s48_value g1)
|
1999-09-14 09:32:05 -04:00
|
|
|
{
|
1999-09-15 20:20:37 -04:00
|
|
|
extern s48_value char_ready_fdes(int );
|
|
|
|
s48_value ret1;
|
1999-11-04 11:00:28 -05:00
|
|
|
S48_DECLARE_GC_PROTECT(1);
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value r1;
|
1999-09-14 09:32:05 -04:00
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
|
1999-11-04 11:00:28 -05:00
|
|
|
|
|
|
|
S48_GC_PROTECT_1(ret1);
|
1999-09-15 20:20:37 -04:00
|
|
|
r1 = char_ready_fdes(s48_extract_fixnum(g1));
|
1999-09-14 09:32:05 -04:00
|
|
|
ret1 = r1;
|
1999-11-04 11:00:28 -05:00
|
|
|
S48_GC_UNPROTECT();
|
1999-09-14 09:32:05 -04:00
|
|
|
return ret1;
|
1999-09-15 20:20:37 -04:00
|
|
|
}
|
1999-09-14 09:32:05 -04:00
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value df_open(s48_value g1, s48_value g2, s48_value g3, s48_value mv_vec)
|
1999-09-14 09:32:05 -04:00
|
|
|
{
|
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value ret1;
|
1999-11-04 11:00:28 -05:00
|
|
|
S48_DECLARE_GC_PROTECT(2);
|
1999-09-14 09:32:05 -04:00
|
|
|
int r1;
|
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
|
1999-11-04 11:00:28 -05:00
|
|
|
|
|
|
|
S48_GC_PROTECT_2(mv_vec,ret1);
|
1999-09-15 20:20:37 -04:00
|
|
|
r1 = open(s48_extract_string(g1), s48_extract_fixnum(g2), s48_extract_fixnum(g3));
|
1999-09-14 09:32:05 -04:00
|
|
|
ret1 = errno_or_false(r1);
|
1999-09-15 20:20:37 -04:00
|
|
|
S48_VECTOR_SET(mv_vec,0,s48_enter_fixnum(r1));
|
1999-11-04 11:00:28 -05:00
|
|
|
S48_GC_UNPROTECT();
|
1999-09-14 09:32:05 -04:00
|
|
|
return ret1;
|
1999-09-15 20:20:37 -04:00
|
|
|
}
|
1999-09-14 09:32:05 -04:00
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value df_scheme_pipe(s48_value mv_vec)
|
1999-09-14 09:32:05 -04:00
|
|
|
{
|
|
|
|
extern int scheme_pipe(int *, int *);
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value ret1;
|
1999-11-04 11:00:28 -05:00
|
|
|
S48_DECLARE_GC_PROTECT(2);
|
1999-09-14 09:32:05 -04:00
|
|
|
int r1;
|
|
|
|
int r2;
|
|
|
|
int r3;
|
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
|
1999-11-04 11:00:28 -05:00
|
|
|
|
|
|
|
S48_GC_PROTECT_2(mv_vec,ret1);
|
1999-09-14 09:32:05 -04:00
|
|
|
r1 = scheme_pipe(&r2, &r3);
|
|
|
|
ret1 = False_on_zero(r1);
|
1999-09-15 20:20:37 -04:00
|
|
|
S48_VECTOR_SET(mv_vec,0,s48_enter_fixnum(r2));
|
|
|
|
S48_VECTOR_SET(mv_vec,1,s48_enter_fixnum(r3));
|
1999-11-04 11:00:28 -05:00
|
|
|
S48_GC_UNPROTECT();
|
1999-09-14 09:32:05 -04:00
|
|
|
return ret1;
|
1999-09-15 20:20:37 -04:00
|
|
|
}
|
1999-09-14 09:32:05 -04:00
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value df_read_fdes_char(s48_value g1)
|
1999-09-14 09:32:05 -04:00
|
|
|
{
|
1999-09-15 20:20:37 -04:00
|
|
|
extern s48_value read_fdes_char(int );
|
|
|
|
s48_value ret1;
|
1999-11-04 11:00:28 -05:00
|
|
|
S48_DECLARE_GC_PROTECT(1);
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value r1;
|
1999-09-14 09:32:05 -04:00
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
|
1999-11-04 11:00:28 -05:00
|
|
|
|
|
|
|
S48_GC_PROTECT_1(ret1);
|
1999-09-15 20:20:37 -04:00
|
|
|
r1 = read_fdes_char(s48_extract_fixnum(g1));
|
1999-09-14 09:32:05 -04:00
|
|
|
ret1 = r1;
|
1999-11-04 11:00:28 -05:00
|
|
|
S48_GC_UNPROTECT();
|
1999-09-14 09:32:05 -04:00
|
|
|
return ret1;
|
1999-09-15 20:20:37 -04:00
|
|
|
}
|
1999-09-14 09:32:05 -04:00
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value df_write_fdes_char(s48_value g1, s48_value g2)
|
1999-09-14 09:32:05 -04:00
|
|
|
{
|
|
|
|
extern int write_fdes_char(char , int );
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value ret1;
|
1999-11-04 11:00:28 -05:00
|
|
|
S48_DECLARE_GC_PROTECT(1);
|
1999-09-14 09:32:05 -04:00
|
|
|
int r1;
|
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
|
1999-11-04 11:00:28 -05:00
|
|
|
|
|
|
|
S48_GC_PROTECT_1(ret1);
|
1999-09-15 20:20:37 -04:00
|
|
|
r1 = write_fdes_char(s48_extract_char(g1), s48_extract_fixnum(g2));
|
1999-09-14 09:32:05 -04:00
|
|
|
ret1 = errno_or_false(r1);
|
1999-11-04 11:00:28 -05:00
|
|
|
S48_GC_UNPROTECT();
|
1999-09-14 09:32:05 -04:00
|
|
|
return ret1;
|
1999-09-15 20:20:37 -04:00
|
|
|
}
|
1999-09-14 09:32:05 -04:00
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value df_read_fdes_substring(s48_value g1, s48_value g2, s48_value g3, s48_value g4, s48_value mv_vec)
|
1999-09-14 09:32:05 -04:00
|
|
|
{
|
2000-07-27 09:32:12 -04:00
|
|
|
extern ssize_t read_fdes_substring(s48_value , size_t , size_t , int );
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value ret1;
|
1999-11-04 11:00:28 -05:00
|
|
|
S48_DECLARE_GC_PROTECT(2);
|
2000-07-27 09:32:12 -04:00
|
|
|
ssize_t r1;
|
1999-09-14 09:32:05 -04:00
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
|
1999-11-04 11:00:28 -05:00
|
|
|
|
|
|
|
S48_GC_PROTECT_2(mv_vec,ret1);
|
1999-09-15 20:20:37 -04:00
|
|
|
r1 = read_fdes_substring(g1, s48_extract_fixnum(g2), s48_extract_fixnum(g3), s48_extract_fixnum(g4));
|
1999-09-14 09:32:05 -04:00
|
|
|
ret1 = errno_or_false(r1);
|
1999-09-15 20:20:37 -04:00
|
|
|
S48_VECTOR_SET(mv_vec,0,s48_enter_fixnum(r1));
|
1999-11-04 11:00:28 -05:00
|
|
|
S48_GC_UNPROTECT();
|
1999-09-14 09:32:05 -04:00
|
|
|
return ret1;
|
1999-09-15 20:20:37 -04:00
|
|
|
}
|
1999-09-14 09:32:05 -04:00
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value df_write_fdes_substring(s48_value g1, s48_value g2, s48_value g3, s48_value g4, s48_value mv_vec)
|
1999-09-14 09:32:05 -04:00
|
|
|
{
|
2000-07-27 09:32:12 -04:00
|
|
|
extern ssize_t write_fdes_substring(s48_value , size_t , size_t , int );
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value ret1;
|
1999-11-04 11:00:28 -05:00
|
|
|
S48_DECLARE_GC_PROTECT(2);
|
2000-07-27 09:32:12 -04:00
|
|
|
ssize_t r1;
|
1999-09-14 09:32:05 -04:00
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
|
1999-11-04 11:00:28 -05:00
|
|
|
|
|
|
|
S48_GC_PROTECT_2(mv_vec,ret1);
|
1999-09-15 20:20:37 -04:00
|
|
|
r1 = write_fdes_substring(g1, s48_extract_fixnum(g2), s48_extract_fixnum(g3), s48_extract_fixnum(g4));
|
1999-09-14 09:32:05 -04:00
|
|
|
ret1 = errno_or_false(r1);
|
1999-09-15 20:20:37 -04:00
|
|
|
S48_VECTOR_SET(mv_vec,0,s48_enter_fixnum(r1));
|
1999-11-04 11:00:28 -05:00
|
|
|
S48_GC_UNPROTECT();
|
1999-09-14 09:32:05 -04:00
|
|
|
return ret1;
|
1999-09-15 20:20:37 -04:00
|
|
|
}
|
1999-09-14 09:32:05 -04:00
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value df_kill(s48_value g1, s48_value g2)
|
1999-09-14 09:32:05 -04:00
|
|
|
{
|
|
|
|
extern int kill(pid_t , int );
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value ret1;
|
1999-11-04 11:00:28 -05:00
|
|
|
S48_DECLARE_GC_PROTECT(1);
|
1999-09-14 09:32:05 -04:00
|
|
|
int r1;
|
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
|
1999-11-04 11:00:28 -05:00
|
|
|
|
|
|
|
S48_GC_PROTECT_1(ret1);
|
1999-09-15 20:20:37 -04:00
|
|
|
r1 = kill(s48_extract_fixnum(g1), s48_extract_fixnum(g2));
|
1999-09-14 09:32:05 -04:00
|
|
|
ret1 = errno_or_false(r1);
|
1999-11-04 11:00:28 -05:00
|
|
|
S48_GC_UNPROTECT();
|
1999-09-14 09:32:05 -04:00
|
|
|
return ret1;
|
1999-09-15 20:20:37 -04:00
|
|
|
}
|
1999-09-14 09:32:05 -04:00
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value df_pause(void)
|
1999-09-14 09:32:05 -04:00
|
|
|
{
|
|
|
|
|
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
|
1999-09-14 09:32:05 -04:00
|
|
|
pause();
|
1999-09-15 20:20:37 -04:00
|
|
|
return S48_FALSE;
|
|
|
|
}
|
1999-09-14 09:32:05 -04:00
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value df_open_dir(s48_value g1, s48_value mv_vec)
|
1999-09-14 09:32:05 -04:00
|
|
|
{
|
|
|
|
extern int open_dir(const char *, char** *, int *);
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value ret1;
|
1999-11-04 11:00:28 -05:00
|
|
|
S48_DECLARE_GC_PROTECT(2);
|
1999-09-14 09:32:05 -04:00
|
|
|
int r1;
|
|
|
|
char** r2;
|
|
|
|
int r3;
|
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
|
1999-11-04 11:00:28 -05:00
|
|
|
|
|
|
|
S48_GC_PROTECT_2(mv_vec,ret1);
|
1999-09-15 20:20:37 -04:00
|
|
|
r1 = open_dir(s48_extract_string(g1), &r2, &r3);
|
1999-09-14 09:32:05 -04:00
|
|
|
ret1 = False_on_zero(r1);
|
1999-09-23 10:36:25 -04:00
|
|
|
SetAlienVal(S48_VECTOR_REF(mv_vec,0),(long) r2);//simple-assign
|
1999-09-15 20:20:37 -04:00
|
|
|
S48_VECTOR_SET(mv_vec,1,s48_enter_fixnum(r3));
|
1999-11-04 11:00:28 -05:00
|
|
|
S48_GC_UNPROTECT();
|
1999-09-14 09:32:05 -04:00
|
|
|
return ret1;
|
1999-09-15 20:20:37 -04:00
|
|
|
}
|
1999-09-14 09:32:05 -04:00
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value df_scm_sort_filevec(s48_value g1, s48_value g2)
|
1999-09-14 09:32:05 -04:00
|
|
|
{
|
|
|
|
extern void scm_sort_filevec(const char** , int );
|
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
|
|
|
|
scm_sort_filevec((const char** )AlienVal(g1), s48_extract_fixnum(g2));
|
|
|
|
return S48_FALSE;
|
|
|
|
}
|
1999-09-14 09:32:05 -04:00
|
|
|
|
2000-07-27 09:32:12 -04:00
|
|
|
s48_value df_scm_envvec(void)
|
1999-09-14 09:32:05 -04:00
|
|
|
{
|
2000-07-27 09:32:12 -04:00
|
|
|
extern s48_value scm_envvec(void);
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value ret1;
|
2000-07-27 09:32:12 -04:00
|
|
|
S48_DECLARE_GC_PROTECT(1);
|
|
|
|
s48_value r1;
|
1999-09-14 09:32:05 -04:00
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
|
1999-11-04 11:00:28 -05:00
|
|
|
|
2000-07-27 09:32:12 -04:00
|
|
|
S48_GC_PROTECT_1(ret1);
|
|
|
|
r1 = scm_envvec();
|
|
|
|
ret1 = r1;
|
1999-11-04 11:00:28 -05:00
|
|
|
S48_GC_UNPROTECT();
|
1999-09-14 09:32:05 -04:00
|
|
|
return ret1;
|
1999-09-15 20:20:37 -04:00
|
|
|
}
|
1999-09-14 09:32:05 -04:00
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value df_install_env(s48_value g1)
|
1999-09-14 09:32:05 -04:00
|
|
|
{
|
1999-09-15 20:20:37 -04:00
|
|
|
extern int install_env(s48_value );
|
|
|
|
s48_value ret1;
|
1999-11-04 11:00:28 -05:00
|
|
|
S48_DECLARE_GC_PROTECT(1);
|
1999-09-14 09:32:05 -04:00
|
|
|
int r1;
|
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
|
1999-11-04 11:00:28 -05:00
|
|
|
|
|
|
|
S48_GC_PROTECT_1(ret1);
|
1999-09-15 20:20:37 -04:00
|
|
|
r1 = install_env(g1);
|
1999-09-14 09:32:05 -04:00
|
|
|
ret1 = errno_or_false(r1);
|
1999-11-04 11:00:28 -05:00
|
|
|
S48_GC_UNPROTECT();
|
1999-09-14 09:32:05 -04:00
|
|
|
return ret1;
|
1999-09-15 20:20:37 -04:00
|
|
|
}
|
1999-09-14 09:32:05 -04:00
|
|
|
|
1999-11-04 11:00:28 -05:00
|
|
|
s48_value df_create_env(s48_value g1, s48_value mv_vec)
|
1999-09-14 09:32:05 -04:00
|
|
|
{
|
1999-11-04 11:00:28 -05:00
|
|
|
extern int create_env(s48_value , s48_value *);
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value ret1;
|
1999-11-04 11:00:28 -05:00
|
|
|
S48_DECLARE_GC_PROTECT(2);
|
|
|
|
int r1;
|
|
|
|
s48_value r2;
|
1999-09-14 09:32:05 -04:00
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
|
1999-11-04 11:00:28 -05:00
|
|
|
|
|
|
|
S48_GC_PROTECT_2(mv_vec,ret1);
|
|
|
|
r1 = create_env(g1, &r2);
|
|
|
|
ret1 = errno_or_false(r1);
|
|
|
|
S48_VECTOR_SET(mv_vec,0,r2);
|
|
|
|
S48_GC_UNPROTECT();
|
1999-09-14 09:32:05 -04:00
|
|
|
return ret1;
|
1999-09-15 20:20:37 -04:00
|
|
|
}
|
1999-09-14 09:32:05 -04:00
|
|
|
|
1999-11-04 11:00:28 -05:00
|
|
|
s48_value df_align_env(s48_value g1)
|
|
|
|
{
|
|
|
|
extern void align_env(s48_value );
|
1999-09-14 09:32:05 -04:00
|
|
|
|
1999-11-04 11:00:28 -05:00
|
|
|
|
|
|
|
align_env(g1);
|
|
|
|
return S48_FALSE;
|
|
|
|
}
|
|
|
|
|
2000-07-27 09:32:12 -04:00
|
|
|
s48_value df_free_envvec(s48_value g1)
|
|
|
|
{
|
|
|
|
extern s48_value free_envvec(s48_value );
|
|
|
|
s48_value ret1;
|
|
|
|
S48_DECLARE_GC_PROTECT(1);
|
|
|
|
s48_value r1;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
S48_GC_PROTECT_1(ret1);
|
|
|
|
r1 = free_envvec(g1);
|
|
|
|
ret1 = r1;
|
|
|
|
S48_GC_UNPROTECT();
|
|
|
|
return ret1;
|
|
|
|
}
|
|
|
|
|
1999-11-04 11:00:28 -05:00
|
|
|
s48_value df_envvec_setenv(s48_value g1, s48_value g2)
|
1999-09-14 09:32:05 -04:00
|
|
|
{
|
1999-11-04 11:00:28 -05:00
|
|
|
extern s48_value envvec_setenv(s48_value , s48_value );
|
|
|
|
s48_value ret1;
|
|
|
|
S48_DECLARE_GC_PROTECT(1);
|
|
|
|
s48_value r1;
|
|
|
|
|
|
|
|
|
1999-09-14 09:32:05 -04:00
|
|
|
|
1999-11-04 11:00:28 -05:00
|
|
|
S48_GC_PROTECT_1(ret1);
|
|
|
|
r1 = envvec_setenv(g1, g2);
|
|
|
|
ret1 = r1;
|
|
|
|
S48_GC_UNPROTECT();
|
|
|
|
return ret1;
|
|
|
|
}
|
|
|
|
|
|
|
|
s48_value df_getenv(s48_value g1, s48_value mv_vec)
|
|
|
|
{
|
|
|
|
extern char *getenv(const char *);
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value ret1;
|
1999-11-04 11:00:28 -05:00
|
|
|
S48_DECLARE_GC_PROTECT(2);
|
|
|
|
char *r1;
|
1999-09-14 09:32:05 -04:00
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
|
1999-11-04 11:00:28 -05:00
|
|
|
|
|
|
|
S48_GC_PROTECT_2(mv_vec,ret1);
|
|
|
|
r1 = getenv(s48_extract_string(g1));
|
|
|
|
ret1 = S48_VECTOR_REF(mv_vec,0);
|
|
|
|
SetAlienVal(S48_CAR(ret1),(long) r1); S48_SET_CDR(ret1,strlen_or_false(r1));//str-and-len
|
|
|
|
S48_GC_UNPROTECT();
|
1999-09-14 09:32:05 -04:00
|
|
|
return ret1;
|
1999-09-15 20:20:37 -04:00
|
|
|
}
|
1999-09-14 09:32:05 -04:00
|
|
|
|
1999-11-04 11:00:28 -05:00
|
|
|
#define errno_on_nonzero_or_false(x) ((x) ? s48_enter_fixnum(errno) : S48_FALSE)
|
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value df_delete_env(s48_value g1)
|
1999-09-14 09:32:05 -04:00
|
|
|
{
|
2000-07-27 09:32:12 -04:00
|
|
|
extern s48_value delete_env(s48_value );
|
|
|
|
s48_value ret1;
|
|
|
|
S48_DECLARE_GC_PROTECT(1);
|
|
|
|
s48_value r1;
|
1999-09-14 09:32:05 -04:00
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
|
2000-07-27 09:32:12 -04:00
|
|
|
|
|
|
|
S48_GC_PROTECT_1(ret1);
|
|
|
|
r1 = delete_env(g1);
|
|
|
|
ret1 = r1;
|
|
|
|
S48_GC_UNPROTECT();
|
|
|
|
return ret1;
|
1999-09-15 20:20:37 -04:00
|
|
|
}
|
1999-09-14 09:32:05 -04:00
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value df_set_cloexec(s48_value g1, s48_value g2)
|
1999-09-14 09:32:05 -04:00
|
|
|
{
|
|
|
|
extern int set_cloexec(int , int );
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value ret1;
|
1999-11-04 11:00:28 -05:00
|
|
|
S48_DECLARE_GC_PROTECT(1);
|
1999-09-14 09:32:05 -04:00
|
|
|
int r1;
|
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
|
1999-11-04 11:00:28 -05:00
|
|
|
|
|
|
|
S48_GC_PROTECT_1(ret1);
|
1999-09-15 20:20:37 -04:00
|
|
|
r1 = set_cloexec(s48_extract_fixnum(g1), EXTRACT_BOOLEAN(g2));
|
1999-09-14 09:32:05 -04:00
|
|
|
ret1 = errno_or_false(r1);
|
1999-11-04 11:00:28 -05:00
|
|
|
S48_GC_UNPROTECT();
|
1999-09-14 09:32:05 -04:00
|
|
|
return ret1;
|
1999-09-15 20:20:37 -04:00
|
|
|
}
|
1999-09-14 09:32:05 -04:00
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value df_fcntl_read(s48_value g1, s48_value g2, s48_value mv_vec)
|
1999-09-14 09:32:05 -04:00
|
|
|
{
|
|
|
|
extern int fcntl_read(int , int );
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value ret1;
|
1999-11-04 11:00:28 -05:00
|
|
|
S48_DECLARE_GC_PROTECT(2);
|
1999-09-14 09:32:05 -04:00
|
|
|
int r1;
|
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
|
1999-11-04 11:00:28 -05:00
|
|
|
|
|
|
|
S48_GC_PROTECT_2(mv_vec,ret1);
|
1999-09-15 20:20:37 -04:00
|
|
|
r1 = fcntl_read(s48_extract_fixnum(g1), s48_extract_fixnum(g2));
|
1999-09-14 09:32:05 -04:00
|
|
|
ret1 = errno_or_false(r1);
|
1999-09-15 20:20:37 -04:00
|
|
|
S48_VECTOR_SET(mv_vec,0,s48_enter_fixnum(r1));
|
1999-11-04 11:00:28 -05:00
|
|
|
S48_GC_UNPROTECT();
|
1999-09-14 09:32:05 -04:00
|
|
|
return ret1;
|
1999-09-15 20:20:37 -04:00
|
|
|
}
|
1999-09-14 09:32:05 -04:00
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value df_fcntl_write(s48_value g1, s48_value g2, s48_value g3)
|
1999-09-14 09:32:05 -04:00
|
|
|
{
|
|
|
|
extern int fcntl_write(int , int , int );
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value ret1;
|
1999-11-04 11:00:28 -05:00
|
|
|
S48_DECLARE_GC_PROTECT(1);
|
1999-09-14 09:32:05 -04:00
|
|
|
int r1;
|
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
|
1999-11-04 11:00:28 -05:00
|
|
|
|
|
|
|
S48_GC_PROTECT_1(ret1);
|
1999-09-15 20:20:37 -04:00
|
|
|
r1 = fcntl_write(s48_extract_fixnum(g1), s48_extract_fixnum(g2), s48_extract_fixnum(g3));
|
1999-09-14 09:32:05 -04:00
|
|
|
ret1 = errno_or_false(r1);
|
1999-11-04 11:00:28 -05:00
|
|
|
S48_GC_UNPROTECT();
|
1999-09-14 09:32:05 -04:00
|
|
|
return ret1;
|
1999-09-15 20:20:37 -04:00
|
|
|
}
|
1999-09-14 09:32:05 -04:00
|
|
|
|
1999-10-08 14:41:05 -04:00
|
|
|
s48_value df_sleep_until(s48_value g1)
|
1999-09-14 09:32:05 -04:00
|
|
|
{
|
1999-10-08 14:41:05 -04:00
|
|
|
extern s48_value sleep_until(time_t );
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value ret1;
|
1999-11-04 11:00:28 -05:00
|
|
|
S48_DECLARE_GC_PROTECT(1);
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value r1;
|
1999-09-14 09:32:05 -04:00
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
|
1999-11-04 11:00:28 -05:00
|
|
|
|
|
|
|
S48_GC_PROTECT_1(ret1);
|
1999-10-08 14:41:05 -04:00
|
|
|
r1 = sleep_until(s48_extract_integer(g1));
|
1999-09-14 09:32:05 -04:00
|
|
|
ret1 = r1;
|
1999-11-04 11:00:28 -05:00
|
|
|
S48_GC_UNPROTECT();
|
1999-09-14 09:32:05 -04:00
|
|
|
return ret1;
|
1999-09-15 20:20:37 -04:00
|
|
|
}
|
1999-09-14 09:32:05 -04:00
|
|
|
|
1999-11-04 11:00:28 -05:00
|
|
|
s48_value df_scm_gethostname(void)
|
1999-09-14 09:32:05 -04:00
|
|
|
{
|
1999-11-04 11:00:28 -05:00
|
|
|
extern s48_value scm_gethostname(void);
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value ret1;
|
1999-11-04 11:00:28 -05:00
|
|
|
S48_DECLARE_GC_PROTECT(1);
|
|
|
|
s48_value r1;
|
1999-09-14 09:32:05 -04:00
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
|
1999-11-04 11:00:28 -05:00
|
|
|
|
|
|
|
S48_GC_PROTECT_1(ret1);
|
1999-09-14 09:32:05 -04:00
|
|
|
r1 = scm_gethostname();
|
1999-11-04 11:00:28 -05:00
|
|
|
ret1 = r1;
|
|
|
|
S48_GC_UNPROTECT();
|
1999-09-14 09:32:05 -04:00
|
|
|
return ret1;
|
1999-09-15 20:20:37 -04:00
|
|
|
}
|
1999-09-14 09:32:05 -04:00
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value df_errno_msg(s48_value g1, s48_value mv_vec)
|
1999-09-14 09:32:05 -04:00
|
|
|
{
|
|
|
|
extern char *errno_msg(int );
|
1999-09-15 20:20:37 -04:00
|
|
|
s48_value ret1;
|
1999-11-04 11:00:28 -05:00
|
|
|
S48_DECLARE_GC_PROTECT(2);
|
1999-09-14 09:32:05 -04:00
|
|
|
char *r1;
|
|
|
|
|
1999-09-15 20:20:37 -04:00
|
|
|
|
1999-11-04 11:00:28 -05:00
|
|
|
|
|
|
|
S48_GC_PROTECT_2(mv_vec,ret1);
|
1999-10-08 14:41:05 -04:00
|
|
|
r1 = errno_msg(s48_extract_integer(g1));
|
1999-09-15 20:20:37 -04:00
|
|
|
ret1 = S48_VECTOR_REF(mv_vec,0);
|
1999-09-23 10:36:25 -04:00
|
|
|
SetAlienVal(S48_CAR(ret1),(long) r1); S48_SET_CDR(ret1,strlen_or_false(r1));//str-and-len
|
1999-11-04 11:00:28 -05:00
|
|
|
S48_GC_UNPROTECT();
|
|
|
|
return ret1;
|
|
|
|
}
|
|
|
|
|
|
|
|
s48_value df_scm_crypt(s48_value g1, s48_value g2)
|
|
|
|
{
|
|
|
|
extern s48_value scm_crypt(s48_value , s48_value );
|
|
|
|
s48_value ret1;
|
|
|
|
S48_DECLARE_GC_PROTECT(1);
|
|
|
|
s48_value r1;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
S48_GC_PROTECT_1(ret1);
|
|
|
|
r1 = scm_crypt(g1, g2);
|
|
|
|
ret1 = r1;
|
|
|
|
S48_GC_UNPROTECT();
|
1999-09-15 20:20:37 -04:00
|
|
|
return ret1;
|
|
|
|
}
|
|
|
|
|
|
|
|
s48_value s48_init_syscalls(void)
|
|
|
|
{
|
|
|
|
S48_EXPORT_FUNCTION(df_scheme_exec);
|
|
|
|
S48_EXPORT_FUNCTION(df_exit);
|
|
|
|
S48_EXPORT_FUNCTION(df__exit);
|
|
|
|
S48_EXPORT_FUNCTION(df_fork);
|
2000-07-27 09:32:12 -04:00
|
|
|
S48_EXPORT_FUNCTION(wait_pid);
|
1999-09-15 20:20:37 -04:00
|
|
|
S48_EXPORT_FUNCTION(df_chdir);
|
|
|
|
S48_EXPORT_FUNCTION(df_scheme_cwd);
|
|
|
|
S48_EXPORT_FUNCTION(df_getgid);
|
|
|
|
S48_EXPORT_FUNCTION(df_getegid);
|
|
|
|
S48_EXPORT_FUNCTION(df_setgid);
|
|
|
|
S48_EXPORT_FUNCTION(df_num_supp_groups);
|
|
|
|
S48_EXPORT_FUNCTION(df_get_groups);
|
|
|
|
S48_EXPORT_FUNCTION(df_getuid);
|
|
|
|
S48_EXPORT_FUNCTION(df_geteuid);
|
|
|
|
S48_EXPORT_FUNCTION(df_setuid);
|
|
|
|
S48_EXPORT_FUNCTION(df_getpid);
|
|
|
|
S48_EXPORT_FUNCTION(df_getppid);
|
|
|
|
S48_EXPORT_FUNCTION(df_getpgrp);
|
|
|
|
S48_EXPORT_FUNCTION(df_setpgid);
|
|
|
|
S48_EXPORT_FUNCTION(df_setsid);
|
|
|
|
S48_EXPORT_FUNCTION(df_umask);
|
|
|
|
S48_EXPORT_FUNCTION(df_process_times);
|
|
|
|
S48_EXPORT_FUNCTION(df_cpu_clock_ticks_per_sec);
|
|
|
|
S48_EXPORT_FUNCTION(df_chmod);
|
|
|
|
S48_EXPORT_FUNCTION(df_fchmod);
|
|
|
|
S48_EXPORT_FUNCTION(df_chown);
|
|
|
|
S48_EXPORT_FUNCTION(df_fchown);
|
|
|
|
S48_EXPORT_FUNCTION(df_access);
|
|
|
|
S48_EXPORT_FUNCTION(df_link);
|
|
|
|
S48_EXPORT_FUNCTION(df_mkfifo);
|
|
|
|
S48_EXPORT_FUNCTION(df_mkdir);
|
|
|
|
S48_EXPORT_FUNCTION(df_scm_readlink);
|
|
|
|
S48_EXPORT_FUNCTION(df_rename);
|
|
|
|
S48_EXPORT_FUNCTION(df_rmdir);
|
|
|
|
S48_EXPORT_FUNCTION(df_scm_utime);
|
|
|
|
S48_EXPORT_FUNCTION(df_scm_utime_now);
|
|
|
|
S48_EXPORT_FUNCTION(df_scheme_stat);
|
|
|
|
S48_EXPORT_FUNCTION(df_scheme_fstat);
|
|
|
|
S48_EXPORT_FUNCTION(df_symlink);
|
|
|
|
S48_EXPORT_FUNCTION(df_truncate);
|
|
|
|
S48_EXPORT_FUNCTION(df_ftruncate);
|
|
|
|
S48_EXPORT_FUNCTION(df_unlink);
|
|
|
|
S48_EXPORT_FUNCTION(df_fsync);
|
|
|
|
S48_EXPORT_FUNCTION(df_sync);
|
|
|
|
S48_EXPORT_FUNCTION(df_close);
|
|
|
|
S48_EXPORT_FUNCTION(df_dup);
|
|
|
|
S48_EXPORT_FUNCTION(df_dup2);
|
|
|
|
S48_EXPORT_FUNCTION(df_lseek);
|
|
|
|
S48_EXPORT_FUNCTION(df_char_ready_fdes);
|
|
|
|
S48_EXPORT_FUNCTION(df_open);
|
|
|
|
S48_EXPORT_FUNCTION(df_scheme_pipe);
|
|
|
|
S48_EXPORT_FUNCTION(df_read_fdes_char);
|
|
|
|
S48_EXPORT_FUNCTION(df_write_fdes_char);
|
|
|
|
S48_EXPORT_FUNCTION(df_read_fdes_substring);
|
|
|
|
S48_EXPORT_FUNCTION(df_write_fdes_substring);
|
|
|
|
S48_EXPORT_FUNCTION(df_kill);
|
|
|
|
S48_EXPORT_FUNCTION(df_pause);
|
|
|
|
S48_EXPORT_FUNCTION(df_open_dir);
|
|
|
|
S48_EXPORT_FUNCTION(df_scm_sort_filevec);
|
|
|
|
S48_EXPORT_FUNCTION(df_scm_envvec);
|
|
|
|
S48_EXPORT_FUNCTION(df_install_env);
|
1999-11-04 11:00:28 -05:00
|
|
|
S48_EXPORT_FUNCTION(df_create_env);
|
|
|
|
S48_EXPORT_FUNCTION(df_align_env);
|
2000-07-27 09:32:12 -04:00
|
|
|
S48_EXPORT_FUNCTION(df_free_envvec);
|
1999-11-04 11:00:28 -05:00
|
|
|
S48_EXPORT_FUNCTION(df_envvec_setenv);
|
1999-09-15 20:20:37 -04:00
|
|
|
S48_EXPORT_FUNCTION(df_getenv);
|
|
|
|
S48_EXPORT_FUNCTION(df_delete_env);
|
|
|
|
S48_EXPORT_FUNCTION(df_set_cloexec);
|
|
|
|
S48_EXPORT_FUNCTION(df_fcntl_read);
|
|
|
|
S48_EXPORT_FUNCTION(df_fcntl_write);
|
|
|
|
S48_EXPORT_FUNCTION(df_sleep_until);
|
|
|
|
S48_EXPORT_FUNCTION(df_scm_gethostname);
|
|
|
|
S48_EXPORT_FUNCTION(df_errno_msg);
|
1999-11-04 11:00:28 -05:00
|
|
|
S48_EXPORT_FUNCTION(df_scm_crypt);
|
1999-09-15 20:20:37 -04:00
|
|
|
|
|
|
|
return S48_UNSPECIFIC;
|
|
|
|
}
|