Messages in this thread Patch in this message | | | Subject | SEMMSL (from older code...) | Date | Tue, 14 Sep 1999 01:19:25 -0400 | From | "Marty Leisner" <> |
| |
This is a conversation I had with the bplay author...is there a way to get SEMMSL at runtime? How do I include headers to get it in userspace?
thanks...
marty ------- Forwarded Message
To: davidm@cs.usyd.edu.au Subject: how do I compile an application that wants to use SEMMSL? Date: Mon, 13 Sep 1999 01:32:49 -0400 From: "Marty Leisner" <leisner@soyata.home>
I'm trying to compile bplay (with redhat 6.0).
I initially got: shmbuf.c:131: `SEMMSL' undeclared (first use in this function) shmbuf.c:131: (Each undeclared identifier is reported only once shmbuf.c:131: for each function it appears in.) shmbuf.c: In function `up': shmbuf.c:159: `SEMMSL' undeclared (first use in this function) shmbuf.c: In function `down': shmbuf.c:172: `SEMMSL' undeclared (first use in this function) shmbuf.c: In function `initsems': shmbuf.c:430: `SEMMSL' undeclared (first use in this function)
So I saw where it was defined (in linux/sem.h) so I thought I was being clever by adding: : leisner@soyata;rcsdiff -u shmbuf.c =================================================================== RCS file: shmbuf.c,v retrieving revision 1.1 diff -u -r1.1 shmbuf.c - --- shmbuf.c 1999/09/13 02:54:43 1.1 +++ shmbuf.c 1999/09/13 03:07:14 @@ -19,6 +19,9 @@ #include <sys/sem.h> #include <sys/shm.h> #include <sys/wait.h> +#ifndef SEMMSL +#include <linux/sem.h> +#endif Now I get: : leisner@soyata;make gcc -Wall -g -O2 -m486 -DUSEBUFFLOCK -DDEBUG -c shmbuf.c -o shmbuf.o In file included from /usr/include/linux/sem.h:4, from shmbuf.c:23: /usr/include/linux/ipc.h:6: warning: `IPC_PRIVATE' redefined /usr/include/bits/ipc.h:37: warning: this is the location of the previous definition /usr/include/linux/ipc.h:20: warning: `IPC_CREAT' redefined /usr/include/bits/ipc.h:26: warning: this is the location of the previous definition /usr/include/linux/ipc.h:21: warning: `IPC_EXCL' redefined /usr/include/bits/ipc.h:27: warning: this is the location of the previous definition /usr/include/linux/ipc.h:22: warning: `IPC_NOWAIT' redefined /usr/include/bits/ipc.h:28: warning: this is the location of the previous definition In file included from /usr/include/linux/sem.h:4, from shmbuf.c:23: /usr/include/linux/ipc.h:9: redefinition of `struct ipc_perm' In file included from shmbuf.c:23: /usr/include/linux/sem.h:23: redefinition of `struct semid_ds' /usr/include/linux/sem.h:35: redefinition of `struct sembuf' /usr/include/linux/sem.h:50: redefinition of `struct seminfo' Is SEMMSL something which is supposed to be in user space? I can't find a reference on it...(I ended up just using gcc -DSEMMSL=32 and it seemed to work...
It also seems to me this should be a runtime constant rather than a compile time constant?
I'd figure I'd bounce this off you before I query linux-kernel...
Marty Leisner leisner@rochester.rr.com
------- End of Forwarded Message (Message inbox:8156) Date: Mon, 13 Sep 1999 21:33:20 BST To: Marty Leisner <leisner@rochester.rr.com> From: David Monro <davidm@amberdata.demon.co.uk> Subject: Re: how do I compile an application that wants to use SEMMSL?
Return-Path: davidm@amberdata.demon.co.uk Delivery-Date: Mon Sep 13 21:05:37 1999 Return-Path: <davidm@amberdata.demon.co.uk> Sender: davidm@amberdata.demon.co.uk Reply-To: David Monro <davidm@amberdata.demon.co.uk> In-Reply-To: <199909130532.BAA04696@rochester.rr.com> MIME-Version: 1.0
Umm. Yes, the bplay code is very old (libc4 if I remeber rightly). Setting -DSEMMSL=32 is a good workaround for now. In fact you are right; these days it ought to be retreived at runtime, but I'm not sure I know how to do this. Maybe sysconf() or something. If you find a way, tell me :-)
I have nearly finished writing bplay2 which is a complete rewrite using posix threading rather than the old SYSV IPC mechanisms, but it isn't quite right yet.
Cheers,
David
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/
| |