On Thu, 06 Jul 2006 09:53:57 +0900, YAMAMOTO Mitsuharu [EMAIL
PROTECTED] said:
I've once posted a (not complete) list of Darwin library functions
that may call malloc-related functions but are not protected by
BLOCK_INPUT:
localtime, gmtime, ctime, opendir, getc, getaddrinfo, fwrite,
mkstemp fclose, closedir, freeaddrinfo, mktime (not used as of
2004-09)
(http://lists.gnu.org/archive/html/emacs-devel/2004-09/msg00074.html)
I cannot detect `getgrgid' as such a function, but I guess this is
due to the difference in name service backends (NIS, LDAP, ...).
Sorry, I could. So it has nothing to do with the type of backends.
Also, I found that getpwuid/getpwnam/getgrgid in both glibc and
FreeBSD libc called malloc-related functions. So I think it's
reasonable to put BLOCK_INPUTs around them. Objections?
YAMAMOTO Mitsuharu
[EMAIL PROTECTED]
Index: src/Makefile.in
===
RCS file: /cvsroot/emacs/emacs/src/Makefile.in,v
retrieving revision 1.327
diff -c -p -r1.327 Makefile.in
*** src/Makefile.in 18 May 2006 17:05:36 - 1.327
--- src/Makefile.in 8 Jul 2006 05:30:06 -
*** pre-crt0.o: pre-crt0.c
*** 1108,1114
ecrt0.o: ecrt0.c $(config_h)
CRT0_COMPILE ${srcdir}/ecrt0.c
dired.o: dired.c commands.h buffer.h $(config_h) charset.h coding.h regex.h \
!systime.h
dispnew.o: dispnew.c systty.h systime.h commands.h process.h frame.h \
window.h buffer.h dispextern.h termchar.h termopts.h termhooks.h cm.h \
disptab.h indent.h intervals.h \
--- 1108,1114
ecrt0.o: ecrt0.c $(config_h)
CRT0_COMPILE ${srcdir}/ecrt0.c
dired.o: dired.c commands.h buffer.h $(config_h) charset.h coding.h regex.h \
!systime.h blockinput.h
dispnew.o: dispnew.c systty.h systime.h commands.h process.h frame.h \
window.h buffer.h dispextern.h termchar.h termopts.h termhooks.h cm.h \
disptab.h indent.h intervals.h \
*** doprnt.o: doprnt.c charset.h $(config_h)
*** 1119,1130
dosfns.o: buffer.h termchar.h termhooks.h frame.h blockinput.h window.h \
msdos.h dosfns.h dispextern.h charset.h coding.h $(config_h)
editfns.o: editfns.c window.h buffer.h systime.h $(INTERVAL_SRC) charset.h \
!coding.h dispextern.h frame.h $(config_h)
emacs.o: emacs.c commands.h systty.h syssignal.h blockinput.h process.h \
termhooks.h buffer.h atimer.h systime.h $(INTERVAL_SRC) $(config_h) \
window.h dispextern.h keyboard.h keymap.h
fileio.o: fileio.c window.h buffer.h systime.h $(INTERVAL_SRC) charset.h \
!coding.h msdos.h dispextern.h $(config_h)
filelock.o: filelock.c buffer.h charset.h coding.h systime.h epaths.h
$(config_h)
filemode.o: filemode.c $(config_h)
frame.o: frame.c xterm.h window.h frame.h termhooks.h commands.h keyboard.h \
--- 1119,1130
dosfns.o: buffer.h termchar.h termhooks.h frame.h blockinput.h window.h \
msdos.h dosfns.h dispextern.h charset.h coding.h $(config_h)
editfns.o: editfns.c window.h buffer.h systime.h $(INTERVAL_SRC) charset.h \
!coding.h dispextern.h frame.h blockinput.h $(config_h)
emacs.o: emacs.c commands.h systty.h syssignal.h blockinput.h process.h \
termhooks.h buffer.h atimer.h systime.h $(INTERVAL_SRC) $(config_h) \
window.h dispextern.h keyboard.h keymap.h
fileio.o: fileio.c window.h buffer.h systime.h $(INTERVAL_SRC) charset.h \
!coding.h msdos.h dispextern.h blockinput.h $(config_h)
filelock.o: filelock.c buffer.h charset.h coding.h systime.h epaths.h
$(config_h)
filemode.o: filemode.c $(config_h)
frame.o: frame.c xterm.h window.h frame.h termhooks.h commands.h keyboard.h \
Index: src/dired.c
===
RCS file: /cvsroot/emacs/emacs/src/dired.c,v
retrieving revision 1.123
diff -c -p -r1.123 dired.c
*** src/dired.c 24 Jun 2006 07:24:42 - 1.123
--- src/dired.c 8 Jul 2006 05:30:06 -
*** extern struct direct *readdir ();
*** 99,104
--- 99,105
#include charset.h
#include coding.h
#include regex.h
+ #include blockinput.h
/* Returns a search buffer, with a fastmap allocated and ready to go. */
extern struct re_pattern_buffer *compile_pattern ();
*** Elements of the attribute list are:
*** 951,960
--- 952,963
}
else
{
+ BLOCK_INPUT;
pw = (struct passwd *) getpwuid (s.st_uid);
values[2] = (pw ? build_string (pw-pw_name) : make_number (s.st_uid));
gr = (struct group *) getgrgid (s.st_gid);
values[3] = (gr ? build_string (gr-gr_name) : make_number (s.st_gid));
+ UNBLOCK_INPUT;
}
values[4] = make_time (s.st_atime);
values[5] = make_time (s.st_mtime);
Index: src/editfns.c
===
RCS file: /cvsroot/emacs/emacs/src/editfns.c,v
retrieving revision