diff --git a/configure.ac b/configure.ac index d971996..c2a6542 100644 --- a/configure.ac +++ b/configure.ac @@ -65,10 +65,6 @@ case $system in AC_DEFINE(OS_FREEBSD,1,"") AC_MSG_RESULT(FreeBSD) ;; - AIX) - AC_DEFINE(OS_AIX,1,"") - AC_MSG_RESULT(AIX) - ;; *) AC_MSG_ERROR(unknown OS type: $system) ;; @@ -79,12 +75,7 @@ AC_ARG_WITH([static-libgcc], [AS_HELP_STRING([--with-static-libgcc],[build with static libgcc library])], [ AC_MSG_RESULT(yes) - if test "${system}" = "AIX"; then - LDFLAGS="${LDFLAGS} -static-libgcc -Wl,-bstatic -lstdc++ -Wl,-bdynamic -lsupc++" - else - LDFLAGS="${LDFLAGS} -static-libgcc -Wl,-static -lstdc++ -lsupc++" - - fi + LDFLAGS="${LDFLAGS} -static-libgcc -Wl,-static -lstdc++ -lsupc++" ], [AC_MSG_RESULT(no)]) diff --git a/man/stenc.rst b/man/stenc.rst index b89b1e6..49c7478 100644 --- a/man/stenc.rst +++ b/man/stenc.rst @@ -17,7 +17,7 @@ SYNOPSIS AVAILABILITY ============ -Linux, AIX +Linux DESCRIPTION =========== diff --git a/src/scsiencrypt.cpp b/src/scsiencrypt.cpp index 7aa571e..aed0c1e 100644 --- a/src/scsiencrypt.cpp +++ b/src/scsiencrypt.cpp @@ -39,13 +39,6 @@ GNU General Public License for more details. #elif defined(OS_FREEBSD) #include #define SCSI_TIMEOUT 5000 -#elif defined(OS_AIX) -#define _LINUX_SOURCE_COMPAT -#include -#include -#include -#include -#define SCSI_TIMEOUT 5 #else #error "OS type is not set" #endif @@ -322,52 +315,6 @@ bool SCSIExecute(std::string tapedrive, unsigned char *cmd_p, int cmd_len, } while (errno != 0 && retries <= RETRYCOUNT); sresult = cmdio.status; -#elif defined(OS_AIX) // AIX System - - errno = 0; - sg_fd = openx((char *)tapedevice, O_RDONLY, NULL, SC_DIAGNOSTIC); - if (!sg_fd || sg_fd == -1) { - std::cerr << "Could not open device '" << tapedevice << "'" << std::endl; - exit(EXIT_FAILURE); - } - - struct sc_iocmd cmdio; - memset(&cmdio, 0, sizeof(struct sc_iocmd)); - // copy the command bytes into the first part of the structure - memcpy(&cmdio.scsi_cdb, cmd_p, cmd_len); - cmdio.buffer = (char *)dxfer_p; - cmdio.timeout_value = SCSI_TIMEOUT; - cmdio.command_length = cmd_len; - cmdio.data_length = dxfer_len; - cmdio.status_validity = SC_SCSI_ERROR; - cmdio.flags = (cmd_to_device) ? B_WRITE : B_READ; - - retries = 0; - do { - errno = 0; - eresult = ioctl(sg_fd, STIOCMD, &cmdio); - sresult = (int)cmdio.scsi_bus_status; - if (eresult != 0) - ioerr = errno; - retries++; - } while (errno != 0 && retries <= RETRYCOUNT); - - if (sresult == SC_CHECK_CONDITION) { // get the sense data - - struct sc_iocmd scmdio; - memset(&scmdio, 0, sizeof(struct sc_iocmd)); - // copy the command bytes into the first part of the structure - memcpy(&scmdio.scsi_cdb, &scsi_sense_command, sizeof(scsi_sense_command)); - scmdio.buffer = (char *)sd; - scmdio.timeout_value = SCSI_TIMEOUT; - scmdio.command_length = sizeof(scsi_sense_command); - scmdio.data_length = sizeof(SCSI_PAGE_SENSE); - scmdio.status_validity = SC_SCSI_ERROR; - scmdio.flags = B_READ; - - errno = 0; - ioctl(sg_fd, STIOCMD, &scmdio); - } #else #error "OS type is not set" #endif @@ -474,10 +421,6 @@ bool moveTape(std::string tapeDevice, int count, bool dirForward) { mt_command.mt_op = (dirForward) ? MTFSR : MTBSR; mt_command.mt_count = count; ioctl(sg_fd, MTIOCTOP, &mt_command); -#elif defined(OS_AIX) - mt_command.st_op = (dirForward) ? MTFSR : MTBSR; - mt_command.st_count = count; - ioctl(sg_fd, STIOCTOP, &mt_command); #else #error "OS type is not set" #endif @@ -509,33 +452,6 @@ void readIOError(int err) { case EPERM: std::cerr << "You do not have privileges to do this. Are you root?\n"; break; -#ifdef OS_AIX - case EBADF: - std::cerr << "EBADF\n"; - break; - case EFAULT: - std::cerr << "EFAULT\n"; - break; - case EINTR: - std::cerr << "EINTR\n"; - break; - case EINVAL: - std::cerr << "Invalid device.\n"; - break; - - case ENOTTY: - std::cerr << "ENOTTY\n"; - break; - - case ENODEV: - std::cerr << "Device is not responding.\n"; - break; - - case ENXIO: - std::cerr << "ENXIO\n"; - break; - -#endif default: if (errno != 0) { std::cerr << "0x" << std::hex << errno << " " << strerror(errno) << "\n";