On Mac OS X (and probably the other BSD's too), the ioctl() syscall takes an 'unsigned long' integer as the request parameter. On 64bit systems this is a 64bit type, while on 32bit systems it's a 32bit type. Some of the request constants are defined as 32 bit negative numbers. Casting it to a 64bit value will perform a sign extension operation to preserve the negative value. Because this results in a different request code when interpreted as an unsigned integer, the ioctl() call fails with ENOTTY. For example TIOCMBIS is defined as 0x8004746c and becomes 0xffffffff8004746 after the sign extension. Linux 64bit is unaffected by this problem. None of the request constants has the sign bit set, and thus the sign extension has no effect. For example TIOCMBIS is defined as 0x5416. By using an unsigned integer type, the sign extension can be avoided. We use the 'unsigned long' type in case one of the request constants happens to be defined as a 64bit number.
Overview ======== Libdivecomputer is a cross-platform and open source library for communication with dive computers from various manufacturers. The official web site is: http://www.divesoftware.org/libdc/ The sourceforge project page is: http://sourceforge.net/projects/libdivecomputer/ Installation ============ On UNIX-like systems (including Linux, Mac OS X, MinGW), use the autotools based build system. Run the following commands from the top directory (containing this file) to configure, build and install the library and utilities: $ ./configure $ make $ make install If you downloaded the libdivecomputer source code directly from the git source code repository, then you need to create the configure script as the first step: $ autoreconf --install To uninstall libdivecomputer again, run: $ make uninstall Support ======= Please send bug reports, feedback or questions to the mailing list: https://lists.sourceforge.net/lists/listinfo/libdivecomputer-devel or contact me directly: jefdriesen@hotmail.com License ======= Libdivecomputer is free software, released under the terms of the GNU Lesser General Public License (LGPL). You can find a copy of the license in the file COPYING.
Description
Languages
C
98.3%
M4
1.2%
Makefile
0.5%