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_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 );
|
2000-10-19 04:37:34 -04:00
|
|
|
s48_value ret1 = S48_FALSE;
|
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_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 );
|
2000-10-19 04:37:34 -04:00
|
|
|
s48_value ret1 = S48_FALSE;
|
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 );
|
2000-10-19 04:37:34 -04:00
|
|
|
s48_value ret1 = S48_FALSE;
|
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 );
|
2000-10-19 04:37:34 -04:00
|
|
|
s48_value ret1 = S48_FALSE;
|
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 );
|
2000-10-19 04:37:34 -04:00
|
|
|
s48_value ret1 = S48_FALSE;
|
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-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 );
|
2000-10-19 04:37:34 -04:00
|
|
|
s48_value ret1 = S48_FALSE;
|
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
|
|
|
|
2001-01-09 10:57:06 -05:00
|
|
|
void s48_init_syscalls(void)
|
1999-09-15 20:20:37 -04:00
|
|
|
{
|
2001-01-01 12:55:36 -05:00
|
|
|
S48_EXPORT_FUNCTION(scheme_exec);
|
2000-10-19 04:37:34 -04:00
|
|
|
S48_EXPORT_FUNCTION(scsh_exit);
|
|
|
|
S48_EXPORT_FUNCTION(scsh__exit);
|
|
|
|
S48_EXPORT_FUNCTION(scsh_fork);
|
2000-07-27 09:32:12 -04:00
|
|
|
S48_EXPORT_FUNCTION(wait_pid);
|
2001-01-01 12:55:36 -05:00
|
|
|
S48_EXPORT_FUNCTION(scsh_chdir);
|
|
|
|
S48_EXPORT_FUNCTION(scheme_cwd);
|
|
|
|
S48_EXPORT_FUNCTION(scsh_getgid);
|
|
|
|
S48_EXPORT_FUNCTION(scsh_getegid);
|
|
|
|
S48_EXPORT_FUNCTION(scsh_setgid);
|
|
|
|
S48_EXPORT_FUNCTION(scsh_setegid);
|
|
|
|
S48_EXPORT_FUNCTION(get_groups);
|
|
|
|
S48_EXPORT_FUNCTION(scsh_getuid);
|
|
|
|
S48_EXPORT_FUNCTION(scsh_geteuid);
|
|
|
|
S48_EXPORT_FUNCTION(scsh_setuid);
|
|
|
|
S48_EXPORT_FUNCTION(scsh_seteuid);
|
2001-08-08 05:21:20 -04:00
|
|
|
S48_EXPORT_FUNCTION(scsh_getpid);
|
|
|
|
S48_EXPORT_FUNCTION(scsh_getppid);
|
|
|
|
S48_EXPORT_FUNCTION(scsh_getpgrp);
|
|
|
|
S48_EXPORT_FUNCTION(setpgid);
|
|
|
|
S48_EXPORT_FUNCTION(scsh_setsid);
|
|
|
|
S48_EXPORT_FUNCTION(scsh_umask);
|
|
|
|
S48_EXPORT_FUNCTION(process_times);
|
|
|
|
S48_EXPORT_FUNCTION(cpu_clock_ticks_per_sec);
|
|
|
|
S48_EXPORT_FUNCTION(scsh_chmod);
|
|
|
|
S48_EXPORT_FUNCTION(scsh_fchmod);
|
|
|
|
S48_EXPORT_FUNCTION(scsh_chown);
|
|
|
|
S48_EXPORT_FUNCTION(scsh_fchown);
|
|
|
|
S48_EXPORT_FUNCTION(scsh_access);
|
|
|
|
S48_EXPORT_FUNCTION(scsh_link);
|
|
|
|
S48_EXPORT_FUNCTION(scsh_mkfifo);
|
|
|
|
S48_EXPORT_FUNCTION(scsh_mkdir);
|
|
|
|
S48_EXPORT_FUNCTION(scsh_readlink);
|
|
|
|
S48_EXPORT_FUNCTION(scsh_rename);
|
|
|
|
S48_EXPORT_FUNCTION(scsh_rmdir);
|
|
|
|
S48_EXPORT_FUNCTION(scm_utime);
|
|
|
|
S48_EXPORT_FUNCTION(scm_utime_now);
|
2001-01-01 12:55:36 -05:00
|
|
|
S48_EXPORT_FUNCTION(scheme_stat);
|
|
|
|
S48_EXPORT_FUNCTION(scheme_fstat);
|
2001-08-08 05:21:20 -04:00
|
|
|
S48_EXPORT_FUNCTION(scsh_symlink);
|
|
|
|
S48_EXPORT_FUNCTION(scsh_truncate);
|
|
|
|
S48_EXPORT_FUNCTION(scsh_ftruncate);
|
|
|
|
S48_EXPORT_FUNCTION(scsh_unlink);
|
|
|
|
S48_EXPORT_FUNCTION(scsh_fsync);
|
|
|
|
S48_EXPORT_FUNCTION(scsh_sync);
|
|
|
|
S48_EXPORT_FUNCTION(scsh_close);
|
|
|
|
S48_EXPORT_FUNCTION(scsh_dup);
|
|
|
|
S48_EXPORT_FUNCTION(scsh_dup2);
|
|
|
|
S48_EXPORT_FUNCTION(scsh_lseek);
|
1999-09-15 20:20:37 -04:00
|
|
|
S48_EXPORT_FUNCTION(df_char_ready_fdes);
|
2001-08-08 05:21:20 -04:00
|
|
|
S48_EXPORT_FUNCTION(scsh_open);
|
2000-10-19 04:37:34 -04:00
|
|
|
S48_EXPORT_FUNCTION(scheme_pipe);
|
1999-09-15 20:20:37 -04:00
|
|
|
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);
|
2000-10-19 04:37:34 -04:00
|
|
|
S48_EXPORT_FUNCTION(scsh_kill);
|
2001-08-08 05:21:20 -04:00
|
|
|
S48_EXPORT_FUNCTION(open_dir);
|
2001-08-06 04:33:24 -04:00
|
|
|
S48_EXPORT_FUNCTION(scm_envvec);
|
|
|
|
S48_EXPORT_FUNCTION(create_env);
|
|
|
|
S48_EXPORT_FUNCTION(align_env);
|
|
|
|
S48_EXPORT_FUNCTION(free_envvec);
|
2000-10-19 04:37:34 -04:00
|
|
|
S48_EXPORT_FUNCTION(set_cloexec);
|
|
|
|
S48_EXPORT_FUNCTION(fcntl_read);
|
|
|
|
S48_EXPORT_FUNCTION(fcntl_write);
|
1999-09-15 20:20:37 -04:00
|
|
|
S48_EXPORT_FUNCTION(df_sleep_until);
|
2000-10-19 04:37:34 -04:00
|
|
|
S48_EXPORT_FUNCTION(scm_gethostname);
|
2001-08-08 05:21:20 -04:00
|
|
|
S48_EXPORT_FUNCTION(errno_msg);
|
2000-10-19 04:37:34 -04:00
|
|
|
S48_EXPORT_FUNCTION(scm_crypt);
|
1999-09-15 20:20:37 -04:00
|
|
|
}
|