+2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
+
+ Merge from gnulib. This is for OpenBSD 5.1 amd64.
+ * m4/sys_time_h.m4: New version from gnulib, incorporating:
+ 2012-07-05 sys_time: allow too-wide tv_sec
+
2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
Merge from gnulib.
dnl (in <sys/time.h> and <winsock2.h> for mingw64, in <winsock2.h> only
dnl for MSVC) with a tv_sec field of type 'long' (32-bit!), which is
dnl smaller than the 'time_t' type mandated by POSIX.
- AC_CACHE_CHECK([for correct struct timeval.tv_sec member],
+ dnl On OpenBSD 5.1 amd64, tv_sec is 64 bits and time_t 32 bits, but
+ dnl that is good enough.
+ AC_CACHE_CHECK([for wide-enough struct timeval.tv_sec member],
[gl_cv_sys_struct_timeval_tv_sec],
[AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
#endif
]],
[[static struct timeval x;
- typedef int verify_tv_sec_type[sizeof (x.tv_sec) == sizeof (time_t) ? 1 : -1];
+ typedef int verify_tv_sec_type[
+ sizeof (time_t) <= sizeof x.tv_sec ? 1 : -1
+ ];
]])],
[gl_cv_sys_struct_timeval_tv_sec=yes],
[gl_cv_sys_struct_timeval_tv_sec=no])
+2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
+
+ Port to OpenBSD 5.1 amd64.
+ * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
+ This is needed for OpenBSD, and should be harmless on all BSD systems.
+ Also, include <sys/sysctl.h>, as it should be available on all
+ BSD_SYSTEM hosts given that we're already calling sysctl in that case.
+ (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
+ use p_pid member, not kp_proc.pid.
+
2012-07-06 Glenn Morris <rgm@gnu.org>
* Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
#include "sysselect.h"
#include "blockinput.h"
-#ifdef __FreeBSD__
+#ifdef BSD_SYSTEM
+#include <sys/param.h>
#include <sys/sysctl.h>
+#endif
+
+#ifdef __FreeBSD__
#include <sys/user.h>
#include <sys/resource.h>
#include <math.h>
#endif
-#ifdef DARWIN_OS
-#include <sys/sysctl.h>
-#endif
-
#ifdef WINDOWSNT
#define read sys_read
#define write sys_write
Lisp_Object
list_system_processes (void)
{
-#ifdef DARWIN_OS
+#if defined DARWIN_OS || defined __OpenBSD__
int mib[] = {CTL_KERN, KERN_PROC, KERN_PROC_ALL};
#else
int mib[] = {CTL_KERN, KERN_PROC, KERN_PROC_PROC};
{
#ifdef DARWIN_OS
proclist = Fcons (make_fixnum_or_float (procs[i].kp_proc.p_pid), proclist);
+#elif defined __OpenBSD__
+ proclist = Fcons (make_fixnum_or_float (procs[i].p_pid), proclist);
#else
proclist = Fcons (make_fixnum_or_float (procs[i].ki_pid), proclist);
#endif