Ticket #520 (new task)

Opened 6 years ago

Last modified 6 years ago

transport.c for Linux does not use Posix Shared Memory calls

Reported by: paulf Owned by: somebody
Priority: major Milestone: Linux
Component: ALL modules Version:
Keywords: Cc:

Description

It appears that the Linux unix/transport.c has a compile time flag for using POSIX Shared memory _USE_POSIX_SHM that has never been turned on or even tested. Thus the shared memory on Linux systems still uses old style shared memory as it was developed on Solaris....

This needs to be tested on a Linux system. I am not sure if this is something we want to muck with before the 7.8 release gets tagged and bundled however.....

Change History

comment:1 Changed 6 years ago by et

What I found is that 'transport.c' doesn't compile (under Linux) when "_USE_POSIX_SHM" is defined. Firstly, the "src/libsrc/unix/makefile.unix" file does not use the GLOBALFLAGS symbol, so modifying it has no effect. When I add "-D_USE_POSIX_SHM" to that makefile, the build fails with the output below. So, it looks to me like this has never really been used in Earthworm.

[et@love unix]$ make -f makefile.unix
/usr/bin/gcc -g -c -m32 -Dlinux -D__i386 -D_LINUX -D_INTEL -D_USE_SCHED  -D_USE_PTHREADS -D_USE_TERMIOS -I/home/et/ewtst/earthworm_svn/include -D_USE_POSIX_SHM transport.c
transport.c: In function 'tport_create':
transport.c:142: error: 'MAP_AUTOGROW' undeclared (first use in this function)
transport.c:142: error: (Each undeclared identifier is reported only once
transport.c:142: error: for each function it appears in.)
transport.c:216: warning: assignment makes integer from pointer without a cast
transport.c: In function 'tport_destroy':
transport.c:245: warning: passing argument 1 of 'sem_close' makes pointer from integer without a cast
/usr/include/semaphore.h:46: note: expected 'union sem_t *' but argument is of type 'long int'
transport.c: In function 'tport_attach':
transport.c:335: error: 'MAP_AUTOGROW' undeclared (first use in this function)
transport.c:365: warning: assignment makes integer from pointer without a cast
transport.c: In function 'tport_putmsg':
transport.c:477: warning: passing argument 1 of 'sem_wait' makes pointer from integer without a cast
/usr/include/semaphore.h:55: note: expected 'union sem_t *' but argument is of type 'long int'
transport.c:588: warning: passing argument 1 of 'sem_post' makes pointer from integer without a cast
/usr/include/semaphore.h:70: note: expected 'union sem_t *' but argument is of type 'long int'
transport.c: In function 'tport_doFlagOp':
transport.c:966: warning: passing argument 1 of 'sem_wait' makes pointer from integer without a cast
/usr/include/semaphore.h:55: note: expected 'union sem_t *' but argument is of type 'long int'
transport.c:1093: warning: passing argument 1 of 'sem_post' makes pointer from integer without a cast
/usr/include/semaphore.h:70: note: expected 'union sem_t *' but argument is of type 'long int'
transport.c: In function 'tport_copyto':
transport.c:1742: warning: passing argument 1 of 'sem_wait' makes pointer from integer without a cast
/usr/include/semaphore.h:55: note: expected 'union sem_t *' but argument is of type 'long int'
transport.c:1822: warning: passing argument 1 of 'sem_post' makes pointer from integer without a cast
/usr/include/semaphore.h:70: note: expected 'union sem_t *' but argument is of type 'long int'
make: *** [transport.o] Error 1

Looks like 'MAP_AUTOGROW' is a non-standard flag. http://linux.die.net/man/2/mmap http://menehune.opt.wfu.edu/Kokua/More_SGI/007-2478-008/sgi_html/ch01.html

The mismatched parameters generating the warnings just look wrong.

--ET

Note: See TracTickets for help on using tickets.