1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-30 11:50:28 +02:00
Commit graph

78 commits

Author SHA1 Message Date
Thien-Thi Nguyen
cd53bd3668 Add tmpfile(3) to libguile.
* libguile/posix.c (scm_tmpfile): New primitive.
* libguile/posix.h (scm_tmpfile): New func decl.

* doc/ref/posix.texi (File System): Document `tmpfile'.
2010-06-15 23:06:00 +02:00
Ludovic Courtès
477e42195c Change occurrences of "filesystem" to "file system".
* doc/ref/posix.texi (File System): Change "filesystem" to "file
  system".

* libguile/posix.c (scm_utime): Ditto.
2010-05-28 17:02:13 +02:00
Ludovic Courtès
d2add8ae11 Remove misplaced tabs from the manual.
* doc/ref/posix.texi (Network Databases): Remove tabs from `getaddrinfo'
  example.

* .dir-locals.el: Set `indent-tabs-mode' to `t' for `texinfo-mode'.
2010-02-17 00:31:04 +01:00
Ludovic Courtès
55ae00ea73 Add `getaddrinfo' and related procedures.
* libguile/net_db.c (sym_getaddrinfo_error, sym_ai_passive,
  sym_ai_canonname, sym_ai_numerichost, sym_ai_numericserv,
  sym_ai_v4mapped, sym_ai_all, sym_ai_addrconfig, sym_eai_badflags,
  sym_eai_noname, sym_eai_again, sym_eai_fail, sym_eai_family,
  sym_eai_socktype, sym_eai_service, sym_eai_memory, sym_eai_system,
  sym_eai_overflow, sym_eai_nodata, sym_eai_addrfamily,
  sym_eai_inprogress, sym_eai_canceled, sym_eai_notcanceled,
  sym_eai_alldone, sym_eai_intr, sym_eai_idn_encode): New variables.
  (scm_from_addrinfo, scm_getaddrinfo, scm_gai_strerror): New functions.

* libguile/net_db.h (scm_getaddrinfo, scm_gai_strerror): New functions.

* module/ice-9/networking.scm (addrinfo:flags, addrinfo:fam,
  addrinfo:socktype, addrinfo:protocol, addrinfo:addr,
  addrinfo:canonname): New procedures.

* test-suite/tests/net-db.test: New file.

* test-suite/Makefile.am (SCM_TESTS): Add `tests/net-db.test'.

* doc/ref/posix.texi (Network Databases)[getaddrinfo]: New subsection.
  [The Host Database]: Suggest using `getaddrinfo'.
2010-02-14 20:56:47 +01:00
Andy Wingo
06bfe276c8 nanosecond timestamp support in stat and utime
* libguile/posix.h:
* libguile/posix.c (scm_utime): Add optional nanosecond arguments. This
  is an incompatible change on the C level, but it's unlikely people are
  using this POSIX wrapper function, because they would just use the
  POSIX function directly. Hopefully, anyway.

* module/system/base/compile.scm (call-with-output-file/atomic):
  Propagate source timestamps to targets with nanosecond precision, if
  available. Fixes build on systems with ext4 filesystems.

* libguile/filesys.c (scm_stat2scm):
* module/ice-9/posix.scm (stat:atimensec, stat:mtimensec)
  (stat:ctimensec): Add three new elements to Scheme stat structures,
  for nanosecond-level timestamps.

* configure.ac: Add checks for utimensat, and for nanosecond fields in
  struct stat. We should switch to using Gnulib things for these,
  though.

* doc/ref/posix.texi (File System): Add documentation for utime's
  additional arguments, and nanosecond stat timestamp accessors.
2010-01-17 16:56:34 +01:00
Neil Jerram
211a5b0425 Doc for getsid
* NEWS: Note new getsid primitive.

* doc/ref/posix.texi (Processes): Document getsid.
2009-12-27 18:44:41 +00:00
Ludovic Courtès
3452e6667f Deprecate inet-ntoa' and inet-aton'.
Suggested by Bruno Haible.

* libguile/inet_aton.c: Remove.

* libguile/Makefile.am (EXTRA_libguile_la_SOURCES): Remove
  `inet_aton.c'.

* libguile/deprecated.c (scm_inet_aton, scm_inet_ntoa): New functions.

* libguile/deprecated.h: Update accordingly.

* libguile/socket.c (scm_inet_aton, scm_inet_ntoa): Remove.

* doc/ref/posix.texi (Network Address Conversion): Mark `inet-ntoa' and
  `inet-aton' as deprecated.
2009-11-16 09:23:47 +01:00
Neil Jerram
187a43907f Fix doc for inet-ntop: always produces a string
Thanks to Scott McPeak for reporting this.

* libguile/socket.c (scm_inet_ntop): In docstring, add quotes around
  IPv6 address (+ reflow a bit).

* doc/ref/posix.texi (Network Address Conversion): Corresponding
  change.

* doc/maint/guile.texi: Corresponding change.
2009-10-01 23:38:57 +01:00
Neil Jerram
32bc92570e Fix incorrect doc mentions of INADDR_LOCALHOST
Thanks to Scott McPeak for reporting this.

