1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-27 12:41:57 +03:00

Remove configure probe for sys/resource.h and refactor.

<sys/resource.h> is in SUSv2 and is on all targeted Unix systems.  We
have a replacement for getrusage() on Windows, so let's just move its
declarations into src/include/port/win32/sys/resource.h so that we can
use a standard-looking #include.  Also remove an obsolete reference to
CLK_TCK.  Also rename src/port/getrusage.c to win32getrusage.c,
following the convention for Windows-only fallback code.

Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://postgr.es/m/CA%2BhUKG%2BL_3brvh%3D8e0BW_VfX9h7MtwgN%3DnFHP5o7X2oZucY9dg%40mail.gmail.com
This commit is contained in:
Thomas Munro
2022-08-13 23:35:24 +12:00
parent 37a65d1db1
commit 36b3d52459
16 changed files with 42 additions and 89 deletions

14
configure vendored
View File

@ -13874,7 +13874,7 @@ $as_echo "#define HAVE_STDBOOL_H 1" >>confdefs.h
fi
for ac_header in atomic.h copyfile.h execinfo.h getopt.h ifaddrs.h langinfo.h mbarrier.h net/if.h netinet/tcp.h sys/epoll.h sys/event.h sys/personality.h sys/prctl.h sys/procctl.h sys/resource.h sys/signalfd.h sys/sockio.h sys/ucred.h termios.h ucred.h
for ac_header in atomic.h copyfile.h execinfo.h getopt.h ifaddrs.h langinfo.h mbarrier.h net/if.h netinet/tcp.h sys/epoll.h sys/event.h sys/personality.h sys/prctl.h sys/procctl.h sys/signalfd.h sys/sockio.h sys/ucred.h termios.h ucred.h
do :
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
@ -16734,12 +16734,6 @@ done
;;
esac
case " $LIBOBJS " in
*" getrusage.$ac_objext "* ) ;;
*) LIBOBJS="$LIBOBJS getrusage.$ac_objext"
;;
esac
case " $LIBOBJS " in
*" kill.$ac_objext "* ) ;;
*) LIBOBJS="$LIBOBJS kill.$ac_objext"
@ -16782,6 +16776,12 @@ esac
;;
esac
case " $LIBOBJS " in
*" win32getrusage.$ac_objext "* ) ;;
*) LIBOBJS="$LIBOBJS win32getrusage.$ac_objext"
;;
esac
case " $LIBOBJS " in
*" win32link.$ac_objext "* ) ;;
*) LIBOBJS="$LIBOBJS win32link.$ac_objext"