aboutsummaryrefslogtreecommitdiff
path: root/include/sg_lib.h
diff options
context:
space:
mode:
authorDouglas Gilbert <dgilbert@interlog.com>2018-02-04 21:44:28 +0000
committerDouglas Gilbert <dgilbert@interlog.com>2018-02-04 21:44:28 +0000
commit9fe92189ee2e0769daaefccf68d3fabff62b4f6b (patch)
treefc953c05ae1c6481008e3ab29b083cb4d74f14bb /include/sg_lib.h
parenta89cc910e28cbdebc01e2414bc47bcc9a163c7df (diff)
downloadsg3_utils-9fe92189ee2e0769daaefccf68d3fabff62b4f6b.tar.gz
add sg_convert_errno() and sg_if_can2stderr(); work on NVMe support for Win32; add REPORT SUPPORTED OPCODES+TMFs to SNTL
git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@749 6180dd3e-e324-4e3e-922d-17de1ae2f315
Diffstat (limited to 'include/sg_lib.h')
-rw-r--r--include/sg_lib.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/sg_lib.h b/include/sg_lib.h
index 1b3d4794..bc93d49e 100644
--- a/include/sg_lib.h
+++ b/include/sg_lib.h
@@ -357,6 +357,14 @@ void sg_print_scsi_status(int scsi_status);
void sg_print_sense(const char * leadin, const unsigned char * sense_buffer,
int sb_len, bool raw_info);
+/* Following examines exit_status and outputs a clear error message to
+ * warnings_strm (usually stderr) if one is known and returns true.
+ * Otherwise it doesn't print anything and returns false. Note that if
+ * exit_status==0 then returns true but prints nothing and if
+ * exit_status<0 ("some error occurred") false is returned. If leadin is
+ * non-NULL is will be printed before error message. */
+bool sg_if_can2stderr(const char * leadin, int exit_status);
+
/* Utilities can use these exit status values for syntax errors and
* file (device node) problems (e.g. not found or permissions). */
#define SG_LIB_SYNTAX_ERROR 1 /* command line syntax problem */
@@ -570,6 +578,11 @@ uint8_t * sg_memalign(uint32_t num_bytes, uint32_t align_to,
/* Returns OS page size in bytes. If uncertain returns 4096. */
uint32_t sg_get_page_size(void);
+/* If os_err_num is within bounds then the returned value is 'os_err_num +
+ * SG_LIB_OS_BASE_ERR' otherwise -1 is returned. If os_err_num is 0 then 0
+ * is returned. */
+int sg_convert_errno(int os_err_num);
+
/* <<< Architectural support functions [is there a better place?] >>> */