[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: importing getloadavg from gnulib
From: |
Eli Zaretskii |
Subject: |
Re: importing getloadavg from gnulib |
Date: |
Tue, 08 Feb 2011 04:02:07 -0500 |
> Date: Mon, 07 Feb 2011 23:22:07 -0800
> From: Paul Eggert <address@hidden>
>
> Attached is a patch to have Emacs import getloadavg from gnulib
> instead of maintining its own special version. This has some
> porting and bugfix advantages (see ChangeLog entry below). I have
> not installed this yet, to give the Windows porters a heads-up.
Thanks. I cannot try the Windows build where I'm typing this, so the
below is based only on reading the diffs. Please take it with a grain
of salt, and apologies if I made wrong conclusions as result.
> After the ChangeLog entry below I have listed the most important
> changes in the patch. (Most of the full patch file is bzr overhead
> or autogenerated files.) If Windows ports are compiling getloadavg.c,
> they'll need to do so in the lib directory, not the src directory.
> I don't expect any of the new symbols in config.in need to be
> configured on Windows.
The Windows build has its own implementation of getloadavg, see
w32.c. So it does not compile src/getloadavg.c, and therefore does
not need the new gnulib stuff. However, this change in src/lisp.h:
> -#ifndef HAVE_GETLOADAVG
> -/* Defined in getloadavg.c */
> -extern int getloadavg (double *, int);
> -#endif
will cause the prototype of getloadavg to become unavailable in the
Windows build, because the Windows stdlib.h obviously does not declare
it. So I think we should leave the declaration in place for the
Windows build at the least.
The MS-DOS build does compile src/getloadavg.c, but the code for
MS-DOS there is a trivial stub (and remains as such in the new
version). So I can either change the MS-DOS build to use the new
version in lib/, or provide the same trivial stub in MS-DOS specific
source files, like Windows does. What would you suggest?
One question unrelated to DOS/Windows: it looks like we are adding
stdlib.h from gnulib for getloadavg's sake, but we get gobs of
unrelated stuff as a side effect. For example, the
*_CANONICALIZE_FILE_NAME macros, the *_UNSETENV macros, etc. -- these
aren't used anywhere in getloadavg.c, it seems, they are there just
because gnulib's stdlib.h needs them. This seems rather inelegant.
Isn't there a cleaner way of getting just getloadavg without all that
surplus?
- Re: importing getloadavg from gnulib, (continued)
- Re: importing getloadavg from gnulib, Dan Nicolaescu, 2011/02/08
- Re: importing getloadavg from gnulib, Andreas Schwab, 2011/02/08
- Re: importing getloadavg from gnulib, Paul Eggert, 2011/02/10
- Re: importing getloadavg from gnulib, Paul Eggert, 2011/02/15
- Re: importing getloadavg from gnulib, Eli Zaretskii, 2011/02/15
- Re: importing getloadavg from gnulib, Paul Eggert, 2011/02/15
- Re: importing getloadavg from gnulib, Eli Zaretskii, 2011/02/15
- Re: importing getloadavg from gnulib, Paul Eggert, 2011/02/15
- Re: importing getloadavg from gnulib, Paul Eggert, 2011/02/15
- Re: importing getloadavg from gnulib, Eli Zaretskii, 2011/02/16
Re: importing getloadavg from gnulib,
Eli Zaretskii <=