help-rcs
[Top][All Lists]
Advanced

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

Compiling on dynix/ptx sysv4


From: Udcsweb2
Subject: Compiling on dynix/ptx sysv4
Date: Wed, 13 Mar 2002 12:06:55 +0200

Hi.
 
I am currently trying to compile rcs on a Sequent Dynix/ptx 4.4.8 SysV4 machine.  After running configure, I run make in the src dir, and it bombs with error after the following line:
 
./conf.sh: configuring has_map_fd, has_mmap, has_madvise, mmap_signal ... make[1]: *** [conf.h] Error 1
 
Looking in conf.err I find this:
 
+ echo ./conf.sh: configuring has_map_fd, has_mmap, has_madvise, mmap_signal ... \c
+ rm -f a.c a.d a.e
+ cat
#define CHAR1 '#' /* the first character in this file */
#include "a.h"
static char *a;
static struct stat b;
#ifndef MADVISE_OK
#define MADVISE_OK (madvise(a,b.st_size,MADV_SEQUENTIAL)==0 && madvise(a,b.st_size,MADV_NORMAL)==0)
#endif
#ifndef WTERMSIG
#define WTERMSIG(s) ((s)&0177)
#undef WIFSIGNALED /* Avoid 4.3BSD incompatibility with Posix.  */
#endif
#ifndef WIFSIGNALED
#define WIFSIGNALED(s) (((s)&0377) != 0177  &&  WTERMSIG(s) != 0)
#endif
#ifndef MAP_FAILED
#define MAP_FAILED (-1)
#endif
#ifndef STDIN_FILENO
#define STDIN_FILENO 0
#endif
int
main(argc, argv) int argc; char **argv; {
    int s = 0;
#if TRY_MAP_FD
    kern_return_t kr;
    vm_address_t va;
#endif

    if (fstat(STDIN_FILENO, &b) != 0) {
        perror("fstat");
        exitmain(1);
    }
#    if TRY_MAP_FD
        kr = map_fd(STDIN_FILENO, 0, &va, TRUE, b.st_size);
        if (kr != KERN_SUCCESS) {
            mach_error("map_fd", kr);
            exitmain(1);
        }
        a = (char *) va;
#    else
        a = mmap(
            (char *)0, b.st_size, PROT_READ, MAP_SHARED,
            STDIN_FILENO, (off_t)0
        );
        if (a == (char *)MAP_FAILED) {
            perror("mmap");
            exitmain(1);
        }
        if (!MADVISE_OK) {
            perror("madvise");
            exitmain(1);
        }
#    endif
    if (*a != CHAR1)
        exitmain(1);
    if (1 < argc) {
        pid_t p, w;
        int f = creat(argv[1], 0);
        /*
        * Some buggy hosts yield ETXTBSY if you try to use creat
        * to truncate a file that is mmapped.  On such hosts,
        * don't bother to try to figure out what mmap_signal is.
        */
#        ifndef ETXTBSY
#            define ETXTBSY (-1)
#        endif
        if (f<0 ? errno!=ETXTBSY : close(f)!=0) {
            perror(argv[1]);
            exitmain(1);
        }
        if ((p = fork()) < 0) {
            perror("fork");
            exitmain(1);
        }
        if (!p)
            /* Refer to nonexistent storage, causing a signal in the child.  */
            _exit(a[0] != 0);
        while ((w = wait(&s)) != p)
            if (w < 0) {
                perror("wait");
                exitmain(1);
            }
        s = WIFSIGNALED(s) ? WTERMSIG(s) : 0;
    }
#    if TRY_MAP_FD
        kr = vm_deallocate(task_self(), va, (vm_size_t) b.st_size);
        if (kr != KERN_SUCCESS) {
            mach_error("vm_deallocate", kr);
            exitmain(1);
        }
#    else
        if (munmap(a, b.st_size)  !=  0) {
            perror("munmap");
            exitmain(1);
        }
#    endif
    if (1 < argc) {
#        ifdef SIGBUS
            if (s == SIGBUS) { printf("SIGBUS\n"); s = 0; }
#        endif
#        ifdef SIGSEGV
            if (s == SIGSEGV) { printf("SIGSEGV\n"); s = 0; }
#        endif
        if (s) printf("%d\n", s);
    }
    exitmain(ferror(stdout) || fclose(stdout)!=0);
}
+ sleep 2
+ cp a.c a.d
+ sleep 2
mmap_signal= has_madvise=? has_mmap=? has_map_fd=?
+ rm -f ./a.out
+ cc -Dhas_conf_h -I. -I. -g -o a.out -DTRY_MAP_FD=1 a.c
"a.c", line 25: undefined symbol: kern_return_t
"a.c", line 25: syntax error before or at: kr
"a.c", line 26: undefined symbol: vm_address_t
"a.c", line 34: undefined symbol: kr
"a.c", line 34: undefined symbol: va
"a.c", line 35: undefined symbol: KERN_SUCCESS
"a.c", line 86: undefined symbol: vm_size_t
"a.c", line 86: syntax error before or at: b
has_madvise=0 has_mmap=0 has_map_fd=0
+ cc -Dhas_conf_h -I. -I. -g -o a.out -DMADVISE_OK=1 a.c
+ ./a.out
+ ls -t a.c a.d
has_mmap=1
+ rm -f a.ous
+ mv ./a.out a.ous
+ rm -f ./a.out
+ cc -Dhas_conf_h -I. -I. -g -o a.out a.c
+ ./a.out
has_madvise=1
+ rm -f a.ous
+ rm -f a.e
+ cp a.c a.e
+ ./a.out a.e
a.e: Device busy
mmap_signal=
+ exit
Any Ideas?

reply via email to

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