From owner-freebsd-hackers Wed Mar 20 13:11: 2 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from dastardly.newsbastards.org.72.27.172.IN-addr.ARPA.NetScum.dyndns.dk (pop-be-15-1-dialup-238.freesurf.ch [194.230.14.238]) by hub.freebsd.org (Postfix) with ESMTP id 37E6F37B405 for ; Wed, 20 Mar 2002 13:09:47 -0800 (PST) Received: from beerswilling.netscum.dyndns.dk (dcf77-zeit.netscum.dyndns.dk [172.27.72.27] (may be forged)) by dastardly.newsbastards.org.72.27.172.IN-addr.ARPA.NetScum.dyndns.dk (8.11.6/8.11.6) with ESMTP id g2KJ72J03930 (using TLSv1/SSLv3 with cipher EDH-RSA-DES-CBC3-SHA (168 bits) verified FAIL); Wed, 20 Mar 2002 20:07:05 +0100 (CET) (envelope-from bounce@netscum.dyndns.dk) Received: (from root@localhost) by beerswilling.netscum.dyndns.dk (8.11.6/8.11.6) id g2KJ71R03929; Wed, 20 Mar 2002 20:07:01 +0100 (CET) (envelope-from bounce@netscum.dyndns.dk) Date: Wed, 20 Mar 2002 20:07:01 +0100 (CET) Message-Id: <200203201907.g2KJ71R03929@beerswilling.netscum.dyndns.dk> From: BOUWSMA Beery To: hackers@freebsd.org Subject: Re: How to correctly detect POSIX 1003.1b features on FreeBSD? Cc: jonathan@buzzard.org.uk (Jonathan Buzzard) References: <20020312140904.A799@bbn.com> <3C8E742C.7C2E63B8@mindspring.com> <20020312193514.A2226@bbn.com> <20020313005940.GB32410@elvis.mu.org> <20020312201314.A2345@bbn.com> <3C8EB31E.19382903@mindspring.com> <20020312214007.A2526@bbn.com> Organization: Men not wearing any pants that dont shave X-Hacked: via telnet to your port 25, what else? X-Internet-Access-Provided-By: Slow Dial-in Modem X-NetScum: Yes X-One-And-Only-Real-True-Fluffy: No Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG [replies sent directly to me may timeout and bounce, since I'm not online as often as I should be, but I'll check the list archives] I've followed this with interest, because I'm playing with some Linux k0deZ which makes calls to m(un)lockall() that are similarly wrapped in sys/mman.h by | #ifdef _P1003_1B_VISIBLE | int mlockall __P((int)); | int munlockall __P((void)); | int shm_open __P((const char *, int, mode_t)); | int shm_unlink __P((const char *)); | #endif /* _P1003_1B_VISIBLE */ [...] > > When (if) the feature is ever actuallysupported by FreeBSD, > > the manifest constant _POSIX_REALTIME_SIGNALS will be > > defined. > Ahh! OK, this is the information that I am most interested in. > So, I am now confident to re-write the test in ACE to: > > #ifdef _POSIX_REALTIME_SIGNALS > > /* use sigqueue(), etc. */ > > #endif > > This test will work for ACE users on older and newer versions of FreeBSD, > and when POSIX RT signals are fully implemented on FreeBSD, ACE will use > them. Anyway, when compiling this Linux program, which has lines | /* lock all memory pages */ | if (mlockall(MCL_CURRENT | MCL_FUTURE) !=0) | syslog(LOG_INFO, "error unable to lock memory pages"); and | syslog(LOG_INFO, "Exiting..."); | unlink(PID_FILE); | munlockall(); linking fails... radioclkd.o: In function `Catch': radioclkd.o(.text+0xb3b): undefined reference to `munlockall' radioclkd.o: In function `main': radioclkd.o(.text+0xfeb): undefined reference to `mlockall' *** Error code 1 First question: Are mlockall() and munlockall() supported by FreeBSD (tested with 4.5-stable above), and if so, what needs to be defined as the magic incantation to be able to use them as above? Of course, given that the vm_mmap.c k0deZ for mlockall() looks like | int | mlockall(p, uap) | struct proc *p; | struct mlockall_args *uap; | { | return 0; | } this is probably more an exercise in proper programming for the moment... Secondly, if these calls aren't supported, what test, if not the #ifdef _POSIX_REALTIME_SIGNALS test mentioned in the earlier thread above, needs to be wrapped around the source k0deZ so that FreeBSD goes to some alternate code, while Linux executes the above m(un)lockall() calls, until FreeBSD does support these calls? thanks, barry bouwsma To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message