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

274 commits

Author SHA1 Message Date
Andy Wingo
4ea9429edc add getrlimit and setrlimit wrappers
* README: Some rewording.

* configure.in: Check for getrlimit and setrlimit.

* libguile/posix.h:
* libguile/posix.c: Add some getrlimit and setrlimit wrappers. They're
  documented, but I suspect something else has to be done to get them
  into the manual.
2009-03-27 15:06:41 -07:00
Ludovic Courtès
2a77682322 Use scm_gc malloc_pointerless ()' in scm_i allocate_string_pointers ()'.
* libguile/dynl.c (free_string_pointers): Remove.
  (scm_dynamic_args_call): Remove reference to `free_string_pointers ()'
  and remove dynwind.

* libguile/posix.c (free_string_pointers): Remove.
  (scm_execl, scm_execlp, scm_execle, scm_environ): Remove references
  to `free_string_pointers ()'.

* libguile/simpos.c (free_string_pointers): Remove.
  (scm_system_star): Remove reference to `free_string_pointers ()',
  remove enclosing dynwind.

* libguile/strings.c (scm_i_allocate_string_pointers): Use
  `scm_gc_malloc_pointerless ()' and `scm_gc_malloc ()'
  instead of `scm_malloc ()' and `scm_to_locale_string ()',
  so that the result is automatically GC'd when no longer
  referenced.  Remove unneeded dynwind.
  (scm_i_free_string_pointers): Remove.

* libguile/strings.h (scm_i_free_string_pointers): Remove declaration.
2009-01-18 16:02:04 +01:00
Ludovic Courtès
634aa8de8f Check the return value of libc's functions to make `_FORTIFY_SOURCE=2' work.
This fixes bug #24009 reported by Martin Pitt.

* libguile/threads.c (guilify_self_1): Check the return value of
  pipe(2).
  (scm_std_select): Use `full_read ()' instead of `read ()' when reading
  from WAKEUP_FD.

* libguile/async.c (scm_i_queue_async_cell): Use `full_write ()' instead
  of write(2) when writing to SLEEP_FD.

* libguile/fports.c (fport_flush): Likewise.

* libguile/posix.c (getgroups): Use the return value of getgroups(2) as
  NGROUPS.
  (scm_nice): Get the return value of nice(2) to make glibc happy.

* libguile/scmsigs.c (take_signal): Use `full_write ()' instead of
  write(2).
2008-11-30 18:43:41 +01:00
Ludovic Courtès
dbb605f575 Include <config.h> in all C files; use #ifdef HAVE_CONFIG_H' rather than #if'. 2008-09-13 15:35:27 +02:00
Ludovic Courtès
417566ebc9 Never define _GNU_SOURCE' explicitly since AC_USE_SYSTEM_EXTENSIONS'
takes care of it.

Conflicts:

	ChangeLog
	configure.in
	libguile/eval.c
	libguile/srfi-14.c
	libguile/threads.c