* doc/ref/posix.texi (Network Sockets and Communication): Change
  INADDR_LOCALHOST to INADDR_LOOPBACK.
2009-10-01 22:27:41 +01:00
Neil Jerram
aba0dff5f7 In general, use @lisp in preference to @smalllisp
because it looks better in the DVI output.  Exceptions are

- wide examples, which would cause overfull hboxes if they
  used the bigger @lisp font

- very large examples, which may look too big at the @lisp size.
2009-08-09 15:04:08 +01:00
Neil Jerram
0ebbcf43c4 Remove AC_SYS_RESTARTABLE_SYSCALLS and related code
As the Autoconf documentation says, "These days portable programs
[...] should not rely on `HAVE_RESTARTABLE_SYSCALLS', since nowadays
whether a system call is restartable is a dynamic issue, not a
configuration-time issue."

In other words, if we ever rely on HAVE_RESTARTABLE_SYSCALLS, we are
at the mercy of any code that Guile happens to be linked with, because
that code could install a signal handler without the SA_RESTART flag,
and then a Guile system call could unexpectedly return EINTR.

The readline part of this goes back to this problem report:
http://sources.redhat.com/ml/guile/2000-05/msg00177.html; and is an
excellent example of the above paragraph.  It was noted during the
discussion that undefining HAVE_RESTARTABLE_SYSCALLS would fix the
problem, but that solution wasn't adopted - I guess because Guile was
still using cooperative threads then (not pthreads) and so there was a
significant concern (whether founded or not) that not using
restartable syscalls (where available) could lead to a loss of
performance.

Now Guile's default mode of operation is with pthreads, where we
already don't assume that HAVE_RESTARTABLE_SYSCALLS is reliable, so
there is no possible further performance loss.  And in any case we
really have no choice, if we want correct operation.

Thanks to Sylvain Beucler for reporting this and suggesting the fix.

* configure.in (AC_SYS_RESTARTABLE_SYSCALLS): Removed.

* doc/ref/posix.texi (Signals): Remove statement that Guile always
  sets SA_RESTART flag.

* guile-readline/configure.in (GUILE_SIGWINCH_SA_RESTART_CLEARED):
  Remove this setting, together with its test code.
  (HAVE_RL_PRE_INPUT_HOOK): Remove this setting and its code, as no
  longer needed.

* guile-readline/readline.c (sigwinch_enable_restart): Removed.
  (scm_init_readline): Remove setting of rl_pre_input_hook.

* libguile/_scm.h (SCM_SYSCALL): Remove the definition that relies on
  HAVE_RESTARTABLE_SYSCALLS.

* libguile/scmsigs.c (scm_sigaction_for_thread): Don't always set the
  SA_RESTART flag if available.  Update docstring accordingly.
  (scm_init_scmsigs): Remove code that sets SA_RESTART flag for all
  signals.

* THANKS: Add Sylvain.
2009-06-23 23:04:41 +01:00
Ludovic Courtès
f8c01b6f68 Fix strftime' documentation wrt. %Z'.
* doc/ref/posix.texi (Time)[strftime]: Remove erroneous note saying
  that `%Z' ignores `tm:zone'.  Reported by Neil Jerram.
2008-09-18 23:13:42 +02:00
Ludovic Courtès
69f23174d3 Use Gnulib's `strftime' to address bug #24130.
* libguile/stime.c (scm_strftime): Use `nstrftime ()' from Gnulib.
  This provides the same semantics on all platforms, thereby fixing
  bug #24130.

* doc/ref/posix.texi (Time): Remove note about non-portable `%Z'
  behavior.  Describe the new, portable behavior.

