* filesys.c (scm_chown): use SCM_FPORT_FDES.
authorJim Blandy <jimb@red-bean.com>
Wed, 9 Jun 1999 12:17:38 +0000 (12:17 +0000)
committerJim Blandy <jimb@red-bean.com>
Wed, 9 Jun 1999 12:17:38 +0000 (12:17 +0000)
commit77a76b643dc52431f18ca6d0e1e5c740ad3a9f1d
treef38e8f11d69a673038953e72c3d01f84fe7ab620
parent156ecad591a08593629c4215b8122b7e143bef24
* filesys.c (scm_chown): use SCM_FPORT_FDES.
(scm_chmod, scm_stat, scm_truncate_file: likewise.
* fports.c (scm_fdes_to_port), ports.c (scm_void_port),
filesys.c (scm_opendir):
restore defer interrupts while the port is constructed.
* (scm_setvbuf): if mode is _IOFBF and size is not supplied,
derive buffer size from fdes or use a default.
(scm_fdes_to_port): use setvbuf instead of creating the buffers
directly.
* filesys.c (scm_fsync): use SCM_FDES.
* filesys.c (scm_fcntl): get fdes from fport.
(set_element, get_element): likewise.
* filesys.c (scm_open): adjust port_mode for O_APPEND and O_CREAT.
ports.c fports.c ioext.c posix.c socket.c net_db.c filesys.c:
removed all uses of SCM_DEFER/ALLOW ints for now.  they were mainly
just protecting errno.  some may need to be put back.
* * ports.c (scm_drain_input): new procedure.
ports.h: prototype.
* fports.c (FPORT_READ_SAFE, FPORT_WRITE_SAFE, FPORT_ALL_OKAY,
pre_read, pre_write): removed.
(local_fputc, local_fputs, local_ffwrite): use write, not stdio.
(scm_standard_stream_to_port): change first arg from FILE * to
int fdes.
(local_fflush): flush fdes, not FILE *.
* fports.h (SCM_NOFTELL): removed.
* genio.c, ports.c: don't include filesys.h.
* genio.c (scm_getc): don't use scm_internal_select if FPORT.
do it in fports.c:local_fgetc.
* genio.c: don't use SCM_SYSCALL when calling ptob procedures.
do it where it's needed in the port smobs.
* filesys.c (scm_input_waiting_p): moved to fports.c, stdio
  buffer support removed.  take SCM arg, not FILE *.
* filesys.h: prototype moved too.
* fports.c (scm_fdes_to_port): new procedure.
(local_fgetc): use read not fgetc.
(local_fclose): use close, not fclose.
(local_fgets): use read, not fgets
* fports.h: prototype for scm_fdes_to_port.
* fports.h (scm_fport): new struct.
* fports.c (scm_open_file): use open, not fopen.
#include fcntl.h
* ports.h (struct scm_port_table): change stream from SCM to void *.
* ports.c (scm_add_to_port_table): check for memory allocation error.
(scm_prinport): remove MSDOS hair.
(scm_void_port): set stream to 0 instead of SCM_BOOL_F.
(scm_close_port): don't throw errors: do it in fports.c.
libguile/filesys.c