source: rtems/aclocal/sysv-ipc.m4 @ 613ab62

4.104.114.84.95
Last change on this file since 613ab62 was 613ab62, checked in by Joel Sherrill <joel.sherrill@…>, on 07/23/98 at 19:39:25

Patch from Dario Alcocer <alcocer@…> and Ralf Corsepius
<corsepiu@…> which attempts to detect when the UNIX port
is being configured on a system without System V IPC support. This
is an optional component on both FreeBSD and Linux systems. Most
Linux 2.x kernels ship with it enabled but it is still a real risk.

This test may have undesirable side-effects on some hosts. We will
address those conflicts as they arise.

  • Property mode set to 100644
File size: 2.1 KB
Line 
1dnl
2dnl $Id$
3dnl
4dnl Check for System V IPC calls used by Unix simulators
5dnl
6dnl 98/07/17 Dario Alcocer     alcocer@netcom.com
7dnl          Ralf Corsepius    corsepiu@faw.uni-ulm.de
8dnl
9dnl Note: $host_os should probably *not* ever be used here to
10dnl determine if host supports System V IPC calls, since some
11dnl (e.g. FreeBSD 2.x) are configured by default to include only
12dnl a subset of the System V IPC calls.  Therefore, to make sure
13dnl all of the required calls are found, test for each call explicitly.
14dnl
15dnl All of the calls use IPC_PRIVATE, so tests will not unintentionally
16dnl modify any existing key sets.  See the man pages for semget, shmget,
17dnl msgget, semctl, shmctl and msgctl for details.
18
19AC_DEFUN(RTEMS_SYSV_SEM,
20[AC_REQUIRE([RTEMS_PROG_CC])
21AC_REQUIRE([AC_CANONICAL_HOST])
22AC_CACHE_CHECK(whether $RTEMS_HOST supports System V semaphores,
23rtems_cv_sysv_sem,
24[
25AC_TRY_RUN([
26#include <sys/types.h>
27#include <sys/ipc.h>
28#include <sys/sem.h>
29int main () {
30  union semun arg ;
31  int id=semget(IPC_PRIVATE,1,IPC_CREAT|0400);
32  if (id == -1)
33    exit(1);
34  arg.val = 0; /* avoid implicit type cast to union */
35  if (semctl(id, 0, IPC_RMID, arg) == -1)
36    exit(1);
37  exit(0);
38}
39],
40rtems_cv_sysv_sem="yes", rtems_cv_sysv_sem="no", :)
41])
42])
43
44AC_DEFUN(RTEMS_SYSV_SHM,
45[AC_REQUIRE([RTEMS_PROG_CC])
46AC_REQUIRE([AC_CANONICAL_HOST])
47AC_CACHE_CHECK(whether $RTEMS_HOST supports System V shared memory,
48rtems_cv_sysv_shm,
49[
50AC_TRY_RUN([
51#include <sys/types.h>
52#include <sys/ipc.h>
53#include <sys/shm.h>
54int main () {
55  int id=shmget(IPC_PRIVATE,1,IPC_CREAT|0400);
56  if (id == -1)
57    exit(1);
58  if (shmctl(id, IPC_RMID, 0) == -1)
59    exit(1);
60  exit(0);
61}
62],
63rtems_cv_sysv_shm="yes", rtems_cv_sysv_shm="no", :)
64])
65])
66
67AC_DEFUN(RTEMS_SYSV_MSG,
68[AC_REQUIRE([RTEMS_PROG_CC])
69AC_REQUIRE([AC_CANONICAL_HOST])
70AC_CACHE_CHECK(whether $RTEMS_HOST supports System V messages,
71rtems_cv_sysv_msg,
72[
73AC_TRY_RUN([
74#include <sys/types.h>
75#include <sys/ipc.h>
76#include <sys/msg.h>
77int main () {
78  int id=msgget(IPC_PRIVATE,IPC_CREAT|0400);
79  if (id == -1)
80    exit(1);
81  if (msgctl(id, IPC_RMID, 0) == -1)
82    exit(1);
83  exit(0);
84}
85],
86rtems_cv_sysv_msg="yes", rtems_cv_sysv_msg="no", :)
87])
88])
Note: See TracBrowser for help on using the repository browser.