2008-08-20 19:31:46 +02:00
Ludovic Courtès
dbd1132b9c Changes from arch/CVS synchronization 2007-10-27 18:40:41 +00:00
Ludovic Courtès
8b0f07460a Changes from arch/CVS synchronization 2007-10-27 17:41:35 +00:00
Kevin Ryde
5b7ecf1b30 (scm_putenv): Confine the putenv("NAME=") bit to mingw, use
putenv("NAME") as the fallback everywhere else.  In particular this is
needed for solaris 9.  Reported by Frank Storbeck.
2007-09-11 00:46:15 +00:00
Ludovic Courtès
6caac03c93 Changes from arch/CVS synchronization 2007-07-29 14:58:21 +00:00
Ludovic Courtès
a1ef740636 Changes from arch/CVS synchronization 2007-06-07 08:36:13 +00:00
Ludovic Courtès
a2f00b9b36 Changes from arch/CVS synchronization 2007-01-31 20:58:20 +00:00
Kevin Ryde
23d7256628 merge from 1.8 2007-01-15 23:42:45 +00:00
Ludovic Courtès
b89c494395 Changes from arch/CVS synchronization 2006-11-18 18:14:55 +00:00
Kevin Ryde
8ab3d8a068 merge from 1.8 branch 2006-10-09 23:40:48 +00:00
Ludovic Courtès
a17d26545d Changes from arch/CVS synchronization 2006-09-20 12:48:45 +00:00
Kevin Ryde
23f2b9a3de merge from 1.8 branch 2006-06-17 23:15:59 +00:00
Kevin Ryde
2b829bbb3d merge from 1.8 branch 2006-04-17 00:05:42 +00:00
Marius Vollmer
661ae7ab6b Renamed the "frames" that are related to dynamic-wind to "dynamic
contexts.  Renamed all functions from scm_frame_ to scm_dynwind_.
Updated documentation.
2006-01-29 00:23:28 +00:00
Marius Vollmer
92205699d0 The FSF has a new address. 2005-05-23 19:57:22 +00:00
Marius Vollmer
9de87eea47 See ChangeLog from 2005-03-02. 2005-03-02 20:42:01 +00:00
Marius Vollmer
76da80e788 Reverted changed from 2005/01/24 19:14:54, which was a commit to the
wrong branch.  Sorry.
2005-01-24 23:41:14 +00:00
Marius Vollmer
a54a94b397 Threading changes. 2005-01-24 19:14:54 +00:00
Kevin Ryde
0b91f1db7a (scm_flock): Update docstring from manual. 2005-01-23 22:09:14 +00:00
Kevin Ryde
41b74b7dbb (scm_setlocale): Force errno=EINVAL for an error, since
POSIX and C99 don't document errno being set.  Reported by Bruno
Haible.
2005-01-23 21:59:09 +00:00
Kevin Ryde
2c4cdcb06c (scm_mkstemp): Update docstring from manual. 2005-01-09 22:23:14 +00:00
Marius Vollmer
4057a3e05a Use new vector elements API or simple vector API, as appropriate.
Removed SCM_HAVE_ARRAYS ifdefery.  Replaced all uses of
SCM_HASHTABLE_BUCKETS with SCM_HASHTABLE_BUCKET.
2005-01-02 20:49:04 +00:00
Marius Vollmer
9361f7621b * i18n.c: Handle --disable-nls (thanks Bruno).
* posix.c (scm_init_posix): Add LC_PAPER, LC_NAME, LC_ADDRESS,
LC_TELEPHONE, LC_MEASUREMENT, LC_IDENTIFICATION.

* i18n.c (scm_i_to_lc_category): New name and export.  Support all
LC categories.

* posix.c (s_scm_setlocale): Use it.

* i18n.h, i18n.c (scm_textdomain, scm_bindtextdomain,
scm_bind_textdomain_codeset): Make wrappers similar to C function
they wrap.

* i18n.h: New file.
* i18n.c: New file.
* gettext.h: New file, taken from GNU gettext.
* init.c: Include libguile/i18n.h.
(scm_init_guile_1): Add call to scm_init_i18n().
* Makefile.am (libguile_la_SOURCES): Add i18n.c.
(DOT_X_FILES): Add i18n.x.
(DOT_DOC_FILES): Add i18n.doc.
(libguile_la_LDFLAGS): Add @LTLIBINTL@.
(modinclude_HEADERS): Add i18n.h.
2004-09-22 21:54:50 +00:00
Kevin Ryde
20e0b1661a (scm_access): Update docstring per manual. 2004-09-07 00:26:48 +00:00
Kevin Ryde
f1c82f55b9 (scm_nice): Correction to error detection. Reported by
Matthias Koeppe.
2004-09-07 00:06:18 +00:00
Stefan Jahn
edea856ce5 2004-09-03 Stefan Jahn <stefan@lkcc.org>
* configure.in (isinf): Let configure find the isinf() function
        on MinGW32 systems.

2004-09-03  Stefan Jahn  <stefan@lkcc.org>

        * threads.c (scm_threads_mark_stacks):  Fixed local variable
        definitions.

        * strings.c (scm_i_substring_copy, s_scm_string_append): Fixed
        local variable definitions.

        * stime.c (_POSIX_C_SOURCE):  Do not define this item on
        MinGW32 because it conflicts with its pthread headers.
        (s_scm_mktime): Consider the HAVE_STRUCT_TM_TM_ZONE define.
        (s_scm_strftime): Using scm_from_locale_string() instead of
        scm_makfrom0str().

        * posix.c (s_scm_putenv): Fixed typo in the !HAVE_UNSETENV
        part.

        * numbers.c (scm_init_numbers): Removed check_sanity() call
        inside GUILE_DEBUG.  The function has been removed somewhen...

        * filesys.c (_POSIX_C_SOURCE): Do not define this item on
        MinGW32 because it conflicts with its pthread headers.

