Discussion:
spiped 1.2.0 patch
James Turner
2012-08-30 17:08:17 UTC
Permalink
I had to add stdint.h to spipe/pushbits.c before spipe would compile on
archlinux. uint8_t was returning unknown type without it. Thanks.
--
James Turner
***@calminferno.net
James Cook
2012-08-30 17:56:53 UTC
Permalink
I also had to add that header to get spipe to compile on Snow Leopard.
Additionally, I had to remove "-lrt" from the spipe(d) makefiles.
--
James
Colin Percival
2012-08-30 23:47:12 UTC
Permalink
Post by James Cook
I also had to add that header to get spipe to compile on Snow Leopard.
Additionally, I had to remove "-lrt" from the spipe(d) makefiles.
The "-lrt" removal is a known bug in OS X. (Last I heard, OpenBSD also
has the same bug). Normally -l<foo> means "link to the <foo> library",
but -lrt (and a few others) are required by POSIX to succeed even if the
library in question does not exist -- on some platforms (OS X included)
the functions normally provided in librt are instead merged into libc.
--
Colin Percival
Security Officer Emeritus, FreeBSD | The power to serve
Founder, Tarsnap | www.tarsnap.com | Online backups for the truly paranoid
James Turner
2012-08-30 20:31:35 UTC
Permalink
Post by James Turner
I had to add stdint.h to spipe/pushbits.c before spipe would compile on
archlinux. uint8_t was returning unknown type without it. Thanks.
On a somewhat related note, I did not need stdint.h on OpenBSD, but did
need to add sys/types.h to both spipe/main.c and spipe/pushbits.c as
sys/socket.h depends on it under OpenBSD.
--
James Turner
***@calminferno.net
Berk D. Demir
2012-08-30 22:34:31 UTC
Permalink
Post by James Turner
Post by James Turner
I had to add stdint.h to spipe/pushbits.c before spipe would compile on
archlinux. uint8_t was returning unknown type without it. Thanks.
On a somewhat related note, I did not need stdint.h on OpenBSD, but did
need to add sys/types.h to both spipe/main.c and spipe/pushbits.c as
sys/socket.h depends on it under OpenBSD.
uint8_t became a standard with C99 but it was used before the standard
was ratified. C99 compilers doesn't recognize uintX_t types but the
standard specifies 'stdint.h' for their definition.

'sys/types.h' in OpenBSD defines ``uint8_t'' as an ``__uint8_t'' which
will be typedef'd to appropriate type for the architecture in
'sys/arch/`uname -m`/include/_types.h'. For every architecture it is
typedef'd from ``unsigned char''.


For Mac OS X Mountain Lion, I also needed to include 'stdint.h' and
remove unconditional ``-lrt'' from LDADD. I'm guessing the
requirement for POSIX Realtime Extensions Library arose from
``clock_gettime'' which doesn't exists on Mac OS X but this case is
handled in 'lib/util/monoclock.c' and if CLOCK_MONOTONIC is not
defined, ``gettimeofday`` is used.

I submitted a pull request to Homebrew with a small patch for handling
'stdint.h' inclusion and '-lrt' removal.

Pull Request: https://github.com/mxcl/homebrew/pull/14576
Patch: https://raw.github.com/gist/3541617/e212734f3ff105f636ea6e225ad7c9d5cb0ce347/spiped-1.2.0-macosx-mountain-lion.patch
Colin Percival
2012-08-31 04:21:02 UTC
Permalink
Post by James Turner
On a somewhat related note, I did not need stdint.h on OpenBSD, but did
need to add sys/types.h to both spipe/main.c and spipe/pushbits.c as
sys/socket.h depends on it under OpenBSD.
This is a POSIX-compliance bug in OpenBSD: POSIX states that
Post by James Turner
The <sys/socket.h> header shall define the size_t and ssize_t types as described in <sys/types.h>.
(http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_socket.h.html)
--
Colin Percival
Security Officer Emeritus, FreeBSD | The power to serve
Founder, Tarsnap | www.tarsnap.com | Online backups for the truly paranoid
Colin Percival
2012-08-30 23:41:43 UTC
Permalink
Post by James Turner
I had to add stdint.h to spipe/pushbits.c before spipe would compile on
archlinux. uint8_t was returning unknown type without it. Thanks.
Oops. I'll be rolling a new spiped-1.2.1 release shortly with this fixed.
--
Colin Percival
Security Officer Emeritus, FreeBSD | The power to serve
Founder, Tarsnap | www.tarsnap.com | Online backups for the truly paranoid
Loading...