dma icon indicating copy to clipboard operation
dma copied to clipboard

Buildfix for dma on SunOS

Open drscream opened this issue 9 years ago • 4 comments

To build dma on SunOS (tested on SmartOS) it's required to rename existing queue struct to dma_queue (or anything else). To decrease the warnings I also included strings.h for the bzero and bcopy function. The sys/sysmacros.h include is required for the roundup function.

The following additional LDFLAGS are required on SunOS. I'm not sure how to reflect that in your Makefile:

-lsocket -lnsl

This should hopefully fix #1.

drscream avatar Feb 24 '16 07:02 drscream

Why can't an application use the identifier queue? Can you point me to a relevant header?

corecode avatar Feb 24 '16 09:02 corecode

If I'm correct it's the stream.h (/usr/include/sys/stream.h) which already uses queue. It's mostly also described in #1 and I know it's mostly one of the easiest solution to rename the struct ;-)

In file included from crypto.c:45:0:
dma.h:121:8: error: redefinition of 'struct queue'
 struct queue {
        ^
In file included from /usr/include/netinet/in.h:68:0,
                 from /usr/include/sys/socket.h:57,
                 from dma.h:42,
                 from crypto.c:45:
/usr/include/sys/stream.h:112:16: note: originally defined here
 typedef struct queue {
                ^

drscream avatar Feb 24 '16 09:02 drscream

I've got a patch for illumos that does the same (renames struct queue to dma_queue) and does a bit more as well (bcopy -> memmove, bzero -> memset)

drscream: is this against Solaris 11? I take it that Solaris 11 introduced lockf() recently?

My diff is here: http://elemental.org/webrevs/dma-illumos-port.patch

daleghent avatar Feb 26 '16 22:02 daleghent

@daleghent it's only tested with pkgsrc on SmartOS (illumos distribution).

drscream avatar Feb 28 '16 12:02 drscream