2004-09-03  Stefan Jahn  <stefan@lkcc.org>

        * srfi-1.c, srfi-1.h: Renamed any 'lst1' into 'list1' because
        lst1 is a #define on Win32 systems.
2004-09-03 19:45:37 +00:00
Marius Vollmer
c44ca4fe75 Include "srfi-13.h" instead of "strop.h". 2004-08-24 22:12:37 +00:00
Marius Vollmer
892065da6c (scm_mkstemp): Correction to the correction, mkstemp expects a
null-terminated string in the locale encoding, but
scm_i_string_writable_chars doesn't give that.  Fixed by letting
mkstemp modify a locale version of the tmpl argument and copying the
result back into tmpl.
2004-08-20 12:25:20 +00:00
Kevin Ryde
71978ac9f6 (scm_mkstemp): Correction to new locale_string stuff, need
to modify the input string.
2004-08-20 01:32:36 +00:00
Marius Vollmer
cc95e00ac6 * strings.h, strings.c: (scm_i_string_chars, scm_i_string_length,
scm_i_string_writable_chars, scm_i_string_stop_writing): New, to
replace SCM_I_STRING_CHARS and SCM_I_STRING_LENGTH.  Updated all
uses.
(scm_i_make_string, scm_c_make_string): New, to replace
scm_allocate_string.  Updated all uses.
(SCM_STRINGP, SCM_STRING_CHARS, SCM_STRING_UCHARS,
SCM_STRING_LENGTH): Deprecated.
(scm_allocate_string, scm_take_str, scm_take0str, scm_mem2string,
scm_str2string, scm_makfrom0str, scm_makfrom0str_opt):
Discouraged.  Replaced all uses with scm_from_locale_string or
similar, as appropriate.
(scm_c_string_length, scm_c_string_ref, scm_c_string_set_x,
scm_c_substring, scm_c_substring_shared, scm_c_substring_copy,
scm_substring_shared, scm_substring_copy): New.

* symbols.c, symbols.h (SCM_SYMBOLP, SCM_SYMBOL_FUNC,
SCM_SET_SYMBOL_FUNC, SCM_SYMBOL_PROPS, SCM_SET_SYMBOL_PROPS,
SCM_SYMBOL_HASH, SCM_SYMBOL_INTERNED_P, scm_mem2symbol,
scm_str2symbol, scm_mem2uninterned_symbol): Discouraged.
(SCM_SYMBOL_LENGTH, SCM_SYMBOL_CHARS, scm_c_symbol2str):
Deprecated.
(SCM_MAKE_SYMBOL_TAG, SCM_SET_SYMBOL_LENGTH, SCM_SET_SYMBOL_CHARS,
SCM_PROP_SLOTS, SCM_SET_PROP_SLOTS): Removed.
(scm_is_symbol, scm_from_locale_symbol, scm_from_locale_symboln):
New, to replace scm_str2symbol and scm_mem2symbol, respectively.
Updated all uses.
(scm_gensym): Generate only the number suffix in the buffer, just
string-append the prefix.
2004-08-19 17:19:44 +00:00
Marius Vollmer
f015614ae0 (WITH_STRING): New helper macro. Use it where one
locale string is needed for a short piece of code.
(STRING_SYSCALL): New helper macro.  Use it instead of SCM_SYSCALL
when one locale string is needed.
(scm_mkstemp): Convert tmpl to a locale string.
(scm_putenv): Rewritten to use only C strings.
(scm_setlocale, scm_crpt): Convert argument strings to locale
strings.
2004-08-12 17:28:06 +00:00
Marius Vollmer
7f03f97036 * procs.c, posix.c, ports.c, net_db.c, fports.c, filesys.c,
eval.c, deprecation.c, dynl.c: Replaced uses of SCM_STRING_CHARS
with proper uses of scm_to_locale_string.  Replaced SCM_STRINGP
with scm_is_string.

