1 2 /* os-netbsd.h 3 Operating system specific libburn definitions and declarations. Included 4 by os.h in case of compilation for 5 NetBSD 6 or OpenBSD 5.9 6 with MMC transport adapter sg-netbsd.c 7 8 Copyright (C) 2010 - 2016 Thomas Schmitt <scdbackup@gmx.net> 9 provided under GPLv2+ 10 11 Derived 2014 from libburn/os-solaris.c 12 Adapted 2016 to OpenBSD by help of SASANO Takayoshi <uaa@mx5.nisiq.net> 13 */ 14 15 16 /** List of all signals which shall be caught by signal handlers and trigger 17 a graceful abort of libburn. (See man signal.h) 18 */ 19 /* Once as system defined macros */ 20 #define BURN_OS_SIGNAL_MACRO_LIST \ 21 SIGHUP, SIGINT, SIGQUIT, SIGILL, SIGTRAP, \ 22 SIGABRT, SIGEMT, SIGFPE, SIGBUS, SIGSEGV, \ 23 SIGSYS, SIGPIPE, SIGALRM, SIGTERM, SIGXCPU, \ 24 SIGXFSZ, SIGVTALRM, SIGPROF, SIGUSR1, SIGUSR2 25 26 /* Once as text 1:1 list of strings for messages and interpreters */ 27 #define BURN_OS_SIGNAL_NAME_LIST \ 28 "SIGHUP", "SIGINT", "SIGQUIT", "SIGILL", "SIGTRAP", \ 29 "SIGABRT", "SIGEMT", "SIGFPE", "SIGBUS", "SIGSEGV", \ 30 "SIGSYS", "SIGPIPE", "SIGALRM", "SIGTERM", "SIGXCPU", \ 31 "SIGXFSZ", "SIGVTALRM", "SIGPROF", "SIGUSR1", "SIGUSR2" 32 33 /* The number of above list items */ 34 #define BURN_OS_SIGNAL_COUNT 20 35 36 #ifdef __OpenBSD__ 37 38 /** To list all signals which shall surely not be caught */ 39 #define BURN_OS_NON_SIGNAL_MACRO_LIST \ 40 SIGKILL, SIGURG, SIGSTOP, SIGTSTP, SIGCONT, \ 41 SIGCHLD, SIGTTIN, SIGTTOU, SIGIO, SIGWINCH, \ 42 SIGINFO 43 44 /* The number of above list items */ 45 #define BURN_OS_NON_SIGNAL_COUNT 11 46 47 /* ts B60730 */ 48 /* Either OpenBSD or SASANO Takayoshi's LG BH14NS48 throw 2,0,0 49 on Immed bit with BLANK and SYNCHRONIZE CACHE. 50 Until it is clear that the drive is to blame, the OpenBSD default is 51 not to use Immed. 52 53 This may be overridden at ./configure time by 54 export CFLAGS 55 CFLAGS="$CFLAGS -DLibburn_do_no_immed_defaulT=0" 56 */ 57 #ifndef Libburn_do_no_immed_defaulT 58 #define Libburn_do_no_immed_defaulT 1 59 #endif 60 61 #else /* __OpenBSD__ */ 62 63 /** To list all signals which shall surely not be caught */ 64 #define BURN_OS_NON_SIGNAL_MACRO_LIST \ 65 SIGKILL, SIGURG, SIGSTOP, SIGTSTP, SIGCONT, \ 66 SIGCHLD, SIGTTIN, SIGTTOU, SIGIO, SIGWINCH, \ 67 SIGINFO, SIGPWR 68 69 /* The number of above list items */ 70 #define BURN_OS_NON_SIGNAL_COUNT 12 71 72 #endif /* ! __OpenBSD__ */ 73 74 /* The maximum size for a (SCSI) i/o transaction */ 75 /* Important : MUST be at least 32768 ! */ 76 /* My Blu-ray burner LG GGW-H20 writes junk if stream recording is combined 77 with buffer size 32 kB. So stream recording is allowed only with size 64k. 78 */ 79 /* >>> ??? Does it do 64 kB ? */ 80 #define BURN_OS_TRANSPORT_BUFFER_SIZE 65536 81 82 83 /* To hold the position of the most recently delivered address from 84 device enumeration. 85 */ 86 struct burn_drive_enumerator_struct { 87 int cdno; 88 }; 89 90 #define BURN_OS_DEFINE_DRIVE_ENUMERATOR_T \ 91 typedef struct burn_drive_enumerator_struct burn_drive_enumerator_t; 92 93 94 /* The list of operating system dependent elements in struct burn_drive. 95 Usually they are initialized in sg-*.c:enumerate_common(). 96 */ 97 #define BURN_OS_TRANSPORT_DRIVE_ELEMENTS \ 98 int fd; 99 100