* ports.c: add SCM_PROC declarations for pt-size and pt-member.
* Makefile.am: remove AWK=@AWK@.
Add a rule for generating errnos.list.
(CLEANFILES): put errnos.list here instead of in DISTCLEANFILES.
* configure.in: add AC_SUBST(AWK) and AC_SUBST(ERRNO_EXTRACT).
don't extract errnos, just set a variable (avoids the
need to recompile error.c just because configure is run.)
* unif.h: update prototypes.
* unif.c (scm_uniform_array_read,write): change the offset and
length arguments to start and end, for consistency.
* __scm.h: uncomment SCM_ARG6 and SCM_ARG7, I needed SCM_ARG6.
* ioext.h: update prototypes.
* * ioext.c (scm_read_delimited_x): replaces scm_read_line and
scm_read_line_x, it's a more general procedure using an
interface from scsh. read-line and read-line! are now defined
in boot-9.scm.
* Note that the new read-line trims the terminator
by default, previously it was appended to the returned string. An
optional argument specifies how to process the terminator (scsh
compatible). For the old behaviour: (read-line port 'concat).
scm_read_line, scm_read_line_x: deleted. (read-line port 'split)
returns a pair, but is converted to multiple values if the scsh
module is loaded.
socket.h: update prototypes.
* socket.c (scm_recvfrom): for consistency with other procedures,
take start and end as separate optional arguments.
* (scm_recv, scm_recvfrom): don't allow the second argument
to be a size, only a buffer. Change the scheme names to
recv! and recvfrom!. Don't return the buffer.
* ioext.h, posix.h: move prototypes too.
* ioext.c, posix.c (scm_read_line, scm_read_line_x, scm_write_line:
moved back from posix.c to ioext.c. Also move #includes of "genio.h"
"read.h" and "unif.h".
* ioext.c: include "chars.h"
1997-01-25 18:23:49 +00:00
|
|
|
|
/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
|
1996-07-25 22:56:11 +00:00
|
|
|
|
*
|
|
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
|
|
* the Free Software Foundation; either version 2, or (at your option)
|
|
|
|
|
|
* any later version.
|
|
|
|
|
|
*
|
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
|
*
|
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
|
|
* along with this software; see the file COPYING. If not, write to
|
|
|
|
|
|
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
|
|
|
|
*
|
|
|
|
|
|
* As a special exception, the Free Software Foundation gives permission
|
|
|
|
|
|
* for additional uses of the text contained in its release of GUILE.
|
|
|
|
|
|
*
|
|
|
|
|
|
* The exception is that, if you link the GUILE library with other files
|
|
|
|
|
|
* to produce an executable, this does not by itself cause the
|
|
|
|
|
|
* resulting executable to be covered by the GNU General Public License.
|
|
|
|
|
|
* Your use of that executable is in no way restricted on account of
|
|
|
|
|
|
* linking the GUILE library code into it.
|
|
|
|
|
|
*
|
|
|
|
|
|
* This exception does not however invalidate any other reasons why
|
|
|
|
|
|
* the executable file might be covered by the GNU General Public License.
|
|
|
|
|
|
*
|
|
|
|
|
|
* This exception applies only to the code released by the
|
|
|
|
|
|
* Free Software Foundation under the name GUILE. If you copy
|
|
|
|
|
|
* code from other Free Software Foundation releases into a copy of
|
|
|
|
|
|
* GUILE, as the General Public License permits, the exception does
|
|
|
|
|
|
* not apply to the code that you add in this way. To avoid misleading
|
|
|
|
|
|
* anyone as to the status of such modified files, you must delete
|
|
|
|
|
|
* this exception notice from them.
|
|
|
|
|
|
*
|
|
|
|
|
|
* If you write modifications of your own for GUILE, it is your choice
|
|
|
|
|
|
* whether to permit this exception to apply to your modifications.
|
|
|
|
|
|
* If you do not wish that, delete this exception notice.
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
|
#include "_scm.h"
|
C files should #include only the header files they need, not
libguile.h (which #includes all the header files); the pointless
recompilation was wasting my time.
* Makefile.in (all .o dependency lists): Regenerated.
* libguile.h: Don't try to get a definition for size_t here...
* __scm.h: Do it here.
* _scm.h: Since this is the internal libguile header, put things
here that all (or a majority) of the libguile files will want.
Don't #include <libguile.h> here; that generates dependencies on
way too much. Instead, get "__scm.h", "error.h", "pairs.h",
"list.h", "gc.h", "gsubr.h", "procs.h", "numbers.h", "symbols.h",
"boolean.h", "strings.h", "vectors.h", "root.h", "ports.h", and
"async.h".
* alist.c: Get "eq.h", "list.h", "alist.h".
* append.c: Get "append.h", "list.h".
* arbiters.c: Get "arbiters.h", "smob.h".
* async.c: Get "async.h", "smob.h", "throw.h", "eval.h".
* boolean.c: Get "boolean.h".
* chars.c: Get "chars.h".
* continuations.c: Get "continuations.h", "dynwind.h", "debug.h",
"stackchk.h".
* debug.c: Get "debug.h", "feature.h", "read.h", "strports.h",
"continuations.h", "alist.h", "srcprop.h", "procprop.h", "smob.h",
"genio.h", "throw.h", "eval.h".
* dynwind.c: Get "dynwind.h", "alist.h", "eval.h".
* eq.c: Get "eq.h", "unif.h", "smob.h", "strorder.h",
"stackchk.h".
* error.c: Get "error.h", "throw.h", "genio.h", "pairs.h".
* eval.c: Get "eval.h", "stackchk.h", "srcprop.h", "debug.h",
"hashtab.h", "procprop.h", "markers.h", "smob.h", "throw.h",
"continuations.h", "eq.h", "sequences.h", "alist.h", "append.h",
"debug.h".
* fdsocket.c: Get "fdsocket.h", "unif.h", "filesys.h".
* feature.c: Get "feature.h".
* files.c: Get "files.h".
* filesys.c: Get "filesys.h", "smob.h", "genio.h".
* fports.c: Get "fports.h", "markers.h".
* gc.c: Get "async.h", "unif.h", "smob.h", "weaks.h",
"genio.h", "struct.h", "stackchk.h", "stime.h".
* gdbint.c: Get "gdbint.h", "chars.h", "eval.h", "print.h",
"read.h", "strports.h", "tag.h".
* genio.c: Get "genio.h", "chars.h".
* gsubr.c: Get "gsubr.h", "genio.h".
* hash.c: Get "hash.h", "chars.h".
* hashtab.c: Get "hashtab.h", "eval.h", "hash.h", "alist.h".
* init.c: Get everyone who has an scm_init_mumble function:
"weaks.h", "vports.h", "version.h", "vectors.h", "variable.h",
"unif.h", "throw.h", "tag.h", "symbols.h", "struct.h",
"strports.h", "strorder.h", "strop.h", "strings.h", "stime.h",
"stackchk.h", "srcprop.h", "socket.h", "simpos.h", "sequences.h",
"scmsigs.h", "read.h", "ramap.h", "procs.h", "procprop.h",
"print.h", "posix.h", "ports.h", "pairs.h", "options.h",
"objprop.h", "numbers.h", "mbstrings.h", "mallocs.h", "load.h",
"list.h", "kw.h", "ioext.h", "hashtab.h", "hash.h", "gsubr.h",
"gdbint.h", "gc.h", "fports.h", "filesys.h", "files.h",
"feature.h", "fdsocket.h", "eval.h", "error.h", "eq.h",
"dynwind.h", "debug.h", "continuations.h", "chars.h", "boolean.h",
"async.h", "arbiters.h", "append.h", "alist.h".
* ioext.c: Get "ioext.h", "fports.h".
* kw.c: Get "kw.h", "smob.h", "mbstrings.h", "genio.h".
* list.c: Get "list.h", "eq.h".
* load.c: Get "load.h", "eval.h", "read.h", "fports.h".
* mallocs.c: Get "smob.h", "genio.h".
* markers.c: Get "markers.h".
* mbstrings.c: Get "mbstrings.h", "read.h", "genio.h", "unif.h",
"chars.h".
* numbers.c: Get "unif.h", "genio.h".
* objprop.c: Get "objprop.h", "weaks.h", "alist.h", "hashtab.h".
* options.c: Get "options.h".
* ports.c: Get "ports.h", "vports.h", "strports.h", "fports.h",
"markers.h", "chars.h", "genio.h".
* posix.c: Get "posix.h", "sequences.h", "feature.h", "unif.h",
"read.h", "scmsigs.h", "genio.h", "fports.h".
* print.c: Get "print.h", "unif.h", "weaks.h", "read.h",
"procprop.h", "eval.h", "smob.h", "mbstrings.h", "genio.h",
"chars.h".
* procprop.c: Get "procprop.h", "eval.h", "alist.h".
* procs.c: Get "procs.h".
* ramap.c: Get "ramap.h", "feature.h", "eval.h", "eq.h",
"chars.h", "smob.h", "unif.h".
* read.c: Get "alist.h", "kw.h", "mbstrings.h", "unif.h",
"eval.h", "genio.h", "chars.h".
* root.c: Get "root.h", "stackchk.h".
* scmsigs.c: Get "scmsigs.h".
* sequences.c: Get "sequences.h".
* simpos.c: Get "simpos.h", "scmsigs.h".
* smob.c: Get "smob.h".
* socket.c: Get "socket.h", "feature.h".
* srcprop.c: Get "srcprop.h", "weaks.h", "hashtab.h", "debug.h",
"alist.h", "smob.h".
* stackchk.c: Get "stackchk.h", "genio.h".
* stime.c: Get "stime.h"."libguile/continuations.h".
* strings.c: Get "strings.h", "chars.h".
* strop.c: Get "strop.h", "chars.h".
* strorder.c: Get "strorder.h", "chars.h".
* strports.c: Get "strports.h", "print.h", "eval.h", "unif.h".
* struct.c: Get "struct.h", "chars.h".
* symbols.c: Get "symbols.h", "mbstrings.h", "alist.h",
"variable.h", "eval.h", "chars.h".
* tag.c: Get "tag.h", "struct.h", "chars.h".
* throw.c: Get "throw.h", "continuations.h", "debug.h",
"dynwind.h", "eval.h", "alist.h", "smob.h", "genio.h".
* unif.c: Get "unif.h", "feature.h", "strop.h", "sequences.h",
"smob.h", "genio.h", "eval.h", "chars.h".
* variable.c: Get "variable.h", "smob.h", "genio.h".
* vectors.c: Get "vectors.h", "eq.h".
* version.c: Get "version.h".
* vports.c: Get "vports.h", "fports.h", "chars.h", "eval.h".
* weaks.c: Get "weaks.h".
1996-09-10 02:26:07 +00:00
|
|
|
|
#include "fports.h"
|
|
|
|
|
|
#include "scmsigs.h"
|
|
|
|
|
|
#include "feature.h"
|
|
|
|
|
|
#include "sequences.h"
|
1996-07-25 22:56:11 +00:00
|
|
|
|
|
C files should #include only the header files they need, not
libguile.h (which #includes all the header files); the pointless
recompilation was wasting my time.
* Makefile.in (all .o dependency lists): Regenerated.
* libguile.h: Don't try to get a definition for size_t here...
* __scm.h: Do it here.
* _scm.h: Since this is the internal libguile header, put things
here that all (or a majority) of the libguile files will want.
Don't #include <libguile.h> here; that generates dependencies on
way too much. Instead, get "__scm.h", "error.h", "pairs.h",
"list.h", "gc.h", "gsubr.h", "procs.h", "numbers.h", "symbols.h",
"boolean.h", "strings.h", "vectors.h", "root.h", "ports.h", and
"async.h".
* alist.c: Get "eq.h", "list.h", "alist.h".
* append.c: Get "append.h", "list.h".
* arbiters.c: Get "arbiters.h", "smob.h".
* async.c: Get "async.h", "smob.h", "throw.h", "eval.h".
* boolean.c: Get "boolean.h".
* chars.c: Get "chars.h".
* continuations.c: Get "continuations.h", "dynwind.h", "debug.h",
"stackchk.h".
* debug.c: Get "debug.h", "feature.h", "read.h", "strports.h",
"continuations.h", "alist.h", "srcprop.h", "procprop.h", "smob.h",
"genio.h", "throw.h", "eval.h".
* dynwind.c: Get "dynwind.h", "alist.h", "eval.h".
* eq.c: Get "eq.h", "unif.h", "smob.h", "strorder.h",
"stackchk.h".
* error.c: Get "error.h", "throw.h", "genio.h", "pairs.h".
* eval.c: Get "eval.h", "stackchk.h", "srcprop.h", "debug.h",
"hashtab.h", "procprop.h", "markers.h", "smob.h", "throw.h",
"continuations.h", "eq.h", "sequences.h", "alist.h", "append.h",
"debug.h".
* fdsocket.c: Get "fdsocket.h", "unif.h", "filesys.h".
* feature.c: Get "feature.h".
* files.c: Get "files.h".
* filesys.c: Get "filesys.h", "smob.h", "genio.h".
* fports.c: Get "fports.h", "markers.h".
* gc.c: Get "async.h", "unif.h", "smob.h", "weaks.h",
"genio.h", "struct.h", "stackchk.h", "stime.h".
* gdbint.c: Get "gdbint.h", "chars.h", "eval.h", "print.h",
"read.h", "strports.h", "tag.h".
* genio.c: Get "genio.h", "chars.h".
* gsubr.c: Get "gsubr.h", "genio.h".
* hash.c: Get "hash.h", "chars.h".
* hashtab.c: Get "hashtab.h", "eval.h", "hash.h", "alist.h".
* init.c: Get everyone who has an scm_init_mumble function:
"weaks.h", "vports.h", "version.h", "vectors.h", "variable.h",
"unif.h", "throw.h", "tag.h", "symbols.h", "struct.h",
"strports.h", "strorder.h", "strop.h", "strings.h", "stime.h",
"stackchk.h", "srcprop.h", "socket.h", "simpos.h", "sequences.h",
"scmsigs.h", "read.h", "ramap.h", "procs.h", "procprop.h",
"print.h", "posix.h", "ports.h", "pairs.h", "options.h",
"objprop.h", "numbers.h", "mbstrings.h", "mallocs.h", "load.h",
"list.h", "kw.h", "ioext.h", "hashtab.h", "hash.h", "gsubr.h",
"gdbint.h", "gc.h", "fports.h", "filesys.h", "files.h",
"feature.h", "fdsocket.h", "eval.h", "error.h", "eq.h",
"dynwind.h", "debug.h", "continuations.h", "chars.h", "boolean.h",
"async.h", "arbiters.h", "append.h", "alist.h".
* ioext.c: Get "ioext.h", "fports.h".
* kw.c: Get "kw.h", "smob.h", "mbstrings.h", "genio.h".
* list.c: Get "list.h", "eq.h".
* load.c: Get "load.h", "eval.h", "read.h", "fports.h".
* mallocs.c: Get "smob.h", "genio.h".
* markers.c: Get "markers.h".
* mbstrings.c: Get "mbstrings.h", "read.h", "genio.h", "unif.h",
"chars.h".
* numbers.c: Get "unif.h", "genio.h".
* objprop.c: Get "objprop.h", "weaks.h", "alist.h", "hashtab.h".
* options.c: Get "options.h".
* ports.c: Get "ports.h", "vports.h", "strports.h", "fports.h",
"markers.h", "chars.h", "genio.h".
* posix.c: Get "posix.h", "sequences.h", "feature.h", "unif.h",
"read.h", "scmsigs.h", "genio.h", "fports.h".
* print.c: Get "print.h", "unif.h", "weaks.h", "read.h",
"procprop.h", "eval.h", "smob.h", "mbstrings.h", "genio.h",
"chars.h".
* procprop.c: Get "procprop.h", "eval.h", "alist.h".
* procs.c: Get "procs.h".
* ramap.c: Get "ramap.h", "feature.h", "eval.h", "eq.h",
"chars.h", "smob.h", "unif.h".
* read.c: Get "alist.h", "kw.h", "mbstrings.h", "unif.h",
"eval.h", "genio.h", "chars.h".
* root.c: Get "root.h", "stackchk.h".
* scmsigs.c: Get "scmsigs.h".
* sequences.c: Get "sequences.h".
* simpos.c: Get "simpos.h", "scmsigs.h".
* smob.c: Get "smob.h".
* socket.c: Get "socket.h", "feature.h".
* srcprop.c: Get "srcprop.h", "weaks.h", "hashtab.h", "debug.h",
"alist.h", "smob.h".
* stackchk.c: Get "stackchk.h", "genio.h".
* stime.c: Get "stime.h"."libguile/continuations.h".
* strings.c: Get "strings.h", "chars.h".
* strop.c: Get "strop.h", "chars.h".
* strorder.c: Get "strorder.h", "chars.h".
* strports.c: Get "strports.h", "print.h", "eval.h", "unif.h".
* struct.c: Get "struct.h", "chars.h".
* symbols.c: Get "symbols.h", "mbstrings.h", "alist.h",
"variable.h", "eval.h", "chars.h".
* tag.c: Get "tag.h", "struct.h", "chars.h".
* throw.c: Get "throw.h", "continuations.h", "debug.h",
"dynwind.h", "eval.h", "alist.h", "smob.h", "genio.h".
* unif.c: Get "unif.h", "feature.h", "strop.h", "sequences.h",
"smob.h", "genio.h", "eval.h", "chars.h".
* variable.c: Get "variable.h", "smob.h", "genio.h".
* vectors.c: Get "vectors.h", "eq.h".
* version.c: Get "version.h".
* vports.c: Get "vports.h", "fports.h", "chars.h", "eval.h".
* weaks.c: Get "weaks.h".
1996-09-10 02:26:07 +00:00
|
|
|
|
#include "posix.h"
|
1996-07-25 22:56:11 +00:00
|
|
|
|
|
|
|
|
|
|
|
1996-08-02 23:26:33 +00:00
|
|
|
|
#ifdef HAVE_STRING_H
|
|
|
|
|
|
#include <string.h>
|
|
|
|
|
|
#endif
|
1996-07-25 22:56:11 +00:00
|
|
|
|
#ifdef TIME_WITH_SYS_TIME
|
|
|
|
|
|
# include <sys/time.h>
|
|
|
|
|
|
# include <time.h>
|
|
|
|
|
|
#else
|
|
|
|
|
|
# if HAVE_SYS_TIME_H
|
|
|
|
|
|
# include <sys/time.h>
|
|
|
|
|
|
# else
|
|
|
|
|
|
# include <time.h>
|
|
|
|
|
|
# endif
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef HAVE_UNISTD_H
|
|
|
|
|
|
#include <unistd.h>
|
1996-08-07 09:46:41 +00:00
|
|
|
|
#else
|
|
|
|
|
|
#ifndef ttyname
|
|
|
|
|
|
extern char *ttyname();
|
|
|
|
|
|
#endif
|
1996-07-25 22:56:11 +00:00
|
|
|
|
#endif
|
|
|
|
|
|
|
1996-11-10 00:14:45 +00:00
|
|
|
|
#ifdef LIBC_H_WITH_UNISTD_H
|
On NextStep, <utime.h> doesn't define struct utime, unless we
#define _POSIX_SOURCE before #including it.
* aclocal.m4 (GUILE_STRUCT_UTIMBUF): New test.
* acconfig.h: New comment text for above CPP symbol.
* configure.in: Call it.
* posix.c: #define _POSIX_SOURCE if it seems necessary.
* configure.in (AC_CHECK_HEADERS): Include sys/utime.h and utime.h
in the list.
* posix.c: Check HAVE_SYS_UTIME_H and HAVE_UTIME_H, instead of
testing for __EMX__.
* posix.c: #include <libc.h>, if it exists.
* posix.c: Cast the return result to GETGROUPS_T, not gid_t; we
don't even know if the latter exists.
* posix.c (s_sys_setpgid, s_sys_setsid, s_sys_ctermid,
s_sys_tcgetpgrp, s_sys_tcsetpgrp): Renamed from s_setpgid,
s_setsid, s_ctermid, s_tcgetpgrp, s_tcsetpgrp, for consistency.
* posix.c (R_OK, W_OK, X_OK, F_OK): #define these if the system's
header files don't.
(scm_init_posix): Use them when initializing the Scheme constants
of the same name.
1996-09-03 04:43:15 +00:00
|
|
|
|
#include <libc.h>
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
1996-07-25 22:56:11 +00:00
|
|
|
|
#ifdef HAVE_SYS_SELECT_H
|
|
|
|
|
|
#include <sys/select.h>
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
1996-08-01 10:54:50 +00:00
|
|
|
|
#include <sys/types.h>
|
1996-07-25 22:56:11 +00:00
|
|
|
|
#include <sys/stat.h>
|
|
|
|
|
|
#include <fcntl.h>
|
|
|
|
|
|
|
|
|
|
|
|
#include <pwd.h>
|
|
|
|
|
|
|
|
|
|
|
|
#if HAVE_SYS_WAIT_H
|
|
|
|
|
|
# include <sys/wait.h>
|
|
|
|
|
|
#endif
|
|
|
|
|
|
#ifndef WEXITSTATUS
|
|
|
|
|
|
# define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
|
|
|
|
|
|
#endif
|
|
|
|
|
|
#ifndef WIFEXITED
|
|
|
|
|
|
# define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#include <signal.h>
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef FD_SET
|
|
|
|
|
|
|
|
|
|
|
|
#define SELECT_TYPE fd_set
|
|
|
|
|
|
#define SELECT_SET_SIZE FD_SETSIZE
|
|
|
|
|
|
|
|
|
|
|
|
#else /* no FD_SET */
|
|
|
|
|
|
|
|
|
|
|
|
/* Define the macros to access a single-int bitmap of descriptors. */
|
|
|
|
|
|
#define SELECT_SET_SIZE 32
|
|
|
|
|
|
#define SELECT_TYPE int
|
|
|
|
|
|
#define FD_SET(n, p) (*(p) |= (1 << (n)))
|
|
|
|
|
|
#define FD_CLR(n, p) (*(p) &= ~(1 << (n)))
|
|
|
|
|
|
#define FD_ISSET(n, p) (*(p) & (1 << (n)))
|
|
|
|
|
|
#define FD_ZERO(p) (*(p) = 0)
|
|
|
|
|
|
|
|
|
|
|
|
#endif /* no FD_SET */
|
|
|
|
|
|
|
|
|
|
|
|
extern FILE *popen ();
|
|
|
|
|
|
extern char ** environ;
|
|
|
|
|
|
|
|
|
|
|
|
#include <grp.h>
|
|
|
|
|
|
#include <sys/utsname.h>
|
|
|
|
|
|
|
|
|
|
|
|
#if HAVE_DIRENT_H
|
|
|
|
|
|
# include <dirent.h>
|
|
|
|
|
|
# define NAMLEN(dirent) strlen((dirent)->d_name)
|
|
|
|
|
|
#else
|
|
|
|
|
|
# define dirent direct
|
|
|
|
|
|
# define NAMLEN(dirent) (dirent)->d_namlen
|
|
|
|
|
|
# if HAVE_SYS_NDIR_H
|
|
|
|
|
|
# include <sys/ndir.h>
|
|
|
|
|
|
# endif
|
|
|
|
|
|
# if HAVE_SYS_DIR_H
|
|
|
|
|
|
# include <sys/dir.h>
|
|
|
|
|
|
# endif
|
|
|
|
|
|
# if HAVE_NDIR_H
|
|
|
|
|
|
# include <ndir.h>
|
|
|
|
|
|
# endif
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
char *strptime ();
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef HAVE_SETLOCALE
|
|
|
|
|
|
#include <locale.h>
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
On NextStep, <utime.h> doesn't define struct utime, unless we
#define _POSIX_SOURCE before #including it.
* aclocal.m4 (GUILE_STRUCT_UTIMBUF): New test.
* acconfig.h: New comment text for above CPP symbol.
* configure.in: Call it.
* posix.c: #define _POSIX_SOURCE if it seems necessary.
* configure.in (AC_CHECK_HEADERS): Include sys/utime.h and utime.h
in the list.
* posix.c: Check HAVE_SYS_UTIME_H and HAVE_UTIME_H, instead of
testing for __EMX__.
* posix.c: #include <libc.h>, if it exists.
* posix.c: Cast the return result to GETGROUPS_T, not gid_t; we
don't even know if the latter exists.
* posix.c (s_sys_setpgid, s_sys_setsid, s_sys_ctermid,
s_sys_tcgetpgrp, s_sys_tcsetpgrp): Renamed from s_setpgid,
s_setsid, s_ctermid, s_tcgetpgrp, s_tcsetpgrp, for consistency.
* posix.c (R_OK, W_OK, X_OK, F_OK): #define these if the system's
header files don't.
(scm_init_posix): Use them when initializing the Scheme constants
of the same name.
1996-09-03 04:43:15 +00:00
|
|
|
|
/* Some Unix systems don't define these. CPP hair is dangerous, but
|
|
|
|
|
|
this seems safe enough... */
|
|
|
|
|
|
#ifndef R_OK
|
|
|
|
|
|
#define R_OK 4
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef W_OK
|
|
|
|
|
|
#define W_OK 2
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef X_OK
|
|
|
|
|
|
#define X_OK 1
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef F_OK
|
|
|
|
|
|
#define F_OK 0
|
|
|
|
|
|
#endif
|
1996-09-04 06:34:02 +00:00
|
|
|
|
|
|
|
|
|
|
/* On NextStep, <utime.h> doesn't define struct utime, unless we
|
|
|
|
|
|
#define _POSIX_SOURCE before #including it. I think this is less
|
|
|
|
|
|
of a kludge than defining struct utimbuf ourselves. */
|
|
|
|
|
|
#ifdef UTIMBUF_NEEDS_POSIX
|
|
|
|
|
|
#define _POSIX_SOURCE
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef HAVE_SYS_UTIME_H
|
|
|
|
|
|
#include <sys/utime.h>
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef HAVE_UTIME_H
|
|
|
|
|
|
#include <utime.h>
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
/* Please don't add any more #includes or #defines here. The hack
|
|
|
|
|
|
above means that _POSIX_SOURCE may be #defined, which will
|
|
|
|
|
|
encourage header files to do strange things. */
|
|
|
|
|
|
|
1996-07-25 22:56:11 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1996-10-28 09:44:07 +00:00
|
|
|
|
SCM_PROC (s_pipe, "pipe", 0, 0, 0, scm_pipe);
|
* __scm.h, alist.c, alist.h, append.c, append.h, appinit.c,
arbiters.c, arbiters.h, async.c, async.h, boolean.c, boolean.h,
chars.c, chars.h, continuations.c, continuations.h, debug.c,
debug.h, dynwind.c, dynwind.h, eq.c, eq.h, error.c, eval.c,
eval.h, extchrs.c, extchrs.h, fdsocket.c, fdsocket.h, filesys.c,
filesys.h, fports.c, fports.h, gc.c, gdb_interface.h, gdbint.c,
gdbint.h, genio.c, genio.h, gscm.c, gscm.h, gsubr.c, gsubr.h,
hash.c, hash.h, hashtab.c, hashtab.h, init.c, ioext.c, ioext.h,
kw.c, kw.h, libguile.h, mallocs.c, mallocs.h, markers.c,
markers.h, mbstrings.c, mbstrings.h, numbers.c, numbers.h,
objprop.c, objprop.h, options.c, options.h, pairs.c, pairs.h,
ports.c, ports.h, posix.c, posix.h, print.c, print.h, procprop.c,
procprop.h, procs.c, procs.h, ramap.c, ramap.h, read.c, read.h,
root.c, scmsigs.c, scmsigs.h, sequences.c, sequences.h, simpos.c,
simpos.h, smob.c, socket.c, socket.h, srcprop.c, srcprop.h,
stackchk.c, stackchk.h, stime.c, stime.h, strings.c, strings.h,
strop.c, strop.h, strorder.c, strorder.h, strports.c, strports.h,
struct.c, struct.h, symbols.c, symbols.h, tag.c, tag.h, unif.c,
unif.h, variable.c, variable.h, vectors.c, vectors.h, version.c,
version.h, vports.c, vports.h, weaks.c, weaks.h: Use SCM_P to
declare functions with prototypes. (Patch thanks to Marius
Vollmer.)
1996-10-14 01:33:50 +00:00
|
|
|
|
|
1996-07-25 22:56:11 +00:00
|
|
|
|
SCM
|
1996-10-28 09:44:07 +00:00
|
|
|
|
scm_pipe ()
|
1996-07-25 22:56:11 +00:00
|
|
|
|
{
|
|
|
|
|
|
int fd[2], rv;
|
|
|
|
|
|
FILE *f_rd, *f_wt;
|
|
|
|
|
|
SCM p_rd, p_wt;
|
1996-08-02 23:26:33 +00:00
|
|
|
|
struct scm_port_table * ptr;
|
|
|
|
|
|
struct scm_port_table * ptw;
|
|
|
|
|
|
|
1996-07-25 22:56:11 +00:00
|
|
|
|
SCM_NEWCELL (p_rd);
|
|
|
|
|
|
SCM_NEWCELL (p_wt);
|
|
|
|
|
|
rv = pipe (fd);
|
|
|
|
|
|
if (rv)
|
1996-10-28 09:44:07 +00:00
|
|
|
|
scm_syserror (s_pipe);
|
1996-07-25 22:56:11 +00:00
|
|
|
|
f_rd = fdopen (fd[0], "r");
|
|
|
|
|
|
if (!f_rd)
|
|
|
|
|
|
{
|
|
|
|
|
|
SCM_SYSCALL (close (fd[0]));
|
|
|
|
|
|
SCM_SYSCALL (close (fd[1]));
|
1996-10-28 09:44:07 +00:00
|
|
|
|
scm_syserror (s_pipe);
|
1996-07-25 22:56:11 +00:00
|
|
|
|
}
|
|
|
|
|
|
f_wt = fdopen (fd[1], "w");
|
|
|
|
|
|
if (!f_wt)
|
|
|
|
|
|
{
|
|
|
|
|
|
int en;
|
|
|
|
|
|
en = errno;
|
|
|
|
|
|
fclose (f_rd);
|
|
|
|
|
|
SCM_SYSCALL (close (fd[1]));
|
1996-08-02 23:26:33 +00:00
|
|
|
|
errno = en;
|
1996-10-28 09:44:07 +00:00
|
|
|
|
scm_syserror (s_pipe);
|
1996-07-25 22:56:11 +00:00
|
|
|
|
}
|
1996-08-02 23:26:33 +00:00
|
|
|
|
ptr = scm_add_to_port_table (p_rd);
|
|
|
|
|
|
ptw = scm_add_to_port_table (p_wt);
|
|
|
|
|
|
SCM_SETPTAB_ENTRY (p_rd, ptr);
|
|
|
|
|
|
SCM_SETPTAB_ENTRY (p_wt, ptw);
|
* alist.c, arbiters.c, continuations.c, debug.c, debug.h, eval.c,
eval.h, feature.c, filesys.c, fports.c, gc.c, gsubr.c, init.c,
ioext.c, kw.c, list.c, load.c, mallocs.c, numbers.c, numbers.h,
pairs.c, pairs.h, ports.c, ports.h, posix.c, procprop.c, procs.c,
procs.h, ramap.c, read.c, root.c, srcprop.c, srcprop.h,
strports.c, symbols.c, tags.h, throw.c, unif.c, variable.c,
vports.c: Cleaned up use of pairs: Don't make any special
assumptions about the internal structure of selectors and
mutators: SCM_CXR (<e1>) = <e2> --> SCM_SETCXR (<e1>, <e2>),
SCM_CXR (<e1>) &= <e2> --> SCM_SETAND_CXR (<e1>, <e2>) etc.
(Among other things, this change makes it easier to build Guile
with certain compilers which have problems with casted lvalues.)
1996-10-20 03:31:08 +00:00
|
|
|
|
SCM_SETCAR (p_rd, scm_tc16_fport | scm_mode_bits ("r"));
|
|
|
|
|
|
SCM_SETCAR (p_wt, scm_tc16_fport | scm_mode_bits ("w"));
|
1996-08-02 23:26:33 +00:00
|
|
|
|
SCM_SETSTREAM (p_rd, (SCM)f_rd);
|
|
|
|
|
|
SCM_SETSTREAM (p_wt, (SCM)f_wt);
|
|
|
|
|
|
|
1996-07-25 22:56:11 +00:00
|
|
|
|
SCM_ALLOW_INTS;
|
|
|
|
|
|
return scm_cons (p_rd, p_wt);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1996-10-28 09:44:07 +00:00
|
|
|
|
SCM_PROC (s_getgroups, "getgroups", 0, 0, 0, scm_getgroups);
|
* __scm.h, alist.c, alist.h, append.c, append.h, appinit.c,
arbiters.c, arbiters.h, async.c, async.h, boolean.c, boolean.h,
chars.c, chars.h, continuations.c, continuations.h, debug.c,
debug.h, dynwind.c, dynwind.h, eq.c, eq.h, error.c, eval.c,
eval.h, extchrs.c, extchrs.h, fdsocket.c, fdsocket.h, filesys.c,
filesys.h, fports.c, fports.h, gc.c, gdb_interface.h, gdbint.c,
gdbint.h, genio.c, genio.h, gscm.c, gscm.h, gsubr.c, gsubr.h,
hash.c, hash.h, hashtab.c, hashtab.h, init.c, ioext.c, ioext.h,
kw.c, kw.h, libguile.h, mallocs.c, mallocs.h, markers.c,
markers.h, mbstrings.c, mbstrings.h, numbers.c, numbers.h,
objprop.c, objprop.h, options.c, options.h, pairs.c, pairs.h,
ports.c, ports.h, posix.c, posix.h, print.c, print.h, procprop.c,
procprop.h, procs.c, procs.h, ramap.c, ramap.h, read.c, read.h,
root.c, scmsigs.c, scmsigs.h, sequences.c, sequences.h, simpos.c,
simpos.h, smob.c, socket.c, socket.h, srcprop.c, srcprop.h,
stackchk.c, stackchk.h, stime.c, stime.h, strings.c, strings.h,
strop.c, strop.h, strorder.c, strorder.h, strports.c, strports.h,
struct.c, struct.h, symbols.c, symbols.h, tag.c, tag.h, unif.c,
unif.h, variable.c, variable.h, vectors.c, vectors.h, version.c,
version.h, vports.c, vports.h, weaks.c, weaks.h: Use SCM_P to
declare functions with prototypes. (Patch thanks to Marius
Vollmer.)
1996-10-14 01:33:50 +00:00
|
|
|
|
|
1996-07-25 22:56:11 +00:00
|
|
|
|
SCM
|
1996-10-28 09:44:07 +00:00
|
|
|
|
scm_getgroups()
|
1996-07-25 22:56:11 +00:00
|
|
|
|
{
|
|
|
|
|
|
SCM grps, ans;
|
|
|
|
|
|
int ngroups = getgroups (0, NULL);
|
1996-08-02 23:26:33 +00:00
|
|
|
|
if (!ngroups)
|
1996-10-28 09:44:07 +00:00
|
|
|
|
scm_syserror (s_getgroups);
|
1996-07-25 22:56:11 +00:00
|
|
|
|
SCM_NEWCELL(grps);
|
|
|
|
|
|
SCM_DEFER_INTS;
|
|
|
|
|
|
{
|
|
|
|
|
|
GETGROUPS_T *groups;
|
|
|
|
|
|
int val;
|
|
|
|
|
|
|
On NextStep, <utime.h> doesn't define struct utime, unless we
#define _POSIX_SOURCE before #including it.
* aclocal.m4 (GUILE_STRUCT_UTIMBUF): New test.
* acconfig.h: New comment text for above CPP symbol.
* configure.in: Call it.
* posix.c: #define _POSIX_SOURCE if it seems necessary.
* configure.in (AC_CHECK_HEADERS): Include sys/utime.h and utime.h
in the list.
* posix.c: Check HAVE_SYS_UTIME_H and HAVE_UTIME_H, instead of
testing for __EMX__.
* posix.c: #include <libc.h>, if it exists.
* posix.c: Cast the return result to GETGROUPS_T, not gid_t; we
don't even know if the latter exists.
* posix.c (s_sys_setpgid, s_sys_setsid, s_sys_ctermid,
s_sys_tcgetpgrp, s_sys_tcsetpgrp): Renamed from s_setpgid,
s_setsid, s_ctermid, s_tcgetpgrp, s_tcsetpgrp, for consistency.
* posix.c (R_OK, W_OK, X_OK, F_OK): #define these if the system's
header files don't.
(scm_init_posix): Use them when initializing the Scheme constants
of the same name.
1996-09-03 04:43:15 +00:00
|
|
|
|
groups = (GETGROUPS_T *) scm_must_malloc(ngroups * sizeof(GETGROUPS_T),
|
1996-10-28 09:44:07 +00:00
|
|
|
|
s_getgroups);
|
1996-07-25 22:56:11 +00:00
|
|
|
|
val = getgroups(ngroups, groups);
|
|
|
|
|
|
if (val < 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
scm_must_free((char *)groups);
|
1996-10-28 09:44:07 +00:00
|
|
|
|
scm_syserror (s_getgroups);
|
1996-07-25 22:56:11 +00:00
|
|
|
|
}
|
|
|
|
|
|
SCM_SETCHARS(grps, groups); /* set up grps as a GC protect */
|
|
|
|
|
|
SCM_SETLENGTH(grps, 0L + ngroups * sizeof(GETGROUPS_T), scm_tc7_string);
|
|
|
|
|
|
SCM_ALLOW_INTS;
|
|
|
|
|
|
ans = scm_make_vector(SCM_MAKINUM(ngroups), SCM_UNDEFINED, SCM_BOOL_F);
|
|
|
|
|
|
while (--ngroups >= 0) SCM_VELTS(ans)[ngroups] = SCM_MAKINUM(groups[ngroups]);
|
|
|
|
|
|
SCM_SETCHARS(grps, groups); /* to make sure grps stays around. */
|
|
|
|
|
|
return ans;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1996-10-28 09:44:07 +00:00
|
|
|
|
SCM_PROC (s_getpwuid, "getpw", 0, 1, 0, scm_getpwuid);
|
* __scm.h, alist.c, alist.h, append.c, append.h, appinit.c,
arbiters.c, arbiters.h, async.c, async.h, boolean.c, boolean.h,
chars.c, chars.h, continuations.c, continuations.h, debug.c,
debug.h, dynwind.c, dynwind.h, eq.c, eq.h, error.c, eval.c,
eval.h, extchrs.c, extchrs.h, fdsocket.c, fdsocket.h, filesys.c,
filesys.h, fports.c, fports.h, gc.c, gdb_interface.h, gdbint.c,
gdbint.h, genio.c, genio.h, gscm.c, gscm.h, gsubr.c, gsubr.h,
hash.c, hash.h, hashtab.c, hashtab.h, init.c, ioext.c, ioext.h,
kw.c, kw.h, libguile.h, mallocs.c, mallocs.h, markers.c,
markers.h, mbstrings.c, mbstrings.h, numbers.c, numbers.h,
objprop.c, objprop.h, options.c, options.h, pairs.c, pairs.h,
ports.c, ports.h, posix.c, posix.h, print.c, print.h, procprop.c,
procprop.h, procs.c, procs.h, ramap.c, ramap.h, read.c, read.h,
root.c, scmsigs.c, scmsigs.h, sequences.c, sequences.h, simpos.c,
simpos.h, smob.c, socket.c, socket.h, srcprop.c, srcprop.h,
stackchk.c, stackchk.h, stime.c, stime.h, strings.c, strings.h,
strop.c, strop.h, strorder.c, strorder.h, strports.c, strports.h,
struct.c, struct.h, symbols.c, symbols.h, tag.c, tag.h, unif.c,
unif.h, variable.c, variable.h, vectors.c, vectors.h, version.c,
version.h, vports.c, vports.h, weaks.c, weaks.h: Use SCM_P to
declare functions with prototypes. (Patch thanks to Marius
Vollmer.)
1996-10-14 01:33:50 +00:00
|
|
|
|
|
1996-07-25 22:56:11 +00:00
|
|
|
|
SCM
|
1996-10-28 09:44:07 +00:00
|
|
|
|
scm_getpwuid (user)
|
1996-07-25 22:56:11 +00:00
|
|
|
|
SCM user;
|
|
|
|
|
|
{
|
|
|
|
|
|
SCM result;
|
|
|
|
|
|
struct passwd *entry;
|
|
|
|
|
|
SCM *ve;
|
|
|
|
|
|
|
|
|
|
|
|
result = scm_make_vector (SCM_MAKINUM (7), SCM_UNSPECIFIED, SCM_BOOL_F);
|
|
|
|
|
|
ve = SCM_VELTS (result);
|
|
|
|
|
|
if (SCM_UNBNDP (user) || SCM_FALSEP (user))
|
|
|
|
|
|
{
|
|
|
|
|
|
SCM_DEFER_INTS;
|
|
|
|
|
|
SCM_SYSCALL (entry = getpwent ());
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (SCM_INUMP (user))
|
|
|
|
|
|
{
|
|
|
|
|
|
SCM_DEFER_INTS;
|
|
|
|
|
|
entry = getpwuid (SCM_INUM (user));
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
1996-10-28 09:44:07 +00:00
|
|
|
|
SCM_ASSERT (SCM_NIMP (user) && SCM_ROSTRINGP (user), user, SCM_ARG1, s_getpwuid);
|
1996-07-25 22:56:11 +00:00
|
|
|
|
if (SCM_SUBSTRP (user))
|
|
|
|
|
|
user = scm_makfromstr (SCM_ROCHARS (user), SCM_ROLENGTH (user), 0);
|
|
|
|
|
|
SCM_DEFER_INTS;
|
|
|
|
|
|
entry = getpwnam (SCM_ROCHARS (user));
|
|
|
|
|
|
}
|
|
|
|
|
|
if (!entry)
|
1996-10-28 09:44:07 +00:00
|
|
|
|
scm_syserror (s_getpwuid);
|
1996-08-02 23:26:33 +00:00
|
|
|
|
|
1996-07-25 22:56:11 +00:00
|
|
|
|
ve[0] = scm_makfrom0str (entry->pw_name);
|
|
|
|
|
|
ve[1] = scm_makfrom0str (entry->pw_passwd);
|
|
|
|
|
|
ve[2] = scm_ulong2num ((unsigned long) entry->pw_uid);
|
|
|
|
|
|
ve[3] = scm_ulong2num ((unsigned long) entry->pw_gid);
|
|
|
|
|
|
ve[4] = scm_makfrom0str (entry->pw_gecos);
|
|
|
|
|
|
if (!entry->pw_dir)
|
|
|
|
|
|
ve[5] = scm_makfrom0str ("");
|
|
|
|
|
|
else
|
|
|
|
|
|
ve[5] = scm_makfrom0str (entry->pw_dir);
|
|
|
|
|
|
if (!entry->pw_shell)
|
|
|
|
|
|
ve[6] = scm_makfrom0str ("");
|
|
|
|
|
|
else
|
|
|
|
|
|
ve[6] = scm_makfrom0str (entry->pw_shell);
|
|
|
|
|
|
SCM_ALLOW_INTS;
|
|
|
|
|
|
return result;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SCM_PROC (s_setpwent, "setpw", 0, 1, 0, scm_setpwent);
|
* __scm.h, alist.c, alist.h, append.c, append.h, appinit.c,
arbiters.c, arbiters.h, async.c, async.h, boolean.c, boolean.h,
chars.c, chars.h, continuations.c, continuations.h, debug.c,
debug.h, dynwind.c, dynwind.h, eq.c, eq.h, error.c, eval.c,
eval.h, extchrs.c, extchrs.h, fdsocket.c, fdsocket.h, filesys.c,
filesys.h, fports.c, fports.h, gc.c, gdb_interface.h, gdbint.c,
gdbint.h, genio.c, genio.h, gscm.c, gscm.h, gsubr.c, gsubr.h,
hash.c, hash.h, hashtab.c, hashtab.h, init.c, ioext.c, ioext.h,
kw.c, kw.h, libguile.h, mallocs.c, mallocs.h, markers.c,
markers.h, mbstrings.c, mbstrings.h, numbers.c, numbers.h,
objprop.c, objprop.h, options.c, options.h, pairs.c, pairs.h,
ports.c, ports.h, posix.c, posix.h, print.c, print.h, procprop.c,
procprop.h, procs.c, procs.h, ramap.c, ramap.h, read.c, read.h,
root.c, scmsigs.c, scmsigs.h, sequences.c, sequences.h, simpos.c,
simpos.h, smob.c, socket.c, socket.h, srcprop.c, srcprop.h,
stackchk.c, stackchk.h, stime.c, stime.h, strings.c, strings.h,
strop.c, strop.h, strorder.c, strorder.h, strports.c, strports.h,
struct.c, struct.h, symbols.c, symbols.h, tag.c, tag.h, unif.c,
unif.h, variable.c, variable.h, vectors.c, vectors.h, version.c,
version.h, vports.c, vports.h, weaks.c, weaks.h: Use SCM_P to
declare functions with prototypes. (Patch thanks to Marius
Vollmer.)
1996-10-14 01:33:50 +00:00
|
|
|
|
|
1996-07-25 22:56:11 +00:00
|
|
|
|
SCM
|
|
|
|
|
|
scm_setpwent (arg)
|
|
|
|
|
|
SCM arg;
|
|
|
|
|
|
{
|
|
|
|
|
|
if (SCM_UNBNDP (arg) || SCM_FALSEP (arg))
|
|
|
|
|
|
endpwent ();
|
|
|
|
|
|
else
|
|
|
|
|
|
setpwent ();
|
|
|
|
|
|
return SCM_UNSPECIFIED;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Combines getgrgid and getgrnam. */
|
1996-10-28 09:44:07 +00:00
|
|
|
|
SCM_PROC (s_getgrgid, "getgr", 0, 1, 0, scm_getgrgid);
|
* __scm.h, alist.c, alist.h, append.c, append.h, appinit.c,
arbiters.c, arbiters.h, async.c, async.h, boolean.c, boolean.h,
chars.c, chars.h, continuations.c, continuations.h, debug.c,
debug.h, dynwind.c, dynwind.h, eq.c, eq.h, error.c, eval.c,
eval.h, extchrs.c, extchrs.h, fdsocket.c, fdsocket.h, filesys.c,
filesys.h, fports.c, fports.h, gc.c, gdb_interface.h, gdbint.c,
gdbint.h, genio.c, genio.h, gscm.c, gscm.h, gsubr.c, gsubr.h,
hash.c, hash.h, hashtab.c, hashtab.h, init.c, ioext.c, ioext.h,
kw.c, kw.h, libguile.h, mallocs.c, mallocs.h, markers.c,
markers.h, mbstrings.c, mbstrings.h, numbers.c, numbers.h,
objprop.c, objprop.h, options.c, options.h, pairs.c, pairs.h,
ports.c, ports.h, posix.c, posix.h, print.c, print.h, procprop.c,
procprop.h, procs.c, procs.h, ramap.c, ramap.h, read.c, read.h,
root.c, scmsigs.c, scmsigs.h, sequences.c, sequences.h, simpos.c,
simpos.h, smob.c, socket.c, socket.h, srcprop.c, srcprop.h,
stackchk.c, stackchk.h, stime.c, stime.h, strings.c, strings.h,
strop.c, strop.h, strorder.c, strorder.h, strports.c, strports.h,
struct.c, struct.h, symbols.c, symbols.h, tag.c, tag.h, unif.c,
unif.h, variable.c, variable.h, vectors.c, vectors.h, version.c,
version.h, vports.c, vports.h, weaks.c, weaks.h: Use SCM_P to
declare functions with prototypes. (Patch thanks to Marius
Vollmer.)
1996-10-14 01:33:50 +00:00
|
|
|
|
|
1996-07-25 22:56:11 +00:00
|
|
|
|
SCM
|
1996-10-28 09:44:07 +00:00
|
|
|
|
scm_getgrgid (name)
|
1996-07-25 22:56:11 +00:00
|
|
|
|
SCM name;
|
|
|
|
|
|
{
|
|
|
|
|
|
SCM result;
|
|
|
|
|
|
struct group *entry;
|
|
|
|
|
|
SCM *ve;
|
|
|
|
|
|
result = scm_make_vector (SCM_MAKINUM (4), SCM_UNSPECIFIED, SCM_BOOL_F);
|
|
|
|
|
|
ve = SCM_VELTS (result);
|
|
|
|
|
|
SCM_DEFER_INTS;
|
|
|
|
|
|
if (SCM_UNBNDP (name) || (name == SCM_BOOL_F))
|
|
|
|
|
|
SCM_SYSCALL (entry = getgrent ());
|
|
|
|
|
|
else if (SCM_INUMP (name))
|
|
|
|
|
|
SCM_SYSCALL (entry = getgrgid (SCM_INUM (name)));
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
1997-03-13 21:54:02 +00:00
|
|
|
|
SCM_ASSERT (SCM_NIMP (name) && SCM_ROSTRINGP (name), name, SCM_ARG1,
|
|
|
|
|
|
s_getgrgid);
|
|
|
|
|
|
SCM_SYSCALL (entry = getgrnam (SCM_ROCHARS (name)));
|
1996-07-25 22:56:11 +00:00
|
|
|
|
}
|
|
|
|
|
|
if (!entry)
|
1996-10-28 09:44:07 +00:00
|
|
|
|
scm_syserror (s_getgrgid);
|
1996-08-02 23:26:33 +00:00
|
|
|
|
|
1996-07-25 22:56:11 +00:00
|
|
|
|
ve[0] = scm_makfrom0str (entry->gr_name);
|
|
|
|
|
|
ve[1] = scm_makfrom0str (entry->gr_passwd);
|
|
|
|
|
|
ve[2] = scm_ulong2num ((unsigned long) entry->gr_gid);
|
|
|
|
|
|
ve[3] = scm_makfromstrs (-1, entry->gr_mem);
|
|
|
|
|
|
SCM_ALLOW_INTS;
|
|
|
|
|
|
return result;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SCM_PROC (s_setgrent, "setgr", 0, 1, 0, scm_setgrent);
|
* __scm.h, alist.c, alist.h, append.c, append.h, appinit.c,
arbiters.c, arbiters.h, async.c, async.h, boolean.c, boolean.h,
chars.c, chars.h, continuations.c, continuations.h, debug.c,
debug.h, dynwind.c, dynwind.h, eq.c, eq.h, error.c, eval.c,
eval.h, extchrs.c, extchrs.h, fdsocket.c, fdsocket.h, filesys.c,
filesys.h, fports.c, fports.h, gc.c, gdb_interface.h, gdbint.c,
gdbint.h, genio.c, genio.h, gscm.c, gscm.h, gsubr.c, gsubr.h,
hash.c, hash.h, hashtab.c, hashtab.h, init.c, ioext.c, ioext.h,
kw.c, kw.h, libguile.h, mallocs.c, mallocs.h, markers.c,
markers.h, mbstrings.c, mbstrings.h, numbers.c, numbers.h,
objprop.c, objprop.h, options.c, options.h, pairs.c, pairs.h,
ports.c, ports.h, posix.c, posix.h, print.c, print.h, procprop.c,
procprop.h, procs.c, procs.h, ramap.c, ramap.h, read.c, read.h,
root.c, scmsigs.c, scmsigs.h, sequences.c, sequences.h, simpos.c,
simpos.h, smob.c, socket.c, socket.h, srcprop.c, srcprop.h,
stackchk.c, stackchk.h, stime.c, stime.h, strings.c, strings.h,
strop.c, strop.h, strorder.c, strorder.h, strports.c, strports.h,
struct.c, struct.h, symbols.c, symbols.h, tag.c, tag.h, unif.c,
unif.h, variable.c, variable.h, vectors.c, vectors.h, version.c,
version.h, vports.c, vports.h, weaks.c, weaks.h: Use SCM_P to
declare functions with prototypes. (Patch thanks to Marius
Vollmer.)
1996-10-14 01:33:50 +00:00
|
|
|
|
|
1996-07-25 22:56:11 +00:00
|
|
|
|
SCM
|
|
|
|
|
|
scm_setgrent (arg)
|
|
|
|
|
|
SCM arg;
|
|
|
|
|
|
{
|
|
|
|
|
|
if (SCM_UNBNDP (arg) || SCM_FALSEP (arg))
|
|
|
|
|
|
endgrent ();
|
|
|
|
|
|
else
|
|
|
|
|
|
setgrent ();
|
|
|
|
|
|
return SCM_UNSPECIFIED;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1996-10-28 09:44:07 +00:00
|
|
|
|
SCM_PROC (s_kill, "kill", 2, 0, 0, scm_kill);
|
* __scm.h, alist.c, alist.h, append.c, append.h, appinit.c,
arbiters.c, arbiters.h, async.c, async.h, boolean.c, boolean.h,
chars.c, chars.h, continuations.c, continuations.h, debug.c,
debug.h, dynwind.c, dynwind.h, eq.c, eq.h, error.c, eval.c,
eval.h, extchrs.c, extchrs.h, fdsocket.c, fdsocket.h, filesys.c,
filesys.h, fports.c, fports.h, gc.c, gdb_interface.h, gdbint.c,
gdbint.h, genio.c, genio.h, gscm.c, gscm.h, gsubr.c, gsubr.h,
hash.c, hash.h, hashtab.c, hashtab.h, init.c, ioext.c, ioext.h,
kw.c, kw.h, libguile.h, mallocs.c, mallocs.h, markers.c,
markers.h, mbstrings.c, mbstrings.h, numbers.c, numbers.h,
objprop.c, objprop.h, options.c, options.h, pairs.c, pairs.h,
ports.c, ports.h, posix.c, posix.h, print.c, print.h, procprop.c,
procprop.h, procs.c, procs.h, ramap.c, ramap.h, read.c, read.h,
root.c, scmsigs.c, scmsigs.h, sequences.c, sequences.h, simpos.c,
simpos.h, smob.c, socket.c, socket.h, srcprop.c, srcprop.h,
stackchk.c, stackchk.h, stime.c, stime.h, strings.c, strings.h,
strop.c, strop.h, strorder.c, strorder.h, strports.c, strports.h,
struct.c, struct.h, symbols.c, symbols.h, tag.c, tag.h, unif.c,
unif.h, variable.c, variable.h, vectors.c, vectors.h, version.c,
version.h, vports.c, vports.h, weaks.c, weaks.h: Use SCM_P to
declare functions with prototypes. (Patch thanks to Marius
Vollmer.)
1996-10-14 01:33:50 +00:00
|
|
|
|
|
1996-07-25 22:56:11 +00:00
|
|
|
|
SCM
|
1996-10-28 09:44:07 +00:00
|
|
|
|
scm_kill (pid, sig)
|
1996-07-25 22:56:11 +00:00
|
|
|
|
SCM pid;
|
|
|
|
|
|
SCM sig;
|
|
|
|
|
|
{
|
1996-10-28 09:44:07 +00:00
|
|
|
|
SCM_ASSERT (SCM_INUMP (pid), pid, SCM_ARG1, s_kill);
|
|
|
|
|
|
SCM_ASSERT (SCM_INUMP (sig), sig, SCM_ARG2, s_kill);
|
1996-07-25 22:56:11 +00:00
|
|
|
|
/* Signal values are interned in scm_init_posix(). */
|
1996-08-02 23:26:33 +00:00
|
|
|
|
if (kill ((int) SCM_INUM (pid), (int) SCM_INUM (sig)) != 0)
|
1996-10-28 09:44:07 +00:00
|
|
|
|
scm_syserror (s_kill);
|
1996-08-02 23:26:33 +00:00
|
|
|
|
return SCM_UNSPECIFIED;
|
1996-07-25 22:56:11 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1996-10-28 09:44:07 +00:00
|
|
|
|
SCM_PROC (s_waitpid, "waitpid", 1, 1, 0, scm_waitpid);
|
* __scm.h, alist.c, alist.h, append.c, append.h, appinit.c,
arbiters.c, arbiters.h, async.c, async.h, boolean.c, boolean.h,
chars.c, chars.h, continuations.c, continuations.h, debug.c,
debug.h, dynwind.c, dynwind.h, eq.c, eq.h, error.c, eval.c,
eval.h, extchrs.c, extchrs.h, fdsocket.c, fdsocket.h, filesys.c,
filesys.h, fports.c, fports.h, gc.c, gdb_interface.h, gdbint.c,
gdbint.h, genio.c, genio.h, gscm.c, gscm.h, gsubr.c, gsubr.h,
hash.c, hash.h, hashtab.c, hashtab.h, init.c, ioext.c, ioext.h,
kw.c, kw.h, libguile.h, mallocs.c, mallocs.h, markers.c,
markers.h, mbstrings.c, mbstrings.h, numbers.c, numbers.h,
objprop.c, objprop.h, options.c, options.h, pairs.c, pairs.h,
ports.c, ports.h, posix.c, posix.h, print.c, print.h, procprop.c,
procprop.h, procs.c, procs.h, ramap.c, ramap.h, read.c, read.h,
root.c, scmsigs.c, scmsigs.h, sequences.c, sequences.h, simpos.c,
simpos.h, smob.c, socket.c, socket.h, srcprop.c, srcprop.h,
stackchk.c, stackchk.h, stime.c, stime.h, strings.c, strings.h,
strop.c, strop.h, strorder.c, strorder.h, strports.c, strports.h,
struct.c, struct.h, symbols.c, symbols.h, tag.c, tag.h, unif.c,
unif.h, variable.c, variable.h, vectors.c, vectors.h, version.c,
version.h, vports.c, vports.h, weaks.c, weaks.h: Use SCM_P to
declare functions with prototypes. (Patch thanks to Marius
Vollmer.)
1996-10-14 01:33:50 +00:00
|
|
|
|
|
1996-07-25 22:56:11 +00:00
|
|
|
|
SCM
|
1996-10-28 09:44:07 +00:00
|
|
|
|
scm_waitpid (pid, options)
|
1996-07-25 22:56:11 +00:00
|
|
|
|
SCM pid;
|
|
|
|
|
|
SCM options;
|
|
|
|
|
|
{
|
More functions unavailable on some systems.
* configure.in (AC_CHECK_FUNCS): Add ctermid, setpgid, setsid,
tcgetpgrp, tcsetpgrp, and waitpid to the list of functions to
check for.
* configure, scmconfig.h.in: Updated, using autoconf and autoheader.
* posix.c (scm_sys_ctermid, scm_sys_setpgid, scm_sys_setsid,
scm_sys_tcgetpgrp, scm_sys_tcsetpgrp, scm_sys_waitpid): Put the
bodies of these functions in "#ifdef HAVE_MUMBLE" clauses, with a
stub that signals an error as the #else.
1996-08-07 20:25:10 +00:00
|
|
|
|
#ifdef HAVE_WAITPID
|
1996-07-25 22:56:11 +00:00
|
|
|
|
int i;
|
|
|
|
|
|
int status;
|
|
|
|
|
|
int ioptions;
|
1996-10-28 09:44:07 +00:00
|
|
|
|
SCM_ASSERT (SCM_INUMP (pid), pid, SCM_ARG1, s_waitpid);
|
1996-07-25 22:56:11 +00:00
|
|
|
|
if (SCM_UNBNDP (options))
|
|
|
|
|
|
ioptions = 0;
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
1996-10-28 09:44:07 +00:00
|
|
|
|
SCM_ASSERT (SCM_INUMP (options), options, SCM_ARG2, s_waitpid);
|
1996-07-25 22:56:11 +00:00
|
|
|
|
/* Flags are interned in scm_init_posix. */
|
|
|
|
|
|
ioptions = SCM_INUM (options);
|
|
|
|
|
|
}
|
|
|
|
|
|
SCM_SYSCALL (i = waitpid (SCM_INUM (pid), &status, ioptions));
|
1996-08-02 23:26:33 +00:00
|
|
|
|
if (i == -1)
|
1996-10-28 09:44:07 +00:00
|
|
|
|
scm_syserror (s_waitpid);
|
1996-08-02 23:26:33 +00:00
|
|
|
|
return scm_cons (SCM_MAKINUM (0L + i), SCM_MAKINUM (0L + status));
|
More functions unavailable on some systems.
* configure.in (AC_CHECK_FUNCS): Add ctermid, setpgid, setsid,
tcgetpgrp, tcsetpgrp, and waitpid to the list of functions to
check for.
* configure, scmconfig.h.in: Updated, using autoconf and autoheader.
* posix.c (scm_sys_ctermid, scm_sys_setpgid, scm_sys_setsid,
scm_sys_tcgetpgrp, scm_sys_tcsetpgrp, scm_sys_waitpid): Put the
bodies of these functions in "#ifdef HAVE_MUMBLE" clauses, with a
stub that signals an error as the #else.
1996-08-07 20:25:10 +00:00
|
|
|
|
#else
|
1996-10-28 09:44:07 +00:00
|
|
|
|
scm_sysmissing (s_waitpid);
|
More functions unavailable on some systems.
* configure.in (AC_CHECK_FUNCS): Add ctermid, setpgid, setsid,
tcgetpgrp, tcsetpgrp, and waitpid to the list of functions to
check for.
* configure, scmconfig.h.in: Updated, using autoconf and autoheader.
* posix.c (scm_sys_ctermid, scm_sys_setpgid, scm_sys_setsid,
scm_sys_tcgetpgrp, scm_sys_tcsetpgrp, scm_sys_waitpid): Put the
bodies of these functions in "#ifdef HAVE_MUMBLE" clauses, with a
stub that signals an error as the #else.
1996-08-07 20:25:10 +00:00
|
|
|
|
/* not reached. */
|
|
|
|
|
|
return SCM_BOOL_F;
|
|
|
|
|
|
#endif
|
1996-07-25 22:56:11 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SCM_PROC (s_getppid, "getppid", 0, 0, 0, scm_getppid);
|
* __scm.h, alist.c, alist.h, append.c, append.h, appinit.c,
arbiters.c, arbiters.h, async.c, async.h, boolean.c, boolean.h,
chars.c, chars.h, continuations.c, continuations.h, debug.c,
debug.h, dynwind.c, dynwind.h, eq.c, eq.h, error.c, eval.c,
eval.h, extchrs.c, extchrs.h, fdsocket.c, fdsocket.h, filesys.c,
filesys.h, fports.c, fports.h, gc.c, gdb_interface.h, gdbint.c,
gdbint.h, genio.c, genio.h, gscm.c, gscm.h, gsubr.c, gsubr.h,
hash.c, hash.h, hashtab.c, hashtab.h, init.c, ioext.c, ioext.h,
kw.c, kw.h, libguile.h, mallocs.c, mallocs.h, markers.c,
markers.h, mbstrings.c, mbstrings.h, numbers.c, numbers.h,
objprop.c, objprop.h, options.c, options.h, pairs.c, pairs.h,
ports.c, ports.h, posix.c, posix.h, print.c, print.h, procprop.c,
procprop.h, procs.c, procs.h, ramap.c, ramap.h, read.c, read.h,
root.c, scmsigs.c, scmsigs.h, sequences.c, sequences.h, simpos.c,
simpos.h, smob.c, socket.c, socket.h, srcprop.c, srcprop.h,
stackchk.c, stackchk.h, stime.c, stime.h, strings.c, strings.h,
strop.c, strop.h, strorder.c, strorder.h, strports.c, strports.h,
struct.c, struct.h, symbols.c, symbols.h, tag.c, tag.h, unif.c,
unif.h, variable.c, variable.h, vectors.c, vectors.h, version.c,
version.h, vports.c, vports.h, weaks.c, weaks.h: Use SCM_P to
declare functions with prototypes. (Patch thanks to Marius
Vollmer.)
1996-10-14 01:33:50 +00:00
|
|
|
|
|
1996-07-25 22:56:11 +00:00
|
|
|
|
SCM
|
|
|
|
|
|
scm_getppid ()
|
|
|
|
|
|
{
|
|
|
|
|
|
return SCM_MAKINUM (0L + getppid ());
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SCM_PROC (s_getuid, "getuid", 0, 0, 0, scm_getuid);
|
* __scm.h, alist.c, alist.h, append.c, append.h, appinit.c,
arbiters.c, arbiters.h, async.c, async.h, boolean.c, boolean.h,
chars.c, chars.h, continuations.c, continuations.h, debug.c,
debug.h, dynwind.c, dynwind.h, eq.c, eq.h, error.c, eval.c,
eval.h, extchrs.c, extchrs.h, fdsocket.c, fdsocket.h, filesys.c,
filesys.h, fports.c, fports.h, gc.c, gdb_interface.h, gdbint.c,
gdbint.h, genio.c, genio.h, gscm.c, gscm.h, gsubr.c, gsubr.h,
hash.c, hash.h, hashtab.c, hashtab.h, init.c, ioext.c, ioext.h,
kw.c, kw.h, libguile.h, mallocs.c, mallocs.h, markers.c,
markers.h, mbstrings.c, mbstrings.h, numbers.c, numbers.h,
objprop.c, objprop.h, options.c, options.h, pairs.c, pairs.h,
ports.c, ports.h, posix.c, posix.h, print.c, print.h, procprop.c,
procprop.h, procs.c, procs.h, ramap.c, ramap.h, read.c, read.h,
root.c, scmsigs.c, scmsigs.h, sequences.c, sequences.h, simpos.c,
simpos.h, smob.c, socket.c, socket.h, srcprop.c, srcprop.h,
stackchk.c, stackchk.h, stime.c, stime.h, strings.c, strings.h,
strop.c, strop.h, strorder.c, strorder.h, strports.c, strports.h,
struct.c, struct.h, symbols.c, symbols.h, tag.c, tag.h, unif.c,
unif.h, variable.c, variable.h, vectors.c, vectors.h, version.c,
version.h, vports.c, vports.h, weaks.c, weaks.h: Use SCM_P to
declare functions with prototypes. (Patch thanks to Marius
Vollmer.)
1996-10-14 01:33:50 +00:00
|
|
|
|
|
1996-07-25 22:56:11 +00:00
|
|
|
|
SCM
|
|
|
|
|
|
scm_getuid ()
|
|
|
|
|
|
{
|
|
|
|
|
|
return SCM_MAKINUM (0L + getuid ());
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SCM_PROC (s_getgid, "getgid", 0, 0, 0, scm_getgid);
|
* __scm.h, alist.c, alist.h, append.c, append.h, appinit.c,
arbiters.c, arbiters.h, async.c, async.h, boolean.c, boolean.h,
chars.c, chars.h, continuations.c, continuations.h, debug.c,
debug.h, dynwind.c, dynwind.h, eq.c, eq.h, error.c, eval.c,
eval.h, extchrs.c, extchrs.h, fdsocket.c, fdsocket.h, filesys.c,
filesys.h, fports.c, fports.h, gc.c, gdb_interface.h, gdbint.c,
gdbint.h, genio.c, genio.h, gscm.c, gscm.h, gsubr.c, gsubr.h,
hash.c, hash.h, hashtab.c, hashtab.h, init.c, ioext.c, ioext.h,
kw.c, kw.h, libguile.h, mallocs.c, mallocs.h, markers.c,
markers.h, mbstrings.c, mbstrings.h, numbers.c, numbers.h,
objprop.c, objprop.h, options.c, options.h, pairs.c, pairs.h,
ports.c, ports.h, posix.c, posix.h, print.c, print.h, procprop.c,
procprop.h, procs.c, procs.h, ramap.c, ramap.h, read.c, read.h,
root.c, scmsigs.c, scmsigs.h, sequences.c, sequences.h, simpos.c,
simpos.h, smob.c, socket.c, socket.h, srcprop.c, srcprop.h,
stackchk.c, stackchk.h, stime.c, stime.h, strings.c, strings.h,
strop.c, strop.h, strorder.c, strorder.h, strports.c, strports.h,
struct.c, struct.h, symbols.c, symbols.h, tag.c, tag.h, unif.c,
unif.h, variable.c, variable.h, vectors.c, vectors.h, version.c,
version.h, vports.c, vports.h, weaks.c, weaks.h: Use SCM_P to
declare functions with prototypes. (Patch thanks to Marius
Vollmer.)
1996-10-14 01:33:50 +00:00
|
|
|
|
|
1996-07-25 22:56:11 +00:00
|
|
|
|
SCM
|
|
|
|
|
|
scm_getgid ()
|
|
|
|
|
|
{
|
|
|
|
|
|
return SCM_MAKINUM (0L + getgid ());
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SCM_PROC (s_geteuid, "geteuid", 0, 0, 0, scm_geteuid);
|
* __scm.h, alist.c, alist.h, append.c, append.h, appinit.c,
arbiters.c, arbiters.h, async.c, async.h, boolean.c, boolean.h,
chars.c, chars.h, continuations.c, continuations.h, debug.c,
debug.h, dynwind.c, dynwind.h, eq.c, eq.h, error.c, eval.c,
eval.h, extchrs.c, extchrs.h, fdsocket.c, fdsocket.h, filesys.c,
filesys.h, fports.c, fports.h, gc.c, gdb_interface.h, gdbint.c,
gdbint.h, genio.c, genio.h, gscm.c, gscm.h, gsubr.c, gsubr.h,
hash.c, hash.h, hashtab.c, hashtab.h, init.c, ioext.c, ioext.h,
kw.c, kw.h, libguile.h, mallocs.c, mallocs.h, markers.c,
markers.h, mbstrings.c, mbstrings.h, numbers.c, numbers.h,
objprop.c, objprop.h, options.c, options.h, pairs.c, pairs.h,
ports.c, ports.h, posix.c, posix.h, print.c, print.h, procprop.c,
procprop.h, procs.c, procs.h, ramap.c, ramap.h, read.c, read.h,
root.c, scmsigs.c, scmsigs.h, sequences.c, sequences.h, simpos.c,
simpos.h, smob.c, socket.c, socket.h, srcprop.c, srcprop.h,
stackchk.c, stackchk.h, stime.c, stime.h, strings.c, strings.h,
strop.c, strop.h, strorder.c, strorder.h, strports.c, strports.h,
struct.c, struct.h, symbols.c, symbols.h, tag.c, tag.h, unif.c,
unif.h, variable.c, variable.h, vectors.c, vectors.h, version.c,
version.h, vports.c, vports.h, weaks.c, weaks.h: Use SCM_P to
declare functions with prototypes. (Patch thanks to Marius
Vollmer.)
1996-10-14 01:33:50 +00:00
|
|
|
|
|
1996-07-25 22:56:11 +00:00
|
|
|
|
SCM
|
|
|
|
|
|
scm_geteuid ()
|
|
|
|
|
|
{
|
|
|
|
|
|
#ifdef HAVE_GETEUID
|
|
|
|
|
|
return SCM_MAKINUM (0L + geteuid ());
|
|
|
|
|
|
#else
|
|
|
|
|
|
return SCM_MAKINUM (0L + getuid ());
|
|
|
|
|
|
#endif
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SCM_PROC (s_getegid, "getegid", 0, 0, 0, scm_getegid);
|
* __scm.h, alist.c, alist.h, append.c, append.h, appinit.c,
arbiters.c, arbiters.h, async.c, async.h, boolean.c, boolean.h,
chars.c, chars.h, continuations.c, continuations.h, debug.c,
debug.h, dynwind.c, dynwind.h, eq.c, eq.h, error.c, eval.c,
eval.h, extchrs.c, extchrs.h, fdsocket.c, fdsocket.h, filesys.c,
filesys.h, fports.c, fports.h, gc.c, gdb_interface.h, gdbint.c,
gdbint.h, genio.c, genio.h, gscm.c, gscm.h, gsubr.c, gsubr.h,
hash.c, hash.h, hashtab.c, hashtab.h, init.c, ioext.c, ioext.h,
kw.c, kw.h, libguile.h, mallocs.c, mallocs.h, markers.c,
markers.h, mbstrings.c, mbstrings.h, numbers.c, numbers.h,
objprop.c, objprop.h, options.c, options.h, pairs.c, pairs.h,
ports.c, ports.h, posix.c, posix.h, print.c, print.h, procprop.c,
procprop.h, procs.c, procs.h, ramap.c, ramap.h, read.c, read.h,
root.c, scmsigs.c, scmsigs.h, sequences.c, sequences.h, simpos.c,
simpos.h, smob.c, socket.c, socket.h, srcprop.c, srcprop.h,
stackchk.c, stackchk.h, stime.c, stime.h, strings.c, strings.h,
strop.c, strop.h, strorder.c, strorder.h, strports.c, strports.h,
struct.c, struct.h, symbols.c, symbols.h, tag.c, tag.h, unif.c,
unif.h, variable.c, variable.h, vectors.c, vectors.h, version.c,
version.h, vports.c, vports.h, weaks.c, weaks.h: Use SCM_P to
declare functions with prototypes. (Patch thanks to Marius
Vollmer.)
1996-10-14 01:33:50 +00:00
|
|
|
|
|
1996-07-25 22:56:11 +00:00
|
|
|
|
SCM
|
|
|
|
|
|
scm_getegid ()
|
|
|
|
|
|
{
|
|
|
|
|
|
#ifdef HAVE_GETEUID
|
|
|
|
|
|
return SCM_MAKINUM (0L + getegid ());
|
|
|
|
|
|
#else
|
|
|
|
|
|
return SCM_MAKINUM (0L + getgid ());
|
|
|
|
|
|
#endif
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
1996-10-28 09:44:07 +00:00
|
|
|
|
SCM_PROC (s_setuid, "setuid", 1, 0, 0, scm_setuid);
|
* __scm.h, alist.c, alist.h, append.c, append.h, appinit.c,
arbiters.c, arbiters.h, async.c, async.h, boolean.c, boolean.h,
chars.c, chars.h, continuations.c, continuations.h, debug.c,
debug.h, dynwind.c, dynwind.h, eq.c, eq.h, error.c, eval.c,
eval.h, extchrs.c, extchrs.h, fdsocket.c, fdsocket.h, filesys.c,
filesys.h, fports.c, fports.h, gc.c, gdb_interface.h, gdbint.c,
gdbint.h, genio.c, genio.h, gscm.c, gscm.h, gsubr.c, gsubr.h,
hash.c, hash.h, hashtab.c, hashtab.h, init.c, ioext.c, ioext.h,
kw.c, kw.h, libguile.h, mallocs.c, mallocs.h, markers.c,
markers.h, mbstrings.c, mbstrings.h, numbers.c, numbers.h,
objprop.c, objprop.h, options.c, options.h, pairs.c, pairs.h,
ports.c, ports.h, posix.c, posix.h, print.c, print.h, procprop.c,
procprop.h, procs.c, procs.h, ramap.c, ramap.h, read.c, read.h,
root.c, scmsigs.c, scmsigs.h, sequences.c, sequences.h, simpos.c,
simpos.h, smob.c, socket.c, socket.h, srcprop.c, srcprop.h,
stackchk.c, stackchk.h, stime.c, stime.h, strings.c, strings.h,
strop.c, strop.h, strorder.c, strorder.h, strports.c, strports.h,
struct.c, struct.h, symbols.c, symbols.h, tag.c, tag.h, unif.c,
unif.h, variable.c, variable.h, vectors.c, vectors.h, version.c,
version.h, vports.c, vports.h, weaks.c, weaks.h: Use SCM_P to
declare functions with prototypes. (Patch thanks to Marius
Vollmer.)
1996-10-14 01:33:50 +00:00
|
|
|
|
|
1996-07-25 22:56:11 +00:00
|
|
|
|
SCM
|
1996-10-28 09:44:07 +00:00
|
|
|
|
scm_setuid (id)
|
1996-07-25 22:56:11 +00:00
|
|
|
|
SCM id;
|
|
|
|
|
|
{
|
1996-10-28 09:44:07 +00:00
|
|
|
|
SCM_ASSERT (SCM_INUMP (id), id, SCM_ARG1, s_setuid);
|
1996-08-02 23:26:33 +00:00
|
|
|
|
if (setuid (SCM_INUM (id)) != 0)
|
1996-10-28 09:44:07 +00:00
|
|
|
|
scm_syserror (s_setuid);
|
1996-08-02 23:26:33 +00:00
|
|
|
|
return SCM_UNSPECIFIED;
|
1996-07-25 22:56:11 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
1996-10-28 09:44:07 +00:00
|
|
|
|
SCM_PROC (s_setgid, "setgid", 1, 0, 0, scm_setgid);
|
* __scm.h, alist.c, alist.h, append.c, append.h, appinit.c,
arbiters.c, arbiters.h, async.c, async.h, boolean.c, boolean.h,
chars.c, chars.h, continuations.c, continuations.h, debug.c,
debug.h, dynwind.c, dynwind.h, eq.c, eq.h, error.c, eval.c,
eval.h, extchrs.c, extchrs.h, fdsocket.c, fdsocket.h, filesys.c,
filesys.h, fports.c, fports.h, gc.c, gdb_interface.h, gdbint.c,
gdbint.h, genio.c, genio.h, gscm.c, gscm.h, gsubr.c, gsubr.h,
hash.c, hash.h, hashtab.c, hashtab.h, init.c, ioext.c, ioext.h,
kw.c, kw.h, libguile.h, mallocs.c, mallocs.h, markers.c,
markers.h, mbstrings.c, mbstrings.h, numbers.c, numbers.h,
objprop.c, objprop.h, options.c, options.h, pairs.c, pairs.h,
ports.c, ports.h, posix.c, posix.h, print.c, print.h, procprop.c,
procprop.h, procs.c, procs.h, ramap.c, ramap.h, read.c, read.h,
root.c, scmsigs.c, scmsigs.h, sequences.c, sequences.h, simpos.c,
simpos.h, smob.c, socket.c, socket.h, srcprop.c, srcprop.h,
stackchk.c, stackchk.h, stime.c, stime.h, strings.c, strings.h,
strop.c, strop.h, strorder.c, strorder.h, strports.c, strports.h,
struct.c, struct.h, symbols.c, symbols.h, tag.c, tag.h, unif.c,
unif.h, variable.c, variable.h, vectors.c, vectors.h, version.c,
version.h, vports.c, vports.h, weaks.c, weaks.h: Use SCM_P to
declare functions with prototypes. (Patch thanks to Marius
Vollmer.)
1996-10-14 01:33:50 +00:00
|
|
|
|
|
1996-07-25 22:56:11 +00:00
|
|
|
|
SCM
|
1996-10-28 09:44:07 +00:00
|
|
|
|
scm_setgid (id)
|
1996-07-25 22:56:11 +00:00
|
|
|
|
SCM id;
|
|
|
|
|
|
{
|
1996-10-28 09:44:07 +00:00
|
|
|
|
SCM_ASSERT (SCM_INUMP (id), id, SCM_ARG1, s_setgid);
|
1996-08-02 23:26:33 +00:00
|
|
|
|
if (setgid (SCM_INUM (id)) != 0)
|
1996-10-28 09:44:07 +00:00
|
|
|
|
scm_syserror (s_setgid);
|
1996-08-02 23:26:33 +00:00
|
|
|
|
return SCM_UNSPECIFIED;
|
1996-07-25 22:56:11 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
1996-10-28 09:44:07 +00:00
|
|
|
|
SCM_PROC (s_seteuid, "seteuid", 1, 0, 0, scm_seteuid);
|
* __scm.h, alist.c, alist.h, append.c, append.h, appinit.c,
arbiters.c, arbiters.h, async.c, async.h, boolean.c, boolean.h,
chars.c, chars.h, continuations.c, continuations.h, debug.c,
debug.h, dynwind.c, dynwind.h, eq.c, eq.h, error.c, eval.c,
eval.h, extchrs.c, extchrs.h, fdsocket.c, fdsocket.h, filesys.c,
filesys.h, fports.c, fports.h, gc.c, gdb_interface.h, gdbint.c,
gdbint.h, genio.c, genio.h, gscm.c, gscm.h, gsubr.c, gsubr.h,
hash.c, hash.h, hashtab.c, hashtab.h, init.c, ioext.c, ioext.h,
kw.c, kw.h, libguile.h, mallocs.c, mallocs.h, markers.c,
markers.h, mbstrings.c, mbstrings.h, numbers.c, numbers.h,
objprop.c, objprop.h, options.c, options.h, pairs.c, pairs.h,
ports.c, ports.h, posix.c, posix.h, print.c, print.h, procprop.c,
procprop.h, procs.c, procs.h, ramap.c, ramap.h, read.c, read.h,
root.c, scmsigs.c, scmsigs.h, sequences.c, sequences.h, simpos.c,
simpos.h, smob.c, socket.c, socket.h, srcprop.c, srcprop.h,
stackchk.c, stackchk.h, stime.c, stime.h, strings.c, strings.h,
strop.c, strop.h, strorder.c, strorder.h, strports.c, strports.h,
struct.c, struct.h, symbols.c, symbols.h, tag.c, tag.h, unif.c,
unif.h, variable.c, variable.h, vectors.c, vectors.h, version.c,
version.h, vports.c, vports.h, weaks.c, weaks.h: Use SCM_P to
declare functions with prototypes. (Patch thanks to Marius
Vollmer.)
1996-10-14 01:33:50 +00:00
|
|
|
|
|
1996-07-25 22:56:11 +00:00
|
|
|
|
SCM
|
1996-10-28 09:44:07 +00:00
|
|
|
|
scm_seteuid (id)
|
1996-07-25 22:56:11 +00:00
|
|
|
|
SCM id;
|
|
|
|
|
|
{
|
1996-08-02 23:26:33 +00:00
|
|
|
|
int rv;
|
|
|
|
|
|
|
1996-10-28 09:44:07 +00:00
|
|
|
|
SCM_ASSERT (SCM_INUMP (id), id, SCM_ARG1, s_seteuid);
|
1996-07-25 22:56:11 +00:00
|
|
|
|
#ifdef HAVE_SETEUID
|
1996-08-02 23:26:33 +00:00
|
|
|
|
rv = seteuid (SCM_INUM (id));
|
1996-07-25 22:56:11 +00:00
|
|
|
|
#else
|
1996-08-02 23:26:33 +00:00
|
|
|
|
rv = setuid (SCM_INUM (id));
|
1996-07-25 22:56:11 +00:00
|
|
|
|
#endif
|
1996-08-02 23:26:33 +00:00
|
|
|
|
if (rv != 0)
|
1996-10-28 09:44:07 +00:00
|
|
|
|
scm_syserror (s_seteuid);
|
1996-08-02 23:26:33 +00:00
|
|
|
|
return SCM_UNSPECIFIED;
|
1996-07-25 22:56:11 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
1996-10-28 09:44:07 +00:00
|
|
|
|
SCM_PROC (s_setegid, "setegid", 1, 0, 0, scm_setegid);
|
* __scm.h, alist.c, alist.h, append.c, append.h, appinit.c,
arbiters.c, arbiters.h, async.c, async.h, boolean.c, boolean.h,
chars.c, chars.h, continuations.c, continuations.h, debug.c,
debug.h, dynwind.c, dynwind.h, eq.c, eq.h, error.c, eval.c,
eval.h, extchrs.c, extchrs.h, fdsocket.c, fdsocket.h, filesys.c,
filesys.h, fports.c, fports.h, gc.c, gdb_interface.h, gdbint.c,
gdbint.h, genio.c, genio.h, gscm.c, gscm.h, gsubr.c, gsubr.h,
hash.c, hash.h, hashtab.c, hashtab.h, init.c, ioext.c, ioext.h,
kw.c, kw.h, libguile.h, mallocs.c, mallocs.h, markers.c,
markers.h, mbstrings.c, mbstrings.h, numbers.c, numbers.h,
objprop.c, objprop.h, options.c, options.h, pairs.c, pairs.h,
ports.c, ports.h, posix.c, posix.h, print.c, print.h, procprop.c,
procprop.h, procs.c, procs.h, ramap.c, ramap.h, read.c, read.h,
root.c, scmsigs.c, scmsigs.h, sequences.c, sequences.h, simpos.c,
simpos.h, smob.c, socket.c, socket.h, srcprop.c, srcprop.h,
stackchk.c, stackchk.h, stime.c, stime.h, strings.c, strings.h,
strop.c, strop.h, strorder.c, strorder.h, strports.c, strports.h,
struct.c, struct.h, symbols.c, symbols.h, tag.c, tag.h, unif.c,
unif.h, variable.c, variable.h, vectors.c, vectors.h, version.c,
version.h, vports.c, vports.h, weaks.c, weaks.h: Use SCM_P to
declare functions with prototypes. (Patch thanks to Marius
Vollmer.)
1996-10-14 01:33:50 +00:00
|
|
|
|
|
1996-07-25 22:56:11 +00:00
|
|
|
|
SCM
|
1996-10-28 09:44:07 +00:00
|
|
|
|
scm_setegid (id)
|
1996-07-25 22:56:11 +00:00
|
|
|
|
SCM id;
|
|
|
|
|
|
{
|
1996-08-02 23:26:33 +00:00
|
|
|
|
int rv;
|
|
|
|
|
|
|
1996-10-28 09:44:07 +00:00
|
|
|
|
SCM_ASSERT (SCM_INUMP (id), id, SCM_ARG1, s_setegid);
|
1996-07-25 22:56:11 +00:00
|
|
|
|
#ifdef HAVE_SETEUID
|
1996-08-02 23:26:33 +00:00
|
|
|
|
rv = setegid (SCM_INUM (id));
|
1996-07-25 22:56:11 +00:00
|
|
|
|
#else
|
1996-08-02 23:26:33 +00:00
|
|
|
|
rv = setgid (SCM_INUM (id));
|
1996-07-25 22:56:11 +00:00
|
|
|
|
#endif
|
1996-08-02 23:26:33 +00:00
|
|
|
|
if (rv != 0)
|
1996-10-28 09:44:07 +00:00
|
|
|
|
scm_syserror (s_setegid);
|
1996-08-02 23:26:33 +00:00
|
|
|
|
return SCM_UNSPECIFIED;
|
|
|
|
|
|
|
1996-07-25 22:56:11 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
SCM_PROC (s_getpgrp, "getpgrp", 0, 0, 0, scm_getpgrp);
|
|
|
|
|
|
SCM
|
|
|
|
|
|
scm_getpgrp ()
|
|
|
|
|
|
{
|
|
|
|
|
|
int (*fn)();
|
1996-08-20 17:10:18 +00:00
|
|
|
|
fn = (int (*) ()) getpgrp;
|
1996-07-25 22:56:11 +00:00
|
|
|
|
return SCM_MAKINUM (fn (0));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
1996-10-28 09:44:07 +00:00
|
|
|
|
SCM_PROC (s_setpgid, "setpgid", 2, 0, 0, scm_setpgid);
|
1996-07-25 22:56:11 +00:00
|
|
|
|
SCM
|
|
|
|
|
|
scm_setpgid (pid, pgid)
|
|
|
|
|
|
SCM pid, pgid;
|
|
|
|
|
|
{
|
More functions unavailable on some systems.
* configure.in (AC_CHECK_FUNCS): Add ctermid, setpgid, setsid,
tcgetpgrp, tcsetpgrp, and waitpid to the list of functions to
check for.
* configure, scmconfig.h.in: Updated, using autoconf and autoheader.
* posix.c (scm_sys_ctermid, scm_sys_setpgid, scm_sys_setsid,
scm_sys_tcgetpgrp, scm_sys_tcsetpgrp, scm_sys_waitpid): Put the
bodies of these functions in "#ifdef HAVE_MUMBLE" clauses, with a
stub that signals an error as the #else.
1996-08-07 20:25:10 +00:00
|
|
|
|
#ifdef HAVE_SETPGID
|
1996-10-28 09:44:07 +00:00
|
|
|
|
SCM_ASSERT (SCM_INUMP (pid), pid, SCM_ARG1, s_setpgid);
|
|
|
|
|
|
SCM_ASSERT (SCM_INUMP (pgid), pgid, SCM_ARG2, s_setpgid);
|
1996-08-02 23:26:33 +00:00
|
|
|
|
/* FIXME(?): may be known as setpgrp. */
|
|
|
|
|
|
if (setpgid (SCM_INUM (pid), SCM_INUM (pgid)) != 0)
|
1996-10-28 09:44:07 +00:00
|
|
|
|
scm_syserror (s_setpgid);
|
1996-08-02 23:26:33 +00:00
|
|
|
|
return SCM_UNSPECIFIED;
|
More functions unavailable on some systems.
* configure.in (AC_CHECK_FUNCS): Add ctermid, setpgid, setsid,
tcgetpgrp, tcsetpgrp, and waitpid to the list of functions to
check for.
* configure, scmconfig.h.in: Updated, using autoconf and autoheader.
* posix.c (scm_sys_ctermid, scm_sys_setpgid, scm_sys_setsid,
scm_sys_tcgetpgrp, scm_sys_tcsetpgrp, scm_sys_waitpid): Put the
bodies of these functions in "#ifdef HAVE_MUMBLE" clauses, with a
stub that signals an error as the #else.
1996-08-07 20:25:10 +00:00
|
|
|
|
#else
|
1996-10-28 09:44:07 +00:00
|
|
|
|
scm_sysmissing (s_setpgid);
|
More functions unavailable on some systems.
* configure.in (AC_CHECK_FUNCS): Add ctermid, setpgid, setsid,
tcgetpgrp, tcsetpgrp, and waitpid to the list of functions to
check for.
* configure, scmconfig.h.in: Updated, using autoconf and autoheader.
* posix.c (scm_sys_ctermid, scm_sys_setpgid, scm_sys_setsid,
scm_sys_tcgetpgrp, scm_sys_tcsetpgrp, scm_sys_waitpid): Put the
bodies of these functions in "#ifdef HAVE_MUMBLE" clauses, with a
stub that signals an error as the #else.
1996-08-07 20:25:10 +00:00
|
|
|
|
/* not reached. */
|
|
|
|
|
|
return SCM_BOOL_F;
|
|
|
|
|
|
#endif
|
1996-07-25 22:56:11 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
1996-10-28 09:44:07 +00:00
|
|
|
|
SCM_PROC (s_setsid, "setsid", 0, 0, 0, scm_setsid);
|
1996-07-25 22:56:11 +00:00
|
|
|
|
SCM
|
|
|
|
|
|
scm_setsid ()
|
|
|
|
|
|
{
|
More functions unavailable on some systems.
* configure.in (AC_CHECK_FUNCS): Add ctermid, setpgid, setsid,
tcgetpgrp, tcsetpgrp, and waitpid to the list of functions to
check for.
* configure, scmconfig.h.in: Updated, using autoconf and autoheader.
* posix.c (scm_sys_ctermid, scm_sys_setpgid, scm_sys_setsid,
scm_sys_tcgetpgrp, scm_sys_tcsetpgrp, scm_sys_waitpid): Put the
bodies of these functions in "#ifdef HAVE_MUMBLE" clauses, with a
stub that signals an error as the #else.
1996-08-07 20:25:10 +00:00
|
|
|
|
#ifdef HAVE_SETSID
|
1996-07-25 22:56:11 +00:00
|
|
|
|
pid_t sid = setsid ();
|
1996-08-02 23:26:33 +00:00
|
|
|
|
if (sid == -1)
|
1996-10-28 09:44:07 +00:00
|
|
|
|
scm_syserror (s_setsid);
|
1996-08-02 23:26:33 +00:00
|
|
|
|
return SCM_UNSPECIFIED;
|
More functions unavailable on some systems.
* configure.in (AC_CHECK_FUNCS): Add ctermid, setpgid, setsid,
tcgetpgrp, tcsetpgrp, and waitpid to the list of functions to
check for.
* configure, scmconfig.h.in: Updated, using autoconf and autoheader.
* posix.c (scm_sys_ctermid, scm_sys_setpgid, scm_sys_setsid,
scm_sys_tcgetpgrp, scm_sys_tcsetpgrp, scm_sys_waitpid): Put the
bodies of these functions in "#ifdef HAVE_MUMBLE" clauses, with a
stub that signals an error as the #else.
1996-08-07 20:25:10 +00:00
|
|
|
|
#else
|
1996-10-28 09:44:07 +00:00
|
|
|
|
scm_sysmissing (s_setsid);
|
More functions unavailable on some systems.
* configure.in (AC_CHECK_FUNCS): Add ctermid, setpgid, setsid,
tcgetpgrp, tcsetpgrp, and waitpid to the list of functions to
check for.
* configure, scmconfig.h.in: Updated, using autoconf and autoheader.
* posix.c (scm_sys_ctermid, scm_sys_setpgid, scm_sys_setsid,
scm_sys_tcgetpgrp, scm_sys_tcsetpgrp, scm_sys_waitpid): Put the
bodies of these functions in "#ifdef HAVE_MUMBLE" clauses, with a
stub that signals an error as the #else.
1996-08-07 20:25:10 +00:00
|
|
|
|
/* not reached. */
|
|
|
|
|
|
return SCM_BOOL_F;
|
|
|
|
|
|
#endif
|
1996-07-25 22:56:11 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
1996-08-02 23:26:33 +00:00
|
|
|
|
SCM_PROC (s_ttyname, "ttyname", 1, 0, 0, scm_ttyname);
|
* __scm.h, alist.c, alist.h, append.c, append.h, appinit.c,
arbiters.c, arbiters.h, async.c, async.h, boolean.c, boolean.h,
chars.c, chars.h, continuations.c, continuations.h, debug.c,
debug.h, dynwind.c, dynwind.h, eq.c, eq.h, error.c, eval.c,
eval.h, extchrs.c, extchrs.h, fdsocket.c, fdsocket.h, filesys.c,
filesys.h, fports.c, fports.h, gc.c, gdb_interface.h, gdbint.c,
gdbint.h, genio.c, genio.h, gscm.c, gscm.h, gsubr.c, gsubr.h,
hash.c, hash.h, hashtab.c, hashtab.h, init.c, ioext.c, ioext.h,
kw.c, kw.h, libguile.h, mallocs.c, mallocs.h, markers.c,
markers.h, mbstrings.c, mbstrings.h, numbers.c, numbers.h,
objprop.c, objprop.h, options.c, options.h, pairs.c, pairs.h,
ports.c, ports.h, posix.c, posix.h, print.c, print.h, procprop.c,
procprop.h, procs.c, procs.h, ramap.c, ramap.h, read.c, read.h,
root.c, scmsigs.c, scmsigs.h, sequences.c, sequences.h, simpos.c,
simpos.h, smob.c, socket.c, socket.h, srcprop.c, srcprop.h,
stackchk.c, stackchk.h, stime.c, stime.h, strings.c, strings.h,
strop.c, strop.h, strorder.c, strorder.h, strports.c, strports.h,
struct.c, struct.h, symbols.c, symbols.h, tag.c, tag.h, unif.c,
unif.h, variable.c, variable.h, vectors.c, vectors.h, version.c,
version.h, vports.c, vports.h, weaks.c, weaks.h: Use SCM_P to
declare functions with prototypes. (Patch thanks to Marius
Vollmer.)
1996-10-14 01:33:50 +00:00
|
|
|
|
|
1996-07-25 22:56:11 +00:00
|
|
|
|
SCM
|
|
|
|
|
|
scm_ttyname (port)
|
|
|
|
|
|
SCM port;
|
|
|
|
|
|
{
|
|
|
|
|
|
char *ans;
|
|
|
|
|
|
int fd;
|
|
|
|
|
|
SCM_ASSERT (SCM_NIMP (port) && SCM_OPPORTP (port), port, SCM_ARG1, s_ttyname);
|
|
|
|
|
|
if (scm_tc16_fport != SCM_TYP16 (port))
|
|
|
|
|
|
return SCM_BOOL_F;
|
|
|
|
|
|
fd = fileno ((FILE *)SCM_STREAM (port));
|
1996-08-02 23:26:33 +00:00
|
|
|
|
if (fd == -1)
|
* debug.c, unif.c: use scm_out_of_range instead of
wta for range errors (ASSERT still needs work).
* error.c, error.h (scm_out_of_range): new procedure.
* error.c, error.h (scm_out_of_range_key): new key.
* posix.c (scm_sync): #else was missing.
* error.c, error.h: append _key to names scm_num_overflow and
scm_system_error.
* __scm.h (SCM_SYSMISSING, SCM_NUM_OVERFLOW): use SCM_BOOL_F instead
of consing an empty list.
(SCM_SYSERROR etc.): move into error.c, make them procedures instead
of macros, saves code and string space.
error.c, fports.c, numbers.c, posix.c, ioext.c, filesys.c, socket.c,
fdsocket.c, simpos.c: change names of SCM_SYSERROR etc., to
lower case. Rename scm_syserror_m to scm_syserror_msg.
error.h: prototypes for new procedures.
1996-09-15 06:41:31 +00:00
|
|
|
|
scm_syserror (s_ttyname);
|
1996-08-02 23:26:33 +00:00
|
|
|
|
SCM_SYSCALL (ans = ttyname (fd));
|
|
|
|
|
|
if (!ans)
|
* debug.c, unif.c: use scm_out_of_range instead of
wta for range errors (ASSERT still needs work).
* error.c, error.h (scm_out_of_range): new procedure.
* error.c, error.h (scm_out_of_range_key): new key.
* posix.c (scm_sync): #else was missing.
* error.c, error.h: append _key to names scm_num_overflow and
scm_system_error.
* __scm.h (SCM_SYSMISSING, SCM_NUM_OVERFLOW): use SCM_BOOL_F instead
of consing an empty list.
(SCM_SYSERROR etc.): move into error.c, make them procedures instead
of macros, saves code and string space.
error.c, fports.c, numbers.c, posix.c, ioext.c, filesys.c, socket.c,
fdsocket.c, simpos.c: change names of SCM_SYSERROR etc., to
lower case. Rename scm_syserror_m to scm_syserror_msg.
error.h: prototypes for new procedures.
1996-09-15 06:41:31 +00:00
|
|
|
|
scm_syserror (s_ttyname);
|
1996-07-25 22:56:11 +00:00
|
|
|
|
/* ans could be overwritten by another call to ttyname */
|
1996-08-02 23:26:33 +00:00
|
|
|
|
return (scm_makfrom0str (ans));
|
1996-07-25 22:56:11 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
1996-10-28 09:44:07 +00:00
|
|
|
|
SCM_PROC (s_ctermid, "ctermid", 0, 0, 0, scm_ctermid);
|
1996-07-25 22:56:11 +00:00
|
|
|
|
SCM
|
|
|
|
|
|
scm_ctermid ()
|
|
|
|
|
|
{
|
More functions unavailable on some systems.
* configure.in (AC_CHECK_FUNCS): Add ctermid, setpgid, setsid,
tcgetpgrp, tcsetpgrp, and waitpid to the list of functions to
check for.
* configure, scmconfig.h.in: Updated, using autoconf and autoheader.
* posix.c (scm_sys_ctermid, scm_sys_setpgid, scm_sys_setsid,
scm_sys_tcgetpgrp, scm_sys_tcsetpgrp, scm_sys_waitpid): Put the
bodies of these functions in "#ifdef HAVE_MUMBLE" clauses, with a
stub that signals an error as the #else.
1996-08-07 20:25:10 +00:00
|
|
|
|
#ifdef HAVE_CTERMID
|
1996-07-25 22:56:11 +00:00
|
|
|
|
char *result = ctermid (NULL);
|
1996-08-02 23:26:33 +00:00
|
|
|
|
if (*result == '\0')
|
1996-10-28 09:44:07 +00:00
|
|
|
|
scm_syserror (s_ctermid);
|
1996-08-02 23:26:33 +00:00
|
|
|
|
return scm_makfrom0str (result);
|
More functions unavailable on some systems.
* configure.in (AC_CHECK_FUNCS): Add ctermid, setpgid, setsid,
tcgetpgrp, tcsetpgrp, and waitpid to the list of functions to
check for.
* configure, scmconfig.h.in: Updated, using autoconf and autoheader.
* posix.c (scm_sys_ctermid, scm_sys_setpgid, scm_sys_setsid,
scm_sys_tcgetpgrp, scm_sys_tcsetpgrp, scm_sys_waitpid): Put the
bodies of these functions in "#ifdef HAVE_MUMBLE" clauses, with a
stub that signals an error as the #else.
1996-08-07 20:25:10 +00:00
|
|
|
|
#else
|
1996-10-28 09:44:07 +00:00
|
|
|
|
scm_sysmissing (s_ctermid);
|
More functions unavailable on some systems.
* configure.in (AC_CHECK_FUNCS): Add ctermid, setpgid, setsid,
tcgetpgrp, tcsetpgrp, and waitpid to the list of functions to
check for.
* configure, scmconfig.h.in: Updated, using autoconf and autoheader.
* posix.c (scm_sys_ctermid, scm_sys_setpgid, scm_sys_setsid,
scm_sys_tcgetpgrp, scm_sys_tcsetpgrp, scm_sys_waitpid): Put the
bodies of these functions in "#ifdef HAVE_MUMBLE" clauses, with a
stub that signals an error as the #else.
1996-08-07 20:25:10 +00:00
|
|
|
|
/* not reached. */
|
|
|
|
|
|
return SCM_BOOL_F;
|
|
|
|
|
|
#endif
|
1996-07-25 22:56:11 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
1996-10-28 09:44:07 +00:00
|
|
|
|
SCM_PROC (s_tcgetpgrp, "tcgetpgrp", 1, 0, 0, scm_tcgetpgrp);
|
1996-07-25 22:56:11 +00:00
|
|
|
|
SCM
|
|
|
|
|
|
scm_tcgetpgrp (port)
|
|
|
|
|
|
SCM port;
|
|
|
|
|
|
{
|
More functions unavailable on some systems.
* configure.in (AC_CHECK_FUNCS): Add ctermid, setpgid, setsid,
tcgetpgrp, tcsetpgrp, and waitpid to the list of functions to
check for.
* configure, scmconfig.h.in: Updated, using autoconf and autoheader.
* posix.c (scm_sys_ctermid, scm_sys_setpgid, scm_sys_setsid,
scm_sys_tcgetpgrp, scm_sys_tcsetpgrp, scm_sys_waitpid): Put the
bodies of these functions in "#ifdef HAVE_MUMBLE" clauses, with a
stub that signals an error as the #else.
1996-08-07 20:25:10 +00:00
|
|
|
|
#ifdef HAVE_TCGETPGRP
|
1996-07-25 22:56:11 +00:00
|
|
|
|
int fd;
|
|
|
|
|
|
pid_t pgid;
|
1996-10-28 09:44:07 +00:00
|
|
|
|
SCM_ASSERT (SCM_NIMP (port) && SCM_OPFPORTP (port), port, SCM_ARG1, s_tcgetpgrp);
|
1996-07-25 22:56:11 +00:00
|
|
|
|
fd = fileno ((FILE *)SCM_STREAM (port));
|
|
|
|
|
|
if (fd == -1 || (pgid = tcgetpgrp (fd)) == -1)
|
1996-10-28 09:44:07 +00:00
|
|
|
|
scm_syserror (s_tcgetpgrp);
|
1996-08-02 23:26:33 +00:00
|
|
|
|
return SCM_MAKINUM (pgid);
|
More functions unavailable on some systems.
* configure.in (AC_CHECK_FUNCS): Add ctermid, setpgid, setsid,
tcgetpgrp, tcsetpgrp, and waitpid to the list of functions to
check for.
* configure, scmconfig.h.in: Updated, using autoconf and autoheader.
* posix.c (scm_sys_ctermid, scm_sys_setpgid, scm_sys_setsid,
scm_sys_tcgetpgrp, scm_sys_tcsetpgrp, scm_sys_waitpid): Put the
bodies of these functions in "#ifdef HAVE_MUMBLE" clauses, with a
stub that signals an error as the #else.
1996-08-07 20:25:10 +00:00
|
|
|
|
#else
|
1996-10-28 09:44:07 +00:00
|
|
|
|
scm_sysmissing (s_tcgetpgrp);
|
More functions unavailable on some systems.
* configure.in (AC_CHECK_FUNCS): Add ctermid, setpgid, setsid,
tcgetpgrp, tcsetpgrp, and waitpid to the list of functions to
check for.
* configure, scmconfig.h.in: Updated, using autoconf and autoheader.
* posix.c (scm_sys_ctermid, scm_sys_setpgid, scm_sys_setsid,
scm_sys_tcgetpgrp, scm_sys_tcsetpgrp, scm_sys_waitpid): Put the
bodies of these functions in "#ifdef HAVE_MUMBLE" clauses, with a
stub that signals an error as the #else.
1996-08-07 20:25:10 +00:00
|
|
|
|
/* not reached. */
|
|
|
|
|
|
return SCM_BOOL_F;
|
|
|
|
|
|
#endif
|
1996-07-25 22:56:11 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
1996-10-28 09:44:07 +00:00
|
|
|
|
SCM_PROC (s_tcsetpgrp, "tcsetpgrp", 2, 0, 0, scm_tcsetpgrp);
|
1996-07-25 22:56:11 +00:00
|
|
|
|
SCM
|
|
|
|
|
|
scm_tcsetpgrp (port, pgid)
|
|
|
|
|
|
SCM port, pgid;
|
|
|
|
|
|
{
|
More functions unavailable on some systems.
* configure.in (AC_CHECK_FUNCS): Add ctermid, setpgid, setsid,
tcgetpgrp, tcsetpgrp, and waitpid to the list of functions to
check for.
* configure, scmconfig.h.in: Updated, using autoconf and autoheader.
* posix.c (scm_sys_ctermid, scm_sys_setpgid, scm_sys_setsid,
scm_sys_tcgetpgrp, scm_sys_tcsetpgrp, scm_sys_waitpid): Put the
bodies of these functions in "#ifdef HAVE_MUMBLE" clauses, with a
stub that signals an error as the #else.
1996-08-07 20:25:10 +00:00
|
|
|
|
#ifdef HAVE_TCSETPGRP
|
1996-07-25 22:56:11 +00:00
|
|
|
|
int fd;
|
1996-10-28 09:44:07 +00:00
|
|
|
|
SCM_ASSERT (SCM_NIMP (port) && SCM_OPFPORTP (port), port, SCM_ARG1, s_tcsetpgrp);
|
|
|
|
|
|
SCM_ASSERT (SCM_INUMP (pgid), pgid, SCM_ARG2, s_tcsetpgrp);
|
1996-07-25 22:56:11 +00:00
|
|
|
|
fd = fileno ((FILE *)SCM_STREAM (port));
|
|
|
|
|
|
if (fd == -1 || tcsetpgrp (fd, SCM_INUM (pgid)) == -1)
|
1996-10-28 09:44:07 +00:00
|
|
|
|
scm_syserror (s_tcsetpgrp);
|
1996-08-02 23:26:33 +00:00
|
|
|
|
return SCM_UNSPECIFIED;
|
More functions unavailable on some systems.
* configure.in (AC_CHECK_FUNCS): Add ctermid, setpgid, setsid,
tcgetpgrp, tcsetpgrp, and waitpid to the list of functions to
check for.
* configure, scmconfig.h.in: Updated, using autoconf and autoheader.
* posix.c (scm_sys_ctermid, scm_sys_setpgid, scm_sys_setsid,
scm_sys_tcgetpgrp, scm_sys_tcsetpgrp, scm_sys_waitpid): Put the
bodies of these functions in "#ifdef HAVE_MUMBLE" clauses, with a
stub that signals an error as the #else.
1996-08-07 20:25:10 +00:00
|
|
|
|
#else
|
1996-10-28 09:44:07 +00:00
|
|
|
|
scm_sysmissing (s_tcsetpgrp);
|
More functions unavailable on some systems.
* configure.in (AC_CHECK_FUNCS): Add ctermid, setpgid, setsid,
tcgetpgrp, tcsetpgrp, and waitpid to the list of functions to
check for.
* configure, scmconfig.h.in: Updated, using autoconf and autoheader.
* posix.c (scm_sys_ctermid, scm_sys_setpgid, scm_sys_setsid,
scm_sys_tcgetpgrp, scm_sys_tcsetpgrp, scm_sys_waitpid): Put the
bodies of these functions in "#ifdef HAVE_MUMBLE" clauses, with a
stub that signals an error as the #else.
1996-08-07 20:25:10 +00:00
|
|
|
|
/* not reached. */
|
|
|
|
|
|
return SCM_BOOL_F;
|
|
|
|
|
|
#endif
|
1996-07-25 22:56:11 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* Copy exec args from an SCM vector into a new C array. */
|
* __scm.h, alist.c, alist.h, append.c, append.h, appinit.c,
arbiters.c, arbiters.h, async.c, async.h, boolean.c, boolean.h,
chars.c, chars.h, continuations.c, continuations.h, debug.c,
debug.h, dynwind.c, dynwind.h, eq.c, eq.h, error.c, eval.c,
eval.h, extchrs.c, extchrs.h, fdsocket.c, fdsocket.h, filesys.c,
filesys.h, fports.c, fports.h, gc.c, gdb_interface.h, gdbint.c,
gdbint.h, genio.c, genio.h, gscm.c, gscm.h, gsubr.c, gsubr.h,
hash.c, hash.h, hashtab.c, hashtab.h, init.c, ioext.c, ioext.h,
kw.c, kw.h, libguile.h, mallocs.c, mallocs.h, markers.c,
markers.h, mbstrings.c, mbstrings.h, numbers.c, numbers.h,
objprop.c, objprop.h, options.c, options.h, pairs.c, pairs.h,
ports.c, ports.h, posix.c, posix.h, print.c, print.h, procprop.c,
procprop.h, procs.c, procs.h, ramap.c, ramap.h, read.c, read.h,
root.c, scmsigs.c, scmsigs.h, sequences.c, sequences.h, simpos.c,
simpos.h, smob.c, socket.c, socket.h, srcprop.c, srcprop.h,
stackchk.c, stackchk.h, stime.c, stime.h, strings.c, strings.h,
strop.c, strop.h, strorder.c, strorder.h, strports.c, strports.h,
struct.c, struct.h, symbols.c, symbols.h, tag.c, tag.h, unif.c,
unif.h, variable.c, variable.h, vectors.c, vectors.h, version.c,
version.h, vports.c, vports.h, weaks.c, weaks.h: Use SCM_P to
declare functions with prototypes. (Patch thanks to Marius
Vollmer.)
1996-10-14 01:33:50 +00:00
|
|
|
|
|
|
|
|
|
|
static char ** scm_convert_exec_args SCM_P ((SCM args));
|
|
|
|
|
|
|
1996-07-25 22:56:11 +00:00
|
|
|
|
static char **
|
|
|
|
|
|
scm_convert_exec_args (args)
|
|
|
|
|
|
SCM args;
|
|
|
|
|
|
{
|
|
|
|
|
|
char **execargv;
|
|
|
|
|
|
int num_args;
|
|
|
|
|
|
int i;
|
|
|
|
|
|
SCM_DEFER_INTS;
|
|
|
|
|
|
num_args = scm_ilength (args);
|
|
|
|
|
|
execargv = (char **)
|
|
|
|
|
|
scm_must_malloc ((num_args + 1) * sizeof (char *), s_ttyname);
|
|
|
|
|
|
for (i = 0; SCM_NNULLP (args); args = SCM_CDR (args), ++i)
|
|
|
|
|
|
{
|
|
|
|
|
|
scm_sizet len;
|
|
|
|
|
|
char *dst;
|
|
|
|
|
|
char *src;
|
1997-03-13 21:54:02 +00:00
|
|
|
|
SCM_ASSERT (SCM_NIMP (SCM_CAR (args)) && SCM_ROSTRINGP (SCM_CAR (args)),
|
|
|
|
|
|
SCM_CAR (args), "wrong type in SCM_ARG", "exec arg");
|
1996-07-25 22:56:11 +00:00
|
|
|
|
len = 1 + SCM_ROLENGTH (SCM_CAR (args));
|
|
|
|
|
|
dst = (char *) scm_must_malloc ((long) len, s_ttyname);
|
|
|
|
|
|
src = SCM_ROCHARS (SCM_CAR (args));
|
|
|
|
|
|
while (len--)
|
|
|
|
|
|
dst[len] = src[len];
|
|
|
|
|
|
execargv[i] = dst;
|
|
|
|
|
|
}
|
|
|
|
|
|
execargv[i] = 0;
|
|
|
|
|
|
SCM_ALLOW_INTS;
|
|
|
|
|
|
return execargv;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
1996-10-28 09:44:07 +00:00
|
|
|
|
SCM_PROC (s_execl, "execl", 0, 0, 1, scm_execl);
|
* __scm.h, alist.c, alist.h, append.c, append.h, appinit.c,
arbiters.c, arbiters.h, async.c, async.h, boolean.c, boolean.h,
chars.c, chars.h, continuations.c, continuations.h, debug.c,
debug.h, dynwind.c, dynwind.h, eq.c, eq.h, error.c, eval.c,
eval.h, extchrs.c, extchrs.h, fdsocket.c, fdsocket.h, filesys.c,
filesys.h, fports.c, fports.h, gc.c, gdb_interface.h, gdbint.c,
gdbint.h, genio.c, genio.h, gscm.c, gscm.h, gsubr.c, gsubr.h,
hash.c, hash.h, hashtab.c, hashtab.h, init.c, ioext.c, ioext.h,
kw.c, kw.h, libguile.h, mallocs.c, mallocs.h, markers.c,
markers.h, mbstrings.c, mbstrings.h, numbers.c, numbers.h,
objprop.c, objprop.h, options.c, options.h, pairs.c, pairs.h,
ports.c, ports.h, posix.c, posix.h, print.c, print.h, procprop.c,
procprop.h, procs.c, procs.h, ramap.c, ramap.h, read.c, read.h,
root.c, scmsigs.c, scmsigs.h, sequences.c, sequences.h, simpos.c,
simpos.h, smob.c, socket.c, socket.h, srcprop.c, srcprop.h,
stackchk.c, stackchk.h, stime.c, stime.h, strings.c, strings.h,
strop.c, strop.h, strorder.c, strorder.h, strports.c, strports.h,
struct.c, struct.h, symbols.c, symbols.h, tag.c, tag.h, unif.c,
unif.h, variable.c, variable.h, vectors.c, vectors.h, version.c,
version.h, vports.c, vports.h, weaks.c, weaks.h: Use SCM_P to
declare functions with prototypes. (Patch thanks to Marius
Vollmer.)
1996-10-14 01:33:50 +00:00
|
|
|
|
|
1996-07-25 22:56:11 +00:00
|
|
|
|
SCM
|
1996-10-28 09:44:07 +00:00
|
|
|
|
scm_execl (args)
|
1996-07-25 22:56:11 +00:00
|
|
|
|
SCM args;
|
|
|
|
|
|
{
|
|
|
|
|
|
char **execargv;
|
|
|
|
|
|
SCM filename = SCM_CAR (args);
|
1996-10-28 09:44:07 +00:00
|
|
|
|
SCM_ASSERT (SCM_NIMP (filename) && SCM_ROSTRINGP (filename), filename, SCM_ARG1, s_execl);
|
1996-07-25 22:56:11 +00:00
|
|
|
|
if (SCM_SUBSTRP (filename))
|
|
|
|
|
|
filename = scm_makfromstr (SCM_ROCHARS (filename), SCM_ROLENGTH (filename), 0);
|
|
|
|
|
|
args = SCM_CDR (args);
|
|
|
|
|
|
execargv = scm_convert_exec_args (args);
|
|
|
|
|
|
execv (SCM_ROCHARS (filename), execargv);
|
1996-10-28 09:44:07 +00:00
|
|
|
|
scm_syserror (s_execl);
|
1996-08-02 23:26:33 +00:00
|
|
|
|
/* not reached. */
|
|
|
|
|
|
return SCM_BOOL_F;
|
1996-07-25 22:56:11 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
1996-10-28 09:44:07 +00:00
|
|
|
|
SCM_PROC (s_execlp, "execlp", 0, 0, 1, scm_execlp);
|
* __scm.h, alist.c, alist.h, append.c, append.h, appinit.c,
arbiters.c, arbiters.h, async.c, async.h, boolean.c, boolean.h,
chars.c, chars.h, continuations.c, continuations.h, debug.c,
debug.h, dynwind.c, dynwind.h, eq.c, eq.h, error.c, eval.c,
eval.h, extchrs.c, extchrs.h, fdsocket.c, fdsocket.h, filesys.c,
filesys.h, fports.c, fports.h, gc.c, gdb_interface.h, gdbint.c,
gdbint.h, genio.c, genio.h, gscm.c, gscm.h, gsubr.c, gsubr.h,
hash.c, hash.h, hashtab.c, hashtab.h, init.c, ioext.c, ioext.h,
kw.c, kw.h, libguile.h, mallocs.c, mallocs.h, markers.c,
markers.h, mbstrings.c, mbstrings.h, numbers.c, numbers.h,
objprop.c, objprop.h, options.c, options.h, pairs.c, pairs.h,
ports.c, ports.h, posix.c, posix.h, print.c, print.h, procprop.c,
procprop.h, procs.c, procs.h, ramap.c, ramap.h, read.c, read.h,
root.c, scmsigs.c, scmsigs.h, sequences.c, sequences.h, simpos.c,
simpos.h, smob.c, socket.c, socket.h, srcprop.c, srcprop.h,
stackchk.c, stackchk.h, stime.c, stime.h, strings.c, strings.h,
strop.c, strop.h, strorder.c, strorder.h, strports.c, strports.h,
struct.c, struct.h, symbols.c, symbols.h, tag.c, tag.h, unif.c,
unif.h, variable.c, variable.h, vectors.c, vectors.h, version.c,
version.h, vports.c, vports.h, weaks.c, weaks.h: Use SCM_P to
declare functions with prototypes. (Patch thanks to Marius
Vollmer.)
1996-10-14 01:33:50 +00:00
|
|
|
|
|
1996-07-25 22:56:11 +00:00
|
|
|
|
SCM
|
1996-10-28 09:44:07 +00:00
|
|
|
|
scm_execlp (args)
|
1996-07-25 22:56:11 +00:00
|
|
|
|
SCM args;
|
|
|
|
|
|
{
|
|
|
|
|
|
char **execargv;
|
|
|
|
|
|
SCM filename = SCM_CAR (args);
|
1997-03-13 21:54:02 +00:00
|
|
|
|
SCM_ASSERT (SCM_NIMP (filename) && SCM_ROSTRINGP (filename), filename,
|
|
|
|
|
|
SCM_ARG1, s_execlp);
|
1996-07-25 22:56:11 +00:00
|
|
|
|
if (SCM_SUBSTRP (filename))
|
1997-03-13 21:54:02 +00:00
|
|
|
|
filename = scm_makfromstr (SCM_ROCHARS (filename),
|
|
|
|
|
|
SCM_ROLENGTH (filename), 0);
|
1996-07-25 22:56:11 +00:00
|
|
|
|
args = SCM_CDR (args);
|
|
|
|
|
|
execargv = scm_convert_exec_args (args);
|
|
|
|
|
|
execvp (SCM_ROCHARS (filename), execargv);
|
1996-10-28 09:44:07 +00:00
|
|
|
|
scm_syserror (s_execlp);
|
1996-08-02 23:26:33 +00:00
|
|
|
|
/* not reached. */
|
|
|
|
|
|
return SCM_BOOL_F;
|
1996-07-25 22:56:11 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
1997-01-31 04:36:24 +00:00
|
|
|
|
SCM_PROC (s_fork, "primitive-fork", 0, 0, 0, scm_fork);
|
* __scm.h, alist.c, alist.h, append.c, append.h, appinit.c,
arbiters.c, arbiters.h, async.c, async.h, boolean.c, boolean.h,
chars.c, chars.h, continuations.c, continuations.h, debug.c,
debug.h, dynwind.c, dynwind.h, eq.c, eq.h, error.c, eval.c,
eval.h, extchrs.c, extchrs.h, fdsocket.c, fdsocket.h, filesys.c,
filesys.h, fports.c, fports.h, gc.c, gdb_interface.h, gdbint.c,
gdbint.h, genio.c, genio.h, gscm.c, gscm.h, gsubr.c, gsubr.h,
hash.c, hash.h, hashtab.c, hashtab.h, init.c, ioext.c, ioext.h,
kw.c, kw.h, libguile.h, mallocs.c, mallocs.h, markers.c,
markers.h, mbstrings.c, mbstrings.h, numbers.c, numbers.h,
objprop.c, objprop.h, options.c, options.h, pairs.c, pairs.h,
ports.c, ports.h, posix.c, posix.h, print.c, print.h, procprop.c,
procprop.h, procs.c, procs.h, ramap.c, ramap.h, read.c, read.h,
root.c, scmsigs.c, scmsigs.h, sequences.c, sequences.h, simpos.c,
simpos.h, smob.c, socket.c, socket.h, srcprop.c, srcprop.h,
stackchk.c, stackchk.h, stime.c, stime.h, strings.c, strings.h,
strop.c, strop.h, strorder.c, strorder.h, strports.c, strports.h,
struct.c, struct.h, symbols.c, symbols.h, tag.c, tag.h, unif.c,
unif.h, variable.c, variable.h, vectors.c, vectors.h, version.c,
version.h, vports.c, vports.h, weaks.c, weaks.h: Use SCM_P to
declare functions with prototypes. (Patch thanks to Marius
Vollmer.)
1996-10-14 01:33:50 +00:00
|
|
|
|
|
1996-07-25 22:56:11 +00:00
|
|
|
|
SCM
|
1996-10-28 09:44:07 +00:00
|
|
|
|
scm_fork()
|
1996-07-25 22:56:11 +00:00
|
|
|
|
{
|
On NextStep, <utime.h> doesn't define struct utime, unless we
#define _POSIX_SOURCE before #including it.
* aclocal.m4 (GUILE_STRUCT_UTIMBUF): New test.
* acconfig.h: New comment text for above CPP symbol.
* configure.in: Call it.
* posix.c: #define _POSIX_SOURCE if it seems necessary.
* configure.in (AC_CHECK_HEADERS): Include sys/utime.h and utime.h
in the list.
* posix.c: Check HAVE_SYS_UTIME_H and HAVE_UTIME_H, instead of
testing for __EMX__.
* posix.c: #include <libc.h>, if it exists.
* posix.c: Cast the return result to GETGROUPS_T, not gid_t; we
don't even know if the latter exists.
* posix.c (s_sys_setpgid, s_sys_setsid, s_sys_ctermid,
s_sys_tcgetpgrp, s_sys_tcsetpgrp): Renamed from s_setpgid,
s_setsid, s_ctermid, s_tcgetpgrp, s_tcsetpgrp, for consistency.
* posix.c (R_OK, W_OK, X_OK, F_OK): #define these if the system's
header files don't.
(scm_init_posix): Use them when initializing the Scheme constants
of the same name.
1996-09-03 04:43:15 +00:00
|
|
|
|
int pid;
|
1996-07-25 22:56:11 +00:00
|
|
|
|
pid = fork ();
|
|
|
|
|
|
if (pid == -1)
|
1996-10-28 09:44:07 +00:00
|
|
|
|
scm_syserror (s_fork);
|
1996-08-02 23:26:33 +00:00
|
|
|
|
return SCM_MAKINUM (0L+pid);
|
1996-07-25 22:56:11 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
1996-10-28 09:44:07 +00:00
|
|
|
|
SCM_PROC (s_uname, "uname", 0, 0, 0, scm_uname);
|
* __scm.h, alist.c, alist.h, append.c, append.h, appinit.c,
arbiters.c, arbiters.h, async.c, async.h, boolean.c, boolean.h,
chars.c, chars.h, continuations.c, continuations.h, debug.c,
debug.h, dynwind.c, dynwind.h, eq.c, eq.h, error.c, eval.c,
eval.h, extchrs.c, extchrs.h, fdsocket.c, fdsocket.h, filesys.c,
filesys.h, fports.c, fports.h, gc.c, gdb_interface.h, gdbint.c,
gdbint.h, genio.c, genio.h, gscm.c, gscm.h, gsubr.c, gsubr.h,
hash.c, hash.h, hashtab.c, hashtab.h, init.c, ioext.c, ioext.h,
kw.c, kw.h, libguile.h, mallocs.c, mallocs.h, markers.c,
markers.h, mbstrings.c, mbstrings.h, numbers.c, numbers.h,
objprop.c, objprop.h, options.c, options.h, pairs.c, pairs.h,
ports.c, ports.h, posix.c, posix.h, print.c, print.h, procprop.c,
procprop.h, procs.c, procs.h, ramap.c, ramap.h, read.c, read.h,
root.c, scmsigs.c, scmsigs.h, sequences.c, sequences.h, simpos.c,
simpos.h, smob.c, socket.c, socket.h, srcprop.c, srcprop.h,
stackchk.c, stackchk.h, stime.c, stime.h, strings.c, strings.h,
strop.c, strop.h, strorder.c, strorder.h, strports.c, strports.h,
struct.c, struct.h, symbols.c, symbols.h, tag.c, tag.h, unif.c,
unif.h, variable.c, variable.h, vectors.c, vectors.h, version.c,
version.h, vports.c, vports.h, weaks.c, weaks.h: Use SCM_P to
declare functions with prototypes. (Patch thanks to Marius
Vollmer.)
1996-10-14 01:33:50 +00:00
|
|
|
|
|
1996-07-25 22:56:11 +00:00
|
|
|
|
SCM
|
1996-10-28 09:44:07 +00:00
|
|
|
|
scm_uname ()
|
1996-07-25 22:56:11 +00:00
|
|
|
|
{
|
|
|
|
|
|
#ifdef HAVE_UNAME
|
|
|
|
|
|
struct utsname buf;
|
|
|
|
|
|
SCM ans = scm_make_vector(SCM_MAKINUM(5), SCM_UNSPECIFIED, SCM_BOOL_F);
|
|
|
|
|
|
SCM *ve = SCM_VELTS (ans);
|
1997-03-15 18:10:35 +00:00
|
|
|
|
SCM_DEFER_INTS;
|
1996-07-25 22:56:11 +00:00
|
|
|
|
if (uname (&buf))
|
1997-03-15 18:10:35 +00:00
|
|
|
|
scm_syserror (s_uname);
|
1996-07-25 22:56:11 +00:00
|
|
|
|
ve[0] = scm_makfrom0str (buf.sysname);
|
|
|
|
|
|
ve[1] = scm_makfrom0str (buf.nodename);
|
|
|
|
|
|
ve[2] = scm_makfrom0str (buf.release);
|
|
|
|
|
|
ve[3] = scm_makfrom0str (buf.version);
|
|
|
|
|
|
ve[4] = scm_makfrom0str (buf.machine);
|
|
|
|
|
|
/*
|
1996-08-02 23:26:33 +00:00
|
|
|
|
a linux special?
|
1996-07-25 22:56:11 +00:00
|
|
|
|
ve[5] = scm_makfrom0str (buf.domainname);
|
|
|
|
|
|
*/
|
1997-03-15 18:10:35 +00:00
|
|
|
|
SCM_ALLOW_INTS;
|
1996-07-25 22:56:11 +00:00
|
|
|
|
return ans;
|
|
|
|
|
|
#else
|
1996-10-28 09:44:07 +00:00
|
|
|
|
scm_sysmissing (s_uname);
|
1996-08-02 23:26:33 +00:00
|
|
|
|
/* not reached. */
|
|
|
|
|
|
return SCM_BOOL_F;
|
1996-07-25 22:56:11 +00:00
|
|
|
|
#endif
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
SCM_PROC (s_environ, "environ", 0, 1, 0, scm_environ);
|
* __scm.h, alist.c, alist.h, append.c, append.h, appinit.c,
arbiters.c, arbiters.h, async.c, async.h, boolean.c, boolean.h,
chars.c, chars.h, continuations.c, continuations.h, debug.c,
debug.h, dynwind.c, dynwind.h, eq.c, eq.h, error.c, eval.c,
eval.h, extchrs.c, extchrs.h, fdsocket.c, fdsocket.h, filesys.c,
filesys.h, fports.c, fports.h, gc.c, gdb_interface.h, gdbint.c,
gdbint.h, genio.c, genio.h, gscm.c, gscm.h, gsubr.c, gsubr.h,
hash.c, hash.h, hashtab.c, hashtab.h, init.c, ioext.c, ioext.h,
kw.c, kw.h, libguile.h, mallocs.c, mallocs.h, markers.c,
markers.h, mbstrings.c, mbstrings.h, numbers.c, numbers.h,
objprop.c, objprop.h, options.c, options.h, pairs.c, pairs.h,
ports.c, ports.h, posix.c, posix.h, print.c, print.h, procprop.c,
procprop.h, procs.c, procs.h, ramap.c, ramap.h, read.c, read.h,
root.c, scmsigs.c, scmsigs.h, sequences.c, sequences.h, simpos.c,
simpos.h, smob.c, socket.c, socket.h, srcprop.c, srcprop.h,
stackchk.c, stackchk.h, stime.c, stime.h, strings.c, strings.h,
strop.c, strop.h, strorder.c, strorder.h, strports.c, strports.h,
struct.c, struct.h, symbols.c, symbols.h, tag.c, tag.h, unif.c,
unif.h, variable.c, variable.h, vectors.c, vectors.h, version.c,
version.h, vports.c, vports.h, weaks.c, weaks.h: Use SCM_P to
declare functions with prototypes. (Patch thanks to Marius
Vollmer.)
1996-10-14 01:33:50 +00:00
|
|
|
|
|
1996-07-25 22:56:11 +00:00
|
|
|
|
SCM
|
|
|
|
|
|
scm_environ (env)
|
|
|
|
|
|
SCM env;
|
|
|
|
|
|
{
|
|
|
|
|
|
if (SCM_UNBNDP (env))
|
|
|
|
|
|
return scm_makfromstrs (-1, environ);
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
int num_strings;
|
|
|
|
|
|
char **new_environ;
|
|
|
|
|
|
int i = 0;
|
|
|
|
|
|
SCM_ASSERT (SCM_NULLP (env) || (SCM_NIMP (env) && SCM_CONSP (env)),
|
|
|
|
|
|
env, SCM_ARG1, s_environ);
|
|
|
|
|
|
num_strings = scm_ilength (env);
|
|
|
|
|
|
new_environ = (char **) scm_must_malloc ((num_strings + 1)
|
|
|
|
|
|
* sizeof (char *),
|
|
|
|
|
|
s_environ);
|
|
|
|
|
|
while (SCM_NNULLP (env))
|
|
|
|
|
|
{
|
|
|
|
|
|
int len;
|
|
|
|
|
|
char *src;
|
1997-03-13 21:54:02 +00:00
|
|
|
|
SCM_ASSERT (SCM_NIMP (SCM_CAR (env))
|
|
|
|
|
|
&& SCM_ROSTRINGP (SCM_CAR (env)),
|
|
|
|
|
|
env, SCM_ARG1, s_environ);
|
1996-07-25 22:56:11 +00:00
|
|
|
|
len = 1 + SCM_ROLENGTH (SCM_CAR (env));
|
|
|
|
|
|
new_environ[i] = scm_must_malloc ((long) len, s_environ);
|
|
|
|
|
|
src = SCM_ROCHARS (SCM_CAR (env));
|
|
|
|
|
|
while (len--)
|
|
|
|
|
|
new_environ[i][len] = src[len];
|
|
|
|
|
|
env = SCM_CDR (env);
|
|
|
|
|
|
i++;
|
|
|
|
|
|
}
|
|
|
|
|
|
new_environ[i] = 0;
|
|
|
|
|
|
/* Free the old environment, except when called for the first
|
|
|
|
|
|
* time.
|
|
|
|
|
|
*/
|
|
|
|
|
|
{
|
|
|
|
|
|
char **ep;
|
|
|
|
|
|
static int first = 1;
|
|
|
|
|
|
if (!first)
|
|
|
|
|
|
{
|
|
|
|
|
|
for (ep = environ; *ep != NULL; ep++)
|
|
|
|
|
|
scm_must_free (*ep);
|
|
|
|
|
|
scm_must_free ((char *) environ);
|
|
|
|
|
|
}
|
|
|
|
|
|
first = 0;
|
|
|
|
|
|
}
|
|
|
|
|
|
environ = new_environ;
|
|
|
|
|
|
return SCM_UNSPECIFIED;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
1996-11-02 20:53:53 +00:00
|
|
|
|
#ifdef L_tmpnam
|
|
|
|
|
|
|
|
|
|
|
|
SCM_PROC (s_tmpnam, "tmpnam", 0, 0, 0, scm_tmpnam);
|
|
|
|
|
|
|
|
|
|
|
|
SCM scm_tmpnam()
|
|
|
|
|
|
{
|
|
|
|
|
|
char name[L_tmpnam];
|
|
|
|
|
|
SCM_SYSCALL (tmpnam (name););
|
|
|
|
|
|
return scm_makfrom0str (name);
|
|
|
|
|
|
}
|
|
|
|
|
|
#endif
|
1996-07-25 22:56:11 +00:00
|
|
|
|
|
|
|
|
|
|
SCM_PROC (s_open_pipe, "open-pipe", 2, 0, 0, scm_open_pipe);
|
* __scm.h, alist.c, alist.h, append.c, append.h, appinit.c,
arbiters.c, arbiters.h, async.c, async.h, boolean.c, boolean.h,
chars.c, chars.h, continuations.c, continuations.h, debug.c,
debug.h, dynwind.c, dynwind.h, eq.c, eq.h, error.c, eval.c,
eval.h, extchrs.c, extchrs.h, fdsocket.c, fdsocket.h, filesys.c,
filesys.h, fports.c, fports.h, gc.c, gdb_interface.h, gdbint.c,
gdbint.h, genio.c, genio.h, gscm.c, gscm.h, gsubr.c, gsubr.h,
hash.c, hash.h, hashtab.c, hashtab.h, init.c, ioext.c, ioext.h,
kw.c, kw.h, libguile.h, mallocs.c, mallocs.h, markers.c,
markers.h, mbstrings.c, mbstrings.h, numbers.c, numbers.h,
objprop.c, objprop.h, options.c, options.h, pairs.c, pairs.h,
ports.c, ports.h, posix.c, posix.h, print.c, print.h, procprop.c,
procprop.h, procs.c, procs.h, ramap.c, ramap.h, read.c, read.h,
root.c, scmsigs.c, scmsigs.h, sequences.c, sequences.h, simpos.c,
simpos.h, smob.c, socket.c, socket.h, srcprop.c, srcprop.h,
stackchk.c, stackchk.h, stime.c, stime.h, strings.c, strings.h,
strop.c, strop.h, strorder.c, strorder.h, strports.c, strports.h,
struct.c, struct.h, symbols.c, symbols.h, tag.c, tag.h, unif.c,
unif.h, variable.c, variable.h, vectors.c, vectors.h, version.c,
version.h, vports.c, vports.h, weaks.c, weaks.h: Use SCM_P to
declare functions with prototypes. (Patch thanks to Marius
Vollmer.)
1996-10-14 01:33:50 +00:00
|
|
|
|
|
1996-07-25 22:56:11 +00:00
|
|
|
|
SCM
|
|
|
|
|
|
scm_open_pipe (pipestr, modes)
|
|
|
|
|
|
SCM pipestr;
|
|
|
|
|
|
SCM modes;
|
|
|
|
|
|
{
|
|
|
|
|
|
FILE *f;
|
|
|
|
|
|
register SCM z;
|
1996-08-02 23:26:33 +00:00
|
|
|
|
struct scm_port_table * pt;
|
|
|
|
|
|
|
1997-03-13 21:54:02 +00:00
|
|
|
|
SCM_ASSERT (SCM_NIMP (pipestr) && SCM_ROSTRINGP (pipestr), pipestr,
|
|
|
|
|
|
SCM_ARG1, s_open_pipe);
|
1996-07-25 22:56:11 +00:00
|
|
|
|
if (SCM_SUBSTRP (pipestr))
|
1997-03-13 21:54:02 +00:00
|
|
|
|
pipestr = scm_makfromstr (SCM_ROCHARS (pipestr),
|
|
|
|
|
|
SCM_ROLENGTH (pipestr), 0);
|
|
|
|
|
|
SCM_ASSERT (SCM_NIMP (modes) && SCM_ROSTRINGP (modes), modes, SCM_ARG2,
|
|
|
|
|
|
s_open_pipe);
|
1996-07-25 22:56:11 +00:00
|
|
|
|
if (SCM_SUBSTRP (modes))
|
|
|
|
|
|
modes = scm_makfromstr (SCM_ROCHARS (modes), SCM_ROLENGTH (modes), 0);
|
|
|
|
|
|
SCM_NEWCELL (z);
|
|
|
|
|
|
SCM_DEFER_INTS;
|
|
|
|
|
|
scm_ignore_signals ();
|
|
|
|
|
|
SCM_SYSCALL (f = popen (SCM_ROCHARS (pipestr), SCM_ROCHARS (modes)));
|
|
|
|
|
|
scm_unignore_signals ();
|
|
|
|
|
|
if (!f)
|
* debug.c, unif.c: use scm_out_of_range instead of
wta for range errors (ASSERT still needs work).
* error.c, error.h (scm_out_of_range): new procedure.
* error.c, error.h (scm_out_of_range_key): new key.
* posix.c (scm_sync): #else was missing.
* error.c, error.h: append _key to names scm_num_overflow and
scm_system_error.
* __scm.h (SCM_SYSMISSING, SCM_NUM_OVERFLOW): use SCM_BOOL_F instead
of consing an empty list.
(SCM_SYSERROR etc.): move into error.c, make them procedures instead
of macros, saves code and string space.
error.c, fports.c, numbers.c, posix.c, ioext.c, filesys.c, socket.c,
fdsocket.c, simpos.c: change names of SCM_SYSERROR etc., to
lower case. Rename scm_syserror_m to scm_syserror_msg.
error.h: prototypes for new procedures.
1996-09-15 06:41:31 +00:00
|
|
|
|
scm_syserror (s_open_pipe);
|
1996-08-02 23:26:33 +00:00
|
|
|
|
pt = scm_add_to_port_table (z);
|
|
|
|
|
|
SCM_SETPTAB_ENTRY (z, pt);
|
* alist.c, arbiters.c, continuations.c, debug.c, debug.h, eval.c,
eval.h, feature.c, filesys.c, fports.c, gc.c, gsubr.c, init.c,
ioext.c, kw.c, list.c, load.c, mallocs.c, numbers.c, numbers.h,
pairs.c, pairs.h, ports.c, ports.h, posix.c, procprop.c, procs.c,
procs.h, ramap.c, read.c, root.c, srcprop.c, srcprop.h,
strports.c, symbols.c, tags.h, throw.c, unif.c, variable.c,
vports.c: Cleaned up use of pairs: Don't make any special
assumptions about the internal structure of selectors and
mutators: SCM_CXR (<e1>) = <e2> --> SCM_SETCXR (<e1>, <e2>),
SCM_CXR (<e1>) &= <e2> --> SCM_SETAND_CXR (<e1>, <e2>) etc.
(Among other things, this change makes it easier to build Guile
with certain compilers which have problems with casted lvalues.)
1996-10-20 03:31:08 +00:00
|
|
|
|
SCM_SETCAR (z, scm_tc16_pipe | SCM_OPN
|
|
|
|
|
|
| (strchr (SCM_ROCHARS (modes), 'r') ? SCM_RDNG : SCM_WRTNG));
|
1996-08-02 23:26:33 +00:00
|
|
|
|
SCM_SETSTREAM (z, (SCM)f);
|
1996-07-25 22:56:11 +00:00
|
|
|
|
SCM_ALLOW_INTS;
|
|
|
|
|
|
return z;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SCM_PROC (s_open_input_pipe, "open-input-pipe", 1, 0, 0, scm_open_input_pipe);
|
* __scm.h, alist.c, alist.h, append.c, append.h, appinit.c,
arbiters.c, arbiters.h, async.c, async.h, boolean.c, boolean.h,
chars.c, chars.h, continuations.c, continuations.h, debug.c,
debug.h, dynwind.c, dynwind.h, eq.c, eq.h, error.c, eval.c,
eval.h, extchrs.c, extchrs.h, fdsocket.c, fdsocket.h, filesys.c,
filesys.h, fports.c, fports.h, gc.c, gdb_interface.h, gdbint.c,
gdbint.h, genio.c, genio.h, gscm.c, gscm.h, gsubr.c, gsubr.h,
hash.c, hash.h, hashtab.c, hashtab.h, init.c, ioext.c, ioext.h,
kw.c, kw.h, libguile.h, mallocs.c, mallocs.h, markers.c,
markers.h, mbstrings.c, mbstrings.h, numbers.c, numbers.h,
objprop.c, objprop.h, options.c, options.h, pairs.c, pairs.h,
ports.c, ports.h, posix.c, posix.h, print.c, print.h, procprop.c,
procprop.h, procs.c, procs.h, ramap.c, ramap.h, read.c, read.h,
root.c, scmsigs.c, scmsigs.h, sequences.c, sequences.h, simpos.c,
simpos.h, smob.c, socket.c, socket.h, srcprop.c, srcprop.h,
stackchk.c, stackchk.h, stime.c, stime.h, strings.c, strings.h,
strop.c, strop.h, strorder.c, strorder.h, strports.c, strports.h,
struct.c, struct.h, symbols.c, symbols.h, tag.c, tag.h, unif.c,
unif.h, variable.c, variable.h, vectors.c, vectors.h, version.c,
version.h, vports.c, vports.h, weaks.c, weaks.h: Use SCM_P to
declare functions with prototypes. (Patch thanks to Marius
Vollmer.)
1996-10-14 01:33:50 +00:00
|
|
|
|
|
1996-07-25 22:56:11 +00:00
|
|
|
|
SCM
|
|
|
|
|
|
scm_open_input_pipe(pipestr)
|
|
|
|
|
|
SCM pipestr;
|
|
|
|
|
|
{
|
|
|
|
|
|
return scm_open_pipe(pipestr, scm_makfromstr("r", (sizeof "r")-1, 0));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
SCM_PROC (s_open_output_pipe, "open-output-pipe", 1, 0, 0, scm_open_output_pipe);
|
* __scm.h, alist.c, alist.h, append.c, append.h, appinit.c,
arbiters.c, arbiters.h, async.c, async.h, boolean.c, boolean.h,
chars.c, chars.h, continuations.c, continuations.h, debug.c,
debug.h, dynwind.c, dynwind.h, eq.c, eq.h, error.c, eval.c,
eval.h, extchrs.c, extchrs.h, fdsocket.c, fdsocket.h, filesys.c,
filesys.h, fports.c, fports.h, gc.c, gdb_interface.h, gdbint.c,
gdbint.h, genio.c, genio.h, gscm.c, gscm.h, gsubr.c, gsubr.h,
hash.c, hash.h, hashtab.c, hashtab.h, init.c, ioext.c, ioext.h,
kw.c, kw.h, libguile.h, mallocs.c, mallocs.h, markers.c,
markers.h, mbstrings.c, mbstrings.h, numbers.c, numbers.h,
objprop.c, objprop.h, options.c, options.h, pairs.c, pairs.h,
ports.c, ports.h, posix.c, posix.h, print.c, print.h, procprop.c,
procprop.h, procs.c, procs.h, ramap.c, ramap.h, read.c, read.h,
root.c, scmsigs.c, scmsigs.h, sequences.c, sequences.h, simpos.c,
simpos.h, smob.c, socket.c, socket.h, srcprop.c, srcprop.h,
stackchk.c, stackchk.h, stime.c, stime.h, strings.c, strings.h,
strop.c, strop.h, strorder.c, strorder.h, strports.c, strports.h,
struct.c, struct.h, symbols.c, symbols.h, tag.c, tag.h, unif.c,
unif.h, variable.c, variable.h, vectors.c, vectors.h, version.c,
version.h, vports.c, vports.h, weaks.c, weaks.h: Use SCM_P to
declare functions with prototypes. (Patch thanks to Marius
Vollmer.)
1996-10-14 01:33:50 +00:00
|
|
|
|
|
1996-07-25 22:56:11 +00:00
|
|
|
|
SCM
|
|
|
|
|
|
scm_open_output_pipe(pipestr)
|
|
|
|
|
|
SCM pipestr;
|
|
|
|
|
|
{
|
|
|
|
|
|
return scm_open_pipe(pipestr, scm_makfromstr("w", (sizeof "w")-1, 0));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
1996-10-28 09:44:07 +00:00
|
|
|
|
SCM_PROC (s_utime, "utime", 1, 2, 0, scm_utime);
|
* __scm.h, alist.c, alist.h, append.c, append.h, appinit.c,
arbiters.c, arbiters.h, async.c, async.h, boolean.c, boolean.h,
chars.c, chars.h, continuations.c, continuations.h, debug.c,
debug.h, dynwind.c, dynwind.h, eq.c, eq.h, error.c, eval.c,
eval.h, extchrs.c, extchrs.h, fdsocket.c, fdsocket.h, filesys.c,
filesys.h, fports.c, fports.h, gc.c, gdb_interface.h, gdbint.c,
gdbint.h, genio.c, genio.h, gscm.c, gscm.h, gsubr.c, gsubr.h,
hash.c, hash.h, hashtab.c, hashtab.h, init.c, ioext.c, ioext.h,
kw.c, kw.h, libguile.h, mallocs.c, mallocs.h, markers.c,
markers.h, mbstrings.c, mbstrings.h, numbers.c, numbers.h,
objprop.c, objprop.h, options.c, options.h, pairs.c, pairs.h,
ports.c, ports.h, posix.c, posix.h, print.c, print.h, procprop.c,
procprop.h, procs.c, procs.h, ramap.c, ramap.h, read.c, read.h,
root.c, scmsigs.c, scmsigs.h, sequences.c, sequences.h, simpos.c,
simpos.h, smob.c, socket.c, socket.h, srcprop.c, srcprop.h,
stackchk.c, stackchk.h, stime.c, stime.h, strings.c, strings.h,
strop.c, strop.h, strorder.c, strorder.h, strports.c, strports.h,
struct.c, struct.h, symbols.c, symbols.h, tag.c, tag.h, unif.c,
unif.h, variable.c, variable.h, vectors.c, vectors.h, version.c,
version.h, vports.c, vports.h, weaks.c, weaks.h: Use SCM_P to
declare functions with prototypes. (Patch thanks to Marius
Vollmer.)
1996-10-14 01:33:50 +00:00
|
|
|
|
|
1996-07-25 22:56:11 +00:00
|
|
|
|
SCM
|
1996-10-28 09:44:07 +00:00
|
|
|
|
scm_utime (pathname, actime, modtime)
|
1996-07-25 22:56:11 +00:00
|
|
|
|
SCM pathname;
|
|
|
|
|
|
SCM actime;
|
|
|
|
|
|
SCM modtime;
|
|
|
|
|
|
{
|
|
|
|
|
|
int rv;
|
|
|
|
|
|
struct utimbuf utm_tmp;
|
|
|
|
|
|
|
1997-03-13 21:54:02 +00:00
|
|
|
|
SCM_ASSERT (SCM_NIMP (pathname) && SCM_STRINGP (pathname), pathname,
|
|
|
|
|
|
SCM_ARG1, s_utime);
|
1996-07-25 22:56:11 +00:00
|
|
|
|
|
|
|
|
|
|
if (SCM_UNBNDP (actime))
|
|
|
|
|
|
SCM_SYSCALL (time (&utm_tmp.actime));
|
|
|
|
|
|
else
|
1996-10-28 09:44:07 +00:00
|
|
|
|
utm_tmp.actime = scm_num2ulong (actime, (char *) SCM_ARG2, s_utime);
|
1996-07-25 22:56:11 +00:00
|
|
|
|
|
|
|
|
|
|
if (SCM_UNBNDP (modtime))
|
|
|
|
|
|
SCM_SYSCALL (time (&utm_tmp.modtime));
|
|
|
|
|
|
else
|
1996-10-28 09:44:07 +00:00
|
|
|
|
utm_tmp.modtime = scm_num2ulong (modtime, (char *) SCM_ARG3, s_utime);
|
1996-07-25 22:56:11 +00:00
|
|
|
|
|
|
|
|
|
|
SCM_SYSCALL (rv = utime (SCM_CHARS (pathname), &utm_tmp));
|
1996-08-02 23:26:33 +00:00
|
|
|
|
if (rv != 0)
|
1996-10-28 09:44:07 +00:00
|
|
|
|
scm_syserror (s_utime);
|
1996-08-02 23:26:33 +00:00
|
|
|
|
return SCM_UNSPECIFIED;
|
1996-07-25 22:56:11 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
1996-10-28 09:44:07 +00:00
|
|
|
|
SCM_PROC (s_access, "access?", 2, 0, 0, scm_access);
|
* __scm.h, alist.c, alist.h, append.c, append.h, appinit.c,
arbiters.c, arbiters.h, async.c, async.h, boolean.c, boolean.h,
chars.c, chars.h, continuations.c, continuations.h, debug.c,
debug.h, dynwind.c, dynwind.h, eq.c, eq.h, error.c, eval.c,
eval.h, extchrs.c, extchrs.h, fdsocket.c, fdsocket.h, filesys.c,
filesys.h, fports.c, fports.h, gc.c, gdb_interface.h, gdbint.c,
gdbint.h, genio.c, genio.h, gscm.c, gscm.h, gsubr.c, gsubr.h,
hash.c, hash.h, hashtab.c, hashtab.h, init.c, ioext.c, ioext.h,
kw.c, kw.h, libguile.h, mallocs.c, mallocs.h, markers.c,
markers.h, mbstrings.c, mbstrings.h, numbers.c, numbers.h,
objprop.c, objprop.h, options.c, options.h, pairs.c, pairs.h,
ports.c, ports.h, posix.c, posix.h, print.c, print.h, procprop.c,
procprop.h, procs.c, procs.h, ramap.c, ramap.h, read.c, read.h,
root.c, scmsigs.c, scmsigs.h, sequences.c, sequences.h, simpos.c,
simpos.h, smob.c, socket.c, socket.h, srcprop.c, srcprop.h,
stackchk.c, stackchk.h, stime.c, stime.h, strings.c, strings.h,
strop.c, strop.h, strorder.c, strorder.h, strports.c, strports.h,
struct.c, struct.h, symbols.c, symbols.h, tag.c, tag.h, unif.c,
unif.h, variable.c, variable.h, vectors.c, vectors.h, version.c,
version.h, vports.c, vports.h, weaks.c, weaks.h: Use SCM_P to
declare functions with prototypes. (Patch thanks to Marius
Vollmer.)
1996-10-14 01:33:50 +00:00
|
|
|
|
|
1996-07-25 22:56:11 +00:00
|
|
|
|
SCM
|
1996-10-28 09:44:07 +00:00
|
|
|
|
scm_access (path, how)
|
1996-07-25 22:56:11 +00:00
|
|
|
|
SCM path;
|
|
|
|
|
|
SCM how;
|
|
|
|
|
|
{
|
|
|
|
|
|
int rv;
|
|
|
|
|
|
|
1997-03-13 21:54:02 +00:00
|
|
|
|
SCM_ASSERT (SCM_NIMP (path) && SCM_ROSTRINGP (path), path, SCM_ARG1,
|
|
|
|
|
|
s_access);
|
1996-07-25 22:56:11 +00:00
|
|
|
|
if (SCM_SUBSTRP (path))
|
|
|
|
|
|
path = scm_makfromstr (SCM_ROCHARS (path), SCM_ROLENGTH (path), 0);
|
1996-10-28 09:44:07 +00:00
|
|
|
|
SCM_ASSERT (SCM_INUMP (how), how, SCM_ARG2, s_access);
|
1996-07-25 22:56:11 +00:00
|
|
|
|
rv = access (SCM_ROCHARS (path), SCM_INUM (how));
|
|
|
|
|
|
return rv ? SCM_BOOL_F : SCM_BOOL_T;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
SCM_PROC (s_getpid, "getpid", 0, 0, 0, scm_getpid);
|
* __scm.h, alist.c, alist.h, append.c, append.h, appinit.c,
arbiters.c, arbiters.h, async.c, async.h, boolean.c, boolean.h,
chars.c, chars.h, continuations.c, continuations.h, debug.c,
debug.h, dynwind.c, dynwind.h, eq.c, eq.h, error.c, eval.c,
eval.h, extchrs.c, extchrs.h, fdsocket.c, fdsocket.h, filesys.c,
filesys.h, fports.c, fports.h, gc.c, gdb_interface.h, gdbint.c,
gdbint.h, genio.c, genio.h, gscm.c, gscm.h, gsubr.c, gsubr.h,
hash.c, hash.h, hashtab.c, hashtab.h, init.c, ioext.c, ioext.h,
kw.c, kw.h, libguile.h, mallocs.c, mallocs.h, markers.c,
markers.h, mbstrings.c, mbstrings.h, numbers.c, numbers.h,
objprop.c, objprop.h, options.c, options.h, pairs.c, pairs.h,
ports.c, ports.h, posix.c, posix.h, print.c, print.h, procprop.c,
procprop.h, procs.c, procs.h, ramap.c, ramap.h, read.c, read.h,
root.c, scmsigs.c, scmsigs.h, sequences.c, sequences.h, simpos.c,
simpos.h, smob.c, socket.c, socket.h, srcprop.c, srcprop.h,
stackchk.c, stackchk.h, stime.c, stime.h, strings.c, strings.h,
strop.c, strop.h, strorder.c, strorder.h, strports.c, strports.h,
struct.c, struct.h, symbols.c, symbols.h, tag.c, tag.h, unif.c,
unif.h, variable.c, variable.h, vectors.c, vectors.h, version.c,
version.h, vports.c, vports.h, weaks.c, weaks.h: Use SCM_P to
declare functions with prototypes. (Patch thanks to Marius
Vollmer.)
1996-10-14 01:33:50 +00:00
|
|
|
|
|
1996-07-25 22:56:11 +00:00
|
|
|
|
SCM
|
|
|
|
|
|
scm_getpid ()
|
|
|
|
|
|
{
|
|
|
|
|
|
return SCM_MAKINUM ((unsigned long) getpid ());
|
|
|
|
|
|
}
|
|
|
|
|
|
|
1996-10-28 09:44:07 +00:00
|
|
|
|
SCM_PROC (s_putenv, "putenv", 1, 0, 0, scm_putenv);
|
* __scm.h, alist.c, alist.h, append.c, append.h, appinit.c,
arbiters.c, arbiters.h, async.c, async.h, boolean.c, boolean.h,
chars.c, chars.h, continuations.c, continuations.h, debug.c,
debug.h, dynwind.c, dynwind.h, eq.c, eq.h, error.c, eval.c,
eval.h, extchrs.c, extchrs.h, fdsocket.c, fdsocket.h, filesys.c,
filesys.h, fports.c, fports.h, gc.c, gdb_interface.h, gdbint.c,
gdbint.h, genio.c, genio.h, gscm.c, gscm.h, gsubr.c, gsubr.h,
hash.c, hash.h, hashtab.c, hashtab.h, init.c, ioext.c, ioext.h,
kw.c, kw.h, libguile.h, mallocs.c, mallocs.h, markers.c,
markers.h, mbstrings.c, mbstrings.h, numbers.c, numbers.h,
objprop.c, objprop.h, options.c, options.h, pairs.c, pairs.h,
ports.c, ports.h, posix.c, posix.h, print.c, print.h, procprop.c,
procprop.h, procs.c, procs.h, ramap.c, ramap.h, read.c, read.h,
root.c, scmsigs.c, scmsigs.h, sequences.c, sequences.h, simpos.c,
simpos.h, smob.c, socket.c, socket.h, srcprop.c, srcprop.h,
stackchk.c, stackchk.h, stime.c, stime.h, strings.c, strings.h,
strop.c, strop.h, strorder.c, strorder.h, strports.c, strports.h,
struct.c, struct.h, symbols.c, symbols.h, tag.c, tag.h, unif.c,
unif.h, variable.c, variable.h, vectors.c, vectors.h, version.c,
version.h, vports.c, vports.h, weaks.c, weaks.h: Use SCM_P to
declare functions with prototypes. (Patch thanks to Marius
Vollmer.)
1996-10-14 01:33:50 +00:00
|
|
|
|
|
1996-07-25 22:56:11 +00:00
|
|
|
|
SCM
|
1996-10-28 09:44:07 +00:00
|
|
|
|
scm_putenv (str)
|
1996-07-25 22:56:11 +00:00
|
|
|
|
SCM str;
|
|
|
|
|
|
{
|
|
|
|
|
|
#ifdef HAVE_PUTENV
|
1996-10-28 09:44:07 +00:00
|
|
|
|
int rv;
|
|
|
|
|
|
|
|
|
|
|
|
SCM_ASSERT (SCM_NIMP (str) && SCM_STRINGP (str), str, SCM_ARG1, s_putenv);
|
|
|
|
|
|
rv = putenv (SCM_CHARS (str));
|
|
|
|
|
|
if (rv < 0)
|
|
|
|
|
|
scm_syserror (s_putenv);
|
|
|
|
|
|
return SCM_UNSPECIFIED;
|
1996-07-25 22:56:11 +00:00
|
|
|
|
#else
|
1996-10-28 09:44:07 +00:00
|
|
|
|
scm_sysmissing (s_putenv);
|
1996-08-02 23:26:33 +00:00
|
|
|
|
/* not reached. */
|
|
|
|
|
|
return SCM_BOOL_F;
|
1996-07-25 22:56:11 +00:00
|
|
|
|
#endif
|
|
|
|
|
|
}
|
|
|
|
|
|
|
1996-08-02 23:26:33 +00:00
|
|
|
|
SCM_PROC (s_setlocale, "setlocale", 1, 1, 0, scm_setlocale);
|
* __scm.h, alist.c, alist.h, append.c, append.h, appinit.c,
arbiters.c, arbiters.h, async.c, async.h, boolean.c, boolean.h,
chars.c, chars.h, continuations.c, continuations.h, debug.c,
debug.h, dynwind.c, dynwind.h, eq.c, eq.h, error.c, eval.c,
eval.h, extchrs.c, extchrs.h, fdsocket.c, fdsocket.h, filesys.c,
filesys.h, fports.c, fports.h, gc.c, gdb_interface.h, gdbint.c,
gdbint.h, genio.c, genio.h, gscm.c, gscm.h, gsubr.c, gsubr.h,
hash.c, hash.h, hashtab.c, hashtab.h, init.c, ioext.c, ioext.h,
kw.c, kw.h, libguile.h, mallocs.c, mallocs.h, markers.c,
markers.h, mbstrings.c, mbstrings.h, numbers.c, numbers.h,
objprop.c, objprop.h, options.c, options.h, pairs.c, pairs.h,
ports.c, ports.h, posix.c, posix.h, print.c, print.h, procprop.c,
procprop.h, procs.c, procs.h, ramap.c, ramap.h, read.c, read.h,
root.c, scmsigs.c, scmsigs.h, sequences.c, sequences.h, simpos.c,
simpos.h, smob.c, socket.c, socket.h, srcprop.c, srcprop.h,
stackchk.c, stackchk.h, stime.c, stime.h, strings.c, strings.h,
strop.c, strop.h, strorder.c, strorder.h, strports.c, strports.h,
struct.c, struct.h, symbols.c, symbols.h, tag.c, tag.h, unif.c,
unif.h, variable.c, variable.h, vectors.c, vectors.h, version.c,
version.h, vports.c, vports.h, weaks.c, weaks.h: Use SCM_P to
declare functions with prototypes. (Patch thanks to Marius
Vollmer.)
1996-10-14 01:33:50 +00:00
|
|
|
|
|
1996-07-25 22:56:11 +00:00
|
|
|
|
SCM
|
|
|
|
|
|
scm_setlocale (category, locale)
|
|
|
|
|
|
SCM category;
|
|
|
|
|
|
SCM locale;
|
|
|
|
|
|
{
|
|
|
|
|
|
#ifdef HAVE_SETLOCALE
|
|
|
|
|
|
char *clocale;
|
|
|
|
|
|
char *rv;
|
|
|
|
|
|
|
|
|
|
|
|
SCM_ASSERT (SCM_INUMP (category), category, SCM_ARG1, s_setlocale);
|
|
|
|
|
|
if (SCM_UNBNDP (locale))
|
|
|
|
|
|
{
|
|
|
|
|
|
clocale = NULL;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
1997-03-13 21:54:02 +00:00
|
|
|
|
SCM_ASSERT (SCM_NIMP (locale) && SCM_STRINGP (locale), locale,
|
|
|
|
|
|
SCM_ARG2, s_setlocale);
|
1996-07-25 22:56:11 +00:00
|
|
|
|
clocale = SCM_CHARS (locale);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
rv = setlocale (SCM_INUM (category), clocale);
|
1996-08-02 23:26:33 +00:00
|
|
|
|
if (rv == NULL)
|
* debug.c, unif.c: use scm_out_of_range instead of
wta for range errors (ASSERT still needs work).
* error.c, error.h (scm_out_of_range): new procedure.
* error.c, error.h (scm_out_of_range_key): new key.
* posix.c (scm_sync): #else was missing.
* error.c, error.h: append _key to names scm_num_overflow and
scm_system_error.
* __scm.h (SCM_SYSMISSING, SCM_NUM_OVERFLOW): use SCM_BOOL_F instead
of consing an empty list.
(SCM_SYSERROR etc.): move into error.c, make them procedures instead
of macros, saves code and string space.
error.c, fports.c, numbers.c, posix.c, ioext.c, filesys.c, socket.c,
fdsocket.c, simpos.c: change names of SCM_SYSERROR etc., to
lower case. Rename scm_syserror_m to scm_syserror_msg.
error.h: prototypes for new procedures.
1996-09-15 06:41:31 +00:00
|
|
|
|
scm_syserror (s_setlocale);
|
1996-08-02 23:26:33 +00:00
|
|
|
|
return scm_makfrom0str (rv);
|
1996-07-25 22:56:11 +00:00
|
|
|
|
#else
|
* debug.c, unif.c: use scm_out_of_range instead of
wta for range errors (ASSERT still needs work).
* error.c, error.h (scm_out_of_range): new procedure.
* error.c, error.h (scm_out_of_range_key): new key.
* posix.c (scm_sync): #else was missing.
* error.c, error.h: append _key to names scm_num_overflow and
scm_system_error.
* __scm.h (SCM_SYSMISSING, SCM_NUM_OVERFLOW): use SCM_BOOL_F instead
of consing an empty list.
(SCM_SYSERROR etc.): move into error.c, make them procedures instead
of macros, saves code and string space.
error.c, fports.c, numbers.c, posix.c, ioext.c, filesys.c, socket.c,
fdsocket.c, simpos.c: change names of SCM_SYSERROR etc., to
lower case. Rename scm_syserror_m to scm_syserror_msg.
error.h: prototypes for new procedures.
1996-09-15 06:41:31 +00:00
|
|
|
|
scm_sysmissing (s_setlocale);
|
1996-08-02 23:26:33 +00:00
|
|
|
|
/* not reached. */
|
|
|
|
|
|
return SCM_BOOL_F;
|
1996-07-25 22:56:11 +00:00
|
|
|
|
#endif
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
SCM_PROC (s_strftime, "strftime", 2, 0, 0, scm_strftime);
|
* __scm.h, alist.c, alist.h, append.c, append.h, appinit.c,
arbiters.c, arbiters.h, async.c, async.h, boolean.c, boolean.h,
chars.c, chars.h, continuations.c, continuations.h, debug.c,
debug.h, dynwind.c, dynwind.h, eq.c, eq.h, error.c, eval.c,
eval.h, extchrs.c, extchrs.h, fdsocket.c, fdsocket.h, filesys.c,
filesys.h, fports.c, fports.h, gc.c, gdb_interface.h, gdbint.c,
gdbint.h, genio.c, genio.h, gscm.c, gscm.h, gsubr.c, gsubr.h,
hash.c, hash.h, hashtab.c, hashtab.h, init.c, ioext.c, ioext.h,
kw.c, kw.h, libguile.h, mallocs.c, mallocs.h, markers.c,
markers.h, mbstrings.c, mbstrings.h, numbers.c, numbers.h,
objprop.c, objprop.h, options.c, options.h, pairs.c, pairs.h,
ports.c, ports.h, posix.c, posix.h, print.c, print.h, procprop.c,
procprop.h, procs.c, procs.h, ramap.c, ramap.h, read.c, read.h,
root.c, scmsigs.c, scmsigs.h, sequences.c, sequences.h, simpos.c,
simpos.h, smob.c, socket.c, socket.h, srcprop.c, srcprop.h,
stackchk.c, stackchk.h, stime.c, stime.h, strings.c, strings.h,
strop.c, strop.h, strorder.c, strorder.h, strports.c, strports.h,
struct.c, struct.h, symbols.c, symbols.h, tag.c, tag.h, unif.c,
unif.h, variable.c, variable.h, vectors.c, vectors.h, version.c,
version.h, vports.c, vports.h, weaks.c, weaks.h: Use SCM_P to
declare functions with prototypes. (Patch thanks to Marius
Vollmer.)
1996-10-14 01:33:50 +00:00
|
|
|
|
|
1996-07-25 22:56:11 +00:00
|
|
|
|
SCM
|
|
|
|
|
|
scm_strftime (format, stime)
|
|
|
|
|
|
SCM format;
|
|
|
|
|
|
SCM stime;
|
|
|
|
|
|
{
|
|
|
|
|
|
struct tm t;
|
|
|
|
|
|
|
|
|
|
|
|
char *tbuf;
|
|
|
|
|
|
int n;
|
|
|
|
|
|
int size = 50;
|
|
|
|
|
|
char *fmt;
|
|
|
|
|
|
int len;
|
|
|
|
|
|
|
1997-03-13 21:54:02 +00:00
|
|
|
|
SCM_ASSERT (SCM_NIMP (format) && SCM_STRINGP (format), format, SCM_ARG1,
|
|
|
|
|
|
s_strftime);
|
|
|
|
|
|
SCM_ASSERT (SCM_NIMP (stime) && SCM_VECTORP (stime)
|
|
|
|
|
|
&& scm_obj_length (stime) == 9,
|
|
|
|
|
|
stime, SCM_ARG2, s_strftime);
|
1996-07-25 22:56:11 +00:00
|
|
|
|
|
|
|
|
|
|
fmt = SCM_ROCHARS (format);
|
|
|
|
|
|
len = SCM_ROLENGTH (format);
|
|
|
|
|
|
|
|
|
|
|
|
#define tm_deref scm_num2long (SCM_VELTS (stime)[n++], (char *)SCM_ARG2, s_strftime)
|
|
|
|
|
|
n = 0;
|
|
|
|
|
|
t.tm_sec = tm_deref;
|
|
|
|
|
|
t.tm_min = tm_deref;
|
|
|
|
|
|
t.tm_hour = tm_deref;
|
|
|
|
|
|
t.tm_mday = tm_deref;
|
|
|
|
|
|
t.tm_mon = tm_deref;
|
|
|
|
|
|
t.tm_year = tm_deref;
|
|
|
|
|
|
/* not used by mktime.
|
|
|
|
|
|
t.tm_wday = tm_deref;
|
|
|
|
|
|
t.tm_yday = tm_deref; */
|
|
|
|
|
|
t.tm_isdst = tm_deref;
|
|
|
|
|
|
#undef tm_deref
|
|
|
|
|
|
|
|
|
|
|
|
/* fill in missing fields and set the timezone. */
|
|
|
|
|
|
mktime (&t);
|
|
|
|
|
|
|
|
|
|
|
|
tbuf = scm_must_malloc (size, s_strftime);
|
|
|
|
|
|
while ((len = strftime (tbuf, size, fmt, &t)) == size)
|
|
|
|
|
|
{
|
|
|
|
|
|
scm_must_free (tbuf);
|
|
|
|
|
|
size *= 2;
|
|
|
|
|
|
tbuf = scm_must_malloc (size, s_strftime);
|
|
|
|
|
|
}
|
|
|
|
|
|
return scm_makfromstr (tbuf, len, 0);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
1996-10-28 09:44:07 +00:00
|
|
|
|
SCM_PROC (s_strptime, "strptime", 2, 0, 0, scm_strptime);
|
* __scm.h, alist.c, alist.h, append.c, append.h, appinit.c,
arbiters.c, arbiters.h, async.c, async.h, boolean.c, boolean.h,
chars.c, chars.h, continuations.c, continuations.h, debug.c,
debug.h, dynwind.c, dynwind.h, eq.c, eq.h, error.c, eval.c,
eval.h, extchrs.c, extchrs.h, fdsocket.c, fdsocket.h, filesys.c,
filesys.h, fports.c, fports.h, gc.c, gdb_interface.h, gdbint.c,
gdbint.h, genio.c, genio.h, gscm.c, gscm.h, gsubr.c, gsubr.h,
hash.c, hash.h, hashtab.c, hashtab.h, init.c, ioext.c, ioext.h,
kw.c, kw.h, libguile.h, mallocs.c, mallocs.h, markers.c,
markers.h, mbstrings.c, mbstrings.h, numbers.c, numbers.h,
objprop.c, objprop.h, options.c, options.h, pairs.c, pairs.h,
ports.c, ports.h, posix.c, posix.h, print.c, print.h, procprop.c,
procprop.h, procs.c, procs.h, ramap.c, ramap.h, read.c, read.h,
root.c, scmsigs.c, scmsigs.h, sequences.c, sequences.h, simpos.c,
simpos.h, smob.c, socket.c, socket.h, srcprop.c, srcprop.h,
stackchk.c, stackchk.h, stime.c, stime.h, strings.c, strings.h,
strop.c, strop.h, strorder.c, strorder.h, strports.c, strports.h,
struct.c, struct.h, symbols.c, symbols.h, tag.c, tag.h, unif.c,
unif.h, variable.c, variable.h, vectors.c, vectors.h, version.c,
version.h, vports.c, vports.h, weaks.c, weaks.h: Use SCM_P to
declare functions with prototypes. (Patch thanks to Marius
Vollmer.)
1996-10-14 01:33:50 +00:00
|
|
|
|
|
1996-07-25 22:56:11 +00:00
|
|
|
|
SCM
|
1996-10-28 09:44:07 +00:00
|
|
|
|
scm_strptime (format, string)
|
1996-07-25 22:56:11 +00:00
|
|
|
|
SCM format;
|
|
|
|
|
|
SCM string;
|
|
|
|
|
|
{
|
|
|
|
|
|
#ifdef HAVE_STRPTIME
|
|
|
|
|
|
SCM stime;
|
|
|
|
|
|
struct tm t;
|
|
|
|
|
|
|
|
|
|
|
|
char *fmt, *str, *rest;
|
|
|
|
|
|
int n;
|
|
|
|
|
|
|
1997-03-13 21:54:02 +00:00
|
|
|
|
SCM_ASSERT (SCM_NIMP (format) && SCM_ROSTRINGP (format), format, SCM_ARG1,
|
|
|
|
|
|
s_strptime);
|
1996-07-25 22:56:11 +00:00
|
|
|
|
if (SCM_SUBSTRP (format))
|
|
|
|
|
|
format = scm_makfromstr (SCM_ROCHARS (format), SCM_ROLENGTH (format), 0);
|
1997-03-13 21:54:02 +00:00
|
|
|
|
SCM_ASSERT (SCM_NIMP (string) && SCM_ROSTRINGP (string), string, SCM_ARG2,
|
|
|
|
|
|
s_strptime);
|
1996-07-25 22:56:11 +00:00
|
|
|
|
if (SCM_SUBSTRP (string))
|
|
|
|
|
|
string = scm_makfromstr (SCM_ROCHARS (string), SCM_ROLENGTH (string), 0);
|
|
|
|
|
|
|
|
|
|
|
|
fmt = SCM_CHARS (format);
|
|
|
|
|
|
str = SCM_CHARS (string);
|
|
|
|
|
|
|
|
|
|
|
|
/* initialize the struct tm */
|
|
|
|
|
|
#define tm_init(field) t.field = 0
|
|
|
|
|
|
tm_init (tm_sec);
|
|
|
|
|
|
tm_init (tm_min);
|
|
|
|
|
|
tm_init (tm_hour);
|
|
|
|
|
|
tm_init (tm_mday);
|
|
|
|
|
|
tm_init (tm_mon);
|
|
|
|
|
|
tm_init (tm_year);
|
|
|
|
|
|
tm_init (tm_wday);
|
|
|
|
|
|
tm_init (tm_yday);
|
|
|
|
|
|
tm_init (tm_isdst);
|
|
|
|
|
|
#undef tm_init
|
|
|
|
|
|
|
|
|
|
|
|
SCM_DEFER_INTS;
|
|
|
|
|
|
rest = strptime (str, fmt, &t);
|
|
|
|
|
|
SCM_ALLOW_INTS;
|
|
|
|
|
|
|
1996-08-02 23:26:33 +00:00
|
|
|
|
if (rest == NULL)
|
1996-10-28 09:44:07 +00:00
|
|
|
|
scm_syserror (s_strptime);
|
1996-07-25 22:56:11 +00:00
|
|
|
|
|
|
|
|
|
|
stime = scm_make_vector (SCM_MAKINUM (9), scm_long2num (0), SCM_UNDEFINED);
|
|
|
|
|
|
|
|
|
|
|
|
#define stime_set(val) scm_vector_set_x (stime, SCM_MAKINUM (n++), scm_long2num (t.val));
|
|
|
|
|
|
n = 0;
|
|
|
|
|
|
stime_set (tm_sec);
|
|
|
|
|
|
stime_set (tm_min);
|
|
|
|
|
|
stime_set (tm_hour);
|
|
|
|
|
|
stime_set (tm_mday);
|
|
|
|
|
|
stime_set (tm_mon);
|
|
|
|
|
|
stime_set (tm_year);
|
|
|
|
|
|
stime_set (tm_wday);
|
|
|
|
|
|
stime_set (tm_yday);
|
|
|
|
|
|
stime_set (tm_isdst);
|
|
|
|
|
|
#undef stime_set
|
|
|
|
|
|
|
|
|
|
|
|
return scm_cons (stime, scm_makfrom0str (rest));
|
|
|
|
|
|
#else
|
1996-10-28 09:44:07 +00:00
|
|
|
|
scm_sysmissing (s_strptime);
|
1996-08-02 23:26:33 +00:00
|
|
|
|
/* not reached. */
|
1996-07-25 22:56:11 +00:00
|
|
|
|
return SCM_BOOL_F;
|
|
|
|
|
|
#endif
|
|
|
|
|
|
}
|
|
|
|
|
|
|
1996-10-28 09:44:07 +00:00
|
|
|
|
SCM_PROC (s_mknod, "mknod", 3, 0, 0, scm_mknod);
|
* __scm.h, alist.c, alist.h, append.c, append.h, appinit.c,
arbiters.c, arbiters.h, async.c, async.h, boolean.c, boolean.h,
chars.c, chars.h, continuations.c, continuations.h, debug.c,
debug.h, dynwind.c, dynwind.h, eq.c, eq.h, error.c, eval.c,
eval.h, extchrs.c, extchrs.h, fdsocket.c, fdsocket.h, filesys.c,
filesys.h, fports.c, fports.h, gc.c, gdb_interface.h, gdbint.c,
gdbint.h, genio.c, genio.h, gscm.c, gscm.h, gsubr.c, gsubr.h,
hash.c, hash.h, hashtab.c, hashtab.h, init.c, ioext.c, ioext.h,
kw.c, kw.h, libguile.h, mallocs.c, mallocs.h, markers.c,
markers.h, mbstrings.c, mbstrings.h, numbers.c, numbers.h,
objprop.c, objprop.h, options.c, options.h, pairs.c, pairs.h,
ports.c, ports.h, posix.c, posix.h, print.c, print.h, procprop.c,
procprop.h, procs.c, procs.h, ramap.c, ramap.h, read.c, read.h,
root.c, scmsigs.c, scmsigs.h, sequences.c, sequences.h, simpos.c,
simpos.h, smob.c, socket.c, socket.h, srcprop.c, srcprop.h,
stackchk.c, stackchk.h, stime.c, stime.h, strings.c, strings.h,
strop.c, strop.h, strorder.c, strorder.h, strports.c, strports.h,
struct.c, struct.h, symbols.c, symbols.h, tag.c, tag.h, unif.c,
unif.h, variable.c, variable.h, vectors.c, vectors.h, version.c,
version.h, vports.c, vports.h, weaks.c, weaks.h: Use SCM_P to
declare functions with prototypes. (Patch thanks to Marius
Vollmer.)
1996-10-14 01:33:50 +00:00
|
|
|
|
|
1996-07-25 22:56:11 +00:00
|
|
|
|
SCM
|
1996-10-28 09:44:07 +00:00
|
|
|
|
scm_mknod(path, mode, dev)
|
1996-07-25 22:56:11 +00:00
|
|
|
|
SCM path;
|
|
|
|
|
|
SCM mode;
|
|
|
|
|
|
SCM dev;
|
|
|
|
|
|
{
|
|
|
|
|
|
#ifdef HAVE_MKNOD
|
|
|
|
|
|
int val;
|
1997-03-13 21:54:02 +00:00
|
|
|
|
SCM_ASSERT(SCM_NIMP(path) && SCM_ROSTRINGP(path), path, SCM_ARG1, s_mknod);
|
1996-10-28 09:44:07 +00:00
|
|
|
|
SCM_ASSERT(SCM_INUMP(mode), mode, SCM_ARG2, s_mknod);
|
|
|
|
|
|
SCM_ASSERT(SCM_INUMP(dev), dev, SCM_ARG3, s_mknod);
|
1997-03-13 21:54:02 +00:00
|
|
|
|
SCM_SYSCALL(val = mknod(SCM_ROCHARS(path), SCM_INUM(mode), SCM_INUM(dev)));
|
1996-08-02 23:26:33 +00:00
|
|
|
|
if (val != 0)
|
1996-10-28 09:44:07 +00:00
|
|
|
|
scm_syserror (s_mknod);
|
1996-08-02 23:26:33 +00:00
|
|
|
|
return SCM_UNSPECIFIED;
|
1996-07-25 22:56:11 +00:00
|
|
|
|
#else
|
1996-10-28 09:44:07 +00:00
|
|
|
|
scm_sysmissing (s_mknod);
|
1996-08-02 23:26:33 +00:00
|
|
|
|
/* not reached. */
|
1996-07-25 22:56:11 +00:00
|
|
|
|
return SCM_BOOL_F;
|
|
|
|
|
|
#endif
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
1996-10-28 09:44:07 +00:00
|
|
|
|
SCM_PROC (s_nice, "nice", 1, 0, 0, scm_nice);
|
* __scm.h, alist.c, alist.h, append.c, append.h, appinit.c,
arbiters.c, arbiters.h, async.c, async.h, boolean.c, boolean.h,
chars.c, chars.h, continuations.c, continuations.h, debug.c,
debug.h, dynwind.c, dynwind.h, eq.c, eq.h, error.c, eval.c,
eval.h, extchrs.c, extchrs.h, fdsocket.c, fdsocket.h, filesys.c,
filesys.h, fports.c, fports.h, gc.c, gdb_interface.h, gdbint.c,
gdbint.h, genio.c, genio.h, gscm.c, gscm.h, gsubr.c, gsubr.h,
hash.c, hash.h, hashtab.c, hashtab.h, init.c, ioext.c, ioext.h,
kw.c, kw.h, libguile.h, mallocs.c, mallocs.h, markers.c,
markers.h, mbstrings.c, mbstrings.h, numbers.c, numbers.h,
objprop.c, objprop.h, options.c, options.h, pairs.c, pairs.h,
ports.c, ports.h, posix.c, posix.h, print.c, print.h, procprop.c,
procprop.h, procs.c, procs.h, ramap.c, ramap.h, read.c, read.h,
root.c, scmsigs.c, scmsigs.h, sequences.c, sequences.h, simpos.c,
simpos.h, smob.c, socket.c, socket.h, srcprop.c, srcprop.h,
stackchk.c, stackchk.h, stime.c, stime.h, strings.c, strings.h,
strop.c, strop.h, strorder.c, strorder.h, strports.c, strports.h,
struct.c, struct.h, symbols.c, symbols.h, tag.c, tag.h, unif.c,
unif.h, variable.c, variable.h, vectors.c, vectors.h, version.c,
version.h, vports.c, vports.h, weaks.c, weaks.h: Use SCM_P to
declare functions with prototypes. (Patch thanks to Marius
Vollmer.)
1996-10-14 01:33:50 +00:00
|
|
|
|
|
1996-07-25 22:56:11 +00:00
|
|
|
|
SCM
|
1996-10-28 09:44:07 +00:00
|
|
|
|
scm_nice(incr)
|
1996-07-25 22:56:11 +00:00
|
|
|
|
SCM incr;
|
|
|
|
|
|
{
|
|
|
|
|
|
#ifdef HAVE_NICE
|
1996-10-28 09:44:07 +00:00
|
|
|
|
SCM_ASSERT(SCM_INUMP(incr), incr, SCM_ARG1, s_nice);
|
1996-08-02 23:26:33 +00:00
|
|
|
|
if (nice(SCM_INUM(incr)) != 0)
|
1996-10-28 09:44:07 +00:00
|
|
|
|
scm_syserror (s_nice);
|
1996-08-02 23:26:33 +00:00
|
|
|
|
return SCM_UNSPECIFIED;
|
1996-07-25 22:56:11 +00:00
|
|
|
|
#else
|
1996-10-28 09:44:07 +00:00
|
|
|
|
scm_sysmissing (s_nice);
|
1996-08-02 23:26:33 +00:00
|
|
|
|
/* not reached. */
|
|
|
|
|
|
return SCM_BOOL_F;
|
1996-07-25 22:56:11 +00:00
|
|
|
|
#endif
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SCM_PROC (s_sync, "sync", 0, 0, 0, scm_sync);
|
* __scm.h, alist.c, alist.h, append.c, append.h, appinit.c,
arbiters.c, arbiters.h, async.c, async.h, boolean.c, boolean.h,
chars.c, chars.h, continuations.c, continuations.h, debug.c,
debug.h, dynwind.c, dynwind.h, eq.c, eq.h, error.c, eval.c,
eval.h, extchrs.c, extchrs.h, fdsocket.c, fdsocket.h, filesys.c,
filesys.h, fports.c, fports.h, gc.c, gdb_interface.h, gdbint.c,
gdbint.h, genio.c, genio.h, gscm.c, gscm.h, gsubr.c, gsubr.h,
hash.c, hash.h, hashtab.c, hashtab.h, init.c, ioext.c, ioext.h,
kw.c, kw.h, libguile.h, mallocs.c, mallocs.h, markers.c,
markers.h, mbstrings.c, mbstrings.h, numbers.c, numbers.h,
objprop.c, objprop.h, options.c, options.h, pairs.c, pairs.h,
ports.c, ports.h, posix.c, posix.h, print.c, print.h, procprop.c,
procprop.h, procs.c, procs.h, ramap.c, ramap.h, read.c, read.h,
root.c, scmsigs.c, scmsigs.h, sequences.c, sequences.h, simpos.c,
simpos.h, smob.c, socket.c, socket.h, srcprop.c, srcprop.h,
stackchk.c, stackchk.h, stime.c, stime.h, strings.c, strings.h,
strop.c, strop.h, strorder.c, strorder.h, strports.c, strports.h,
struct.c, struct.h, symbols.c, symbols.h, tag.c, tag.h, unif.c,
unif.h, variable.c, variable.h, vectors.c, vectors.h, version.c,
version.h, vports.c, vports.h, weaks.c, weaks.h: Use SCM_P to
declare functions with prototypes. (Patch thanks to Marius
Vollmer.)
1996-10-14 01:33:50 +00:00
|
|
|
|
|
1996-07-25 22:56:11 +00:00
|
|
|
|
SCM
|
|
|
|
|
|
scm_sync()
|
|
|
|
|
|
{
|
|
|
|
|
|
#ifdef HAVE_SYNC
|
|
|
|
|
|
sync();
|
* debug.c, unif.c: use scm_out_of_range instead of
wta for range errors (ASSERT still needs work).
* error.c, error.h (scm_out_of_range): new procedure.
* error.c, error.h (scm_out_of_range_key): new key.
* posix.c (scm_sync): #else was missing.
* error.c, error.h: append _key to names scm_num_overflow and
scm_system_error.
* __scm.h (SCM_SYSMISSING, SCM_NUM_OVERFLOW): use SCM_BOOL_F instead
of consing an empty list.
(SCM_SYSERROR etc.): move into error.c, make them procedures instead
of macros, saves code and string space.
error.c, fports.c, numbers.c, posix.c, ioext.c, filesys.c, socket.c,
fdsocket.c, simpos.c: change names of SCM_SYSERROR etc., to
lower case. Rename scm_syserror_m to scm_syserror_msg.
error.h: prototypes for new procedures.
1996-09-15 06:41:31 +00:00
|
|
|
|
#else
|
|
|
|
|
|
scm_sysmissing (s_sync);
|
1996-08-02 23:26:33 +00:00
|
|
|
|
/* not reached. */
|
* debug.c, unif.c: use scm_out_of_range instead of
wta for range errors (ASSERT still needs work).
* error.c, error.h (scm_out_of_range): new procedure.
* error.c, error.h (scm_out_of_range_key): new key.
* posix.c (scm_sync): #else was missing.
* error.c, error.h: append _key to names scm_num_overflow and
scm_system_error.
* __scm.h (SCM_SYSMISSING, SCM_NUM_OVERFLOW): use SCM_BOOL_F instead
of consing an empty list.
(SCM_SYSERROR etc.): move into error.c, make them procedures instead
of macros, saves code and string space.
error.c, fports.c, numbers.c, posix.c, ioext.c, filesys.c, socket.c,
fdsocket.c, simpos.c: change names of SCM_SYSERROR etc., to
lower case. Rename scm_syserror_m to scm_syserror_msg.
error.h: prototypes for new procedures.
1996-09-15 06:41:31 +00:00
|
|
|
|
#endif
|
1996-08-02 23:26:33 +00:00
|
|
|
|
return SCM_BOOL_F;
|
1996-07-25 22:56:11 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
* __scm.h, alist.c, alist.h, append.c, append.h, appinit.c,
arbiters.c, arbiters.h, async.c, async.h, boolean.c, boolean.h,
chars.c, chars.h, continuations.c, continuations.h, debug.c,
debug.h, dynwind.c, dynwind.h, eq.c, eq.h, error.c, eval.c,
eval.h, extchrs.c, extchrs.h, fdsocket.c, fdsocket.h, filesys.c,
filesys.h, fports.c, fports.h, gc.c, gdb_interface.h, gdbint.c,
gdbint.h, genio.c, genio.h, gscm.c, gscm.h, gsubr.c, gsubr.h,
hash.c, hash.h, hashtab.c, hashtab.h, init.c, ioext.c, ioext.h,
kw.c, kw.h, libguile.h, mallocs.c, mallocs.h, markers.c,
markers.h, mbstrings.c, mbstrings.h, numbers.c, numbers.h,
objprop.c, objprop.h, options.c, options.h, pairs.c, pairs.h,
ports.c, ports.h, posix.c, posix.h, print.c, print.h, procprop.c,
procprop.h, procs.c, procs.h, ramap.c, ramap.h, read.c, read.h,
root.c, scmsigs.c, scmsigs.h, sequences.c, sequences.h, simpos.c,
simpos.h, smob.c, socket.c, socket.h, srcprop.c, srcprop.h,
stackchk.c, stackchk.h, stime.c, stime.h, strings.c, strings.h,
strop.c, strop.h, strorder.c, strorder.h, strports.c, strports.h,
struct.c, struct.h, symbols.c, symbols.h, tag.c, tag.h, unif.c,
unif.h, variable.c, variable.h, vectors.c, vectors.h, version.c,
version.h, vports.c, vports.h, weaks.c, weaks.h: Use SCM_P to
declare functions with prototypes. (Patch thanks to Marius
Vollmer.)
1996-10-14 01:33:50 +00:00
|
|
|
|
|
1996-07-25 22:56:11 +00:00
|
|
|
|
void
|
|
|
|
|
|
scm_init_posix ()
|
|
|
|
|
|
{
|
|
|
|
|
|
scm_add_feature ("posix");
|
|
|
|
|
|
#ifdef HAVE_GETEUID
|
|
|
|
|
|
scm_add_feature ("EIDs");
|
|
|
|
|
|
#endif
|
|
|
|
|
|
#ifdef WAIT_ANY
|
|
|
|
|
|
scm_sysintern ("WAIT_ANY", SCM_MAKINUM (WAIT_ANY));
|
|
|
|
|
|
#endif
|
|
|
|
|
|
#ifdef WAIT_MYPGRP
|
|
|
|
|
|
scm_sysintern ("WAIT_MYPGRP", SCM_MAKINUM (WAIT_MYPGRP));
|
|
|
|
|
|
#endif
|
|
|
|
|
|
#ifdef WNOHANG
|
|
|
|
|
|
scm_sysintern ("WNOHANG", SCM_MAKINUM (WNOHANG));
|
|
|
|
|
|
#endif
|
|
|
|
|
|
#ifdef WUNTRACED
|
|
|
|
|
|
scm_sysintern ("WUNTRACED", SCM_MAKINUM (WUNTRACED));
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef SIGHUP
|
|
|
|
|
|
scm_sysintern ("SIGHUP", SCM_MAKINUM (SIGHUP));
|
|
|
|
|
|
#endif
|
|
|
|
|
|
#ifdef SIGINT
|
|
|
|
|
|
scm_sysintern ("SIGINT", SCM_MAKINUM (SIGINT));
|
|
|
|
|
|
#endif
|
|
|
|
|
|
#ifdef SIGQUIT
|
|
|
|
|
|
scm_sysintern ("SIGQUIT", SCM_MAKINUM (SIGQUIT));
|
|
|
|
|
|
#endif
|
|
|
|
|
|
#ifdef SIGILL
|
|
|
|
|
|
scm_sysintern ("SIGILL", SCM_MAKINUM (SIGILL));
|
|
|
|
|
|
#endif
|
|
|
|
|
|
#ifdef SIGTRAP
|
|
|
|
|
|
scm_sysintern ("SIGTRAP", SCM_MAKINUM (SIGTRAP));
|
|
|
|
|
|
#endif
|
|
|
|
|
|
#ifdef SIGABRT
|
|
|
|
|
|
scm_sysintern ("SIGABRT", SCM_MAKINUM (SIGABRT));
|
|
|
|
|
|
#endif
|
|
|
|
|
|
#ifdef SIGIOT
|
|
|
|
|
|
scm_sysintern ("SIGIOT", SCM_MAKINUM (SIGIOT));
|
|
|
|
|
|
#endif
|
|
|
|
|
|
#ifdef SIGBUS
|
|
|
|
|
|
scm_sysintern ("SIGBUS", SCM_MAKINUM (SIGBUS));
|
|
|
|
|
|
#endif
|
|
|
|
|
|
#ifdef SIGFPE
|
|
|
|
|
|
scm_sysintern ("SIGFPE", SCM_MAKINUM (SIGFPE));
|
|
|
|
|
|
#endif
|
|
|
|
|
|
#ifdef SIGKILL
|
|
|
|
|
|
scm_sysintern ("SIGKILL", SCM_MAKINUM (SIGKILL));
|
|
|
|
|
|
#endif
|
|
|
|
|
|
#ifdef SIGUSR1
|
|
|
|
|
|
scm_sysintern ("SIGUSR1", SCM_MAKINUM (SIGUSR1));
|
|
|
|
|
|
#endif
|
|
|
|
|
|
#ifdef SIGSEGV
|
|
|
|
|
|
scm_sysintern ("SIGSEGV", SCM_MAKINUM (SIGSEGV));
|
|
|
|
|
|
#endif
|
|
|
|
|
|
#ifdef SIGUSR2
|
|
|
|
|
|
scm_sysintern ("SIGUSR2", SCM_MAKINUM (SIGUSR2));
|
|
|
|
|
|
#endif
|
|
|
|
|
|
#ifdef SIGPIPE
|
|
|
|
|
|
scm_sysintern ("SIGPIPE", SCM_MAKINUM (SIGPIPE));
|
|
|
|
|
|
#endif
|
|
|
|
|
|
#ifdef SIGALRM
|
|
|
|
|
|
scm_sysintern ("SIGALRM", SCM_MAKINUM (SIGALRM));
|
|
|
|
|
|
#endif
|
|
|
|
|
|
#ifdef SIGTERM
|
|
|
|
|
|
scm_sysintern ("SIGTERM", SCM_MAKINUM (SIGTERM));
|
|
|
|
|
|
#endif
|
|
|
|
|
|
#ifdef SIGSTKFLT
|
|
|
|
|
|
scm_sysintern ("SIGSTKFLT", SCM_MAKINUM (SIGSTKFLT));
|
|
|
|
|
|
#endif
|
|
|
|
|
|
#ifdef SIGCHLD
|
|
|
|
|
|
scm_sysintern ("SIGCHLD", SCM_MAKINUM (SIGCHLD));
|
|
|
|
|
|
#endif
|
|
|
|
|
|
#ifdef SIGCONT
|
|
|
|
|
|
scm_sysintern ("SIGCONT", SCM_MAKINUM (SIGCONT));
|
|
|
|
|
|
#endif
|
|
|
|
|
|
#ifdef SIGSTOP
|
|
|
|
|
|
scm_sysintern ("SIGSTOP", SCM_MAKINUM (SIGSTOP));
|
|
|
|
|
|
#endif
|
|
|
|
|
|
#ifdef SIGTSTP
|
|
|
|
|
|
scm_sysintern ("SIGTSTP", SCM_MAKINUM (SIGTSTP));
|
|
|
|
|
|
#endif
|
|
|
|
|
|
#ifdef SIGTTIN
|
|
|
|
|
|
scm_sysintern ("SIGTTIN", SCM_MAKINUM (SIGTTIN));
|
|
|
|
|
|
#endif
|
|
|
|
|
|
#ifdef SIGTTOU
|
|
|
|
|
|
scm_sysintern ("SIGTTOU", SCM_MAKINUM (SIGTTOU));
|
|
|
|
|
|
#endif
|
|
|
|
|
|
#ifdef SIGIO
|
|
|
|
|
|
scm_sysintern ("SIGIO", SCM_MAKINUM (SIGIO));
|
|
|
|
|
|
#endif
|
|
|
|
|
|
#ifdef SIGPOLL
|
|
|
|
|
|
scm_sysintern ("SIGPOLL", SCM_MAKINUM (SIGPOLL));
|
|
|
|
|
|
#endif
|
|
|
|
|
|
#ifdef SIGURG
|
|
|
|
|
|
scm_sysintern ("SIGURG", SCM_MAKINUM (SIGURG));
|
|
|
|
|
|
#endif
|
|
|
|
|
|
#ifdef SIGXCPU
|
|
|
|
|
|
scm_sysintern ("SIGXCPU", SCM_MAKINUM (SIGXCPU));
|
|
|
|
|
|
#endif
|
|
|
|
|
|
#ifdef SIGXFSZ
|
|
|
|
|
|
scm_sysintern ("SIGXFSZ", SCM_MAKINUM (SIGXFSZ));
|
|
|
|
|
|
#endif
|
|
|
|
|
|
#ifdef SIGVTALRM
|
|
|
|
|
|
scm_sysintern ("SIGVTALRM", SCM_MAKINUM (SIGVTALRM));
|
|
|
|
|
|
#endif
|
|
|
|
|
|
#ifdef SIGPROF
|
|
|
|
|
|
scm_sysintern ("SIGPROF", SCM_MAKINUM (SIGPROF));
|
|
|
|
|
|
#endif
|
|
|
|
|
|
#ifdef SIGWINCH
|
|
|
|
|
|
scm_sysintern ("SIGWINCH", SCM_MAKINUM (SIGWINCH));
|
|
|
|
|
|
#endif
|
|
|
|
|
|
#ifdef SIGLOST
|
|
|
|
|
|
scm_sysintern ("SIGLOST", SCM_MAKINUM (SIGLOST));
|
|
|
|
|
|
#endif
|
|
|
|
|
|
#ifdef SIGPWR
|
|
|
|
|
|
scm_sysintern ("SIGPWR", SCM_MAKINUM (SIGPWR));
|
|
|
|
|
|
#endif
|
|
|
|
|
|
/* access() symbols. */
|
On NextStep, <utime.h> doesn't define struct utime, unless we
#define _POSIX_SOURCE before #including it.
* aclocal.m4 (GUILE_STRUCT_UTIMBUF): New test.
* acconfig.h: New comment text for above CPP symbol.
* configure.in: Call it.
* posix.c: #define _POSIX_SOURCE if it seems necessary.
* configure.in (AC_CHECK_HEADERS): Include sys/utime.h and utime.h
in the list.
* posix.c: Check HAVE_SYS_UTIME_H and HAVE_UTIME_H, instead of
testing for __EMX__.
* posix.c: #include <libc.h>, if it exists.
* posix.c: Cast the return result to GETGROUPS_T, not gid_t; we
don't even know if the latter exists.
* posix.c (s_sys_setpgid, s_sys_setsid, s_sys_ctermid,
s_sys_tcgetpgrp, s_sys_tcsetpgrp): Renamed from s_setpgid,
s_setsid, s_ctermid, s_tcgetpgrp, s_tcsetpgrp, for consistency.
* posix.c (R_OK, W_OK, X_OK, F_OK): #define these if the system's
header files don't.
(scm_init_posix): Use them when initializing the Scheme constants
of the same name.
1996-09-03 04:43:15 +00:00
|
|
|
|
scm_sysintern ("R_OK", SCM_MAKINUM (R_OK));
|
|
|
|
|
|
scm_sysintern ("W_OK", SCM_MAKINUM (W_OK));
|
|
|
|
|
|
scm_sysintern ("X_OK", SCM_MAKINUM (X_OK));
|
|
|
|
|
|
scm_sysintern ("F_OK", SCM_MAKINUM (F_OK));
|
1996-07-25 22:56:11 +00:00
|
|
|
|
|
|
|
|
|
|
#ifdef LC_COLLATE
|
|
|
|
|
|
scm_sysintern ("LC_COLLATE", SCM_MAKINUM (LC_COLLATE));
|
|
|
|
|
|
#endif
|
|
|
|
|
|
#ifdef LC_CTYPE
|
|
|
|
|
|
scm_sysintern ("LC_CTYPE", SCM_MAKINUM (LC_CTYPE));
|
|
|
|
|
|
#endif
|
|
|
|
|
|
#ifdef LC_MONETARY
|
|
|
|
|
|
scm_sysintern ("LC_MONETARY", SCM_MAKINUM (LC_MONETARY));
|
|
|
|
|
|
#endif
|
|
|
|
|
|
#ifdef LC_NUMERIC
|
|
|
|
|
|
scm_sysintern ("LC_NUMERIC", SCM_MAKINUM (LC_NUMERIC));
|
|
|
|
|
|
#endif
|
|
|
|
|
|
#ifdef LC_TIME
|
|
|
|
|
|
scm_sysintern ("LC_TIME", SCM_MAKINUM (LC_TIME));
|
|
|
|
|
|
#endif
|
|
|
|
|
|
#ifdef LC_MESSAGES
|
|
|
|
|
|
scm_sysintern ("LC_MESSAGES", SCM_MAKINUM (LC_MESSAGES));
|
|
|
|
|
|
#endif
|
|
|
|
|
|
#ifdef LC_ALL
|
|
|
|
|
|
scm_sysintern ("LC_ALL", SCM_MAKINUM (LC_ALL));
|
|
|
|
|
|
#endif
|
|
|
|
|
|
#include "posix.x"
|
|
|
|
|
|
}
|