* posix.c (allocate_string_pointers, environ_list_to_c): Removed,
replaced all uses with scm_i_allocate_string_pointers.
2004-08-10 13:54:16 +00:00
Kevin Ryde
fcc3adc2f9 (scm_setgroups): Enhance docstring, per doc/ref/posix.texi. 2004-08-05 00:19:14 +00:00
Marius Vollmer
b9bd8526f0 * numbers.h, numbers.c, discouraged.h, discouraged.c (scm_short2num,
scm_ushort2num, scm_int2num, scm_uint2num, scm_long2num,
scm_ulong2num, scm_size2num, scm_ptrdiff2num, scm_num2short,
scm_num2ushort, scm_num2int, scm_num2uint, scm_num2long,
scm_num2ulong, scm_num2size, scm_num2ptrdiff, scm_long_long2num,
scm_ulong_long2num, scm_num2long_long, scm_num2ulong_long):
Discouraged by moving to discouraged.h and discouraged.c and
reimplementing in terms of scm_from_* and scm_to_*.  Changed all uses
to the new scm_from_* and scm_to_* functions.
2004-08-02 16:14:04 +00:00
Kevin Ryde
e8a590639c (scm_ttyname): Use scm_i_misc_mutex for thread safety. 2004-07-29 00:12:25 +00:00
Kevin Ryde
0a9d83b0f4 (scm_ctermid): Use an L_ctermid buf on the stack, for thread safety. 2004-07-27 23:10:35 +00:00
Kevin Ryde
33bea692e5 * threads.c, threads.h (scm_i_misc_mutex): New SCM_GLOBAL_MUTEX.
* posix.c (scm_crypt): Use it to protect static data in crypt().
2004-07-23 23:52:55 +00:00
Marius Vollmer
e11e83f3d9 * deprecated.h, deprecated.c, numbers.h (SCM_INUMP, SCM_NINUMP,
SCM_INUM): Deprecated by reenaming them to SCM_I_INUMP, SCM_I_NINUMP
and SCM_I_INUM, respectively and adding deprecated versions to
deprecated.h and deprecated.c.  Changed all uses to either use the
SCM_I_ variants or scm_is_*, scm_to_*, or scm_from_*, as appropriate.
2004-07-23 15:43:02 +00:00
Marius Vollmer
a55c2b6809 * validate.h, deprecated.h (SCM_VALIDATE_INUM, SCM_VALIDATE_INUM_COPY,
SCM_VALIDATE_BIGINT, SCM_VALIDATE_INUM_MIN,
SCM_VALIDATE_INUM_MIN_COPY,
SCM_VALIDATE_INUM_MIN_DEF_COPY,SCM_VALIDATE_INUM_DEF,
SCM_VALIDATE_INUM_DEF_COPY, SCM_VALIDATE_INUM_RANGE,
SCM_VALIDATE_INUM_RANGE_COPY): Deprecated because they make the
fixnum/bignum distinction visible.  Changed all uses to scm_to_size_t
or similar.
2004-07-10 14:35:36 +00:00
Marius Vollmer
93ccaef0c6 * numbers.h (SCM_MAKINUM, SCM_I_MAKINUM): Renamed SCM_MAKINUM to
SCM_I_MAKINUM and changed all uses.
2004-07-08 15:58:11 +00:00
Marius Vollmer
7888309be8 * deprecated.h, boolean.h (SCM_FALSEP, SCM_NFALSEP, SCM_BOOL,
SCM_NEGATE_BOOL, SCM_BOOLP): Deprecated by moving into "deprecated.h".
Replaced all uses with scm_is_false, scm_is_true, scm_from_bool, and
scm_is_bool, respectively.
2004-07-06 10:59:25 +00:00
Dirk Herrmann
b28f5b3cb2 * posix.c (scm_gethostname): Make sure len is initialised before
it is used.  Restructured to (hopefully) represent possible
	configurations more clearly in the code.  Added unwind handler.
2004-03-24 00:49:07 +00:00
Kevin Ryde
0eaf105588 (scm_gethostname): Use sysconf(_SC_HOST_NAME_MAX) and/or
MAXHOSTNAMELEN when available.
2004-03-22 23:41:30 +00:00
Kevin Ryde
228651245d * posix.c (scm_gethostname): Preserve errno across free() call. 2004-03-19 23:17:00 +00:00
Kevin Ryde
807f353fed (scm_execl, scm_execlp, scm_execle): Avoid memory leak under error throw. 2004-02-28 19:16:26 +00:00
Kevin Ryde
1b317eb196 (scm_cuserid): Use a private result buffer, for thread safe. 2004-02-23 22:05:37 +00:00