* test-suite/tests/time.test ("strftime")["strftime %Z doesn't return
  garbage"]: Reinstate.
  ["C99 %z format"](have-strftime-%z): Remove.
  ("GMT", "EST+5"): Don't use `have-strftime-%z'.
2008-09-02 21:58:58 +02:00
Neil Jerram
839e63263c Document file-exists? 2008-04-17 21:37:47 +01:00
Ludovic Courtès
41185bfe2a Changes from arch/CVS synchronization 2007-05-16 07:51:52 +00:00
Kevin Ryde
bf5df489e2 merge from 1.8 branch 2007-03-07 22:46:00 +00:00
Ludovic Courtès
a2f00b9b36 Changes from arch/CVS synchronization 2007-01-31 20:58:20 +00:00
Kevin Ryde
9a18d8d431 merge from 1.8 2007-01-15 23:22:36 +00:00
Ludovic Courtès
b89c494395 Changes from arch/CVS synchronization 2006-11-18 18:14:55 +00:00
Kevin Ryde
40296bab81 merge from 1.8 branch 2006-10-09 22:47:06 +00:00
Kevin Ryde
23f2b9a3de merge from 1.8 branch 2006-06-17 23:15:59 +00:00
Kevin Ryde
1b09b607dd merge from 1.8 branch 2006-04-16 23:18:55 +00:00
Kevin Ryde
99d1677605 (Network Address Conversion, Network Databases)
(Network Sockets and Communication, Internet Socket Examples): Misc
tweaks.
2006-02-04 01:00:57 +00:00
Kevin Ryde
20b988f88d (Time): In strftime, note systems vary for %Z. 2005-10-31 23:41:46 +00:00
Kevin Ryde
32ff73707c (Network Socket Address): Add scm_make_socket_address,
scm_c_make_socket_address, scm_from_sockaddr, scm_to_sockaddr.  This
change by Ludovic Courtès and revised a bit by me.
2005-10-28 23:00:19 +00:00
Kevin Ryde
13ed23db8e (Network Address Conversion): Move INADDR_ANY to here.
(Network Socket Address): New section, move sockaddr bits to here, add
new make-socket-address.
(Network Sockets and Communication): In connect, bind, and sendto, now
take socket address object.  In bind, leave INADDR constants for
"Network Address Conversion" node.  In those plus accept, getsockname,
getpeername, reword a bit for clarity.
2005-10-27 01:05:43 +00:00
Kevin Ryde
4b08cab6dd (Time): Revise strftime for clarity, cross reference man
3 strftime (suggested by Greg Troxel), note locale character set when
setlocale has been called.
2005-10-23 22:21:33 +00:00
Kevin Ryde
7381c1de51 Untabify 2005-10-23 21:57:08 +00:00
Kevin Ryde
8b6b6ce5ad (Network Sockets and Communication): Combine and revise
getsockopt and setsockopt.  Add OPTNAME constants, including new
IP_ADD_MEMBERSHIP and IP_DROP_MEMBERSHIP.
2005-10-23 21:50:41 +00:00
Kevin Ryde
0b0715f1b2 (File System): In tmpnam, clarify security and use of
O_EXCL.  In mkstemp!, in fact posix doesn't specify permissions.
2005-02-14 23:37:28 +00:00
Kevin Ryde
61fdb55797 (File System): In mkstemp!, in fact posix doesn't specify
the permissions mode.  Add an example setting 666 less umask.
2005-02-04 22:40:21 +00:00
Kevin Ryde
b0fb230659 (Time): In mktime, clarify fields of sbd-time used, and
the handling of tm:isdst.
2005-02-03 23:16:35 +00:00
Kevin Ryde
91f5e9f7ec (Signals): In sigaction, add SA_NOCLDSTOP, make it
clearer SA_RESTART is a variable.
2005-01-28 21:09:30 +00:00
Kevin Ryde
67bcd1103b (Ports and File Descriptors): In flock, for LOCK_NB note
logior for LOCK_NB and EWOULDBLOCK error, and note flock doesn't work
over NFS.
2005-01-19 23:32:44 +00:00
Kevin Ryde
2afd305b11 (User Information): Note cuserid gone from POSIX.
Prompted by Roland Besserer.
2005-01-13 23:18:09 +00:00
Kevin Ryde
f3dfb8acf8 Various further index entries. 2005-01-07 23:48:25 +00:00
Kevin Ryde
24ec486cf7 (File System): In mkstemp!, note 0600 creation mode. 2005-01-07 23:29:33 +00:00
Kevin Ryde
cb62d8e556 * posix.texi (Pipes): Expand and clarify a bit. Describe port
inheritance.  Caution against waitpid WAIT_ANY.
2005-01-01 23:54:46 +00:00
Marius Vollmer
7064e449bd Added open-pipe* and open-input-output-pipe. 2004-12-22 15:01:53 +00:00
Kevin Ryde
01357a75f0 (System Identification): Remove software-type, it doesn't
exist in the guile core.
2004-09-07 01:02:12 +00:00
Kevin Ryde
bdd46043c0 (Locales): Use @var for category arg. 2004-09-07 00:30:44 +00:00
Kevin Ryde
a8d0313f69 (Internet Socket Examples): Correction to socket calls,
should be PF_INET not AF_INET (though generally the two are the same
value).
2004-08-18 00:12:44 +00:00
Kevin Ryde
0bd094c2ad (Network Sockets and Communication): Add SOCK_RDM and SOCK_SEQPACKET. 2004-08-17 23:58:56 +00:00
Kevin Ryde
ef04832454 (Processes): Add setgroups. 2004-08-05 00:17:39 +00:00
Kevin Ryde
5982a8e012 (Conventions): Describe system-error args, use @defun for
system-error-errno instead of just words.
2004-08-05 00:02:23 +00:00
Marius Vollmer
3229f68b5a Big reorganization of the whole manual to give it a simpler structure. 2004-04-21 14:33:05 +00:00
Marius Vollmer
2da09c3fde Added Copyright notice. 2004-01-21 22:40:39 +00:00
Rob Browning
8141bd983d (Processes): add documentation for system*. 2003-11-19 21:39:35 +00:00
Kevin Ryde
158fab2b80 * posix.texi (Time): Correction to strftime glibc cross reference
node, now "Formatting Calendar Time".
2003-10-18 01:43:55 +00:00
Kevin Ryde
1cd9ea6915 A tweak to:
(File System): In access?, reword a bit, clarify real
versus effective ID handling, cross reference glibc on that, and
recommend against access tests in library functions.
2003-09-21 01:38:01 +00:00