From: Paul Eggert Date: Fri, 6 Jul 2012 03:08:57 +0000 (+0000) Subject: Port to OpenBSD 5.1 amd64. X-Git-Tag: emacs-24.2.90~1199^2~196 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=7dca65a4b4ff280171df473557d5fc0f98540200;p=emacs.git Port to OpenBSD 5.1 amd64. --- diff --git a/ChangeLog b/ChangeLog index ce247c84122..500c14ef823 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2012-07-06 Paul Eggert + + 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 Merge from gnulib. diff --git a/m4/sys_time_h.m4 b/m4/sys_time_h.m4 index 26eaf8ea7f3..c4a30cda777 100644 --- a/m4/sys_time_h.m4 +++ b/m4/sys_time_h.m4 @@ -52,7 +52,9 @@ AC_DEFUN([gl_HEADER_SYS_TIME_H_BODY], dnl (in and for mingw64, in 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( @@ -65,7 +67,9 @@ AC_DEFUN([gl_HEADER_SYS_TIME_H_BODY], #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]) diff --git a/src/ChangeLog b/src/ChangeLog index 7189f930333..af51c9a100a 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,13 @@ +2012-07-06 Paul Eggert + + Port to OpenBSD 5.1 amd64. + * sysdep.c [BSD_SYSTEM]: Include before . + This is needed for OpenBSD, and should be harmless on all BSD systems. + Also, include , 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 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows. diff --git a/src/sysdep.c b/src/sysdep.c index 7a4fa9aa5f7..63bf680f17f 100644 --- a/src/sysdep.c +++ b/src/sysdep.c @@ -38,17 +38,17 @@ along with GNU Emacs. If not, see . */ #include "sysselect.h" #include "blockinput.h" -#ifdef __FreeBSD__ +#ifdef BSD_SYSTEM +#include #include +#endif + +#ifdef __FreeBSD__ #include #include #include #endif -#ifdef DARWIN_OS -#include -#endif - #ifdef WINDOWSNT #define read sys_read #define write sys_write @@ -2520,7 +2520,7 @@ list_system_processes (void) 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}; @@ -2548,6 +2548,8 @@ list_system_processes (void) { #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