bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Build breakage due to missing semaphore.h on z/OS


From: Daniel Richard G.
Subject: Build breakage due to missing semaphore.h on z/OS
Date: Mon, 20 Feb 2017 16:12:37 -0500

Building current Git on z/OS fails with

source='/u/username/testdir/gltests/test-lock.c' object='test-lock.o' 
libtool=no \
DEPDIR=.deps depmode=aix /bin/sh /u/username/testdir/build-aux/depcomp \
xlc-wrap -DHAVE_CONFIG_H -DEXEEXT=\"\" -I. -I/u/username/testdir/gltests -I..  
-DGNULIB_STRICT_CHECKING=1 -DIN_GNULIB_TESTS=1 -I. 
-I/u/username/testdir/gltests -I.. -I/u/username/testdir/gltests/.. -I../gllib 
-I/u/username/testdir/gltests/../gllib -D_XOPEN_SOURCE=600 -DNSIG=39 
-qhaltonmsg=CCN3296  -g -qfloat=ieee -qlanglvl=extc99  -c -o test-lock.o 
/u/username/testdir/gltests/test-lock.c
ERROR CCN3296 /u/username/testdir/gltests/test-lock.c:110   #include file 
<semaphore.h> not found.
ERROR CCN3046 /u/username/testdir/gltests/test-lock.c:147   Syntax error.
ERROR CCN3278 /u/username/testdir/gltests/test-lock.c:148   The structure 
definition must specify a member list.
[...]


The problem may be found in test-lock.c:

    #if USE_POSIX_THREADS
    /* Whether to use a semaphore to communicate information between threads.
       If set to 0, a lock is used. If set to 1, a semaphore is used.
       Uncomment this to reduce the dependencies of this test.  */
    # define USE_SEMAPHORE 1
    #endif

    ...

    #include "glthread/thread.h"
    #include "glthread/yield.h"
    #if USE_SEMAPHORE
    # include <errno.h>
    # include <semaphore.h>
    #endif

$ ls /usr/include/semaphore.h
ls: FSUM6785 File or directory "/usr/include/semaphore.h" is not found

z/OS has POSIX threads (and pthread.h), but there is no semaphore.h
header. The sem_*() functions do not appear to exist on this platform.

I worked around this with a quick-and-dirty "#if defined(__MVS__)", but
a better fix may be to use HAVE_SEMAPHORE_H.


--Daniel


-- 
Daniel Richard G. || address@hidden
My ASCII-art .sig got a bad case of Times New Roman.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]