pbs_decl_epoll_pwait.m4 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. #
  2. # Copyright (C) 1994-2018 Altair Engineering, Inc.
  3. # For more information, contact Altair at www.altair.com.
  4. #
  5. # This file is part of the PBS Professional ("PBS Pro") software.
  6. #
  7. # Open Source License Information:
  8. #
  9. # PBS Pro is free software. You can redistribute it and/or modify it under the
  10. # terms of the GNU Affero General Public License as published by the Free
  11. # Software Foundation, either version 3 of the License, or (at your option) any
  12. # later version.
  13. #
  14. # PBS Pro is distributed in the hope that it will be useful, but WITHOUT ANY
  15. # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  16. # FOR A PARTICULAR PURPOSE.
  17. # See the GNU Affero General Public License for more details.
  18. #
  19. # You should have received a copy of the GNU Affero General Public License
  20. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  21. #
  22. # Commercial License Information:
  23. #
  24. # For a copy of the commercial license terms and conditions,
  25. # go to: (http://www.pbspro.com/UserArea/agreement.html)
  26. # or contact the Altair Legal Department.
  27. #
  28. # Altair’s dual-license business model allows companies, individuals, and
  29. # organizations to create proprietary derivative works of PBS Pro and
  30. # distribute them - whether embedded or bundled with other software -
  31. # under a commercial license agreement.
  32. #
  33. # Use of Altair’s trademarks, including but not limited to "PBS™",
  34. # "PBS Professional®", and "PBS Pro™" and Altair’s logos is subject to Altair's
  35. # trademark licensing policies.
  36. #
  37. #
  38. # Prefix the macro names with PBS_ so they don't conflict with
  39. # Python definitions
  40. #
  41. AC_DEFUN([PBS_AC_DECL_EPOLL_PWAIT],
  42. [
  43. AS_CASE([x$target_os],
  44. [xlinux*],
  45. AC_MSG_CHECKING(whether epoll_pwait system call is supported)
  46. AC_TRY_RUN([
  47. #include <unistd.h>
  48. #include <poll.h>
  49. #include <signal.h>
  50. #include <stdio.h>
  51. #include <errno.h>
  52. #include <sys/epoll.h>
  53. int main()
  54. {
  55. sigset_t allsigs;
  56. int n;
  57. int maxevents = 1;
  58. int timeout = 0;
  59. int epollfd;
  60. struct epoll_event events;
  61. sigemptyset(&allsigs);
  62. events.events = EPOLLIN;
  63. epollfd = epoll_create1(0);
  64. if (epollfd == -1) {
  65. perror("epoll_create1");
  66. return (1);
  67. }
  68. n = epoll_pwait(epollfd, &events, maxevents, timeout, &allsigs);
  69. return (n);
  70. }],
  71. AC_DEFINE([PBS_HAVE_EPOLL_PWAIT], [],
  72. [Defined when epoll_pwait is available])
  73. AC_MSG_RESULT([yes]),
  74. AC_MSG_RESULT([no])
  75. )
  76. )
  77. ])